Skip to content

Commit 27211f0

Browse files
committed
Merge branch 'master' into release
2 parents b70cdd6 + efa8f04 commit 27211f0

File tree

307 files changed

+10183
-11324
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

307 files changed

+10183
-11324
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
node_modules/*
22
.idea/*
33
.vscode/*
4+
!.vscode/launch.json
45
devtools/temp
56
test/e2e/server/content/infinite-canvas.js
67
test/e2e/server/content/test-case/rhino.jpg

.vscode/launch.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Debug test",
11+
"skipFiles": [
12+
"<node_internals>/**"
13+
],
14+
"program": "${workspaceFolder}/node_modules/.bin/jest",
15+
"args": ["${fileBasenameNoExtension}", "--config","./test/jest.config.js"],
16+
"autoAttachChildProcesses": true,
17+
"windows": {
18+
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
19+
}
20+
}
21+
]
22+
}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var context = infiniteCanvas.getContext("2d");
2323
Include `InfiniteCanvas` in your web page:
2424

2525
```html
26-
<script src="https://cdn.jsdelivr.net/npm/[email protected].0-alpha/dist/infinite-canvas.js"></script>
26+
<script src="https://cdn.jsdelivr.net/npm/[email protected].1/dist/infinite-canvas.js"></script>
2727
```
2828

2929
or install it using npm:

babel.config.js

-20
This file was deleted.

dist/infinite-canvas.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/types/infinite-canvas-rendering-context-2d.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* This interface inherits all properties and methods from [`CanvasRenderingContext2D`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D)
33
*
44
* @remarks
5-
* `InfiniteCanvasRenderingContext2D` currently does **not** support [`getImageData()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/getImageData), [`createImageData()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createImageData), [`globalAlpha`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalAlpha), [`globalCompositeOperation`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation), [`isPointInPath()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/isPointInPath), [`isPointInStroke()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/isPointInStroke), [`filter`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/filter), [`imageSmoothingEnabled`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingEnabled), [`imageSmoothingQuality`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingQuality), [`lineJoin`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin), [`miterLimit`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/miterLimit), [`drawFocusIfNeeded()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawFocusIfNeeded) and [`scrollPathIntoView()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/scrollPathIntoView)
5+
* `InfiniteCanvasRenderingContext2D` currently does **not** support [`getImageData()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/getImageData), [`createImageData()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createImageData), [`isPointInPath()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/isPointInPath), [`isPointInStroke()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/isPointInStroke), [`drawFocusIfNeeded()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawFocusIfNeeded) and [`scrollPathIntoView()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/scrollPathIntoView)
66
*/
77
export interface InfiniteCanvasRenderingContext2D extends CanvasRenderingContext2D {
88
/**

docs/api/interfaces/InfiniteCanvasRenderingContext2D.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This interface inherits all properties and methods from [`CanvasRenderingContext
66

77
**`Remarks`**
88

9-
`InfiniteCanvasRenderingContext2D` currently does **not** support [`getImageData()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/getImageData), [`createImageData()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createImageData), [`globalAlpha`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalAlpha), [`globalCompositeOperation`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation), [`isPointInPath()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/isPointInPath), [`isPointInStroke()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/isPointInStroke), [`filter`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/filter), [`imageSmoothingEnabled`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingEnabled), [`imageSmoothingQuality`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingQuality), [`lineJoin`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin), [`miterLimit`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/miterLimit), [`drawFocusIfNeeded()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawFocusIfNeeded) and [`scrollPathIntoView()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/scrollPathIntoView)
9+
`InfiniteCanvasRenderingContext2D` currently does **not** support [`getImageData()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/getImageData), [`createImageData()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createImageData), [`isPointInPath()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/isPointInPath), [`isPointInStroke()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/isPointInStroke), [`drawFocusIfNeeded()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawFocusIfNeeded) and [`scrollPathIntoView()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/scrollPathIntoView)
1010

1111
## Hierarchy
1212

docs/dev/page/index.css

+8
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,12 @@ iframe{
5050
border: none;
5151
height: 100%;
5252
width: 100%;
53+
}
54+
.state-container button{
55+
margin-left: 5px;
56+
background-color: #1e1e1e;
57+
color: rgb(240, 240, 240);
58+
border: 1px solid rgb(240, 240, 240);
59+
cursor: pointer;
60+
border-radius: 2px;
5361
}

docs/dev/page/index.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<title>InfiniteCanvas in Stackblitz</title>
55
<link rel="stylesheet" type="text/css" href="index.css" />
6+
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"/>
67
<script src="https://unpkg.com/@stackblitz/sdk@1/bundles/sdk.umd.js"></script>
78
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/acorn.js"></script>
89
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
@@ -11,7 +12,7 @@
1112
</head>
1213
<body>
1314
<template id="projectStateTemplate">
14-
<div>{{message}}</div>
15+
<div class="state-container"><span>{{message}}</span><button v-on:click="reconnect" v-if="canReconnect"><i class="fa-solid fa-rotate-right"></i></button></div>
1516
</template>
1617
<template id="projectSelectorTemplate">
1718
<div>

docs/dev/page/index.js

+19-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import createDepTrees from './dep-trees.js'
22

33
console.log('hello from stackblitz page')
44

5-
const infCanvasUrl = 'https://cdn.jsdelivr.net/npm/[email protected].0-alpha/dist/infinite-canvas.js';
5+
const infCanvasUrl = 'https://cdn.jsdelivr.net/npm/[email protected].1/dist/infinite-canvas.js';
66

77
const stateType = {
88
initializing: 0,
@@ -210,6 +210,11 @@ function configureHeader(project, route, api){
210210
props: {
211211
projectstate: Object
212212
},
213+
methods: {
214+
reconnect(){
215+
project.connect();
216+
}
217+
},
213218
computed: {
214219
message(){
215220
if(!this.projectstate){
@@ -223,6 +228,9 @@ function configureHeader(project, route, api){
223228
case stateType.switching: return 'switching...'
224229
default: return 'state';
225230
}
231+
},
232+
canReconnect(){
233+
return this.projectstate && this.projectstate.type === stateType.disconnected;
226234
}
227235
}
228236
},
@@ -314,18 +322,22 @@ class EmbeddedProject{
314322
})
315323
this.stateDispatcher.setState({type: stateType.watching})
316324
}
325+
connect(){
326+
this.stateDispatcher.setState({type: stateType.waitForCompilation})
327+
getInfiniteCanvasCompilation(
328+
(script) => this.addInfiniteCanvas(script),
329+
() => {
330+
this.stateDispatcher.setState({type: stateType.disconnected})
331+
})
332+
}
317333
initialize(projectId, type){
318334
this.projectId = projectId;
319335
const watching = type === pageType.dev;
320336
this.infiniteCanvasReference = watching ? `./${infiniteCanvasFileName}` : 'ef-infinite-canvas';
321337
this.stateDispatcher.setState({type: stateType.initializing})
322338
this.embedPromise = this.embedProject(projectId, type);
323339
if(watching){
324-
getInfiniteCanvasCompilation(
325-
(script) => this.addInfiniteCanvas(script),
326-
() => {
327-
this.stateDispatcher.setState({type: stateType.disconnected})
328-
})
340+
this.connect()
329341
}
330342
}
331343
applyFsDiff(diff){
@@ -382,7 +394,7 @@ class EmbeddedProject{
382394
};
383395
if(!watching){
384396
projectConfig.dependencies = {
385-
"ef-infinite-canvas": "^0.6.0-alpha"
397+
"ef-infinite-canvas": "^0.6.1"
386398
};
387399
}
388400
const openOptions = this.getOpenOptions(type, files);

docs/dev/start.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ async function getTestCaseProjects(){
9898
})
9999
});
100100
return fileNames.map(fileName => {
101-
const withoutExtension = fileName.replace(/\.js$/g,'');
101+
const withoutExtension = fileName.replace(/\.mjs$/g,'');
102102
return {
103103
id: `test-cases/${withoutExtension}`,
104104
title: withoutExtension
@@ -120,7 +120,7 @@ function createApiRouter(){
120120
res.send('use-cases/simple')
121121
});
122122
router.get('/test-case/:testCaseId', async (req, res) => {
123-
const result = await readFileContent(path.resolve(testCaseDir, `${req.params.testCaseId}.js`));
123+
const result = await readFileContent(path.resolve(testCaseDir, `${req.params.testCaseId}.mjs`));
124124
res.send(result)
125125
})
126126
return router;

docs/getting-started.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Simply include it in your html
44

55
```html
6-
<script src="https://cdn.jsdelivr.net/npm/[email protected].0-alpha/dist/infinite-canvas.js"></script>
6+
<script src="https://cdn.jsdelivr.net/npm/[email protected].1/dist/infinite-canvas.js"></script>
77
```
88

99
or install it using npm:

0 commit comments

Comments
 (0)