Spaces:
Runtime error
Runtime error
fix: background default and other glitches
Browse files- package-lock.json +7 -36
- package.json +1 -1
- public/js/utils.js +0 -6
- src/pages/live.tsx +1 -1
- src/services/api/index.ts +3 -3
package-lock.json
CHANGED
|
@@ -13,7 +13,6 @@
|
|
| 13 |
"@emotion/react": "11.10.6",
|
| 14 |
"@emotion/server": "11.10.0",
|
| 15 |
"@emotion/styled": "11.10.6",
|
| 16 |
-
"@monaco-editor/react": "4.5.0",
|
| 17 |
"@mui/icons-material": "5.11.16",
|
| 18 |
"@mui/material": "5.12.0",
|
| 19 |
"axios": "1.3.5",
|
|
@@ -31,6 +30,7 @@
|
|
| 31 |
},
|
| 32 |
"devDependencies": {
|
| 33 |
"@semantic-release/git": "^10.0.1",
|
|
|
|
| 34 |
"@types/react-syntax-highlighter": "^15.5.6",
|
| 35 |
"husky": "^8.0.3",
|
| 36 |
"prettier": "^2.8.7"
|
|
@@ -431,30 +431,6 @@
|
|
| 431 |
"resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz",
|
| 432 |
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA=="
|
| 433 |
},
|
| 434 |
-
"node_modules/@monaco-editor/loader": {
|
| 435 |
-
"version": "1.3.3",
|
| 436 |
-
"resolved": "https://registry.npmjs.org/@monaco-editor/loader/-/loader-1.3.3.tgz",
|
| 437 |
-
"integrity": "sha512-6KKF4CTzcJiS8BJwtxtfyYt9shBiEv32ateQ9T4UVogwn4HM/uPo9iJd2Dmbkpz8CM6Y0PDUpjnZzCwC+eYo2Q==",
|
| 438 |
-
"dependencies": {
|
| 439 |
-
"state-local": "^1.0.6"
|
| 440 |
-
},
|
| 441 |
-
"peerDependencies": {
|
| 442 |
-
"monaco-editor": ">= 0.21.0 < 1"
|
| 443 |
-
}
|
| 444 |
-
},
|
| 445 |
-
"node_modules/@monaco-editor/react": {
|
| 446 |
-
"version": "4.5.0",
|
| 447 |
-
"resolved": "https://registry.npmjs.org/@monaco-editor/react/-/react-4.5.0.tgz",
|
| 448 |
-
"integrity": "sha512-VJMkp5Fe1+w8pLEq8tZPHZKu8zDXQIA1FtiDTSNccg1D3wg1YIZaH2es2Qpvop1k62g3c/YySRb3bnGXu2XwYQ==",
|
| 449 |
-
"dependencies": {
|
| 450 |
-
"@monaco-editor/loader": "^1.3.3"
|
| 451 |
-
},
|
| 452 |
-
"peerDependencies": {
|
| 453 |
-
"monaco-editor": ">= 0.25.0 < 1",
|
| 454 |
-
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
| 455 |
-
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
| 456 |
-
}
|
| 457 |
-
},
|
| 458 |
"node_modules/@mui/base": {
|
| 459 |
"version": "5.0.0-alpha.125",
|
| 460 |
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.125.tgz",
|
|
@@ -1692,6 +1668,12 @@
|
|
| 1692 |
"dev": true,
|
| 1693 |
"peer": true
|
| 1694 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1695 |
"node_modules/@types/normalize-package-data": {
|
| 1696 |
"version": "2.4.1",
|
| 1697 |
"resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz",
|
|
@@ -5568,12 +5550,6 @@
|
|
| 5568 |
"node": ">=0.10.0"
|
| 5569 |
}
|
| 5570 |
},
|
| 5571 |
-
"node_modules/monaco-editor": {
|
| 5572 |
-
"version": "0.37.1",
|
| 5573 |
-
"resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.37.1.tgz",
|
| 5574 |
-
"integrity": "sha512-jLXEEYSbqMkT/FuJLBZAVWGuhIb4JNwHE9kPTorAVmsdZ4UzHAfgWxLsVtD7pLRFaOwYPhNG9nUCpmFL1t/dIg==",
|
| 5575 |
-
"peer": true
|
| 5576 |
-
},
|
| 5577 |
"node_modules/ms": {
|
| 5578 |
"version": "2.1.2",
|
| 5579 |
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
|
@@ -10679,11 +10655,6 @@
|
|
| 10679 |
"node": ">= 6"
|
| 10680 |
}
|
| 10681 |
},
|
| 10682 |
-
"node_modules/state-local": {
|
| 10683 |
-
"version": "1.0.7",
|
| 10684 |
-
"resolved": "https://registry.npmjs.org/state-local/-/state-local-1.0.7.tgz",
|
| 10685 |
-
"integrity": "sha512-HTEHMNieakEnoe33shBYcZ7NX83ACUjCu8c40iOGEZsngj9zRnkqS9j1pqQPXwobB0ZcVTk27REb7COQ0UR59w=="
|
| 10686 |
-
},
|
| 10687 |
"node_modules/stop-iteration-iterator": {
|
| 10688 |
"version": "1.0.0",
|
| 10689 |
"resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz",
|
|
|
|
| 13 |
"@emotion/react": "11.10.6",
|
| 14 |
"@emotion/server": "11.10.0",
|
| 15 |
"@emotion/styled": "11.10.6",
|
|
|
|
| 16 |
"@mui/icons-material": "5.11.16",
|
| 17 |
"@mui/material": "5.12.0",
|
| 18 |
"axios": "1.3.5",
|
|
|
|
| 30 |
},
|
| 31 |
"devDependencies": {
|
| 32 |
"@semantic-release/git": "^10.0.1",
|
| 33 |
+
"@types/node": "18.15.11",
|
| 34 |
"@types/react-syntax-highlighter": "^15.5.6",
|
| 35 |
"husky": "^8.0.3",
|
| 36 |
"prettier": "^2.8.7"
|
|
|
|
| 431 |
"resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz",
|
| 432 |
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA=="
|
| 433 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 434 |
"node_modules/@mui/base": {
|
| 435 |
"version": "5.0.0-alpha.125",
|
| 436 |
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.125.tgz",
|
|
|
|
| 1668 |
"dev": true,
|
| 1669 |
"peer": true
|
| 1670 |
},
|
| 1671 |
+
"node_modules/@types/node": {
|
| 1672 |
+
"version": "18.15.11",
|
| 1673 |
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz",
|
| 1674 |
+
"integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==",
|
| 1675 |
+
"dev": true
|
| 1676 |
+
},
|
| 1677 |
"node_modules/@types/normalize-package-data": {
|
| 1678 |
"version": "2.4.1",
|
| 1679 |
"resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz",
|
|
|
|
| 5550 |
"node": ">=0.10.0"
|
| 5551 |
}
|
| 5552 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5553 |
"node_modules/ms": {
|
| 5554 |
"version": "2.1.2",
|
| 5555 |
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
|
|
|
| 10655 |
"node": ">= 6"
|
| 10656 |
}
|
| 10657 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10658 |
"node_modules/stop-iteration-iterator": {
|
| 10659 |
"version": "1.0.0",
|
| 10660 |
"resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz",
|
package.json
CHANGED
|
@@ -42,7 +42,6 @@
|
|
| 42 |
"@emotion/react": "11.10.6",
|
| 43 |
"@emotion/server": "11.10.0",
|
| 44 |
"@emotion/styled": "11.10.6",
|
| 45 |
-
"@monaco-editor/react": "4.5.0",
|
| 46 |
"@mui/icons-material": "5.11.16",
|
| 47 |
"@mui/material": "5.12.0",
|
| 48 |
"axios": "1.3.5",
|
|
@@ -60,6 +59,7 @@
|
|
| 60 |
},
|
| 61 |
"devDependencies": {
|
| 62 |
"@semantic-release/git": "^10.0.1",
|
|
|
|
| 63 |
"@types/react-syntax-highlighter": "^15.5.6",
|
| 64 |
"husky": "^8.0.3",
|
| 65 |
"prettier": "^2.8.7"
|
|
|
|
| 42 |
"@emotion/react": "11.10.6",
|
| 43 |
"@emotion/server": "11.10.0",
|
| 44 |
"@emotion/styled": "11.10.6",
|
|
|
|
| 45 |
"@mui/icons-material": "5.11.16",
|
| 46 |
"@mui/material": "5.12.0",
|
| 47 |
"axios": "1.3.5",
|
|
|
|
| 59 |
},
|
| 60 |
"devDependencies": {
|
| 61 |
"@semantic-release/git": "^10.0.1",
|
| 62 |
+
"@types/node": "18.15.11",
|
| 63 |
"@types/react-syntax-highlighter": "^15.5.6",
|
| 64 |
"husky": "^8.0.3",
|
| 65 |
"prettier": "^2.8.7"
|
public/js/utils.js
CHANGED
|
@@ -50,12 +50,6 @@ function answer(window_, channel, targetOrigin = "*") {
|
|
| 50 |
}
|
| 51 |
|
| 52 |
function handleTemplate(template) {
|
| 53 |
-
for (let i = 1; i < 1_000; i++) {
|
| 54 |
-
window.clearInterval(i);
|
| 55 |
-
window.cancelAnimationFrame(i);
|
| 56 |
-
window.clearTimeout(i);
|
| 57 |
-
}
|
| 58 |
-
|
| 59 |
try {
|
| 60 |
Function("Template", `${template};`)();
|
| 61 |
} catch (error) {
|
|
|
|
| 50 |
}
|
| 51 |
|
| 52 |
function handleTemplate(template) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
try {
|
| 54 |
Function("Template", `${template};`)();
|
| 55 |
} catch (error) {
|
src/pages/live.tsx
CHANGED
|
@@ -11,7 +11,7 @@ const styles = (
|
|
| 11 |
height: 100%;
|
| 12 |
width: 100%;
|
| 13 |
overflow: hidden;
|
| 14 |
-
background:
|
| 15 |
}
|
| 16 |
#__next {
|
| 17 |
display: contents;
|
|
|
|
| 11 |
height: 100%;
|
| 12 |
width: 100%;
|
| 13 |
overflow: hidden;
|
| 14 |
+
background: #a9a9a9;
|
| 15 |
}
|
| 16 |
#__next {
|
| 17 |
display: contents;
|
src/services/api/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import { ChatCompletionRequestMessage, Configuration, OpenAIApi } from "openai";
|
| 2 |
import { nanoid } from "nanoid";
|
|
|
|
| 3 |
|
| 4 |
const configuration = new Configuration({
|
| 5 |
apiKey: process.env.OPENAI_API_KEY,
|
|
@@ -53,9 +54,8 @@ export async function toOpenAI({
|
|
| 53 |
{
|
| 54 |
role: "system",
|
| 55 |
content: miniPrompt`
|
| 56 |
-
All UPPERCASE words are IMPORTANT, all "UPPERCASE" words in QUOTES (") indicate KEYWORDS
|
| 57 |
-
You are
|
| 58 |
-
You are a Canvas-2d expert and performance guru.
|
| 59 |
You strictly follow all "DOCS".
|
| 60 |
You ALWAYS follow the "ADD", "REMOVE", "INPUT" and "OUTPUT FORMAT".
|
| 61 |
You NEVER explain anything.
|
|
|
|
| 1 |
import { ChatCompletionRequestMessage, Configuration, OpenAIApi } from "openai";
|
| 2 |
import { nanoid } from "nanoid";
|
| 3 |
+
import process from "node:process";
|
| 4 |
|
| 5 |
const configuration = new Configuration({
|
| 6 |
apiKey: process.env.OPENAI_API_KEY,
|
|
|
|
| 54 |
{
|
| 55 |
role: "system",
|
| 56 |
content: miniPrompt`
|
| 57 |
+
All UPPERCASE words are IMPORTANT, all "UPPERCASE" words in QUOTES (") indicate KEYWORDS.
|
| 58 |
+
You are: expert JavaScript Developer, creative, Canvas-2d expert, performance guru, interaction expert.
|
|
|
|
| 59 |
You strictly follow all "DOCS".
|
| 60 |
You ALWAYS follow the "ADD", "REMOVE", "INPUT" and "OUTPUT FORMAT".
|
| 61 |
You NEVER explain anything.
|