-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
307 changed files
with
10,183 additions
and
11,324 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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> | ||
|
@@ -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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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, | ||
|
@@ -210,6 +210,11 @@ function configureHeader(project, route, api){ | |
props: { | ||
projectstate: Object | ||
}, | ||
methods: { | ||
reconnect(){ | ||
project.connect(); | ||
} | ||
}, | ||
computed: { | ||
message(){ | ||
if(!this.projectstate){ | ||
|
@@ -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; | ||
} | ||
} | ||
}, | ||
|
@@ -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){ | ||
|
@@ -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); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
Oops, something went wrong.