Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
emilefokkema committed Apr 15, 2023
2 parents b70cdd6 + efa8f04 commit 27211f0
Show file tree
Hide file tree
Showing 307 changed files with 10,183 additions and 11,324 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules/*
.idea/*
.vscode/*
!.vscode/launch.json
devtools/temp
test/e2e/server/content/infinite-canvas.js
test/e2e/server/content/test-case/rhino.jpg
Expand Down
22 changes: 22 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug test",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["${fileBasenameNoExtension}", "--config","./test/jest.config.js"],
"autoAttachChildProcesses": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
}
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var context = infiniteCanvas.getContext("2d");
Include `InfiniteCanvas` in your web page:

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

or install it using npm:
Expand Down
20 changes: 0 additions & 20 deletions babel.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion dist/infinite-canvas.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/types/infinite-canvas-rendering-context-2d.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This interface inherits all properties and methods from [`CanvasRenderingContext2D`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D)
*
* @remarks
* `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)
* `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)
*/
export interface InfiniteCanvasRenderingContext2D extends CanvasRenderingContext2D {
/**
Expand Down
2 changes: 1 addition & 1 deletion docs/api/interfaces/InfiniteCanvasRenderingContext2D.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This interface inherits all properties and methods from [`CanvasRenderingContext

**`Remarks`**

`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)
`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)

## Hierarchy

Expand Down
8 changes: 8 additions & 0 deletions docs/dev/page/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,12 @@ iframe{
border: none;
height: 100%;
width: 100%;
}
.state-container button{
margin-left: 5px;
background-color: #1e1e1e;
color: rgb(240, 240, 240);
border: 1px solid rgb(240, 240, 240);
cursor: pointer;
border-radius: 2px;
}
3 changes: 2 additions & 1 deletion docs/dev/page/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<title>InfiniteCanvas in Stackblitz</title>
<link rel="stylesheet" type="text/css" href="index.css" />
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"/>
<script src="https://unpkg.com/@stackblitz/sdk@1/bundles/sdk.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/acorn.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
Expand All @@ -11,7 +12,7 @@
</head>
<body>
<template id="projectStateTemplate">
<div>{{message}}</div>
<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>
</template>
<template id="projectSelectorTemplate">
<div>
Expand Down
26 changes: 19 additions & 7 deletions docs/dev/page/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import createDepTrees from './dep-trees.js'

console.log('hello from stackblitz page')

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

const stateType = {
initializing: 0,
Expand Down Expand Up @@ -210,6 +210,11 @@ function configureHeader(project, route, api){
props: {
projectstate: Object
},
methods: {
reconnect(){
project.connect();
}
},
computed: {
message(){
if(!this.projectstate){
Expand All @@ -223,6 +228,9 @@ function configureHeader(project, route, api){
case stateType.switching: return 'switching...'
default: return 'state';
}
},
canReconnect(){
return this.projectstate && this.projectstate.type === stateType.disconnected;
}
}
},
Expand Down Expand Up @@ -314,18 +322,22 @@ class EmbeddedProject{
})
this.stateDispatcher.setState({type: stateType.watching})
}
connect(){
this.stateDispatcher.setState({type: stateType.waitForCompilation})
getInfiniteCanvasCompilation(
(script) => this.addInfiniteCanvas(script),
() => {
this.stateDispatcher.setState({type: stateType.disconnected})
})
}
initialize(projectId, type){
this.projectId = projectId;
const watching = type === pageType.dev;
this.infiniteCanvasReference = watching ? `./${infiniteCanvasFileName}` : 'ef-infinite-canvas';
this.stateDispatcher.setState({type: stateType.initializing})
this.embedPromise = this.embedProject(projectId, type);
if(watching){
getInfiniteCanvasCompilation(
(script) => this.addInfiniteCanvas(script),
() => {
this.stateDispatcher.setState({type: stateType.disconnected})
})
this.connect()
}
}
applyFsDiff(diff){
Expand Down Expand Up @@ -382,7 +394,7 @@ class EmbeddedProject{
};
if(!watching){
projectConfig.dependencies = {
"ef-infinite-canvas": "^0.6.0-alpha"
"ef-infinite-canvas": "^0.6.1"
};
}
const openOptions = this.getOpenOptions(type, files);
Expand Down
4 changes: 2 additions & 2 deletions docs/dev/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async function getTestCaseProjects(){
})
});
return fileNames.map(fileName => {
const withoutExtension = fileName.replace(/\.js$/g,'');
const withoutExtension = fileName.replace(/\.mjs$/g,'');
return {
id: `test-cases/${withoutExtension}`,
title: withoutExtension
Expand All @@ -120,7 +120,7 @@ function createApiRouter(){
res.send('use-cases/simple')
});
router.get('/test-case/:testCaseId', async (req, res) => {
const result = await readFileContent(path.resolve(testCaseDir, `${req.params.testCaseId}.js`));
const result = await readFileContent(path.resolve(testCaseDir, `${req.params.testCaseId}.mjs`));
res.send(result)
})
return router;
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Simply include it in your html

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

or install it using npm:
Expand Down
Loading

0 comments on commit 27211f0

Please sign in to comment.