@dxos/plugin-script 0.6.13-staging.1e988a3 → 0.6.14-main.1366248
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/lib/browser/AutomationPanel-XLL2ZXGS.mjs +78 -0
- package/dist/lib/browser/AutomationPanel-XLL2ZXGS.mjs.map +7 -0
- package/dist/lib/browser/ScriptContainer-YXH4MFEO.mjs +415 -0
- package/dist/lib/browser/ScriptContainer-YXH4MFEO.mjs.map +7 -0
- package/dist/lib/browser/chunk-C7VBULMK.mjs +18 -0
- package/dist/lib/browser/chunk-C7VBULMK.mjs.map +7 -0
- package/dist/lib/browser/{chunk-RHEZ5LUU.mjs → chunk-G6H56WFS.mjs} +51 -2
- package/dist/lib/browser/{chunk-RHEZ5LUU.mjs.map → chunk-G6H56WFS.mjs.map} +4 -4
- package/dist/lib/browser/{chunk-DL5XQRQM.mjs → chunk-KHNN3F7J.mjs} +18 -6
- package/dist/lib/browser/chunk-KHNN3F7J.mjs.map +7 -0
- package/dist/lib/browser/chunk-NCZUJKJE.mjs +236 -0
- package/dist/lib/browser/chunk-NCZUJKJE.mjs.map +7 -0
- package/dist/lib/browser/{chunk-O4LWBX6A.mjs → chunk-USXWNH3S.mjs} +2 -2
- package/dist/lib/browser/{chunk-O4LWBX6A.mjs.map → chunk-USXWNH3S.mjs.map} +2 -2
- package/dist/lib/browser/edge/index.mjs +5 -1
- package/dist/lib/browser/index.mjs +185 -62
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node/AutomationPanel-OSPAFWZU.cjs +100 -0
- package/dist/lib/node/AutomationPanel-OSPAFWZU.cjs.map +7 -0
- package/dist/lib/node/ScriptContainer-FWHFEIHK.cjs +417 -0
- package/dist/lib/node/ScriptContainer-FWHFEIHK.cjs.map +7 -0
- package/dist/lib/node/{TypescriptEditor-M3WWFIP2.cjs → chunk-6LYX73ZT.cjs} +19 -8
- package/dist/lib/node/chunk-6LYX73ZT.cjs.map +7 -0
- package/dist/lib/node/{chunk-4GTXIELQ.cjs → chunk-ACLCRWDB.cjs} +44 -6
- package/dist/lib/node/chunk-ACLCRWDB.cjs.map +7 -0
- package/dist/lib/node/chunk-BJ4WIWCP.cjs +265 -0
- package/dist/lib/node/chunk-BJ4WIWCP.cjs.map +7 -0
- package/dist/lib/node/{chunk-5RBVXKXT.cjs → chunk-CPNHUAFN.cjs} +6 -6
- package/dist/lib/node/{chunk-5RBVXKXT.cjs.map → chunk-CPNHUAFN.cjs.map} +2 -2
- package/dist/lib/node/{chunk-PFH3ROEH.cjs → chunk-FY5KKL5N.cjs} +22 -8
- package/dist/lib/node/chunk-FY5KKL5N.cjs.map +7 -0
- package/dist/lib/node/edge/index.cjs +12 -8
- package/dist/lib/node/edge/index.cjs.map +2 -2
- package/dist/lib/node/index.cjs +196 -81
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.cjs +3 -3
- package/dist/lib/node/meta.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types/index.cjs +5 -5
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/AutomationPanel-KJNL6ARP.mjs +79 -0
- package/dist/lib/node-esm/AutomationPanel-KJNL6ARP.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptContainer-6U5WJFRB.mjs +416 -0
- package/dist/lib/node-esm/ScriptContainer-6U5WJFRB.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-2NPZGQGA.mjs +47 -0
- package/dist/lib/node-esm/chunk-2NPZGQGA.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DXWSRDEN.mjs +237 -0
- package/dist/lib/node-esm/chunk-DXWSRDEN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-LDLNTVAK.mjs +280 -0
- package/dist/lib/node-esm/chunk-LDLNTVAK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QMTTZYLF.mjs +255 -0
- package/dist/lib/node-esm/chunk-QMTTZYLF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SLTZMY34.mjs +20 -0
- package/dist/lib/node-esm/chunk-SLTZMY34.mjs.map +7 -0
- package/dist/lib/node-esm/edge/index.mjs +24 -0
- package/dist/lib/node-esm/index.mjs +415 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/meta.mjs +10 -0
- package/dist/lib/node-esm/meta.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +13 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +17 -0
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -0
- package/dist/types/src/components/AutomationPanel/index.d.ts +4 -0
- package/dist/types/src/components/AutomationPanel/index.d.ts.map +1 -0
- package/dist/types/src/components/DebugPanel/DebugPanel.d.ts +7 -0
- package/dist/types/src/components/DebugPanel/DebugPanel.d.ts.map +1 -0
- package/dist/types/src/components/DebugPanel/index.d.ts +2 -0
- package/dist/types/src/components/DebugPanel/index.d.ts.map +1 -0
- package/dist/types/src/components/{ScriptBlock/FrameContainer → FrameContainer}/FrameContainer.d.ts +1 -1
- package/dist/types/src/components/FrameContainer/FrameContainer.d.ts.map +1 -0
- package/dist/types/src/components/FrameContainer/frame.d.ts.map +1 -0
- package/dist/types/src/components/FrameContainer/index.d.ts.map +1 -0
- package/dist/types/src/components/ScriptBlock/ScriptBlock.d.ts +1 -3
- package/dist/types/src/components/ScriptBlock/ScriptBlock.d.ts.map +1 -1
- package/dist/types/src/components/ScriptBlock/ScriptBlock.stories.d.ts +3 -8
- package/dist/types/src/components/ScriptBlock/ScriptBlock.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScriptContainer.d.ts +5 -0
- package/dist/types/src/components/ScriptContainer.d.ts.map +1 -0
- package/dist/types/src/components/ScriptEditor.d.ts +4 -5
- package/dist/types/src/components/ScriptEditor.d.ts.map +1 -1
- package/dist/types/src/components/ScriptSettings/ScriptSettings.d.ts +6 -0
- package/dist/types/src/components/ScriptSettings/ScriptSettings.d.ts.map +1 -0
- package/dist/types/src/components/ScriptSettings/index.d.ts +2 -0
- package/dist/types/src/components/ScriptSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/ScriptSettingsPanel.d.ts +7 -0
- package/dist/types/src/components/ScriptSettingsPanel.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +23 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +14 -0
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/index.d.ts +2 -0
- package/dist/types/src/components/Toolbar/index.d.ts.map +1 -0
- package/dist/types/src/components/{TypescriptEditor.d.ts → TypescriptEditor/TypescriptEditor.d.ts} +1 -2
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -0
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +6 -0
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/TypescriptEditor/index.d.ts +2 -0
- package/dist/types/src/components/TypescriptEditor/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +4 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/edge/functions.d.ts +7 -0
- package/dist/types/src/edge/functions.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +5 -9
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/templates/chat.d.ts +6 -0
- package/dist/types/src/templates/chat.d.ts.map +1 -0
- package/dist/types/src/templates/chess.d.ts +6 -0
- package/dist/types/src/templates/chess.d.ts.map +1 -0
- package/dist/types/src/templates/echo.d.ts +6 -0
- package/dist/types/src/templates/echo.d.ts.map +1 -0
- package/dist/types/src/templates/email.d.ts +6 -0
- package/dist/types/src/templates/email.d.ts.map +1 -0
- package/dist/types/src/templates/forex.d.ts +6 -0
- package/dist/types/src/templates/forex.d.ts.map +1 -0
- package/dist/types/src/templates.d.ts +8 -0
- package/dist/types/src/templates.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +7 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/script.d.ts +4 -4
- package/dist/types/src/types/types.d.ts +4 -3
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/package.json +59 -64
- package/src/ScriptPlugin.tsx +47 -41
- package/src/bundler/bundler.test.ts +12 -2
- package/src/components/AutomationPanel/AutomationPanel.tsx +101 -0
- package/src/components/AutomationPanel/index.ts +9 -0
- package/src/components/{DebugPanel.tsx → DebugPanel/DebugPanel.tsx} +74 -96
- package/src/components/DebugPanel/index.ts +5 -0
- package/src/components/{ScriptBlock/FrameContainer → FrameContainer}/FrameContainer.tsx +1 -1
- package/src/components/ScriptBlock/ScriptBlock.stories.tsx +15 -14
- package/src/components/ScriptBlock/ScriptBlock.tsx +23 -51
- package/src/components/ScriptContainer.tsx +22 -0
- package/src/components/ScriptEditor.tsx +51 -62
- package/src/components/ScriptSettings/ScriptSettings.tsx +47 -0
- package/src/components/ScriptSettings/index.ts +5 -0
- package/src/components/ScriptSettingsPanel.tsx +105 -0
- package/src/components/Toolbar/Toolbar.stories.tsx +30 -0
- package/src/components/Toolbar/Toolbar.tsx +177 -0
- package/src/components/{ScriptBlock/Splitter → Toolbar}/index.ts +1 -1
- package/src/components/{TypescriptEditor.stories.tsx → TypescriptEditor/TypescriptEditor.stories.tsx} +17 -35
- package/src/components/{TypescriptEditor.tsx → TypescriptEditor/TypescriptEditor.tsx} +1 -3
- package/src/components/TypescriptEditor/index.ts +5 -0
- package/src/components/index.ts +6 -3
- package/src/edge/functions.ts +19 -0
- package/src/meta.ts +16 -0
- package/src/templates/chat.ts +102 -0
- package/src/templates/chess.ts +41 -0
- package/src/templates/echo.ts +15 -0
- package/src/templates/email.ts +38 -0
- package/src/templates/forex.ts +21 -0
- package/src/templates.ts +54 -0
- package/src/translations.ts +7 -0
- package/src/types/types.ts +9 -5
- package/dist/lib/browser/ScriptEditor-5Y3EROG3.mjs +0 -513
- package/dist/lib/browser/ScriptEditor-5Y3EROG3.mjs.map +0 -7
- package/dist/lib/browser/TypescriptEditor-GPE72Y6I.mjs +0 -9
- package/dist/lib/browser/chunk-DL5XQRQM.mjs.map +0 -7
- package/dist/lib/browser/chunk-JBACGDOJ.mjs +0 -21
- package/dist/lib/browser/chunk-JBACGDOJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-MRGOT5RF.mjs +0 -78
- package/dist/lib/browser/chunk-MRGOT5RF.mjs.map +0 -7
- package/dist/lib/node/ScriptEditor-YCUQFWQM.cjs +0 -526
- package/dist/lib/node/ScriptEditor-YCUQFWQM.cjs.map +0 -7
- package/dist/lib/node/TypescriptEditor-M3WWFIP2.cjs.map +0 -7
- package/dist/lib/node/chunk-4GTXIELQ.cjs.map +0 -7
- package/dist/lib/node/chunk-4VMNBXWU.cjs +0 -54
- package/dist/lib/node/chunk-4VMNBXWU.cjs.map +0 -7
- package/dist/lib/node/chunk-IMLDKD5Y.cjs +0 -111
- package/dist/lib/node/chunk-IMLDKD5Y.cjs.map +0 -7
- package/dist/lib/node/chunk-PFH3ROEH.cjs.map +0 -7
- package/dist/types/src/components/DebugPanel.d.ts +0 -9
- package/dist/types/src/components/DebugPanel.d.ts.map +0 -1
- package/dist/types/src/components/ScriptBlock/FrameContainer/FrameContainer.d.ts.map +0 -1
- package/dist/types/src/components/ScriptBlock/FrameContainer/frame.d.ts.map +0 -1
- package/dist/types/src/components/ScriptBlock/FrameContainer/index.d.ts.map +0 -1
- package/dist/types/src/components/ScriptBlock/Splitter/Splitter.d.ts +0 -15
- package/dist/types/src/components/ScriptBlock/Splitter/Splitter.d.ts.map +0 -1
- package/dist/types/src/components/ScriptBlock/Splitter/Splitter.stories.d.ts +0 -13
- package/dist/types/src/components/ScriptBlock/Splitter/Splitter.stories.d.ts.map +0 -1
- package/dist/types/src/components/ScriptBlock/Splitter/index.d.ts +0 -2
- package/dist/types/src/components/ScriptBlock/Splitter/index.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar.d.ts +0 -13
- package/dist/types/src/components/Toolbar.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar.stories.d.ts +0 -14
- package/dist/types/src/components/Toolbar.stories.d.ts.map +0 -1
- package/dist/types/src/components/TypescriptEditor.d.ts.map +0 -1
- package/dist/types/src/components/TypescriptEditor.stories.d.ts +0 -10
- package/dist/types/src/components/TypescriptEditor.stories.d.ts.map +0 -1
- package/src/components/ScriptBlock/Splitter/Splitter.stories.tsx +0 -37
- package/src/components/ScriptBlock/Splitter/Splitter.tsx +0 -52
- package/src/components/Toolbar.stories.tsx +0 -17
- package/src/components/Toolbar.tsx +0 -147
- package/src/meta.tsx +0 -19
- /package/dist/lib/{browser/TypescriptEditor-GPE72Y6I.mjs.map → node-esm/edge/index.mjs.map} +0 -0
- /package/dist/types/src/components/{ScriptBlock/FrameContainer → FrameContainer}/frame.d.ts +0 -0
- /package/dist/types/src/components/{ScriptBlock/FrameContainer → FrameContainer}/index.d.ts +0 -0
- /package/src/components/{ScriptBlock/FrameContainer → FrameContainer}/frame.html +0 -0
- /package/src/components/{ScriptBlock/FrameContainer → FrameContainer}/frame.tsx +0 -0
- /package/src/components/{ScriptBlock/FrameContainer → FrameContainer}/index.ts +0 -0
package/package.json
CHANGED
|
@@ -1,39 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-script",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.14-main.1366248",
|
|
4
4
|
"description": "Braneframe notebook plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "DXOS.org",
|
|
9
|
+
"sideEffects": true,
|
|
9
10
|
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"browser": "./dist/lib/browser/index.mjs",
|
|
12
|
-
"node": {
|
|
13
|
-
"default": "./dist/lib/node/index.cjs"
|
|
14
|
-
},
|
|
15
|
-
"types": "./dist/types/src/index.d.ts"
|
|
16
|
-
},
|
|
17
11
|
"./edge": {
|
|
12
|
+
"types": "./dist/types/src/edge/index.d.ts",
|
|
18
13
|
"browser": "./dist/lib/browser/edge/index.mjs",
|
|
19
|
-
"node":
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"types": "./dist/types/src/
|
|
14
|
+
"node": "./dist/lib/node-esm/edge/index.mjs"
|
|
15
|
+
},
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/types/src/index.d.ts",
|
|
18
|
+
"browser": "./dist/lib/browser/index.mjs",
|
|
19
|
+
"node": "./dist/lib/node-esm/index.mjs"
|
|
23
20
|
},
|
|
24
21
|
"./meta": {
|
|
22
|
+
"types": "./dist/types/src/meta.d.ts",
|
|
25
23
|
"browser": "./dist/lib/browser/meta.mjs",
|
|
26
|
-
"node":
|
|
27
|
-
"default": "./dist/lib/node/meta.cjs"
|
|
28
|
-
},
|
|
29
|
-
"types": "./dist/types/src/meta.d.ts"
|
|
24
|
+
"node": "./dist/lib/node-esm/meta.mjs"
|
|
30
25
|
},
|
|
31
26
|
"./types": {
|
|
27
|
+
"types": "./dist/types/src/types/index.d.ts",
|
|
32
28
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
33
|
-
"node":
|
|
34
|
-
"default": "./dist/lib/node/types/index.cjs"
|
|
35
|
-
},
|
|
36
|
-
"types": "./dist/types/src/types/index.d.ts"
|
|
29
|
+
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
37
30
|
}
|
|
38
31
|
},
|
|
39
32
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -55,14 +48,15 @@
|
|
|
55
48
|
"src"
|
|
56
49
|
],
|
|
57
50
|
"dependencies": {
|
|
58
|
-
"@codemirror/autocomplete": "^6.18.
|
|
51
|
+
"@codemirror/autocomplete": "^6.18.1",
|
|
59
52
|
"@codemirror/lang-javascript": "^6.2.2",
|
|
60
|
-
"@codemirror/language": "^6.10.
|
|
61
|
-
"@codemirror/lint": "^6.8.
|
|
53
|
+
"@codemirror/language": "^6.10.3",
|
|
54
|
+
"@codemirror/lint": "^6.8.2",
|
|
62
55
|
"@codemirror/state": "^6.4.1",
|
|
63
56
|
"@codemirror/theme-one-dark": "^6.1.2",
|
|
64
|
-
"@codemirror/view": "^6.
|
|
65
|
-
"@
|
|
57
|
+
"@codemirror/view": "^6.34.1",
|
|
58
|
+
"@effect/schema": "^0.75.1",
|
|
59
|
+
"@lezer/common": "^1.2.2",
|
|
66
60
|
"@preact/signals-core": "^1.6.0",
|
|
67
61
|
"@typescript/vfs": "^1.6.0",
|
|
68
62
|
"@valtown/codemirror-ts": "^2.2.0",
|
|
@@ -72,32 +66,33 @@
|
|
|
72
66
|
"lodash.get": "^4.4.2",
|
|
73
67
|
"prettier": "^3.2.4",
|
|
74
68
|
"react-syntax-highlighter": "^15.5.0",
|
|
75
|
-
"typescript": "^5.
|
|
76
|
-
"@dxos/app-framework": "0.6.
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/debug": "0.6.
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/
|
|
85
|
-
"@dxos/
|
|
86
|
-
"@dxos/
|
|
87
|
-
"@dxos/plugin-graph": "0.6.
|
|
88
|
-
"@dxos/plugin-explorer": "0.6.
|
|
89
|
-
"@dxos/plugin-
|
|
90
|
-
"@dxos/plugin-
|
|
91
|
-
"@dxos/plugin-
|
|
92
|
-
"@dxos/plugin-space": "0.6.
|
|
93
|
-
"@dxos/protocols": "0.6.
|
|
94
|
-
"@dxos/react-client": "0.6.
|
|
95
|
-
"@dxos/react-ui-
|
|
96
|
-
"@dxos/react-ui-attention": "0.6.
|
|
97
|
-
"@dxos/react-ui-
|
|
98
|
-
"@dxos/
|
|
99
|
-
"@dxos/rpc-tunnel": "0.6.
|
|
100
|
-
"@dxos/
|
|
69
|
+
"typescript": "^5.6.2",
|
|
70
|
+
"@dxos/app-framework": "0.6.14-main.1366248",
|
|
71
|
+
"@dxos/client": "0.6.14-main.1366248",
|
|
72
|
+
"@dxos/client-protocol": "0.6.14-main.1366248",
|
|
73
|
+
"@dxos/async": "0.6.14-main.1366248",
|
|
74
|
+
"@dxos/debug": "0.6.14-main.1366248",
|
|
75
|
+
"@dxos/echo-schema": "0.6.14-main.1366248",
|
|
76
|
+
"@dxos/invariant": "0.6.14-main.1366248",
|
|
77
|
+
"@dxos/keys": "0.6.14-main.1366248",
|
|
78
|
+
"@dxos/crypto": "0.6.14-main.1366248",
|
|
79
|
+
"@dxos/log": "0.6.14-main.1366248",
|
|
80
|
+
"@dxos/plugin-client": "0.6.14-main.1366248",
|
|
81
|
+
"@dxos/plugin-graph": "0.6.14-main.1366248",
|
|
82
|
+
"@dxos/plugin-explorer": "0.6.14-main.1366248",
|
|
83
|
+
"@dxos/plugin-markdown": "0.6.14-main.1366248",
|
|
84
|
+
"@dxos/plugin-theme": "0.6.14-main.1366248",
|
|
85
|
+
"@dxos/plugin-stack": "0.6.14-main.1366248",
|
|
86
|
+
"@dxos/plugin-space": "0.6.14-main.1366248",
|
|
87
|
+
"@dxos/protocols": "0.6.14-main.1366248",
|
|
88
|
+
"@dxos/react-client": "0.6.14-main.1366248",
|
|
89
|
+
"@dxos/react-ui-data": "0.6.14-main.1366248",
|
|
90
|
+
"@dxos/react-ui-attention": "0.6.14-main.1366248",
|
|
91
|
+
"@dxos/react-ui-editor": "0.6.14-main.1366248",
|
|
92
|
+
"@dxos/react-ui-syntax-highlighter": "0.6.14-main.1366248",
|
|
93
|
+
"@dxos/rpc-tunnel": "0.6.14-main.1366248",
|
|
94
|
+
"@dxos/rpc": "0.6.14-main.1366248",
|
|
95
|
+
"@dxos/util": "0.6.14-main.1366248"
|
|
101
96
|
},
|
|
102
97
|
"devDependencies": {
|
|
103
98
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -106,21 +101,21 @@
|
|
|
106
101
|
"@types/react-dom": "~18.2.0",
|
|
107
102
|
"react": "~18.2.0",
|
|
108
103
|
"react-dom": "~18.2.0",
|
|
109
|
-
"vite": "
|
|
110
|
-
"@dxos/echo-generator": "0.6.
|
|
111
|
-
"@dxos/random": "0.6.
|
|
112
|
-
"@dxos/react-ui": "0.6.
|
|
113
|
-
"@dxos/react-ui
|
|
114
|
-
"@dxos/react-ui-theme": "0.6.
|
|
115
|
-
"@dxos/storybook-utils": "0.6.
|
|
104
|
+
"vite": "5.4.7",
|
|
105
|
+
"@dxos/echo-generator": "0.6.14-main.1366248",
|
|
106
|
+
"@dxos/random": "0.6.14-main.1366248",
|
|
107
|
+
"@dxos/react-ui-mosaic": "0.6.14-main.1366248",
|
|
108
|
+
"@dxos/react-ui": "0.6.14-main.1366248",
|
|
109
|
+
"@dxos/react-ui-theme": "0.6.14-main.1366248",
|
|
110
|
+
"@dxos/storybook-utils": "0.6.14-main.1366248"
|
|
116
111
|
},
|
|
117
|
-
"
|
|
112
|
+
"peerDependencies": {
|
|
118
113
|
"@phosphor-icons/react": "^2.1.5",
|
|
119
|
-
"react": "
|
|
120
|
-
"react-dom": "
|
|
121
|
-
"@dxos/react-ui
|
|
122
|
-
"@dxos/react-ui-
|
|
123
|
-
"@dxos/react-ui": "0.6.
|
|
114
|
+
"react": "~18.2.0",
|
|
115
|
+
"react-dom": "~18.2.0",
|
|
116
|
+
"@dxos/react-ui": "0.6.14-main.1366248",
|
|
117
|
+
"@dxos/react-ui-mosaic": "0.6.14-main.1366248",
|
|
118
|
+
"@dxos/react-ui-theme": "0.6.14-main.1366248"
|
|
124
119
|
},
|
|
125
120
|
"publishConfig": {
|
|
126
121
|
"access": "public"
|
package/src/ScriptPlugin.tsx
CHANGED
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Code, type IconProps } from '@phosphor-icons/react';
|
|
6
5
|
// @ts-ignore
|
|
7
6
|
import wasmUrl from 'esbuild-wasm/esbuild.wasm?url';
|
|
8
7
|
import React from 'react';
|
|
9
8
|
|
|
10
|
-
import { parseIntentPlugin, type PluginDefinition, resolvePlugin
|
|
9
|
+
import { NavigationAction, parseIntentPlugin, type PluginDefinition, resolvePlugin } from '@dxos/app-framework';
|
|
11
10
|
import { create } from '@dxos/echo-schema';
|
|
12
11
|
import { parseClientPlugin } from '@dxos/plugin-client';
|
|
13
12
|
import { type ActionGroup, createExtension, isActionGroup } from '@dxos/plugin-graph';
|
|
@@ -17,11 +16,11 @@ import { loadObjectReferences } from '@dxos/react-client/echo';
|
|
|
17
16
|
|
|
18
17
|
import { initializeBundler } from './bundler';
|
|
19
18
|
import { Compiler } from './compiler';
|
|
20
|
-
import {
|
|
19
|
+
import { AutomationPanel, ScriptContainer, ScriptSettings, ScriptSettingsPanel } from './components';
|
|
21
20
|
import meta, { SCRIPT_PLUGIN } from './meta';
|
|
21
|
+
import { templates } from './templates';
|
|
22
22
|
import translations from './translations';
|
|
23
|
-
import { FunctionType, ScriptType } from './types';
|
|
24
|
-
import { ScriptAction, type ScriptPluginProvides } from './types';
|
|
23
|
+
import { FunctionType, ScriptAction, type ScriptPluginProvides, ScriptType } from './types';
|
|
25
24
|
|
|
26
25
|
export const ScriptPlugin = (): PluginDefinition<ScriptPluginProvides> => {
|
|
27
26
|
const compiler = new Compiler();
|
|
@@ -45,12 +44,12 @@ export const ScriptPlugin = (): PluginDefinition<ScriptPluginProvides> => {
|
|
|
45
44
|
await initializeBundler({ wasmUrl });
|
|
46
45
|
},
|
|
47
46
|
provides: {
|
|
47
|
+
settings: {},
|
|
48
48
|
metadata: {
|
|
49
49
|
records: {
|
|
50
50
|
[ScriptType.typename]: {
|
|
51
51
|
placeholder: ['object title placeholder', { ns: SCRIPT_PLUGIN }],
|
|
52
|
-
icon:
|
|
53
|
-
iconSymbol: 'ph--code--regular',
|
|
52
|
+
icon: 'ph--code--regular',
|
|
54
53
|
// TODO(wittjosiah): Move out of metadata.
|
|
55
54
|
loadReferences: (script: ScriptType) => loadObjectReferences(script, (script) => [script.source]),
|
|
56
55
|
},
|
|
@@ -60,6 +59,12 @@ export const ScriptPlugin = (): PluginDefinition<ScriptPluginProvides> => {
|
|
|
60
59
|
echo: {
|
|
61
60
|
schema: [ScriptType, FunctionType],
|
|
62
61
|
},
|
|
62
|
+
space: {
|
|
63
|
+
onSpaceCreate: {
|
|
64
|
+
label: ['create object label', { ns: SCRIPT_PLUGIN }],
|
|
65
|
+
action: ScriptAction.CREATE,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
63
68
|
graph: {
|
|
64
69
|
builder: (plugins) => {
|
|
65
70
|
const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;
|
|
@@ -93,8 +98,7 @@ export const ScriptPlugin = (): PluginDefinition<ScriptPluginProvides> => {
|
|
|
93
98
|
},
|
|
94
99
|
properties: {
|
|
95
100
|
label: ['create object label', { ns: SCRIPT_PLUGIN }],
|
|
96
|
-
icon:
|
|
97
|
-
iconSymbol: 'ph--code--regular',
|
|
101
|
+
icon: 'ph--code--regular',
|
|
98
102
|
testId: 'scriptPlugin.createObject',
|
|
99
103
|
},
|
|
100
104
|
},
|
|
@@ -103,29 +107,36 @@ export const ScriptPlugin = (): PluginDefinition<ScriptPluginProvides> => {
|
|
|
103
107
|
});
|
|
104
108
|
},
|
|
105
109
|
},
|
|
106
|
-
stack: {
|
|
107
|
-
creators: [
|
|
108
|
-
{
|
|
109
|
-
id: 'create-stack-section-script',
|
|
110
|
-
testId: 'scriptPlugin.createSection',
|
|
111
|
-
type: ['plugin name', { ns: SCRIPT_PLUGIN }],
|
|
112
|
-
label: ['create stack section label', { ns: SCRIPT_PLUGIN }],
|
|
113
|
-
icon: (props: any) => <Code {...props} />,
|
|
114
|
-
intent: {
|
|
115
|
-
plugin: SCRIPT_PLUGIN,
|
|
116
|
-
action: ScriptAction.CREATE,
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
],
|
|
120
|
-
},
|
|
121
110
|
surface: {
|
|
122
111
|
component: ({ data, role }) => {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
112
|
+
switch (role) {
|
|
113
|
+
case 'settings': {
|
|
114
|
+
return data.plugin === meta.id ? <ScriptSettings settings={{}} /> : null;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
case 'article': {
|
|
118
|
+
if (data.object instanceof ScriptType) {
|
|
119
|
+
return <ScriptContainer script={data.object} env={compiler.environment} />;
|
|
120
|
+
}
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
case 'complementary--automation': {
|
|
125
|
+
if (data.subject instanceof ScriptType) {
|
|
126
|
+
return {
|
|
127
|
+
node: <AutomationPanel subject={data.subject as any} />,
|
|
128
|
+
disposition: 'hoist',
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
126
133
|
|
|
127
|
-
|
|
128
|
-
|
|
134
|
+
case 'complementary--settings': {
|
|
135
|
+
if (data.subject instanceof ScriptType) {
|
|
136
|
+
return <ScriptSettingsPanel script={data.subject} />;
|
|
137
|
+
}
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
129
140
|
}
|
|
130
141
|
|
|
131
142
|
return null;
|
|
@@ -135,7 +146,13 @@ export const ScriptPlugin = (): PluginDefinition<ScriptPluginProvides> => {
|
|
|
135
146
|
resolver: (intent) => {
|
|
136
147
|
switch (intent.action) {
|
|
137
148
|
case ScriptAction.CREATE: {
|
|
138
|
-
return {
|
|
149
|
+
return {
|
|
150
|
+
data: create(ScriptType, {
|
|
151
|
+
source: create(TextType, {
|
|
152
|
+
content: templates[0].source,
|
|
153
|
+
}),
|
|
154
|
+
}),
|
|
155
|
+
};
|
|
139
156
|
}
|
|
140
157
|
}
|
|
141
158
|
},
|
|
@@ -143,14 +160,3 @@ export const ScriptPlugin = (): PluginDefinition<ScriptPluginProvides> => {
|
|
|
143
160
|
},
|
|
144
161
|
};
|
|
145
162
|
};
|
|
146
|
-
|
|
147
|
-
// TODO(burdon): Import.
|
|
148
|
-
const example = [
|
|
149
|
-
'export default async ({ ',
|
|
150
|
-
' event: { data: { request } },',
|
|
151
|
-
' context: { space, ai } ',
|
|
152
|
-
'}: any) => {',
|
|
153
|
-
" return new Response('Hello DXOS!');",
|
|
154
|
-
'};',
|
|
155
|
-
'',
|
|
156
|
-
].join('\n');
|
|
@@ -2,11 +2,21 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
import wasmUrl from 'esbuild-wasm/esbuild.wasm?url';
|
|
7
|
+
import { beforeAll, describe, expect, test } from 'vitest';
|
|
6
8
|
|
|
7
|
-
import {
|
|
9
|
+
import { isNode } from '@dxos/util';
|
|
10
|
+
|
|
11
|
+
import { Bundler, initializeBundler } from './bundler';
|
|
8
12
|
|
|
9
13
|
describe('Bundler', () => {
|
|
14
|
+
beforeAll(async () => {
|
|
15
|
+
if (!isNode()) {
|
|
16
|
+
await initializeBundler({ wasmUrl });
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
10
20
|
test('Basic', async () => {
|
|
11
21
|
const bundler = new Bundler({ platform: 'node', sandboxedModules: [], remoteModules: {} });
|
|
12
22
|
const result = await bundler.bundle('const x = 100'); // TODO(burdon): Test import.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useMemo, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type EchoReactiveObject } from '@dxos/client/echo';
|
|
8
|
+
import { failUndefined } from '@dxos/debug';
|
|
9
|
+
import { useClient } from '@dxos/react-client';
|
|
10
|
+
import { Filter, getMeta, getSpace, useQuery } from '@dxos/react-client/echo';
|
|
11
|
+
import { Select } from '@dxos/react-ui';
|
|
12
|
+
|
|
13
|
+
import { getInvocationUrl, getUserFunctionUrlInMetadata } from '../../edge';
|
|
14
|
+
import { FunctionType, ScriptType } from '../../types';
|
|
15
|
+
import { DebugPanel } from '../DebugPanel';
|
|
16
|
+
|
|
17
|
+
export interface AutomationPanelProps {
|
|
18
|
+
subject: EchoReactiveObject<any>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const AutomationPanel = ({ subject }: AutomationPanelProps) => {
|
|
22
|
+
const space = getSpace(subject);
|
|
23
|
+
|
|
24
|
+
// TODO(dmaretskyi): Parametric query.
|
|
25
|
+
const functions = useQuery(
|
|
26
|
+
space ?? undefined,
|
|
27
|
+
Filter.schema(FunctionType, (fn) => (subject instanceof ScriptType ? fn.source === subject : fn.binding != null)),
|
|
28
|
+
{},
|
|
29
|
+
[subject],
|
|
30
|
+
);
|
|
31
|
+
const [selectedFunction, setSelectedFunction] = useState<FunctionType | null>(null);
|
|
32
|
+
const functionToChatWith = subject instanceof ScriptType ? functions[0] : selectedFunction;
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div className='h-full flex flex-col'>
|
|
36
|
+
{!(subject instanceof ScriptType) && (
|
|
37
|
+
<BindingSelect
|
|
38
|
+
selectedFunction={selectedFunction}
|
|
39
|
+
setSelectedFunction={setSelectedFunction}
|
|
40
|
+
functions={functions}
|
|
41
|
+
/>
|
|
42
|
+
)}
|
|
43
|
+
{functionToChatWith && <ChatPanel fn={functionToChatWith} subject={subject} />}
|
|
44
|
+
{subject instanceof ScriptType && functions.length === 0 && <p>Deploy function to interact with it.</p>}
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export interface ChatPanelProps {
|
|
50
|
+
fn: FunctionType;
|
|
51
|
+
subject: EchoReactiveObject<any>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const ChatPanel = ({ fn, subject }: ChatPanelProps) => {
|
|
55
|
+
const client = useClient();
|
|
56
|
+
const space = getSpace(fn);
|
|
57
|
+
const existingFunctionUrl = getUserFunctionUrlInMetadata(getMeta(fn));
|
|
58
|
+
const functionUrl = useMemo(() => {
|
|
59
|
+
if (!existingFunctionUrl) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return getInvocationUrl(existingFunctionUrl, client.config.values.runtime?.services?.edge?.url ?? '', {
|
|
64
|
+
spaceId: space?.id,
|
|
65
|
+
subjectId: subject?.id,
|
|
66
|
+
});
|
|
67
|
+
}, [existingFunctionUrl, space, subject]);
|
|
68
|
+
|
|
69
|
+
return <DebugPanel functionUrl={functionUrl} classNames='flex-1' />;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export interface BindingSelectProps {
|
|
73
|
+
selectedFunction: FunctionType | null;
|
|
74
|
+
setSelectedFunction: (fn: FunctionType) => void;
|
|
75
|
+
functions: FunctionType[];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const BindingSelect = ({ selectedFunction, setSelectedFunction, functions }: BindingSelectProps) => {
|
|
79
|
+
return (
|
|
80
|
+
<Select.Root
|
|
81
|
+
value={selectedFunction?.id}
|
|
82
|
+
onValueChange={(id) => setSelectedFunction(functions.find((fn) => fn.id === id) ?? failUndefined())}
|
|
83
|
+
>
|
|
84
|
+
<Select.TriggerButton placeholder='Select value' />
|
|
85
|
+
<Select.Portal>
|
|
86
|
+
<Select.Content>
|
|
87
|
+
<Select.ScrollUpButton />
|
|
88
|
+
<Select.Viewport>
|
|
89
|
+
{functions.map(({ id, binding }) => (
|
|
90
|
+
<Select.Option key={id} value={id}>
|
|
91
|
+
{binding}
|
|
92
|
+
</Select.Option>
|
|
93
|
+
))}
|
|
94
|
+
</Select.Viewport>
|
|
95
|
+
<Select.ScrollDownButton />
|
|
96
|
+
<Select.Arrow />
|
|
97
|
+
</Select.Content>
|
|
98
|
+
</Select.Portal>
|
|
99
|
+
</Select.Root>
|
|
100
|
+
);
|
|
101
|
+
};
|