@dxos/plugin-automation 0.8.2-main.f11618f → 0.8.2-staging.7ac8446
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/{chunk-NGG4ICAQ.mjs → AutomationPanel-YAHFXQX6.mjs} +12 -13
- package/dist/lib/browser/AutomationPanel-YAHFXQX6.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-ND64CHOM.mjs → app-graph-builder-K3BIQFWW.mjs} +1 -42
- package/dist/lib/browser/app-graph-builder-K3BIQFWW.mjs.map +7 -0
- package/dist/lib/browser/chunk-MT3FZH4V.mjs +8 -0
- package/dist/lib/browser/chunk-MT3FZH4V.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +17 -23
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-4QQSJR4A.mjs +42 -0
- package/dist/lib/browser/react-surface-4QQSJR4A.mjs.map +7 -0
- package/dist/lib/node/{chunk-SRXHHBDE.cjs → AutomationPanel-ZKAMIU6O.cjs} +14 -19
- package/dist/lib/node/AutomationPanel-ZKAMIU6O.cjs.map +7 -0
- package/dist/lib/node/{app-graph-builder-TVFR6RXO.cjs → app-graph-builder-HO4FPGZ5.cjs} +4 -45
- package/dist/lib/node/app-graph-builder-HO4FPGZ5.cjs.map +7 -0
- package/dist/lib/node/{chunk-L5TWLPGA.cjs → chunk-AGJ6XTDN.cjs} +7 -16
- package/dist/lib/node/chunk-AGJ6XTDN.cjs.map +7 -0
- package/dist/lib/node/index.cjs +17 -23
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-PCZCHIET.cjs → react-surface-52M54VWV.cjs} +12 -36
- package/dist/lib/node/react-surface-52M54VWV.cjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HMYAQLGF.mjs → AutomationPanel-XF7YPSKM.mjs} +12 -13
- package/dist/lib/node-esm/AutomationPanel-XF7YPSKM.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-NYLOXWVV.mjs → app-graph-builder-XCJR33VS.mjs} +1 -42
- package/dist/lib/node-esm/app-graph-builder-XCJR33VS.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-OA75PSGH.mjs +10 -0
- package/dist/lib/node-esm/chunk-OA75PSGH.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +17 -23
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-MGKM3OO3.mjs +43 -0
- package/dist/lib/node-esm/react-surface-MGKM3OO3.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 +0 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +3 -6
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/index.d.ts +0 -1
- package/dist/types/src/components/AutomationPanel/index.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -8
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +0 -8
- package/dist/types/src/translations.d.ts.map +1 -1
- package/package.json +24 -29
- package/src/AutomationPlugin.tsx +9 -4
- package/src/capabilities/app-graph-builder.ts +0 -31
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/react-surface.tsx +7 -31
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +4 -4
- package/src/components/AutomationPanel/AutomationPanel.tsx +63 -62
- package/src/components/AutomationPanel/index.ts +0 -2
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +3 -3
- package/src/components/index.ts +0 -3
- package/src/translations.ts +1 -10
- package/dist/lib/browser/AutomationContainer-KEQ5RNIW.mjs +0 -34
- package/dist/lib/browser/AutomationContainer-KEQ5RNIW.mjs.map +0 -7
- package/dist/lib/browser/AutomationPanel-G3OB6ELR.mjs +0 -11
- package/dist/lib/browser/AutomationPanel-G3OB6ELR.mjs.map +0 -7
- package/dist/lib/browser/FunctionsContainer-STXBW4CX.mjs +0 -33
- package/dist/lib/browser/FunctionsContainer-STXBW4CX.mjs.map +0 -7
- package/dist/lib/browser/FunctionsPanel-JJPLIAJW.mjs +0 -10
- package/dist/lib/browser/FunctionsPanel-JJPLIAJW.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-ND64CHOM.mjs.map +0 -7
- package/dist/lib/browser/chunk-65VL4EYS.mjs +0 -88
- package/dist/lib/browser/chunk-65VL4EYS.mjs.map +0 -7
- package/dist/lib/browser/chunk-FCLWFVFX.mjs +0 -39
- package/dist/lib/browser/chunk-FCLWFVFX.mjs.map +0 -7
- package/dist/lib/browser/chunk-NGG4ICAQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-QJPKWYTL.mjs +0 -14
- package/dist/lib/browser/chunk-QJPKWYTL.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-SNIAQ7V5.mjs +0 -78
- package/dist/lib/browser/intent-resolver-SNIAQ7V5.mjs.map +0 -7
- package/dist/lib/browser/react-surface-L22QIANU.mjs +0 -68
- package/dist/lib/browser/react-surface-L22QIANU.mjs.map +0 -7
- package/dist/lib/browser/types.mjs +0 -8
- package/dist/lib/browser/types.mjs.map +0 -7
- package/dist/lib/node/AutomationContainer-E5I76FPP.cjs +0 -62
- package/dist/lib/node/AutomationContainer-E5I76FPP.cjs.map +0 -7
- package/dist/lib/node/AutomationPanel-YLXAFJDP.cjs +0 -32
- package/dist/lib/node/AutomationPanel-YLXAFJDP.cjs.map +0 -7
- package/dist/lib/node/FunctionsContainer-3HCURMEB.cjs +0 -61
- package/dist/lib/node/FunctionsContainer-3HCURMEB.cjs.map +0 -7
- package/dist/lib/node/FunctionsPanel-SYIZHPGU.cjs +0 -31
- package/dist/lib/node/FunctionsPanel-SYIZHPGU.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-TVFR6RXO.cjs.map +0 -7
- package/dist/lib/node/chunk-BSK5SHTR.cjs +0 -116
- package/dist/lib/node/chunk-BSK5SHTR.cjs.map +0 -7
- package/dist/lib/node/chunk-L5TWLPGA.cjs.map +0 -7
- package/dist/lib/node/chunk-PSIJDHAX.cjs +0 -58
- package/dist/lib/node/chunk-PSIJDHAX.cjs.map +0 -7
- package/dist/lib/node/chunk-SRXHHBDE.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-A44BNFEG.cjs +0 -94
- package/dist/lib/node/intent-resolver-A44BNFEG.cjs.map +0 -7
- package/dist/lib/node/react-surface-PCZCHIET.cjs.map +0 -7
- package/dist/lib/node/types.cjs +0 -30
- package/dist/lib/node/types.cjs.map +0 -7
- package/dist/lib/node-esm/AutomationContainer-22PUFPSE.mjs +0 -35
- package/dist/lib/node-esm/AutomationContainer-22PUFPSE.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationPanel-6UXIAJVS.mjs +0 -12
- package/dist/lib/node-esm/AutomationPanel-6UXIAJVS.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsContainer-XG5WVAN3.mjs +0 -34
- package/dist/lib/node-esm/FunctionsContainer-XG5WVAN3.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsPanel-J3QGUESH.mjs +0 -11
- package/dist/lib/node-esm/FunctionsPanel-J3QGUESH.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-NYLOXWVV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4UPGANGV.mjs +0 -89
- package/dist/lib/node-esm/chunk-4UPGANGV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HMYAQLGF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TMMB5ETD.mjs +0 -16
- package/dist/lib/node-esm/chunk-TMMB5ETD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YYBCQXB2.mjs +0 -40
- package/dist/lib/node-esm/chunk-YYBCQXB2.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-JFLTVJ7D.mjs +0 -79
- package/dist/lib/node-esm/intent-resolver-JFLTVJ7D.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-VSO4NWC6.mjs +0 -69
- package/dist/lib/node-esm/react-surface-VSO4NWC6.mjs.map +0 -7
- package/dist/lib/node-esm/types.mjs +0 -9
- package/dist/lib/node-esm/types.mjs.map +0 -7
- 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 -7
- package/dist/types/src/components/AutomationContainer.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/types.d.ts +0 -25
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/capabilities/intent-resolver.ts +0 -76
- package/src/components/AutomationContainer.tsx +0 -31
- package/src/components/FunctionsContainer.tsx +0 -31
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +0 -95
- package/src/components/FunctionsPanel/index.ts +0 -8
- package/src/types.ts +0 -32
|
@@ -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 { 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
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
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
|
|
@@ -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 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;IAACb;IAAWK;GAAQ;AAGtB,QAAMiB,gBAAgBC,YACpB,CAACT,SAAAA;AACC,UAAMK,SAAST,oBAAoBI,KAAKI,EAAE;AAC1C,WAAOC,QAAQK;EACjB,GACA;IAACd;GAAoB;AAGvB,QAAMe,mBAAmBF,YACvB,CAACT,SAAAA;AACC,UAAMK,SAAST,oBAAoBI,KAAKI,EAAE;AAC1C,QAAIC,QAAQ;AACV,WAAKX,SAASkB,aAAaC,aAAaC,MAAM;QAAEC,MAAM;QAAQC,SAAS;UAACC,iBAAiBZ,MAAAA;;MAAS,CAAA,CAAA;IACpG;EACF,GACA;IAACT;IAAqBF;GAAS;AAGjC,SACE,sBAAA,cAACwB,OAAAA;IAAIC,MAAK;IAAOC,WAAWC,GAAGC,kBAAAA;KAC7B,sBAAA,cAACC,KAAKC,MAAI;IAAeC,OAAOvC;IAAWwC,QAAQC,EAAEC,GAAGtC,YAAAA;IAAeuC,OAAO,CAAC7B,SAASA,KAAKI;KAC1F,CAAC,EAAEqB,MAAK,MACP,sBAAA,cAACP,OAAAA;IAAIC,MAAK;IAAOC,WAAU;KACxBK,OAAO1B,IAAI,CAACC,SACX,sBAAA,cAACuB,KAAKO,MAAI;IACRC,KAAK/B,KAAKI;IACV4B,MAAMhC;IACNiC,YAAYZ,GAAGzC,MAAMsD,YAAY,gBAAgB,SAAS,eAAA;KAE1D,sBAAA,cAAChB,OAAAA;IAAIE,WAAU;KACb,sBAAA,cAACG,KAAKY,WAAS;IAACF,YAAW;KAAYjC,KAAKU,IAAI,GAC/CF,cAAcR,IAAAA,KACb,sBAAA,cAACkB,OAAAA;IAAIE,WAAU;KAAqCZ,cAAcR,IAAAA,CAAAA,CAAAA,GAGrEJ,oBAAoBI,KAAKI,EAAE,KAC1B,sBAAA,cAACgC,QAAAA;IAAOC,SAAS,MAAM1B,iBAAiBX,IAAAA;KAAQjB,EAAE,oCAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAQ7DG,UAAUoD,WAAW,KAAK,sBAAA,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
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
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
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/AutomationPanel/AutomationPanel.tsx", "../../../src/components/AutomationPanel/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useState } from 'react';\n\nimport { S } from '@dxos/echo-schema';\nimport {\n FunctionType,\n FunctionTrigger,\n FunctionTriggerSchema,\n TriggerKind,\n type FunctionTriggerType,\n ScriptType,\n} from '@dxos/functions/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": "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",
|
|
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
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
|
@@ -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,78 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AutomationAction
|
|
3
|
-
} from "./chunk-FCLWFVFX.mjs";
|
|
4
|
-
import "./chunk-WKKQV4PC.mjs";
|
|
5
|
-
|
|
6
|
-
// packages/plugins/plugin-automation/src/capabilities/intent-resolver.ts
|
|
7
|
-
import { contributes, Capabilities, createResolver, createIntent, LayoutAction } from "@dxos/app-framework";
|
|
8
|
-
import { FunctionTrigger, FunctionType, ScriptType, TriggerKind } from "@dxos/functions";
|
|
9
|
-
import { live } from "@dxos/live-object";
|
|
10
|
-
import { ATTENDABLE_PATH_SEPARATOR } from "@dxos/plugin-deck/types";
|
|
11
|
-
import { SpaceAction } from "@dxos/plugin-space/types";
|
|
12
|
-
import { Filter } from "@dxos/react-client/echo";
|
|
13
|
-
var intent_resolver_default = (context) => contributes(Capabilities.IntentResolver, [
|
|
14
|
-
createResolver({
|
|
15
|
-
intent: AutomationAction.CreateTriggerFromTemplate,
|
|
16
|
-
resolve: async ({ space, template, enabled = false, scriptName, payload }) => {
|
|
17
|
-
const trigger = live(FunctionTrigger, {
|
|
18
|
-
enabled
|
|
19
|
-
});
|
|
20
|
-
if (scriptName) {
|
|
21
|
-
const { objects: [script] } = await space.db.query(Filter.schema(ScriptType, {
|
|
22
|
-
name: scriptName
|
|
23
|
-
})).run();
|
|
24
|
-
if (script) {
|
|
25
|
-
const { objects: [fn] } = await space.db.query(Filter.schema(FunctionType, {
|
|
26
|
-
source: script
|
|
27
|
-
})).run();
|
|
28
|
-
if (fn) {
|
|
29
|
-
trigger.function = `dxn:worker:${fn.name}`;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
if (payload) {
|
|
34
|
-
trigger.meta = payload;
|
|
35
|
-
}
|
|
36
|
-
switch (template.type) {
|
|
37
|
-
case "timer": {
|
|
38
|
-
trigger.spec = {
|
|
39
|
-
type: TriggerKind.Timer,
|
|
40
|
-
cron: template.cron
|
|
41
|
-
};
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
case "queue": {
|
|
45
|
-
trigger.spec = {
|
|
46
|
-
type: TriggerKind.Queue,
|
|
47
|
-
queue: template.queueDXN.toString()
|
|
48
|
-
};
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
default: {
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return {
|
|
56
|
-
intents: [
|
|
57
|
-
createIntent(SpaceAction.AddObject, {
|
|
58
|
-
object: trigger,
|
|
59
|
-
target: space
|
|
60
|
-
}),
|
|
61
|
-
createIntent(LayoutAction.Open, {
|
|
62
|
-
part: "main",
|
|
63
|
-
subject: [
|
|
64
|
-
`automation-settings${ATTENDABLE_PATH_SEPARATOR}${space.id}`
|
|
65
|
-
],
|
|
66
|
-
options: {
|
|
67
|
-
workspace: space.id
|
|
68
|
-
}
|
|
69
|
-
})
|
|
70
|
-
]
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
})
|
|
74
|
-
]);
|
|
75
|
-
export {
|
|
76
|
-
intent_resolver_default as default
|
|
77
|
-
};
|
|
78
|
-
//# sourceMappingURL=intent-resolver-SNIAQ7V5.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/intent-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n contributes,\n Capabilities,\n createResolver,\n type PluginsContext,\n createIntent,\n LayoutAction,\n} from '@dxos/app-framework';\nimport { FunctionTrigger, FunctionType, ScriptType, TriggerKind } from '@dxos/functions';\nimport { type DXN } from '@dxos/keys';\nimport { live } from '@dxos/live-object';\nimport { ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { Filter } from '@dxos/react-client/echo';\n\nimport { AutomationAction } from '../types';\n\nexport default (context: PluginsContext) =>\n contributes(Capabilities.IntentResolver, [\n createResolver({\n intent: AutomationAction.CreateTriggerFromTemplate,\n resolve: async ({ space, template, enabled = false, scriptName, payload }) => {\n const trigger = live(FunctionTrigger, { enabled });\n\n // TODO(wittjosiah): Factor out function lookup by script name?\n if (scriptName) {\n const {\n objects: [script],\n } = await space.db.query(Filter.schema(ScriptType, { name: scriptName })).run();\n if (script) {\n const {\n objects: [fn],\n } = await space.db.query(Filter.schema(FunctionType, { source: script })).run();\n if (fn) {\n trigger.function = `dxn:worker:${fn.name}`;\n }\n }\n }\n\n if (payload) {\n trigger.meta = payload;\n }\n\n switch (template.type) {\n case 'timer': {\n trigger.spec = { type: TriggerKind.Timer, cron: template.cron };\n break;\n }\n case 'queue': {\n trigger.spec = { type: TriggerKind.Queue, queue: (template.queueDXN as DXN).toString() };\n break;\n }\n default: {\n break;\n }\n }\n\n return {\n intents: [\n createIntent(SpaceAction.AddObject, { object: trigger, target: space }),\n createIntent(LayoutAction.Open, {\n part: 'main',\n subject: [`automation-settings${ATTENDABLE_PATH_SEPARATOR}${space.id}`],\n options: {\n workspace: space.id,\n },\n }),\n ],\n };\n },\n }),\n ]);\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,SACEA,aACAC,cACAC,gBAEAC,cACAC,oBACK;AACP,SAASC,iBAAiBC,cAAcC,YAAYC,mBAAmB;AAEvE,SAASC,YAAY;AACrB,SAASC,iCAAiC;AAC1C,SAASC,mBAAmB;AAC5B,SAASC,cAAc;AAIvB,IAAA,0BAAe,CAACC,YACdC,YAAYC,aAAaC,gBAAgB;EACvCC,eAAe;IACbC,QAAQC,iBAAiBC;IACzBC,SAAS,OAAO,EAAEC,OAAOC,UAAUC,UAAU,OAAOC,YAAYC,QAAO,MAAE;AACvE,YAAMC,UAAUC,KAAKC,iBAAiB;QAAEL;MAAQ,CAAA;AAGhD,UAAIC,YAAY;AACd,cAAM,EACJK,SAAS,CAACC,MAAAA,EAAO,IACf,MAAMT,MAAMU,GAAGC,MAAMC,OAAOC,OAAOC,YAAY;UAAEC,MAAMZ;QAAW,CAAA,CAAA,EAAIa,IAAG;AAC7E,YAAIP,QAAQ;AACV,gBAAM,EACJD,SAAS,CAACS,EAAAA,EAAG,IACX,MAAMjB,MAAMU,GAAGC,MAAMC,OAAOC,OAAOK,cAAc;YAAEC,QAAQV;UAAO,CAAA,CAAA,EAAIO,IAAG;AAC7E,cAAIC,IAAI;AACNZ,oBAAQe,WAAW,cAAcH,GAAGF,IAAI;UAC1C;QACF;MACF;AAEA,UAAIX,SAAS;AACXC,gBAAQgB,OAAOjB;MACjB;AAEA,cAAQH,SAASqB,MAAI;QACnB,KAAK,SAAS;AACZjB,kBAAQkB,OAAO;YAAED,MAAME,YAAYC;YAAOC,MAAMzB,SAASyB;UAAK;AAC9D;QACF;QACA,KAAK,SAAS;AACZrB,kBAAQkB,OAAO;YAAED,MAAME,YAAYG;YAAOC,OAAQ3B,SAAS4B,SAAiBC,SAAQ;UAAG;AACvF;QACF;QACA,SAAS;AACP;QACF;MACF;AAEA,aAAO;QACLC,SAAS;UACPC,aAAaC,YAAYC,WAAW;YAAEC,QAAQ9B;YAAS+B,QAAQpC;UAAM,CAAA;UACrEgC,aAAaK,aAAaC,MAAM;YAC9BC,MAAM;YACNC,SAAS;cAAC,sBAAsBC,yBAAAA,GAA4BzC,MAAM0C,EAAE;;YACpEC,SAAS;cACPC,WAAW5C,MAAM0C;YACnB;UACF,CAAA;;MAEJ;IACF;EACF,CAAA;CACD;",
|
|
6
|
-
"names": ["contributes", "Capabilities", "createResolver", "createIntent", "LayoutAction", "FunctionTrigger", "FunctionType", "ScriptType", "TriggerKind", "live", "ATTENDABLE_PATH_SEPARATOR", "SpaceAction", "Filter", "context", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "AutomationAction", "CreateTriggerFromTemplate", "resolve", "space", "template", "enabled", "scriptName", "payload", "trigger", "live", "FunctionTrigger", "objects", "script", "db", "query", "Filter", "schema", "ScriptType", "name", "run", "fn", "FunctionType", "source", "function", "meta", "type", "spec", "TriggerKind", "Timer", "cron", "Queue", "queue", "queueDXN", "toString", "intents", "createIntent", "SpaceAction", "AddObject", "object", "target", "LayoutAction", "Open", "part", "subject", "ATTENDABLE_PATH_SEPARATOR", "id", "options", "workspace"]
|
|
7
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AutomationContainer,
|
|
3
|
-
AutomationPanel,
|
|
4
|
-
FunctionsContainer
|
|
5
|
-
} from "./chunk-QJPKWYTL.mjs";
|
|
6
|
-
import "./chunk-FALBBJNO.mjs";
|
|
7
|
-
import {
|
|
8
|
-
meta
|
|
9
|
-
} from "./chunk-WKKQV4PC.mjs";
|
|
10
|
-
|
|
11
|
-
// packages/plugins/plugin-automation/src/capabilities/react-surface.tsx
|
|
12
|
-
import React from "react";
|
|
13
|
-
import { Capabilities, contributes, createSurface, useLayout } from "@dxos/app-framework";
|
|
14
|
-
import { isInstanceOf } from "@dxos/echo-schema";
|
|
15
|
-
import { ScriptType } from "@dxos/functions/types";
|
|
16
|
-
import { getSpace, parseId, useSpace } from "@dxos/react-client/echo";
|
|
17
|
-
import { StackItem } from "@dxos/react-ui-stack";
|
|
18
|
-
var react_surface_default = () => contributes(Capabilities.ReactSurface, [
|
|
19
|
-
createSurface({
|
|
20
|
-
id: `${meta.id}/space-settings-automation`,
|
|
21
|
-
role: "article",
|
|
22
|
-
filter: (data) => data.subject === `${meta.id}/space-settings-automation`,
|
|
23
|
-
component: () => {
|
|
24
|
-
const layout = useLayout();
|
|
25
|
-
const { spaceId } = parseId(layout.workspace);
|
|
26
|
-
const space = useSpace(spaceId);
|
|
27
|
-
if (!space || !spaceId) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
return /* @__PURE__ */ React.createElement(AutomationContainer, {
|
|
31
|
-
space
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}),
|
|
35
|
-
createSurface({
|
|
36
|
-
id: `${meta.id}/space-settings-functions`,
|
|
37
|
-
role: "article",
|
|
38
|
-
filter: (data) => data.subject === `${meta.id}/space-settings-functions`,
|
|
39
|
-
component: () => {
|
|
40
|
-
const layout = useLayout();
|
|
41
|
-
const { spaceId } = parseId(layout.workspace);
|
|
42
|
-
const space = useSpace(spaceId);
|
|
43
|
-
if (!space || !spaceId) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
return /* @__PURE__ */ React.createElement(FunctionsContainer, {
|
|
47
|
-
space
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}),
|
|
51
|
-
createSurface({
|
|
52
|
-
id: `${meta.id}/companion/automation`,
|
|
53
|
-
role: "article",
|
|
54
|
-
filter: (data) => isInstanceOf(ScriptType, data.companionTo) && data.subject === "automation",
|
|
55
|
-
component: ({ data, role }) => {
|
|
56
|
-
return /* @__PURE__ */ React.createElement(StackItem.Content, {
|
|
57
|
-
role
|
|
58
|
-
}, /* @__PURE__ */ React.createElement(AutomationPanel, {
|
|
59
|
-
space: getSpace(data.companionTo),
|
|
60
|
-
object: data.companionTo
|
|
61
|
-
}));
|
|
62
|
-
}
|
|
63
|
-
})
|
|
64
|
-
]);
|
|
65
|
-
export {
|
|
66
|
-
react_surface_default as default
|
|
67
|
-
};
|
|
68
|
-
//# sourceMappingURL=react-surface-L22QIANU.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 { isInstanceOf } from '@dxos/echo-schema';\nimport { ScriptType } from '@dxos/functions/types';\nimport { getSpace, parseId, useSpace } from '@dxos/react-client/echo';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { AutomationContainer, AutomationPanel, 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 isInstanceOf(ScriptType, data.companionTo) && data.subject === 'automation',\n component: ({ data, role }) => {\n return (\n <StackItem.Content role={role}>\n <AutomationPanel space={getSpace(data.companionTo)!} object={data.companionTo} />\n </StackItem.Content>\n );\n },\n }),\n ]);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,cAAcC,aAAaC,eAAeC,iBAAiB;AACpE,SAASC,oBAAoB;AAC7B,SAASC,kBAAkB;AAC3B,SAASC,UAAUC,SAASC,gBAAgB;AAC5C,SAASC,iBAAiB;AAK1B,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,aAAaC,YAAYb,KAAKc,WAAW,KAAKd,KAAKC,YAAY;IACjEC,WAAW,CAAC,EAAEF,MAAMF,KAAI,MAAE;AACxB,aACE,sBAAA,cAACiB,UAAUC,SAAO;QAAClB;SACjB,sBAAA,cAACmB,iBAAAA;QAAgBT,OAAOU,SAASlB,KAAKc,WAAW;QAAIK,QAAQnB,KAAKc;;IAGxE;EACF,CAAA;CACD;",
|
|
6
|
-
"names": ["React", "Capabilities", "contributes", "createSurface", "useLayout", "isInstanceOf", "ScriptType", "getSpace", "parseId", "useSpace", "StackItem", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "meta", "role", "filter", "data", "subject", "component", "layout", "useLayout", "spaceId", "parseId", "workspace", "space", "useSpace", "AutomationContainer", "FunctionsContainer", "isInstanceOf", "ScriptType", "companionTo", "StackItem", "Content", "AutomationPanel", "getSpace", "object"]
|
|
7
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var AutomationContainer_E5I76FPP_exports = {};
|
|
30
|
-
__export(AutomationContainer_E5I76FPP_exports, {
|
|
31
|
-
AutomationContainer: () => AutomationContainer,
|
|
32
|
-
default: () => AutomationContainer_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(AutomationContainer_E5I76FPP_exports);
|
|
35
|
-
var import_chunk_SRXHHBDE = require("./chunk-SRXHHBDE.cjs");
|
|
36
|
-
var import_chunk_FTEDH5Q6 = require("./chunk-FTEDH5Q6.cjs");
|
|
37
|
-
var import_chunk_7GXNXMSM = require("./chunk-7GXNXMSM.cjs");
|
|
38
|
-
var import_react = __toESM(require("react"));
|
|
39
|
-
var import_react_ui = require("@dxos/react-ui");
|
|
40
|
-
var import_react_ui_form = require("@dxos/react-ui-form");
|
|
41
|
-
var import_react_ui_stack = require("@dxos/react-ui-stack");
|
|
42
|
-
var AutomationContainer = ({ space }) => {
|
|
43
|
-
const { t } = (0, import_react_ui.useTranslation)(import_chunk_7GXNXMSM.AUTOMATION_PLUGIN);
|
|
44
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react_ui_stack.StackItem.Content, {
|
|
45
|
-
classNames: "block overflow-y-auto"
|
|
46
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_react_ui_form.ControlPage, null, /* @__PURE__ */ import_react.default.createElement(import_react_ui_form.ControlSection, {
|
|
47
|
-
title: t("automation verbose label", {
|
|
48
|
-
ns: import_chunk_7GXNXMSM.AUTOMATION_PLUGIN
|
|
49
|
-
}),
|
|
50
|
-
description: t("automation description", {
|
|
51
|
-
ns: import_chunk_7GXNXMSM.AUTOMATION_PLUGIN
|
|
52
|
-
})
|
|
53
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_chunk_SRXHHBDE.AutomationPanel, {
|
|
54
|
-
space
|
|
55
|
-
}))));
|
|
56
|
-
};
|
|
57
|
-
var AutomationContainer_default = AutomationContainer;
|
|
58
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
59
|
-
0 && (module.exports = {
|
|
60
|
-
AutomationContainer
|
|
61
|
-
});
|
|
62
|
-
//# sourceMappingURL=AutomationContainer-E5I76FPP.cjs.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 { 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,mBAAkB;AAGlB,sBAA+B;AAC/B,2BAA4C;AAC5C,4BAA0B;AAKnB,IAAMA,sBAAsB,CAAC,EAAEC,MAAK,MAAoB;AAC7D,QAAM,EAAEC,EAAC,QAAKC,gCAAeC,uCAAAA;AAC7B,SACE,6BAAAC,QAAA,cAACC,gCAAUC,SAAO;IAACC,YAAW;KAC5B,6BAAAH,QAAA,cAACI,kCAAAA,MACC,6BAAAJ,QAAA,cAACK,qCAAAA;IACCC,OAAOT,EAAE,4BAA4B;MAAEU,IAAIR;IAAkB,CAAA;IAC7DS,aAAaX,EAAE,0BAA0B;MAAEU,IAAIR;IAAkB,CAAA;KAEjE,6BAAAC,QAAA,cAACS,uCAAAA;IAAgBb;;AAK3B;AAEA,IAAA,8BAAeD;",
|
|
6
|
-
"names": ["AutomationContainer", "space", "t", "useTranslation", "AUTOMATION_PLUGIN", "React", "StackItem", "Content", "classNames", "ControlPage", "ControlSection", "title", "ns", "description", "AutomationPanel"]
|
|
7
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var AutomationPanel_YLXAFJDP_exports = {};
|
|
20
|
-
__export(AutomationPanel_YLXAFJDP_exports, {
|
|
21
|
-
AutomationPanel: () => import_chunk_SRXHHBDE.AutomationPanel,
|
|
22
|
-
default: () => import_chunk_SRXHHBDE.AutomationPanel_default
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(AutomationPanel_YLXAFJDP_exports);
|
|
25
|
-
var import_chunk_SRXHHBDE = require("./chunk-SRXHHBDE.cjs");
|
|
26
|
-
var import_chunk_FTEDH5Q6 = require("./chunk-FTEDH5Q6.cjs");
|
|
27
|
-
var import_chunk_7GXNXMSM = require("./chunk-7GXNXMSM.cjs");
|
|
28
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
-
0 && (module.exports = {
|
|
30
|
-
AutomationPanel
|
|
31
|
-
});
|
|
32
|
-
//# sourceMappingURL=AutomationPanel-YLXAFJDP.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["AutomationPanel-YLXAFJDP.cjs"],
|
|
4
|
-
"sourcesContent": ["import {\n AutomationPanel,\n AutomationPanel_default\n} from \"./chunk-SRXHHBDE.cjs\";\nimport \"./chunk-FTEDH5Q6.cjs\";\nimport \"./chunk-7GXNXMSM.cjs\";\nexport {\n AutomationPanel,\n AutomationPanel_default as default\n};\n//# sourceMappingURL=AutomationPanel-YLXAFJDP.cjs.map\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAGO;AACP,4BAAO;AACP,4BAAO;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var FunctionsContainer_3HCURMEB_exports = {};
|
|
30
|
-
__export(FunctionsContainer_3HCURMEB_exports, {
|
|
31
|
-
FunctionsContainer: () => FunctionsContainer,
|
|
32
|
-
default: () => FunctionsContainer_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(FunctionsContainer_3HCURMEB_exports);
|
|
35
|
-
var import_chunk_BSK5SHTR = require("./chunk-BSK5SHTR.cjs");
|
|
36
|
-
var import_chunk_7GXNXMSM = require("./chunk-7GXNXMSM.cjs");
|
|
37
|
-
var import_react = __toESM(require("react"));
|
|
38
|
-
var import_react_ui = require("@dxos/react-ui");
|
|
39
|
-
var import_react_ui_form = require("@dxos/react-ui-form");
|
|
40
|
-
var import_react_ui_stack = require("@dxos/react-ui-stack");
|
|
41
|
-
var FunctionsContainer = ({ space }) => {
|
|
42
|
-
const { t } = (0, import_react_ui.useTranslation)(import_chunk_7GXNXMSM.AUTOMATION_PLUGIN);
|
|
43
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react_ui_stack.StackItem.Content, {
|
|
44
|
-
classNames: "block overflow-y-auto"
|
|
45
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_react_ui_form.ControlPage, null, /* @__PURE__ */ import_react.default.createElement(import_react_ui_form.ControlSection, {
|
|
46
|
-
title: t("functions verbose label", {
|
|
47
|
-
ns: import_chunk_7GXNXMSM.AUTOMATION_PLUGIN
|
|
48
|
-
}),
|
|
49
|
-
description: t("functions description", {
|
|
50
|
-
ns: import_chunk_7GXNXMSM.AUTOMATION_PLUGIN
|
|
51
|
-
})
|
|
52
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_chunk_BSK5SHTR.FunctionsPanel, {
|
|
53
|
-
space
|
|
54
|
-
}))));
|
|
55
|
-
};
|
|
56
|
-
var FunctionsContainer_default = FunctionsContainer;
|
|
57
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
-
0 && (module.exports = {
|
|
59
|
-
FunctionsContainer
|
|
60
|
-
});
|
|
61
|
-
//# sourceMappingURL=FunctionsContainer-3HCURMEB.cjs.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 { 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,mBAAkB;AAGlB,sBAA+B;AAC/B,2BAA4C;AAC5C,4BAA0B;AAKnB,IAAMA,qBAAqB,CAAC,EAAEC,MAAK,MAAoB;AAC5D,QAAM,EAAEC,EAAC,QAAKC,gCAAeC,uCAAAA;AAC7B,SACE,6BAAAC,QAAA,cAACC,gCAAUC,SAAO;IAACC,YAAW;KAC5B,6BAAAH,QAAA,cAACI,kCAAAA,MACC,6BAAAJ,QAAA,cAACK,qCAAAA;IACCC,OAAOT,EAAE,2BAA2B;MAAEU,IAAIR;IAAkB,CAAA;IAC5DS,aAAaX,EAAE,yBAAyB;MAAEU,IAAIR;IAAkB,CAAA;KAEhE,6BAAAC,QAAA,cAACS,sCAAAA;IAAeb;;AAK1B;AAEA,IAAA,6BAAeD;",
|
|
6
|
-
"names": ["FunctionsContainer", "space", "t", "useTranslation", "AUTOMATION_PLUGIN", "React", "StackItem", "Content", "classNames", "ControlPage", "ControlSection", "title", "ns", "description", "FunctionsPanel"]
|
|
7
|
-
}
|