@dxos/plugin-automation 0.8.2-main.5885341 → 0.8.2-main.5ca3450
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 → AutomationContainer-PDPL34DX.mjs} +3 -3
- package/dist/lib/browser/{AutomationPanel-G3OB6ELR.mjs → AutomationPanel-3WG2B7JM.mjs} +3 -3
- package/dist/lib/browser/{FunctionsContainer-STXBW4CX.mjs → FunctionsContainer-HLISW5QI.mjs} +2 -2
- package/dist/lib/browser/{FunctionsPanel-JJPLIAJW.mjs → FunctionsPanel-OKFRBXLO.mjs} +2 -2
- package/dist/lib/browser/chunk-ADYCSC6Y.mjs +39 -0
- package/dist/lib/browser/chunk-ADYCSC6Y.mjs.map +7 -0
- package/dist/lib/browser/{chunk-QJPKWYTL.mjs → chunk-GUPG3Q72.mjs} +5 -5
- package/dist/lib/browser/{chunk-65VL4EYS.mjs → chunk-IDCVJ2JW.mjs} +4 -4
- package/dist/lib/browser/chunk-IDCVJ2JW.mjs.map +7 -0
- package/dist/lib/browser/{chunk-NGG4ICAQ.mjs → chunk-QFIPNCNF.mjs} +9 -9
- package/dist/lib/browser/chunk-QFIPNCNF.mjs.map +7 -0
- package/dist/lib/browser/chunk-W4T2BTH2.mjs +211 -0
- package/dist/lib/browser/chunk-W4T2BTH2.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +5 -5
- package/dist/lib/browser/index.mjs.map +1 -1
- package/dist/lib/browser/{intent-resolver-SNIAQ7V5.mjs → intent-resolver-TCUIVOEW.mjs} +9 -10
- package/dist/lib/browser/intent-resolver-TCUIVOEW.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-L22QIANU.mjs → react-surface-P65PEZPN.mjs} +4 -4
- package/dist/lib/browser/{react-surface-L22QIANU.mjs.map → react-surface-P65PEZPN.mjs.map} +1 -1
- package/dist/lib/browser/types.mjs +1 -1
- package/dist/lib/node/{AutomationContainer-E5I76FPP.cjs → AutomationContainer-EXTHQ7B3.cjs} +7 -7
- package/dist/lib/node/{AutomationPanel-YLXAFJDP.cjs → AutomationPanel-G7R6RL7O.cjs} +8 -8
- package/dist/lib/node/{AutomationPanel-YLXAFJDP.cjs.map → AutomationPanel-G7R6RL7O.cjs.map} +2 -2
- package/dist/lib/node/{FunctionsContainer-3HCURMEB.cjs → FunctionsContainer-RNZTNQEU.cjs} +6 -6
- package/dist/lib/node/{FunctionsPanel-SYIZHPGU.cjs → FunctionsPanel-7I7YCHPJ.cjs} +7 -7
- package/dist/lib/node/{FunctionsPanel-SYIZHPGU.cjs.map → FunctionsPanel-7I7YCHPJ.cjs.map} +2 -2
- package/dist/lib/node/chunk-A4DMUH7U.cjs +234 -0
- package/dist/lib/node/chunk-A4DMUH7U.cjs.map +7 -0
- package/dist/lib/node/{chunk-L5TWLPGA.cjs → chunk-B3OL2E3B.cjs} +8 -8
- package/dist/lib/node/{chunk-SRXHHBDE.cjs → chunk-F74YVA6P.cjs} +18 -18
- package/dist/lib/node/chunk-F74YVA6P.cjs.map +7 -0
- package/dist/lib/node/{chunk-PSIJDHAX.cjs → chunk-GDCG2BML.cjs} +19 -19
- package/dist/lib/node/chunk-GDCG2BML.cjs.map +7 -0
- package/dist/lib/node/{chunk-BSK5SHTR.cjs → chunk-GLXGAIZC.cjs} +9 -9
- package/dist/lib/node/chunk-GLXGAIZC.cjs.map +7 -0
- package/dist/lib/node/index.cjs +12 -12
- package/dist/lib/node/index.cjs.map +2 -2
- package/dist/lib/node/{intent-resolver-A44BNFEG.cjs → intent-resolver-6XS2NYC7.cjs} +16 -17
- package/dist/lib/node/intent-resolver-6XS2NYC7.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-PCZCHIET.cjs → react-surface-OYJMJXJI.cjs} +11 -11
- package/dist/lib/node/react-surface-OYJMJXJI.cjs.map +7 -0
- package/dist/lib/node/types.cjs +2 -2
- package/dist/lib/node/types.cjs.map +1 -1
- package/dist/lib/node-esm/{AutomationContainer-22PUFPSE.mjs → AutomationContainer-FSWEGDKP.mjs} +3 -3
- package/dist/lib/node-esm/{AutomationPanel-6UXIAJVS.mjs → AutomationPanel-LIPLJA55.mjs} +3 -3
- package/dist/lib/node-esm/{FunctionsContainer-XG5WVAN3.mjs → FunctionsContainer-435FW56J.mjs} +2 -2
- package/dist/lib/node-esm/{FunctionsPanel-J3QGUESH.mjs → FunctionsPanel-NXXT5ERU.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-HMYAQLGF.mjs → chunk-27IHWHDH.mjs} +9 -9
- package/dist/lib/node-esm/chunk-27IHWHDH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-YYBCQXB2.mjs → chunk-EEA6CZ6B.mjs} +16 -16
- package/dist/lib/node-esm/chunk-EEA6CZ6B.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-IS3BYE3I.mjs +212 -0
- package/dist/lib/node-esm/chunk-IS3BYE3I.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-4UPGANGV.mjs → chunk-VYSTWH6Q.mjs} +4 -4
- package/dist/lib/node-esm/chunk-VYSTWH6Q.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-TMMB5ETD.mjs → chunk-YCNX76NJ.mjs} +5 -5
- package/dist/lib/node-esm/index.mjs +5 -5
- package/dist/lib/node-esm/index.mjs.map +1 -1
- package/dist/lib/node-esm/{intent-resolver-JFLTVJ7D.mjs → intent-resolver-CHDYUFFN.mjs} +9 -10
- package/dist/lib/node-esm/intent-resolver-CHDYUFFN.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-VSO4NWC6.mjs → react-surface-FDGQORLY.mjs} +4 -4
- package/dist/lib/node-esm/{react-surface-VSO4NWC6.mjs.map → react-surface-FDGQORLY.mjs.map} +1 -1
- package/dist/lib/node-esm/types.mjs +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/components/AutomationContainer.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsContainer.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +12 -0
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -0
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +5 -0
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -0
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +15 -15
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +28 -24
- package/src/AutomationPlugin.tsx +1 -1
- package/src/capabilities/intent-resolver.ts +6 -9
- package/src/capabilities/react-surface.tsx +1 -1
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +1 -1
- package/src/components/AutomationPanel/AutomationPanel.tsx +8 -7
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +3 -3
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +77 -0
- package/src/components/TriggerEditor/SpecSelector.tsx +59 -0
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +16 -7
- package/src/components/TriggerEditor/TriggerEditor.tsx +50 -90
- package/src/testing/test-functions.ts +23 -9
- package/src/types.ts +11 -10
- package/dist/lib/browser/chunk-65VL4EYS.mjs.map +0 -7
- package/dist/lib/browser/chunk-FALBBJNO.mjs +0 -138
- package/dist/lib/browser/chunk-FALBBJNO.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/intent-resolver-SNIAQ7V5.mjs.map +0 -7
- package/dist/lib/node/chunk-BSK5SHTR.cjs.map +0 -7
- package/dist/lib/node/chunk-FTEDH5Q6.cjs +0 -167
- package/dist/lib/node/chunk-FTEDH5Q6.cjs.map +0 -7
- 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.map +0 -7
- package/dist/lib/node/react-surface-PCZCHIET.cjs.map +0 -7
- 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-M4QXMIIB.mjs +0 -139
- package/dist/lib/node-esm/chunk-M4QXMIIB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YYBCQXB2.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-JFLTVJ7D.mjs.map +0 -7
- /package/dist/lib/browser/{AutomationContainer-KEQ5RNIW.mjs.map → AutomationContainer-PDPL34DX.mjs.map} +0 -0
- /package/dist/lib/browser/{AutomationPanel-G3OB6ELR.mjs.map → AutomationPanel-3WG2B7JM.mjs.map} +0 -0
- /package/dist/lib/browser/{FunctionsContainer-STXBW4CX.mjs.map → FunctionsContainer-HLISW5QI.mjs.map} +0 -0
- /package/dist/lib/browser/{FunctionsPanel-JJPLIAJW.mjs.map → FunctionsPanel-OKFRBXLO.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-QJPKWYTL.mjs.map → chunk-GUPG3Q72.mjs.map} +0 -0
- /package/dist/lib/node/{AutomationContainer-E5I76FPP.cjs.map → AutomationContainer-EXTHQ7B3.cjs.map} +0 -0
- /package/dist/lib/node/{FunctionsContainer-3HCURMEB.cjs.map → FunctionsContainer-RNZTNQEU.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-L5TWLPGA.cjs.map → chunk-B3OL2E3B.cjs.map} +0 -0
- /package/dist/lib/node-esm/{AutomationContainer-22PUFPSE.mjs.map → AutomationContainer-FSWEGDKP.mjs.map} +0 -0
- /package/dist/lib/node-esm/{AutomationPanel-6UXIAJVS.mjs.map → AutomationPanel-LIPLJA55.mjs.map} +0 -0
- /package/dist/lib/node-esm/{FunctionsContainer-XG5WVAN3.mjs.map → FunctionsContainer-435FW56J.mjs.map} +0 -0
- /package/dist/lib/node-esm/{FunctionsPanel-J3QGUESH.mjs.map → FunctionsPanel-NXXT5ERU.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-TMMB5ETD.mjs.map → chunk-YCNX76NJ.mjs.map} +0 -0
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Schema } from 'effect';
|
|
5
6
|
import React, { useState } from 'react';
|
|
6
7
|
|
|
7
|
-
import { S } from '@dxos/echo-schema';
|
|
8
8
|
import {
|
|
9
9
|
FunctionType,
|
|
10
10
|
FunctionTrigger,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
TriggerKind,
|
|
13
13
|
type FunctionTriggerType,
|
|
14
14
|
ScriptType,
|
|
15
|
-
} from '@dxos/functions
|
|
15
|
+
} from '@dxos/functions';
|
|
16
16
|
import { type Client, useClient } from '@dxos/react-client';
|
|
17
17
|
import { live, Filter, useQuery, type Space, type Live, getSpace } from '@dxos/react-client/echo';
|
|
18
18
|
import { Clipboard, IconButton, Input, Separator, useTranslation } from '@dxos/react-ui';
|
|
@@ -85,7 +85,7 @@ export const AutomationPanel = ({ space, object, initialTrigger, onDone }: Autom
|
|
|
85
85
|
</ControlItem>
|
|
86
86
|
) : (
|
|
87
87
|
<div role='none' className={controlItemClasses}>
|
|
88
|
-
<List.Root<FunctionTrigger> items={triggers} isItem={
|
|
88
|
+
<List.Root<FunctionTrigger> items={triggers} isItem={Schema.is(FunctionTrigger)} getId={(field) => field.id}>
|
|
89
89
|
{({ items: triggers }) => (
|
|
90
90
|
<div role='list' className='flex flex-col w-full'>
|
|
91
91
|
{triggers?.map((trigger) => {
|
|
@@ -136,11 +136,11 @@ export const AutomationPanel = ({ space, object, initialTrigger, onDone }: Autom
|
|
|
136
136
|
};
|
|
137
137
|
|
|
138
138
|
const getCopyAction = (client: Client, trigger: FunctionTrigger | undefined) => {
|
|
139
|
-
if (trigger?.spec?.
|
|
139
|
+
if (trigger?.spec?.kind === TriggerKind.Email) {
|
|
140
140
|
return { translationKey: 'trigger copy email', contentProvider: () => `${getSpace(trigger)!.id}@dxos.network` };
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
if (trigger?.spec?.
|
|
143
|
+
if (trigger?.spec?.kind === TriggerKind.Webhook) {
|
|
144
144
|
return { translationKey: 'trigger copy url', contentProvider: () => getWebhookUrl(client, trigger) };
|
|
145
145
|
}
|
|
146
146
|
|
|
@@ -158,10 +158,11 @@ const getWebhookUrl = (client: Client, trigger: FunctionTrigger) => {
|
|
|
158
158
|
const getFunctionName = (scripts: ScriptType[], functions: FunctionType[], trigger: FunctionTriggerType) => {
|
|
159
159
|
// TODO(wittjosiah): Truncation should be done in the UI.
|
|
160
160
|
// Warning that the List component is currently a can of worms.
|
|
161
|
-
const shortId = trigger.function && `${trigger.function
|
|
162
|
-
const functionObject = functions.find((fn) =>
|
|
161
|
+
const shortId = trigger.function && `${trigger.function.dxn.toString().slice(0, 16)}…`;
|
|
162
|
+
const functionObject = functions.find((fn) => fn === trigger.function?.target);
|
|
163
163
|
if (!functionObject) {
|
|
164
164
|
return shortId;
|
|
165
165
|
}
|
|
166
|
+
|
|
166
167
|
return scripts.find((s) => functionObject.source?.target?.id === s.id)?.name ?? shortId;
|
|
167
168
|
};
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Schema } from 'effect';
|
|
5
6
|
import React, { useCallback, useMemo } from 'react';
|
|
6
7
|
|
|
7
8
|
import { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
-
import {
|
|
9
|
-
import { FunctionType, ScriptType } from '@dxos/functions/types';
|
|
9
|
+
import { FunctionType, ScriptType } from '@dxos/functions';
|
|
10
10
|
import { Filter, fullyQualifiedId, useQuery, type Space } from '@dxos/react-client/echo';
|
|
11
11
|
import { Button, useTranslation } from '@dxos/react-ui';
|
|
12
12
|
import { controlItemClasses } from '@dxos/react-ui-form';
|
|
@@ -65,7 +65,7 @@ export const FunctionsPanel = ({ space }: FunctionsPanelProps) => {
|
|
|
65
65
|
|
|
66
66
|
return (
|
|
67
67
|
<div role='none' className={mx(controlItemClasses)}>
|
|
68
|
-
<List.Root<FunctionType> items={functions} isItem={
|
|
68
|
+
<List.Root<FunctionType> items={functions} isItem={Schema.is(FunctionType)} getId={(func) => func.id}>
|
|
69
69
|
{({ items }) => (
|
|
70
70
|
<div role='list' className='flex flex-col w-full'>
|
|
71
71
|
{items?.map((func) => (
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useCallback, useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type JsonPath, RefImpl, toEffectSchema } from '@dxos/echo-schema';
|
|
8
|
+
import { type FunctionType } from '@dxos/functions';
|
|
9
|
+
import { useOnTransition } from '@dxos/react-ui';
|
|
10
|
+
import { Form, type FormInputStateProps, type QueryRefOptions, useFormValues } from '@dxos/react-ui-form';
|
|
11
|
+
|
|
12
|
+
export type FunctionInputEditorProps = {
|
|
13
|
+
functions: FunctionType[];
|
|
14
|
+
onQueryRefOptions: QueryRefOptions;
|
|
15
|
+
} & FormInputStateProps;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Editor component for function input parameters.
|
|
19
|
+
*/
|
|
20
|
+
export const FunctionInputEditor = ({
|
|
21
|
+
functions,
|
|
22
|
+
getValue,
|
|
23
|
+
onValueChange,
|
|
24
|
+
onQueryRefOptions,
|
|
25
|
+
}: FunctionInputEditorProps) => {
|
|
26
|
+
const selectedFunctionValue = useFormValues(['function' as JsonPath]);
|
|
27
|
+
const selectedFunctionId = useMemo(() => {
|
|
28
|
+
if (selectedFunctionValue instanceof RefImpl) {
|
|
29
|
+
return selectedFunctionValue.dxn.toString().split('dxn:echo:@:').at(1);
|
|
30
|
+
}
|
|
31
|
+
}, [selectedFunctionValue]);
|
|
32
|
+
|
|
33
|
+
const selectedFunction = useMemo(
|
|
34
|
+
() => functions.find((f) => f.id === selectedFunctionId),
|
|
35
|
+
[functions, selectedFunctionId],
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
useOnTransition(
|
|
39
|
+
// Clear function parameter input when the function changes.
|
|
40
|
+
selectedFunctionValue,
|
|
41
|
+
(prevValue) => prevValue !== undefined && prevValue !== selectedFunctionValue,
|
|
42
|
+
(currValue) => currValue !== undefined,
|
|
43
|
+
() => onValueChange('object', {}),
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const inputSchema = useMemo(() => selectedFunction?.inputSchema, [selectedFunction]);
|
|
47
|
+
const effectSchema = useMemo(() => (inputSchema ? toEffectSchema(inputSchema) : undefined), [inputSchema]);
|
|
48
|
+
const propertyCount = inputSchema?.properties ? Object.keys(inputSchema.properties).length : 0;
|
|
49
|
+
|
|
50
|
+
const values = useMemo(() => getValue() ?? {}, [getValue]);
|
|
51
|
+
|
|
52
|
+
const handleValuesChanged = useCallback(
|
|
53
|
+
(values: any) => {
|
|
54
|
+
onValueChange('object', values);
|
|
55
|
+
},
|
|
56
|
+
[onValueChange],
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
if (selectedFunction === undefined || effectSchema === undefined || propertyCount === 0) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<>
|
|
65
|
+
<h3 className='text-md'>Function parameters</h3>
|
|
66
|
+
{/* TODO(ZaymonFC): Try using <FormFields /> internal component for this nesting.
|
|
67
|
+
This would allow errors to flow up to the root context. */}
|
|
68
|
+
<Form
|
|
69
|
+
schema={effectSchema}
|
|
70
|
+
values={values}
|
|
71
|
+
classNames='p-0'
|
|
72
|
+
onValuesChanged={handleValuesChanged}
|
|
73
|
+
onQueryRefOptions={onQueryRefOptions}
|
|
74
|
+
/>
|
|
75
|
+
</>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useCallback, useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type FunctionTriggerType, TriggerKind, type TriggerType } from '@dxos/functions';
|
|
8
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
9
|
+
import { SelectInput, type InputProps, useInputProps } from '@dxos/react-ui-form';
|
|
10
|
+
|
|
11
|
+
import { AUTOMATION_PLUGIN } from '../../meta';
|
|
12
|
+
|
|
13
|
+
export type SpecSelectorProps = InputProps;
|
|
14
|
+
|
|
15
|
+
export const SpecSelector = (props: SpecSelectorProps) => {
|
|
16
|
+
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
17
|
+
const specProps = useInputProps(['spec' satisfies keyof FunctionTriggerType]);
|
|
18
|
+
|
|
19
|
+
const handleTypeChange = useCallback(
|
|
20
|
+
(_type: any, value: string): TriggerType | undefined => {
|
|
21
|
+
const getDefaultTriggerSpec = (kind: string) => {
|
|
22
|
+
switch (kind) {
|
|
23
|
+
case TriggerKind.Timer:
|
|
24
|
+
return { type: TriggerKind.Timer, cron: '' };
|
|
25
|
+
case TriggerKind.Subscription:
|
|
26
|
+
return { type: TriggerKind.Subscription, filter: {} };
|
|
27
|
+
case TriggerKind.Queue:
|
|
28
|
+
return { type: TriggerKind.Queue, queue: '' };
|
|
29
|
+
case TriggerKind.Email:
|
|
30
|
+
return { type: TriggerKind.Email };
|
|
31
|
+
case TriggerKind.Webhook:
|
|
32
|
+
return { type: TriggerKind.Webhook };
|
|
33
|
+
default:
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const defaultSpec = getDefaultTriggerSpec(value);
|
|
39
|
+
if (!defaultSpec) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Update the entire spec object, not just the `spec.type`.
|
|
44
|
+
specProps.onValueChange('object', defaultSpec);
|
|
45
|
+
},
|
|
46
|
+
[specProps],
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
const options = useMemo(
|
|
50
|
+
() =>
|
|
51
|
+
Object.values(TriggerKind).map((kind) => ({
|
|
52
|
+
value: kind,
|
|
53
|
+
label: t(`trigger type ${kind}`),
|
|
54
|
+
})),
|
|
55
|
+
[t],
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
return <SelectInput {...props} options={options} onValueChange={handleTypeChange} />;
|
|
59
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
@@ -7,10 +7,11 @@ import '@dxos-theme';
|
|
|
7
7
|
import { type Meta } from '@storybook/react';
|
|
8
8
|
import React, { useEffect, useState } from 'react';
|
|
9
9
|
|
|
10
|
-
import { FunctionType, FunctionTrigger, TriggerKind } from '@dxos/functions
|
|
10
|
+
import { FunctionType, FunctionTrigger, TriggerKind } from '@dxos/functions';
|
|
11
11
|
import { live } from '@dxos/live-object';
|
|
12
|
+
import { faker } from '@dxos/random';
|
|
12
13
|
import { useSpaces } from '@dxos/react-client/echo';
|
|
13
|
-
import { withClientProvider } from '@dxos/react-client/testing';
|
|
14
|
+
import { ContactType, withClientProvider } from '@dxos/react-client/testing';
|
|
14
15
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
15
16
|
|
|
16
17
|
import { TriggerEditor } from './TriggerEditor';
|
|
@@ -26,7 +27,7 @@ const DefaultStory = () => {
|
|
|
26
27
|
return;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
const trigger = space.db.add(live(FunctionTrigger, { spec: {
|
|
30
|
+
const trigger = space.db.add(live(FunctionTrigger, { spec: { kind: TriggerKind.Timer, cron: '' } }));
|
|
30
31
|
setTrigger(trigger);
|
|
31
32
|
}, [space]);
|
|
32
33
|
|
|
@@ -35,8 +36,8 @@ const DefaultStory = () => {
|
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
return (
|
|
38
|
-
<div role='none' className='
|
|
39
|
-
<TriggerEditor space={space} trigger={trigger} />
|
|
39
|
+
<div role='none' className='w-[32rem] bs-fit border border-separator rounded-sm'>
|
|
40
|
+
<TriggerEditor space={space} trigger={trigger} onSave={(values) => console.log('on save', values)} />
|
|
40
41
|
</div>
|
|
41
42
|
);
|
|
42
43
|
};
|
|
@@ -49,11 +50,19 @@ const meta: Meta = {
|
|
|
49
50
|
withClientProvider({
|
|
50
51
|
createIdentity: true,
|
|
51
52
|
createSpace: true,
|
|
52
|
-
types: [FunctionType, FunctionTrigger],
|
|
53
|
+
types: [FunctionType, FunctionTrigger, ContactType],
|
|
53
54
|
onSpaceCreated: ({ space }) => {
|
|
54
55
|
for (const fn of functions) {
|
|
55
56
|
space.db.add(live(FunctionType, fn));
|
|
56
57
|
}
|
|
58
|
+
Array.from({ length: 10 }).map(() => {
|
|
59
|
+
return space.db.add(
|
|
60
|
+
live(ContactType, {
|
|
61
|
+
name: faker.person.fullName(),
|
|
62
|
+
identifiers: [],
|
|
63
|
+
}),
|
|
64
|
+
);
|
|
65
|
+
});
|
|
57
66
|
},
|
|
58
67
|
}),
|
|
59
68
|
withLayout({ fullscreen: true, tooltips: true, classNames: 'flex justify-center m-2' }),
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
//
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { useCallback,
|
|
5
|
+
import React, { useCallback, useMemo } from 'react';
|
|
6
6
|
|
|
7
7
|
import { ComputeGraph } from '@dxos/conductor';
|
|
8
|
+
import { DXN } from '@dxos/echo';
|
|
8
9
|
import {
|
|
9
10
|
FunctionType,
|
|
10
11
|
FunctionTriggerSchema,
|
|
11
12
|
type FunctionTriggerType,
|
|
12
13
|
type FunctionTrigger,
|
|
13
14
|
ScriptType,
|
|
14
|
-
|
|
15
|
-
} from '@dxos/
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { type CustomInputMap, Form, type InputProps, SelectInput, TextInput, useInputProps } from '@dxos/react-ui-form';
|
|
15
|
+
} from '@dxos/functions';
|
|
16
|
+
import { Filter, Ref, useQuery, type Space } from '@dxos/react-client/echo';
|
|
17
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
18
|
+
import { type CustomInputMap, Form, SelectInput, useRefQueryLookupHandler } from '@dxos/react-ui-form';
|
|
19
19
|
|
|
20
|
+
import { FunctionInputEditor } from './FunctionInputEditor';
|
|
21
|
+
import { SpecSelector } from './SpecSelector';
|
|
20
22
|
import { AUTOMATION_PLUGIN } from '../../meta';
|
|
21
23
|
|
|
22
24
|
export type TriggerEditorProps = {
|
|
@@ -26,30 +28,6 @@ export type TriggerEditorProps = {
|
|
|
26
28
|
onCancel?: () => void;
|
|
27
29
|
};
|
|
28
30
|
|
|
29
|
-
const PayloadInput = (props: InputProps & { property: string }) => {
|
|
30
|
-
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
31
|
-
// TODO(dmaretskyi): Prop name (`meta`) should be passed in.
|
|
32
|
-
const inputProps = useInputProps(['meta', props.property]);
|
|
33
|
-
return (
|
|
34
|
-
<div role='none' className='flex items-center mt-2 gap-1'>
|
|
35
|
-
<div role='none' className='flex-1'>
|
|
36
|
-
<TextInput {...inputProps} type='string' label={props.property} />
|
|
37
|
-
</div>
|
|
38
|
-
<IconButton
|
|
39
|
-
icon='ph--trash--regular'
|
|
40
|
-
iconOnly
|
|
41
|
-
classNames={'mt-6'}
|
|
42
|
-
label={t('trigger meta remove')}
|
|
43
|
-
onClick={() => {
|
|
44
|
-
const newValues: any = { ...props.getValue() };
|
|
45
|
-
delete newValues[props.property];
|
|
46
|
-
props.onValueChange('object', newValues);
|
|
47
|
-
}}
|
|
48
|
-
/>
|
|
49
|
-
</div>
|
|
50
|
-
);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
31
|
export const TriggerEditor = ({ space, trigger, onSave, onCancel }: TriggerEditorProps) => {
|
|
54
32
|
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
55
33
|
|
|
@@ -61,76 +39,58 @@ export const TriggerEditor = ({ space, trigger, onSave, onCancel }: TriggerEdito
|
|
|
61
39
|
onSave?.(values);
|
|
62
40
|
};
|
|
63
41
|
|
|
42
|
+
const handleRefQueryLookup = useRefQueryLookupHandler({ space });
|
|
43
|
+
|
|
64
44
|
const Custom = useMemo(
|
|
65
45
|
(): CustomInputMap => ({
|
|
66
|
-
['function' satisfies keyof FunctionTriggerType]: (props) =>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
),
|
|
72
|
-
['spec.type' as const]: (props) => (
|
|
73
|
-
<SelectInput
|
|
74
|
-
{...props}
|
|
75
|
-
options={Object.values(TriggerKind).map((kind) => ({
|
|
76
|
-
value: kind,
|
|
77
|
-
label: t(`trigger type ${kind}`),
|
|
78
|
-
}))}
|
|
79
|
-
/>
|
|
80
|
-
),
|
|
81
|
-
// TODO(wittjosiah): Form should be able to handle arbitrary records by default.
|
|
82
|
-
['meta' as const]: (props) => {
|
|
83
|
-
const payload = props.getValue() ?? {};
|
|
84
|
-
useEffect(() => props.onValueChange('object', { ...payload }), []);
|
|
85
|
-
const [newPayloadFieldName, setNewPayloadFieldName] = useState('');
|
|
86
|
-
|
|
87
|
-
const handleAddPayload = useCallback(() => {
|
|
88
|
-
if (newPayloadFieldName.length) {
|
|
89
|
-
const payload = props.getValue() ?? {};
|
|
90
|
-
const payloadWithNewProp = { ...payload, [newPayloadFieldName]: '' };
|
|
91
|
-
setNewPayloadFieldName('');
|
|
92
|
-
props.onValueChange('object', payloadWithNewProp);
|
|
46
|
+
['function' satisfies keyof FunctionTriggerType]: (props) => {
|
|
47
|
+
const getValue = useCallback(() => {
|
|
48
|
+
const formValue = props.getValue();
|
|
49
|
+
if (Ref.isRef(formValue)) {
|
|
50
|
+
return formValue.dxn.toString() as string;
|
|
93
51
|
}
|
|
94
|
-
|
|
52
|
+
return undefined;
|
|
53
|
+
}, [props]);
|
|
54
|
+
|
|
55
|
+
const handleOnValueChange = useCallback(
|
|
56
|
+
(_type: any, dxnString: string) => {
|
|
57
|
+
const dxn = DXN.parse(dxnString);
|
|
58
|
+
if (dxn) {
|
|
59
|
+
const ref = Ref.fromDXN(dxn);
|
|
60
|
+
props.onValueChange('object', ref);
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
[props.onValueChange],
|
|
64
|
+
);
|
|
95
65
|
|
|
96
66
|
return (
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
{
|
|
100
|
-
|
|
101
|
-
))}
|
|
102
|
-
|
|
103
|
-
<div role='none' className='flex-1'>
|
|
104
|
-
<Input.Root>
|
|
105
|
-
<Input.TextInput
|
|
106
|
-
placeholder={t('trigger payload prop name placeholder')}
|
|
107
|
-
value={newPayloadFieldName}
|
|
108
|
-
onChange={(event) => setNewPayloadFieldName(event.target.value)}
|
|
109
|
-
/>
|
|
110
|
-
</Input.Root>
|
|
111
|
-
</div>
|
|
112
|
-
<IconButton
|
|
113
|
-
icon='ph--plus--regular'
|
|
114
|
-
iconOnly
|
|
115
|
-
label={t('trigger payload add')}
|
|
116
|
-
onClick={handleAddPayload}
|
|
117
|
-
/>
|
|
118
|
-
</div>
|
|
119
|
-
</>
|
|
67
|
+
<SelectInput
|
|
68
|
+
{...props}
|
|
69
|
+
getValue={getValue as any}
|
|
70
|
+
onValueChange={handleOnValueChange}
|
|
71
|
+
options={getWorkflowOptions(workflows).concat(getFunctionOptions(scripts, functions))}
|
|
72
|
+
/>
|
|
120
73
|
);
|
|
121
74
|
},
|
|
75
|
+
['spec.kind' as const]: SpecSelector,
|
|
76
|
+
['input' as const]: (props) => (
|
|
77
|
+
<FunctionInputEditor {...props} functions={functions} onQueryRefOptions={handleRefQueryLookup} />
|
|
78
|
+
),
|
|
122
79
|
}),
|
|
123
80
|
[workflows, scripts, functions, t],
|
|
124
81
|
);
|
|
125
82
|
|
|
126
83
|
return (
|
|
127
|
-
<
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
84
|
+
<div role='none' className='bs-full is-full'>
|
|
85
|
+
<Form
|
|
86
|
+
schema={FunctionTriggerSchema}
|
|
87
|
+
values={trigger}
|
|
88
|
+
onSave={handleSave}
|
|
89
|
+
onCancel={onCancel}
|
|
90
|
+
Custom={Custom}
|
|
91
|
+
onQueryRefOptions={handleRefQueryLookup}
|
|
92
|
+
/>
|
|
93
|
+
</div>
|
|
134
94
|
);
|
|
135
95
|
};
|
|
136
96
|
|
|
@@ -140,5 +100,5 @@ const getWorkflowOptions = (graphs: ComputeGraph[]) => {
|
|
|
140
100
|
|
|
141
101
|
const getFunctionOptions = (scripts: ScriptType[], functions: FunctionType[]) => {
|
|
142
102
|
const getLabel = (fn: FunctionType) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
|
|
143
|
-
return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:
|
|
103
|
+
return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:echo:@:${fn.id}` }));
|
|
144
104
|
};
|
|
@@ -2,16 +2,19 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Schema, SchemaAST } from 'effect';
|
|
6
|
+
|
|
7
|
+
import { ContactType } from '@dxos/client/testing';
|
|
8
|
+
import { Ref, toJsonSchema } from '@dxos/echo-schema';
|
|
6
9
|
|
|
7
10
|
export const functions = [
|
|
8
11
|
{
|
|
9
12
|
name: 'example.com/function/chess',
|
|
10
13
|
version: '0.1.0',
|
|
11
14
|
inputSchema: toJsonSchema(
|
|
12
|
-
|
|
13
|
-
level:
|
|
14
|
-
[
|
|
15
|
+
Schema.Struct({
|
|
16
|
+
level: Schema.Number.annotations({
|
|
17
|
+
[SchemaAST.TitleAnnotationId]: 'Level',
|
|
15
18
|
}),
|
|
16
19
|
}),
|
|
17
20
|
),
|
|
@@ -21,12 +24,23 @@ export const functions = [
|
|
|
21
24
|
version: '0.1.0',
|
|
22
25
|
binding: 'FOREX',
|
|
23
26
|
inputSchema: toJsonSchema(
|
|
24
|
-
|
|
25
|
-
from:
|
|
26
|
-
[
|
|
27
|
+
Schema.Struct({
|
|
28
|
+
from: Schema.String.annotations({
|
|
29
|
+
[SchemaAST.TitleAnnotationId]: 'Currency from',
|
|
30
|
+
}),
|
|
31
|
+
to: Schema.String.annotations({
|
|
32
|
+
[SchemaAST.TitleAnnotationId]: 'Currency to',
|
|
27
33
|
}),
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
}),
|
|
35
|
+
),
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'example.com/function/ping-contact',
|
|
39
|
+
version: '0.0.1',
|
|
40
|
+
inputSchema: toJsonSchema(
|
|
41
|
+
Schema.Struct({
|
|
42
|
+
contact: Ref(ContactType).annotations({
|
|
43
|
+
[SchemaAST.TitleAnnotationId]: 'Contact',
|
|
30
44
|
}),
|
|
31
45
|
}),
|
|
32
46
|
),
|
package/src/types.ts
CHANGED
|
@@ -2,31 +2,32 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Schema } from 'effect';
|
|
6
|
+
|
|
6
7
|
import { SpaceSchema } from '@dxos/react-client/echo';
|
|
7
8
|
|
|
8
9
|
import { AUTOMATION_PLUGIN } from './meta';
|
|
9
10
|
|
|
10
|
-
const TriggerTemplate =
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const TriggerTemplate = Schema.Union(
|
|
12
|
+
Schema.Struct({ type: Schema.Literal('timer'), cron: Schema.String }),
|
|
13
|
+
Schema.Struct({ type: Schema.Literal('queue'), queueDXN: Schema.Any }),
|
|
13
14
|
);
|
|
14
15
|
|
|
15
16
|
export namespace AutomationAction {
|
|
16
17
|
const AUTOMATION_ACTION = `${AUTOMATION_PLUGIN}/action`;
|
|
17
18
|
|
|
18
|
-
export class CreateTriggerFromTemplate extends
|
|
19
|
+
export class CreateTriggerFromTemplate extends Schema.TaggedClass<CreateTriggerFromTemplate>()(
|
|
19
20
|
`${AUTOMATION_ACTION}/create-trigger-from-template`,
|
|
20
21
|
{
|
|
21
|
-
input:
|
|
22
|
+
input: Schema.Struct({
|
|
22
23
|
space: SpaceSchema,
|
|
23
24
|
template: TriggerTemplate,
|
|
24
|
-
enabled:
|
|
25
|
+
enabled: Schema.optional(Schema.Boolean),
|
|
25
26
|
// TODO(wittjosiah): Improve how this lookup is done.
|
|
26
|
-
scriptName:
|
|
27
|
-
|
|
27
|
+
scriptName: Schema.optional(Schema.String),
|
|
28
|
+
input: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),
|
|
28
29
|
}),
|
|
29
|
-
output:
|
|
30
|
+
output: Schema.Void,
|
|
30
31
|
},
|
|
31
32
|
) {}
|
|
32
33
|
}
|
|
@@ -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
|
-
}
|