@dxos/plugin-automation 0.8.4-main.fd6878d → 0.8.4-staging.60fe92afc8
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/LICENSE +102 -5
- package/PLUGIN.mdl +428 -0
- package/README.md +1 -1
- package/dist/lib/neutral/AutomationArticle-GN36NUX2.mjs +17 -0
- package/dist/lib/neutral/AutomationCompanion-M26WR6VP.mjs +165 -0
- package/dist/lib/neutral/AutomationCompanion-M26WR6VP.mjs.map +7 -0
- package/dist/lib/neutral/AutomationPlugin.mjs +10 -0
- package/dist/lib/neutral/AutomationPlugin.node.mjs +1132 -0
- package/dist/lib/neutral/AutomationPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/AutomationPlugin.workerd.mjs +36 -0
- package/dist/lib/neutral/AutomationPlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/AutomationSettings-YXUJDRQA.mjs +27 -0
- package/dist/lib/neutral/AutomationSettings-YXUJDRQA.mjs.map +7 -0
- package/dist/lib/neutral/TriggerSettings-XCHIZPOR.mjs +9 -0
- package/dist/lib/neutral/app-graph-builder-BTTHS4VK.mjs +102 -0
- package/dist/lib/neutral/app-graph-builder-BTTHS4VK.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +25 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/node.mjs +19 -0
- package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
- package/dist/lib/neutral/chunk-24JKY6NU.mjs +21 -0
- package/dist/lib/neutral/chunk-24JKY6NU.mjs.map +7 -0
- package/dist/lib/neutral/chunk-2JP77CMN.mjs +42 -0
- package/dist/lib/neutral/chunk-2JP77CMN.mjs.map +7 -0
- package/dist/lib/neutral/chunk-DUGOIM7G.mjs +36 -0
- package/dist/lib/neutral/chunk-DUGOIM7G.mjs.map +7 -0
- package/dist/lib/neutral/chunk-FE7YFBX7.mjs +486 -0
- package/dist/lib/neutral/chunk-FE7YFBX7.mjs.map +7 -0
- package/dist/lib/neutral/chunk-GARB7S5R.mjs +157 -0
- package/dist/lib/neutral/chunk-GARB7S5R.mjs.map +7 -0
- package/dist/lib/neutral/chunk-HPUHQ3L6.mjs +64 -0
- package/dist/lib/neutral/chunk-HPUHQ3L6.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-SONGOJRB.mjs +8 -0
- package/dist/lib/neutral/chunk-SONGOJRB.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +48 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +15 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-automation-OE3TNXYE.mjs +41 -0
- package/dist/lib/neutral/create-automation-OE3TNXYE.mjs.map +7 -0
- package/dist/lib/neutral/create-object-MEJOWGMH.mjs +25 -0
- package/dist/lib/neutral/create-object-MEJOWGMH.mjs.map +7 -0
- package/dist/lib/neutral/create-trigger-from-template-TERHKWJM.mjs +68 -0
- package/dist/lib/neutral/create-trigger-from-template-TERHKWJM.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +47 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +22 -0
- package/dist/lib/neutral/layer-specs-G6GCH7BE.mjs +137 -0
- package/dist/lib/neutral/layer-specs-G6GCH7BE.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/navigation-resolver-I3L5FHJO.mjs +14 -0
- package/dist/lib/neutral/navigation-resolver-I3L5FHJO.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs +13 -0
- package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-IBRWUKPC.mjs +54 -0
- package/dist/lib/neutral/react-surface-IBRWUKPC.mjs.map +7 -0
- package/dist/lib/neutral/registry-sync-G6TKKZGK.mjs +86 -0
- package/dist/lib/neutral/registry-sync-G6TKKZGK.mjs.map +7 -0
- package/dist/lib/neutral/templates-ETXVD3VE.mjs +16 -0
- package/dist/lib/neutral/templates-ETXVD3VE.mjs.map +7 -0
- package/dist/lib/neutral/testing.mjs +8 -0
- package/dist/lib/neutral/testing.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +64 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/trigger-runtime-controller-BOEJYGWC.mjs +77 -0
- package/dist/lib/neutral/trigger-runtime-controller-BOEJYGWC.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +18 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/AutomationPlugin.d.ts +3 -1
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/AutomationPlugin.node.d.ts +4 -0
- package/dist/types/src/AutomationPlugin.node.d.ts.map +1 -0
- package/dist/types/src/AutomationPlugin.test.d.ts +2 -0
- package/dist/types/src/AutomationPlugin.test.d.ts.map +1 -0
- package/dist/types/src/AutomationPlugin.workerd.d.ts +4 -0
- package/dist/types/src/AutomationPlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +11 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/create-object.test.d.ts +2 -0
- package/dist/types/src/capabilities/create-object.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +16 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/layer-specs.d.ts +6 -0
- package/dist/types/src/capabilities/layer-specs.d.ts.map +1 -0
- package/dist/types/src/capabilities/navigation-resolver.d.ts +6 -0
- package/dist/types/src/capabilities/navigation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/node.d.ts +9 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/registry-sync.d.ts +21 -0
- package/dist/types/src/capabilities/registry-sync.d.ts.map +1 -0
- package/dist/types/src/capabilities/templates.d.ts +6 -0
- package/dist/types/src/capabilities/templates.d.ts.map +1 -0
- package/dist/types/src/capabilities/trigger-runtime-controller.d.ts +5 -0
- package/dist/types/src/capabilities/trigger-runtime-controller.d.ts.map +1 -0
- package/dist/types/src/capabilities/trigger-runtime-controller.test.d.ts +2 -0
- package/dist/types/src/capabilities/trigger-runtime-controller.test.d.ts.map +1 -0
- package/dist/types/src/commands/index.d.ts +2 -0
- package/dist/types/src/commands/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/create/index.d.ts +25 -0
- package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/create/queue.d.ts +13 -0
- package/dist/types/src/commands/trigger/create/queue.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/create/subscription.d.ts +15 -0
- package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/create/timer.d.ts +13 -0
- package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/index.d.ts +57 -0
- package/dist/types/src/commands/trigger/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/list.d.ts +7 -0
- package/dist/types/src/commands/trigger/list.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/options.d.ts +10 -0
- package/dist/types/src/commands/trigger/options.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/remove.d.ts +8 -0
- package/dist/types/src/commands/trigger/remove.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/index.d.ts +28 -0
- package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/queue.d.ts +11 -0
- package/dist/types/src/commands/trigger/update/queue.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/subscription.d.ts +13 -0
- package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/timer.d.ts +11 -0
- package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/util.d.ts +85 -0
- package/dist/types/src/commands/trigger/util.d.ts.map +1 -0
- package/dist/types/src/components/CreateAutomationPanel/CreateAutomationPanel.d.ts +14 -0
- package/dist/types/src/components/CreateAutomationPanel/CreateAutomationPanel.d.ts.map +1 -0
- package/dist/types/src/components/CreateAutomationPanel/index.d.ts +2 -0
- package/dist/types/src/components/CreateAutomationPanel/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -7
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/AutomationArticle/AutomationArticle.d.ts +35 -0
- package/dist/types/src/containers/AutomationArticle/AutomationArticle.d.ts.map +1 -0
- package/dist/types/src/containers/AutomationArticle/index.d.ts +3 -0
- package/dist/types/src/containers/AutomationArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/AutomationCompanion/AutomationCompanion.d.ts +13 -0
- package/dist/types/src/containers/AutomationCompanion/AutomationCompanion.d.ts.map +1 -0
- package/dist/types/src/containers/AutomationCompanion/index.d.ts +3 -0
- package/dist/types/src/containers/AutomationCompanion/index.d.ts.map +1 -0
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +10 -0
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
- package/dist/types/src/containers/AutomationSettings/index.d.ts +2 -0
- package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts +6 -0
- package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerSettings/index.d.ts +3 -0
- package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +6 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +12 -0
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/create-automation.d.ts +5 -0
- package/dist/types/src/operations/create-automation.d.ts.map +1 -0
- package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
- package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/paths.d.ts +3 -0
- package/dist/types/src/paths.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/templates/index.d.ts +10 -0
- package/dist/types/src/templates/index.d.ts.map +1 -0
- package/dist/types/src/testing/test-functions.d.ts +318 -3
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/testing.d.ts +2 -0
- package/dist/types/src/testing.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +90 -26
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Automation.d.ts +41 -0
- package/dist/types/src/types/Automation.d.ts.map +1 -0
- package/dist/types/src/types/Automation.test.d.ts +2 -0
- package/dist/types/src/types/Automation.test.d.ts.map +1 -0
- package/dist/types/src/types/AutomationCapabilities.d.ts +42 -0
- package/dist/types/src/types/AutomationCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/AutomationOperation.d.ts +31 -0
- package/dist/types/src/types/AutomationOperation.d.ts.map +1 -0
- package/dist/types/src/types/Runnable.d.ts +14 -0
- package/dist/types/src/types/Runnable.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +4 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +14 -6
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/util/automations-for-object.d.ts +20 -0
- package/dist/types/src/util/automations-for-object.d.ts.map +1 -0
- package/dist/types/src/util/automations-for-object.test.d.ts +2 -0
- package/dist/types/src/util/automations-for-object.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +140 -52
- package/src/AutomationPlugin.node.ts +48 -0
- package/src/AutomationPlugin.test.ts +27 -0
- package/src/AutomationPlugin.tsx +52 -34
- package/src/AutomationPlugin.workerd.ts +24 -0
- package/src/capabilities/app-graph-builder.ts +82 -78
- package/src/capabilities/create-object.test.ts +18 -0
- package/src/capabilities/create-object.ts +26 -0
- package/src/capabilities/index.ts +17 -4
- package/src/capabilities/layer-specs.ts +196 -0
- package/src/capabilities/navigation-resolver.ts +19 -0
- package/src/capabilities/node.ts +19 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +45 -46
- package/src/capabilities/registry-sync.ts +114 -0
- package/src/capabilities/templates.ts +17 -0
- package/src/capabilities/trigger-runtime-controller.test.ts +107 -0
- package/src/capabilities/trigger-runtime-controller.ts +126 -0
- package/src/commands/index.ts +5 -0
- package/src/commands/trigger/create/index.ts +14 -0
- package/src/commands/trigger/create/queue.ts +87 -0
- package/src/commands/trigger/create/subscription.ts +126 -0
- package/src/commands/trigger/create/timer.ts +90 -0
- package/src/commands/trigger/index.ts +16 -0
- package/src/commands/trigger/list.ts +69 -0
- package/src/commands/trigger/options.ts +47 -0
- package/src/commands/trigger/remove.ts +45 -0
- package/src/commands/trigger/update/index.ts +14 -0
- package/src/commands/trigger/update/queue.ts +191 -0
- package/src/commands/trigger/update/subscription.ts +279 -0
- package/src/commands/trigger/update/timer.ts +195 -0
- package/src/commands/trigger/util.ts +410 -0
- package/src/components/CreateAutomationPanel/CreateAutomationPanel.tsx +68 -0
- package/src/components/CreateAutomationPanel/index.ts +5 -0
- package/src/components/index.ts +1 -8
- package/src/containers/AutomationArticle/AutomationArticle.tsx +586 -0
- package/src/containers/AutomationArticle/index.ts +6 -0
- package/src/containers/AutomationCompanion/AutomationCompanion.tsx +183 -0
- package/src/containers/AutomationCompanion/index.ts +6 -0
- package/src/containers/AutomationSettings/AutomationSettings.tsx +34 -0
- package/src/containers/AutomationSettings/index.ts +5 -0
- package/src/containers/TriggerSettings/TriggerSettings.tsx +48 -0
- package/src/containers/TriggerSettings/index.ts +6 -0
- package/src/containers/index.ts +10 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/useTriggerRuntimeControls.ts +72 -0
- package/src/index.ts +1 -3
- package/src/meta.ts +26 -9
- package/src/operations/create-automation.ts +38 -0
- package/src/operations/create-trigger-from-template.ts +70 -0
- package/src/operations/index.ts +10 -0
- package/src/paths.ts +13 -0
- package/src/plugin.ts +11 -0
- package/src/templates/index.ts +22 -0
- package/src/testing/test-functions.ts +44 -10
- package/src/testing.ts +7 -0
- package/src/translations.ts +49 -26
- package/src/types/Automation.test.ts +37 -0
- package/src/types/Automation.ts +45 -0
- package/src/types/AutomationCapabilities.ts +52 -0
- package/src/types/AutomationOperation.ts +61 -0
- package/src/types/Runnable.ts +14 -0
- package/src/types/index.ts +5 -0
- package/src/types/schema.ts +7 -7
- package/src/util/automations-for-object.test.ts +86 -0
- package/src/util/automations-for-object.ts +72 -0
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/AutomationContainer-5UYKI7EG.mjs +0 -38
- package/dist/lib/browser/AutomationContainer-5UYKI7EG.mjs.map +0 -7
- package/dist/lib/browser/AutomationPanel-YYERBNYJ.mjs +0 -11
- package/dist/lib/browser/FunctionsContainer-VOGKIPHA.mjs +0 -39
- package/dist/lib/browser/FunctionsContainer-VOGKIPHA.mjs.map +0 -7
- package/dist/lib/browser/FunctionsPanel-I443Y6KB.mjs +0 -10
- package/dist/lib/browser/app-graph-builder-4OFKIRAI.mjs +0 -80
- package/dist/lib/browser/app-graph-builder-4OFKIRAI.mjs.map +0 -7
- package/dist/lib/browser/chunk-7EE4SA6M.mjs +0 -230
- package/dist/lib/browser/chunk-7EE4SA6M.mjs.map +0 -7
- package/dist/lib/browser/chunk-CHENFUQ6.mjs +0 -14
- package/dist/lib/browser/chunk-CHENFUQ6.mjs.map +0 -7
- package/dist/lib/browser/chunk-GW5U2DGT.mjs +0 -15
- package/dist/lib/browser/chunk-GW5U2DGT.mjs.map +0 -7
- package/dist/lib/browser/chunk-HN7OHFCB.mjs +0 -38
- package/dist/lib/browser/chunk-HN7OHFCB.mjs.map +0 -7
- package/dist/lib/browser/chunk-OX6OW6XP.mjs +0 -147
- package/dist/lib/browser/chunk-OX6OW6XP.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z5DT4MHW.mjs +0 -94
- package/dist/lib/browser/chunk-Z5DT4MHW.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -101
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-YZP6RKTR.mjs +0 -76
- package/dist/lib/browser/intent-resolver-YZP6RKTR.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-WNOIIT4O.mjs +0 -64
- package/dist/lib/browser/react-surface-WNOIIT4O.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -8
- package/dist/lib/node-esm/AutomationContainer-EZMY6DTD.mjs +0 -39
- package/dist/lib/node-esm/AutomationContainer-EZMY6DTD.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationPanel-5EQQF5S2.mjs +0 -12
- package/dist/lib/node-esm/FunctionsContainer-IHLMLXHH.mjs +0 -40
- package/dist/lib/node-esm/FunctionsContainer-IHLMLXHH.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsPanel-ELINCXPW.mjs +0 -11
- package/dist/lib/node-esm/app-graph-builder-555IHYOB.mjs +0 -81
- package/dist/lib/node-esm/app-graph-builder-555IHYOB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CX2AILIS.mjs +0 -95
- package/dist/lib/node-esm/chunk-CX2AILIS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-D4VWZD53.mjs +0 -16
- package/dist/lib/node-esm/chunk-D4VWZD53.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GHRG4NQV.mjs +0 -148
- package/dist/lib/node-esm/chunk-GHRG4NQV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NK5N3QKD.mjs +0 -17
- package/dist/lib/node-esm/chunk-NK5N3QKD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OEZNHUL2.mjs +0 -39
- package/dist/lib/node-esm/chunk-OEZNHUL2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YPUO4IVX.mjs +0 -231
- package/dist/lib/node-esm/chunk-YPUO4IVX.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -102
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-TSLQE27W.mjs +0 -77
- package/dist/lib/node-esm/intent-resolver-TSLQE27W.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-K6MQFIAS.mjs +0 -65
- package/dist/lib/node-esm/react-surface-K6MQFIAS.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -9
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/AutomationContainer.d.ts +0 -5
- package/dist/types/src/components/AutomationContainer.d.ts.map +0 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +0 -12
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +0 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +0 -6
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +0 -1
- package/dist/types/src/components/AutomationPanel/index.d.ts +0 -4
- package/dist/types/src/components/AutomationPanel/index.d.ts.map +0 -1
- package/dist/types/src/components/FunctionsContainer.d.ts +0 -7
- package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
- package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts +0 -7
- package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +0 -1
- package/dist/types/src/components/FunctionsPanel/index.d.ts +0 -4
- package/dist/types/src/components/FunctionsPanel/index.d.ts.map +0 -1
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +0 -12
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +0 -1
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +0 -5
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +0 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +0 -11
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +0 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +0 -6
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/TriggerEditor/index.d.ts +0 -2
- package/dist/types/src/components/TriggerEditor/index.d.ts.map +0 -1
- package/src/capabilities/intent-resolver.ts +0 -72
- package/src/components/AutomationContainer.tsx +0 -31
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +0 -58
- package/src/components/AutomationPanel/AutomationPanel.tsx +0 -171
- package/src/components/AutomationPanel/index.ts +0 -9
- package/src/components/FunctionsContainer.tsx +0 -32
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +0 -97
- package/src/components/FunctionsPanel/index.ts +0 -8
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +0 -78
- package/src/components/TriggerEditor/SpecSelector.tsx +0 -59
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +0 -79
- package/src/components/TriggerEditor/TriggerEditor.tsx +0 -107
- package/src/components/TriggerEditor/index.ts +0 -5
- /package/dist/lib/{browser/AutomationPanel-YYERBNYJ.mjs.map → neutral/AutomationArticle-GN36NUX2.mjs.map} +0 -0
- /package/dist/lib/{browser/FunctionsPanel-I443Y6KB.mjs.map → neutral/AutomationPlugin.mjs.map} +0 -0
- /package/dist/lib/{browser/types/index.mjs.map → neutral/TriggerSettings-XCHIZPOR.mjs.map} +0 -0
- /package/dist/lib/{node-esm/AutomationPanel-5EQQF5S2.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/FunctionsPanel-ELINCXPW.mjs.map → neutral/meta.mjs.map} +0 -0
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AutomationContainer,
|
|
3
|
-
FunctionsContainer
|
|
4
|
-
} from "./chunk-CHENFUQ6.mjs";
|
|
5
|
-
import "./chunk-7EE4SA6M.mjs";
|
|
6
|
-
import {
|
|
7
|
-
meta
|
|
8
|
-
} from "./chunk-GW5U2DGT.mjs";
|
|
9
|
-
|
|
10
|
-
// src/capabilities/react-surface.tsx
|
|
11
|
-
import React from "react";
|
|
12
|
-
import { Capabilities, contributes, createSurface, useLayout } from "@dxos/app-framework";
|
|
13
|
-
import { Obj } from "@dxos/echo";
|
|
14
|
-
import { ScriptType } from "@dxos/functions";
|
|
15
|
-
import { getSpace, parseId, useSpace } from "@dxos/react-client/echo";
|
|
16
|
-
var react_surface_default = () => contributes(Capabilities.ReactSurface, [
|
|
17
|
-
createSurface({
|
|
18
|
-
id: `${meta.id}/space-settings-automation`,
|
|
19
|
-
role: "article",
|
|
20
|
-
filter: (data) => data.subject === `${meta.id}/space-settings-automation`,
|
|
21
|
-
component: () => {
|
|
22
|
-
const layout = useLayout();
|
|
23
|
-
const { spaceId } = parseId(layout.workspace);
|
|
24
|
-
const space = useSpace(spaceId);
|
|
25
|
-
if (!space || !spaceId) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
return /* @__PURE__ */ React.createElement(AutomationContainer, {
|
|
29
|
-
space
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}),
|
|
33
|
-
createSurface({
|
|
34
|
-
id: `${meta.id}/space-settings-functions`,
|
|
35
|
-
role: "article",
|
|
36
|
-
filter: (data) => data.subject === `${meta.id}/space-settings-functions`,
|
|
37
|
-
component: () => {
|
|
38
|
-
const layout = useLayout();
|
|
39
|
-
const { spaceId } = parseId(layout.workspace);
|
|
40
|
-
const space = useSpace(spaceId);
|
|
41
|
-
if (!space || !spaceId) {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
return /* @__PURE__ */ React.createElement(FunctionsContainer, {
|
|
45
|
-
space
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}),
|
|
49
|
-
createSurface({
|
|
50
|
-
id: `${meta.id}/companion/automation`,
|
|
51
|
-
role: "article",
|
|
52
|
-
filter: (data) => Obj.instanceOf(ScriptType, data.companionTo) && data.subject === "automation",
|
|
53
|
-
component: ({ data, role }) => {
|
|
54
|
-
return /* @__PURE__ */ React.createElement(AutomationContainer, {
|
|
55
|
-
space: getSpace(data.companionTo),
|
|
56
|
-
object: data.companionTo
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
]);
|
|
61
|
-
export {
|
|
62
|
-
react_surface_default as default
|
|
63
|
-
};
|
|
64
|
-
//# sourceMappingURL=react-surface-WNOIIT4O.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes, createSurface, useLayout } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\nimport { ScriptType } from '@dxos/functions';\nimport { getSpace, parseId, useSpace } from '@dxos/react-client/echo';\n\nimport { AutomationContainer, FunctionsContainer } from '../components';\nimport { meta } from '../meta';\n\nexport default () =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: `${meta.id}/space-settings-automation`,\n role: 'article',\n filter: (data): data is { subject: string } => data.subject === `${meta.id}/space-settings-automation`,\n component: () => {\n const layout = useLayout();\n const { spaceId } = parseId(layout.workspace);\n const space = useSpace(spaceId);\n if (!space || !spaceId) {\n return null;\n }\n\n return <AutomationContainer space={space} />;\n },\n }),\n createSurface({\n id: `${meta.id}/space-settings-functions`,\n role: 'article',\n filter: (data): data is { subject: string } => data.subject === `${meta.id}/space-settings-functions`,\n component: () => {\n const layout = useLayout();\n const { spaceId } = parseId(layout.workspace);\n const space = useSpace(spaceId);\n if (!space || !spaceId) {\n return null;\n }\n\n return <FunctionsContainer space={space} />;\n },\n }),\n createSurface({\n id: `${meta.id}/companion/automation`,\n role: 'article',\n filter: (data): data is { companionTo: ScriptType; subject: 'automation' } =>\n Obj.instanceOf(ScriptType, data.companionTo) && data.subject === 'automation',\n component: ({ data, role }) => {\n return <AutomationContainer space={getSpace(data.companionTo)!} object={data.companionTo} />;\n },\n }),\n ]);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,cAAcC,aAAaC,eAAeC,iBAAiB;AACpE,SAASC,WAAW;AACpB,SAASC,kBAAkB;AAC3B,SAASC,UAAUC,SAASC,gBAAgB;AAK5C,IAAA,wBAAe,MACbC,YAAYC,aAAaC,cAAc;EACrCC,cAAc;IACZC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,QAAQ,CAACC,SAAsCA,KAAKC,YAAY,GAAGJ,KAAKD,EAAE;IAC1EM,WAAW,MAAA;AACT,YAAMC,SAASC,UAAAA;AACf,YAAM,EAAEC,QAAO,IAAKC,QAAQH,OAAOI,SAAS;AAC5C,YAAMC,QAAQC,SAASJ,OAAAA;AACvB,UAAI,CAACG,SAAS,CAACH,SAAS;AACtB,eAAO;MACT;AAEA,aAAO,sBAAA,cAACK,qBAAAA;QAAoBF;;IAC9B;EACF,CAAA;EACAb,cAAc;IACZC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,QAAQ,CAACC,SAAsCA,KAAKC,YAAY,GAAGJ,KAAKD,EAAE;IAC1EM,WAAW,MAAA;AACT,YAAMC,SAASC,UAAAA;AACf,YAAM,EAAEC,QAAO,IAAKC,QAAQH,OAAOI,SAAS;AAC5C,YAAMC,QAAQC,SAASJ,OAAAA;AACvB,UAAI,CAACG,SAAS,CAACH,SAAS;AACtB,eAAO;MACT;AAEA,aAAO,sBAAA,cAACM,oBAAAA;QAAmBH;;IAC7B;EACF,CAAA;EACAb,cAAc;IACZC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,QAAQ,CAACC,SACPY,IAAIC,WAAWC,YAAYd,KAAKe,WAAW,KAAKf,KAAKC,YAAY;IACnEC,WAAW,CAAC,EAAEF,MAAMF,KAAI,MAAE;AACxB,aAAO,sBAAA,cAACY,qBAAAA;QAAoBF,OAAOQ,SAAShB,KAAKe,WAAW;QAAIE,QAAQjB,KAAKe;;IAC/E;EACF,CAAA;CACD;",
|
|
6
|
-
"names": ["React", "Capabilities", "contributes", "createSurface", "useLayout", "Obj", "ScriptType", "getSpace", "parseId", "useSpace", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "meta", "role", "filter", "data", "subject", "component", "layout", "useLayout", "spaceId", "parseId", "workspace", "space", "useSpace", "AutomationContainer", "FunctionsContainer", "Obj", "instanceOf", "ScriptType", "companionTo", "getSpace", "object"]
|
|
7
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
AutomationPanel
|
|
4
|
-
} from "./chunk-GHRG4NQV.mjs";
|
|
5
|
-
import "./chunk-YPUO4IVX.mjs";
|
|
6
|
-
import {
|
|
7
|
-
AUTOMATION_PLUGIN
|
|
8
|
-
} from "./chunk-NK5N3QKD.mjs";
|
|
9
|
-
|
|
10
|
-
// src/components/AutomationContainer.tsx
|
|
11
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
12
|
-
import React from "react";
|
|
13
|
-
import { useTranslation } from "@dxos/react-ui";
|
|
14
|
-
import { ControlPage, ControlSection } from "@dxos/react-ui-form";
|
|
15
|
-
import { StackItem } from "@dxos/react-ui-stack";
|
|
16
|
-
var AutomationContainer = (props) => {
|
|
17
|
-
var _effect = _useSignals();
|
|
18
|
-
try {
|
|
19
|
-
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
20
|
-
return /* @__PURE__ */ React.createElement(StackItem.Content, {
|
|
21
|
-
classNames: "block overflow-y-auto"
|
|
22
|
-
}, /* @__PURE__ */ React.createElement(ControlPage, null, /* @__PURE__ */ React.createElement(ControlSection, {
|
|
23
|
-
title: t("automation verbose label", {
|
|
24
|
-
ns: AUTOMATION_PLUGIN
|
|
25
|
-
}),
|
|
26
|
-
description: t("automation description", {
|
|
27
|
-
ns: AUTOMATION_PLUGIN
|
|
28
|
-
})
|
|
29
|
-
}, /* @__PURE__ */ React.createElement(AutomationPanel, props))));
|
|
30
|
-
} finally {
|
|
31
|
-
_effect.f();
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
var AutomationContainer_default = AutomationContainer;
|
|
35
|
-
export {
|
|
36
|
-
AutomationContainer,
|
|
37
|
-
AutomationContainer_default as default
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=AutomationContainer-EZMY6DTD.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/AutomationContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { useTranslation } from '@dxos/react-ui';\nimport { ControlPage, ControlSection } from '@dxos/react-ui-form';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { AUTOMATION_PLUGIN } from '../meta';\n\nimport { AutomationPanel, type AutomationPanelProps } from './AutomationPanel';\n\nexport const AutomationContainer = (props: AutomationPanelProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n return (\n <StackItem.Content classNames='block overflow-y-auto'>\n <ControlPage>\n <ControlSection\n title={t('automation verbose label', { ns: AUTOMATION_PLUGIN })}\n description={t('automation description', { ns: AUTOMATION_PLUGIN })}\n >\n <AutomationPanel {...props} />\n </ControlSection>\n </ControlPage>\n </StackItem.Content>\n );\n};\n\nexport default AutomationContainer;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,sBAAsB;AAC/B,SAASC,aAAaC,sBAAsB;AAC5C,SAASC,iBAAiB;AAMnB,IAAMC,sBAAsB,CAACC,UAAAA;;;AAClC,UAAM,EAAEC,EAAC,IAAKC,eAAeC,iBAAAA;AAC7B,WACE,sBAAA,cAACC,UAAUC,SAAO;MAACC,YAAW;OAC5B,sBAAA,cAACC,aAAAA,MACC,sBAAA,cAACC,gBAAAA;MACCC,OAAOR,EAAE,4BAA4B;QAAES,IAAIP;MAAkB,CAAA;MAC7DQ,aAAaV,EAAE,0BAA0B;QAAES,IAAIP;MAAkB,CAAA;OAEjE,sBAAA,cAACS,iBAAoBZ,KAAAA,CAAAA,CAAAA,CAAAA;;;;AAK/B;AAEA,IAAA,8BAAeD;",
|
|
6
|
-
"names": ["React", "useTranslation", "ControlPage", "ControlSection", "StackItem", "AutomationContainer", "props", "t", "useTranslation", "AUTOMATION_PLUGIN", "StackItem", "Content", "classNames", "ControlPage", "ControlSection", "title", "ns", "description", "AutomationPanel"]
|
|
7
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
AutomationPanel,
|
|
4
|
-
AutomationPanel_default
|
|
5
|
-
} from "./chunk-GHRG4NQV.mjs";
|
|
6
|
-
import "./chunk-YPUO4IVX.mjs";
|
|
7
|
-
import "./chunk-NK5N3QKD.mjs";
|
|
8
|
-
export {
|
|
9
|
-
AutomationPanel,
|
|
10
|
-
AutomationPanel_default as default
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=AutomationPanel-5EQQF5S2.mjs.map
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
FunctionsPanel
|
|
4
|
-
} from "./chunk-CX2AILIS.mjs";
|
|
5
|
-
import {
|
|
6
|
-
AUTOMATION_PLUGIN
|
|
7
|
-
} from "./chunk-NK5N3QKD.mjs";
|
|
8
|
-
|
|
9
|
-
// src/components/FunctionsContainer.tsx
|
|
10
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
11
|
-
import React from "react";
|
|
12
|
-
import { useTranslation } from "@dxos/react-ui";
|
|
13
|
-
import { ControlPage, ControlSection } from "@dxos/react-ui-form";
|
|
14
|
-
import { StackItem } from "@dxos/react-ui-stack";
|
|
15
|
-
var FunctionsContainer = ({ space }) => {
|
|
16
|
-
var _effect = _useSignals();
|
|
17
|
-
try {
|
|
18
|
-
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
19
|
-
return /* @__PURE__ */ React.createElement(StackItem.Content, {
|
|
20
|
-
classNames: "block overflow-y-auto"
|
|
21
|
-
}, /* @__PURE__ */ React.createElement(ControlPage, null, /* @__PURE__ */ React.createElement(ControlSection, {
|
|
22
|
-
title: t("functions verbose label", {
|
|
23
|
-
ns: AUTOMATION_PLUGIN
|
|
24
|
-
}),
|
|
25
|
-
description: t("functions description", {
|
|
26
|
-
ns: AUTOMATION_PLUGIN
|
|
27
|
-
})
|
|
28
|
-
}, /* @__PURE__ */ React.createElement(FunctionsPanel, {
|
|
29
|
-
space
|
|
30
|
-
}))));
|
|
31
|
-
} finally {
|
|
32
|
-
_effect.f();
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
var FunctionsContainer_default = FunctionsContainer;
|
|
36
|
-
export {
|
|
37
|
-
FunctionsContainer,
|
|
38
|
-
FunctionsContainer_default as default
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=FunctionsContainer-IHLMLXHH.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/FunctionsContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type Space } from '@dxos/react-client/echo';\nimport { useTranslation } from '@dxos/react-ui';\nimport { ControlPage, ControlSection } from '@dxos/react-ui-form';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { AUTOMATION_PLUGIN } from '../meta';\n\nimport { FunctionsPanel } from './FunctionsPanel';\n\nexport const FunctionsContainer = ({ space }: { space: Space }) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n return (\n <StackItem.Content classNames='block overflow-y-auto'>\n <ControlPage>\n <ControlSection\n title={t('functions verbose label', { ns: AUTOMATION_PLUGIN })}\n description={t('functions description', { ns: AUTOMATION_PLUGIN })}\n >\n <FunctionsPanel space={space} />\n </ControlSection>\n </ControlPage>\n </StackItem.Content>\n );\n};\n\nexport default FunctionsContainer;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;AAIA,OAAOA,WAAW;AAGlB,SAASC,sBAAsB;AAC/B,SAASC,aAAaC,sBAAsB;AAC5C,SAASC,iBAAiB;AAMnB,IAAMC,qBAAqB,CAAC,EAAEC,MAAK,MAAoB;;;AAC5D,UAAM,EAAEC,EAAC,IAAKC,eAAeC,iBAAAA;AAC7B,WACE,sBAAA,cAACC,UAAUC,SAAO;MAACC,YAAW;OAC5B,sBAAA,cAACC,aAAAA,MACC,sBAAA,cAACC,gBAAAA;MACCC,OAAOR,EAAE,2BAA2B;QAAES,IAAIP;MAAkB,CAAA;MAC5DQ,aAAaV,EAAE,yBAAyB;QAAES,IAAIP;MAAkB,CAAA;OAEhE,sBAAA,cAACS,gBAAAA;MAAeZ;;;;;AAK1B;AAEA,IAAA,6BAAeD;",
|
|
6
|
-
"names": ["React", "useTranslation", "ControlPage", "ControlSection", "StackItem", "FunctionsContainer", "space", "t", "useTranslation", "AUTOMATION_PLUGIN", "StackItem", "Content", "classNames", "ControlPage", "ControlSection", "title", "ns", "description", "FunctionsPanel"]
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
FunctionsPanel,
|
|
4
|
-
FunctionsPanel_default
|
|
5
|
-
} from "./chunk-CX2AILIS.mjs";
|
|
6
|
-
import "./chunk-NK5N3QKD.mjs";
|
|
7
|
-
export {
|
|
8
|
-
FunctionsPanel,
|
|
9
|
-
FunctionsPanel_default as default
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=FunctionsPanel-ELINCXPW.mjs.map
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
meta
|
|
4
|
-
} from "./chunk-NK5N3QKD.mjs";
|
|
5
|
-
|
|
6
|
-
// src/capabilities/app-graph-builder.ts
|
|
7
|
-
import { Rx } from "@effect-rx/rx-react";
|
|
8
|
-
import { Option, pipe } from "effect";
|
|
9
|
-
import { Capabilities, contributes } from "@dxos/app-framework";
|
|
10
|
-
import { Obj } from "@dxos/echo";
|
|
11
|
-
import { ScriptType } from "@dxos/functions";
|
|
12
|
-
import { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from "@dxos/plugin-deck/types";
|
|
13
|
-
import { createExtension } from "@dxos/plugin-graph";
|
|
14
|
-
import { SPACE_PLUGIN } from "@dxos/plugin-space";
|
|
15
|
-
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, [
|
|
16
|
-
createExtension({
|
|
17
|
-
id: `${meta.id}/space-settings-automation`,
|
|
18
|
-
connector: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.type === `${SPACE_PLUGIN}/settings` ? Option.some(node2) : Option.none()), Option.map((node2) => [
|
|
19
|
-
{
|
|
20
|
-
id: `automation-${node2.id}`,
|
|
21
|
-
type: `${meta.id}/space-settings-automation`,
|
|
22
|
-
data: `${meta.id}/space-settings-automation`,
|
|
23
|
-
properties: {
|
|
24
|
-
label: [
|
|
25
|
-
"automation panel label",
|
|
26
|
-
{
|
|
27
|
-
ns: meta.id
|
|
28
|
-
}
|
|
29
|
-
],
|
|
30
|
-
icon: "ph--lightning--regular"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
]), Option.getOrElse(() => [])))
|
|
34
|
-
}),
|
|
35
|
-
createExtension({
|
|
36
|
-
id: `${meta.id}/space-settings-functions`,
|
|
37
|
-
connector: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.type === `${SPACE_PLUGIN}/settings` ? Option.some(node2) : Option.none()), Option.map((node2) => [
|
|
38
|
-
{
|
|
39
|
-
id: `functions-${node2.id}`,
|
|
40
|
-
type: `${meta.id}/space-settings-functions`,
|
|
41
|
-
data: `${meta.id}/space-settings-functions`,
|
|
42
|
-
properties: {
|
|
43
|
-
label: [
|
|
44
|
-
"functions panel label",
|
|
45
|
-
{
|
|
46
|
-
ns: meta.id
|
|
47
|
-
}
|
|
48
|
-
],
|
|
49
|
-
icon: "ph--function--regular"
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
]), Option.getOrElse(() => [])))
|
|
53
|
-
}),
|
|
54
|
-
createExtension({
|
|
55
|
-
id: `${meta.id}/script-companion`,
|
|
56
|
-
connector: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => Obj.instanceOf(ScriptType, node2.data) ? Option.some(node2) : Option.none()), Option.map((node2) => [
|
|
57
|
-
{
|
|
58
|
-
id: [
|
|
59
|
-
node2.id,
|
|
60
|
-
"automation"
|
|
61
|
-
].join(ATTENDABLE_PATH_SEPARATOR),
|
|
62
|
-
type: PLANK_COMPANION_TYPE,
|
|
63
|
-
data: "automation",
|
|
64
|
-
properties: {
|
|
65
|
-
label: [
|
|
66
|
-
"script automation label",
|
|
67
|
-
{
|
|
68
|
-
ns: meta.id
|
|
69
|
-
}
|
|
70
|
-
],
|
|
71
|
-
icon: "ph--lightning--regular",
|
|
72
|
-
disposition: "hidden"
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
]), Option.getOrElse(() => [])))
|
|
76
|
-
})
|
|
77
|
-
]);
|
|
78
|
-
export {
|
|
79
|
-
app_graph_builder_default as default
|
|
80
|
-
};
|
|
81
|
-
//# sourceMappingURL=app-graph-builder-555IHYOB.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\nimport { ScriptType } from '@dxos/functions';\nimport { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';\nimport { createExtension } from '@dxos/plugin-graph';\nimport { SPACE_PLUGIN } from '@dxos/plugin-space';\n\nimport { meta } from '../meta';\n\nexport default (context: PluginContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: `${meta.id}/space-settings-automation`,\n connector: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.type === `${SPACE_PLUGIN}/settings` ? Option.some(node) : Option.none())),\n Option.map((node) => [\n {\n id: `automation-${node.id}`,\n type: `${meta.id}/space-settings-automation`,\n data: `${meta.id}/space-settings-automation`,\n properties: {\n label: ['automation panel label', { ns: meta.id }],\n icon: 'ph--lightning--regular',\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: `${meta.id}/space-settings-functions`,\n connector: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.type === `${SPACE_PLUGIN}/settings` ? Option.some(node) : Option.none())),\n Option.map((node) => [\n {\n id: `functions-${node.id}`,\n type: `${meta.id}/space-settings-functions`,\n data: `${meta.id}/space-settings-functions`,\n properties: {\n label: ['functions panel label', { ns: meta.id }],\n icon: 'ph--function--regular',\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: `${meta.id}/script-companion`,\n connector: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (Obj.instanceOf(ScriptType, node.data) ? Option.some(node) : Option.none())),\n Option.map((node) => [\n {\n id: [node.id, 'automation'].join(ATTENDABLE_PATH_SEPARATOR),\n type: PLANK_COMPANION_TYPE,\n data: 'automation',\n properties: {\n label: ['script automation label', { ns: meta.id }],\n icon: 'ph--lightning--regular',\n disposition: 'hidden',\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n ]);\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,SAASA,UAAU;AACnB,SAASC,QAAQC,YAAY;AAE7B,SAASC,cAAkCC,mBAAmB;AAC9D,SAASC,WAAW;AACpB,SAASC,kBAAkB;AAC3B,SAASC,2BAA2BC,4BAA4B;AAChE,SAASC,uBAAuB;AAChC,SAASC,oBAAoB;AAI7B,IAAA,4BAAe,CAACC,YACdC,YAAYC,aAAaC,iBAAiB;EACxCC,gBAAgB;IACdC,IAAI,GAAGC,KAAKD,EAAE;IACdE,WAAW,CAACC,SACVC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUA,MAAKO,SAAS,GAAGC,YAAAA,cAA0BH,OAAOI,KAAKT,KAAAA,IAAQK,OAAOK,KAAI,CAAA,GACpGL,OAAOM,IAAI,CAACX,UAAS;MACnB;QACEH,IAAI,cAAcG,MAAKH,EAAE;QACzBU,MAAM,GAAGT,KAAKD,EAAE;QAChBe,MAAM,GAAGd,KAAKD,EAAE;QAChBgB,YAAY;UACVC,OAAO;YAAC;YAA0B;cAAEC,IAAIjB,KAAKD;YAAG;;UAChDmB,MAAM;QACR;MACF;KACD,GACDX,OAAOY,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;EACArB,gBAAgB;IACdC,IAAI,GAAGC,KAAKD,EAAE;IACdE,WAAW,CAACC,SACVC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUA,MAAKO,SAAS,GAAGC,YAAAA,cAA0BH,OAAOI,KAAKT,KAAAA,IAAQK,OAAOK,KAAI,CAAA,GACpGL,OAAOM,IAAI,CAACX,UAAS;MACnB;QACEH,IAAI,aAAaG,MAAKH,EAAE;QACxBU,MAAM,GAAGT,KAAKD,EAAE;QAChBe,MAAM,GAAGd,KAAKD,EAAE;QAChBgB,YAAY;UACVC,OAAO;YAAC;YAAyB;cAAEC,IAAIjB,KAAKD;YAAG;;UAC/CmB,MAAM;QACR;MACF;KACD,GACDX,OAAOY,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;EACArB,gBAAgB;IACdC,IAAI,GAAGC,KAAKD,EAAE;IACdE,WAAW,CAACC,SACVC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUkB,IAAIC,WAAWC,YAAYpB,MAAKY,IAAI,IAAIP,OAAOI,KAAKT,KAAAA,IAAQK,OAAOK,KAAI,CAAA,GACjGL,OAAOM,IAAI,CAACX,UAAS;MACnB;QACEH,IAAI;UAACG,MAAKH;UAAI;UAAcwB,KAAKC,yBAAAA;QACjCf,MAAMgB;QACNX,MAAM;QACNC,YAAY;UACVC,OAAO;YAAC;YAA2B;cAAEC,IAAIjB,KAAKD;YAAG;;UACjDmB,MAAM;UACNQ,aAAa;QACf;MACF;KACD,GACDnB,OAAOY,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;CACD;",
|
|
6
|
-
"names": ["Rx", "Option", "pipe", "Capabilities", "contributes", "Obj", "ScriptType", "ATTENDABLE_PATH_SEPARATOR", "PLANK_COMPANION_TYPE", "createExtension", "SPACE_PLUGIN", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "meta", "connector", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "type", "SPACE_PLUGIN", "some", "none", "map", "data", "properties", "label", "ns", "icon", "getOrElse", "Obj", "instanceOf", "ScriptType", "join", "ATTENDABLE_PATH_SEPARATOR", "PLANK_COMPANION_TYPE", "disposition"]
|
|
7
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
AUTOMATION_PLUGIN
|
|
4
|
-
} from "./chunk-NK5N3QKD.mjs";
|
|
5
|
-
|
|
6
|
-
// src/components/FunctionsPanel/FunctionsPanel.tsx
|
|
7
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
8
|
-
import { Schema } from "effect";
|
|
9
|
-
import React, { useCallback, useMemo } from "react";
|
|
10
|
-
import { LayoutAction, createIntent, useIntentDispatcher } from "@dxos/app-framework";
|
|
11
|
-
import { FunctionType, ScriptType } from "@dxos/functions";
|
|
12
|
-
import { Filter, fullyQualifiedId, useQuery } from "@dxos/react-client/echo";
|
|
13
|
-
import { Button, useTranslation } from "@dxos/react-ui";
|
|
14
|
-
import { controlItemClasses } from "@dxos/react-ui-form";
|
|
15
|
-
import { List } from "@dxos/react-ui-list";
|
|
16
|
-
import { ghostHover, mx } from "@dxos/react-ui-theme";
|
|
17
|
-
var grid = "grid grid-cols-[1fr_auto] min-bs-[2.5rem]";
|
|
18
|
-
var FunctionsPanel = ({ space }) => {
|
|
19
|
-
var _effect = _useSignals();
|
|
20
|
-
try {
|
|
21
|
-
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
22
|
-
const functions = useQuery(space, Filter.type(FunctionType));
|
|
23
|
-
const scripts = useQuery(space, Filter.type(ScriptType));
|
|
24
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
25
|
-
const functionToScriptMap = useMemo(() => functions.reduce((map, func) => {
|
|
26
|
-
const scriptId = func.source?.target?.id;
|
|
27
|
-
if (scriptId) {
|
|
28
|
-
const script = scripts.find((s) => s.id === scriptId);
|
|
29
|
-
if (script) {
|
|
30
|
-
map[func.id] = script;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return map;
|
|
34
|
-
}, {}), [
|
|
35
|
-
functions,
|
|
36
|
-
scripts
|
|
37
|
-
]);
|
|
38
|
-
const getScriptName = useCallback((func) => {
|
|
39
|
-
const script = functionToScriptMap[func.id];
|
|
40
|
-
return script?.name;
|
|
41
|
-
}, [
|
|
42
|
-
functionToScriptMap
|
|
43
|
-
]);
|
|
44
|
-
const handleGoToScript = useCallback((func) => {
|
|
45
|
-
const script = functionToScriptMap[func.id];
|
|
46
|
-
if (script) {
|
|
47
|
-
void dispatch(createIntent(LayoutAction.Open, {
|
|
48
|
-
part: "main",
|
|
49
|
-
subject: [
|
|
50
|
-
fullyQualifiedId(script)
|
|
51
|
-
]
|
|
52
|
-
}));
|
|
53
|
-
}
|
|
54
|
-
}, [
|
|
55
|
-
functionToScriptMap,
|
|
56
|
-
dispatch
|
|
57
|
-
]);
|
|
58
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
59
|
-
role: "none",
|
|
60
|
-
className: mx(controlItemClasses)
|
|
61
|
-
}, functions.length > 0 && /* @__PURE__ */ React.createElement(List.Root, {
|
|
62
|
-
items: functions,
|
|
63
|
-
isItem: Schema.is(FunctionType),
|
|
64
|
-
getId: (func) => func.id
|
|
65
|
-
}, ({ items }) => /* @__PURE__ */ React.createElement("div", {
|
|
66
|
-
role: "list",
|
|
67
|
-
className: "flex flex-col w-full"
|
|
68
|
-
}, items?.map((func) => /* @__PURE__ */ React.createElement(List.Item, {
|
|
69
|
-
key: func.id,
|
|
70
|
-
item: func,
|
|
71
|
-
classNames: mx(grid, ghostHover, "items-center", "pli-2", "min-bs-[3rem]")
|
|
72
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
73
|
-
className: "flex flex-col truncate"
|
|
74
|
-
}, /* @__PURE__ */ React.createElement(List.ItemTitle, {
|
|
75
|
-
classNames: "truncate"
|
|
76
|
-
}, func.name), getScriptName(func) && /* @__PURE__ */ React.createElement("div", {
|
|
77
|
-
className: "text-xs text-description truncate"
|
|
78
|
-
}, getScriptName(func))), functionToScriptMap[func.id] && /* @__PURE__ */ React.createElement(Button, {
|
|
79
|
-
onClick: () => handleGoToScript(func)
|
|
80
|
-
}, t("go to function source button label")))))), functions.length === 0 && /* @__PURE__ */ React.createElement("div", {
|
|
81
|
-
className: "text-center plb-4 text-gray-500"
|
|
82
|
-
}, t("no functions found")));
|
|
83
|
-
} finally {
|
|
84
|
-
_effect.f();
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
// src/components/FunctionsPanel/index.ts
|
|
89
|
-
var FunctionsPanel_default = FunctionsPanel;
|
|
90
|
-
|
|
91
|
-
export {
|
|
92
|
-
FunctionsPanel,
|
|
93
|
-
FunctionsPanel_default
|
|
94
|
-
};
|
|
95
|
-
//# sourceMappingURL=chunk-CX2AILIS.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/FunctionsPanel/FunctionsPanel.tsx", "../../../src/components/FunctionsPanel/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\nimport React, { useCallback, useMemo } from 'react';\n\nimport { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';\nimport { FunctionType, ScriptType } from '@dxos/functions';\nimport { Filter, type Space, fullyQualifiedId, useQuery } from '@dxos/react-client/echo';\nimport { Button, useTranslation } from '@dxos/react-ui';\nimport { controlItemClasses } from '@dxos/react-ui-form';\nimport { List } from '@dxos/react-ui-list';\nimport { ghostHover, mx } from '@dxos/react-ui-theme';\n\nimport { AUTOMATION_PLUGIN } from '../../meta';\n\nconst grid = 'grid grid-cols-[1fr_auto] min-bs-[2.5rem]';\n\nexport type FunctionsPanelProps = {\n space: Space;\n};\n\nexport const FunctionsPanel = ({ space }: FunctionsPanelProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n const functions = useQuery(space, Filter.type(FunctionType));\n const scripts = useQuery(space, Filter.type(ScriptType));\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n\n const functionToScriptMap = useMemo(\n () =>\n functions.reduce(\n (map, func) => {\n const scriptId = func.source?.target?.id;\n if (scriptId) {\n const script = scripts.find((s) => s.id === scriptId);\n if (script) {\n map[func.id] = script;\n }\n }\n return map;\n },\n {} as Record<string, ScriptType>,\n ),\n [functions, scripts],\n );\n\n const getScriptName = useCallback(\n (func: FunctionType) => {\n const script = functionToScriptMap[func.id];\n return script?.name;\n },\n [functionToScriptMap],\n );\n\n const handleGoToScript = useCallback(\n (func: FunctionType) => {\n const script = functionToScriptMap[func.id];\n if (script) {\n void dispatch(createIntent(LayoutAction.Open, { part: 'main', subject: [fullyQualifiedId(script)] }));\n }\n },\n [functionToScriptMap, dispatch],\n );\n\n return (\n <div role='none' className={mx(controlItemClasses)}>\n {functions.length > 0 && (\n <List.Root<FunctionType> items={functions} isItem={Schema.is(FunctionType)} getId={(func) => func.id}>\n {({ items }) => (\n <div role='list' className='flex flex-col w-full'>\n {items?.map((func) => (\n <List.Item<FunctionType>\n key={func.id}\n item={func}\n classNames={mx(grid, ghostHover, 'items-center', 'pli-2', 'min-bs-[3rem]')}\n >\n <div className='flex flex-col truncate'>\n <List.ItemTitle classNames='truncate'>{func.name}</List.ItemTitle>\n {getScriptName(func) && (\n <div className='text-xs text-description truncate'>{getScriptName(func)}</div>\n )}\n </div>\n {functionToScriptMap[func.id] && (\n <Button onClick={() => handleGoToScript(func)}>{t('go to function source button label')}</Button>\n )}\n </List.Item>\n ))}\n </div>\n )}\n </List.Root>\n )}\n\n {functions.length === 0 && <div className='text-center plb-4 text-gray-500'>{t('no functions found')}</div>}\n </div>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { FunctionsPanel } from './FunctionsPanel';\n\nexport * from './FunctionsPanel';\nexport default FunctionsPanel;\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,SAASA,cAAc;AACvB,OAAOC,SAASC,aAAaC,eAAe;AAE5C,SAASC,cAAcC,cAAcC,2BAA2B;AAChE,SAASC,cAAcC,kBAAkB;AACzC,SAASC,QAAoBC,kBAAkBC,gBAAgB;AAC/D,SAASC,QAAQC,sBAAsB;AACvC,SAASC,0BAA0B;AACnC,SAASC,YAAY;AACrB,SAASC,YAAYC,UAAU;AAI/B,IAAMC,OAAO;AAMN,IAAMC,iBAAiB,CAAC,EAAEC,MAAK,MAAuB;;;AAC3D,UAAM,EAAEC,EAAC,IAAKC,eAAeC,iBAAAA;AAC7B,UAAMC,YAAYC,SAASL,OAAOM,OAAOC,KAAKC,YAAAA,CAAAA;AAC9C,UAAMC,UAAUJ,SAASL,OAAOM,OAAOC,KAAKG,UAAAA,CAAAA;AAC5C,UAAM,EAAEC,iBAAiBC,SAAQ,IAAKC,oBAAAA;AAEtC,UAAMC,sBAAsBC,QAC1B,MACEX,UAAUY,OACR,CAACC,KAAKC,SAAAA;AACJ,YAAMC,WAAWD,KAAKE,QAAQC,QAAQC;AACtC,UAAIH,UAAU;AACZ,cAAMI,SAASd,QAAQe,KAAK,CAACC,MAAMA,EAAEH,OAAOH,QAAAA;AAC5C,YAAII,QAAQ;AACVN,cAAIC,KAAKI,EAAE,IAAIC;QACjB;MACF;AACA,aAAON;IACT,GACA,CAAC,CAAA,GAEL;MAACb;MAAWK;KAAQ;AAGtB,UAAMiB,gBAAgBC,YACpB,CAACT,SAAAA;AACC,YAAMK,SAAST,oBAAoBI,KAAKI,EAAE;AAC1C,aAAOC,QAAQK;IACjB,GACA;MAACd;KAAoB;AAGvB,UAAMe,mBAAmBF,YACvB,CAACT,SAAAA;AACC,YAAMK,SAAST,oBAAoBI,KAAKI,EAAE;AAC1C,UAAIC,QAAQ;AACV,aAAKX,SAASkB,aAAaC,aAAaC,MAAM;UAAEC,MAAM;UAAQC,SAAS;YAACC,iBAAiBZ,MAAAA;;QAAS,CAAA,CAAA;MACpG;IACF,GACA;MAACT;MAAqBF;KAAS;AAGjC,WACE,sBAAA,cAACwB,OAAAA;MAAIC,MAAK;MAAOC,WAAWC,GAAGC,kBAAAA;OAC5BpC,UAAUqC,SAAS,KAClB,sBAAA,cAACC,KAAKC,MAAI;MAAeC,OAAOxC;MAAWyC,QAAQC,OAAOC,GAAGvC,YAAAA;MAAewC,OAAO,CAAC9B,SAASA,KAAKI;OAC/F,CAAC,EAAEsB,MAAK,MACP,sBAAA,cAACR,OAAAA;MAAIC,MAAK;MAAOC,WAAU;OACxBM,OAAO3B,IAAI,CAACC,SACX,sBAAA,cAACwB,KAAKO,MAAI;MACRC,KAAKhC,KAAKI;MACV6B,MAAMjC;MACNkC,YAAYb,GAAGzC,MAAMuD,YAAY,gBAAgB,SAAS,eAAA;OAE1D,sBAAA,cAACjB,OAAAA;MAAIE,WAAU;OACb,sBAAA,cAACI,KAAKY,WAAS;MAACF,YAAW;OAAYlC,KAAKU,IAAI,GAC/CF,cAAcR,IAAAA,KACb,sBAAA,cAACkB,OAAAA;MAAIE,WAAU;OAAqCZ,cAAcR,IAAAA,CAAAA,CAAAA,GAGrEJ,oBAAoBI,KAAKI,EAAE,KAC1B,sBAAA,cAACiC,QAAAA;MAAOC,SAAS,MAAM3B,iBAAiBX,IAAAA;OAAQjB,EAAE,oCAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAS/DG,UAAUqC,WAAW,KAAK,sBAAA,cAACL,OAAAA;MAAIE,WAAU;OAAmCrC,EAAE,oBAAA,CAAA,CAAA;;;;AAGrF;;;ACzFA,IAAA,yBAAewD;",
|
|
6
|
-
"names": ["Schema", "React", "useCallback", "useMemo", "LayoutAction", "createIntent", "useIntentDispatcher", "FunctionType", "ScriptType", "Filter", "fullyQualifiedId", "useQuery", "Button", "useTranslation", "controlItemClasses", "List", "ghostHover", "mx", "grid", "FunctionsPanel", "space", "t", "useTranslation", "AUTOMATION_PLUGIN", "functions", "useQuery", "Filter", "type", "FunctionType", "scripts", "ScriptType", "dispatchPromise", "dispatch", "useIntentDispatcher", "functionToScriptMap", "useMemo", "reduce", "map", "func", "scriptId", "source", "target", "id", "script", "find", "s", "getScriptName", "useCallback", "name", "handleGoToScript", "createIntent", "LayoutAction", "Open", "part", "subject", "fullyQualifiedId", "div", "role", "className", "mx", "controlItemClasses", "length", "List", "Root", "items", "isItem", "Schema", "is", "getId", "Item", "key", "item", "classNames", "ghostHover", "ItemTitle", "Button", "onClick", "FunctionsPanel"]
|
|
7
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/components/index.ts
|
|
4
|
-
import { lazy } from "react";
|
|
5
|
-
var AutomationContainer = lazy(() => import("./AutomationContainer-EZMY6DTD.mjs"));
|
|
6
|
-
var AutomationPanel = lazy(() => import("./AutomationPanel-5EQQF5S2.mjs"));
|
|
7
|
-
var FunctionsContainer = lazy(() => import("./FunctionsContainer-IHLMLXHH.mjs"));
|
|
8
|
-
var FunctionsPanel = lazy(() => import("./FunctionsPanel-ELINCXPW.mjs"));
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
AutomationContainer,
|
|
12
|
-
AutomationPanel,
|
|
13
|
-
FunctionsContainer,
|
|
14
|
-
FunctionsPanel
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=chunk-D4VWZD53.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport * from './TriggerEditor';\n\nexport const AutomationContainer = lazy(() => import('./AutomationContainer'));\nexport const AutomationPanel = lazy(() => import('./AutomationPanel'));\nexport const FunctionsContainer = lazy(() => import('./FunctionsContainer'));\nexport const FunctionsPanel = lazy(() => import('./FunctionsPanel'));\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,YAAY;AAId,IAAMC,sBAAsBC,KAAK,MAAM,OAAO,oCAAA,CAAA;AAC9C,IAAMC,kBAAkBD,KAAK,MAAM,OAAO,gCAAA,CAAA;AAC1C,IAAME,qBAAqBF,KAAK,MAAM,OAAO,mCAAA,CAAA;AAC7C,IAAMG,iBAAiBH,KAAK,MAAM,OAAO,+BAAA,CAAA;",
|
|
6
|
-
"names": ["lazy", "AutomationContainer", "lazy", "AutomationPanel", "FunctionsContainer", "FunctionsPanel"]
|
|
7
|
-
}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
TriggerEditor
|
|
4
|
-
} from "./chunk-YPUO4IVX.mjs";
|
|
5
|
-
import {
|
|
6
|
-
AUTOMATION_PLUGIN
|
|
7
|
-
} from "./chunk-NK5N3QKD.mjs";
|
|
8
|
-
|
|
9
|
-
// src/components/AutomationPanel/AutomationPanel.tsx
|
|
10
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
11
|
-
import { Schema } from "effect";
|
|
12
|
-
import React, { useState } from "react";
|
|
13
|
-
import { Filter, Obj } from "@dxos/echo";
|
|
14
|
-
import { FunctionTrigger, FunctionTriggerSchema, FunctionType, ScriptType, TriggerKind } from "@dxos/functions";
|
|
15
|
-
import { useClient } from "@dxos/react-client";
|
|
16
|
-
import { getSpace, useQuery } from "@dxos/react-client/echo";
|
|
17
|
-
import { Clipboard, IconButton, Input, Separator, useTranslation } from "@dxos/react-ui";
|
|
18
|
-
import { ControlItem, controlItemClasses } from "@dxos/react-ui-form";
|
|
19
|
-
import { List } from "@dxos/react-ui-list";
|
|
20
|
-
import { ghostHover, mx } from "@dxos/react-ui-theme";
|
|
21
|
-
var grid = "grid grid-cols-[40px_1fr_32px] min-bs-[2.5rem]";
|
|
22
|
-
var AutomationPanel = ({ space, object, initialTrigger, onDone }) => {
|
|
23
|
-
var _effect = _useSignals();
|
|
24
|
-
try {
|
|
25
|
-
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
26
|
-
const client = useClient();
|
|
27
|
-
const triggers = useQuery(space, Filter.type(FunctionTrigger));
|
|
28
|
-
const functions = useQuery(space, Filter.type(FunctionType));
|
|
29
|
-
const scripts = useQuery(space, Filter.type(ScriptType));
|
|
30
|
-
const [trigger, setTrigger] = useState(initialTrigger);
|
|
31
|
-
const [selected, setSelected] = useState();
|
|
32
|
-
const handleSelect = (trigger2) => {
|
|
33
|
-
const { id: _, ...values } = trigger2;
|
|
34
|
-
setTrigger(values);
|
|
35
|
-
setSelected(trigger2);
|
|
36
|
-
};
|
|
37
|
-
const handleAdd = () => {
|
|
38
|
-
setTrigger(Obj.make(FunctionTriggerSchema, {}));
|
|
39
|
-
setSelected(void 0);
|
|
40
|
-
};
|
|
41
|
-
const handleDelete = (trigger2) => {
|
|
42
|
-
space.db.remove(trigger2);
|
|
43
|
-
setTrigger(void 0);
|
|
44
|
-
setSelected(void 0);
|
|
45
|
-
};
|
|
46
|
-
const handleSave = (trigger2) => {
|
|
47
|
-
if (selected) {
|
|
48
|
-
Object.assign(selected, trigger2);
|
|
49
|
-
} else {
|
|
50
|
-
space.db.add(Obj.make(FunctionTrigger, trigger2));
|
|
51
|
-
}
|
|
52
|
-
setTrigger(void 0);
|
|
53
|
-
setSelected(void 0);
|
|
54
|
-
onDone?.();
|
|
55
|
-
};
|
|
56
|
-
const handleCancel = () => {
|
|
57
|
-
setTrigger(void 0);
|
|
58
|
-
onDone?.();
|
|
59
|
-
};
|
|
60
|
-
if (trigger) {
|
|
61
|
-
return /* @__PURE__ */ React.createElement(ControlItem, {
|
|
62
|
-
title: t("trigger editor title")
|
|
63
|
-
}, /* @__PURE__ */ React.createElement(TriggerEditor, {
|
|
64
|
-
space,
|
|
65
|
-
trigger,
|
|
66
|
-
onSave: handleSave,
|
|
67
|
-
onCancel: handleCancel
|
|
68
|
-
}));
|
|
69
|
-
}
|
|
70
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
71
|
-
className: controlItemClasses
|
|
72
|
-
}, triggers.length > 0 && /* @__PURE__ */ React.createElement(List.Root, {
|
|
73
|
-
items: triggers,
|
|
74
|
-
isItem: Schema.is(FunctionTrigger),
|
|
75
|
-
getId: (field) => field.id
|
|
76
|
-
}, ({ items: triggers2 }) => /* @__PURE__ */ React.createElement("div", {
|
|
77
|
-
role: "list",
|
|
78
|
-
className: "flex flex-col w-full"
|
|
79
|
-
}, triggers2?.map((trigger2) => {
|
|
80
|
-
const copyAction = getCopyAction(client, trigger2);
|
|
81
|
-
return /* @__PURE__ */ React.createElement(List.Item, {
|
|
82
|
-
key: trigger2.id,
|
|
83
|
-
item: trigger2,
|
|
84
|
-
classNames: mx(grid, ghostHover, "items-center", "px-2")
|
|
85
|
-
}, /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(Input.Switch, {
|
|
86
|
-
checked: trigger2.enabled,
|
|
87
|
-
onCheckedChange: (checked) => trigger2.enabled = checked
|
|
88
|
-
})), /* @__PURE__ */ React.createElement("div", {
|
|
89
|
-
className: "flex"
|
|
90
|
-
}, /* @__PURE__ */ React.createElement(List.ItemTitle, {
|
|
91
|
-
classNames: "px-1 cursor-pointer w-0 shrink truncate",
|
|
92
|
-
onClick: () => handleSelect(trigger2)
|
|
93
|
-
}, getFunctionName(scripts, functions, trigger2) ?? "\u2205"), copyAction && /* @__PURE__ */ React.createElement(Clipboard.IconButton, {
|
|
94
|
-
label: t(copyAction.translationKey),
|
|
95
|
-
value: copyAction.contentProvider()
|
|
96
|
-
})), /* @__PURE__ */ React.createElement(List.ItemDeleteButton, {
|
|
97
|
-
onClick: () => handleDelete(trigger2)
|
|
98
|
-
}));
|
|
99
|
-
}))), triggers.length > 0 && /* @__PURE__ */ React.createElement(Separator, {
|
|
100
|
-
classNames: "mlb-4"
|
|
101
|
-
}), /* @__PURE__ */ React.createElement(IconButton, {
|
|
102
|
-
icon: "ph--plus--regular",
|
|
103
|
-
label: t("new trigger label"),
|
|
104
|
-
onClick: handleAdd
|
|
105
|
-
}));
|
|
106
|
-
} finally {
|
|
107
|
-
_effect.f();
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
var getCopyAction = (client, trigger) => {
|
|
111
|
-
if (trigger?.spec?.kind === TriggerKind.Email) {
|
|
112
|
-
return {
|
|
113
|
-
translationKey: "trigger copy email",
|
|
114
|
-
contentProvider: () => `${getSpace(trigger).id}@dxos.network`
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
if (trigger?.spec?.kind === TriggerKind.Webhook) {
|
|
118
|
-
return {
|
|
119
|
-
translationKey: "trigger copy url",
|
|
120
|
-
contentProvider: () => getWebhookUrl(client, trigger)
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
return void 0;
|
|
124
|
-
};
|
|
125
|
-
var getWebhookUrl = (client, trigger) => {
|
|
126
|
-
const spaceId = getSpace(trigger).id;
|
|
127
|
-
const edgeUrl = new URL(client.config.values.runtime.services.edge.url);
|
|
128
|
-
const isSecure = edgeUrl.protocol.startsWith("https") || edgeUrl.protocol.startsWith("wss");
|
|
129
|
-
edgeUrl.protocol = isSecure ? "https" : "http";
|
|
130
|
-
return new URL(`/webhook/${spaceId}:${trigger.id}`, edgeUrl).toString();
|
|
131
|
-
};
|
|
132
|
-
var getFunctionName = (scripts, functions, trigger) => {
|
|
133
|
-
const shortId = trigger.function && `${trigger.function.dxn.toString().slice(0, 16)}\u2026`;
|
|
134
|
-
const functionObject = functions.find((fn) => fn === trigger.function?.target);
|
|
135
|
-
if (!functionObject) {
|
|
136
|
-
return shortId;
|
|
137
|
-
}
|
|
138
|
-
return scripts.find((s) => functionObject.source?.target?.id === s.id)?.name ?? shortId;
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
// src/components/AutomationPanel/index.ts
|
|
142
|
-
var AutomationPanel_default = AutomationPanel;
|
|
143
|
-
|
|
144
|
-
export {
|
|
145
|
-
AutomationPanel,
|
|
146
|
-
AutomationPanel_default
|
|
147
|
-
};
|
|
148
|
-
//# sourceMappingURL=chunk-GHRG4NQV.mjs.map
|