@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
|
@@ -16,11 +16,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var app_graph_builder_TVFR6RXO_exports = {};
|
|
20
|
+
__export(app_graph_builder_TVFR6RXO_exports, {
|
|
21
21
|
default: () => app_graph_builder_default
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(app_graph_builder_TVFR6RXO_exports);
|
|
24
24
|
var import_chunk_7GXNXMSM = require("./chunk-7GXNXMSM.cjs");
|
|
25
25
|
var import_app_framework = require("@dxos/app-framework");
|
|
26
26
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
@@ -28,7 +28,48 @@ var import_functions = require("@dxos/functions");
|
|
|
28
28
|
var import_types = require("@dxos/plugin-deck/types");
|
|
29
29
|
var import_plugin_graph = require("@dxos/plugin-graph");
|
|
30
30
|
var import_types2 = require("@dxos/plugin-script/types");
|
|
31
|
+
var import_plugin_space = require("@dxos/plugin-space");
|
|
31
32
|
var app_graph_builder_default = (context) => (0, import_app_framework.contributes)(import_app_framework.Capabilities.AppGraphBuilder, [
|
|
33
|
+
(0, import_plugin_graph.createExtension)({
|
|
34
|
+
id: `${import_chunk_7GXNXMSM.meta.id}/space-settings-automation`,
|
|
35
|
+
filter: (node) => node.type === `${import_plugin_space.SPACE_PLUGIN}/settings`,
|
|
36
|
+
connector: ({ node }) => [
|
|
37
|
+
{
|
|
38
|
+
id: `automation-${node.id}`,
|
|
39
|
+
type: `${import_chunk_7GXNXMSM.meta.id}/space-settings-automation`,
|
|
40
|
+
data: `${import_chunk_7GXNXMSM.meta.id}/space-settings-automation`,
|
|
41
|
+
properties: {
|
|
42
|
+
label: [
|
|
43
|
+
"automation panel label",
|
|
44
|
+
{
|
|
45
|
+
ns: import_chunk_7GXNXMSM.meta.id
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
icon: "ph--lightning--regular"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}),
|
|
53
|
+
(0, import_plugin_graph.createExtension)({
|
|
54
|
+
id: `${import_chunk_7GXNXMSM.meta.id}/space-settings-functions`,
|
|
55
|
+
filter: (node) => node.type === `${import_plugin_space.SPACE_PLUGIN}/settings`,
|
|
56
|
+
connector: ({ node }) => [
|
|
57
|
+
{
|
|
58
|
+
id: `functions-${node.id}`,
|
|
59
|
+
type: `${import_chunk_7GXNXMSM.meta.id}/space-settings-functions`,
|
|
60
|
+
data: `${import_chunk_7GXNXMSM.meta.id}/space-settings-functions`,
|
|
61
|
+
properties: {
|
|
62
|
+
label: [
|
|
63
|
+
"functions panel label",
|
|
64
|
+
{
|
|
65
|
+
ns: import_chunk_7GXNXMSM.meta.id
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
icon: "ph--function--regular"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}),
|
|
32
73
|
(0, import_plugin_graph.createExtension)({
|
|
33
74
|
id: `${import_types2.SCRIPT_PLUGIN}/script-companion`,
|
|
34
75
|
filter: (node) => (0, import_echo_schema.isInstanceOf)(import_functions.ScriptType, node.data),
|
|
@@ -53,4 +94,4 @@ var app_graph_builder_default = (context) => (0, import_app_framework.contribute
|
|
|
53
94
|
]
|
|
54
95
|
})
|
|
55
96
|
]);
|
|
56
|
-
//# sourceMappingURL=app-graph-builder-
|
|
97
|
+
//# sourceMappingURL=app-graph-builder-TVFR6RXO.cjs.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,2BAA+D;AAC/D,yBAA6B;AAC7B,uBAA2B;AAC3B,mBAAgE;AAChE,0BAA2C;AAC3C,IAAAA,gBAA8B;AAC9B,0BAA6B;AAI7B,IAAA,4BAAe,CAACC,gBACdC,kCAAYC,kCAAaC,iBAAiB;MACxCC,qCAAgB;IACdC,IAAI,GAAGC,2BAAKD,EAAE;IACdE,QAAQ,CAACC,SAA6BA,KAAKC,SAAS,GAAGC,gCAAAA;IACvDC,WAAW,CAAC,EAAEH,KAAI,MAAO;MACvB;QACEH,IAAI,cAAcG,KAAKH,EAAE;QACzBI,MAAM,GAAGH,2BAAKD,EAAE;QAChBO,MAAM,GAAGN,2BAAKD,EAAE;QAChBQ,YAAY;UACVC,OAAO;YAAC;YAA0B;cAAEC,IAAIT,2BAAKD;YAAG;;UAChDW,MAAM;QACR;MACF;;EAEJ,CAAA;MACAZ,qCAAgB;IACdC,IAAI,GAAGC,2BAAKD,EAAE;IACdE,QAAQ,CAACC,SAA6BA,KAAKC,SAAS,GAAGC,gCAAAA;IACvDC,WAAW,CAAC,EAAEH,KAAI,MAAO;MACvB;QACEH,IAAI,aAAaG,KAAKH,EAAE;QACxBI,MAAM,GAAGH,2BAAKD,EAAE;QAChBO,MAAM,GAAGN,2BAAKD,EAAE;QAChBQ,YAAY;UACVC,OAAO;YAAC;YAAyB;cAAEC,IAAIT,2BAAKD;YAAG;;UAC/CW,MAAM;QACR;MACF;;EAEJ,CAAA;MACAZ,qCAAgB;IACdC,IAAI,GAAGY,2BAAAA;IACPV,QAAQ,CAACC,aAAmCU,iCAAaC,6BAAYX,KAAKI,IAAI;IAC9ED,WAAW,CAAC,EAAEH,KAAI,MAAO;MACvB;QACEH,IAAI;UAACG,KAAKH;UAAI;UAAce,KAAKC,sCAAAA;QACjCZ,MAAMa;QACNV,MAAM;QACNC,YAAY;UACVC,OAAO;YAAC;YAA2B;cAAEC,IAAIT,2BAAKD;YAAG;;UACjDW,MAAM;QACR;MACF;;EAEJ,CAAA;CACD;",
|
|
6
|
+
"names": ["import_types", "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,116 @@
|
|
|
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 chunk_BSK5SHTR_exports = {};
|
|
30
|
+
__export(chunk_BSK5SHTR_exports, {
|
|
31
|
+
FunctionsPanel: () => FunctionsPanel,
|
|
32
|
+
FunctionsPanel_default: () => FunctionsPanel_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(chunk_BSK5SHTR_exports);
|
|
35
|
+
var import_chunk_7GXNXMSM = require("./chunk-7GXNXMSM.cjs");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_app_framework = require("@dxos/app-framework");
|
|
38
|
+
var import_echo_schema = require("@dxos/echo-schema");
|
|
39
|
+
var import_types = require("@dxos/functions/types");
|
|
40
|
+
var import_echo = require("@dxos/react-client/echo");
|
|
41
|
+
var import_react_ui = require("@dxos/react-ui");
|
|
42
|
+
var import_react_ui_form = require("@dxos/react-ui-form");
|
|
43
|
+
var import_react_ui_list = require("@dxos/react-ui-list");
|
|
44
|
+
var import_react_ui_theme = require("@dxos/react-ui-theme");
|
|
45
|
+
var grid = "grid grid-cols-[1fr_auto] min-bs-[2.5rem]";
|
|
46
|
+
var FunctionsPanel = ({ space }) => {
|
|
47
|
+
const { t } = (0, import_react_ui.useTranslation)(import_chunk_7GXNXMSM.AUTOMATION_PLUGIN);
|
|
48
|
+
const functions = (0, import_echo.useQuery)(space, import_echo.Filter.schema(import_types.FunctionType));
|
|
49
|
+
const scripts = (0, import_echo.useQuery)(space, import_echo.Filter.schema(import_types.ScriptType));
|
|
50
|
+
const { dispatchPromise: dispatch } = (0, import_app_framework.useIntentDispatcher)();
|
|
51
|
+
const functionToScriptMap = (0, import_react.useMemo)(() => functions.reduce((map, func) => {
|
|
52
|
+
const scriptId = func.source?.target?.id;
|
|
53
|
+
if (scriptId) {
|
|
54
|
+
const script = scripts.find((s) => s.id === scriptId);
|
|
55
|
+
if (script) {
|
|
56
|
+
map[func.id] = script;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return map;
|
|
60
|
+
}, {}), [
|
|
61
|
+
functions,
|
|
62
|
+
scripts
|
|
63
|
+
]);
|
|
64
|
+
const getScriptName = (0, import_react.useCallback)((func) => {
|
|
65
|
+
const script = functionToScriptMap[func.id];
|
|
66
|
+
return script?.name;
|
|
67
|
+
}, [
|
|
68
|
+
functionToScriptMap
|
|
69
|
+
]);
|
|
70
|
+
const handleGoToScript = (0, import_react.useCallback)((func) => {
|
|
71
|
+
const script = functionToScriptMap[func.id];
|
|
72
|
+
if (script) {
|
|
73
|
+
void dispatch((0, import_app_framework.createIntent)(import_app_framework.LayoutAction.Open, {
|
|
74
|
+
part: "main",
|
|
75
|
+
subject: [
|
|
76
|
+
(0, import_echo.fullyQualifiedId)(script)
|
|
77
|
+
]
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
}, [
|
|
81
|
+
functionToScriptMap,
|
|
82
|
+
dispatch
|
|
83
|
+
]);
|
|
84
|
+
return /* @__PURE__ */ import_react.default.createElement("div", {
|
|
85
|
+
role: "none",
|
|
86
|
+
className: (0, import_react_ui_theme.mx)(import_react_ui_form.controlItemClasses)
|
|
87
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_react_ui_list.List.Root, {
|
|
88
|
+
items: functions,
|
|
89
|
+
isItem: import_echo_schema.S.is(import_types.FunctionType),
|
|
90
|
+
getId: (func) => func.id
|
|
91
|
+
}, ({ items }) => /* @__PURE__ */ import_react.default.createElement("div", {
|
|
92
|
+
role: "list",
|
|
93
|
+
className: "flex flex-col w-full"
|
|
94
|
+
}, items?.map((func) => /* @__PURE__ */ import_react.default.createElement(import_react_ui_list.List.Item, {
|
|
95
|
+
key: func.id,
|
|
96
|
+
item: func,
|
|
97
|
+
classNames: (0, import_react_ui_theme.mx)(grid, import_react_ui_theme.ghostHover, "items-center", "pli-2", "min-bs-[3rem]")
|
|
98
|
+
}, /* @__PURE__ */ import_react.default.createElement("div", {
|
|
99
|
+
className: "flex flex-col truncate"
|
|
100
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_react_ui_list.List.ItemTitle, {
|
|
101
|
+
classNames: "truncate"
|
|
102
|
+
}, func.name), getScriptName(func) && /* @__PURE__ */ import_react.default.createElement("div", {
|
|
103
|
+
className: "text-xs text-description truncate"
|
|
104
|
+
}, getScriptName(func))), functionToScriptMap[func.id] && /* @__PURE__ */ import_react.default.createElement(import_react_ui.Button, {
|
|
105
|
+
onClick: () => handleGoToScript(func)
|
|
106
|
+
}, t("go to function source button label")))))), functions.length === 0 && /* @__PURE__ */ import_react.default.createElement("div", {
|
|
107
|
+
className: "text-center plb-4 text-gray-500"
|
|
108
|
+
}, t("no functions found")));
|
|
109
|
+
};
|
|
110
|
+
var FunctionsPanel_default = FunctionsPanel;
|
|
111
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
112
|
+
0 && (module.exports = {
|
|
113
|
+
FunctionsPanel,
|
|
114
|
+
FunctionsPanel_default
|
|
115
|
+
});
|
|
116
|
+
//# sourceMappingURL=chunk-BSK5SHTR.cjs.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,mBAA4C;AAE5C,2BAAgE;AAChE,yBAAkB;AAClB,mBAAyC;AACzC,kBAA+D;AAC/D,sBAAuC;AACvC,2BAAmC;AACnC,2BAAqB;AACrB,4BAA+B;AAI/B,IAAMA,OAAO;AAMN,IAAMC,iBAAiB,CAAC,EAAEC,MAAK,MAAuB;AAC3D,QAAM,EAAEC,EAAC,QAAKC,gCAAeC,uCAAAA;AAC7B,QAAMC,gBAAYC,sBAASL,OAAOM,mBAAOC,OAAOC,yBAAAA,CAAAA;AAChD,QAAMC,cAAUJ,sBAASL,OAAOM,mBAAOC,OAAOG,uBAAAA,CAAAA;AAC9C,QAAM,EAAEC,iBAAiBC,SAAQ,QAAKC,0CAAAA;AAEtC,QAAMC,0BAAsBC,sBAC1B,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,oBAAgBC,0BACpB,CAACT,SAAAA;AACC,UAAMK,SAAST,oBAAoBI,KAAKI,EAAE;AAC1C,WAAOC,QAAQK;EACjB,GACA;IAACd;GAAoB;AAGvB,QAAMe,uBAAmBF,0BACvB,CAACT,SAAAA;AACC,UAAMK,SAAST,oBAAoBI,KAAKI,EAAE;AAC1C,QAAIC,QAAQ;AACV,WAAKX,aAASkB,mCAAaC,kCAAaC,MAAM;QAAEC,MAAM;QAAQC,SAAS;cAACC,8BAAiBZ,MAAAA;;MAAS,CAAA,CAAA;IACpG;EACF,GACA;IAACT;IAAqBF;GAAS;AAGjC,SACE,6BAAAwB,QAAA,cAACC,OAAAA;IAAIC,MAAK;IAAOC,eAAWC,0BAAGC,uCAAAA;KAC7B,6BAAAL,QAAA,cAACM,0BAAKC,MAAI;IAAeC,OAAOxC;IAAWyC,QAAQC,qBAAEC,GAAGvC,yBAAAA;IAAewC,OAAO,CAAC9B,SAASA,KAAKI;KAC1F,CAAC,EAAEsB,MAAK,MACP,6BAAAR,QAAA,cAACC,OAAAA;IAAIC,MAAK;IAAOC,WAAU;KACxBK,OAAO3B,IAAI,CAACC,SACX,6BAAAkB,QAAA,cAACM,0BAAKO,MAAI;IACRC,KAAKhC,KAAKI;IACV6B,MAAMjC;IACNkC,gBAAYZ,0BAAG1C,MAAMuD,kCAAY,gBAAgB,SAAS,eAAA;KAE1D,6BAAAjB,QAAA,cAACC,OAAAA;IAAIE,WAAU;KACb,6BAAAH,QAAA,cAACM,0BAAKY,WAAS;IAACF,YAAW;KAAYlC,KAAKU,IAAI,GAC/CF,cAAcR,IAAAA,KACb,6BAAAkB,QAAA,cAACC,OAAAA;IAAIE,WAAU;KAAqCb,cAAcR,IAAAA,CAAAA,CAAAA,GAGrEJ,oBAAoBI,KAAKI,EAAE,KAC1B,6BAAAc,QAAA,cAACmB,wBAAAA;IAAOC,SAAS,MAAM3B,iBAAiBX,IAAAA;KAAQjB,EAAE,oCAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAQ7DG,UAAUqD,WAAW,KAAK,6BAAArB,QAAA,cAACC,OAAAA;IAAIE,WAAU;KAAmCtC,EAAE,oBAAA,CAAA,CAAA;AAGrF;ACvFA,IAAA,yBAAeF;",
|
|
6
|
+
"names": ["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", "React", "div", "role", "className", "mx", "controlItemClasses", "List", "Root", "items", "isItem", "S", "is", "getId", "Item", "key", "item", "classNames", "ghostHover", "ItemTitle", "Button", "onClick", "length"]
|
|
7
|
+
}
|
|
@@ -26,15 +26,24 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
31
|
-
|
|
29
|
+
var chunk_L5TWLPGA_exports = {};
|
|
30
|
+
__export(chunk_L5TWLPGA_exports, {
|
|
31
|
+
AutomationContainer: () => AutomationContainer,
|
|
32
|
+
AutomationPanel: () => AutomationPanel,
|
|
33
|
+
FunctionsContainer: () => FunctionsContainer,
|
|
34
|
+
FunctionsPanel: () => FunctionsPanel
|
|
32
35
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
36
|
+
module.exports = __toCommonJS(chunk_L5TWLPGA_exports);
|
|
34
37
|
var import_react = require("react");
|
|
35
|
-
var
|
|
38
|
+
var AutomationContainer = (0, import_react.lazy)(() => import("./AutomationContainer-E5I76FPP.cjs"));
|
|
39
|
+
var AutomationPanel = (0, import_react.lazy)(() => import("./AutomationPanel-YLXAFJDP.cjs"));
|
|
40
|
+
var FunctionsContainer = (0, import_react.lazy)(() => import("./FunctionsContainer-3HCURMEB.cjs"));
|
|
41
|
+
var FunctionsPanel = (0, import_react.lazy)(() => import("./FunctionsPanel-SYIZHPGU.cjs"));
|
|
36
42
|
// Annotate the CommonJS export names for ESM import in node:
|
|
37
43
|
0 && (module.exports = {
|
|
38
|
-
|
|
44
|
+
AutomationContainer,
|
|
45
|
+
AutomationPanel,
|
|
46
|
+
FunctionsContainer,
|
|
47
|
+
FunctionsPanel
|
|
39
48
|
});
|
|
40
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-L5TWLPGA.cjs.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,mBAAqB;AAId,IAAMA,0BAAsBC,mBAAK,MAAM,OAAO,oCAAA,CAAA;AAC9C,IAAMC,sBAAkBD,mBAAK,MAAM,OAAO,gCAAA,CAAA;AAC1C,IAAME,yBAAqBF,mBAAK,MAAM,OAAO,mCAAA,CAAA;AAC7C,IAAMG,qBAAiBH,mBAAK,MAAM,OAAO,+BAAA,CAAA;",
|
|
6
|
+
"names": ["AutomationContainer", "lazy", "AutomationPanel", "FunctionsContainer", "FunctionsPanel"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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 chunk_PSIJDHAX_exports = {};
|
|
20
|
+
__export(chunk_PSIJDHAX_exports, {
|
|
21
|
+
AutomationAction: () => AutomationAction
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(chunk_PSIJDHAX_exports);
|
|
24
|
+
var import_chunk_7GXNXMSM = require("./chunk-7GXNXMSM.cjs");
|
|
25
|
+
var import_echo_schema = require("@dxos/echo-schema");
|
|
26
|
+
var import_echo = require("@dxos/react-client/echo");
|
|
27
|
+
var TriggerTemplate = import_echo_schema.S.Union(import_echo_schema.S.Struct({
|
|
28
|
+
type: import_echo_schema.S.Literal("timer"),
|
|
29
|
+
cron: import_echo_schema.S.String
|
|
30
|
+
}), import_echo_schema.S.Struct({
|
|
31
|
+
type: import_echo_schema.S.Literal("queue"),
|
|
32
|
+
queueDXN: import_echo_schema.S.Any
|
|
33
|
+
}));
|
|
34
|
+
var AutomationAction;
|
|
35
|
+
(function(AutomationAction2) {
|
|
36
|
+
const AUTOMATION_ACTION = `${import_chunk_7GXNXMSM.AUTOMATION_PLUGIN}/action`;
|
|
37
|
+
class CreateTriggerFromTemplate extends import_echo_schema.S.TaggedClass()(`${AUTOMATION_ACTION}/create-trigger-from-template`, {
|
|
38
|
+
input: import_echo_schema.S.Struct({
|
|
39
|
+
space: import_echo.SpaceSchema,
|
|
40
|
+
template: TriggerTemplate,
|
|
41
|
+
enabled: import_echo_schema.S.optional(import_echo_schema.S.Boolean),
|
|
42
|
+
// TODO(wittjosiah): Improve how this lookup is done.
|
|
43
|
+
scriptName: import_echo_schema.S.optional(import_echo_schema.S.String),
|
|
44
|
+
payload: import_echo_schema.S.optional(import_echo_schema.S.Record({
|
|
45
|
+
key: import_echo_schema.S.String,
|
|
46
|
+
value: import_echo_schema.S.Any
|
|
47
|
+
}))
|
|
48
|
+
}),
|
|
49
|
+
output: import_echo_schema.S.Void
|
|
50
|
+
}) {
|
|
51
|
+
}
|
|
52
|
+
AutomationAction2.CreateTriggerFromTemplate = CreateTriggerFromTemplate;
|
|
53
|
+
})(AutomationAction || (AutomationAction = {}));
|
|
54
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
+
0 && (module.exports = {
|
|
56
|
+
AutomationAction
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=chunk-PSIJDHAX.cjs.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,yBAAkB;AAClB,kBAA4B;AAI5B,IAAMA,kBAAkBC,qBAAEC,MACxBD,qBAAEE,OAAO;EAAEC,MAAMH,qBAAEI,QAAQ,OAAA;EAAUC,MAAML,qBAAEM;AAAO,CAAA,GACpDN,qBAAEE,OAAO;EAAEC,MAAMH,qBAAEI,QAAQ,OAAA;EAAUG,UAAUP,qBAAEQ;AAAI,CAAA,CAAA;;UAGtCC,mBAAAA;AACf,QAAMC,oBAAoB,GAAGC,uCAAAA;EAEtB,MAAMC,kCAAkCZ,qBAAEa,YAAW,EAC1D,GAAGH,iBAAAA,iCACH;IACEI,OAAOd,qBAAEE,OAAO;MACda,OAAOC;MACPC,UAAUlB;MACVmB,SAASlB,qBAAEmB,SAASnB,qBAAEoB,OAAO;;MAE7BC,YAAYrB,qBAAEmB,SAASnB,qBAAEM,MAAM;MAC/BgB,SAAStB,qBAAEmB,SAASnB,qBAAEuB,OAAO;QAAEC,KAAKxB,qBAAEM;QAAQmB,OAAOzB,qBAAEQ;MAAI,CAAA,CAAA;IAC7D,CAAA;IACAkB,QAAQ1B,qBAAE2B;EACZ,CAAA,EAAA;EACC;oBAbUf,4BAAAA;AAcf,GAjBiBH,qBAAAA,mBAAAA,CAAAA,EAAAA;",
|
|
6
|
+
"names": ["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
|
+
}
|
|
@@ -26,11 +26,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
31
|
-
|
|
29
|
+
var chunk_SRXHHBDE_exports = {};
|
|
30
|
+
__export(chunk_SRXHHBDE_exports, {
|
|
31
|
+
AutomationPanel: () => AutomationPanel,
|
|
32
|
+
AutomationPanel_default: () => AutomationPanel_default
|
|
32
33
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(chunk_SRXHHBDE_exports);
|
|
34
35
|
var import_chunk_FTEDH5Q6 = require("./chunk-FTEDH5Q6.cjs");
|
|
35
36
|
var import_chunk_7GXNXMSM = require("./chunk-7GXNXMSM.cjs");
|
|
36
37
|
var import_react = __toESM(require("react"));
|
|
@@ -41,16 +42,15 @@ var import_echo = require("@dxos/react-client/echo");
|
|
|
41
42
|
var import_react_ui = require("@dxos/react-ui");
|
|
42
43
|
var import_react_ui_form = require("@dxos/react-ui-form");
|
|
43
44
|
var import_react_ui_list = require("@dxos/react-ui-list");
|
|
44
|
-
var import_react_ui_stack = require("@dxos/react-ui-stack");
|
|
45
45
|
var import_react_ui_theme = require("@dxos/react-ui-theme");
|
|
46
46
|
var grid = "grid grid-cols-[40px_1fr_32px] min-bs-[2.5rem]";
|
|
47
|
-
var AutomationPanel = ({ space, object }) => {
|
|
47
|
+
var AutomationPanel = ({ space, object, initialTrigger, onDone }) => {
|
|
48
48
|
const { t } = (0, import_react_ui.useTranslation)(import_chunk_7GXNXMSM.AUTOMATION_PLUGIN);
|
|
49
49
|
const client = (0, import_react_client.useClient)();
|
|
50
50
|
const triggers = (0, import_echo.useQuery)(space, import_echo.Filter.schema(import_types.FunctionTrigger));
|
|
51
51
|
const functions = (0, import_echo.useQuery)(space, import_echo.Filter.schema(import_types.FunctionType));
|
|
52
52
|
const scripts = (0, import_echo.useQuery)(space, import_echo.Filter.schema(import_types.ScriptType));
|
|
53
|
-
const [trigger, setTrigger] = (0, import_react.useState)();
|
|
53
|
+
const [trigger, setTrigger] = (0, import_react.useState)(initialTrigger);
|
|
54
54
|
const [selected, setSelected] = (0, import_react.useState)();
|
|
55
55
|
const handleSelect = (trigger2) => {
|
|
56
56
|
const { id: _, ...values } = trigger2;
|
|
@@ -58,7 +58,7 @@ var AutomationPanel = ({ space, object }) => {
|
|
|
58
58
|
setSelected(trigger2);
|
|
59
59
|
};
|
|
60
60
|
const handleAdd = () => {
|
|
61
|
-
setTrigger((0, import_echo.
|
|
61
|
+
setTrigger((0, import_echo.live)(import_types.FunctionTriggerSchema, {}));
|
|
62
62
|
setSelected(void 0);
|
|
63
63
|
};
|
|
64
64
|
const handleDelete = (trigger2) => {
|
|
@@ -70,17 +70,17 @@ var AutomationPanel = ({ space, object }) => {
|
|
|
70
70
|
if (selected) {
|
|
71
71
|
Object.assign(selected, trigger2);
|
|
72
72
|
} else {
|
|
73
|
-
space.db.add((0, import_echo.
|
|
73
|
+
space.db.add((0, import_echo.live)(import_types.FunctionTrigger, trigger2));
|
|
74
74
|
}
|
|
75
75
|
setTrigger(void 0);
|
|
76
76
|
setSelected(void 0);
|
|
77
|
+
onDone?.();
|
|
77
78
|
};
|
|
78
79
|
const handleCancel = () => {
|
|
79
80
|
setTrigger(void 0);
|
|
81
|
+
onDone?.();
|
|
80
82
|
};
|
|
81
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
82
|
-
classNames: "block overflow-y-auto"
|
|
83
|
-
}, /* @__PURE__ */ import_react.default.createElement("div", {
|
|
83
|
+
return /* @__PURE__ */ import_react.default.createElement("div", {
|
|
84
84
|
className: "flex flex-col w-full"
|
|
85
85
|
}, trigger ? /* @__PURE__ */ import_react.default.createElement(import_react_ui_form.ControlItem, {
|
|
86
86
|
title: t("trigger editor title")
|
|
@@ -125,7 +125,7 @@ var AutomationPanel = ({ space, object }) => {
|
|
|
125
125
|
icon: "ph--plus--regular",
|
|
126
126
|
label: t("new trigger label"),
|
|
127
127
|
onClick: handleAdd
|
|
128
|
-
})))
|
|
128
|
+
})));
|
|
129
129
|
};
|
|
130
130
|
var getCopyAction = (client, trigger) => {
|
|
131
131
|
if (trigger?.spec?.type === import_types.TriggerKind.Email) {
|
|
@@ -158,4 +158,9 @@ var getFunctionName = (scripts, functions, trigger) => {
|
|
|
158
158
|
return scripts.find((s) => functionObject.source?.target?.id === s.id)?.name ?? shortId;
|
|
159
159
|
};
|
|
160
160
|
var AutomationPanel_default = AutomationPanel;
|
|
161
|
-
|
|
161
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
162
|
+
0 && (module.exports = {
|
|
163
|
+
AutomationPanel,
|
|
164
|
+
AutomationPanel_default
|
|
165
|
+
});
|
|
166
|
+
//# sourceMappingURL=chunk-SRXHHBDE.cjs.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": "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",
|
|
6
|
+
"names": ["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", "React", "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"]
|
|
7
|
+
}
|
package/dist/lib/node/index.cjs
CHANGED
|
@@ -29,22 +29,25 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var node_exports = {};
|
|
30
30
|
__export(node_exports, {
|
|
31
31
|
AUTOMATION_PLUGIN: () => import_chunk_7GXNXMSM.AUTOMATION_PLUGIN,
|
|
32
|
-
|
|
32
|
+
AutomationContainer: () => import_chunk_L5TWLPGA.AutomationContainer,
|
|
33
|
+
AutomationPanel: () => import_chunk_L5TWLPGA.AutomationPanel,
|
|
33
34
|
AutomationPlugin: () => AutomationPlugin,
|
|
35
|
+
FunctionsContainer: () => import_chunk_L5TWLPGA.FunctionsContainer,
|
|
36
|
+
FunctionsPanel: () => import_chunk_L5TWLPGA.FunctionsPanel,
|
|
34
37
|
TriggerEditor: () => import_chunk_FTEDH5Q6.TriggerEditor,
|
|
35
38
|
meta: () => import_chunk_7GXNXMSM.meta
|
|
36
39
|
});
|
|
37
40
|
module.exports = __toCommonJS(node_exports);
|
|
38
|
-
var
|
|
41
|
+
var import_chunk_L5TWLPGA = require("./chunk-L5TWLPGA.cjs");
|
|
39
42
|
var import_chunk_FTEDH5Q6 = require("./chunk-FTEDH5Q6.cjs");
|
|
40
43
|
var import_chunk_7GXNXMSM = require("./chunk-7GXNXMSM.cjs");
|
|
41
44
|
var import_app_framework = require("@dxos/app-framework");
|
|
42
45
|
var import_types = require("@dxos/functions/types");
|
|
43
46
|
var import_plugin_client = require("@dxos/plugin-client");
|
|
44
|
-
var import_plugin_space = require("@dxos/plugin-space");
|
|
45
47
|
var import_app_framework2 = require("@dxos/app-framework");
|
|
46
|
-
var AppGraphBuilder = (0, import_app_framework2.lazy)(() => import("./app-graph-builder-
|
|
47
|
-
var
|
|
48
|
+
var AppGraphBuilder = (0, import_app_framework2.lazy)(() => import("./app-graph-builder-TVFR6RXO.cjs"));
|
|
49
|
+
var IntentResolver = (0, import_app_framework2.lazy)(() => import("./intent-resolver-4YYZ2MMZ.cjs"));
|
|
50
|
+
var ReactSurface = (0, import_app_framework2.lazy)(() => import("./react-surface-PCZCHIET.cjs"));
|
|
48
51
|
var translations_default = [
|
|
49
52
|
{
|
|
50
53
|
"en-US": {
|
|
@@ -52,7 +55,15 @@ var translations_default = [
|
|
|
52
55
|
"plugin name": "Automation",
|
|
53
56
|
"automation panel label": "Automations",
|
|
54
57
|
"script automation label": "Automation",
|
|
55
|
-
"
|
|
58
|
+
"automation verbose label": "Manage automations",
|
|
59
|
+
"automation description": "You can manage all the triggers which automate your space here.",
|
|
60
|
+
"functions panel label": "Functions",
|
|
61
|
+
"functions verbose label": "Manage deployed functions",
|
|
62
|
+
"functions description": "You can manage all the functions deployed from your space on EDGE here.",
|
|
63
|
+
"function copy id": "Copy Function ID",
|
|
64
|
+
"no functions found": "No functions found",
|
|
65
|
+
"go to function source button label": "Show function source",
|
|
66
|
+
"trigger editor title": "Configure Trigger",
|
|
56
67
|
"new trigger label": "Add Trigger",
|
|
57
68
|
"trigger type timer": "Timer",
|
|
58
69
|
"trigger type webhook": "Webhook",
|
|
@@ -89,17 +100,9 @@ var AutomationPlugin = () => (0, import_app_framework.definePlugin)(import_chunk
|
|
|
89
100
|
activate: AppGraphBuilder
|
|
90
101
|
}),
|
|
91
102
|
(0, import_app_framework.defineModule)({
|
|
92
|
-
id: `${import_chunk_7GXNXMSM.meta.id}/module/
|
|
93
|
-
activatesOn:
|
|
94
|
-
activate:
|
|
95
|
-
id: "automation",
|
|
96
|
-
label: [
|
|
97
|
-
"automation panel label",
|
|
98
|
-
{
|
|
99
|
-
ns: import_chunk_7GXNXMSM.meta.id
|
|
100
|
-
}
|
|
101
|
-
]
|
|
102
|
-
})
|
|
103
|
+
id: `${import_chunk_7GXNXMSM.meta.id}/module/intent-resolver`,
|
|
104
|
+
activatesOn: import_app_framework.Events.SetupIntentResolver,
|
|
105
|
+
activate: IntentResolver
|
|
103
106
|
}),
|
|
104
107
|
(0, import_app_framework.defineModule)({
|
|
105
108
|
id: `${import_chunk_7GXNXMSM.meta.id}/module/react-surface`,
|
|
@@ -110,8 +113,11 @@ var AutomationPlugin = () => (0, import_app_framework.definePlugin)(import_chunk
|
|
|
110
113
|
// Annotate the CommonJS export names for ESM import in node:
|
|
111
114
|
0 && (module.exports = {
|
|
112
115
|
AUTOMATION_PLUGIN,
|
|
116
|
+
AutomationContainer,
|
|
113
117
|
AutomationPanel,
|
|
114
118
|
AutomationPlugin,
|
|
119
|
+
FunctionsContainer,
|
|
120
|
+
FunctionsPanel,
|
|
115
121
|
TriggerEditor,
|
|
116
122
|
meta
|
|
117
123
|
});
|
|
@@ -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": ["import_app_framework", "AppGraphBuilder", "lazy", "ReactSurface", "AUTOMATION_PLUGIN", "AutomationPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "ClientEvents", "SetupSchema", "ClientCapabilities", "Schema", "FunctionType", "FunctionTrigger", "SetupAppGraph", "
|
|
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,2BAA8E;AAC9E,mBAA8C;AAC9C,2BAAiD;ACFjD,IAAAA,wBAAqB;AAEd,IAAMC,sBAAkBC,4BAAK,MAAM,OAAO,kCAAA,CAAA;AAC1C,IAAMC,qBAAiBD,4BAAK,MAAM,OAAO,gCAAA,CAAA;AACzC,IAAME,mBAAeF,4BAAK,MAAM,OAAO,8BAAA,CAAA;ACF9C,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACG,uCAAAA,GAAoB;QACnB,eAAe;QACf,0BAA0B;QAC1B,2BAA2B;QAC3B,4BAA4B;QAC5B,0BAA0B;QAE1B,yBAAyB;QACzB,2BAA2B;QAC3B,yBAAyB;QACzB,oBAAoB;QACpB,sBAAsB;QACtB,sCAAsC;QAEtC,wBAAwB;QACxB,qBAAqB;QACrB,sBAAsB;QACtB,wBAAwB;QACxB,0BAA0B;QAC1B,6BAA6B;QAC7B,sBAAsB;QACtB,sBAAsB;QAEtB,oBAAoB;QACpB,sBAAsB;QAEtB,uBAAuB;QACvB,0BAA0B;QAC1B,yCAAyC;MAC3C;IACF;EACF;;AF5BK,IAAMC,mBAAmB,UAC9BC,mCAAaC,4BAAM;MACjBC,mCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaC,4BAAOC;IACpBC,UAAU,UAAMC,kCAAYC,kCAAaC,cAAcC,oBAAAA;EACzD,CAAA;MACAT,mCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaQ,kCAAaC;IAC1BN,UAAU,UAAMC,kCAAYM,wCAAmBC,QAAQ;MAACC;MAAcC;KAAgB;EACxF,CAAA;MACAf,mCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaC,4BAAOa;IACpBX,UAAUb;EACZ,CAAA;MACAQ,mCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaC,4BAAOc;IACpBZ,UAAUX;EACZ,CAAA;MACAM,mCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaC,4BAAOe;IACpBb,UAAUV;EACZ,CAAA;CACD;",
|
|
6
|
+
"names": ["import_app_framework", "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", "SetupIntentResolver", "SetupReactSurface"]
|
|
7
7
|
}
|