@dxos/plugin-script 0.7.5-labs.a279d8c → 0.7.5-labs.d453967
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/dist/lib/browser/{AutomationPanel-OOIRJFPJ.mjs → AutomationPanel-J3SZ5L3Y.mjs} +3 -3
- package/dist/lib/browser/{ScriptContainer-T2AOMDT3.mjs → ScriptContainer-JHAVO2KA.mjs} +98 -70
- package/dist/lib/browser/ScriptContainer-JHAVO2KA.mjs.map +7 -0
- package/dist/lib/browser/artifact-YCIVHFSS.mjs +243 -0
- package/dist/lib/browser/artifact-YCIVHFSS.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SJ4J527G.mjs → chunk-45LXDWNF.mjs} +2 -2
- package/dist/lib/browser/{chunk-ZM6T4HPR.mjs → chunk-6MOQ4BP3.mjs} +2 -2
- package/dist/lib/browser/chunk-FVVCAWNP.mjs +21 -0
- package/dist/lib/browser/chunk-FVVCAWNP.mjs.map +7 -0
- package/dist/lib/browser/{chunk-XPGBHZ3L.mjs → chunk-N46LE7FS.mjs} +2 -2
- package/dist/lib/browser/{chunk-REL2R7SB.mjs → chunk-UDLKK74O.mjs} +20 -3
- package/dist/lib/browser/chunk-UDLKK74O.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SIOGRRPF.mjs → chunk-WAXHENSY.mjs} +21 -9
- package/dist/lib/browser/chunk-WAXHENSY.mjs.map +7 -0
- package/dist/lib/browser/{compiler-HT53ILG7.mjs → compiler-YY2XSKHQ.mjs} +4 -6
- package/dist/lib/browser/compiler-YY2XSKHQ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +20 -18
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/intent-resolver-RV3YXIVN.mjs +45 -0
- package/dist/lib/browser/intent-resolver-RV3YXIVN.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-GAWVYTJ5.mjs → react-surface-ETY4XKFG.mjs} +12 -14
- package/dist/lib/browser/react-surface-ETY4XKFG.mjs.map +7 -0
- package/dist/lib/browser/{settings-YQQEU3DF.mjs → settings-SZCDKHWO.mjs} +3 -3
- package/dist/lib/browser/types.mjs +2 -2
- package/dist/lib/node/{AutomationPanel-EPRDDR3A.cjs → AutomationPanel-4M55FURO.cjs} +8 -8
- package/dist/lib/node/{ScriptContainer-BV56I4OL.cjs → ScriptContainer-EBIT6CT4.cjs} +101 -71
- package/dist/lib/node/ScriptContainer-EBIT6CT4.cjs.map +7 -0
- package/dist/lib/node/artifact-IPGGY2Z2.cjs +262 -0
- package/dist/lib/node/artifact-IPGGY2Z2.cjs.map +7 -0
- package/dist/lib/node/{chunk-5V3XGLTR.cjs → chunk-3VDHZ54A.cjs} +24 -12
- package/dist/lib/node/chunk-3VDHZ54A.cjs.map +7 -0
- package/dist/lib/node/{chunk-EFTZN5X7.cjs → chunk-5UH3F7TA.cjs} +8 -5
- package/dist/lib/node/chunk-5UH3F7TA.cjs.map +7 -0
- package/dist/lib/node/{chunk-A2DI2G4D.cjs → chunk-ALY3N6PW.cjs} +6 -6
- package/dist/lib/node/{chunk-6VKZJ4MH.cjs → chunk-DJGLGRQV.cjs} +6 -6
- package/dist/lib/node/{chunk-DQRAVZM7.cjs → chunk-IID7WUQS.cjs} +6 -6
- package/dist/lib/node/{chunk-TJ4BTPOS.cjs → chunk-JKPNBFU2.cjs} +19 -6
- package/dist/lib/node/chunk-JKPNBFU2.cjs.map +7 -0
- package/dist/lib/node/{compiler-457ZR24G.cjs → compiler-UIBLKJKG.cjs} +9 -9
- package/dist/lib/node/compiler-UIBLKJKG.cjs.map +7 -0
- package/dist/lib/node/index.cjs +38 -35
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-SUAPE7H3.cjs → intent-resolver-WFLQNAID.cjs} +31 -28
- package/dist/lib/node/intent-resolver-WFLQNAID.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-OMBMSFZT.cjs → react-surface-OIQJFA7P.cjs} +23 -25
- package/dist/lib/node/react-surface-OIQJFA7P.cjs.map +7 -0
- package/dist/lib/node/{settings-NGHDYAVK.cjs → settings-SZFSMSKM.cjs} +9 -9
- package/dist/lib/node/types.cjs +4 -4
- package/dist/lib/node/types.cjs.map +1 -1
- package/dist/lib/node-esm/{AutomationPanel-DMLAGQS5.mjs → AutomationPanel-W6SKG35R.mjs} +3 -3
- package/dist/lib/node-esm/{ScriptContainer-3S5VHJVR.mjs → ScriptContainer-QVFTCAML.mjs} +98 -70
- package/dist/lib/node-esm/ScriptContainer-QVFTCAML.mjs.map +7 -0
- package/dist/lib/node-esm/artifact-7H4HGX5W.mjs +245 -0
- package/dist/lib/node-esm/artifact-7H4HGX5W.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-JJZYWSD7.mjs → chunk-5CEKSMA5.mjs} +20 -3
- package/dist/lib/node-esm/chunk-5CEKSMA5.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-XUWS7OTK.mjs → chunk-CGF7EOGD.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-675XSDRN.mjs → chunk-CP5LXTK5.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-BHP545D7.mjs → chunk-P2V2Y5LV.mjs} +5 -2
- package/dist/lib/node-esm/chunk-P2V2Y5LV.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-JHGOPQVO.mjs → chunk-UNQFIERE.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-XPIKUBGS.mjs → chunk-WCAUDRF4.mjs} +21 -9
- package/dist/lib/node-esm/chunk-WCAUDRF4.mjs.map +7 -0
- package/dist/lib/node-esm/{compiler-PEARFTFR.mjs → compiler-XTXFGZJM.mjs} +4 -6
- package/dist/lib/node-esm/compiler-XTXFGZJM.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +20 -18
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/intent-resolver-CYT6IYYH.mjs +46 -0
- package/dist/lib/node-esm/intent-resolver-CYT6IYYH.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-J7NLV2V4.mjs → react-surface-N67GNKC2.mjs} +12 -14
- package/dist/lib/node-esm/react-surface-N67GNKC2.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-XGXDY4NI.mjs → settings-GR4O2WHZ.mjs} +3 -3
- package/dist/lib/node-esm/types.mjs +2 -2
- package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/artifact.d.ts +11 -0
- package/dist/types/src/capabilities/artifact.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +5 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/FrameContainer/FrameContainer.d.ts +2 -2
- package/dist/types/src/components/FrameContainer/FrameContainer.d.ts.map +1 -1
- package/dist/types/src/components/ScriptContainer.d.ts +2 -2
- package/dist/types/src/components/ScriptContainer.d.ts.map +1 -1
- package/dist/types/src/components/ScriptSettingsPanel.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/deploy.d.ts.map +1 -0
- package/dist/types/src/hooks/format.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +7 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/{components/ScriptToolbar/templateSelect.d.ts → hooks/template.d.ts} +1 -1
- package/dist/types/src/hooks/template.d.ts.map +1 -0
- package/dist/types/src/{components/ScriptToolbar → hooks}/useToolbarAction.d.ts +1 -1
- package/dist/types/src/hooks/useToolbarAction.d.ts.map +1 -0
- package/dist/types/src/hooks/useToolbarState.d.ts.map +1 -0
- package/dist/types/src/hooks/view.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/templates/discord.d.ts +3 -0
- package/dist/types/src/templates/discord.d.ts.map +1 -0
- package/dist/types/src/templates/echo.d.ts.map +1 -1
- package/dist/types/src/templates/forex-effect.d.ts +6 -0
- package/dist/types/src/templates/forex-effect.d.ts.map +1 -0
- package/dist/types/src/templates/forex.d.ts +1 -1
- package/dist/types/src/templates/forex.d.ts.map +1 -1
- package/dist/types/src/templates/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +6 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +41 -41
- package/src/ScriptPlugin.tsx +10 -13
- package/src/capabilities/artifact.ts +219 -0
- package/src/capabilities/compiler.ts +1 -1
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/intent-resolver.ts +25 -22
- package/src/capabilities/react-surface.tsx +8 -8
- package/src/components/FrameContainer/FrameContainer.tsx +4 -3
- package/src/components/ScriptContainer.tsx +10 -5
- package/src/components/ScriptSettings/ScriptSettings.tsx +3 -3
- package/src/components/ScriptSettingsPanel.tsx +16 -2
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +8 -6
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +3 -3
- package/src/{components/ScriptToolbar → hooks}/deploy.ts +16 -4
- package/src/{components/ScriptToolbar → hooks}/format.ts +1 -1
- package/src/hooks/index.ts +11 -0
- package/src/{components/ScriptToolbar/templateSelect.ts → hooks/template.ts} +2 -2
- package/src/{components/ScriptToolbar → hooks}/useToolbarAction.ts +1 -1
- package/src/{components/ScriptToolbar → hooks}/view.ts +1 -1
- package/src/index.ts +0 -1
- package/src/meta.ts +3 -1
- package/src/templates/discord.ts +88 -0
- package/src/templates/echo.ts +5 -1
- package/src/templates/forex-effect.ts +44 -0
- package/src/templates/forex.ts +21 -13
- package/src/templates/index.ts +15 -0
- package/src/translations.ts +2 -0
- package/dist/lib/browser/ScriptContainer-T2AOMDT3.mjs.map +0 -7
- package/dist/lib/browser/chunk-5BU5ERNU.mjs +0 -18
- package/dist/lib/browser/chunk-5BU5ERNU.mjs.map +0 -7
- package/dist/lib/browser/chunk-REL2R7SB.mjs.map +0 -7
- package/dist/lib/browser/chunk-SDHKTS6H.mjs +0 -237
- package/dist/lib/browser/chunk-SDHKTS6H.mjs.map +0 -7
- package/dist/lib/browser/chunk-SIOGRRPF.mjs.map +0 -7
- package/dist/lib/browser/compiler-HT53ILG7.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-YPHT6HDZ.mjs +0 -42
- package/dist/lib/browser/intent-resolver-YPHT6HDZ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-GAWVYTJ5.mjs.map +0 -7
- package/dist/lib/node/ScriptContainer-BV56I4OL.cjs.map +0 -7
- package/dist/lib/node/chunk-5V3XGLTR.cjs.map +0 -7
- package/dist/lib/node/chunk-EFTZN5X7.cjs.map +0 -7
- package/dist/lib/node/chunk-T4TXCRN5.cjs +0 -260
- package/dist/lib/node/chunk-T4TXCRN5.cjs.map +0 -7
- package/dist/lib/node/chunk-TJ4BTPOS.cjs.map +0 -7
- package/dist/lib/node/compiler-457ZR24G.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-SUAPE7H3.cjs.map +0 -7
- package/dist/lib/node/react-surface-OMBMSFZT.cjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-3S5VHJVR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BHP545D7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-G76M6O46.mjs +0 -239
- package/dist/lib/node-esm/chunk-G76M6O46.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JJZYWSD7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XPIKUBGS.mjs.map +0 -7
- package/dist/lib/node-esm/compiler-PEARFTFR.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-SZJXQ3CW.mjs +0 -43
- package/dist/lib/node-esm/intent-resolver-SZJXQ3CW.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-J7NLV2V4.mjs.map +0 -7
- package/dist/types/src/bundler/bundler.d.ts +0 -39
- package/dist/types/src/bundler/bundler.d.ts.map +0 -1
- package/dist/types/src/bundler/bundler.test.d.ts +0 -2
- package/dist/types/src/bundler/bundler.test.d.ts.map +0 -1
- package/dist/types/src/bundler/index.d.ts +0 -2
- package/dist/types/src/bundler/index.d.ts.map +0 -1
- package/dist/types/src/components/ScriptToolbar/deploy.d.ts.map +0 -1
- package/dist/types/src/components/ScriptToolbar/format.d.ts.map +0 -1
- package/dist/types/src/components/ScriptToolbar/templateSelect.d.ts.map +0 -1
- package/dist/types/src/components/ScriptToolbar/useToolbarAction.d.ts.map +0 -1
- package/dist/types/src/components/ScriptToolbar/useToolbarState.d.ts.map +0 -1
- package/dist/types/src/components/ScriptToolbar/view.d.ts.map +0 -1
- package/src/bundler/bundler.test.ts +0 -55
- package/src/bundler/bundler.ts +0 -250
- package/src/bundler/index.ts +0 -5
- /package/dist/lib/browser/{AutomationPanel-OOIRJFPJ.mjs.map → AutomationPanel-J3SZ5L3Y.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-SJ4J527G.mjs.map → chunk-45LXDWNF.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-ZM6T4HPR.mjs.map → chunk-6MOQ4BP3.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-XPGBHZ3L.mjs.map → chunk-N46LE7FS.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-YQQEU3DF.mjs.map → settings-SZCDKHWO.mjs.map} +0 -0
- /package/dist/lib/node/{AutomationPanel-EPRDDR3A.cjs.map → AutomationPanel-4M55FURO.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-A2DI2G4D.cjs.map → chunk-ALY3N6PW.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-6VKZJ4MH.cjs.map → chunk-DJGLGRQV.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-DQRAVZM7.cjs.map → chunk-IID7WUQS.cjs.map} +0 -0
- /package/dist/lib/node/{settings-NGHDYAVK.cjs.map → settings-SZFSMSKM.cjs.map} +0 -0
- /package/dist/lib/node-esm/{AutomationPanel-DMLAGQS5.mjs.map → AutomationPanel-W6SKG35R.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-XUWS7OTK.mjs.map → chunk-CGF7EOGD.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-675XSDRN.mjs.map → chunk-CP5LXTK5.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-JHGOPQVO.mjs.map → chunk-UNQFIERE.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-XGXDY4NI.mjs.map → settings-GR4O2WHZ.mjs.map} +0 -0
- /package/dist/types/src/{components/ScriptToolbar → hooks}/deploy.d.ts +0 -0
- /package/dist/types/src/{components/ScriptToolbar → hooks}/format.d.ts +0 -0
- /package/dist/types/src/{components/ScriptToolbar → hooks}/useToolbarState.d.ts +0 -0
- /package/dist/types/src/{components/ScriptToolbar → hooks}/view.d.ts +0 -0
- /package/src/{components/ScriptToolbar → hooks}/useToolbarState.ts +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bundler/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../../../src/components/ScriptToolbar/deploy.ts"],"names":[],"mappings":"AAMA,OAAO,EAKL,KAAK,UAAU,EAGhB,MAAM,iBAAiB,CAAC;AAOzB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAIxC,MAAM,MAAM,sBAAsB,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3E,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG;IACpC,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,OAAO,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;CA8BvD,CAAC;AAUF,eAAO,MAAM,cAAc,sBAAuB;IAAE,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,SAepG,CAAC;AAEF,eAAO,MAAM,gBAAgB,sBAAuB;IAAE,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,wBAyDtG,CAAC;AAEF,eAAO,MAAM,cAAc,cAAe;IAAE,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;CAAE,wBAMhD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../../src/components/ScriptToolbar/format.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAMlD,MAAM,MAAM,sBAAsB,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAExD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;CAUxB,CAAC;AAEF,eAAO,MAAM,gBAAgB,eAAgB;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,wBAiB9C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"templateSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/ScriptToolbar/templateSelect.ts"],"names":[],"mappings":"AAMA,OAAO,EAA6B,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAO7E,MAAM,MAAM,wBAAwB,GAAG;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAmB3E,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;CAUhC,CAAC;AAEF,eAAO,MAAM,wBAAwB,eAAgB;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,kBAE1D,MAAM,SAiBtB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useToolbarAction.d.ts","sourceRoot":"","sources":["../../../../../src/components/ScriptToolbar/useToolbarAction.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE9E,OAAO,EAAE,KAAK,sBAAsB,EAAoC,MAAM,UAAU,CAAC;AACzF,OAAO,EAAE,KAAK,sBAAsB,EAAoB,MAAM,UAAU,CAAC;AACzE,OAAO,EAAE,KAAK,wBAAwB,EAA4B,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAEnD,MAAM,MAAM,6BAA6B,GACrC,wBAAwB,GACxB,oBAAoB,GACpB,sBAAsB,GACtB,sBAAsB,CAAC;AAE3B,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,6BAA6B,CAAC,CAAC;AAE5E,eAAO,MAAM,gBAAgB,UAAW;IAAE,KAAK,EAAE,kBAAkB,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,sBA6BxF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useToolbarState.d.ts","sourceRoot":"","sources":["../../../../../src/components/ScriptToolbar/useToolbarState.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;AAElE,eAAO,MAAM,eAAe,kBAAkB,kBAAkB;;;;;GAE/D,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../../../src/components/ScriptToolbar/view.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AAEpD,MAAM,MAAM,SAAS,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAE3C,MAAM,MAAM,oBAAoB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAA;CAAE,CAAC;AA6BrE,eAAO,MAAM,UAAU,UAAW,OAAO,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;CAUnD,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
import wasmUrl from 'esbuild-wasm/esbuild.wasm?url';
|
|
7
|
-
import { beforeAll, describe, expect, test } from 'vitest';
|
|
8
|
-
|
|
9
|
-
import { isNode } from '@dxos/util';
|
|
10
|
-
|
|
11
|
-
import { Bundler, initializeBundler } from './bundler';
|
|
12
|
-
|
|
13
|
-
describe('Bundler', () => {
|
|
14
|
-
beforeAll(async () => {
|
|
15
|
-
if (!isNode()) {
|
|
16
|
-
await initializeBundler({ wasmUrl });
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
test('Basic', async () => {
|
|
21
|
-
const bundler = new Bundler({ platform: 'node', sandboxedModules: [], remoteModules: {} });
|
|
22
|
-
const result = await bundler.bundle('const x = 100'); // TODO(burdon): Test import.
|
|
23
|
-
expect(result.bundle).to.exist;
|
|
24
|
-
expect(result.error).to.not.exist;
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
test('Import', async () => {
|
|
28
|
-
const bundler = new Bundler({ platform: 'node', sandboxedModules: [], remoteModules: {} });
|
|
29
|
-
const result = await bundler.bundle(`
|
|
30
|
-
import { Filter } from './runtime.js';
|
|
31
|
-
|
|
32
|
-
const query = Filter.typename('dxos.org/type/Example');
|
|
33
|
-
`);
|
|
34
|
-
expect(result.bundle).to.exist;
|
|
35
|
-
expect(result.error).to.not.exist;
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
// TODO(dmaretskyi): Flaky on CI: https://cloud.nx.app/runs/Hjcifa8Ccq/task/plugin-script%3Atest
|
|
39
|
-
test.skip('HTTPS Import', async () => {
|
|
40
|
-
const bundler = new Bundler({ platform: 'node', sandboxedModules: [], remoteModules: {} });
|
|
41
|
-
const result = await bundler.bundle(`
|
|
42
|
-
import { invariant } from 'https://esm.sh/@dxos/invariant';
|
|
43
|
-
invariant(true);
|
|
44
|
-
`);
|
|
45
|
-
expect(result.bundle).to.exist;
|
|
46
|
-
expect(result.error).to.not.exist;
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
test('Error', async () => {
|
|
50
|
-
const bundler = new Bundler({ platform: 'node', sandboxedModules: [], remoteModules: {} });
|
|
51
|
-
const result = await bundler.bundle("import missing from './module'; missing();");
|
|
52
|
-
expect(result.bundle).to.not.exist;
|
|
53
|
-
expect(result.error).to.exist;
|
|
54
|
-
});
|
|
55
|
-
});
|
package/src/bundler/bundler.ts
DELETED
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type BuildOptions } from 'esbuild';
|
|
6
|
-
import { build, initialize, type BuildResult, type Plugin } from 'esbuild-wasm';
|
|
7
|
-
|
|
8
|
-
import { subtleCrypto } from '@dxos/crypto';
|
|
9
|
-
import { invariant } from '@dxos/invariant';
|
|
10
|
-
import { log } from '@dxos/log';
|
|
11
|
-
|
|
12
|
-
export type Import = {
|
|
13
|
-
moduleUrl: string;
|
|
14
|
-
defaultImport: boolean;
|
|
15
|
-
namedImports: string[];
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export type BundlerResult = {
|
|
19
|
-
timestamp: number;
|
|
20
|
-
sourceHash: Buffer;
|
|
21
|
-
imports?: Import[];
|
|
22
|
-
bundle?: string;
|
|
23
|
-
error?: any;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export type BundlerOptions = {
|
|
27
|
-
platform: BuildOptions['platform'];
|
|
28
|
-
sandboxedModules: string[];
|
|
29
|
-
remoteModules: Record<string, string>;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
let initialized: Promise<void>;
|
|
33
|
-
export const initializeBundler = async (options: { wasmUrl: string }) => {
|
|
34
|
-
await (initialized ??= initialize({
|
|
35
|
-
wasmURL: options.wasmUrl,
|
|
36
|
-
}));
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* ESBuild bundler.
|
|
41
|
-
*/
|
|
42
|
-
export class Bundler {
|
|
43
|
-
constructor(private readonly _options: BundlerOptions) {}
|
|
44
|
-
|
|
45
|
-
async bundle(source: string): Promise<BundlerResult> {
|
|
46
|
-
const { sandboxedModules: providedModules, ...options } = this._options;
|
|
47
|
-
|
|
48
|
-
const createResult = async (result?: Partial<BundlerResult>) => {
|
|
49
|
-
return {
|
|
50
|
-
timestamp: Date.now(),
|
|
51
|
-
sourceHash: Buffer.from(await subtleCrypto.digest('SHA-256', Buffer.from(source))),
|
|
52
|
-
...result,
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
if (this._options.platform === 'browser') {
|
|
57
|
-
invariant(initialized, 'Compiler not initialized.');
|
|
58
|
-
await initialized;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const imports = analyzeSourceFileImports(source);
|
|
62
|
-
|
|
63
|
-
// https://esbuild.github.io/api/#build
|
|
64
|
-
try {
|
|
65
|
-
const result = await build({
|
|
66
|
-
platform: options.platform,
|
|
67
|
-
conditions: ['workerd', 'browser'],
|
|
68
|
-
metafile: true,
|
|
69
|
-
write: false,
|
|
70
|
-
entryPoints: ['memory:main.tsx'],
|
|
71
|
-
bundle: true,
|
|
72
|
-
format: 'esm',
|
|
73
|
-
plugins: [
|
|
74
|
-
{
|
|
75
|
-
name: 'memory',
|
|
76
|
-
setup: (build) => {
|
|
77
|
-
build.onResolve({ filter: /^\.\/runtime\.js$/ }, ({ path }) => {
|
|
78
|
-
return { path, external: true };
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
build.onResolve({ filter: /^dxos:functions$/ }, ({ path }) => {
|
|
82
|
-
return { path: './runtime.js', external: true };
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
build.onResolve({ filter: /^memory:/ }, ({ path }) => {
|
|
86
|
-
return { path: path.split(':')[1], namespace: 'memory' };
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
build.onLoad({ filter: /.*/, namespace: 'memory' }, ({ path }) => {
|
|
90
|
-
if (path === 'main.tsx') {
|
|
91
|
-
return {
|
|
92
|
-
contents: source,
|
|
93
|
-
loader: 'tsx',
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
for (const module of providedModules) {
|
|
99
|
-
build.onResolve({ filter: new RegExp(`^${module}$`) }, ({ path }) => {
|
|
100
|
-
return { path, namespace: 'injected-module' };
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
build.onLoad({ filter: /.*/, namespace: 'injected-module' }, ({ path }) => {
|
|
105
|
-
const namedImports = imports.find((entry) => entry.moduleIdentifier === path)?.namedImports ?? [];
|
|
106
|
-
return {
|
|
107
|
-
contents: `
|
|
108
|
-
const { ${namedImports.join(',')} } = window.__DXOS_SANDBOX_MODULES__[${JSON.stringify(path)}];
|
|
109
|
-
export { ${namedImports.join(',')} };
|
|
110
|
-
export default window.__DXOS_SANDBOX_MODULES__[${JSON.stringify(path)}].default;
|
|
111
|
-
`,
|
|
112
|
-
loader: 'tsx',
|
|
113
|
-
};
|
|
114
|
-
});
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
httpPlugin,
|
|
118
|
-
],
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
log('compile complete', result.metafile);
|
|
122
|
-
|
|
123
|
-
return await createResult({
|
|
124
|
-
imports: this.analyzeImports(result),
|
|
125
|
-
bundle: result.outputFiles![0].text,
|
|
126
|
-
});
|
|
127
|
-
} catch (err) {
|
|
128
|
-
return await createResult({ error: err });
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
// TODO(dmaretskyi): In the future we can replace the compiler with SWC with plugins running in WASM.
|
|
133
|
-
analyzeImports(result: BuildResult): Import[] {
|
|
134
|
-
invariant(result.outputFiles);
|
|
135
|
-
|
|
136
|
-
// TODO(dmaretskyi): Support import aliases and wildcard imports.
|
|
137
|
-
const parsedImports = allMatches(IMPORT_REGEX, result.outputFiles[0].text);
|
|
138
|
-
return Object.values(result.metafile!.outputs)[0].imports.map((entry): Import => {
|
|
139
|
-
const namedImports: string[] = [];
|
|
140
|
-
|
|
141
|
-
const parsedImport = parsedImports.find((capture) => capture?.[4] === entry.path);
|
|
142
|
-
if (parsedImport?.[2]) {
|
|
143
|
-
NAMED_IMPORTS_REGEX.lastIndex = 0;
|
|
144
|
-
const namedImportsMatch = NAMED_IMPORTS_REGEX.exec(parsedImport[2]);
|
|
145
|
-
if (namedImportsMatch) {
|
|
146
|
-
namedImportsMatch[1].split(',').forEach((importName) => {
|
|
147
|
-
namedImports.push(importName.trim());
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return {
|
|
153
|
-
moduleUrl: entry.path,
|
|
154
|
-
defaultImport: !!parsedImport?.[1],
|
|
155
|
-
namedImports,
|
|
156
|
-
};
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
analyzeSourceFileImports(code: string) {
|
|
161
|
-
// TODO(dmaretskyi): Support import aliases and wildcard imports.
|
|
162
|
-
const parsedImports = allMatches(IMPORT_REGEX, code);
|
|
163
|
-
return parsedImports.map((capture) => {
|
|
164
|
-
return {
|
|
165
|
-
defaultImportName: capture[1],
|
|
166
|
-
namedImports: capture[2]?.split(',').map((importName) => importName.trim()),
|
|
167
|
-
wildcardImportName: capture[3],
|
|
168
|
-
moduleIdentifier: capture[4],
|
|
169
|
-
quotes: capture[5],
|
|
170
|
-
};
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
// https://regex101.com/r/FEN5ks/1
|
|
176
|
-
// https://stackoverflow.com/a/73265022
|
|
177
|
-
// $1 = default import name (can be non-existent)
|
|
178
|
-
// $2 = destructured exports (can be non-existent)
|
|
179
|
-
// $3 = wildcard import name (can be non-existent)
|
|
180
|
-
// $4 = module identifier
|
|
181
|
-
// $5 = quotes used (either ' or ")
|
|
182
|
-
const IMPORT_REGEX =
|
|
183
|
-
/import(?:(?:(?:[ \n\t]+([^ *\n\t{},]+)[ \n\t]*(?:,|[ \n\t]+))?([ \n\t]*{(?:[ \n\t]*[^ \n\t"'{}]+[ \n\t]*,?)+})?[ \n\t]*)|[ \n\t]*\*[ \n\t]*as[ \n\t]+([^ \n\t{}]+)[ \n\t]+)from[ \n\t]*(?:['"])([^'"\n]+)(['"])/gm;
|
|
184
|
-
|
|
185
|
-
const NAMED_IMPORTS_REGEX = /[ \n\t]*{((?:[ \n\t]*[^ \n\t"'{}]+[ \n\t]*,?)+)}[ \n\t]*/gm;
|
|
186
|
-
|
|
187
|
-
const allMatches = (regex: RegExp, str: string) => {
|
|
188
|
-
regex.lastIndex = 0;
|
|
189
|
-
|
|
190
|
-
let match;
|
|
191
|
-
const matches = [];
|
|
192
|
-
while ((match = regex.exec(str))) {
|
|
193
|
-
matches.push(match);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
return matches;
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
type ParsedImport = {
|
|
200
|
-
defaultImportName?: string;
|
|
201
|
-
namedImports: string[];
|
|
202
|
-
wildcardImportName?: string;
|
|
203
|
-
moduleIdentifier: string;
|
|
204
|
-
quotes: string;
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
const analyzeSourceFileImports = (code: string): ParsedImport[] => {
|
|
208
|
-
// TODO(dmaretskyi): Support import aliases and wildcard imports.
|
|
209
|
-
const parsedImports = allMatches(IMPORT_REGEX, code);
|
|
210
|
-
return parsedImports.map((capture) => {
|
|
211
|
-
return {
|
|
212
|
-
defaultImportName: capture[1],
|
|
213
|
-
namedImports: capture[2]
|
|
214
|
-
?.trim()
|
|
215
|
-
.slice(1, -1)
|
|
216
|
-
.split(',')
|
|
217
|
-
.map((importName) => importName.trim()),
|
|
218
|
-
wildcardImportName: capture[3],
|
|
219
|
-
moduleIdentifier: capture[4],
|
|
220
|
-
quotes: capture[5],
|
|
221
|
-
};
|
|
222
|
-
});
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
const httpPlugin: Plugin = {
|
|
226
|
-
name: 'http',
|
|
227
|
-
setup: (build) => {
|
|
228
|
-
// Intercept import paths starting with "http:" and "https:" so esbuild doesn't attempt to map them to a file system location.
|
|
229
|
-
// Tag them with the "http-url" namespace to associate them with this plugin.
|
|
230
|
-
build.onResolve({ filter: /^https?:\/\// }, (args) => ({
|
|
231
|
-
path: args.path,
|
|
232
|
-
namespace: 'http-url',
|
|
233
|
-
}));
|
|
234
|
-
|
|
235
|
-
// We also want to intercept all import paths inside downloaded files and resolve them against the original URL.
|
|
236
|
-
// All of these files will be in the "http-url" namespace.
|
|
237
|
-
// Make sure to keep the newly resolved URL in the "http-url" namespace so imports inside it will also be resolved as URLs recursively.
|
|
238
|
-
build.onResolve({ filter: /.*/, namespace: 'http-url' }, (args) => ({
|
|
239
|
-
path: new URL(args.path, args.importer).toString(),
|
|
240
|
-
namespace: 'http-url',
|
|
241
|
-
}));
|
|
242
|
-
|
|
243
|
-
// When a URL is loaded, we want to actually download the content from the internet.
|
|
244
|
-
// This has just enough logic to be able to handle the example import from unpkg.com but in reality this would probably need to be more complex.
|
|
245
|
-
build.onLoad({ filter: /.*/, namespace: 'http-url' }, async (args) => {
|
|
246
|
-
const response = await fetch(args.path);
|
|
247
|
-
return { contents: await response.text(), loader: 'jsx' };
|
|
248
|
-
});
|
|
249
|
-
},
|
|
250
|
-
};
|
package/src/bundler/index.ts
DELETED
/package/dist/lib/browser/{AutomationPanel-OOIRJFPJ.mjs.map → AutomationPanel-J3SZ5L3Y.mjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/lib/node/{AutomationPanel-EPRDDR3A.cjs.map → AutomationPanel-4M55FURO.cjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/lib/node-esm/{AutomationPanel-DMLAGQS5.mjs.map → AutomationPanel-W6SKG35R.mjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|