@xyne/workflow-ui 1.3.38 → 1.3.40
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/components/automations/CreateWorkflowDialog.d.ts.map +1 -1
- package/dist/components/automations/CreateWorkflowDialog.js +28 -37
- package/dist/components/automations/CreateWorkflowDialog.js.map +1 -1
- package/dist/components/builder/icons.d.ts.map +1 -1
- package/dist/components/builder/icons.js +3 -0
- package/dist/components/builder/icons.js.map +1 -1
- package/dist/components/builder/v3/ConnectorCatalog.d.ts +34 -0
- package/dist/components/builder/v3/ConnectorCatalog.d.ts.map +1 -0
- package/dist/components/builder/v3/ConnectorCatalog.js +79 -0
- package/dist/components/builder/v3/ConnectorCatalog.js.map +1 -0
- package/dist/components/builder/v3/EnhancedSchemaFormRenderer.d.ts.map +1 -1
- package/dist/components/builder/v3/EnhancedSchemaFormRenderer.js +12 -4
- package/dist/components/builder/v3/EnhancedSchemaFormRenderer.js.map +1 -1
- package/dist/components/builder/v3/MultiSelectCheckboxes.d.ts.map +1 -1
- package/dist/components/builder/v3/MultiSelectCheckboxes.js +4 -1
- package/dist/components/builder/v3/MultiSelectCheckboxes.js.map +1 -1
- package/dist/components/builder/v3/SidePanel.d.ts +5 -2
- package/dist/components/builder/v3/SidePanel.d.ts.map +1 -1
- package/dist/components/builder/v3/SidePanel.js +2 -2
- package/dist/components/builder/v3/SidePanel.js.map +1 -1
- package/dist/components/builder/v3/StepConfigPanel.d.ts +3 -1
- package/dist/components/builder/v3/StepConfigPanel.d.ts.map +1 -1
- package/dist/components/builder/v3/StepConfigPanel.js +3 -2
- package/dist/components/builder/v3/StepConfigPanel.js.map +1 -1
- package/dist/components/builder/v3/StepPicker.d.ts.map +1 -1
- package/dist/components/builder/v3/StepPicker.js +19 -34
- package/dist/components/builder/v3/StepPicker.js.map +1 -1
- package/dist/components/builder/v3/TriggerConfigPanel.d.ts +11 -2
- package/dist/components/builder/v3/TriggerConfigPanel.d.ts.map +1 -1
- package/dist/components/builder/v3/TriggerConfigPanel.js +17 -5
- package/dist/components/builder/v3/TriggerConfigPanel.js.map +1 -1
- package/dist/components/builder/v3/TriggerPicker.d.ts.map +1 -1
- package/dist/components/builder/v3/TriggerPicker.js +6 -6
- package/dist/components/builder/v3/TriggerPicker.js.map +1 -1
- package/dist/components/builder/v3/TriggerStartPanel.d.ts +48 -0
- package/dist/components/builder/v3/TriggerStartPanel.d.ts.map +1 -0
- package/dist/components/builder/v3/TriggerStartPanel.js +83 -0
- package/dist/components/builder/v3/TriggerStartPanel.js.map +1 -0
- package/dist/components/builder/v3/WorkflowBuilderV3.d.ts.map +1 -1
- package/dist/components/builder/v3/WorkflowBuilderV3.js +1 -1
- package/dist/components/builder/v3/WorkflowBuilderV3.js.map +1 -1
- package/dist/components/builder/v3/field-options.d.ts +55 -0
- package/dist/components/builder/v3/field-options.d.ts.map +1 -0
- package/dist/components/builder/v3/field-options.js +152 -0
- package/dist/components/builder/v3/field-options.js.map +1 -0
- package/dist/components/execution/ExecutionHeader.d.ts.map +1 -1
- package/dist/components/execution/ExecutionHeader.js +17 -1
- package/dist/components/execution/ExecutionHeader.js.map +1 -1
- package/dist/components/execution/StepDetailPanel.d.ts.map +1 -1
- package/dist/components/execution/StepDetailPanel.js +3 -0
- package/dist/components/execution/StepDetailPanel.js.map +1 -1
- package/dist/components/runs/RunsTable.d.ts.map +1 -1
- package/dist/components/runs/RunsTable.js +22 -1
- package/dist/components/runs/RunsTable.js.map +1 -1
- package/dist/components/runs/RunsView.d.ts.map +1 -1
- package/dist/components/runs/RunsView.js +2 -0
- package/dist/components/runs/RunsView.js.map +1 -1
- package/dist/components/schema-form/SchemaFormRenderer.d.ts.map +1 -1
- package/dist/components/schema-form/SchemaFormRenderer.js +9 -3
- package/dist/components/schema-form/SchemaFormRenderer.js.map +1 -1
- package/dist/components/shared/StatusBadge.d.ts +1 -1
- package/dist/components/shared/StatusBadge.d.ts.map +1 -1
- package/dist/components/shared/StatusBadge.js +2 -0
- package/dist/components/shared/StatusBadge.js.map +1 -1
- package/dist/hooks/use-schema-form.d.ts +7 -0
- package/dist/hooks/use-schema-form.d.ts.map +1 -1
- package/dist/hooks/use-schema-form.js +9 -19
- package/dist/hooks/use-schema-form.js.map +1 -1
- package/dist/hooks/use-workflow-builder.d.ts +3 -1
- package/dist/hooks/use-workflow-builder.d.ts.map +1 -1
- package/dist/hooks/use-workflow-builder.js +16 -5
- package/dist/hooks/use-workflow-builder.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/utils/connector-groups.d.ts +28 -0
- package/dist/utils/connector-groups.d.ts.map +1 -0
- package/dist/utils/connector-groups.js +45 -0
- package/dist/utils/connector-groups.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TriggerFilter, WorkflowConfig, WorkflowStepConfig, WorkflowVariable } from '@xyne/workflow-sdk/builder';
|
|
1
|
+
import type { TriggerFilter, TriggerStart, WorkflowConfig, WorkflowStepConfig, WorkflowVariable } from '@xyne/workflow-sdk/builder';
|
|
2
2
|
import type { ValidationIssue } from '@xyne/workflow-sdk';
|
|
3
3
|
import type { StepMeta, TriggerMeta } from '../../../hooks/use-step-metadata.js';
|
|
4
4
|
export interface SidePanelProps {
|
|
@@ -23,6 +23,8 @@ export interface SidePanelProps {
|
|
|
23
23
|
triggerConfig: Record<string, unknown>;
|
|
24
24
|
/** Current trigger filter, if any. */
|
|
25
25
|
triggerFilter?: TriggerFilter | undefined;
|
|
26
|
+
/** When a matching event becomes a run. Absent means as soon as it arrives. */
|
|
27
|
+
triggerStart?: TriggerStart | undefined;
|
|
26
28
|
/** The saved workflow's id, for its webhook URL. */
|
|
27
29
|
workflowId?: string | undefined;
|
|
28
30
|
readOnly: boolean;
|
|
@@ -44,8 +46,9 @@ export interface SidePanelProps {
|
|
|
44
46
|
onToggleStepDisabled: (stepId: string) => void;
|
|
45
47
|
onUpdateTriggerConfig: (config: Record<string, unknown>) => void;
|
|
46
48
|
onUpdateTriggerFilter: (filter: TriggerFilter | undefined) => void;
|
|
49
|
+
onUpdateTriggerStart: (start: TriggerStart | undefined) => void;
|
|
47
50
|
onRequestChangeTrigger: () => void;
|
|
48
51
|
onClose: () => void;
|
|
49
52
|
}
|
|
50
|
-
export declare function SidePanel({ selectedStep, isTriggerSelected, isVariablesSelected, variables, onUpdateVariables, config, stepMeta, triggerMeta, triggerType, triggerConfig, triggerFilter, workflowId, readOnly, issues, triggerIssues, onUpdateStepConfig, onUpdateStepMeta, onUpsertGroup, onAddStepCitation, onRemoveStepCitation, onDeleteStep, onDuplicateStep, onToggleStepDisabled, onUpdateTriggerConfig, onUpdateTriggerFilter, onRequestChangeTrigger, onClose, }: SidePanelProps): import("react").JSX.Element;
|
|
53
|
+
export declare function SidePanel({ selectedStep, isTriggerSelected, isVariablesSelected, variables, onUpdateVariables, config, stepMeta, triggerMeta, triggerType, triggerConfig, triggerFilter, triggerStart, workflowId, readOnly, issues, triggerIssues, onUpdateStepConfig, onUpdateStepMeta, onUpsertGroup, onAddStepCitation, onRemoveStepCitation, onDeleteStep, onDuplicateStep, onToggleStepDisabled, onUpdateTriggerConfig, onUpdateTriggerFilter, onUpdateTriggerStart, onRequestChangeTrigger, onClose, }: SidePanelProps): import("react").JSX.Element;
|
|
51
54
|
//# sourceMappingURL=SidePanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../src/components/builder/v3/SidePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../src/components/builder/v3/SidePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EA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AAQ,EACR,MAAM,EACN,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,OAAO,GACR,EAAE,cAAc,+BA4EhB"}
|
|
@@ -3,12 +3,12 @@ import { StepConfigPanel } from './StepConfigPanel.js';
|
|
|
3
3
|
import { TriggerConfigPanel } from './TriggerConfigPanel.js';
|
|
4
4
|
import { VariablesPanel } from './VariablesPanel.js';
|
|
5
5
|
import { cn } from '../../shared/cn.js';
|
|
6
|
-
export function SidePanel({ selectedStep, isTriggerSelected, isVariablesSelected, variables, onUpdateVariables, config, stepMeta, triggerMeta, triggerType, triggerConfig, triggerFilter, workflowId, readOnly, issues, triggerIssues, onUpdateStepConfig, onUpdateStepMeta, onUpsertGroup, onAddStepCitation, onRemoveStepCitation, onDeleteStep, onDuplicateStep, onToggleStepDisabled, onUpdateTriggerConfig, onUpdateTriggerFilter, onRequestChangeTrigger, onClose, }) {
|
|
6
|
+
export function SidePanel({ selectedStep, isTriggerSelected, isVariablesSelected, variables, onUpdateVariables, config, stepMeta, triggerMeta, triggerType, triggerConfig, triggerFilter, triggerStart, workflowId, readOnly, issues, triggerIssues, onUpdateStepConfig, onUpdateStepMeta, onUpsertGroup, onAddStepCitation, onRemoveStepCitation, onDeleteStep, onDuplicateStep, onToggleStepDisabled, onUpdateTriggerConfig, onUpdateTriggerFilter, onUpdateTriggerStart, onRequestChangeTrigger, onClose, }) {
|
|
7
7
|
const isOpen = !!selectedStep || isTriggerSelected || isVariablesSelected;
|
|
8
8
|
const meta = selectedStep ? stepMeta.get(selectedStep.type) : undefined;
|
|
9
9
|
return (_jsx("div", { className: cn('relative flex h-full flex-col border-l border-slate-200/80 bg-white transition-[flex,opacity] duration-200', isOpen ? 'opacity-100' : 'opacity-0 overflow-hidden border-l-0'), style: {
|
|
10
10
|
flex: isOpen ? '0 0 45%' : '0 0 0%',
|
|
11
11
|
animation: isOpen ? 'wui-slide-in-right 180ms ease-out' : undefined,
|
|
12
|
-
}, children: isOpen && (_jsxs(_Fragment, { children: [_jsx("button", { onClick: onClose, className: "absolute right-3 top-4 z-10 flex h-6 w-6 items-center justify-center rounded-md text-slate-400 hover:bg-slate-100 hover:text-slate-600 transition-colors", children: _jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", children: [_jsx("path", { d: "M18 6 6 18" }), _jsx("path", { d: "m6 6 12 12" })] }) }), selectedStep ? (_jsx(StepConfigPanel, { step: selectedStep, config: config, category: meta?.category, icon: meta?.icon, onUpdateConfig: (stepConfig) => onUpdateStepConfig(selectedStep.id, stepConfig), onUpdateMeta: (metaUpdate) => onUpdateStepMeta(selectedStep.id, metaUpdate), groups: config.groups, onUpsertGroup: onUpsertGroup, onAddCitation: (fieldPath, citation) => onAddStepCitation(selectedStep.id, fieldPath, citation), onRemoveCitation: (citationPath, index) => onRemoveStepCitation(selectedStep.id, citationPath, index), issues: issues, onDelete: () => onDeleteStep(selectedStep.id), onDuplicate: () => onDuplicateStep(selectedStep.id), onToggleDisabled: () => onToggleStepDisabled(selectedStep.id), readOnly: readOnly }, selectedStep.id)) : isTriggerSelected ? (_jsx(TriggerConfigPanel, { triggerType: triggerType, triggerConfig: triggerConfig, triggerMeta: triggerMeta, issues: triggerIssues, onUpdateConfig: onUpdateTriggerConfig, filter: triggerFilter, onUpdateFilter: onUpdateTriggerFilter, workflowConfig: config, workflowId: workflowId, onRequestChangeTrigger: onRequestChangeTrigger, readOnly: readOnly })) : isVariablesSelected ? (_jsx(VariablesPanel, { variables: variables, onChange: onUpdateVariables, readOnly: readOnly })) : null] })) }));
|
|
12
|
+
}, children: isOpen && (_jsxs(_Fragment, { children: [_jsx("button", { onClick: onClose, className: "absolute right-3 top-4 z-10 flex h-6 w-6 items-center justify-center rounded-md text-slate-400 hover:bg-slate-100 hover:text-slate-600 transition-colors", children: _jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", children: [_jsx("path", { d: "M18 6 6 18" }), _jsx("path", { d: "m6 6 12 12" })] }) }), selectedStep ? (_jsx(StepConfigPanel, { step: selectedStep, config: config, workflowId: workflowId, category: meta?.category, icon: meta?.icon, onUpdateConfig: (stepConfig) => onUpdateStepConfig(selectedStep.id, stepConfig), onUpdateMeta: (metaUpdate) => onUpdateStepMeta(selectedStep.id, metaUpdate), groups: config.groups, onUpsertGroup: onUpsertGroup, onAddCitation: (fieldPath, citation) => onAddStepCitation(selectedStep.id, fieldPath, citation), onRemoveCitation: (citationPath, index) => onRemoveStepCitation(selectedStep.id, citationPath, index), issues: issues, onDelete: () => onDeleteStep(selectedStep.id), onDuplicate: () => onDuplicateStep(selectedStep.id), onToggleDisabled: () => onToggleStepDisabled(selectedStep.id), readOnly: readOnly }, selectedStep.id)) : isTriggerSelected ? (_jsx(TriggerConfigPanel, { triggerType: triggerType, triggerConfig: triggerConfig, triggerMeta: triggerMeta, issues: triggerIssues, onUpdateConfig: onUpdateTriggerConfig, filter: triggerFilter, onUpdateFilter: onUpdateTriggerFilter, start: triggerStart, onUpdateStart: onUpdateTriggerStart, workflowConfig: config, workflowId: workflowId, onRequestChangeTrigger: onRequestChangeTrigger, readOnly: readOnly })) : isVariablesSelected ? (_jsx(VariablesPanel, { variables: variables, onChange: onUpdateVariables, readOnly: readOnly })) : null] })) }));
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=SidePanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanel.js","sourceRoot":"","sources":["../../../../src/components/builder/v3/SidePanel.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"SidePanel.js","sourceRoot":"","sources":["../../../../src/components/builder/v3/SidePanel.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAgDxC,MAAM,UAAU,SAAS,CAAC,EACxB,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,SAAS,EACT,iBAAiB,EACjB,MAAM,EACN,QAAQ,EACR,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,MAAM,EACN,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,OAAO,GACQ;IACf,MAAM,MAAM,GAAG,CAAC,CAAC,YAAY,IAAI,iBAAiB,IAAI,mBAAmB,CAAC;IAC1E,MAAM,IAAI,GAAG,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAExE,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CACX,4GAA4G,EAC5G,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,sCAAsC,CAChE,EACD,KAAK,EAAE;YACL,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;YACn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EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,YAAY,CAAC,EAAE,CAAC,EACnD,gBAAgB,EAAE,GAAG,EAAE,CAAC,oBAAoB,CAAC,YAAY,CAAC,EAAE,CAAC,EAC7D,QAAQ,EAAE,QAAQ,IAhBb,YAAY,CAAC,EAAE,CAiBpB,CACH,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CACtB,KAAC,kBAAkB,IACjB,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,aAAa,EACrB,cAAc,EAAE,qBAAqB,EACrC,MAAM,EAAE,aAAa,EACrB,cAAc,EAAE,qBAAqB,EACrC,KAAK,EAAE,YAAY,EACnB,aAAa,EAAE,oBAAoB,EACnC,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,sBAAsB,EAC9C,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CACxB,KAAC,cAAc,IACb,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,iBAAiB,EAC3B,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,GACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -26,6 +26,8 @@ export interface StepConfigPanelProps {
|
|
|
26
26
|
onDuplicate: () => void;
|
|
27
27
|
onToggleDisabled: () => void;
|
|
28
28
|
readOnly: boolean;
|
|
29
|
+
/** The saved workflow's id — a picker reads data for that workflow's workspace. */
|
|
30
|
+
workflowId?: string | undefined;
|
|
29
31
|
}
|
|
30
|
-
export declare function StepConfigPanel({ step, config, category, icon, onUpdateConfig, onUpdateMeta, groups, onUpsertGroup, onAddCitation, onRemoveCitation, issues, onDelete, onDuplicate, onToggleDisabled, readOnly, }: StepConfigPanelProps): import("react").JSX.Element;
|
|
32
|
+
export declare function StepConfigPanel({ step, config, category, icon, onUpdateConfig, onUpdateMeta, groups, onUpsertGroup, onAddCitation, onRemoveCitation, issues, onDelete, onDuplicate, onToggleDisabled, readOnly, workflowId, }: StepConfigPanelProps): import("react").JSX.Element;
|
|
31
33
|
//# sourceMappingURL=StepConfigPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepConfigPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/builder/v3/StepConfigPanel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAa,SAAS,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACrH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"StepConfigPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/builder/v3/StepConfigPanel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAa,SAAS,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACrH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAkB1D,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,kBAAkB,CAAC;IACzB,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAC1D,0FAA0F;IAC1F,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,KAAK,IAAI,CAAC;IACjG,qDAAqD;IACrD,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC;IACjC,mFAAmF;IACnF,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IAC3C,4FAA4F;IAC5F,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IAChE,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjE,yEAAyE;IACzE,MAAM,CAAC,EAAE,eAAe,EAAE,GAAG,SAAS,CAAC;IACvC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,mFAAmF;IACnF,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC;AAaD,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,cAAc,EACd,YAAY,EACZ,MAAM,EACN,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,MAAM,EACN,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,UAAU,GACX,EAAE,oBAAoB,+BAsRtB"}
|
|
@@ -5,6 +5,7 @@ import { useStepConfig } from '../../../hooks/use-step-config.js';
|
|
|
5
5
|
import { fieldErrors } from '../../../utils/issue-mapping.js';
|
|
6
6
|
import { detectBranchesFromConfig } from '../../../utils/branch-detection.js';
|
|
7
7
|
import { EnhancedSchemaFormRenderer } from './EnhancedSchemaFormRenderer.js';
|
|
8
|
+
import { FieldOptionsScopeProvider } from './field-options.js';
|
|
8
9
|
import { ConditionEditorPanel } from './ConditionEditorPanel.js';
|
|
9
10
|
import { SwitchCaseEditor } from './SwitchCaseEditor.js';
|
|
10
11
|
import { LoadingSpinner } from '../../shared/LoadingSpinner.js';
|
|
@@ -23,7 +24,7 @@ function formatTypeName(type) {
|
|
|
23
24
|
.map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())
|
|
24
25
|
.join(' ');
|
|
25
26
|
}
|
|
26
|
-
export function StepConfigPanel({ step, config, category, icon, onUpdateConfig, onUpdateMeta, groups, onUpsertGroup, onAddCitation, onRemoveCitation, issues, onDelete, onDuplicate, onToggleDisabled, readOnly, }) {
|
|
27
|
+
export function StepConfigPanel({ step, config, category, icon, onUpdateConfig, onUpdateMeta, groups, onUpsertGroup, onAddCitation, onRemoveCitation, issues, onDelete, onDuplicate, onToggleDisabled, readOnly, workflowId, }) {
|
|
27
28
|
const isConditional = step.type === 'CONDITIONAL';
|
|
28
29
|
const isSwitch = step.type === 'SWITCH';
|
|
29
30
|
const hasSpecialEditor = isConditional || isSwitch;
|
|
@@ -58,7 +59,7 @@ export function StepConfigPanel({ step, config, category, icon, onUpdateConfig,
|
|
|
58
59
|
}, className: "w-full rounded-md border border-slate-200 bg-white px-2.5 py-1.5 text-[12px] text-slate-800 outline-none focus:border-indigo-400 focus:ring-1 focus:ring-indigo-100", children: [_jsx("option", { value: "", children: "No group" }), (groups ?? []).map((g) => (_jsx("option", { value: g.id, children: g.title }, g.id))), _jsx("option", { value: "__new__", children: "\uFF0B Create group\u2026" })] }), step.groupId && onUpsertGroup && (() => {
|
|
59
60
|
const current = (groups ?? []).find((g) => g.id === step.groupId);
|
|
60
61
|
return current ? (_jsxs("div", { className: "mt-2 space-y-1.5 rounded-md border border-slate-200 bg-white p-2", children: [_jsx("span", { className: "block text-[10px] font-bold uppercase tracking-widest text-slate-400", children: "Group details" }), _jsx("input", { type: "text", value: current.title, onChange: (e) => onUpsertGroup({ ...current, title: e.target.value }), placeholder: "Group title", className: "w-full rounded-md border border-slate-200 bg-white px-2.5 py-1.5 text-[12px] text-slate-800 placeholder:text-slate-400 outline-none focus:border-indigo-400 focus:ring-1 focus:ring-indigo-100" }), _jsx("textarea", { value: current.description ?? '', onChange: (e) => onUpsertGroup({ ...current, description: e.target.value }), rows: 2, placeholder: "What this group of steps does\u2026", className: "w-full resize-y rounded-md border border-slate-200 bg-white px-2.5 py-1.5 text-[12px] text-slate-800 placeholder:text-slate-400 outline-none focus:border-indigo-400 focus:ring-1 focus:ring-indigo-100" })] })) : null;
|
|
61
|
-
})()] })] })), isConditional ? (_jsxs("div", { children: [_jsx("h4", { className: "mb-1 text-[10px] font-bold uppercase tracking-widest text-slate-400", children: "Condition" }), _jsx("p", { className: "mb-3 text-[11px] text-slate-400", children: "Define when the true branch executes" }), _jsx(ConditionEditorPanel, { condition: stepConfig['condition'] ?? defaultCondition(), onChange: (c) => onUpdateConfig({ ...stepConfig, condition: c }), config: config, atStepId: step.id, readOnly: readOnly })] })) : isSwitch ? (_jsxs("div", { children: [_jsx("h4", { className: "mb-1 text-[10px] font-bold uppercase tracking-widest text-slate-400", children: "Switch Cases" }), _jsx("p", { className: "mb-3 text-[11px] text-slate-400", children: "Route to the first matching case" }), _jsx(SwitchCaseEditor, { cases: stepConfig['cases'] ?? [], onChange: (c) => onUpdateConfig({ ...stepConfig, cases: c }), config: config, atStepId: step.id, readOnly: readOnly })] })) : isLoading ? (_jsx("div", { className: "flex justify-center py-12", children: _jsx(LoadingSpinner, { size: "md" }) })) : visibleFields.length > 0 ? (_jsxs("div", { children: [_jsx("h4", { className: "mb-3 text-[10px] font-bold uppercase tracking-widest text-slate-400", children: "Configuration" }), _jsx(EnhancedSchemaFormRenderer, { fields: visibleFields, values: values, errors: mergedErrors, onChange: (path, value) => setFieldValue(path, value), config: config, atStepId: step.id, readOnly: readOnly, citations: step.citations, onAddCitation: onAddCitation, onRemoveCitation: onRemoveCitation })] })) : (_jsxs("div", { className: "flex flex-col items-center py-12 text-center", children: [_jsx("div", { className: "mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-slate-50 ring-1 ring-slate-100", children: _jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", className: "text-slate-300", strokeLinecap: "round", children: [_jsx("path", { d: "M12 8v4l3 3" }), _jsx("circle", { cx: "12", cy: "12", r: "10" })] }) }), _jsx("p", { className: "text-[13px] font-medium text-slate-400", children: "No configuration needed" }), _jsx("p", { className: "mt-1 text-[11px] text-slate-300", children: "This step works with default settings" })] }))] }), !readOnly && (_jsxs("div", { className: "flex gap-2 border-t border-slate-100 px-5 py-3", children: [_jsxs("button", { onClick: onToggleDisabled, className: cn('flex items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-[12px] font-medium transition-all', isDisabled
|
|
62
|
+
})()] })] })), isConditional ? (_jsxs("div", { children: [_jsx("h4", { className: "mb-1 text-[10px] font-bold uppercase tracking-widest text-slate-400", children: "Condition" }), _jsx("p", { className: "mb-3 text-[11px] text-slate-400", children: "Define when the true branch executes" }), _jsx(ConditionEditorPanel, { condition: stepConfig['condition'] ?? defaultCondition(), onChange: (c) => onUpdateConfig({ ...stepConfig, condition: c }), config: config, atStepId: step.id, readOnly: readOnly })] })) : isSwitch ? (_jsxs("div", { children: [_jsx("h4", { className: "mb-1 text-[10px] font-bold uppercase tracking-widest text-slate-400", children: "Switch Cases" }), _jsx("p", { className: "mb-3 text-[11px] text-slate-400", children: "Route to the first matching case" }), _jsx(SwitchCaseEditor, { cases: stepConfig['cases'] ?? [], onChange: (c) => onUpdateConfig({ ...stepConfig, cases: c }), config: config, atStepId: step.id, readOnly: readOnly })] })) : isLoading ? (_jsx("div", { className: "flex justify-center py-12", children: _jsx(LoadingSpinner, { size: "md" }) })) : visibleFields.length > 0 ? (_jsxs("div", { children: [_jsx("h4", { className: "mb-3 text-[10px] font-bold uppercase tracking-widest text-slate-400", children: "Configuration" }), _jsx(FieldOptionsScopeProvider, { scope: { kind: 'steps', type: step.type, workflowId }, children: _jsx(EnhancedSchemaFormRenderer, { fields: visibleFields, values: values, errors: mergedErrors, onChange: (path, value) => setFieldValue(path, value), config: config, atStepId: step.id, readOnly: readOnly, citations: step.citations, onAddCitation: onAddCitation, onRemoveCitation: onRemoveCitation }) })] })) : (_jsxs("div", { className: "flex flex-col items-center py-12 text-center", children: [_jsx("div", { className: "mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-slate-50 ring-1 ring-slate-100", children: _jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", className: "text-slate-300", strokeLinecap: "round", children: [_jsx("path", { d: "M12 8v4l3 3" }), _jsx("circle", { cx: "12", cy: "12", r: "10" })] }) }), _jsx("p", { className: "text-[13px] font-medium text-slate-400", children: "No configuration needed" }), _jsx("p", { className: "mt-1 text-[11px] text-slate-300", children: "This step works with default settings" })] }))] }), !readOnly && (_jsxs("div", { className: "flex gap-2 border-t border-slate-100 px-5 py-3", children: [_jsxs("button", { onClick: onToggleDisabled, className: cn('flex items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-[12px] font-medium transition-all', isDisabled
|
|
62
63
|
? 'border-emerald-200 text-emerald-600 hover:bg-emerald-50'
|
|
63
64
|
: 'border-slate-200 text-slate-500 hover:bg-slate-50 hover:border-slate-300'), children: [_jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", children: isDisabled
|
|
64
65
|
? _jsxs(_Fragment, { children: [_jsx("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }), _jsx("circle", { cx: "12", cy: "12", r: "3" })] })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepConfigPanel.js","sourceRoot":"","sources":["../../../../src/components/builder/v3/StepConfigPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO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AAC,GAAG,EAAC,aAAa,EAAC,OAAO,EAAC,cAAc,EAAC,OAAO,aAC5I,eAAM,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,GAAG,EAAA,eAAM,CAAC,EAAC,yDAAyD,GAAG,IAClH,iBAEC,EACT,kBACE,OAAO,EAAE,QAAQ,EACjB,SAAS,EAAC,yLAAyL,aAEnM,eAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,WAAW,EAAC,GAAG,EAAC,aAAa,EAAC,OAAO,EAAC,cAAc,EAAC,OAAO,aAC5I,eAAM,CAAC,EAAC,SAAS,GAAG,EAAA,eAAM,CAAC,EAAC,uCAAuC,GAAG,EAAA,eAAM,CAAC,EAAC,oCAAoC,GAAG,IACjH,cAEC,IACL,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepPicker.d.ts","sourceRoot":"","sources":["../../../../src/components/builder/v3/StepPicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StepPicker.d.ts","sourceRoot":"","sources":["../../../../src/components/builder/v3/StepPicker.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,QAAQ,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;CAC9D;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC7D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAcD,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,eAAe,sCA6E/E"}
|
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useEffect,
|
|
2
|
+
import { useCallback, useEffect, useId, useState } from 'react';
|
|
3
3
|
import { useWorkflowClient } from '../../../hooks/use-workflow-client.js';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { ConnectorCatalog } from './ConnectorCatalog.js';
|
|
5
|
+
/** One connector's steps under a heading per category, in the order categories first appear. */
|
|
6
|
+
function sectionsByCategory(steps) {
|
|
7
|
+
const byCategory = new Map();
|
|
8
|
+
for (const step of steps) {
|
|
9
|
+
const category = step.category || 'other';
|
|
10
|
+
const members = byCategory.get(category);
|
|
11
|
+
if (members)
|
|
12
|
+
members.push(step);
|
|
13
|
+
else
|
|
14
|
+
byCategory.set(category, [step]);
|
|
15
|
+
}
|
|
16
|
+
return Array.from(byCategory, ([category, members]) => ({ key: category, label: category, items: members }));
|
|
17
|
+
}
|
|
7
18
|
export function StepPicker({ open, context, onSelect, onClose }) {
|
|
8
19
|
const client = useWorkflowClient();
|
|
20
|
+
const titleId = useId();
|
|
9
21
|
const [steps, setSteps] = useState([]);
|
|
10
|
-
const [search, setSearch] = useState('');
|
|
11
22
|
useEffect(() => {
|
|
12
23
|
if (!open)
|
|
13
24
|
return;
|
|
@@ -22,10 +33,6 @@ export function StepPicker({ open, context, onSelect, onClose }) {
|
|
|
22
33
|
})();
|
|
23
34
|
return () => { cancelled = true; };
|
|
24
35
|
}, [client, open]);
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
if (open)
|
|
27
|
-
setSearch('');
|
|
28
|
-
}, [open]);
|
|
29
36
|
useEffect(() => {
|
|
30
37
|
if (!open)
|
|
31
38
|
return;
|
|
@@ -38,34 +45,12 @@ export function StepPicker({ open, context, onSelect, onClose }) {
|
|
|
38
45
|
document.addEventListener('keydown', handleKeyDown);
|
|
39
46
|
return () => document.removeEventListener('keydown', handleKeyDown);
|
|
40
47
|
}, [open, onClose]);
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
return steps;
|
|
44
|
-
const q = search.toLowerCase();
|
|
45
|
-
return steps.filter((s) => s.name.toLowerCase().includes(q) ||
|
|
46
|
-
s.type.toLowerCase().includes(q) ||
|
|
47
|
-
s.description.toLowerCase().includes(q));
|
|
48
|
-
}, [steps, search]);
|
|
49
|
-
const grouped = useMemo(() => {
|
|
50
|
-
const groups = {};
|
|
51
|
-
for (const step of filtered) {
|
|
52
|
-
const cat = step.category || 'other';
|
|
53
|
-
(groups[cat] ??= []).push(step);
|
|
54
|
-
}
|
|
55
|
-
return groups;
|
|
56
|
-
}, [filtered]);
|
|
57
|
-
const handleSelect = useCallback((type) => {
|
|
58
|
-
onSelect(type, context);
|
|
48
|
+
const handleSelect = useCallback((step) => {
|
|
49
|
+
onSelect(step.type, context);
|
|
59
50
|
onClose();
|
|
60
51
|
}, [onSelect, onClose, context]);
|
|
61
52
|
if (!open)
|
|
62
53
|
return null;
|
|
63
|
-
return (_jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center", onMouseDown: onClose, children: [_jsx("div", { className: "absolute inset-0 bg-
|
|
64
|
-
const theme = getCategoryTheme(category);
|
|
65
|
-
return (_jsxs("div", { className: "mb-3 last:mb-0", children: [_jsxs("div", { className: "mb-1.5 flex items-center gap-2 px-2", children: [_jsx("span", { className: cn('h-1.5 w-1.5 rounded-full', theme.dot) }), _jsx("span", { className: "text-[10px] font-bold uppercase tracking-widest text-slate-400", children: category }), _jsx("span", { className: "text-[10px] text-slate-300", children: categorySteps.length })] }), _jsx("div", { className: "space-y-0.5", children: categorySteps.map((step) => {
|
|
66
|
-
const stepTheme = getCategoryTheme(step.category);
|
|
67
|
-
return (_jsxs("button", { onClick: () => handleSelect(step.type), className: "flex w-full items-center gap-3.5 rounded-xl px-3 py-2.5 text-left transition-all hover:bg-slate-50 active:scale-[0.99]", children: [_jsx("div", { className: cn('flex h-10 w-10 shrink-0 items-center justify-center rounded-xl', stepTheme.iconBg, stepTheme.iconText), children: getStepIcon(step.icon, { size: 16 }) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "text-[13px] font-semibold text-slate-700", children: step.name }), _jsx("div", { className: "mt-0.5 truncate text-[11px] text-slate-400 leading-tight", children: step.description })] }), _jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", className: "shrink-0 text-slate-300", children: [_jsx("path", { d: "M12 5v14" }), _jsx("path", { d: "M5 12h14" })] })] }, step.type));
|
|
68
|
-
}) })] }, category));
|
|
69
|
-
}), filtered.length === 0 && (_jsxs("div", { className: "flex flex-col items-center py-10", children: [_jsxs("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", className: "text-slate-300 mb-2", children: [_jsx("circle", { cx: "11", cy: "11", r: "8" }), _jsx("path", { d: "m21 21-4.3-4.3" })] }), _jsx("p", { className: "text-sm text-slate-400", children: "No steps found" })] }))] })] })] }));
|
|
54
|
+
return (_jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", onMouseDown: onClose, children: [_jsx("div", { className: "absolute inset-0 bg-black/40 backdrop-blur-[2px]" }), _jsxs("div", { role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, className: "relative flex h-[600px] max-h-[calc(100vh_-_2rem)] w-full max-w-lg flex-col overflow-hidden rounded-[var(--wui-radius-lg)] border border-[var(--wui-border)] bg-[var(--wui-surface)] shadow-[var(--wui-shadow-lg)] animate-[wui-scale-in_180ms_ease-out]", onMouseDown: (e) => e.stopPropagation(), children: [_jsxs("div", { className: "flex shrink-0 items-center justify-between border-b border-[var(--wui-border)] px-5 py-4", children: [_jsxs("div", { children: [_jsx("h2", { id: titleId, className: "text-[15px] font-semibold text-[var(--wui-fg)]", children: "Add Step" }), _jsx("p", { className: "mt-0.5 text-xs text-[var(--wui-fg-muted)]", children: "Choose a step type to add to your workflow" })] }), _jsx("button", { type: "button", onClick: onClose, "aria-label": "Close", className: "flex h-7 w-7 items-center justify-center rounded-[var(--wui-radius-sm)] text-[var(--wui-fg-muted)] transition-colors hover:bg-[var(--wui-bg-muted)] hover:text-[var(--wui-fg)]", children: _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", children: [_jsx("path", { d: "M18 6 6 18" }), _jsx("path", { d: "m6 6 12 12" })] }) })] }), _jsx(ConnectorCatalog, { className: "flex-1", items: steps, noun: "step", onSelect: handleSelect, sectionsOf: sectionsByCategory, autoFocus: true })] })] }));
|
|
70
55
|
}
|
|
71
56
|
//# sourceMappingURL=StepPicker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepPicker.js","sourceRoot":"","sources":["../../../../src/components/builder/v3/StepPicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"StepPicker.js","sourceRoot":"","sources":["../../../../src/components/builder/v3/StepPicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAezD,gGAAgG;AAChG,SAAS,kBAAkB,CAAC,KAA6B;IACvD,MAAM,UAAU,GAAG,IAAI,GAAG,EAAyB,CAAC;IACpD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CA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,EACb,OAAO,EAAE,OAAO,gBACL,OAAO,EAClB,SAAS,EAAC,gLAAgL,YAE1L,eAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,WAAW,EAAC,GAAG,EAAC,aAAa,EAAC,OAAO,aACrH,eAAM,CAAC,EAAC,YAAY,GAAG,EAAA,eAAM,CAAC,EAAC,YAAY,GAAG,IAC1C,GACC,IACL,EAEN,KAAC,gBAAgB,IACf,SAAS,EAAC,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,YAAY,EACtB,UAAU,EAAE,kBAAkB,EAC9B,SAAS,SACT,IACE,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ValidationIssue } from '@xyne/workflow-sdk';
|
|
2
|
-
import type { TriggerFilter, WorkflowConfig } from '@xyne/workflow-sdk/builder';
|
|
2
|
+
import type { TriggerFilter, TriggerStart, WorkflowConfig } from '@xyne/workflow-sdk/builder';
|
|
3
3
|
import type { TriggerMeta } from '../../../hooks/use-step-metadata.js';
|
|
4
4
|
export interface TriggerConfigPanelProps {
|
|
5
5
|
triggerType: string;
|
|
@@ -16,8 +16,17 @@ export interface TriggerConfigPanelProps {
|
|
|
16
16
|
filter?: TriggerFilter | undefined;
|
|
17
17
|
/** Set the filter, or remove it with `undefined`. */
|
|
18
18
|
onUpdateFilter: (filter: TriggerFilter | undefined) => void;
|
|
19
|
+
/** When a matching event becomes a run. Absent means as soon as it arrives. */
|
|
20
|
+
start?: TriggerStart | undefined;
|
|
21
|
+
/** Set the start policy, or remove the delay with `undefined`. */
|
|
22
|
+
onUpdateStart: (start: TriggerStart | undefined) => void;
|
|
19
23
|
/** The saved workflow's id. A workflow that was never saved has no webhook URL yet. */
|
|
20
24
|
workflowId?: string | undefined;
|
|
21
25
|
}
|
|
22
|
-
|
|
26
|
+
/**
|
|
27
|
+
* The trigger's config panel. Keyed by trigger type, so choosing another trigger starts a fresh
|
|
28
|
+
* form: the form holds its values in state, and without the key a field both triggers have (such
|
|
29
|
+
* as `actions`) would carry the old trigger's selections into the new trigger's config.
|
|
30
|
+
*/
|
|
31
|
+
export declare function TriggerConfigPanel(props: TriggerConfigPanelProps): import("react").JSX.Element;
|
|
23
32
|
//# sourceMappingURL=TriggerConfigPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerConfigPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/builder/v3/TriggerConfigPanel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"TriggerConfigPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/builder/v3/TriggerConfigPanel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAEV,aAAa,EACb,YAAY,EACZ,cAAc,EACf,MAAM,4BAA4B,CAAC;AAWpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAEvE,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,WAAW,EAAE,WAAW,EAAE,CAAC;IAC3B,yEAAyE;IACzE,MAAM,CAAC,EAAE,eAAe,EAAE,GAAG,SAAS,CAAC;IACvC,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAC1D,sBAAsB,EAAE,MAAM,IAAI,CAAC;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,8FAA8F;IAC9F,cAAc,EAAE,cAAc,CAAC;IAC/B,wEAAwE;IACxE,MAAM,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IACnC,qDAAqD;IACrD,cAAc,EAAE,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5D,+EAA+E;IAC/E,KAAK,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACjC,kEAAkE;IAClE,aAAa,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,KAAK,IAAI,CAAC;IACzD,uFAAuF;IACvF,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC;AASD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,+BAEhE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, useState } from 'react';
|
|
3
|
-
import { ConditionOperator, TRIGGER_FILTER_SCOPE } from '@xyne/workflow-sdk/builder';
|
|
3
|
+
import { ConditionOperator, TRIGGER_FILTER_SCOPE, isDelayedStart } from '@xyne/workflow-sdk/builder';
|
|
4
4
|
import { TriggerCategory } from '@xyne/workflow-sdk/types';
|
|
5
5
|
import { useTriggerConfig } from '../../../hooks/use-trigger-config.js';
|
|
6
6
|
import { SchemaFormRenderer } from '../../schema-form/SchemaFormRenderer.js';
|
|
@@ -8,12 +8,22 @@ import { LoadingSpinner } from '../../shared/LoadingSpinner.js';
|
|
|
8
8
|
import { fieldErrors } from '../../../utils/issue-mapping.js';
|
|
9
9
|
import { getTriggerIcon } from '../icons.js';
|
|
10
10
|
import { ConditionEditorPanel } from './ConditionEditorPanel.js';
|
|
11
|
+
import { TriggerStartPanel } from './TriggerStartPanel.js';
|
|
12
|
+
import { FieldOptionsScopeProvider } from './field-options.js';
|
|
11
13
|
/** A new filter starts as one empty condition inside an "all" group. */
|
|
12
14
|
function newFilterCondition() {
|
|
13
15
|
return { all: [{ variable: '', operator: ConditionOperator.EQ, value: '' }] };
|
|
14
16
|
}
|
|
15
17
|
const sectionHeading = 'mb-1 text-[10px] font-bold uppercase tracking-widest text-slate-400';
|
|
16
|
-
|
|
18
|
+
/**
|
|
19
|
+
* The trigger's config panel. Keyed by trigger type, so choosing another trigger starts a fresh
|
|
20
|
+
* form: the form holds its values in state, and without the key a field both triggers have (such
|
|
21
|
+
* as `actions`) would carry the old trigger's selections into the new trigger's config.
|
|
22
|
+
*/
|
|
23
|
+
export function TriggerConfigPanel(props) {
|
|
24
|
+
return _jsx(TriggerConfigForm, { ...props }, props.triggerType);
|
|
25
|
+
}
|
|
26
|
+
function TriggerConfigForm({ triggerType, triggerConfig, triggerMeta, issues, onUpdateConfig, onRequestChangeTrigger, readOnly, workflowConfig, filter, onUpdateFilter, start, onUpdateStart, workflowId, }) {
|
|
17
27
|
const { fields, values, errors, setFieldValue, descriptor, isLoading } = useTriggerConfig({
|
|
18
28
|
triggerType,
|
|
19
29
|
initialValues: triggerConfig,
|
|
@@ -25,11 +35,13 @@ export function TriggerConfigPanel({ triggerType, triggerConfig, triggerMeta, is
|
|
|
25
35
|
// Only webhook ingest and event dispatch consult the filter; a manual or cron
|
|
26
36
|
// run is started on purpose and never checks it, so offering one there would mislead.
|
|
27
37
|
const supportsFilter = isWebhook || descriptor?.category === TriggerCategory.EVENT;
|
|
28
|
-
return (_jsxs("div", { className: "flex h-full flex-col", children: [_jsxs("div", { className: "border-b border-slate-100 px-5 py-4", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-indigo-50 text-indigo-600", children: getTriggerIcon(currentTrigger?.icon, { size: 18 }) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "truncate text-sm font-semibold text-slate-800", children: descriptor?.name ?? currentTrigger?.name ?? triggerType }), _jsx("div", { className: "text-[10px] text-indigo-500 uppercase tracking-wider font-medium mt-0.5", children: "Trigger" })] })] }), !readOnly && (_jsxs("button", { onClick: onRequestChangeTrigger, className: "mt-3 flex w-full items-center justify-center gap-1.5 rounded-lg border border-slate-200 px-3 py-1.5 text-[11px] font-medium text-slate-500 hover:bg-slate-50 hover:border-slate-300 transition-all", children: [_jsxs("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), _jsx("path", { d: "M3 3v5h5" }), _jsx("path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16" }), _jsx("path", { d: "M16 16h5v5" })] }), "Change trigger"] }))] }), _jsxs("div", { className: "flex-1 space-y-6 overflow-y-auto px-5 py-4", children: [issues && issues.length > 0 && (_jsx("div", { className: "rounded-lg border border-red-200 bg-red-50 p-3", "data-testid": "trigger-issues", children: _jsx("ul", { className: "space-y-0.5 text-[12px] text-red-700", children: issues.map((iss, i) => (_jsxs("li", { children: [iss.location?.field && _jsxs("span", { className: "font-mono text-[11px] text-red-500", children: [iss.location.field, ": "] }), iss.message] }, i))) }) })), isLoading ? (_jsx("div", { className: "flex justify-center py-12", children: _jsx(LoadingSpinner, { size: "md" }) })) : fields.length > 0 ? (_jsxs("div", { children: [_jsx("h4", { className:
|
|
38
|
+
return (_jsxs("div", { className: "flex h-full flex-col", children: [_jsxs("div", { className: "border-b border-slate-100 px-5 py-4", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-indigo-50 text-indigo-600", children: getTriggerIcon(currentTrigger?.icon, { size: 18 }) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "truncate text-sm font-semibold text-slate-800", children: descriptor?.name ?? currentTrigger?.name ?? triggerType }), _jsx("div", { className: "text-[10px] text-indigo-500 uppercase tracking-wider font-medium mt-0.5", children: "Trigger" })] })] }), !readOnly && (_jsxs("button", { onClick: onRequestChangeTrigger, className: "mt-3 flex w-full items-center justify-center gap-1.5 rounded-lg border border-slate-200 px-3 py-1.5 text-[11px] font-medium text-slate-500 hover:bg-slate-50 hover:border-slate-300 transition-all", children: [_jsxs("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), _jsx("path", { d: "M3 3v5h5" }), _jsx("path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16" }), _jsx("path", { d: "M16 16h5v5" })] }), "Change trigger"] }))] }), _jsxs("div", { className: "flex-1 space-y-6 overflow-y-auto px-5 py-4", children: [issues && issues.length > 0 && (_jsx("div", { className: "rounded-lg border border-red-200 bg-red-50 p-3", "data-testid": "trigger-issues", children: _jsx("ul", { className: "space-y-0.5 text-[12px] text-red-700", children: issues.map((iss, i) => (_jsxs("li", { children: [iss.location?.field && _jsxs("span", { className: "font-mono text-[11px] text-red-500", children: [iss.location.field, ": "] }), iss.message] }, i))) }) })), isLoading ? (_jsx("div", { className: "flex justify-center py-12", children: _jsx(LoadingSpinner, { size: "md" }) })) : fields.length > 0 ? (_jsxs("div", { children: [_jsx("h4", { className: sectionHeading, children: "Watch" }), _jsx("p", { className: "mb-3 text-[11px] text-slate-400", children: "Which events this workflow follows. Checked as soon as an event arrives." }), _jsx(FieldOptionsScopeProvider, { scope: { kind: 'triggers', type: triggerType, workflowId }, children: _jsx(SchemaFormRenderer, { fields: fields, values: values, errors: mergedErrors, onChange: (path, value) => setFieldValue(path, value), readOnly: readOnly }) })] })) : (_jsxs("div", { className: "flex flex-col items-center py-12 text-center", children: [_jsx("div", { className: "mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-indigo-50 ring-1 ring-indigo-100", children: _jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", className: "text-indigo-300", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("polygon", { points: "13 2 3 14 12 14 11 22 21 10 12 10 13 2" }) }) }), _jsx("p", { className: "text-[13px] font-medium text-slate-400", children: "No configuration needed" }), _jsx("p", { className: "mt-1 text-[11px] text-slate-300", children: "This trigger works with default settings" })] })), !isLoading && supportsFilter && (_jsx(TriggerStartPanel, { start: start, onChange: onUpdateStart, workflowConfig: workflowConfig, readOnly: readOnly, error: mergedErrors['start'] })), !isLoading && supportsFilter && (_jsx(TriggerFilterSection, { filter: filter, onUpdateFilter: onUpdateFilter, workflowConfig: workflowConfig, readOnly: readOnly, error: mergedErrors['filter'], delayed: isDelayedStart(start) })), !isLoading && isWebhook && _jsx(WebhookEndpointSection, { workflowId: workflowId })] })] }));
|
|
29
39
|
}
|
|
30
|
-
function TriggerFilterSection({ filter, onUpdateFilter, workflowConfig, readOnly, error, }) {
|
|
40
|
+
function TriggerFilterSection({ filter, onUpdateFilter, workflowConfig, readOnly, error, delayed, }) {
|
|
31
41
|
const conditions = filter?.conditions;
|
|
32
|
-
return (_jsxs("section", { "aria-label": "
|
|
42
|
+
return (_jsxs("section", { "aria-label": "Only run if", children: [_jsx("h4", { className: sectionHeading, children: "Only run if" }), _jsx("p", { className: "mb-3 text-[11px] text-slate-400", children: delayed
|
|
43
|
+
? 'Checked when the run starts, not when the event arrives — so this reads the world as it is by then. A run that no longer matches is skipped, and says why.'
|
|
44
|
+
: 'Start a run only for events that match. Events that don’t match are ignored.' }), conditions ? (_jsxs("div", { className: "space-y-2", children: [_jsx(ConditionEditorPanel, { condition: conditions, onChange: (c) => onUpdateFilter({ conditions: c }), config: workflowConfig, atStepId: TRIGGER_FILTER_SCOPE, readOnly: readOnly }), !readOnly && (_jsx("button", { type: "button", onClick: () => onUpdateFilter(undefined), className: "text-[11px] font-medium text-slate-500 transition-colors hover:text-red-600", children: "Remove conditions" }))] })) : readOnly ? (_jsx("p", { className: "text-[12px] text-slate-500", children: delayed ? 'No conditions. The run acts whenever it wakes.' : 'No conditions. Every event starts a run.' })) : (_jsx("button", { type: "button", onClick: () => onUpdateFilter({ conditions: newFilterCondition() }), className: "flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-slate-300 px-3 py-2 text-[12px] font-medium text-slate-500 transition-colors hover:border-slate-400 hover:bg-slate-50", children: "Add condition" })), error && (_jsx("p", { role: "alert", className: "mt-2 text-[11px] text-red-600", children: error }))] }));
|
|
33
45
|
}
|
|
34
46
|
function WebhookEndpointSection({ workflowId }) {
|
|
35
47
|
const [copied, setCopied] = useState(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerConfigPanel.js","sourceRoot":"","sources":["../../../../src/components/builder/v3/TriggerConfigPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TriggerConfigPanel.js","sourceRoot":"","sources":["../../../../src/components/builder/v3/TriggerConfigPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQ1C,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACrG,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO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ACN,EACP,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,EAC/B,SAAS,EAAC,6HAA6H,YAEtI,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,GACpB,IACL,IACF,CACP,CAAC,CAAC,CAAC,CACF,YAAG,SAAS,EAAC,4BAA4B,iDAAqC,CAC/E,IACO,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerPicker.d.ts","sourceRoot":"","sources":["../../../../src/components/builder/v3/TriggerPicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TriggerPicker.d.ts","sourceRoot":"","sources":["../../../../src/components/builder/v3/TriggerPicker.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,kBAAkB,sCAsE5E"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { useCallback, useEffect, useId, useState } from 'react';
|
|
3
3
|
import { useWorkflowClient } from '../../../hooks/use-workflow-client.js';
|
|
4
|
-
import {
|
|
5
|
-
import { getTriggerIcon } from '../icons.js';
|
|
4
|
+
import { ConnectorCatalog } from './ConnectorCatalog.js';
|
|
6
5
|
export function TriggerPicker({ open, onSelect, onClose }) {
|
|
7
6
|
const client = useWorkflowClient();
|
|
7
|
+
const titleId = useId();
|
|
8
8
|
const [triggers, setTriggers] = useState([]);
|
|
9
9
|
useEffect(() => {
|
|
10
10
|
if (!open)
|
|
@@ -32,12 +32,12 @@ export function TriggerPicker({ open, onSelect, onClose }) {
|
|
|
32
32
|
document.addEventListener('keydown', handleKeyDown);
|
|
33
33
|
return () => document.removeEventListener('keydown', handleKeyDown);
|
|
34
34
|
}, [open, onClose]);
|
|
35
|
-
const handleSelect = useCallback((
|
|
36
|
-
onSelect(type);
|
|
35
|
+
const handleSelect = useCallback((trigger) => {
|
|
36
|
+
onSelect(trigger.type);
|
|
37
37
|
onClose();
|
|
38
38
|
}, [onSelect, onClose]);
|
|
39
39
|
if (!open)
|
|
40
40
|
return null;
|
|
41
|
-
return (_jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center", onMouseDown: onClose, children: [_jsx("div", { className: "absolute inset-0 bg-
|
|
41
|
+
return (_jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", onMouseDown: onClose, children: [_jsx("div", { className: "absolute inset-0 bg-black/40 backdrop-blur-[2px]" }), _jsxs("div", { role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, className: "relative flex h-[560px] max-h-[calc(100vh_-_2rem)] w-full max-w-md flex-col overflow-hidden rounded-[var(--wui-radius-lg)] border border-[var(--wui-border)] bg-[var(--wui-surface)] shadow-[var(--wui-shadow-lg)] animate-[wui-scale-in_180ms_ease-out]", onMouseDown: (e) => e.stopPropagation(), children: [_jsxs("div", { className: "flex shrink-0 items-center justify-between border-b border-[var(--wui-border)] px-5 py-4", children: [_jsxs("div", { children: [_jsx("h2", { id: titleId, className: "text-[15px] font-semibold text-[var(--wui-fg)]", children: "Select Trigger" }), _jsx("p", { className: "mt-0.5 text-xs text-[var(--wui-fg-muted)]", children: "Choose what starts your workflow" })] }), _jsx("button", { type: "button", onClick: onClose, "aria-label": "Close", className: "flex h-7 w-7 items-center justify-center rounded-[var(--wui-radius-sm)] text-[var(--wui-fg-muted)] transition-colors hover:bg-[var(--wui-bg-muted)] hover:text-[var(--wui-fg)]", children: _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", children: [_jsx("path", { d: "M18 6 6 18" }), _jsx("path", { d: "m6 6 12 12" })] }) })] }), _jsx(ConnectorCatalog, { className: "flex-1", items: triggers, noun: "trigger", onSelect: handleSelect, autoFocus: true })] })] }));
|
|
42
42
|
}
|
|
43
43
|
//# sourceMappingURL=TriggerPicker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerPicker.js","sourceRoot":"","sources":["../../../../src/components/builder/v3/TriggerPicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TriggerPicker.js","sourceRoot":"","sources":["../../../../src/components/builder/v3/TriggerPicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAQzD,MAAM,UAAU,aAAa,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAsB;IAC3E,MAAM,MAAM,GAAG,iBAAiB,EAAE,CAAC;IACnC,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;IACxB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAmB,EAAE,CAAC,CAAC;IAE/D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,IAAI;YAAE,OAAO;QAClB,IAAI,SAAS,GAAG,KAAK,CAAC;QACtB,KAAK,CAAC,KAAK,IAAI,EAAE;YACf,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;gBAC9C,IAAI,CAA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AAC,eAAe,EAAE,aAEvC,eAAK,SAAS,EAAC,0FAA0F,aACvG,0BACE,aAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAC,gDAAgD,+BAAoB,EAC/F,YAAG,SAAS,EAAC,2CAA2C,iDAAqC,IACzF,EACN,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,OAAO,gBACL,OAAO,EAClB,SAAS,EAAC,gLAAgL,YAE1L,eAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,WAAW,EAAC,GAAG,EAAC,aAAa,EAAC,OAAO,aACrH,eAAM,CAAC,EAAC,YAAY,GAAG,EAAA,eAAM,CAAC,EAAC,YAAY,GAAG,IAC1C,GACC,IACL,EAEN,KAAC,gBAAgB,IAAC,SAAS,EAAC,QAAQ,EAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAC,SAAS,EAAC,QAAQ,EAAE,YAAY,EAAE,SAAS,SAAG,IACrG,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Duration, TriggerStart, WorkflowConfig } from '@xyne/workflow-sdk/builder';
|
|
2
|
+
/**
|
|
3
|
+
* When a matching event becomes a run.
|
|
4
|
+
*
|
|
5
|
+
* Rendered rather than generated: `start` is one fixed shape for every trigger,
|
|
6
|
+
* not a connector-defined config, so there is no schema to drive a form from —
|
|
7
|
+
* the same reason the condition editor beside it is hand-written. What the editor
|
|
8
|
+
* does NOT do is retype the contract: the type, the units and the cap all come
|
|
9
|
+
* from the engine, so a new unit or a changed limit arrives with the next build.
|
|
10
|
+
*
|
|
11
|
+
* The form is flat and the config is a discriminated union, so the two mapping
|
|
12
|
+
* functions below are the only place that knows how one becomes the other —
|
|
13
|
+
* including dropping the fields a shape does not carry, so switching modes can
|
|
14
|
+
* never leave a stale `ifPast` on a plain delay.
|
|
15
|
+
*/
|
|
16
|
+
export interface TriggerStartPanelProps {
|
|
17
|
+
start: TriggerStart | undefined;
|
|
18
|
+
onChange: (start: TriggerStart | undefined) => void;
|
|
19
|
+
/** The trigger's output feeds the anchor picker. */
|
|
20
|
+
workflowConfig: WorkflowConfig;
|
|
21
|
+
readOnly: boolean;
|
|
22
|
+
/** The saved workflow's validation message for this section, if any. */
|
|
23
|
+
error?: string | undefined;
|
|
24
|
+
}
|
|
25
|
+
type Mode = 'immediate' | 'delay';
|
|
26
|
+
type AnchorKind = 'event' | 'field';
|
|
27
|
+
export interface StartForm {
|
|
28
|
+
mode: Mode;
|
|
29
|
+
amount: number;
|
|
30
|
+
unit: Duration['unit'];
|
|
31
|
+
anchorKind: AnchorKind;
|
|
32
|
+
/** Only meaningful when anchored on a field — an event has already happened. */
|
|
33
|
+
direction: 'before' | 'after';
|
|
34
|
+
anchor: string;
|
|
35
|
+
ifPast: 'run' | 'skip';
|
|
36
|
+
}
|
|
37
|
+
/** Config → form, filling in defaults for the fields a given shape doesn't carry. */
|
|
38
|
+
export declare function fromTriggerStart(start: TriggerStart | undefined): StartForm;
|
|
39
|
+
/**
|
|
40
|
+
* Form → config. Returns `undefined` for an immediate start so an ordinary
|
|
41
|
+
* binding stays free of a field that says "no delay".
|
|
42
|
+
*/
|
|
43
|
+
export declare function toTriggerStart(form: StartForm): TriggerStart | undefined;
|
|
44
|
+
/** What the author would be told at save time, said now instead. */
|
|
45
|
+
export declare function startFormError(form: StartForm): string | null;
|
|
46
|
+
export declare function TriggerStartPanel({ start, onChange, workflowConfig, readOnly, error, }: TriggerStartPanelProps): import("react").JSX.Element;
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=TriggerStartPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TriggerStartPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/builder/v3/TriggerStartPanel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,Q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