@dxos/plugin-automation 0.8.1 → 0.8.2-main.f081794
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/AutomationContainer-KEQ5RNIW.mjs +34 -0
- package/dist/lib/browser/AutomationContainer-KEQ5RNIW.mjs.map +7 -0
- package/dist/lib/browser/AutomationPanel-G3OB6ELR.mjs +11 -0
- package/dist/lib/browser/AutomationPanel-G3OB6ELR.mjs.map +7 -0
- package/dist/lib/browser/FunctionsContainer-STXBW4CX.mjs +33 -0
- package/dist/lib/browser/FunctionsContainer-STXBW4CX.mjs.map +7 -0
- package/dist/lib/browser/FunctionsPanel-JJPLIAJW.mjs +10 -0
- package/dist/lib/browser/FunctionsPanel-JJPLIAJW.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-K3BIQFWW.mjs → app-graph-builder-ND64CHOM.mjs} +42 -1
- package/dist/lib/browser/app-graph-builder-ND64CHOM.mjs.map +7 -0
- package/dist/lib/browser/chunk-65VL4EYS.mjs +88 -0
- package/dist/lib/browser/chunk-65VL4EYS.mjs.map +7 -0
- package/dist/lib/browser/chunk-FCLWFVFX.mjs +39 -0
- package/dist/lib/browser/chunk-FCLWFVFX.mjs.map +7 -0
- package/dist/lib/browser/{AutomationPanel-YAHFXQX6.mjs → chunk-NGG4ICAQ.mjs} +13 -12
- package/dist/lib/browser/chunk-NGG4ICAQ.mjs.map +7 -0
- package/dist/lib/browser/chunk-QJPKWYTL.mjs +14 -0
- package/dist/lib/browser/chunk-QJPKWYTL.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +23 -17
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/intent-resolver-3J647TIZ.mjs +71 -0
- package/dist/lib/browser/intent-resolver-3J647TIZ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-L22QIANU.mjs +68 -0
- package/dist/lib/browser/react-surface-L22QIANU.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +8 -0
- package/dist/lib/browser/types.mjs.map +7 -0
- package/dist/lib/node/AutomationContainer-E5I76FPP.cjs +62 -0
- package/dist/lib/node/AutomationContainer-E5I76FPP.cjs.map +7 -0
- package/dist/lib/node/AutomationPanel-YLXAFJDP.cjs +32 -0
- package/dist/lib/node/AutomationPanel-YLXAFJDP.cjs.map +7 -0
- package/dist/lib/node/FunctionsContainer-3HCURMEB.cjs +61 -0
- package/dist/lib/node/FunctionsContainer-3HCURMEB.cjs.map +7 -0
- package/dist/lib/node/FunctionsPanel-SYIZHPGU.cjs +31 -0
- package/dist/lib/node/FunctionsPanel-SYIZHPGU.cjs.map +7 -0
- package/dist/lib/node/{app-graph-builder-HO4FPGZ5.cjs → app-graph-builder-TVFR6RXO.cjs} +45 -4
- package/dist/lib/node/app-graph-builder-TVFR6RXO.cjs.map +7 -0
- package/dist/lib/node/chunk-BSK5SHTR.cjs +116 -0
- package/dist/lib/node/chunk-BSK5SHTR.cjs.map +7 -0
- package/dist/lib/node/{chunk-AGJ6XTDN.cjs → chunk-L5TWLPGA.cjs} +16 -7
- package/dist/lib/node/chunk-L5TWLPGA.cjs.map +7 -0
- package/dist/lib/node/chunk-PSIJDHAX.cjs +58 -0
- package/dist/lib/node/chunk-PSIJDHAX.cjs.map +7 -0
- package/dist/lib/node/{AutomationPanel-ZKAMIU6O.cjs → chunk-SRXHHBDE.cjs} +19 -14
- package/dist/lib/node/chunk-SRXHHBDE.cjs.map +7 -0
- package/dist/lib/node/index.cjs +23 -17
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/intent-resolver-4YYZ2MMZ.cjs +87 -0
- package/dist/lib/node/intent-resolver-4YYZ2MMZ.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-52M54VWV.cjs → react-surface-PCZCHIET.cjs} +36 -12
- package/dist/lib/node/react-surface-PCZCHIET.cjs.map +7 -0
- package/dist/lib/node/types.cjs +30 -0
- package/dist/lib/node/types.cjs.map +7 -0
- package/dist/lib/node-esm/AutomationContainer-22PUFPSE.mjs +35 -0
- package/dist/lib/node-esm/AutomationContainer-22PUFPSE.mjs.map +7 -0
- package/dist/lib/node-esm/AutomationPanel-6UXIAJVS.mjs +12 -0
- package/dist/lib/node-esm/AutomationPanel-6UXIAJVS.mjs.map +7 -0
- package/dist/lib/node-esm/FunctionsContainer-XG5WVAN3.mjs +34 -0
- package/dist/lib/node-esm/FunctionsContainer-XG5WVAN3.mjs.map +7 -0
- package/dist/lib/node-esm/FunctionsPanel-J3QGUESH.mjs +11 -0
- package/dist/lib/node-esm/FunctionsPanel-J3QGUESH.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-XCJR33VS.mjs → app-graph-builder-NYLOXWVV.mjs} +42 -1
- package/dist/lib/node-esm/app-graph-builder-NYLOXWVV.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4UPGANGV.mjs +89 -0
- package/dist/lib/node-esm/chunk-4UPGANGV.mjs.map +7 -0
- package/dist/lib/node-esm/{AutomationPanel-XF7YPSKM.mjs → chunk-HMYAQLGF.mjs} +13 -12
- package/dist/lib/node-esm/chunk-HMYAQLGF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-TMMB5ETD.mjs +16 -0
- package/dist/lib/node-esm/chunk-TMMB5ETD.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-YYBCQXB2.mjs +40 -0
- package/dist/lib/node-esm/chunk-YYBCQXB2.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +23 -17
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/intent-resolver-WXIXG5UY.mjs +72 -0
- package/dist/lib/node-esm/intent-resolver-WXIXG5UY.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-VSO4NWC6.mjs +69 -0
- package/dist/lib/node-esm/react-surface-VSO4NWC6.mjs.map +7 -0
- package/dist/lib/node-esm/types.mjs +9 -0
- package/dist/lib/node-esm/types.mjs.map +7 -0
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/AutomationContainer.d.ts +7 -0
- package/dist/types/src/components/AutomationContainer.d.ts.map +1 -0
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +6 -3
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/index.d.ts +1 -0
- package/dist/types/src/components/AutomationPanel/index.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsContainer.d.ts +7 -0
- package/dist/types/src/components/FunctionsContainer.d.ts.map +1 -0
- package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts +7 -0
- package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -0
- package/dist/types/src/components/FunctionsPanel/index.d.ts +4 -0
- package/dist/types/src/components/FunctionsPanel/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +8 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +8 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +25 -0
- package/dist/types/src/types.d.ts.map +1 -0
- package/package.json +29 -24
- package/src/AutomationPlugin.tsx +4 -9
- package/src/capabilities/app-graph-builder.ts +31 -0
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/intent-resolver.ts +62 -0
- package/src/capabilities/react-surface.tsx +31 -7
- package/src/components/AutomationContainer.tsx +31 -0
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +4 -4
- package/src/components/AutomationPanel/AutomationPanel.tsx +62 -63
- package/src/components/AutomationPanel/index.ts +2 -0
- package/src/components/FunctionsContainer.tsx +31 -0
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +95 -0
- package/src/components/FunctionsPanel/index.ts +8 -0
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +3 -3
- package/src/components/index.ts +3 -0
- package/src/translations.ts +10 -1
- package/src/types.ts +32 -0
- package/dist/lib/browser/AutomationPanel-YAHFXQX6.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-K3BIQFWW.mjs.map +0 -7
- package/dist/lib/browser/chunk-MT3FZH4V.mjs +0 -8
- package/dist/lib/browser/chunk-MT3FZH4V.mjs.map +0 -7
- package/dist/lib/browser/react-surface-4QQSJR4A.mjs +0 -42
- package/dist/lib/browser/react-surface-4QQSJR4A.mjs.map +0 -7
- package/dist/lib/node/AutomationPanel-ZKAMIU6O.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-HO4FPGZ5.cjs.map +0 -7
- package/dist/lib/node/chunk-AGJ6XTDN.cjs.map +0 -7
- package/dist/lib/node/react-surface-52M54VWV.cjs.map +0 -7
- package/dist/lib/node-esm/AutomationPanel-XF7YPSKM.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-XCJR33VS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OA75PSGH.mjs +0 -10
- package/dist/lib/node-esm/chunk-OA75PSGH.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-MGKM3OO3.mjs +0 -43
- package/dist/lib/node-esm/react-surface-MGKM3OO3.mjs.map +0 -7
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AutomationPanel
|
|
3
|
+
} from "./chunk-NGG4ICAQ.mjs";
|
|
4
|
+
import "./chunk-FALBBJNO.mjs";
|
|
5
|
+
import {
|
|
6
|
+
AUTOMATION_PLUGIN
|
|
7
|
+
} from "./chunk-WKKQV4PC.mjs";
|
|
8
|
+
|
|
9
|
+
// packages/plugins/plugin-automation/src/components/AutomationContainer.tsx
|
|
10
|
+
import React from "react";
|
|
11
|
+
import { useTranslation } from "@dxos/react-ui";
|
|
12
|
+
import { ControlSection, ControlPage } from "@dxos/react-ui-form";
|
|
13
|
+
import { StackItem } from "@dxos/react-ui-stack";
|
|
14
|
+
var AutomationContainer = ({ space }) => {
|
|
15
|
+
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
16
|
+
return /* @__PURE__ */ React.createElement(StackItem.Content, {
|
|
17
|
+
classNames: "block overflow-y-auto"
|
|
18
|
+
}, /* @__PURE__ */ React.createElement(ControlPage, null, /* @__PURE__ */ React.createElement(ControlSection, {
|
|
19
|
+
title: t("automation verbose label", {
|
|
20
|
+
ns: AUTOMATION_PLUGIN
|
|
21
|
+
}),
|
|
22
|
+
description: t("automation description", {
|
|
23
|
+
ns: AUTOMATION_PLUGIN
|
|
24
|
+
})
|
|
25
|
+
}, /* @__PURE__ */ React.createElement(AutomationPanel, {
|
|
26
|
+
space
|
|
27
|
+
}))));
|
|
28
|
+
};
|
|
29
|
+
var AutomationContainer_default = AutomationContainer;
|
|
30
|
+
export {
|
|
31
|
+
AutomationContainer,
|
|
32
|
+
AutomationContainer_default as default
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=AutomationContainer-KEQ5RNIW.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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 { type Space } from '@dxos/react-client/echo';\nimport { useTranslation } from '@dxos/react-ui';\nimport { ControlSection, ControlPage } from '@dxos/react-ui-form';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { AutomationPanel } from './AutomationPanel';\nimport { AUTOMATION_PLUGIN } from '../meta';\n\nexport const AutomationContainer = ({ 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('automation verbose label', { ns: AUTOMATION_PLUGIN })}\n description={t('automation description', { ns: AUTOMATION_PLUGIN })}\n >\n <AutomationPanel space={space} />\n </ControlSection>\n </ControlPage>\n </StackItem.Content>\n );\n};\n\nexport default AutomationContainer;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAIA,OAAOA,WAAW;AAGlB,SAASC,sBAAsB;AAC/B,SAASC,gBAAgBC,mBAAmB;AAC5C,SAASC,iBAAiB;AAKnB,IAAMC,sBAAsB,CAAC,EAAEC,MAAK,MAAoB;AAC7D,QAAM,EAAEC,EAAC,IAAKC,eAAeC,iBAAAA;AAC7B,SACE,sBAAA,cAACC,UAAUC,SAAO;IAACC,YAAW;KAC5B,sBAAA,cAACC,aAAAA,MACC,sBAAA,cAACC,gBAAAA;IACCC,OAAOR,EAAE,4BAA4B;MAAES,IAAIP;IAAkB,CAAA;IAC7DQ,aAAaV,EAAE,0BAA0B;MAAES,IAAIP;IAAkB,CAAA;KAEjE,sBAAA,cAACS,iBAAAA;IAAgBZ;;AAK3B;AAEA,IAAA,8BAAeD;",
|
|
6
|
+
"names": ["React", "useTranslation", "ControlSection", "ControlPage", "StackItem", "AutomationContainer", "space", "t", "useTranslation", "AUTOMATION_PLUGIN", "StackItem", "Content", "classNames", "ControlPage", "ControlSection", "title", "ns", "description", "AutomationPanel"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AutomationPanel,
|
|
3
|
+
AutomationPanel_default
|
|
4
|
+
} from "./chunk-NGG4ICAQ.mjs";
|
|
5
|
+
import "./chunk-FALBBJNO.mjs";
|
|
6
|
+
import "./chunk-WKKQV4PC.mjs";
|
|
7
|
+
export {
|
|
8
|
+
AutomationPanel,
|
|
9
|
+
AutomationPanel_default as default
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=AutomationPanel-G3OB6ELR.mjs.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FunctionsPanel
|
|
3
|
+
} from "./chunk-65VL4EYS.mjs";
|
|
4
|
+
import {
|
|
5
|
+
AUTOMATION_PLUGIN
|
|
6
|
+
} from "./chunk-WKKQV4PC.mjs";
|
|
7
|
+
|
|
8
|
+
// packages/plugins/plugin-automation/src/components/FunctionsContainer.tsx
|
|
9
|
+
import React from "react";
|
|
10
|
+
import { useTranslation } from "@dxos/react-ui";
|
|
11
|
+
import { ControlPage, ControlSection } from "@dxos/react-ui-form";
|
|
12
|
+
import { StackItem } from "@dxos/react-ui-stack";
|
|
13
|
+
var FunctionsContainer = ({ space }) => {
|
|
14
|
+
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
15
|
+
return /* @__PURE__ */ React.createElement(StackItem.Content, {
|
|
16
|
+
classNames: "block overflow-y-auto"
|
|
17
|
+
}, /* @__PURE__ */ React.createElement(ControlPage, null, /* @__PURE__ */ React.createElement(ControlSection, {
|
|
18
|
+
title: t("functions verbose label", {
|
|
19
|
+
ns: AUTOMATION_PLUGIN
|
|
20
|
+
}),
|
|
21
|
+
description: t("functions description", {
|
|
22
|
+
ns: AUTOMATION_PLUGIN
|
|
23
|
+
})
|
|
24
|
+
}, /* @__PURE__ */ React.createElement(FunctionsPanel, {
|
|
25
|
+
space
|
|
26
|
+
}))));
|
|
27
|
+
};
|
|
28
|
+
var FunctionsContainer_default = FunctionsContainer;
|
|
29
|
+
export {
|
|
30
|
+
FunctionsContainer,
|
|
31
|
+
FunctionsContainer_default as default
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=FunctionsContainer-STXBW4CX.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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 { FunctionsPanel } from './FunctionsPanel';\nimport { AUTOMATION_PLUGIN } from '../meta';\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;AAKnB,IAAMC,qBAAqB,CAAC,EAAEC,MAAK,MAAoB;AAC5D,QAAM,EAAEC,EAAC,IAAKC,eAAeC,iBAAAA;AAC7B,SACE,sBAAA,cAACC,UAAUC,SAAO;IAACC,YAAW;KAC5B,sBAAA,cAACC,aAAAA,MACC,sBAAA,cAACC,gBAAAA;IACCC,OAAOR,EAAE,2BAA2B;MAAES,IAAIP;IAAkB,CAAA;IAC5DQ,aAAaV,EAAE,yBAAyB;MAAES,IAAIP;IAAkB,CAAA;KAEhE,sBAAA,cAACS,gBAAAA;IAAeZ;;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
|
+
}
|
|
@@ -9,7 +9,48 @@ import { ScriptType } from "@dxos/functions";
|
|
|
9
9
|
import { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from "@dxos/plugin-deck/types";
|
|
10
10
|
import { createExtension } from "@dxos/plugin-graph";
|
|
11
11
|
import { SCRIPT_PLUGIN } from "@dxos/plugin-script/types";
|
|
12
|
+
import { SPACE_PLUGIN } from "@dxos/plugin-space";
|
|
12
13
|
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, [
|
|
14
|
+
createExtension({
|
|
15
|
+
id: `${meta.id}/space-settings-automation`,
|
|
16
|
+
filter: (node) => node.type === `${SPACE_PLUGIN}/settings`,
|
|
17
|
+
connector: ({ node }) => [
|
|
18
|
+
{
|
|
19
|
+
id: `automation-${node.id}`,
|
|
20
|
+
type: `${meta.id}/space-settings-automation`,
|
|
21
|
+
data: `${meta.id}/space-settings-automation`,
|
|
22
|
+
properties: {
|
|
23
|
+
label: [
|
|
24
|
+
"automation panel label",
|
|
25
|
+
{
|
|
26
|
+
ns: meta.id
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
icon: "ph--lightning--regular"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}),
|
|
34
|
+
createExtension({
|
|
35
|
+
id: `${meta.id}/space-settings-functions`,
|
|
36
|
+
filter: (node) => node.type === `${SPACE_PLUGIN}/settings`,
|
|
37
|
+
connector: ({ node }) => [
|
|
38
|
+
{
|
|
39
|
+
id: `functions-${node.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
|
+
]
|
|
53
|
+
}),
|
|
13
54
|
createExtension({
|
|
14
55
|
id: `${SCRIPT_PLUGIN}/script-companion`,
|
|
15
56
|
filter: (node) => isInstanceOf(ScriptType, node.data),
|
|
@@ -37,4 +78,4 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
37
78
|
export {
|
|
38
79
|
app_graph_builder_default as default
|
|
39
80
|
};
|
|
40
|
-
//# sourceMappingURL=app-graph-builder-
|
|
81
|
+
//# sourceMappingURL=app-graph-builder-ND64CHOM.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';\nimport { isInstanceOf } from '@dxos/echo-schema';\nimport { ScriptType } from '@dxos/functions';\nimport { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\nimport { SCRIPT_PLUGIN } from '@dxos/plugin-script/types';\nimport { SPACE_PLUGIN } from '@dxos/plugin-space';\n\nimport { meta } from '../meta';\n\nexport default (context: PluginsContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: `${meta.id}/space-settings-automation`,\n filter: (node): node is Node<null> => node.type === `${SPACE_PLUGIN}/settings`,\n connector: ({ 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 }),\n createExtension({\n id: `${meta.id}/space-settings-functions`,\n filter: (node): node is Node<null> => node.type === `${SPACE_PLUGIN}/settings`,\n connector: ({ 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 }),\n createExtension({\n id: `${SCRIPT_PLUGIN}/script-companion`,\n filter: (node): node is Node<ScriptType> => isInstanceOf(ScriptType, node.data),\n connector: ({ 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 },\n },\n ],\n }),\n ]);\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAASA,cAAcC,mBAAwC;AAC/D,SAASC,oBAAoB;AAC7B,SAASC,kBAAkB;AAC3B,SAASC,sBAAsBC,iCAAiC;AAChE,SAASC,uBAAkC;AAC3C,SAASC,qBAAqB;AAC9B,SAASC,oBAAoB;AAI7B,IAAA,4BAAe,CAACC,YACdC,YAAYC,aAAaC,iBAAiB;EACxCC,gBAAgB;IACdC,IAAI,GAAGC,KAAKD,EAAE;IACdE,QAAQ,CAACC,SAA6BA,KAAKC,SAAS,GAAGC,YAAAA;IACvDC,WAAW,CAAC,EAAEH,KAAI,MAAO;MACvB;QACEH,IAAI,cAAcG,KAAKH,EAAE;QACzBI,MAAM,GAAGH,KAAKD,EAAE;QAChBO,MAAM,GAAGN,KAAKD,EAAE;QAChBQ,YAAY;UACVC,OAAO;YAAC;YAA0B;cAAEC,IAAIT,KAAKD;YAAG;;UAChDW,MAAM;QACR;MACF;;EAEJ,CAAA;EACAZ,gBAAgB;IACdC,IAAI,GAAGC,KAAKD,EAAE;IACdE,QAAQ,CAACC,SAA6BA,KAAKC,SAAS,GAAGC,YAAAA;IACvDC,WAAW,CAAC,EAAEH,KAAI,MAAO;MACvB;QACEH,IAAI,aAAaG,KAAKH,EAAE;QACxBI,MAAM,GAAGH,KAAKD,EAAE;QAChBO,MAAM,GAAGN,KAAKD,EAAE;QAChBQ,YAAY;UACVC,OAAO;YAAC;YAAyB;cAAEC,IAAIT,KAAKD;YAAG;;UAC/CW,MAAM;QACR;MACF;;EAEJ,CAAA;EACAZ,gBAAgB;IACdC,IAAI,GAAGY,aAAAA;IACPV,QAAQ,CAACC,SAAmCU,aAAaC,YAAYX,KAAKI,IAAI;IAC9ED,WAAW,CAAC,EAAEH,KAAI,MAAO;MACvB;QACEH,IAAI;UAACG,KAAKH;UAAI;UAAce,KAAKC,yBAAAA;QACjCZ,MAAMa;QACNV,MAAM;QACNC,YAAY;UACVC,OAAO;YAAC;YAA2B;cAAEC,IAAIT,KAAKD;YAAG;;UACjDW,MAAM;QACR;MACF;;EAEJ,CAAA;CACD;",
|
|
6
|
+
"names": ["Capabilities", "contributes", "isInstanceOf", "ScriptType", "PLANK_COMPANION_TYPE", "ATTENDABLE_PATH_SEPARATOR", "createExtension", "SCRIPT_PLUGIN", "SPACE_PLUGIN", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "meta", "filter", "node", "type", "SPACE_PLUGIN", "connector", "data", "properties", "label", "ns", "icon", "SCRIPT_PLUGIN", "isInstanceOf", "ScriptType", "join", "ATTENDABLE_PATH_SEPARATOR", "PLANK_COMPANION_TYPE"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AUTOMATION_PLUGIN
|
|
3
|
+
} from "./chunk-WKKQV4PC.mjs";
|
|
4
|
+
|
|
5
|
+
// packages/plugins/plugin-automation/src/components/FunctionsPanel/FunctionsPanel.tsx
|
|
6
|
+
import React, { useCallback, useMemo } from "react";
|
|
7
|
+
import { createIntent, LayoutAction, useIntentDispatcher } from "@dxos/app-framework";
|
|
8
|
+
import { S } from "@dxos/echo-schema";
|
|
9
|
+
import { FunctionType, ScriptType } from "@dxos/functions/types";
|
|
10
|
+
import { Filter, fullyQualifiedId, useQuery } from "@dxos/react-client/echo";
|
|
11
|
+
import { Button, useTranslation } from "@dxos/react-ui";
|
|
12
|
+
import { controlItemClasses } from "@dxos/react-ui-form";
|
|
13
|
+
import { List } from "@dxos/react-ui-list";
|
|
14
|
+
import { ghostHover, mx } from "@dxos/react-ui-theme";
|
|
15
|
+
var grid = "grid grid-cols-[1fr_auto] min-bs-[2.5rem]";
|
|
16
|
+
var FunctionsPanel = ({ space }) => {
|
|
17
|
+
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
18
|
+
const functions = useQuery(space, Filter.schema(FunctionType));
|
|
19
|
+
const scripts = useQuery(space, Filter.schema(ScriptType));
|
|
20
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
21
|
+
const functionToScriptMap = useMemo(() => functions.reduce((map, func) => {
|
|
22
|
+
const scriptId = func.source?.target?.id;
|
|
23
|
+
if (scriptId) {
|
|
24
|
+
const script = scripts.find((s) => s.id === scriptId);
|
|
25
|
+
if (script) {
|
|
26
|
+
map[func.id] = script;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return map;
|
|
30
|
+
}, {}), [
|
|
31
|
+
functions,
|
|
32
|
+
scripts
|
|
33
|
+
]);
|
|
34
|
+
const getScriptName = useCallback((func) => {
|
|
35
|
+
const script = functionToScriptMap[func.id];
|
|
36
|
+
return script?.name;
|
|
37
|
+
}, [
|
|
38
|
+
functionToScriptMap
|
|
39
|
+
]);
|
|
40
|
+
const handleGoToScript = useCallback((func) => {
|
|
41
|
+
const script = functionToScriptMap[func.id];
|
|
42
|
+
if (script) {
|
|
43
|
+
void dispatch(createIntent(LayoutAction.Open, {
|
|
44
|
+
part: "main",
|
|
45
|
+
subject: [
|
|
46
|
+
fullyQualifiedId(script)
|
|
47
|
+
]
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
}, [
|
|
51
|
+
functionToScriptMap,
|
|
52
|
+
dispatch
|
|
53
|
+
]);
|
|
54
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
55
|
+
role: "none",
|
|
56
|
+
className: mx(controlItemClasses)
|
|
57
|
+
}, /* @__PURE__ */ React.createElement(List.Root, {
|
|
58
|
+
items: functions,
|
|
59
|
+
isItem: S.is(FunctionType),
|
|
60
|
+
getId: (func) => func.id
|
|
61
|
+
}, ({ items }) => /* @__PURE__ */ React.createElement("div", {
|
|
62
|
+
role: "list",
|
|
63
|
+
className: "flex flex-col w-full"
|
|
64
|
+
}, items?.map((func) => /* @__PURE__ */ React.createElement(List.Item, {
|
|
65
|
+
key: func.id,
|
|
66
|
+
item: func,
|
|
67
|
+
classNames: mx(grid, ghostHover, "items-center", "pli-2", "min-bs-[3rem]")
|
|
68
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
69
|
+
className: "flex flex-col truncate"
|
|
70
|
+
}, /* @__PURE__ */ React.createElement(List.ItemTitle, {
|
|
71
|
+
classNames: "truncate"
|
|
72
|
+
}, func.name), getScriptName(func) && /* @__PURE__ */ React.createElement("div", {
|
|
73
|
+
className: "text-xs text-description truncate"
|
|
74
|
+
}, getScriptName(func))), functionToScriptMap[func.id] && /* @__PURE__ */ React.createElement(Button, {
|
|
75
|
+
onClick: () => handleGoToScript(func)
|
|
76
|
+
}, t("go to function source button label")))))), functions.length === 0 && /* @__PURE__ */ React.createElement("div", {
|
|
77
|
+
className: "text-center plb-4 text-gray-500"
|
|
78
|
+
}, t("no functions found")));
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// packages/plugins/plugin-automation/src/components/FunctionsPanel/index.ts
|
|
82
|
+
var FunctionsPanel_default = FunctionsPanel;
|
|
83
|
+
|
|
84
|
+
export {
|
|
85
|
+
FunctionsPanel,
|
|
86
|
+
FunctionsPanel_default
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=chunk-65VL4EYS.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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 React, { useCallback, useMemo } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { S } from '@dxos/echo-schema';\nimport { FunctionType, ScriptType } from '@dxos/functions/types';\nimport { Filter, fullyQualifiedId, useQuery, type Space } 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.schema(FunctionType));\n const scripts = useQuery(space, Filter.schema(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 <List.Root<FunctionType> items={functions} isItem={S.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 {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,OAAOA,SAASC,aAAaC,eAAe;AAE5C,SAASC,cAAcC,cAAcC,2BAA2B;AAChE,SAASC,SAAS;AAClB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,QAAQC,kBAAkBC,gBAA4B;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,QAAM,EAAEC,EAAC,IAAKC,eAAeC,iBAAAA;AAC7B,QAAMC,YAAYC,SAASL,OAAOM,OAAOC,OAAOC,YAAAA,CAAAA;AAChD,QAAMC,UAAUJ,SAASL,OAAOM,OAAOC,OAAOG,UAAAA,CAAAA;AAC9C,QAAM,EAAEC,iBAAiBC,SAAQ,IAAKC,oBAAAA;AAEtC,QAAMC,sBAAsBC,QAC1B,MACEX,UAAUY,OACR,CAACC,KAAKC,SAAAA;AACJ,UAAMC,WAAWD,KAAKE,QAAQC,QAAQC;AACtC,QAAIH,UAAU;AACZ,YAAMI,SAASd,QAAQe,KAAK,CAACC,MAAMA,EAAEH,OAAOH,QAAAA;AAC5C,UAAII,QAAQ;AACVN,YAAIC,KAAKI,EAAE,IAAIC;MACjB;IACF;AACA,WAAON;EACT,GACA,CAAC,CAAA,GAEL;IA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A,cAACpB,OAAAA;IAAIE,WAAU;KAAmCrC,EAAE,oBAAA,CAAA,CAAA;AAGrF;;;ACvFA,IAAA,yBAAewD;",
|
|
6
|
+
"names": ["React", "useCallback", "useMemo", "createIntent", "LayoutAction", "useIntentDispatcher", "S", "FunctionType", "ScriptType", "Filter", "fullyQualifiedId", "useQuery", "Button", "useTranslation", "controlItemClasses", "List", "ghostHover", "mx", "grid", "FunctionsPanel", "space", "t", "useTranslation", "AUTOMATION_PLUGIN", "functions", "useQuery", "Filter", "schema", "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", "List", "Root", "items", "isItem", "S", "is", "getId", "Item", "key", "item", "classNames", "ghostHover", "ItemTitle", "Button", "onClick", "length", "FunctionsPanel"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AUTOMATION_PLUGIN
|
|
3
|
+
} from "./chunk-WKKQV4PC.mjs";
|
|
4
|
+
|
|
5
|
+
// packages/plugins/plugin-automation/src/types.ts
|
|
6
|
+
import { S } from "@dxos/echo-schema";
|
|
7
|
+
import { SpaceSchema } from "@dxos/react-client/echo";
|
|
8
|
+
var TriggerTemplate = S.Union(S.Struct({
|
|
9
|
+
type: S.Literal("timer"),
|
|
10
|
+
cron: S.String
|
|
11
|
+
}), S.Struct({
|
|
12
|
+
type: S.Literal("queue"),
|
|
13
|
+
queueDXN: S.Any
|
|
14
|
+
}));
|
|
15
|
+
var AutomationAction;
|
|
16
|
+
(function(AutomationAction2) {
|
|
17
|
+
const AUTOMATION_ACTION = `${AUTOMATION_PLUGIN}/action`;
|
|
18
|
+
class CreateTriggerFromTemplate extends S.TaggedClass()(`${AUTOMATION_ACTION}/create-trigger-from-template`, {
|
|
19
|
+
input: S.Struct({
|
|
20
|
+
space: SpaceSchema,
|
|
21
|
+
template: TriggerTemplate,
|
|
22
|
+
enabled: S.optional(S.Boolean),
|
|
23
|
+
// TODO(wittjosiah): Improve how this lookup is done.
|
|
24
|
+
scriptName: S.optional(S.String),
|
|
25
|
+
payload: S.optional(S.Record({
|
|
26
|
+
key: S.String,
|
|
27
|
+
value: S.Any
|
|
28
|
+
}))
|
|
29
|
+
}),
|
|
30
|
+
output: S.Void
|
|
31
|
+
}) {
|
|
32
|
+
}
|
|
33
|
+
AutomationAction2.CreateTriggerFromTemplate = CreateTriggerFromTemplate;
|
|
34
|
+
})(AutomationAction || (AutomationAction = {}));
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
AutomationAction
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=chunk-FCLWFVFX.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { S } from '@dxos/echo-schema';\nimport { SpaceSchema } from '@dxos/react-client/echo';\n\nimport { AUTOMATION_PLUGIN } from './meta';\n\nconst TriggerTemplate = S.Union(\n S.Struct({ type: S.Literal('timer'), cron: S.String }),\n S.Struct({ type: S.Literal('queue'), queueDXN: S.Any }),\n);\n\nexport namespace AutomationAction {\n const AUTOMATION_ACTION = `${AUTOMATION_PLUGIN}/action`;\n\n export class CreateTriggerFromTemplate extends S.TaggedClass<CreateTriggerFromTemplate>()(\n `${AUTOMATION_ACTION}/create-trigger-from-template`,\n {\n input: S.Struct({\n space: SpaceSchema,\n template: TriggerTemplate,\n enabled: S.optional(S.Boolean),\n // TODO(wittjosiah): Improve how this lookup is done.\n scriptName: S.optional(S.String),\n payload: S.optional(S.Record({ key: S.String, value: S.Any })),\n }),\n output: S.Void,\n },\n ) {}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAASA,SAAS;AAClB,SAASC,mBAAmB;AAI5B,IAAMC,kBAAkBC,EAAEC,MACxBD,EAAEE,OAAO;EAAEC,MAAMH,EAAEI,QAAQ,OAAA;EAAUC,MAAML,EAAEM;AAAO,CAAA,GACpDN,EAAEE,OAAO;EAAEC,MAAMH,EAAEI,QAAQ,OAAA;EAAUG,UAAUP,EAAEQ;AAAI,CAAA,CAAA;;UAGtCC,mBAAAA;AACf,QAAMC,oBAAoB,GAAGC,iBAAAA;EAEtB,MAAMC,kCAAkCZ,EAAEa,YAAW,EAC1D,GAAGH,iBAAAA,iCACH;IACEI,OAAOd,EAAEE,OAAO;MACda,OAAOC;MACPC,UAAUlB;MACVmB,SAASlB,EAAEmB,SAASnB,EAAEoB,OAAO;;MAE7BC,YAAYrB,EAAEmB,SAASnB,EAAEM,MAAM;MAC/BgB,SAAStB,EAAEmB,SAASnB,EAAEuB,OAAO;QAAEC,KAAKxB,EAAEM;QAAQmB,OAAOzB,EAAEQ;MAAI,CAAA,CAAA;IAC7D,CAAA;IACAkB,QAAQ1B,EAAE2B;EACZ,CAAA,EAAA;EACC;oBAbUf,4BAAAA;AAcf,GAjBiBH,qBAAAA,mBAAAA,CAAAA,EAAAA;",
|
|
6
|
+
"names": ["S", "SpaceSchema", "TriggerTemplate", "S", "Union", "Struct", "type", "Literal", "cron", "String", "queueDXN", "Any", "AutomationAction", "AUTOMATION_ACTION", "AUTOMATION_PLUGIN", "CreateTriggerFromTemplate", "TaggedClass", "input", "space", "SpaceSchema", "template", "enabled", "optional", "Boolean", "scriptName", "payload", "Record", "key", "value", "output", "Void"]
|
|
7
|
+
}
|
|
@@ -10,20 +10,19 @@ import React, { useState } from "react";
|
|
|
10
10
|
import { S } from "@dxos/echo-schema";
|
|
11
11
|
import { FunctionType, FunctionTrigger, FunctionTriggerSchema, TriggerKind, ScriptType } from "@dxos/functions/types";
|
|
12
12
|
import { useClient } from "@dxos/react-client";
|
|
13
|
-
import {
|
|
13
|
+
import { live, Filter, useQuery, getSpace } from "@dxos/react-client/echo";
|
|
14
14
|
import { Clipboard, IconButton, Input, Separator, useTranslation } from "@dxos/react-ui";
|
|
15
15
|
import { ControlItem, controlItemClasses } from "@dxos/react-ui-form";
|
|
16
16
|
import { List } from "@dxos/react-ui-list";
|
|
17
|
-
import { StackItem } from "@dxos/react-ui-stack";
|
|
18
17
|
import { ghostHover, mx } from "@dxos/react-ui-theme";
|
|
19
18
|
var grid = "grid grid-cols-[40px_1fr_32px] min-bs-[2.5rem]";
|
|
20
|
-
var AutomationPanel = ({ space, object }) => {
|
|
19
|
+
var AutomationPanel = ({ space, object, initialTrigger, onDone }) => {
|
|
21
20
|
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
22
21
|
const client = useClient();
|
|
23
22
|
const triggers = useQuery(space, Filter.schema(FunctionTrigger));
|
|
24
23
|
const functions = useQuery(space, Filter.schema(FunctionType));
|
|
25
24
|
const scripts = useQuery(space, Filter.schema(ScriptType));
|
|
26
|
-
const [trigger, setTrigger] = useState();
|
|
25
|
+
const [trigger, setTrigger] = useState(initialTrigger);
|
|
27
26
|
const [selected, setSelected] = useState();
|
|
28
27
|
const handleSelect = (trigger2) => {
|
|
29
28
|
const { id: _, ...values } = trigger2;
|
|
@@ -31,7 +30,7 @@ var AutomationPanel = ({ space, object }) => {
|
|
|
31
30
|
setSelected(trigger2);
|
|
32
31
|
};
|
|
33
32
|
const handleAdd = () => {
|
|
34
|
-
setTrigger(
|
|
33
|
+
setTrigger(live(FunctionTriggerSchema, {}));
|
|
35
34
|
setSelected(void 0);
|
|
36
35
|
};
|
|
37
36
|
const handleDelete = (trigger2) => {
|
|
@@ -43,17 +42,17 @@ var AutomationPanel = ({ space, object }) => {
|
|
|
43
42
|
if (selected) {
|
|
44
43
|
Object.assign(selected, trigger2);
|
|
45
44
|
} else {
|
|
46
|
-
space.db.add(
|
|
45
|
+
space.db.add(live(FunctionTrigger, trigger2));
|
|
47
46
|
}
|
|
48
47
|
setTrigger(void 0);
|
|
49
48
|
setSelected(void 0);
|
|
49
|
+
onDone?.();
|
|
50
50
|
};
|
|
51
51
|
const handleCancel = () => {
|
|
52
52
|
setTrigger(void 0);
|
|
53
|
+
onDone?.();
|
|
53
54
|
};
|
|
54
|
-
return /* @__PURE__ */ React.createElement(
|
|
55
|
-
classNames: "block overflow-y-auto"
|
|
56
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
55
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
57
56
|
className: "flex flex-col w-full"
|
|
58
57
|
}, trigger ? /* @__PURE__ */ React.createElement(ControlItem, {
|
|
59
58
|
title: t("trigger editor title")
|
|
@@ -98,7 +97,7 @@ var AutomationPanel = ({ space, object }) => {
|
|
|
98
97
|
icon: "ph--plus--regular",
|
|
99
98
|
label: t("new trigger label"),
|
|
100
99
|
onClick: handleAdd
|
|
101
|
-
})))
|
|
100
|
+
})));
|
|
102
101
|
};
|
|
103
102
|
var getCopyAction = (client, trigger) => {
|
|
104
103
|
if (trigger?.spec?.type === TriggerKind.Email) {
|
|
@@ -133,7 +132,9 @@ var getFunctionName = (scripts, functions, trigger) => {
|
|
|
133
132
|
|
|
134
133
|
// packages/plugins/plugin-automation/src/components/AutomationPanel/index.ts
|
|
135
134
|
var AutomationPanel_default = AutomationPanel;
|
|
135
|
+
|
|
136
136
|
export {
|
|
137
|
-
|
|
137
|
+
AutomationPanel,
|
|
138
|
+
AutomationPanel_default
|
|
138
139
|
};
|
|
139
|
-
//# sourceMappingURL=
|
|
140
|
+
//# sourceMappingURL=chunk-NGG4ICAQ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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/types';\nimport { type Client, useClient } from '@dxos/react-client';\nimport { live, Filter, useQuery, type Space, type Live, getSpace } from '@dxos/react-client/echo';\nimport { Clipboard, IconButton, Input, Separator, useTranslation } from '@dxos/react-ui';\nimport { ControlItem, 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';\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?: Live<any>;\n initialTrigger?: FunctionTriggerType;\n onDone?: () => void;\n};\n\n// TODO(burdon): Factor out common layout with ViewEditor.\nexport const AutomationPanel = ({ space, object, initialTrigger, onDone }: 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 | undefined>(initialTrigger);\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(live(FunctionTriggerSchema, {}));\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(live(FunctionTrigger, trigger));\n }\n\n setTrigger(undefined);\n setSelected(undefined);\n onDone?.();\n };\n\n const handleCancel: TriggerEditorProps['onCancel'] = () => {\n setTrigger(undefined);\n onDone?.();\n };\n\n return (\n <div className='flex flex-col w-full'>\n {trigger ? (\n <ControlItem title={t('trigger editor title')}>\n <TriggerEditor space={space} trigger={trigger} onSave={handleSave} onCancel={handleCancel} />\n </ControlItem>\n ) : (\n <div role='none' className={controlItemClasses}>\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 {triggers.length > 0 && <Separator classNames='mlb-4' />}\n <IconButton icon='ph--plus--regular' label={t('new trigger label')} onClick={handleAdd} />\n </div>\n )}\n </div>\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 * 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,MAAMC,QAAQC,UAAiCC,gBAAgB;AACxE,SAASC,WAAWC,YAAYC,OAAOC,WAAWC,sBAAsB;AACxE,SAASC,aAAaC,0BAA0B;AAChD,SAASC,YAAY;AACrB,SAASC,YAAYC,UAAU;AAK/B,IAAMC,OAAO;AAUN,IAAMC,kBAAkB,CAAC,EAAEC,OAAOC,QAAQC,gBAAgBC,OAAM,MAAwB;AAC7F,QAAM,EAAEC,EAAC,IAAKC,eAAeC,iBAAAA;AAC7B,QAAMC,SAASC,UAAAA;AACf,QAAMC,WAAWC,SAASV,OAAOW,OAAOC,OAAOC,eAAAA,CAAAA;AAC/C,QAAMC,YAAYJ,SAASV,OAAOW,OAAOC,OAAOG,YAAAA,CAA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B,MAAMW,cAAclF,QAAQW,OAAAA;IAAS;EACrG;AAEA,SAAOY;AACT;AAEA,IAAM2D,gBAAgB,CAAClF,QAAgBW,YAAAA;AACrC,QAAMwE,UAAUH,SAASrE,OAAAA,EAAUM;AACnC,QAAMmE,UAAU,IAAIC,IAAIrF,OAAOsF,OAAOnE,OAAOoE,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,IAAWxE,QAAQM,EAAE,IAAImE,OAAAA,EAASU,SAAQ;AACvE;AAEA,IAAM7B,kBAAkB,CAACxD,SAAuBF,WAA2BI,YAAAA;AAGzE,QAAMoF,UAAUpF,QAAQqF,YAAY,GAAGrF,QAAQqF,UAAUC,MAAM,GAAG,EAAA,CAAA;AAClE,QAAMC,iBAAiB3F,UAAU4F,KAAK,CAACC,OAAO,cAAcA,GAAGC,IAAI,OAAO1F,QAAQqF,QAAQ;AAC1F,MAAI,CAACE,gBAAgB;AACnB,WAAOH;EACT;AACA,SAAOtF,QAAQ0F,KAAK,CAACG,MAAMJ,eAAeK,QAAQC,QAAQvF,OAAOqF,EAAErF,EAAE,GAAGoF,QAAQN;AAClF;;;AC9JA,IAAA,0BAAeU;",
|
|
6
|
+
"names": ["React", "useState", "S", "FunctionType", "FunctionTrigger", "FunctionTriggerSchema", "TriggerKind", "ScriptType", "useClient", "live", "Filter", "useQuery", "getSpace", "Clipboard", "IconButton", "Input", "Separator", "useTranslation", "ControlItem", "controlItemClasses", "List", "ghostHover", "mx", "grid", "AutomationPanel", "space", "object", "initialTrigger", "onDone", "t", "useTranslation", "AUTOMATION_PLUGIN", "client", "useClient", "triggers", "useQuery", "Filter", "schema", "FunctionTrigger", "functions", "FunctionType", "scripts", "ScriptType", "trigger", "setTrigger", "useState", "selected", "setSelected", "handleSelect", "id", "_", "values", "handleAdd", "live", "FunctionTriggerSchema", "undefined", "handleDelete", "db", "remove", "handleSave", "Object", "assign", "add", "handleCancel", "div", "className", "ControlItem", "title", "TriggerEditor", "onSave", "onCancel", "role", "controlItemClasses", "List", "Root", "items", "isItem", "S", "is", "getId", "field", "map", "copyAction", "getCopyAction", "Item", "key", "item", "classNames", "mx", "ghostHover", "Input", "Switch", "checked", "enabled", "onCheckedChange", "ItemTitle", "onClick", "getFunctionName", "Clipboard", "IconButton", "label", "translationKey", "value", "contentProvider", "ItemDeleteButton", "length", "Separator", "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
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// packages/plugins/plugin-automation/src/components/index.ts
|
|
2
|
+
import { lazy } from "react";
|
|
3
|
+
var AutomationContainer = lazy(() => import("./AutomationContainer-KEQ5RNIW.mjs"));
|
|
4
|
+
var AutomationPanel = lazy(() => import("./AutomationPanel-G3OB6ELR.mjs"));
|
|
5
|
+
var FunctionsContainer = lazy(() => import("./FunctionsContainer-STXBW4CX.mjs"));
|
|
6
|
+
var FunctionsPanel = lazy(() => import("./FunctionsPanel-JJPLIAJW.mjs"));
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
AutomationContainer,
|
|
10
|
+
AutomationPanel,
|
|
11
|
+
FunctionsContainer,
|
|
12
|
+
FunctionsPanel
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=chunk-QJPKWYTL.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
AutomationContainer,
|
|
3
|
+
AutomationPanel,
|
|
4
|
+
FunctionsContainer,
|
|
5
|
+
FunctionsPanel
|
|
6
|
+
} from "./chunk-QJPKWYTL.mjs";
|
|
4
7
|
import {
|
|
5
8
|
TriggerEditor
|
|
6
9
|
} from "./chunk-FALBBJNO.mjs";
|
|
@@ -13,12 +16,12 @@ import {
|
|
|
13
16
|
import { Capabilities, contributes, defineModule, definePlugin, Events } from "@dxos/app-framework";
|
|
14
17
|
import { FunctionType, FunctionTrigger } from "@dxos/functions/types";
|
|
15
18
|
import { ClientCapabilities, ClientEvents } from "@dxos/plugin-client";
|
|
16
|
-
import { SpaceCapabilities, SpaceEvents } from "@dxos/plugin-space";
|
|
17
19
|
|
|
18
20
|
// packages/plugins/plugin-automation/src/capabilities/index.ts
|
|
19
21
|
import { lazy } from "@dxos/app-framework";
|
|
20
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-
|
|
21
|
-
var
|
|
22
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-ND64CHOM.mjs"));
|
|
23
|
+
var IntentResolver = lazy(() => import("./intent-resolver-3J647TIZ.mjs"));
|
|
24
|
+
var ReactSurface = lazy(() => import("./react-surface-L22QIANU.mjs"));
|
|
22
25
|
|
|
23
26
|
// packages/plugins/plugin-automation/src/translations.ts
|
|
24
27
|
var translations_default = [
|
|
@@ -28,7 +31,15 @@ var translations_default = [
|
|
|
28
31
|
"plugin name": "Automation",
|
|
29
32
|
"automation panel label": "Automations",
|
|
30
33
|
"script automation label": "Automation",
|
|
31
|
-
"
|
|
34
|
+
"automation verbose label": "Manage automations",
|
|
35
|
+
"automation description": "You can manage all the triggers which automate your space here.",
|
|
36
|
+
"functions panel label": "Functions",
|
|
37
|
+
"functions verbose label": "Manage deployed functions",
|
|
38
|
+
"functions description": "You can manage all the functions deployed from your space on EDGE here.",
|
|
39
|
+
"function copy id": "Copy Function ID",
|
|
40
|
+
"no functions found": "No functions found",
|
|
41
|
+
"go to function source button label": "Show function source",
|
|
42
|
+
"trigger editor title": "Configure Trigger",
|
|
32
43
|
"new trigger label": "Add Trigger",
|
|
33
44
|
"trigger type timer": "Timer",
|
|
34
45
|
"trigger type webhook": "Webhook",
|
|
@@ -67,17 +78,9 @@ var AutomationPlugin = () => definePlugin(meta, [
|
|
|
67
78
|
activate: AppGraphBuilder
|
|
68
79
|
}),
|
|
69
80
|
defineModule({
|
|
70
|
-
id: `${meta.id}/module/
|
|
71
|
-
activatesOn:
|
|
72
|
-
activate:
|
|
73
|
-
id: "automation",
|
|
74
|
-
label: [
|
|
75
|
-
"automation panel label",
|
|
76
|
-
{
|
|
77
|
-
ns: meta.id
|
|
78
|
-
}
|
|
79
|
-
]
|
|
80
|
-
})
|
|
81
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
82
|
+
activatesOn: Events.SetupIntentResolver,
|
|
83
|
+
activate: IntentResolver
|
|
81
84
|
}),
|
|
82
85
|
defineModule({
|
|
83
86
|
id: `${meta.id}/module/react-surface`,
|
|
@@ -87,8 +90,11 @@ var AutomationPlugin = () => definePlugin(meta, [
|
|
|
87
90
|
]);
|
|
88
91
|
export {
|
|
89
92
|
AUTOMATION_PLUGIN,
|
|
93
|
+
AutomationContainer,
|
|
90
94
|
AutomationPanel,
|
|
91
95
|
AutomationPlugin,
|
|
96
|
+
FunctionsContainer,
|
|
97
|
+
FunctionsPanel,
|
|
92
98
|
TriggerEditor,
|
|
93
99
|
meta
|
|
94
100
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/AutomationPlugin.tsx", "../../../src/capabilities/index.ts", "../../../src/translations.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Capabilities, contributes, defineModule, definePlugin, Events } from '@dxos/app-framework';\nimport { FunctionType, FunctionTrigger } from '@dxos/functions/types';\nimport { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';\
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["Capabilities", "contributes", "defineModule", "definePlugin", "Events", "FunctionType", "FunctionTrigger", "ClientCapabilities", "ClientEvents", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Capabilities, contributes, defineModule, definePlugin, Events } from '@dxos/app-framework';\nimport { FunctionType, FunctionTrigger } from '@dxos/functions/types';\nimport { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';\n\nimport { AppGraphBuilder, IntentResolver, ReactSurface } from './capabilities';\nimport { meta } from './meta';\nimport translations from './translations';\n\nexport const AutomationPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () => contributes(ClientCapabilities.Schema, [FunctionType, FunctionTrigger]),\n }),\n defineModule({\n id: `${meta.id}/module/app-graph-builder`,\n activatesOn: Events.SetupAppGraph,\n activate: AppGraphBuilder,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: IntentResolver,\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: ReactSurface,\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(() => import('./app-graph-builder'));\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { AUTOMATION_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [AUTOMATION_PLUGIN]: {\n 'plugin name': 'Automation',\n 'automation panel label': 'Automations',\n 'script automation label': 'Automation',\n 'automation verbose label': 'Manage automations',\n 'automation description': 'You can manage all the triggers which automate your space here.',\n\n 'functions panel label': 'Functions',\n 'functions verbose label': 'Manage deployed functions',\n 'functions description': 'You can manage all the functions deployed from your space on EDGE here.',\n 'function copy id': 'Copy Function ID',\n 'no functions found': 'No functions found',\n 'go to function source button label': 'Show function source',\n\n 'trigger editor title': 'Configure Trigger',\n 'new trigger label': 'Add Trigger',\n 'trigger type timer': 'Timer',\n 'trigger type webhook': 'Webhook',\n 'trigger type websocket': 'Websocket',\n 'trigger type subscription': 'Subscription',\n 'trigger type email': 'Email',\n 'trigger type queue': 'Queue',\n\n 'trigger copy url': 'Copy URL',\n 'trigger copy email': 'Copy Email',\n\n 'trigger payload add': 'Add',\n 'trigger payload remove': 'Remove',\n 'trigger payload prop name placeholder': 'New payload property name',\n },\n },\n },\n];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;AAIA,SAASA,cAAcC,aAAaC,cAAcC,cAAcC,cAAc;AAC9E,SAASC,cAAcC,uBAAuB;AAC9C,SAASC,oBAAoBC,oBAA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
|
6
|
+
"names": ["Capabilities", "contributes", "defineModule", "definePlugin", "Events", "FunctionType", "FunctionTrigger", "ClientCapabilities", "ClientEvents", "lazy", "AppGraphBuilder", "lazy", "IntentResolver", "ReactSurface", "AUTOMATION_PLUGIN", "AutomationPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "ClientEvents", "SetupSchema", "ClientCapabilities", "Schema", "FunctionType", "FunctionTrigger", "SetupAppGraph", "AppGraphBuilder", "SetupIntentResolver", "IntentResolver", "SetupReactSurface", "ReactSurface"]
|
|
7
7
|
}
|