@dxos/plugin-automation 0.8.0 → 0.8.1-main.013e445
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-ITYXSN5Z.mjs → AutomationPanel-NI3IZOYP.mjs} +4 -4
- package/dist/lib/browser/AutomationPanel-NI3IZOYP.mjs.map +7 -0
- package/dist/lib/browser/{chunk-U7QLNY2S.mjs → chunk-A564UUG6.mjs} +2 -2
- package/dist/lib/browser/{chunk-WY2C7JY4.mjs → chunk-TIVRUZAX.mjs} +3 -3
- package/dist/lib/browser/chunk-TIVRUZAX.mjs.map +7 -0
- package/dist/lib/browser/{chunk-OFDNNRLE.mjs → chunk-YGPROMMM.mjs} +1 -1
- package/dist/lib/browser/chunk-YGPROMMM.mjs.map +7 -0
- package/dist/lib/browser/{complementary-panel-4CPOJL4Y.mjs → complementary-panel-4YA2V2ZF.mjs} +2 -2
- package/dist/lib/browser/index.mjs +6 -6
- package/dist/lib/browser/index.mjs.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-SAPMN4PF.mjs → react-surface-G73EWBDI.mjs} +4 -4
- package/dist/lib/node/{AutomationPanel-X33HHDMQ.cjs → AutomationPanel-VBT57PEK.cjs} +17 -17
- package/dist/lib/node/AutomationPanel-VBT57PEK.cjs.map +7 -0
- package/dist/lib/node/{chunk-7Q5SNGCL.cjs → chunk-5XNEP3EC.cjs} +11 -11
- package/dist/lib/node/chunk-5XNEP3EC.cjs.map +7 -0
- package/dist/lib/node/{chunk-CB5OB6JH.cjs → chunk-PS7II4TG.cjs} +5 -5
- package/dist/lib/node/{chunk-ORMEYEBE.cjs → chunk-QSV6RXY2.cjs} +4 -4
- package/dist/lib/node/chunk-QSV6RXY2.cjs.map +7 -0
- package/dist/lib/node/{complementary-panel-ZYJJ42ZU.cjs → complementary-panel-WI3PVFP2.cjs} +6 -6
- package/dist/lib/node/index.cjs +18 -18
- package/dist/lib/node/index.cjs.map +2 -2
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-2WRVAPGR.cjs → react-surface-RDEWDPT2.cjs} +9 -9
- package/dist/lib/node-esm/{AutomationPanel-HY3GB4BT.mjs → AutomationPanel-AVT6M47N.mjs} +4 -4
- package/dist/lib/node-esm/AutomationPanel-AVT6M47N.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-6MUUH67V.mjs → chunk-DDLGDPOD.mjs} +1 -1
- package/dist/lib/node-esm/chunk-DDLGDPOD.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-R3P2WPBQ.mjs → chunk-QGANO7EX.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-UDD2VA6G.mjs → chunk-QQBV2QKA.mjs} +3 -3
- package/dist/lib/node-esm/chunk-QQBV2QKA.mjs.map +7 -0
- package/dist/lib/node-esm/{complementary-panel-S42RIIAY.mjs → complementary-panel-64JPIPNS.mjs} +2 -2
- package/dist/lib/node-esm/index.mjs +6 -6
- package/dist/lib/node-esm/index.mjs.map +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-QWLPOYXO.mjs → react-surface-I6NJHNXK.mjs} +4 -4
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +2 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +3 -2
- package/dist/types/src/components/TriggerEditor/TriggerEditor.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/meta.d.ts +2 -7
- package/dist/types/src/meta.d.ts.map +1 -1
- package/package.json +20 -20
- package/src/AutomationPlugin.tsx +1 -1
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +1 -1
- package/src/components/AutomationPanel/AutomationPanel.tsx +1 -1
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +1 -1
- package/src/components/TriggerEditor/TriggerEditor.tsx +1 -1
- package/src/meta.ts +2 -2
- package/dist/lib/browser/AutomationPanel-ITYXSN5Z.mjs.map +0 -7
- package/dist/lib/browser/chunk-OFDNNRLE.mjs.map +0 -7
- package/dist/lib/browser/chunk-WY2C7JY4.mjs.map +0 -7
- package/dist/lib/node/AutomationPanel-X33HHDMQ.cjs.map +0 -7
- package/dist/lib/node/chunk-7Q5SNGCL.cjs.map +0 -7
- package/dist/lib/node/chunk-ORMEYEBE.cjs.map +0 -7
- package/dist/lib/node-esm/AutomationPanel-HY3GB4BT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6MUUH67V.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UDD2VA6G.mjs.map +0 -7
- /package/dist/lib/browser/{chunk-U7QLNY2S.mjs.map → chunk-A564UUG6.mjs.map} +0 -0
- /package/dist/lib/browser/{complementary-panel-4CPOJL4Y.mjs.map → complementary-panel-4YA2V2ZF.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-SAPMN4PF.mjs.map → react-surface-G73EWBDI.mjs.map} +0 -0
- /package/dist/lib/node/{chunk-CB5OB6JH.cjs.map → chunk-PS7II4TG.cjs.map} +0 -0
- /package/dist/lib/node/{complementary-panel-ZYJJ42ZU.cjs.map → complementary-panel-WI3PVFP2.cjs.map} +0 -0
- /package/dist/lib/node/{react-surface-2WRVAPGR.cjs.map → react-surface-RDEWDPT2.cjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-R3P2WPBQ.mjs.map → chunk-QGANO7EX.mjs.map} +0 -0
- /package/dist/lib/node-esm/{complementary-panel-S42RIIAY.mjs.map → complementary-panel-64JPIPNS.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-QWLPOYXO.mjs.map → react-surface-I6NJHNXK.mjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytes":1789,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytes":17063,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytes":557,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx","kind":"import-statement","original":"./TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytes":20213,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts","kind":"import-statement","original":"../TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytes":751,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx","kind":"import-statement","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytes":927,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts","kind":"import-statement","original":"./TriggerEditor"},{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","kind":"dynamic-import","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/capabilities/complementary-panel.ts":{"bytes":6583,"imports":[{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions/types","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-deck","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/capabilities/react-surface.tsx":{"bytes":3118,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/capabilities/index.ts":{"bytes":1122,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/capabilities/complementary-panel.ts","kind":"dynamic-import","original":"./complementary-panel"},{"path":"packages/plugins/experimental/plugin-automation/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytes":2833,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytes":5111,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-deck","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-automation/src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytes":717,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx","kind":"import-statement","original":"./AutomationPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4092},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-R3P2WPBQ.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-UDD2VA6G.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-6MUUH67V.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-deck","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/complementary-panel-S42RIIAY.mjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/react-surface-QWLPOYXO.mjs","kind":"dynamic-import"}],"exports":["AUTOMATION_PLUGIN","AutomationPanel","AutomationPlugin","TriggerEditor","meta"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytesInOutput":1036},"packages/plugins/experimental/plugin-automation/src/capabilities/index.ts":{"bytesInOutput":198},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytesInOutput":719}},"bytes":2662},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/AutomationPanel-HY3GB4BT.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":11215},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/AutomationPanel-HY3GB4BT.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-UDD2VA6G.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-6MUUH67V.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytesInOutput":4744},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytesInOutput":47}},"bytes":5297},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/complementary-panel-S42RIIAY.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3447},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/complementary-panel-S42RIIAY.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-6MUUH67V.mjs","kind":"import-statement"},{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions/types","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-deck","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/capabilities/complementary-panel.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/capabilities/complementary-panel.ts":{"bytesInOutput":1547}},"bytes":1902},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/react-surface-QWLPOYXO.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1564},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/react-surface-QWLPOYXO.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-R3P2WPBQ.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-UDD2VA6G.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-6MUUH67V.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/capabilities/react-surface.tsx","inputs":{"packages/plugins/experimental/plugin-automation/src/capabilities/react-surface.tsx":{"bytesInOutput":590}},"bytes":1017},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-R3P2WPBQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":406},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-R3P2WPBQ.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/AutomationPanel-HY3GB4BT.mjs","kind":"dynamic-import"}],"exports":["AutomationPanel"],"inputs":{"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytesInOutput":106}},"bytes":349},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-UDD2VA6G.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8751},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-UDD2VA6G.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-6MUUH67V.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true}],"exports":["TriggerEditor"],"inputs":{"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytesInOutput":4289},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytesInOutput":0}},"bytes":4613},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-6MUUH67V.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":837},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-6MUUH67V.mjs":{"imports":[],"exports":["AUTOMATION_PLUGIN","meta"],"inputs":{"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytesInOutput":395}},"bytes":636}}}
|
|
1
|
+
{"inputs":{"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytes":1777,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytes":17077,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/functions/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytes":557,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx","kind":"import-statement","original":"./TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytes":20227,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions/types","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts","kind":"import-statement","original":"../TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytes":751,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx","kind":"import-statement","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytes":927,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts","kind":"import-statement","original":"./TriggerEditor"},{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","kind":"dynamic-import","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/capabilities/complementary-panel.ts":{"bytes":6583,"imports":[{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions/types","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-deck","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/capabilities/react-surface.tsx":{"bytes":3118,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/capabilities/index.ts":{"bytes":1122,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/capabilities/complementary-panel.ts","kind":"dynamic-import","original":"./complementary-panel"},{"path":"packages/plugins/experimental/plugin-automation/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytes":2833,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytes":5125,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-deck","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-automation/src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytes":717,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx","kind":"import-statement","original":"./AutomationPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4098},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-QGANO7EX.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-QQBV2QKA.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-DDLGDPOD.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-deck","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/complementary-panel-64JPIPNS.mjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/react-surface-I6NJHNXK.mjs","kind":"dynamic-import"}],"exports":["AUTOMATION_PLUGIN","AutomationPanel","AutomationPlugin","TriggerEditor","meta"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytesInOutput":1042},"packages/plugins/experimental/plugin-automation/src/capabilities/index.ts":{"bytesInOutput":198},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytesInOutput":719}},"bytes":2668},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/AutomationPanel-AVT6M47N.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":11221},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/AutomationPanel-AVT6M47N.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-QQBV2QKA.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-DDLGDPOD.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions/types","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytesInOutput":4750},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytesInOutput":47}},"bytes":5303},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/complementary-panel-64JPIPNS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3447},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/complementary-panel-64JPIPNS.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-DDLGDPOD.mjs","kind":"import-statement"},{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions/types","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-deck","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/capabilities/complementary-panel.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/capabilities/complementary-panel.ts":{"bytesInOutput":1547}},"bytes":1902},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/react-surface-I6NJHNXK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1564},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/react-surface-I6NJHNXK.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-QGANO7EX.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-QQBV2QKA.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-DDLGDPOD.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/capabilities/react-surface.tsx","inputs":{"packages/plugins/experimental/plugin-automation/src/capabilities/react-surface.tsx":{"bytesInOutput":590}},"bytes":1017},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-QGANO7EX.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":406},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-QGANO7EX.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/AutomationPanel-AVT6M47N.mjs","kind":"dynamic-import"}],"exports":["AutomationPanel"],"inputs":{"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytesInOutput":106}},"bytes":349},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-QQBV2QKA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8757},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-QQBV2QKA.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-DDLGDPOD.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/conductor","kind":"import-statement","external":true},{"path":"@dxos/functions/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true}],"exports":["TriggerEditor"],"inputs":{"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytesInOutput":4295},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytesInOutput":0}},"bytes":4619},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-DDLGDPOD.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":829},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-DDLGDPOD.mjs":{"imports":[],"exports":["AUTOMATION_PLUGIN","meta"],"inputs":{"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytesInOutput":395}},"bytes":636}}}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
AutomationPanel
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-QGANO7EX.mjs";
|
|
5
|
+
import "./chunk-QQBV2QKA.mjs";
|
|
6
6
|
import {
|
|
7
7
|
AUTOMATION_PLUGIN
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DDLGDPOD.mjs";
|
|
9
9
|
|
|
10
10
|
// packages/plugins/experimental/plugin-automation/src/capabilities/react-surface.tsx
|
|
11
11
|
import React from "react";
|
|
@@ -25,4 +25,4 @@ var react_surface_default = () => contributes(Capabilities.ReactSurface, [
|
|
|
25
25
|
export {
|
|
26
26
|
react_surface_default as default
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=react-surface-
|
|
28
|
+
//# sourceMappingURL=react-surface-I6NJHNXK.mjs.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { type Space, type ReactiveObject } from '@dxos/react-client/echo';
|
|
2
3
|
export type AutomationPanelProps = {
|
|
3
4
|
space: Space;
|
|
4
5
|
object?: ReactiveObject<any>;
|
|
5
6
|
};
|
|
6
|
-
export declare const AutomationPanel: ({ space, object }: AutomationPanelProps) =>
|
|
7
|
+
export declare const AutomationPanel: ({ space, object }: AutomationPanelProps) => React.JSX.Element;
|
|
7
8
|
//# sourceMappingURL=AutomationPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutomationPanel.d.ts","sourceRoot":"","sources":["../../../../../src/components/AutomationPanel/AutomationPanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AutomationPanel.d.ts","sourceRoot":"","sources":["../../../../../src/components/AutomationPanel/AutomationPanel.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAYxC,OAAO,EAA4B,KAAK,KAAK,EAAE,KAAK,cAAc,EAAY,MAAM,yBAAyB,CAAC;AAU9G,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;CAC9B,CAAC;AAGF,eAAO,MAAM,eAAe,sBAAuB,oBAAoB,sBAoGtE,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FunctionTriggerType, type FunctionTrigger } from '@dxos/functions/types';
|
|
2
3
|
import { type Space } from '@dxos/react-client/echo';
|
|
3
4
|
export type TriggerEditorProps = {
|
|
4
5
|
space: Space;
|
|
@@ -6,5 +7,5 @@ export type TriggerEditorProps = {
|
|
|
6
7
|
onSave?: (trigger: Omit<FunctionTrigger, 'id'>) => void;
|
|
7
8
|
onCancel?: () => void;
|
|
8
9
|
};
|
|
9
|
-
export declare const TriggerEditor: ({ space, trigger, onSave, onCancel }: TriggerEditorProps) =>
|
|
10
|
+
export declare const TriggerEditor: ({ space, trigger, onSave, onCancel }: TriggerEditorProps) => React.JSX.Element;
|
|
10
11
|
//# sourceMappingURL=TriggerEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TriggerEditor/TriggerEditor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TriggerEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TriggerEditor/TriggerEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EAGrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAoB,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAMvE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,mBAAmB,CAAC;IAC7B,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC;IACxD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,aAAa,yCAA0C,kBAAkB,sBAiGrF,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from './TriggerEditor';
|
|
2
|
-
export declare const AutomationPanel: import("react").LazyExoticComponent<({ space, object }: import("./AutomationPanel/AutomationPanel").AutomationPanelProps) => import("react
|
|
2
|
+
export declare const AutomationPanel: import("react").LazyExoticComponent<({ space, object }: import("./AutomationPanel/AutomationPanel").AutomationPanelProps) => import("react").JSX.Element>;
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAMA,cAAc,iBAAiB,CAAC;AAEhC,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAMA,cAAc,iBAAiB,CAAC;AAEhC,eAAO,MAAM,eAAe,2JAA0C,CAAC"}
|
package/dist/types/src/meta.d.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
+
import { type PluginMeta } from '@dxos/app-framework';
|
|
1
2
|
export declare const AUTOMATION_PLUGIN = "dxos.org/plugin/automation";
|
|
2
|
-
export declare const meta:
|
|
3
|
-
id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
description: string;
|
|
6
|
-
icon: string;
|
|
7
|
-
source: string;
|
|
8
|
-
};
|
|
3
|
+
export declare const meta: PluginMeta;
|
|
9
4
|
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,eAAO,MAAM,iBAAiB,+BAA+B,CAAC;AAE9D,eAAO,MAAM,IAAI,EAAE,UAOlB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-automation",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1-main.013e445",
|
|
4
4
|
"description": "Prompt chain plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -26,20 +26,20 @@
|
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@preact/signals-core": "^1.6.0",
|
|
29
|
-
"@dxos/
|
|
30
|
-
"@dxos/
|
|
31
|
-
"@dxos/conductor": "0.8.
|
|
32
|
-
"@dxos/
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/live-object": "0.8.
|
|
36
|
-
"@dxos/log": "0.8.
|
|
37
|
-
"@dxos/plugin-
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/react-client": "0.8.
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/react-ui-list": "0.8.
|
|
42
|
-
"@dxos/util": "0.8.
|
|
29
|
+
"@dxos/app-framework": "0.8.1-main.013e445",
|
|
30
|
+
"@dxos/async": "0.8.1-main.013e445",
|
|
31
|
+
"@dxos/conductor": "0.8.1-main.013e445",
|
|
32
|
+
"@dxos/echo-schema": "0.8.1-main.013e445",
|
|
33
|
+
"@dxos/functions": "0.8.1-main.013e445",
|
|
34
|
+
"@dxos/invariant": "0.8.1-main.013e445",
|
|
35
|
+
"@dxos/live-object": "0.8.1-main.013e445",
|
|
36
|
+
"@dxos/log": "0.8.1-main.013e445",
|
|
37
|
+
"@dxos/plugin-deck": "0.8.1-main.013e445",
|
|
38
|
+
"@dxos/plugin-client": "0.8.1-main.013e445",
|
|
39
|
+
"@dxos/react-client": "0.8.1-main.013e445",
|
|
40
|
+
"@dxos/react-ui-form": "0.8.1-main.013e445",
|
|
41
|
+
"@dxos/react-ui-list": "0.8.1-main.013e445",
|
|
42
|
+
"@dxos/util": "0.8.1-main.013e445"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/react": "~18.2.0",
|
|
@@ -47,15 +47,15 @@
|
|
|
47
47
|
"react": "~18.2.0",
|
|
48
48
|
"react-dom": "~18.2.0",
|
|
49
49
|
"vite": "5.4.7",
|
|
50
|
-
"@dxos/react-ui": "0.8.
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
50
|
+
"@dxos/react-ui": "0.8.1-main.013e445",
|
|
51
|
+
"@dxos/storybook-utils": "0.8.1-main.013e445",
|
|
52
|
+
"@dxos/react-ui-theme": "0.8.1-main.013e445"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"react": "~18.2.0",
|
|
56
56
|
"react-dom": "~18.2.0",
|
|
57
|
-
"@dxos/react-ui-theme": "0.8.
|
|
58
|
-
"@dxos/react-ui": "0.8.
|
|
57
|
+
"@dxos/react-ui-theme": "0.8.1-main.013e445",
|
|
58
|
+
"@dxos/react-ui": "0.8.1-main.013e445"
|
|
59
59
|
},
|
|
60
60
|
"publishConfig": {
|
|
61
61
|
"access": "public"
|
package/src/AutomationPlugin.tsx
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Capabilities, contributes, defineModule, definePlugin, Events } from '@dxos/app-framework';
|
|
6
|
-
import { FunctionType, FunctionTrigger } from '@dxos/functions';
|
|
6
|
+
import { FunctionType, FunctionTrigger } from '@dxos/functions/types';
|
|
7
7
|
import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
|
|
8
8
|
import { DeckEvents } from '@dxos/plugin-deck';
|
|
9
9
|
|
|
@@ -7,7 +7,7 @@ import '@dxos-theme';
|
|
|
7
7
|
import { type Meta } from '@storybook/react';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
|
-
import { FunctionType, FunctionTrigger } from '@dxos/functions';
|
|
10
|
+
import { FunctionType, FunctionTrigger } from '@dxos/functions/types';
|
|
11
11
|
import { create, useSpaces } from '@dxos/react-client/echo';
|
|
12
12
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
13
13
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
TriggerKind,
|
|
13
13
|
type FunctionTriggerType,
|
|
14
14
|
ScriptType,
|
|
15
|
-
} from '@dxos/functions';
|
|
15
|
+
} from '@dxos/functions/types';
|
|
16
16
|
import { type Client, useClient } from '@dxos/react-client';
|
|
17
17
|
import { create, Filter, useQuery, type Space, type ReactiveObject, getSpace } from '@dxos/react-client/echo';
|
|
18
18
|
import { Clipboard, IconButton, Input, useTranslation } from '@dxos/react-ui';
|
|
@@ -7,7 +7,7 @@ import '@dxos-theme';
|
|
|
7
7
|
import { type Meta } from '@storybook/react';
|
|
8
8
|
import React, { useEffect, useState } from 'react';
|
|
9
9
|
|
|
10
|
-
import { FunctionType, FunctionTrigger, TriggerKind } from '@dxos/functions';
|
|
10
|
+
import { FunctionType, FunctionTrigger, TriggerKind } from '@dxos/functions/types';
|
|
11
11
|
import { create } from '@dxos/live-object';
|
|
12
12
|
import { useSpaces } from '@dxos/react-client/echo';
|
|
13
13
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
type FunctionTrigger,
|
|
13
13
|
ScriptType,
|
|
14
14
|
TriggerKind,
|
|
15
|
-
} from '@dxos/functions';
|
|
15
|
+
} from '@dxos/functions/types';
|
|
16
16
|
import { Filter, useQuery, type Space } from '@dxos/react-client/echo';
|
|
17
17
|
import { IconButton, Input, useTranslation } from '@dxos/react-ui';
|
|
18
18
|
import { Form, SelectInput, TextInput } from '@dxos/react-ui-form';
|
package/src/meta.ts
CHANGED
|
@@ -6,11 +6,11 @@ import { type PluginMeta } from '@dxos/app-framework';
|
|
|
6
6
|
|
|
7
7
|
export const AUTOMATION_PLUGIN = 'dxos.org/plugin/automation';
|
|
8
8
|
|
|
9
|
-
export const meta = {
|
|
9
|
+
export const meta: PluginMeta = {
|
|
10
10
|
id: AUTOMATION_PLUGIN,
|
|
11
11
|
name: 'Automation',
|
|
12
12
|
description:
|
|
13
13
|
'The Automation tab allows you to trigger pre-defined workflows related to the element you are interacting with inside of Composer.',
|
|
14
14
|
icon: 'ph--robot--regular',
|
|
15
15
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-automation',
|
|
16
|
-
}
|
|
16
|
+
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/AutomationPanel/AutomationPanel.tsx", "../../../src/components/AutomationPanel/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useState } from 'react';\n\nimport { S } from '@dxos/echo-schema';\nimport {\n FunctionType,\n FunctionTrigger,\n FunctionTriggerSchema,\n TriggerKind,\n type FunctionTriggerType,\n ScriptType,\n} from '@dxos/functions';\nimport { type Client, useClient } from '@dxos/react-client';\nimport { create, Filter, useQuery, type Space, type ReactiveObject, getSpace } from '@dxos/react-client/echo';\nimport { Clipboard, IconButton, Input, useTranslation } from '@dxos/react-ui';\nimport { List } from '@dxos/react-ui-list';\nimport { ghostHover, mx } from '@dxos/react-ui-theme';\n\nimport { AUTOMATION_PLUGIN } from '../../meta';\nimport { TriggerEditor, type TriggerEditorProps } from '../TriggerEditor';\n\nconst grid = 'grid grid-cols-[40px_1fr_32px] min-bs-[2.5rem]';\n\nexport type AutomationPanelProps = {\n space: Space;\n object?: ReactiveObject<any>;\n};\n\n// TODO(burdon): Factor out common layout with ViewEditor.\nexport const AutomationPanel = ({ space, object }: AutomationPanelProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n const client = useClient();\n const triggers = useQuery(space, Filter.schema(FunctionTrigger));\n const functions = useQuery(space, Filter.schema(FunctionType));\n const scripts = useQuery(space, Filter.schema(ScriptType));\n\n const [trigger, setTrigger] = useState<FunctionTriggerType>();\n const [selected, setSelected] = useState<FunctionTrigger>();\n\n const handleSelect = (trigger: FunctionTrigger) => {\n const { id: _, ...values } = trigger;\n setTrigger(values);\n setSelected(trigger);\n };\n\n const handleAdd = () => {\n setTrigger(create(FunctionTriggerSchema, { meta: {} }));\n setSelected(undefined);\n };\n\n const handleDelete = (trigger: FunctionTrigger) => {\n space.db.remove(trigger);\n setTrigger(undefined);\n setSelected(undefined);\n };\n\n const handleSave: TriggerEditorProps['onSave'] = (trigger) => {\n if (selected) {\n Object.assign(selected, trigger);\n } else {\n space.db.add(create(FunctionTrigger, trigger));\n }\n\n setTrigger(undefined);\n setSelected(undefined);\n };\n\n const handleCancel: TriggerEditorProps['onCancel'] = () => {\n setTrigger(undefined);\n };\n\n return (\n <Clipboard.Provider>\n <div className='flex flex-col w-full'>\n {!trigger && (\n <List.Root<FunctionTrigger> items={triggers} isItem={S.is(FunctionTrigger)} getId={(field) => field.id}>\n {({ items: triggers }) => (\n <div role='list' className='flex flex-col w-full'>\n {triggers?.map((trigger) => {\n const copyAction = getCopyAction(client, trigger);\n return (\n <List.Item<FunctionTrigger>\n key={trigger.id}\n item={trigger}\n classNames={mx(grid, ghostHover, 'items-center', 'px-2')}\n >\n <Input.Root>\n <Input.Switch\n checked={trigger.enabled}\n onCheckedChange={(checked) => (trigger.enabled = checked)}\n />\n </Input.Root>\n\n <div className={'flex'}>\n <List.ItemTitle\n classNames='px-1 cursor-pointer w-0 shrink truncate'\n onClick={() => handleSelect(trigger)}\n >\n {getFunctionName(scripts, functions, trigger) ?? '∅'}\n </List.ItemTitle>\n\n {/* TODO: a better way to expose copy action */}\n {copyAction && (\n <Clipboard.IconButton\n label={t(copyAction.translationKey)}\n value={copyAction.contentProvider()}\n />\n )}\n </div>\n\n <List.ItemDeleteButton onClick={() => handleDelete(trigger)} />\n </List.Item>\n );\n })}\n </div>\n )}\n </List.Root>\n )}\n\n {trigger && <TriggerEditor space={space} trigger={trigger} onSave={handleSave} onCancel={handleCancel} />}\n\n {!trigger && (\n <div className='flex p-2 justify-center'>\n <IconButton icon='ph--plus--regular' label={t('new trigger label')} onClick={handleAdd} />\n </div>\n )}\n </div>\n </Clipboard.Provider>\n );\n};\n\nconst getCopyAction = (client: Client, trigger: FunctionTrigger | undefined) => {\n if (trigger?.spec?.type === TriggerKind.Email) {\n return { translationKey: 'trigger copy email', contentProvider: () => `${getSpace(trigger)!.id}@dxos.network` };\n }\n\n if (trigger?.spec?.type === TriggerKind.Webhook) {\n return { translationKey: 'trigger copy url', contentProvider: () => getWebhookUrl(client, trigger) };\n }\n\n return undefined;\n};\n\nconst getWebhookUrl = (client: Client, trigger: FunctionTrigger) => {\n const spaceId = getSpace(trigger)!.id;\n const edgeUrl = new URL(client.config.values.runtime!.services!.edge!.url!);\n const isSecure = edgeUrl.protocol.startsWith('https') || edgeUrl.protocol.startsWith('wss');\n edgeUrl.protocol = isSecure ? 'https' : 'http';\n return new URL(`/webhook/${spaceId}:${trigger.id}`, edgeUrl).toString();\n};\n\nconst getFunctionName = (scripts: ScriptType[], functions: FunctionType[], trigger: FunctionTriggerType) => {\n // TODO(wittjosiah): Truncation should be done in the UI.\n // Warning that the List component is currently a can of worms.\n const shortId = trigger.function && `${trigger.function?.slice(0, 16)}…`;\n const functionObject = functions.find((fn) => `dxn:worker:${fn.name}` === trigger.function);\n if (!functionObject) {\n return shortId;\n }\n return scripts.find((s) => functionObject.source?.target?.id === s.id)?.name ?? shortId;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { AutomationPanel } from './AutomationPanel';\n\nexport default AutomationPanel;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,OAAOA,SAASC,gBAAgB;AAEhC,SAASC,SAAS;AAClB,SACEC,cACAC,iBACAC,uBACAC,aAEAC,kBACK;AACP,SAAsBC,iBAAiB;AACvC,SAASC,QAAQC,QAAQC,UAA2CC,gBAAgB;AACpF,SAASC,WAAWC,YAAYC,OAAOC,sBAAsB;AAC7D,SAASC,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8D,MAAMC,SAASC,YAAYC,OAAO;AAC7C,WAAO;MAAEX,gBAAgB;MAAsBE,iBAAiB,MAAM,GAAGU,SAASlE,OAAAA,EAAUM,EAAE;IAAgB;EAChH;AAEA,MAAIN,SAAS8D,MAAMC,SAASC,YAAYG,SAAS;AAC/C,WAAO;MAAEb,gBAAgB;MAAoBE,iBAAiB,MAAMY,cAAc/E,QAAQW,OAAAA;IAAS;EACrG;AAEA,SAAOa;AACT;AAEA,IAAMuD,gBAAgB,CAAC/E,QAAgBW,YAAAA;AACrC,QAAMqE,UAAUH,SAASlE,OAAAA,EAAUM;AACnC,QAAMgE,UAAU,IAAIC,IAAIlF,OAAOmF,OAAOhE,OAAOiE,QAASC,SAAUC,KAAMC,GAAG;AACzE,QAAMC,WAAWP,QAAQQ,SAASC,WAAW,OAAA,KAAYT,QAAQQ,SAASC,WAAW,KAAA;AACrFT,UAAQQ,WAAWD,WAAW,UAAU;AACxC,SAAO,IAAIN,IAAI,YAAYF,OAAAA,IAAWrE,QAAQM,EAAE,IAAIgE,OAAAA,EAASU,SAAQ;AACvE;AAEA,IAAM7B,kBAAkB,CAACrD,SAAuBF,WAA2BI,YAAAA;AAGzE,QAAMiF,UAAUjF,QAAQkF,YAAY,GAAGlF,QAAQkF,UAAUC,MAAM,GAAG,EAAA,CAAA;AAClE,QAAMC,iBAAiBxF,UAAUyF,KAAK,CAACC,OAAO,cAAcA,GAAGC,IAAI,OAAOvF,QAAQkF,QAAQ;AAC1F,MAAI,CAACE,gBAAgB;AACnB,WAAOH;EACT;AACA,SAAOnF,QAAQuF,KAAK,CAACG,MAAMJ,eAAeK,QAAQC,QAAQpF,OAAOkF,EAAElF,EAAE,GAAGiF,QAAQN;AAClF;;;AC7JA,IAAA,0BAAeU;",
|
|
6
|
-
"names": ["React", "useState", "S", "FunctionType", "FunctionTrigger", "FunctionTriggerSchema", "TriggerKind", "ScriptType", "useClient", "create", "Filter", "useQuery", "getSpace", "Clipboard", "IconButton", "Input", "useTranslation", "List", "ghostHover", "mx", "grid", "AutomationPanel", "space", "object", "t", "useTranslation", "AUTOMATION_PLUGIN", "client", "useClient", "triggers", "useQuery", "Filter", "schema", "FunctionTrigger", "functions", "FunctionType", "scripts", "ScriptType", "trigger", "setTrigger", "useState", "selected", "setSelected", "handleSelect", "id", "_", "values", "handleAdd", "create", "FunctionTriggerSchema", "meta", "undefined", "handleDelete", "db", "remove", "handleSave", "Object", "assign", "add", "handleCancel", "Clipboard", "Provider", "div", "className", "List", "Root", "items", "isItem", "S", "is", "getId", "field", "role", "map", "copyAction", "getCopyAction", "Item", "key", "item", "classNames", "mx", "ghostHover", "Input", "Switch", "checked", "enabled", "onCheckedChange", "ItemTitle", "onClick", "getFunctionName", "IconButton", "label", "translationKey", "value", "contentProvider", "ItemDeleteButton", "TriggerEditor", "onSave", "onCancel", "icon", "spec", "type", "TriggerKind", "Email", "getSpace", "Webhook", "getWebhookUrl", "spaceId", "edgeUrl", "URL", "config", "runtime", "services", "edge", "url", "isSecure", "protocol", "startsWith", "toString", "shortId", "function", "slice", "functionObject", "find", "fn", "name", "s", "source", "target", "AutomationPanel"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const AUTOMATION_PLUGIN = 'dxos.org/plugin/automation';\n\nexport const meta = {\n id: AUTOMATION_PLUGIN,\n name: 'Automation',\n description:\n 'The Automation tab allows you to trigger pre-defined workflows related to the element you are interacting with inside of Composer.',\n icon: 'ph--robot--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-automation',\n} satisfies PluginMeta;\n"],
|
|
5
|
-
"mappings": ";AAMO,IAAMA,oBAAoB;AAE1B,IAAMC,OAAO;EAClBC,IAAIF;EACJG,MAAM;EACNC,aACE;EACFC,MAAM;EACNC,QAAQ;AACV;",
|
|
6
|
-
"names": ["AUTOMATION_PLUGIN", "meta", "id", "name", "description", "icon", "source"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/TriggerEditor/TriggerEditor.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useEffect, useState } from 'react';\n\nimport { ComputeGraph } from '@dxos/conductor';\nimport {\n FunctionType,\n FunctionTriggerSchema,\n type FunctionTriggerType,\n type FunctionTrigger,\n ScriptType,\n TriggerKind,\n} from '@dxos/functions';\nimport { Filter, useQuery, type Space } from '@dxos/react-client/echo';\nimport { IconButton, Input, useTranslation } from '@dxos/react-ui';\nimport { Form, SelectInput, TextInput } from '@dxos/react-ui-form';\n\nimport { AUTOMATION_PLUGIN } from '../../meta';\n\nexport type TriggerEditorProps = {\n space: Space;\n trigger: FunctionTriggerType;\n onSave?: (trigger: Omit<FunctionTrigger, 'id'>) => void;\n onCancel?: () => void;\n};\n\nexport const TriggerEditor = ({ space, trigger, onSave, onCancel }: TriggerEditorProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n\n const functions = useQuery(space, Filter.schema(FunctionType));\n const workflows = useQuery(space, Filter.schema(ComputeGraph));\n const scripts = useQuery(space, Filter.schema(ScriptType));\n\n const handleSave = (values: FunctionTriggerType) => {\n onSave?.(values);\n };\n\n return (\n <Form<FunctionTriggerType>\n schema={FunctionTriggerSchema}\n values={trigger}\n onSave={handleSave}\n onCancel={onCancel}\n Custom={{\n ['function' satisfies keyof FunctionTriggerType]: (props) => (\n <SelectInput\n {...props}\n options={getWorkflowOptions(workflows).concat(getFunctionOptions(scripts, functions))}\n />\n ),\n ['spec.type' as const]: (props) => (\n <SelectInput\n {...props}\n options={Object.values(TriggerKind).map((kind) => ({\n value: kind,\n label: t(`trigger type ${kind}`),\n }))}\n />\n ),\n ['meta' as const]: (props) => {\n const meta = props.getValue()!;\n useEffect(() => props.onValueChange('object', { ...meta }), []);\n const [newMetaFieldName, setNewMetaFieldName] = useState('');\n\n return (\n <>\n <div>{props.label}</div>\n {[...Object.keys(meta)].map((key) => {\n const compositeKey: any = `meta.${key}`;\n return (\n <div key={compositeKey} role='none' className='flex items-center mt-2 gap-1'>\n <div role='none' className='flex-1'>\n <TextInput\n {...props}\n getValue={() => (props.getValue() as any)[key]}\n type={'string'}\n label={key}\n />\n </div>\n <IconButton\n icon='ph--trash--regular'\n iconOnly\n classNames={'mt-6'}\n label={t('trigger meta remove')}\n onClick={() => {\n const newValues: any = { ...props.getValue() };\n delete newValues[key];\n props.onValueChange('object', newValues);\n }}\n />\n </div>\n );\n })}\n <div role='none' className='flex items-center mt-2 gap-1 plb-1'>\n <div role='none' className='flex-1'>\n <Input.Root>\n <Input.TextInput\n placeholder={t('trigger meta prop name placeholder')}\n value={newMetaFieldName}\n onChange={(event) => setNewMetaFieldName(event.target.value)}\n />\n </Input.Root>\n </div>\n <IconButton\n icon='ph--plus--regular'\n iconOnly\n label={t('trigger meta add')}\n onClick={() => {\n if (newMetaFieldName.length) {\n const meta = props.getValue() ?? {};\n const metaWithNewProp = { ...meta, [newMetaFieldName]: '' };\n setNewMetaFieldName('');\n props.onValueChange('object', metaWithNewProp);\n }\n }}\n />\n </div>\n </>\n );\n },\n }}\n />\n );\n};\n\nconst getWorkflowOptions = (graphs: ComputeGraph[]) => {\n return graphs.map((graph) => ({ label: `compute-${graph.id}`, value: `dxn:echo:@:${graph.id}` }));\n};\n\nconst getFunctionOptions = (scripts: ScriptType[], functions: FunctionType[]) => {\n const getLabel = (fn: FunctionType) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;\n return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:worker:${fn.name}` }));\n};\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,OAAOA,SAASC,WAAWC,gBAAgB;AAE3C,SAASC,o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ACF;;AAGN;AAEA,IAAMrC,qBAAqB,CAACsC,WAAAA;AAC1B,SAAOA,OAAOjC,IAAI,CAACkC,WAAW;IAAE/B,OAAO,WAAW+B,MAAMC,EAAE;IAAIjC,OAAO,cAAcgC,MAAMC,EAAE;EAAG,EAAA;AAChG;AAEA,IAAMtC,qBAAqB,CAACZ,SAAuBP,cAAAA;AACjD,QAAM0D,WAAW,CAACC,OAAqBpD,QAAQqD,KAAK,CAACC,MAAMF,GAAGG,QAAQV,QAAQK,OAAOI,EAAEJ,EAAE,GAAGM,QAAQJ,GAAGI;AACvG,SAAO/D,UAAUsB,IAAI,CAACqC,QAAQ;IAAElC,OAAOiC,SAASC,EAAAA;IAAKnC,OAAO,cAAcmC,GAAGI,IAAI;EAAG,EAAA;AACtF;",
|
|
6
|
-
"names": ["React", "useEffect", "useState", "ComputeGraph", "FunctionType", "FunctionTriggerSchema", "ScriptType", "TriggerKind", "Filter", "useQuery", "IconButton", "Input", "useTranslation", "Form", "SelectInput", "TextInput", "TriggerEditor", "space", "trigger", "onSave", "onCancel", "t", "useTranslation", "AUTOMATION_PLUGIN", "functions", "useQuery", "Filter", "schema", "FunctionType", "workflows", "ComputeGraph", "scripts", "ScriptType", "handleSave", "values", "Form", "FunctionTriggerSchema", "Custom", "props", "SelectInput", "options", "getWorkflowOptions", "concat", "getFunctionOptions", "Object", "TriggerKind", "map", "kind", "value", "label", "meta", "getValue", "useEffect", "onValueChange", "newMetaFieldName", "setNewMetaFieldName", "useState", "div", "keys", "key", "compositeKey", "role", "className", "TextInput", "type", "IconButton", "icon", "iconOnly", "classNames", "onClick", "newValues", "Input", "Root", "placeholder", "onChange", "event", "target", "length", "metaWithNewProp", "graphs", "graph", "id", "getLabel", "fn", "find", "s", "source", "name"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/AutomationPanel/AutomationPanel.tsx", "../../../src/components/AutomationPanel/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useState } from 'react';\n\nimport { S } from '@dxos/echo-schema';\nimport {\n FunctionType,\n FunctionTrigger,\n FunctionTriggerSchema,\n TriggerKind,\n type FunctionTriggerType,\n ScriptType,\n} from '@dxos/functions';\nimport { type Client, useClient } from '@dxos/react-client';\nimport { create, Filter, useQuery, type Space, type ReactiveObject, getSpace } from '@dxos/react-client/echo';\nimport { Clipboard, IconButton, Input, useTranslation } from '@dxos/react-ui';\nimport { List } from '@dxos/react-ui-list';\nimport { ghostHover, mx } from '@dxos/react-ui-theme';\n\nimport { AUTOMATION_PLUGIN } from '../../meta';\nimport { TriggerEditor, type TriggerEditorProps } from '../TriggerEditor';\n\nconst grid = 'grid grid-cols-[40px_1fr_32px] min-bs-[2.5rem]';\n\nexport type AutomationPanelProps = {\n space: Space;\n object?: ReactiveObject<any>;\n};\n\n// TODO(burdon): Factor out common layout with ViewEditor.\nexport const AutomationPanel = ({ space, object }: AutomationPanelProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n const client = useClient();\n const triggers = useQuery(space, Filter.schema(FunctionTrigger));\n const functions = useQuery(space, Filter.schema(FunctionType));\n const scripts = useQuery(space, Filter.schema(ScriptType));\n\n const [trigger, setTrigger] = useState<FunctionTriggerType>();\n const [selected, setSelected] = useState<FunctionTrigger>();\n\n const handleSelect = (trigger: FunctionTrigger) => {\n const { id: _, ...values } = trigger;\n setTrigger(values);\n setSelected(trigger);\n };\n\n const handleAdd = () => {\n setTrigger(create(FunctionTriggerSchema, { meta: {} }));\n setSelected(undefined);\n };\n\n const handleDelete = (trigger: FunctionTrigger) => {\n space.db.remove(trigger);\n setTrigger(undefined);\n setSelected(undefined);\n };\n\n const handleSave: TriggerEditorProps['onSave'] = (trigger) => {\n if (selected) {\n Object.assign(selected, trigger);\n } else {\n space.db.add(create(FunctionTrigger, trigger));\n }\n\n setTrigger(undefined);\n setSelected(undefined);\n };\n\n const handleCancel: TriggerEditorProps['onCancel'] = () => {\n setTrigger(undefined);\n };\n\n return (\n <Clipboard.Provider>\n <div className='flex flex-col w-full'>\n {!trigger && (\n <List.Root<FunctionTrigger> items={triggers} isItem={S.is(FunctionTrigger)} getId={(field) => field.id}>\n {({ items: triggers }) => (\n <div role='list' className='flex flex-col w-full'>\n {triggers?.map((trigger) => {\n const copyAction = getCopyAction(client, trigger);\n return (\n <List.Item<FunctionTrigger>\n key={trigger.id}\n item={trigger}\n classNames={mx(grid, ghostHover, 'items-center', 'px-2')}\n >\n <Input.Root>\n <Input.Switch\n checked={trigger.enabled}\n onCheckedChange={(checked) => (trigger.enabled = checked)}\n />\n </Input.Root>\n\n <div className={'flex'}>\n <List.ItemTitle\n classNames='px-1 cursor-pointer w-0 shrink truncate'\n onClick={() => handleSelect(trigger)}\n >\n {getFunctionName(scripts, functions, trigger) ?? '∅'}\n </List.ItemTitle>\n\n {/* TODO: a better way to expose copy action */}\n {copyAction && (\n <Clipboard.IconButton\n label={t(copyAction.translationKey)}\n value={copyAction.contentProvider()}\n />\n )}\n </div>\n\n <List.ItemDeleteButton onClick={() => handleDelete(trigger)} />\n </List.Item>\n );\n })}\n </div>\n )}\n </List.Root>\n )}\n\n {trigger && <TriggerEditor space={space} trigger={trigger} onSave={handleSave} onCancel={handleCancel} />}\n\n {!trigger && (\n <div className='flex p-2 justify-center'>\n <IconButton icon='ph--plus--regular' label={t('new trigger label')} onClick={handleAdd} />\n </div>\n )}\n </div>\n </Clipboard.Provider>\n );\n};\n\nconst getCopyAction = (client: Client, trigger: FunctionTrigger | undefined) => {\n if (trigger?.spec?.type === TriggerKind.Email) {\n return { translationKey: 'trigger copy email', contentProvider: () => `${getSpace(trigger)!.id}@dxos.network` };\n }\n\n if (trigger?.spec?.type === TriggerKind.Webhook) {\n return { translationKey: 'trigger copy url', contentProvider: () => getWebhookUrl(client, trigger) };\n }\n\n return undefined;\n};\n\nconst getWebhookUrl = (client: Client, trigger: FunctionTrigger) => {\n const spaceId = getSpace(trigger)!.id;\n const edgeUrl = new URL(client.config.values.runtime!.services!.edge!.url!);\n const isSecure = edgeUrl.protocol.startsWith('https') || edgeUrl.protocol.startsWith('wss');\n edgeUrl.protocol = isSecure ? 'https' : 'http';\n return new URL(`/webhook/${spaceId}:${trigger.id}`, edgeUrl).toString();\n};\n\nconst getFunctionName = (scripts: ScriptType[], functions: FunctionType[], trigger: FunctionTriggerType) => {\n // TODO(wittjosiah): Truncation should be done in the UI.\n // Warning that the List component is currently a can of worms.\n const shortId = trigger.function && `${trigger.function?.slice(0, 16)}…`;\n const functionObject = functions.find((fn) => `dxn:worker:${fn.name}` === trigger.function);\n if (!functionObject) {\n return shortId;\n }\n return scripts.find((s) => functionObject.source?.target?.id === s.id)?.name ?? shortId;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { AutomationPanel } from './AutomationPanel';\n\nexport default AutomationPanel;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAgC;AAEhC,yBAAkB;AAClB,uBAOO;AACP,0BAAuC;AACvC,kBAAoF;AACpF,sBAA6D;AAC7D,2BAAqB;AACrB,4BAA+B;AAK/B,IAAMA,OAAO;AAQN,IAAMC,kBAAkB,CAAC,EAAEC,OAAOC,OAAM,MAAwB;AACrE,QAAM,EAAEC,EAAC,QAAKC,gCAAeC,uCAAAA;AAC7B,QAAMC,aAASC,+BAAAA;AACf,QAAMC,eAAWC,sBAASR,OAAOS,mBAAOC,OAAOC,gCAAAA,CAAAA;AAC/C,QAAMC,gBAAYJ,sBAASR,OAAOS,mBAAOC,OAAOG,6BAAAA,CAAAA;AAChD,QAAMC,cAAUN,sBAASR,OAAOS,mBAAOC,OAAOK,2BAAAA,CAAAA;AAE9C,QAAM,CAACC,SAASC,UAAAA,QAAcC,uBAAAA;AAC9B,QAAM,CAACC,UAAUC,WAAAA,QAAeF,uBAAAA;AAEhC,QAAMG,eAAe,CAACL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A,EAAUM;AACnC,QAAMiE,UAAU,IAAIC,IAAInF,OAAOoF,OAAOjE,OAAOkE,QAASC,SAAUC,KAAMC,GAAG;AACzE,QAAMC,WAAWP,QAAQQ,SAASC,WAAW,OAAA,KAAYT,QAAQQ,SAASC,WAAW,KAAA;AACrFT,UAAQQ,WAAWD,WAAW,UAAU;AACxC,SAAO,IAAIN,IAAI,YAAYF,OAAAA,IAAWtE,QAAQM,EAAE,IAAIiE,OAAAA,EAASU,SAAQ;AACvE;AAEA,IAAM7B,kBAAkB,CAACtD,SAAuBF,WAA2BI,YAAAA;AAGzE,QAAMkF,UAAUlF,QAAQmF,YAAY,GAAGnF,QAAQmF,UAAUC,MAAM,GAAG,EAAA,CAAA;AAClE,QAAMC,iBAAiBzF,UAAU0F,KAAK,CAACC,OAAO,cAAcA,GAAGC,IAAI,OAAOxF,QAAQmF,QAAQ;AAC1F,MAAI,CAACE,gBAAgB;AACnB,WAAOH;EACT;AACA,SAAOpF,QAAQwF,KAAK,CAACG,MAAMJ,eAAeK,QAAQC,QAAQrF,OAAOmF,EAAEnF,EAAE,GAAGkF,QAAQN;AAClF;AC7JA,IAAA,0BAAenG;",
|
|
6
|
-
"names": ["grid", "AutomationPanel", "space", "object", "t", "useTranslation", "AUTOMATION_PLUGIN", "client", "useClient", "triggers", "useQuery", "Filter", "schema", "FunctionTrigger", "functions", "FunctionType", "scripts", "ScriptType", "trigger", "setTrigger", "useState", "selected", "setSelected", "handleSelect", "id", "_", "values", "handleAdd", "create", "FunctionTriggerSchema", "meta", "undefined", "handleDelete", "db", "remove", "handleSave", "Object", "assign", "add", "handleCancel", "React", "Clipboard", "Provider", "div", "className", "List", "Root", "items", "isItem", "S", "is", "getId", "field", "role", "map", "copyAction", "getCopyAction", "Item", "key", "item", "classNames", "mx", "ghostHover", "Input", "Switch", "checked", "enabled", "onCheckedChange", "ItemTitle", "onClick", "getFunctionName", "IconButton", "label", "translationKey", "value", "contentProvider", "ItemDeleteButton", "TriggerEditor", "onSave", "onCancel", "icon", "spec", "type", "TriggerKind", "Email", "getSpace", "Webhook", "getWebhookUrl", "spaceId", "edgeUrl", "URL", "config", "runtime", "services", "edge", "url", "isSecure", "protocol", "startsWith", "toString", "shortId", "function", "slice", "functionObject", "find", "fn", "name", "s", "source", "target"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/TriggerEditor/TriggerEditor.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useEffect, useState } from 'react';\n\nimport { ComputeGraph } from '@dxos/conductor';\nimport {\n FunctionType,\n FunctionTriggerSchema,\n type FunctionTriggerType,\n type FunctionTrigger,\n ScriptType,\n TriggerKind,\n} from '@dxos/functions';\nimport { Filter, useQuery, type Space } from '@dxos/react-client/echo';\nimport { IconButton, Input, useTranslation } from '@dxos/react-ui';\nimport { Form, SelectInput, TextInput } from '@dxos/react-ui-form';\n\nimport { AUTOMATION_PLUGIN } from '../../meta';\n\nexport type TriggerEditorProps = {\n space: Space;\n trigger: FunctionTriggerType;\n onSave?: (trigger: Omit<FunctionTrigger, 'id'>) => void;\n onCancel?: () => void;\n};\n\nexport const TriggerEditor = ({ space, trigger, onSave, onCancel }: TriggerEditorProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n\n const functions = useQuery(space, Filter.schema(FunctionType));\n const workflows = useQuery(space, Filter.schema(ComputeGraph));\n const scripts = useQuery(space, Filter.schema(ScriptType));\n\n const handleSave = (values: FunctionTriggerType) => {\n onSave?.(values);\n };\n\n return (\n <Form<FunctionTriggerType>\n schema={FunctionTriggerSchema}\n values={trigger}\n onSave={handleSave}\n onCancel={onCancel}\n Custom={{\n ['function' satisfies keyof FunctionTriggerType]: (props) => (\n <SelectInput\n {...props}\n options={getWorkflowOptions(workflows).concat(getFunctionOptions(scripts, functions))}\n />\n ),\n ['spec.type' as const]: (props) => (\n <SelectInput\n {...props}\n options={Object.values(TriggerKind).map((kind) => ({\n value: kind,\n label: t(`trigger type ${kind}`),\n }))}\n />\n ),\n ['meta' as const]: (props) => {\n const meta = props.getValue()!;\n useEffect(() => props.onValueChange('object', { ...meta }), []);\n const [newMetaFieldName, setNewMetaFieldName] = useState('');\n\n return (\n <>\n <div>{props.label}</div>\n {[...Object.keys(meta)].map((key) => {\n const compositeKey: any = `meta.${key}`;\n return (\n <div key={compositeKey} role='none' className='flex items-center mt-2 gap-1'>\n <div role='none' className='flex-1'>\n <TextInput\n {...props}\n getValue={() => (props.getValue() as any)[key]}\n type={'string'}\n label={key}\n />\n </div>\n <IconButton\n icon='ph--trash--regular'\n iconOnly\n classNames={'mt-6'}\n label={t('trigger meta remove')}\n onClick={() => {\n const newValues: any = { ...props.getValue() };\n delete newValues[key];\n props.onValueChange('object', newValues);\n }}\n />\n </div>\n );\n })}\n <div role='none' className='flex items-center mt-2 gap-1 plb-1'>\n <div role='none' className='flex-1'>\n <Input.Root>\n <Input.TextInput\n placeholder={t('trigger meta prop name placeholder')}\n value={newMetaFieldName}\n onChange={(event) => setNewMetaFieldName(event.target.value)}\n />\n </Input.Root>\n </div>\n <IconButton\n icon='ph--plus--regular'\n iconOnly\n label={t('trigger meta add')}\n onClick={() => {\n if (newMetaFieldName.length) {\n const meta = props.getValue() ?? {};\n const metaWithNewProp = { ...meta, [newMetaFieldName]: '' };\n setNewMetaFieldName('');\n props.onValueChange('object', metaWithNewProp);\n }\n }}\n />\n </div>\n </>\n );\n },\n }}\n />\n );\n};\n\nconst getWorkflowOptions = (graphs: ComputeGraph[]) => {\n return graphs.map((graph) => ({ label: `compute-${graph.id}`, value: `dxn:echo:@:${graph.id}` }));\n};\n\nconst getFunctionOptions = (scripts: ScriptType[], functions: FunctionType[]) => {\n const getLabel = (fn: FunctionType) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;\n return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:worker:${fn.name}` }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AAQ,KAAM,CAAC;AAClC,oBAAM2B,kBAAkB;gBAAE,GAAG5B;gBAAM,CAACI,gBAAAA,GAAmB;cAAG;AAC1DC,kCAAoB,EAAA;AACpBjB,oBAAMe,cAAc,UAAUyB,eAAAA;YAChC;UACF;;MAKV;IACF;;AAGN;AAEA,IAAMrC,qBAAqB,CAACsC,WAAAA;AAC1B,SAAOA,OAAOjC,IAAI,CAACkC,WAAW;IAAE/B,OAAO,WAAW+B,MAAMC,EAAE;IAAIjC,OAAO,cAAcgC,MAAMC,EAAE;EAAG,EAAA;AAChG;AAEA,IAAMtC,qBAAqB,CAACb,SAAuBP,cAAAA;AACjD,QAAM2D,WAAW,CAACC,OAAqBrD,QAAQsD,KAAK,CAACC,MAAMF,GAAGG,QAAQV,QAAQK,OAAOI,EAAEJ,EAAE,GAAGM,QAAQJ,GAAGI;AACvG,SAAOhE,UAAUuB,IAAI,CAACqC,QAAQ;IAAElC,OAAOiC,SAASC,EAAAA;IAAKnC,OAAO,cAAcmC,GAAGI,IAAI;EAAG,EAAA;AACtF;",
|
|
6
|
-
"names": ["TriggerEditor", "space", "trigger", "onSave", "onCancel", "t", "useTranslation", "AUTOMATION_PLUGIN", "functions", "useQuery", "Filter", "schema", "FunctionType", "workflows", "ComputeGraph", "scripts", "ScriptType", "handleSave", "values", "React", "Form", "FunctionTriggerSchema", "Custom", "props", "SelectInput", "options", "getWorkflowOptions", "concat", "getFunctionOptions", "Object", "TriggerKind", "map", "kind", "value", "label", "meta", "getValue", "useEffect", "onValueChange", "newMetaFieldName", "setNewMetaFieldName", "useState", "div", "keys", "key", "compositeKey", "role", "className", "TextInput", "type", "IconButton", "icon", "iconOnly", "classNames", "onClick", "newValues", "Input", "Root", "placeholder", "onChange", "event", "target", "length", "metaWithNewProp", "graphs", "graph", "id", "getLabel", "fn", "find", "s", "source", "name"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const AUTOMATION_PLUGIN = 'dxos.org/plugin/automation';\n\nexport const meta = {\n id: AUTOMATION_PLUGIN,\n name: 'Automation',\n description:\n 'The Automation tab allows you to trigger pre-defined workflows related to the element you are interacting with inside of Composer.',\n icon: 'ph--robot--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-automation',\n} satisfies PluginMeta;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAMO,IAAMA,oBAAoB;AAE1B,IAAMC,OAAO;EAClBC,IAAIF;EACJG,MAAM;EACNC,aACE;EACFC,MAAM;EACNC,QAAQ;AACV;",
|
|
6
|
-
"names": ["AUTOMATION_PLUGIN", "meta", "id", "name", "description", "icon", "source"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/AutomationPanel/AutomationPanel.tsx", "../../../src/components/AutomationPanel/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useState } from 'react';\n\nimport { S } from '@dxos/echo-schema';\nimport {\n FunctionType,\n FunctionTrigger,\n FunctionTriggerSchema,\n TriggerKind,\n type FunctionTriggerType,\n ScriptType,\n} from '@dxos/functions';\nimport { type Client, useClient } from '@dxos/react-client';\nimport { create, Filter, useQuery, type Space, type ReactiveObject, getSpace } from '@dxos/react-client/echo';\nimport { Clipboard, IconButton, Input, useTranslation } from '@dxos/react-ui';\nimport { List } from '@dxos/react-ui-list';\nimport { ghostHover, mx } from '@dxos/react-ui-theme';\n\nimport { AUTOMATION_PLUGIN } from '../../meta';\nimport { TriggerEditor, type TriggerEditorProps } from '../TriggerEditor';\n\nconst grid = 'grid grid-cols-[40px_1fr_32px] min-bs-[2.5rem]';\n\nexport type AutomationPanelProps = {\n space: Space;\n object?: ReactiveObject<any>;\n};\n\n// TODO(burdon): Factor out common layout with ViewEditor.\nexport const AutomationPanel = ({ space, object }: AutomationPanelProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n const client = useClient();\n const triggers = useQuery(space, Filter.schema(FunctionTrigger));\n const functions = useQuery(space, Filter.schema(FunctionType));\n const scripts = useQuery(space, Filter.schema(ScriptType));\n\n const [trigger, setTrigger] = useState<FunctionTriggerType>();\n const [selected, setSelected] = useState<FunctionTrigger>();\n\n const handleSelect = (trigger: FunctionTrigger) => {\n const { id: _, ...values } = trigger;\n setTrigger(values);\n setSelected(trigger);\n };\n\n const handleAdd = () => {\n setTrigger(create(FunctionTriggerSchema, { meta: {} }));\n setSelected(undefined);\n };\n\n const handleDelete = (trigger: FunctionTrigger) => {\n space.db.remove(trigger);\n setTrigger(undefined);\n setSelected(undefined);\n };\n\n const handleSave: TriggerEditorProps['onSave'] = (trigger) => {\n if (selected) {\n Object.assign(selected, trigger);\n } else {\n space.db.add(create(FunctionTrigger, trigger));\n }\n\n setTrigger(undefined);\n setSelected(undefined);\n };\n\n const handleCancel: TriggerEditorProps['onCancel'] = () => {\n setTrigger(undefined);\n };\n\n return (\n <Clipboard.Provider>\n <div className='flex flex-col w-full'>\n {!trigger && (\n <List.Root<FunctionTrigger> items={triggers} isItem={S.is(FunctionTrigger)} getId={(field) => field.id}>\n {({ items: triggers }) => (\n <div role='list' className='flex flex-col w-full'>\n {triggers?.map((trigger) => {\n const copyAction = getCopyAction(client, trigger);\n return (\n <List.Item<FunctionTrigger>\n key={trigger.id}\n item={trigger}\n classNames={mx(grid, ghostHover, 'items-center', 'px-2')}\n >\n <Input.Root>\n <Input.Switch\n checked={trigger.enabled}\n onCheckedChange={(checked) => (trigger.enabled = checked)}\n />\n </Input.Root>\n\n <div className={'flex'}>\n <List.ItemTitle\n classNames='px-1 cursor-pointer w-0 shrink truncate'\n onClick={() => handleSelect(trigger)}\n >\n {getFunctionName(scripts, functions, trigger) ?? '∅'}\n </List.ItemTitle>\n\n {/* TODO: a better way to expose copy action */}\n {copyAction && (\n <Clipboard.IconButton\n label={t(copyAction.translationKey)}\n value={copyAction.contentProvider()}\n />\n )}\n </div>\n\n <List.ItemDeleteButton onClick={() => handleDelete(trigger)} />\n </List.Item>\n );\n })}\n </div>\n )}\n </List.Root>\n )}\n\n {trigger && <TriggerEditor space={space} trigger={trigger} onSave={handleSave} onCancel={handleCancel} />}\n\n {!trigger && (\n <div className='flex p-2 justify-center'>\n <IconButton icon='ph--plus--regular' label={t('new trigger label')} onClick={handleAdd} />\n </div>\n )}\n </div>\n </Clipboard.Provider>\n );\n};\n\nconst getCopyAction = (client: Client, trigger: FunctionTrigger | undefined) => {\n if (trigger?.spec?.type === TriggerKind.Email) {\n return { translationKey: 'trigger copy email', contentProvider: () => `${getSpace(trigger)!.id}@dxos.network` };\n }\n\n if (trigger?.spec?.type === TriggerKind.Webhook) {\n return { translationKey: 'trigger copy url', contentProvider: () => getWebhookUrl(client, trigger) };\n }\n\n return undefined;\n};\n\nconst getWebhookUrl = (client: Client, trigger: FunctionTrigger) => {\n const spaceId = getSpace(trigger)!.id;\n const edgeUrl = new URL(client.config.values.runtime!.services!.edge!.url!);\n const isSecure = edgeUrl.protocol.startsWith('https') || edgeUrl.protocol.startsWith('wss');\n edgeUrl.protocol = isSecure ? 'https' : 'http';\n return new URL(`/webhook/${spaceId}:${trigger.id}`, edgeUrl).toString();\n};\n\nconst getFunctionName = (scripts: ScriptType[], functions: FunctionType[], trigger: FunctionTriggerType) => {\n // TODO(wittjosiah): Truncation should be done in the UI.\n // Warning that the List component is currently a can of worms.\n const shortId = trigger.function && `${trigger.function?.slice(0, 16)}…`;\n const functionObject = functions.find((fn) => `dxn:worker:${fn.name}` === trigger.function);\n if (!functionObject) {\n return shortId;\n }\n return scripts.find((s) => functionObject.source?.target?.id === s.id)?.name ?? shortId;\n};\n", "//\n// Copyright 2024 DXOS.org\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AgB;AACnB,WAAOH;EACT;AACA,SAAOnF,QAAQuF,KAAK,CAACG,MAAMJ,eAAeK,QAAQC,QAAQpF,OAAOkF,EAAElF,EAAE,GAAGiF,QAAQN;AAClF;;;AC7JA,IAAA,0BAAeU;",
|
|
6
|
-
"names": ["React", "useState", "S", "FunctionType", "FunctionTrigger", "FunctionTriggerSchema", "TriggerKind", "ScriptType", "useClient", "create", "Filter", "useQuery", "getSpace", "Clipboard", "IconButton", "Input", "useTranslation", "List", "ghostHover", "mx", "grid", "AutomationPanel", "space", "object", "t", "useTranslation", "AUTOMATION_PLUGIN", "client", "useClient", "triggers", "useQuery", "Filter", "schema", "FunctionTrigger", "functions", "FunctionType", "scripts", "ScriptType", "trigger", "setTrigger", "useState", "selected", "setSelected", "handleSelect", "id", "_", "values", "handleAdd", "create", "FunctionTriggerSchema", "meta", "undefined", "handleDelete", "db", "remove", "handleSave", "Object", "assign", "add", "handleCancel", "Clipboard", "Provider", "div", "className", "List", "Root", "items", "isItem", "S", "is", "getId", "field", "role", "map", "copyAction", "getCopyAction", "Item", "key", "item", "classNames", "mx", "ghostHover", "Input", "Switch", "checked", "enabled", "onCheckedChange", "ItemTitle", "onClick", "getFunctionName", "IconButton", "label", "translationKey", "value", "contentProvider", "ItemDeleteButton", "TriggerEditor", "onSave", "onCancel", "icon", "spec", "type", "TriggerKind", "Email", "getSpace", "Webhook", "getWebhookUrl", "spaceId", "edgeUrl", "URL", "config", "runtime", "services", "edge", "url", "isSecure", "protocol", "startsWith", "toString", "shortId", "function", "slice", "functionObject", "find", "fn", "name", "s", "source", "target", "AutomationPanel"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const AUTOMATION_PLUGIN = 'dxos.org/plugin/automation';\n\nexport const meta = {\n id: AUTOMATION_PLUGIN,\n name: 'Automation',\n description:\n 'The Automation tab allows you to trigger pre-defined workflows related to the element you are interacting with inside of Composer.',\n icon: 'ph--robot--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-automation',\n} satisfies PluginMeta;\n"],
|
|
5
|
-
"mappings": ";;;AAMO,IAAMA,oBAAoB;AAE1B,IAAMC,OAAO;EAClBC,IAAIF;EACJG,MAAM;EACNC,aACE;EACFC,MAAM;EACNC,QAAQ;AACV;",
|
|
6
|
-
"names": ["AUTOMATION_PLUGIN", "meta", "id", "name", "description", "icon", "source"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/TriggerEditor/TriggerEditor.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useEffect, useState } from 'react';\n\nimport { ComputeGraph } from '@dxos/conductor';\nimport {\n FunctionType,\n FunctionTriggerSchema,\n type FunctionTriggerType,\n type FunctionTrigger,\n ScriptType,\n TriggerKind,\n} from '@dxos/functions';\nimport { Filter, useQuery, type Space } from '@dxos/react-client/echo';\nimport { IconButton, Input, useTranslation } from '@dxos/react-ui';\nimport { Form, SelectInput, TextInput } from '@dxos/react-ui-form';\n\nimport { AUTOMATION_PLUGIN } from '../../meta';\n\nexport type TriggerEditorProps = {\n space: Space;\n trigger: FunctionTriggerType;\n onSave?: (trigger: Omit<FunctionTrigger, 'id'>) => void;\n onCancel?: () => void;\n};\n\nexport const TriggerEditor = ({ space, trigger, onSave, onCancel }: TriggerEditorProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n\n const functions = useQuery(space, Filter.schema(FunctionType));\n const workflows = useQuery(space, Filter.schema(ComputeGraph));\n const scripts = useQuery(space, Filter.schema(ScriptType));\n\n const handleSave = (values: FunctionTriggerType) => {\n onSave?.(values);\n };\n\n return (\n <Form<FunctionTriggerType>\n schema={FunctionTriggerSchema}\n values={trigger}\n onSave={handleSave}\n onCancel={onCancel}\n Custom={{\n ['function' satisfies keyof FunctionTriggerType]: (props) => (\n <SelectInput\n {...props}\n options={getWorkflowOptions(workflows).concat(getFunctionOptions(scripts, functions))}\n />\n ),\n ['spec.type' as const]: (props) => (\n <SelectInput\n {...props}\n options={Object.values(TriggerKind).map((kind) => ({\n value: kind,\n label: t(`trigger type ${kind}`),\n }))}\n />\n ),\n ['meta' as const]: (props) => {\n const meta = props.getValue()!;\n useEffect(() => props.onValueChange('object', { ...meta }), []);\n const [newMetaFieldName, setNewMetaFieldName] = useState('');\n\n return (\n <>\n <div>{props.label}</div>\n {[...Object.keys(meta)].map((key) => {\n const compositeKey: any = `meta.${key}`;\n return (\n <div key={compositeKey} role='none' className='flex items-center mt-2 gap-1'>\n <div role='none' className='flex-1'>\n <TextInput\n {...props}\n getValue={() => (props.getValue() as any)[key]}\n type={'string'}\n label={key}\n />\n </div>\n <IconButton\n icon='ph--trash--regular'\n iconOnly\n classNames={'mt-6'}\n label={t('trigger meta remove')}\n onClick={() => {\n const newValues: any = { ...props.getValue() };\n delete newValues[key];\n props.onValueChange('object', newValues);\n }}\n />\n </div>\n );\n })}\n <div role='none' className='flex items-center mt-2 gap-1 plb-1'>\n <div role='none' className='flex-1'>\n <Input.Root>\n <Input.TextInput\n placeholder={t('trigger meta prop name placeholder')}\n value={newMetaFieldName}\n onChange={(event) => setNewMetaFieldName(event.target.value)}\n />\n </Input.Root>\n </div>\n <IconButton\n icon='ph--plus--regular'\n iconOnly\n label={t('trigger meta add')}\n onClick={() => {\n if (newMetaFieldName.length) {\n const meta = props.getValue() ?? {};\n const metaWithNewProp = { ...meta, [newMetaFieldName]: '' };\n setNewMetaFieldName('');\n props.onValueChange('object', metaWithNewProp);\n }\n }}\n />\n </div>\n </>\n );\n },\n }}\n />\n );\n};\n\nconst getWorkflowOptions = (graphs: ComputeGraph[]) => {\n return graphs.map((graph) => ({ label: `compute-${graph.id}`, value: `dxn:echo:@:${graph.id}` }));\n};\n\nconst getFunctionOptions = (scripts: ScriptType[], functions: FunctionType[]) => {\n const getLabel = (fn: FunctionType) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;\n return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:worker:${fn.name}` }));\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,OAAOA,SAASC,WAAWC,gBAAgB;AAE3C,SAASC,oBAAoB;AAC7B,SACEC,cACAC,uBAGAC,YACAC,mBACK;AACP,SAASC,QAAQC,gBAA4B;AAC7C,SAASC,YAAYC,OAAOC,sBAAsB;AAClD,SAASC,MAAMC,aAAaC,iBAAiB;AAWtC,IAAMC,gBAAgB,CAAC,EAAEC,OAAOC,SAASC,QAAQC,SAAQ,MAAsB;AACpF,QAAM,EAAEC,EAAC,IAAKC,eAAeC,iBAAAA;AAE7B,QAAMC,YAAYC,SAASR,OAAOS,OAAOC,OAAOC,YAAAA,CAAAA;AAChD,QAAMC,YAAYJ,SAASR,OAAOS,OAAOC,OAAOG,YAAAA,CAAAA;AAChD,QAAMC,UAAUN,SAASR,OAAOS,OAAOC,OAAOK,UAAAA,CAAAA;AAE9C,QAAMC,aAAa,CAACC,WAAAA;AAClBf,aAASe,MAAAA;EACX;AAEA,SACE,sBAAA,cAACC,MAAAA;IACCR,QAAQS;IACRF,QAAQhB;IACRC,QAAQc;IACRb;IACAiB,QAAQ;MACN,CAAC,UAAA,GAAiD,CAACC,UACjD,sBAAA,cAACC,aAAAA;QACE,GAAGD;QACJE,SAASC,mBAAmBZ,SAAAA,EAAWa,OAAOC,mBAAmBZ,SAASP,SAAAA,CAAAA;;MAG9E,CAAC,WAAA,GAAuB,CAACc,UACvB,sBAAA,cAACC,aAAAA;QACE,GAAGD;QACJE,SAASI,OAAOV,OAAOW,WAAAA,EAAaC,IAAI,CAACC,UAAU;UACjDC,OAAOD;UACPE,OAAO5B,EAAE,gBAAgB0B,IA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AK;UACLC,UAAAA;UACAlB,OAAO5B,EAAE,kBAAA;UACTgD,SAAS,MAAA;AACP,gBAAIf,iBAAiBuB,QAAQ;AAC3B,oBAAM3B,QAAOZ,MAAMa,SAAQ,KAAM,CAAC;AAClC,oBAAM2B,kBAAkB;gBAAE,GAAG5B;gBAAM,CAACI,gBAAAA,GAAmB;cAAG;AAC1DC,kCAAoB,EAAA;AACpBjB,oBAAMe,cAAc,UAAUyB,eAAAA;YAChC;UACF;;MAKV;IACF;;AAGN;AAEA,IAAMrC,qBAAqB,CAACsC,WAAAA;AAC1B,SAAOA,OAAOjC,IAAI,CAACkC,WAAW;IAAE/B,OAAO,WAAW+B,MAAMC,EAAE;IAAIjC,OAAO,cAAcgC,MAAMC,EAAE;EAAG,EAAA;AAChG;AAEA,IAAMtC,qBAAqB,CAACZ,SAAuBP,cAAAA;AACjD,QAAM0D,WAAW,CAACC,OAAqBpD,QAAQqD,KAAK,CAACC,MAAMF,GAAGG,QAAQV,QAAQK,OAAOI,EAAEJ,EAAE,GAAGM,QAAQJ,GAAGI;AACvG,SAAO/D,UAAUsB,IAAI,CAACqC,QAAQ;IAAElC,OAAOiC,SAASC,EAAAA;IAAKnC,OAAO,cAAcmC,GAAGI,IAAI;EAAG,EAAA;AACtF;",
|
|
6
|
-
"names": ["React", "useEffect", "useState", "ComputeGraph", "FunctionType", "FunctionTriggerSchema", "ScriptType", "TriggerKind", "Filter", "useQuery", "IconButton", "Input", "useTranslation", "Form", "SelectInput", "TextInput", "TriggerEditor", "space", "trigger", "onSave", "onCancel", "t", "useTranslation", "AUTOMATION_PLUGIN", "functions", "useQuery", "Filter", "schema", "FunctionType", "workflows", "ComputeGraph", "scripts", "ScriptType", "handleSave", "values", "Form", "FunctionTriggerSchema", "Custom", "props", "SelectInput", "options", "getWorkflowOptions", "concat", "getFunctionOptions", "Object", "TriggerKind", "map", "kind", "value", "label", "meta", "getValue", "useEffect", "onValueChange", "newMetaFieldName", "setNewMetaFieldName", "useState", "div", "keys", "key", "compositeKey", "role", "className", "TextInput", "type", "IconButton", "icon", "iconOnly", "classNames", "onClick", "newValues", "Input", "Root", "placeholder", "onChange", "event", "target", "length", "metaWithNewProp", "graphs", "graph", "id", "getLabel", "fn", "find", "s", "source", "name"]
|
|
7
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/lib/node/{complementary-panel-ZYJJ42ZU.cjs.map → complementary-panel-WI3PVFP2.cjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/lib/node-esm/{react-surface-QWLPOYXO.mjs.map → react-surface-I6NJHNXK.mjs.map}
RENAMED
|
File without changes
|