@emporix/process-diagram 1.0.9 → 1.0.11
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/ProcessDiagram.d.ts +1 -1
- package/dist/components/ProcessDiagram.d.ts.map +1 -1
- package/dist/components/common/icons/ConditionIcon.d.ts +9 -0
- package/dist/components/common/icons/ConditionIcon.d.ts.map +1 -0
- package/dist/components/common/icons/IteratorIcon.d.ts +3 -0
- package/dist/components/common/icons/IteratorIcon.d.ts.map +1 -0
- package/dist/components/common/icons/LoopIcon.d.ts +8 -0
- package/dist/components/common/icons/LoopIcon.d.ts.map +1 -0
- package/dist/components/common/menuTemplate.d.ts +1 -1
- package/dist/components/if-statement/IfStatement.d.ts +8 -0
- package/dist/components/if-statement/IfStatement.d.ts.map +1 -0
- package/dist/components/iterator/Iterator.d.ts +17 -0
- package/dist/components/iterator/Iterator.d.ts.map +1 -0
- package/dist/components/iterator/LoopBoxIcon.d.ts +8 -0
- package/dist/components/iterator/LoopBoxIcon.d.ts.map +1 -0
- package/dist/components/{Menu → menu}/Menu.d.ts.map +1 -1
- package/dist/components/menu/Separator.d.ts.map +1 -0
- package/dist/components/{Menu → menu}/index.d.ts.map +1 -1
- package/dist/components/step/Step.d.ts +1 -1
- package/dist/components/steps/Steps.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +10 -0
- package/dist/components/tooltip/Tooltip.d.ts.map +1 -0
- package/dist/context/MenuProvider.context.d.ts +1 -1
- package/dist/helpers/add-process.helpers.d.ts +30 -0
- package/dist/helpers/add-process.helpers.d.ts.map +1 -0
- package/dist/helpers/processUpdate.helpers.d.ts +12 -0
- package/dist/helpers/processUpdate.helpers.d.ts.map +1 -0
- package/dist/helpers/stepDescendants.helpers.d.ts +13 -0
- package/dist/helpers/stepDescendants.helpers.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +123 -121
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +28 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/Condition.d.ts +0 -6
- package/dist/Condition.d.ts.map +0 -1
- package/dist/Curve.d.ts +0 -6
- package/dist/Curve.d.ts.map +0 -1
- package/dist/Item.d.ts +0 -7
- package/dist/Item.d.ts.map +0 -1
- package/dist/Row.d.ts +0 -6
- package/dist/Row.d.ts.map +0 -1
- package/dist/Steps.d.ts +0 -13
- package/dist/Steps.d.ts.map +0 -1
- package/dist/components/Menu/Separator.d.ts.map +0 -1
- /package/dist/components/{Menu → menu}/Menu.d.ts +0 -0
- /package/dist/components/{Menu → menu}/Separator.d.ts +0 -0
- /package/dist/components/{Menu → menu}/index.d.ts +0 -0
|
@@ -10,6 +10,6 @@ interface ProcessDiagramProps {
|
|
|
10
10
|
addMultipleTriggers: () => unknown;
|
|
11
11
|
onSelectStep: (id: string) => unknown;
|
|
12
12
|
}
|
|
13
|
-
declare const ProcessDiagram: ({ process, addMultipleTriggers, onAddStep, onEditTrigger, onDeleteTrigger, onDeleteStep, onUpdateFilter, onSelectStep, }: Readonly<ProcessDiagramProps>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const ProcessDiagram: ({ process, addMultipleTriggers, onAddStep, onEditTrigger, onDeleteTrigger, onDeleteStep, onUpdateFilter, onSelectStep, onAddTrigger, }: Readonly<ProcessDiagramProps>) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export default ProcessDiagram;
|
|
15
15
|
//# sourceMappingURL=ProcessDiagram.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProcessDiagram.d.ts","sourceRoot":"","sources":["../../src/components/ProcessDiagram.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAGvC,UAAU,mBAAmB;IAC3B,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAA;IACxC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAA;IACrC,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACtC,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACxC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACrC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACvC,mBAAmB,EAAE,MAAM,OAAO,CAAA;IAClC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;CACtC;AAED,QAAA,MAAM,cAAc,GAAI,
|
|
1
|
+
{"version":3,"file":"ProcessDiagram.d.ts","sourceRoot":"","sources":["../../src/components/ProcessDiagram.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAGvC,UAAU,mBAAmB;IAC3B,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAA;IACxC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAA;IACrC,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACtC,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACxC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACrC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACvC,mBAAmB,EAAE,MAAM,OAAO,CAAA;IAClC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;CACtC;AAED,QAAA,MAAM,cAAc,GAAI,wIAUrB,QAAQ,CAAC,mBAAmB,CAAC,4CAwB/B,CAAA;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConditionIcon.d.ts","sourceRoot":"","sources":["../../../../src/components/common/icons/ConditionIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,UAAU,kBAAkB;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA6B/C,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IteratorIcon.d.ts","sourceRoot":"","sources":["../../../../src/components/common/icons/IteratorIcon.tsx"],"names":[],"mappings":"AAAA,QAAA,MAAM,YAAY,+CAqBjB,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoopIcon.d.ts","sourceRoot":"","sources":["../../../../src/components/common/icons/LoopIcon.tsx"],"names":[],"mappings":"AAAA,UAAU,aAAa;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,QAAA,MAAM,QAAQ,GAAI,2BAIf,aAAa,4CAmBf,CAAA;AAED,eAAe,QAAQ,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { MenuItem } from '../
|
|
2
|
+
import type { MenuItem } from '../menu';
|
|
3
3
|
export declare const createMenuTemplate: () => (item: MenuItem, options: {
|
|
4
4
|
onClick: (e: React.MouseEvent) => void;
|
|
5
5
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface IfStatementProps {
|
|
2
|
+
onEdit?: () => void;
|
|
3
|
+
onDelete?: () => void;
|
|
4
|
+
onSelect?: () => void;
|
|
5
|
+
}
|
|
6
|
+
declare const IfStatement: ({ onEdit, onDelete, onSelect, }: Readonly<IfStatementProps>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default IfStatement;
|
|
8
|
+
//# sourceMappingURL=IfStatement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IfStatement.d.ts","sourceRoot":"","sources":["../../../src/components/if-statement/IfStatement.tsx"],"names":[],"mappings":"AASA,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB;AAED,QAAA,MAAM,WAAW,GAAI,iCAIlB,QAAQ,CAAC,gBAAgB,CAAC,4CA6D5B,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Iterator as IteratorType } from '../../types';
|
|
2
|
+
import type { AddStepOperation, AddStepType } from '../../helpers/add-process.helpers';
|
|
3
|
+
export interface IteratorProps {
|
|
4
|
+
/** Iterator data: must include localId; limit is optional. */
|
|
5
|
+
value: Pick<IteratorType, 'localId'> & Partial<Pick<IteratorType, 'limit' | 'steps' | 'condition'>>;
|
|
6
|
+
onAddStep?: (id?: string, pathId?: string, operation?: AddStepOperation) => void;
|
|
7
|
+
onAddTrigger?: (id?: string, pathId?: string, operation?: AddStepType) => void;
|
|
8
|
+
onAddCondition?: (stepId?: string, pathId?: string, operation?: AddStepOperation) => void;
|
|
9
|
+
onAddLoop?: (stepId?: string, pathId?: string, operation?: AddStepOperation) => void;
|
|
10
|
+
onDeleteStep?: (id: string) => void;
|
|
11
|
+
onUpdateFilter?: (id: string) => void;
|
|
12
|
+
onSelectStep?: (id: string) => void;
|
|
13
|
+
onResize?: () => void;
|
|
14
|
+
}
|
|
15
|
+
declare const IteratorComponent: ({ value, onAddStep, onAddTrigger, onAddCondition, onAddLoop, onDeleteStep, onUpdateFilter, onSelectStep, onResize, }: Readonly<IteratorProps>) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default IteratorComponent;
|
|
17
|
+
//# sourceMappingURL=Iterator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Iterator.d.ts","sourceRoot":"","sources":["../../../src/components/iterator/Iterator.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,mCAAmC,CAAA;AAG1C,MAAM,WAAW,aAAa;IAC5B,8DAA8D;IAC9D,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,GAClC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,OAAO,GAAG,WAAW,CAAC,CAAC,CAAA;IAC9D,SAAS,CAAC,EAAE,CACV,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IAC9E,cAAc,CAAC,EAAE,CACf,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,SAAS,CAAC,EAAE,CACV,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB;AAED,QAAA,MAAM,iBAAiB,GAAI,sHAUxB,QAAQ,CAAC,aAAa,CAAC,4CAkGzB,CAAA;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface LoopBoxIconProps {
|
|
2
|
+
width?: number;
|
|
3
|
+
height?: number;
|
|
4
|
+
color?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const LoopBoxIcon: ({ width, height, color, }: LoopBoxIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default LoopBoxIcon;
|
|
8
|
+
//# sourceMappingURL=LoopBoxIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoopBoxIcon.d.ts","sourceRoot":"","sources":["../../../src/components/iterator/LoopBoxIcon.tsx"],"names":[],"mappings":"AAAA,UAAU,gBAAgB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,QAAA,MAAM,WAAW,GAAI,2BAIlB,gBAAgB,4CAmBlB,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/components/
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/components/menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAItD,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,cAAc,CAAC;QAAC,IAAI,EAAE,QAAQ,CAAA;KAAE,KAAK,IAAI,CAAA;IAC9E,QAAQ,CAAC,EAAE,CACT,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE;QAAE,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAA;KAAE,KAChD,SAAS,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI,CAAA;IAC3C,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI,CAAA;IAC5C,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI,CAAA;CAC9C;AAED,UAAU,SAAS;IACjB,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAA;CACxC;AAkBD,QAAA,MAAM,IAAI,2EAoIR,CAAA;AAEF,eAAe,IAAI,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Separator.d.ts","sourceRoot":"","sources":["../../../src/components/menu/Separator.tsx"],"names":[],"mappings":"AAEA,QAAA,MAAM,SAAS,+CAWd,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAA;AACxC,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { PropsWithClassName } from '../../helpers/props';
|
|
3
|
-
import { type MenuItem } from '../
|
|
3
|
+
import { type MenuItem } from '../menu';
|
|
4
4
|
export interface Props extends PropsWithClassName {
|
|
5
5
|
idx: number;
|
|
6
6
|
isSet?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../../../src/components/steps/Steps.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAE7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../../../src/components/steps/Steps.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAE7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAEvC,UAAU,KAAM,SAAQ,kBAAkB;IACxC,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CACnC;AAED,QAAA,MAAM,KAAK,GAAI,qGASZ,QAAQ,CAAC,KAAK,CAAC,4CAqGjB,CAAA;AAED,eAAe,KAAK,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
type TooltipProps = Readonly<{
|
|
3
|
+
content: ReactNode;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
maxWidth?: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
}>;
|
|
8
|
+
declare const Tooltip: ({ content, children, maxWidth, className, }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default Tooltip;
|
|
10
|
+
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,KAAK,YAAY,GAAG,QAAQ,CAAC;IAC3B,OAAO,EAAE,SAAS,CAAA;IAClB,QAAQ,EAAE,SAAS,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC,CAAA;AAEF,QAAA,MAAM,OAAO,GAAI,6CAKd,YAAY,4CAcd,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
-
import type { MenuRef } from '../components/
|
|
3
|
+
import type { MenuRef } from '../components/menu';
|
|
4
4
|
interface MenuProviderContextType {
|
|
5
5
|
openMenus: React.RefObject<MenuRef | null>[];
|
|
6
6
|
openMenu: (menuRef: React.RefObject<MenuRef | null>, event: React.SyntheticEvent) => void;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Path, Process, Step } from '../types';
|
|
2
|
+
export type AddStepOperation = 'prepend' | 'append';
|
|
3
|
+
export type AddStepType = 'step' | 'trigger';
|
|
4
|
+
export declare class AddStepError extends Error {
|
|
5
|
+
constructor(message: string);
|
|
6
|
+
}
|
|
7
|
+
export declare const isPath: (node: Step | Path) => node is Path;
|
|
8
|
+
export declare const insertAt: <T>(arr: readonly T[], index: number, item: T, operation: AddStepOperation) => T[];
|
|
9
|
+
/**
|
|
10
|
+
* Tries to insert newStep into a steps array; returns new array if stepId found, else null.
|
|
11
|
+
*/
|
|
12
|
+
export declare const insertInSteps: (steps: readonly Step[], stepId: string, operation: AddStepOperation, newStep: Step) => Step[] | null;
|
|
13
|
+
export declare const addStepToPathSteps: (path: Path, operation: AddStepOperation, newStep: Step) => Path;
|
|
14
|
+
/**
|
|
15
|
+
* Tries to insert newStep into a paths array; returns new array if path/step id found, else null.
|
|
16
|
+
* When the target is a Path, adds newStep into that path's steps array (supports empty path).
|
|
17
|
+
* When the target is a Step (in paths array), inserts newStep as sibling in paths array.
|
|
18
|
+
*/
|
|
19
|
+
export declare const insertInPaths: (paths: readonly Path[], stepId: string, operation: AddStepOperation, newStep: Step) => Path[] | null;
|
|
20
|
+
/**
|
|
21
|
+
* Adds a step to the process diagram relative to an existing step/path by id.
|
|
22
|
+
*
|
|
23
|
+
* @param process - The current process
|
|
24
|
+
* @param stepId - Id of the step or path to prepend/append relative to
|
|
25
|
+
* @param operation - 'prepend' (before) or 'append' (after)
|
|
26
|
+
* @param newStep - The step to add
|
|
27
|
+
* @returns The new process, or throws AddStepError if stepId is not found
|
|
28
|
+
*/
|
|
29
|
+
export declare const addStep: (process: Process, stepId: string, operation: AddStepOperation, newStep: Step) => Process;
|
|
30
|
+
//# sourceMappingURL=add-process.helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-process.helpers.d.ts","sourceRoot":"","sources":["../../src/helpers/add-process.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEnD,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,CAAA;AACnD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,CAAA;AAE5C,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,EAAE,MAAM;CAI5B;AAED,eAAO,MAAM,MAAM,GAAI,MAAM,IAAI,GAAG,IAAI,KAAG,IAAI,IAAI,IACQ,CAAA;AAE3D,eAAO,MAAM,QAAQ,GAAI,CAAC,EACxB,KAAK,SAAS,CAAC,EAAE,EACjB,OAAO,MAAM,EACb,MAAM,CAAC,EACP,WAAW,gBAAgB,KAC1B,CAAC,EAGH,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,SAAS,IAAI,EAAE,EACtB,QAAQ,MAAM,EACd,WAAW,gBAAgB,EAC3B,SAAS,IAAI,KACZ,IAAI,EAAE,GAAG,IAwBX,CAAA;AAED,eAAO,MAAM,kBAAkB,GAC7B,MAAM,IAAI,EACV,WAAW,gBAAgB,EAC3B,SAAS,IAAI,KACZ,IAKF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,SAAS,IAAI,EAAE,EACtB,QAAQ,MAAM,EACd,WAAW,gBAAgB,EAC3B,SAAS,IAAI,KACZ,IAAI,EAAE,GAAG,IA+BX,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,OAAO,GAClB,SAAS,OAAO,EAChB,QAAQ,MAAM,EACd,WAAW,gBAAgB,EAC3B,SAAS,IAAI,KACZ,OAMF,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Process, Step, Trigger } from '../types';
|
|
2
|
+
export declare const DEFAULT_EMPTY_CONDITION = "";
|
|
3
|
+
export declare const clearSelection: (process: Process) => Process;
|
|
4
|
+
export declare const setStepSelection: (process: Process, selectedId: string, previousId: string | null) => Process;
|
|
5
|
+
export declare const deleteTrigger: (process: Process, id: string) => Process;
|
|
6
|
+
export declare const deleteStep: (process: Process, id: string) => Process;
|
|
7
|
+
export declare const updateStepFilter: (process: Process, id: string) => Process;
|
|
8
|
+
export declare const addTriggerAt: (process: Process, index: number, trigger: Trigger) => Process;
|
|
9
|
+
export declare const appendTrigger: (process: Process, trigger: Trigger) => Process;
|
|
10
|
+
export declare const insertStepAt: (process: Process, index: number, step: Step) => Process;
|
|
11
|
+
export declare const addCondition: (process: Process, stepId: string) => Process;
|
|
12
|
+
//# sourceMappingURL=processUpdate.helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processUpdate.helpers.d.ts","sourceRoot":"","sources":["../../src/helpers/processUpdate.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAE5D,eAAO,MAAM,uBAAuB,KAAK,CAAA;AAuCzC,eAAO,MAAM,cAAc,GAAI,SAAS,OAAO,KAAG,OAIhD,CAAA;AAgBF,eAAO,MAAM,gBAAgB,GAC3B,SAAS,OAAO,EAChB,YAAY,MAAM,EAClB,YAAY,MAAM,GAAG,IAAI,KACxB,OAMD,CAAA;AAEF,eAAO,MAAM,aAAa,GAAI,SAAS,OAAO,EAAE,IAAI,MAAM,KAAG,OAG3D,CAAA;AAqBF,eAAO,MAAM,UAAU,GAAI,SAAS,OAAO,EAAE,IAAI,MAAM,KAAG,OAMzD,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,SAAS,OAAO,EAAE,IAAI,MAAM,KAAG,OAG9D,CAAA;AAEF,eAAO,MAAM,YAAY,GACvB,SAAS,OAAO,EAChB,OAAO,MAAM,EACb,SAAS,OAAO,KACf,OAOD,CAAA;AAEF,eAAO,MAAM,aAAa,GAAI,SAAS,OAAO,EAAE,SAAS,OAAO,KAAG,OAGjE,CAAA;AAEF,eAAO,MAAM,YAAY,GACvB,SAAS,OAAO,EAChB,OAAO,MAAM,EACb,MAAM,IAAI,KACT,OAOD,CAAA;AAkCF,eAAO,MAAM,YAAY,GAAI,SAAS,OAAO,EAAE,QAAQ,MAAM,KAAG,OAc/D,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Step } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Recursively counts all descendants of a step
|
|
4
|
+
* - For all leaves: count all direct children
|
|
5
|
+
* - For 2-level nesting: count leaf direct children + grandchildren
|
|
6
|
+
* - For 3+ level deep nesting: count only first-level grandchildren
|
|
7
|
+
*/
|
|
8
|
+
export declare const countDescendants: (step: Step) => number;
|
|
9
|
+
/**
|
|
10
|
+
* Finds a step by title and calculates the number of its descendants
|
|
11
|
+
*/
|
|
12
|
+
export declare const getDescendantCount: (title: string, steps: Step[]) => number;
|
|
13
|
+
//# sourceMappingURL=stepDescendants.helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepDescendants.helpers.d.ts","sourceRoot":"","sources":["../../src/helpers/stepDescendants.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,IAAI,KAAG,MAoF7C,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,EAAE,OAAO,IAAI,EAAE,KAAG,MAejE,CAAA"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),ie=require("react-dom"),se="_container_ww84z_1",re="_step_ww84z_7",oe="_selected_ww84z_22",le="_selectedInvalid_ww84z_28",ce="_isSet_ww84z_34",ae="_invalid_ww84z_38",de="_filterFlag_ww84z_44",ue="_title_ww84z_70",pe="_icon_ww84z_87",he="_content_ww84z_105",me="_dotsButton_ww84z_111",x={container:se,step:re,selected:oe,selectedInvalid:le,isSet:ce,invalid:ae,filterFlag:de,title:ue,icon:pe,content:he,dotsButton:me};var X={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},V=r.createContext&&r.createContext(X),ge=["attr","size","title"];function Ce(t,i){if(t==null)return{};var n=fe(t,i),s,c;if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(t);for(c=0;c<g.length;c++)s=g[c],!(i.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(t,s)&&(n[s]=t[s])}return n}function fe(t,i){if(t==null)return{};var n={};for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)){if(i.indexOf(s)>=0)continue;n[s]=t[s]}return n}function H(){return H=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},H.apply(this,arguments)}function Z(t,i){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);i&&(s=s.filter(function(c){return Object.getOwnPropertyDescriptor(t,c).enumerable})),n.push.apply(n,s)}return n}function $(t){for(var i=1;i<arguments.length;i++){var n=arguments[i]!=null?arguments[i]:{};i%2?Z(Object(n),!0).forEach(function(s){xe(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}function xe(t,i,n){return i=ve(i),i in t?Object.defineProperty(t,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[i]=n,t}function ve(t){var i=_e(t,"string");return typeof i=="symbol"?i:i+""}function _e(t,i){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var s=n.call(t,i);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(t)}function K(t){return t&&t.map((i,n)=>r.createElement(i.tag,$({key:n},i.attr),K(i.child)))}function O(t){return i=>r.createElement(je,H({attr:$({},t.attr)},i),K(t.child))}function je(t){var i=n=>{var{attr:s,size:c,title:g}=t,u=Ce(t,ge),d=c||n.size||"1em",h;return n.className&&(h=n.className),t.className&&(h=(h?h+" ":"")+t.className),r.createElement("svg",H({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,s,u,{className:h,style:$($({color:t.color||n.color},n.style),t.style),height:d,width:d,xmlns:"http://www.w3.org/2000/svg"}),g&&r.createElement("title",null,g),t.children)};return V!==void 0?r.createElement(V.Consumer,null,n=>i(n)):i(X)}function we(t){return O({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.52.359A.5.5 0 0 1 6 0h4a.5.5 0 0 1 .474.658L8.694 6H12.5a.5.5 0 0 1 .395.807l-7 9a.5.5 0 0 1-.873-.454L6.823 9.5H3.5a.5.5 0 0 1-.48-.641zM6.374 1 4.168 8.5H7.5a.5.5 0 0 1 .478.647L6.78 13.04 11.478 7H8a.5.5 0 0 1-.474-.658L9.306 1z"},child:[]}]})(t)}function Y(t){return O({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"},child:[]}]})(t)}function U(t){return O({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z"},child:[]},{tag:"path",attr:{d:"M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z"},child:[]}]})(t)}const ye="_panel_19663_1",be="_panelExiting_19663_13",ke="_menuItem_19663_37",Ie="_disabled_19663_52",Me="_menuItemIcon_19663_57",Ne="_menuItemText_19663_63",Pe="_overlay_19663_69",b={panel:ye,panelExiting:be,menuItem:ke,disabled:Ie,menuItemIcon:Me,menuItemText:Ne,overlay:Pe},Se=t=>{const n=t.currentTarget??t.target;if(n?.getBoundingClientRect){const c=n.getBoundingClientRect();return{top:c.bottom+2,left:c.left}}const s=t;return{top:(s.clientY??0)+2,left:s.clientX??0}},W=r.forwardRef(function({model:i,popup:n=!0,onHide:s,onClick:c},g){const[u,d]=r.useState(!1),[h,a]=r.useState(!1),[C,y]=r.useState({top:0,left:0}),v=r.useRef(null),f=r.useCallback(()=>{h||a(!0)},[h]),N=r.useCallback(o=>{h&&o.animationName.includes("menuOut")&&(d(!1),a(!1),s?.())},[h,s]),P=r.useCallback(o=>{y(Se(o)),a(!1),d(!0)},[]),L=r.useCallback(o=>{u?f():P(o)},[u,f,P]);r.useImperativeHandle(g,()=>({show:P,hide:f,toggle:L}),[P,f,L]),r.useEffect(()=>{if(!u)return;const o=l=>{l.key==="Escape"&&f()},j=l=>{const m=v.current;m&&!m.contains(l.target)&&f()};return document.addEventListener("keydown",o),document.addEventListener("mousedown",j),()=>{document.removeEventListener("keydown",o),document.removeEventListener("mousedown",j)}},[u,f]);const w=(o,j)=>{j.stopPropagation(),o.command?.({originalEvent:j,item:o}),f()},S=(o,j)=>{const l=m=>w(o,m);return o.template?e.jsx(r.Fragment,{children:o.template(o,{onClick:l})},j):e.jsxs("button",{type:"button",className:`${b.menuItem} ${o.disabled&&b.disabled}`,onClick:m=>{o.disabled||l(m)},children:[o.icon&&e.jsx("span",{className:b.menuItemIcon,children:o.icon}),e.jsx("span",{className:b.menuItemText,children:o.label})]},j)};return!u||!n?null:ie.createPortal(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:b.overlay,"aria-hidden":!0,onClick:()=>f(),onMouseDown:o=>o.stopPropagation()}),e.jsx("div",{ref:v,className:`${b.panel} ${h?b.panelExiting:""}`,role:"menu",style:{top:C.top,left:C.left},onAnimationEnd:N,onClick:o=>{o.stopPropagation(),c?.(o)},children:i.map(S)})]}),document.body)}),J=()=>(t,i)=>e.jsxs("button",{className:b.menuItem,onClick:n=>i.onClick(n),children:[e.jsx("span",{className:b.menuItemIcon,children:t.icon}),e.jsx("span",{className:b.menuItemText,children:t.label})]}),G=({width:t=16,height:i=16,color:n="#3B64A0"})=>e.jsxs("svg",{width:t,height:i,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M8 15C6.14348 15 4.36301 14.2625 3.05025 12.9497C1.7375 11.637 1 9.85652 1 8C1 6.14348 1.7375 4.36301 3.05025 3.05025C4.36301 1.7375 6.14348 1 8 1C9.85652 1 11.637 1.7375 12.9497 3.05025C14.2625 4.36301 15 6.14348 15 8C15 9.85652 14.2625 11.637 12.9497 12.9497C11.637 14.2625 9.85652 15 8 15ZM8 16C10.1217 16 12.1566 15.1571 13.6569 13.6569C15.1571 12.1566 16 10.1217 16 8C16 5.87827 15.1571 3.84344 13.6569 2.34315C12.1566 0.842855 10.1217 0 8 0C5.87827 0 3.84344 0.842855 2.34315 2.34315C0.842855 3.84344 0 5.87827 0 8C0 10.1217 0.842855 12.1566 2.34315 13.6569C3.84344 15.1571 5.87827 16 8 16Z",fill:n}),e.jsx("path",{d:"M7 11.5C7 11.3674 7.05268 11.2402 7.14645 11.1464C7.24021 11.0527 7.36739 11 7.5 11H8.5C8.63261 11 8.75979 11.0527 8.85355 11.1464C8.94732 11.2402 9 11.3674 9 11.5C9 11.6326 8.94732 11.7598 8.85355 11.8536C8.75979 11.9473 8.63261 12 8.5 12H7.5C7.36739 12 7.24021 11.9473 7.14645 11.8536C7.05268 11.7598 7 11.6326 7 11.5ZM5 8.5C5 8.36739 5.05268 8.24021 5.14645 8.14645C5.24021 8.05268 5.36739 8 5.5 8H10.5C10.6326 8 10.7598 8.05268 10.8536 8.14645C10.9473 8.24021 11 8.36739 11 8.5C11 8.63261 10.9473 8.75979 10.8536 8.85355C10.7598 8.94732 10.6326 9 10.5 9H5.5C5.36739 9 5.24021 8.94732 5.14645 8.85355C5.05268 8.75979 5 8.63261 5 8.5ZM3 5.5C3 5.36739 3.05268 5.24021 3.14645 5.14645C3.24021 5.05268 3.36739 5 3.5 5H12.5C12.6326 5 12.7598 5.05268 12.8536 5.14645C12.9473 5.24021 13 5.36739 13 5.5C13 5.63261 12.9473 5.75979 12.8536 5.85355C12.7598 5.94732 12.6326 6 12.5 6H3.5C3.36739 6 3.24021 5.94732 3.14645 5.85355C3.05268 5.75979 3 5.63261 3 5.5Z",fill:n})]}),Q=r.createContext(void 0),Ee=({children:t})=>{const[i,n]=r.useState([]),s=r.useCallback((u,d)=>{n(h=>(h.forEach(a=>{a.current&&a!==u&&a.current.hide(d)}),[])),u.current?.toggle(d),n([u])},[]),c=r.useCallback(u=>{n(d=>d.filter(h=>h!==u))},[]),g=r.useMemo(()=>({openMenus:i,openMenu:s,closeMenu:c}),[i,s,c]);return e.jsx(Q.Provider,{value:g,children:t})},ee=()=>{const t=r.useContext(Q);if(t===void 0)throw new Error("useMenuProvider must be used within a MenuProvider");return t},Le=({color:t="#E32012"})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("g",{clipPath:"url(#clip0_3105_5367)",children:e.jsx("path",{d:"M16 8C16 10.1217 15.1571 12.1566 13.6569 13.6569C12.1566 15.1571 10.1217 16 8 16C5.87827 16 3.84344 15.1571 2.34315 13.6569C0.842855 12.1566 0 10.1217 0 8C0 5.87827 0.842855 3.84344 2.34315 2.34315C3.84344 0.842855 5.87827 0 8 0C10.1217 0 12.1566 0.842855 13.6569 2.34315C15.1571 3.84344 16 5.87827 16 8ZM8 4C7.87361 4.00007 7.74863 4.02662 7.63312 4.07793C7.51761 4.12924 7.41413 4.20418 7.32934 4.29791C7.24456 4.39165 7.18035 4.5021 7.14084 4.62217C7.10134 4.74223 7.08743 4.86923 7.1 4.995L7.45 8.502C7.46176 8.63977 7.5248 8.76811 7.62664 8.86164C7.72849 8.95516 7.86173 9.00705 8 9.00705C8.13827 9.00705 8.27151 8.95516 8.37336 8.86164C8.4752 8.76811 8.53824 8.63977 8.55 8.502L8.9 4.995C8.91257 4.86923 8.89866 4.74223 8.85915 4.62217C8.81965 4.5021 8.75544 4.39165 8.67066 4.29791C8.58587 4.20418 8.48239 4.12924 8.36688 4.07793C8.25137 4.02662 8.12639 4.00007 8 4ZM8.002 10C7.73678 10 7.48243 10.1054 7.29489 10.2929C7.10736 10.4804 7.002 10.7348 7.002 11C7.002 11.2652 7.10736 11.5196 7.29489 11.7071C7.48243 11.8946 7.73678 12 8.002 12C8.26722 12 8.52157 11.8946 8.70911 11.7071C8.89664 11.5196 9.002 11.2652 9.002 11C9.002 10.7348 8.89664 10.4804 8.70911 10.2929C8.52157 10.1054 8.26722 10 8.002 10Z",fill:t})}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_3105_5367",children:e.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),D=t=>{const{isSet:i,isSelected:n,isFilter:s,className:c,title:g,icon:u,contextMenuItems:d=void 0,onClick:h,onDeleteStep:a,onUpdateFilter:C,subtitle:y,isInvalid:v,idx:f}=t,N=r.useRef(null),{openMenu:P,closeMenu:L}=ee(),w=J(),S=r.useMemo(()=>[{label:"Add Step Filter",icon:e.jsx("div",{className:"mr-2 flex items-center justify-center",children:e.jsx(G,{})}),command:p=>{p?.originalEvent?.stopPropagation(),C&&C(f)},template:w},{label:"Remove",icon:e.jsx(U,{className:"mr-2",color:"#3B64A0",size:18}),command:p=>{p?.originalEvent?.stopPropagation(),a&&a(f)},template:w}],[C,a,f]),o=r.useMemo(()=>d!==void 0?d:S,[d,S]),j=p=>{p.stopPropagation(),P(N,p)},l=r.useMemo(()=>n&&v?x.step+" "+x.selectedInvalid:n?x.step+" "+x.selected:i?x.step+" "+x.isSet:v?x.step+" "+x.invalid:x.step,[i,n,v]),m=r.useMemo(()=>v?e.jsx(Le,{color:"#E32012"}):u,[u,v]);return e.jsx("div",{className:x.container+" "+c,children:e.jsxs("div",{children:[e.jsxs("div",{className:l,onClick:h,children:[e.jsxs("div",{className:x.content,children:[e.jsx("div",{className:`${x.icon} ${v&&x.invalid}`,children:m}),e.jsx("div",{className:x.title,children:g})]}),e.jsx("button",{className:x.dotsButton,onClick:j,"aria-haspopup":!0,"aria-label":"Step options",children:e.jsx(Y,{className:x.dots,color:v?"#E32012":"#3B64A0"})}),e.jsx(W,{model:o,popup:!0,ref:N,onClick:p=>p.stopPropagation(),onHide:()=>L(N)})]}),s&&e.jsxs("div",{className:x.filterFlag,role:"button",tabIndex:0,onClick:()=>{C&&C(f)},onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&C&&(p.preventDefault(),C(f))},children:[e.jsx(G,{color:"#3B64A0"}),e.jsx("span",{children:"Filter"}),e.jsx(Y,{className:x.dots,color:v?"#E32012":"#3B64A0",style:{height:"10px"}})]}),y&&e.jsx("div",{className:x.subtitle,children:y})]})})},Oe=()=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[e.jsxs("g",{clipPath:"url(#clip0_6551_9169)",children:[e.jsx("rect",{width:"24",height:"24",rx:"12",fill:"#0C971F"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V11H18C18.5523 11 19 11.4477 19 12C19 12.5523 18.5523 13 18 13H13V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V13H6C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11H11V6Z",fill:"white"})]}),e.jsx("rect",{x:"0.75",y:"0.75",width:"22.5",height:"22.5",rx:"11.25",stroke:"#14BC2B",strokeWidth:"1.5"}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_6551_9169",children:e.jsx("rect",{width:"24",height:"24",rx:"12",fill:"white"})})})]}),Be="_multipleTriggersIcon_oxhdi_1",Te={multipleTriggersIcon:Be},He=()=>e.jsx("div",{className:Te.multipleTriggersIcon,children:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 3.75C1.5 3.15326 1.73705 2.58097 2.15901 2.15901C2.58097 1.73705 3.15326 1.5 3.75 1.5H5.25C5.84674 1.5 6.41903 1.73705 6.84099 2.15901C7.26295 2.58097 7.5 3.15326 7.5 3.75L13.701 3.75C13.8661 3.46404 14.1209 3.24054 14.426 3.11418C14.7311 2.98782 15.0693 2.96565 15.3883 3.05111C15.7072 3.13657 15.9891 3.32489 16.1901 3.58686C16.3911 3.84882 16.5 4.1698 16.5 4.5C16.5 4.8302 16.3911 5.15118 16.1901 5.41314C15.9891 5.67511 15.7072 5.86343 15.3883 5.94889C15.0693 6.03435 14.7311 6.01218 14.426 5.88582C14.1209 5.75946 13.8661 5.53596 13.701 5.25H10.686C10.956 5.52 11.196 5.8215 11.412 6.1575C12.369 7.6455 12.75 9.6885 12.75 12C12.75 14.9895 13.1355 16.638 13.8195 17.55C14.3535 18.264 15.162 18.6315 16.5 18.726C16.5063 18.1334 16.7462 17.5673 17.1674 17.1505C17.5887 16.7337 18.1574 16.5 18.75 16.5H20.25C20.8467 16.5 21.419 16.7371 21.841 17.159C22.2629 17.581 22.5 18.1533 22.5 18.75V20.25C22.5 20.8467 22.2629 21.419 21.841 21.841C21.419 22.2629 20.8467 22.5 20.25 22.5H18.75C18.1533 22.5 17.581 22.2629 17.159 21.841C16.7371 21.419 16.5 20.8467 16.5 20.25H10.299C10.1339 20.536 9.87905 20.7595 9.57399 20.8858C9.26892 21.0122 8.93068 21.0344 8.61173 20.9489C8.29278 20.8634 8.01095 20.6751 7.80993 20.4131C7.60892 20.1512 7.49996 19.8302 7.49996 19.5C7.49996 19.1698 7.60892 18.8488 7.80993 18.5869C8.01095 18.3249 8.29278 18.1366 8.61173 18.0511C8.93068 17.9656 9.26892 17.9878 9.57399 18.1142C9.87905 18.2405 10.1339 18.464 10.299 18.75H12.8655C12.7785 18.6538 12.6959 18.5537 12.618 18.45C11.6145 17.1105 11.25 15.0105 11.25 12C11.25 9.81 10.881 8.1045 10.1505 6.9675C9.5655 6.06 8.7225 5.4675 7.5 5.2995C7.48706 5.88762 7.2443 6.44728 6.82374 6.85859C6.40318 7.2699 5.83826 7.50014 5.25 7.5H3.75C3.15326 7.5 2.58097 7.26295 2.15901 6.84099C1.73705 6.41903 1.5 5.84674 1.5 5.25V3.75ZM3.75 3C3.55109 3 3.36032 3.07902 3.21967 3.21967C3.07902 3.36032 3 3.55109 3 3.75V5.25C3 5.44891 3.07902 5.63968 3.21967 5.78033C3.36032 5.92098 3.55109 6 3.75 6H5.25C5.44891 6 5.63968 5.92098 5.78033 5.78033C5.92098 5.63968 6 5.44891 6 5.25V3.75C6 3.55109 5.92098 3.36032 5.78033 3.21967C5.63968 3.07902 5.44891 3 5.25 3H3.75ZM18.75 18C18.5511 18 18.3603 18.079 18.2197 18.2197C18.079 18.3603 18 18.5511 18 18.75V20.25C18 20.4489 18.079 20.6397 18.2197 20.7803C18.3603 20.921 18.5511 21 18.75 21H20.25C20.4489 21 20.6397 20.921 20.7803 20.7803C20.921 20.6397 21 20.4489 21 20.25V18.75C21 18.5511 20.921 18.3603 20.7803 18.2197C20.6397 18.079 20.4489 18 20.25 18H18.75Z",fill:"white"})})}),$e="_trigger_kfg1y_1",Re="_title_kfg1y_7",ze="_empty_kfg1y_15",Fe="_triggerContainer_kfg1y_21",We="_stepsContainer_kfg1y_25",De="_stepItem_kfg1y_51",Ae="_curvesSvg_kfg1y_70",Ve="_centralNode_kfg1y_78",Ze="_iconWrapper_kfg1y_104",Ye="_fadeIn_kfg1y_127",Ge="_fadeOut_kfg1y_130",qe="_operationContainer_kfg1y_134",_={trigger:$e,title:Re,empty:ze,triggerContainer:Fe,stepsContainer:We,stepItem:De,curvesSvg:Ae,centralNode:Ve,iconWrapper:Ze,fadeIn:Ye,fadeOut:Ge,operationContainer:qe},Xe=()=>e.jsx("div",{style:{height:"1px",marginLeft:"4px",marginRight:"4px",borderTop:"1px solid #a1bbdc"}}),Ke=80,B=34,te=({steps:t,title:i,className:n,onDeleteTrigger:s,onAddTrigger:c,onSelectStep:g,onCenterYUpdate:u})=>{const d=r.useRef(null),h=r.useRef([]),[a,C]=r.useState([]),[y,v]=r.useState({width:0,height:0}),[f,N]=r.useState(!1),[P,L]=r.useState(!1),w=r.useRef(null);r.useEffect(()=>{const l=()=>{if(!d.current)return;const m=[];if(h.current.forEach((p,k)=>{if(p&&d.current){const I=d.current.getBoundingClientRect(),M=p.getBoundingClientRect();m.push({id:t[k]?.id||`step-${k}`,top:M.top-I.top,right:M.right-I.left,centerY:M.top-I.top+M.height/2})}}),C(m),d.current&&m.length>0){const p=d.current.getBoundingClientRect(),k=Math.min(...m.map(E=>E.top)),I=h.current.filter(Boolean).map(E=>E?.offsetHeight||68),M=Math.max(...m.map((E,ne)=>E.top+(I[ne]||68))),R=Math.max(...m.map(E=>E.right))+0,z=Math.max(p.height,M-k+100);v({width:R,height:z})}};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[t]),r.useEffect(()=>(f?(w.current&&(clearTimeout(w.current),w.current=null),setTimeout(()=>{L(!0)},0)):w.current=setTimeout(()=>{L(!1)},140),()=>{w.current&&clearTimeout(w.current)}),[f]);const S=a.length>0?Ke:0,o=r.useMemo(()=>a.length>1?a.reduce((l,m)=>l+m.top+B,0)/a.length:a.length===1?a[0].top+B:0,[a]);if(r.useEffect(()=>{u?.(o)},[o,u]),t.length===0)return e.jsxs("div",{className:`${_.trigger} ${n||""}`,children:[i&&e.jsx("h3",{className:_.title,children:i}),e.jsx("div",{className:_.empty,children:"No steps"})]});const j=(l,m,p,k)=>{const I=p-l,M=Math.min(I*.6,60),A=l+M,R=m,z=p-M;return`M ${l} ${m} C ${A} ${R}, ${z} ${k}, ${p} ${k}`};return e.jsxs("div",{className:`${_.trigger} ${n||""}`,ref:d,children:[i&&e.jsx("h3",{className:_.title,children:i}),e.jsxs("div",{className:_.triggerContainer,children:[e.jsx("div",{className:_.stepsContainer,children:t.map((l,m)=>e.jsx("div",{ref:p=>{h.current[m]=p},children:e.jsx(D,{title:l.title,className:_.stepItem,idx:m,isSet:l.isSet,isSelected:l.isSelected,isInvalid:l.isInvalid,isFilter:l.isFilter,icon:l.icon,onClick:g?()=>g(l.id):()=>{},contextMenuItems:[{label:"Delete",icon:e.jsx(U,{className:"mr-2",color:"#3B64A0",size:18}),command:()=>{s?.(l.id)},disabled:t.length===1},{label:"",template:()=>e.jsx(Xe,{})},{label:"Add More Triggers",icon:e.jsx(we,{className:"mr-2",color:"#3B64A0",size:18}),command:()=>{c?.()}}]})},l.id))}),e.jsx("div",{style:{position:"relative"},children:a.length>1&&e.jsx("svg",{className:_.curvesSvg,width:y.width,height:y.height,children:a.map(l=>{const p=a.length===1?a[0].top+B:l.top+B,k=S,I=o;return e.jsx("path",{d:j(0,p,k,I),stroke:"#3b64a0",strokeWidth:"2",fill:"none",strokeLinecap:"round"},l.id)})})}),a.length>1?e.jsxs("div",{style:{position:"relative",marginRight:"140px"},children:[e.jsx("div",{className:_.centralNode,style:{"--node-x":`${S}px`,"--node-y":`${o}px`},onMouseEnter:()=>N(!0),onMouseLeave:()=>N(!1),children:P?e.jsx("div",{className:`${_.iconWrapper} ${f?_.fadeIn:_.fadeOut}`,onClick:c,children:e.jsx(Oe,{})}):null}),e.jsx("div",{className:_.operationContainer,style:{"--op-x":`${S+16}px`,"--op-y":`${o}px`},children:e.jsx(He,{})})]}):null]})]})},Ue=()=>e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M6 12L18 12",stroke:"#3B64A0",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("path",{d:"M12 6V18",stroke:"#3B64A0",strokeWidth:"2",strokeLinecap:"round"})]}),Je="_stepLinkIcon_a40q0_1",Qe="_stepLinkLine_a40q0_17",et="_stepLinkContainer_a40q0_39",T={stepLinkIcon:Je,stepLinkLine:Qe,stepLinkContainer:et};function tt(t){return O({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"4"},child:[]},{tag:"line",attr:{x1:"1.05",y1:"12",x2:"7",y2:"12"},child:[]},{tag:"line",attr:{x1:"17.01",y1:"12",x2:"22.96",y2:"12"},child:[]}]})(t)}function nt(t){return O({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"},child:[]}]})(t)}const F=({onAddStep:t,onAddTrigger:i,index:n=0})=>{const s=J(),c=r.useRef(null),g=[{label:"Trigger",icon:e.jsx(nt,{className:"mr-2",color:"#3B64A0",size:18}),command:()=>{i?.(n)},template:s},{label:"Step",icon:e.jsx(tt,{className:"mr-2",color:"#3B64A0",size:18}),command:()=>{t?.(n)},template:s}],u=d=>{c.current?.show(d)};return e.jsxs("div",{className:T.stepLinkContainer,children:[e.jsx("div",{className:T.stepLinkLine}),e.jsx("div",{className:T.stepLinkIcon,onClick:u,"aria-haspopup":!0,children:e.jsx(Ue,{})}),e.jsx(W,{model:n===0?g.splice(1):g,popup:!0,ref:c}),e.jsx("div",{className:T.stepLinkLine})]})},it="_steps_k2je4_1",st="_stepContainer_k2je4_8",q={steps:it,stepContainer:st},rt=({steps:t,centerY:i,className:n,onDeleteStep:s,onUpdateFilter:c,onAddStep:g,onAddTrigger:u,onSelectStep:d})=>{const a=i!==void 0?{marginTop:Math.max(0,i-37)}:void 0;return t.length===0?e.jsxs("div",{style:{width:"100%",marginTop:"23px",display:"flex",flexDirection:"row",flex:1,minWidth:0,...a},children:[e.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:"2px solid #3B64A0"}}),e.jsx(F,{onAddStep:g,onAddTrigger:u,index:0}),e.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:"2px solid #3B64A0"}})]}):e.jsx("div",{className:q.steps+(n?" "+n:""),style:a,children:e.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:1,minWidth:0,width:"100%"},children:[e.jsx(F,{onAddStep:g,onAddTrigger:u,index:0}),t.map((C,y)=>e.jsxs("div",{className:q.stepContainer,children:[e.jsx(D,{idx:y,title:C.title,isSet:C.isSet,isInvalid:C.isInvalid,isFilter:C.isFilter,isSelected:C.isSelected,icon:C.icon,onClick:()=>{d(C.id)},onDeleteStep:s?v=>s(t[v].id):void 0,onUpdateFilter:c?v=>c(t[v].id):void 0}),e.jsx(F,{onAddStep:g,onAddTrigger:u,index:y+1})]},C.id)),e.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",borderTop:"2px solid #3B64A0",marginTop:"36.5px"}})]})})},ot="_container_12c1g_1",lt={container:ot},ct=({process:t,addMultipleTriggers:i,onAddStep:n,onEditTrigger:s,onDeleteTrigger:c,onDeleteStep:g,onUpdateFilter:u,onSelectStep:d})=>{const[h,a]=r.useState(0);return e.jsxs("div",{className:lt.container,children:[e.jsx(te,{steps:t.triggers,onAddTrigger:i,onDeleteTrigger:c,onEditTrigger:s,onSelectStep:d,onCenterYUpdate:a}),e.jsx(rt,{steps:t.steps,centerY:h,onAddStep:n,onDeleteStep:g,onUpdateFilter:u,onSelectStep:d})]})};exports.Menu=W;exports.MenuProvider=Ee;exports.ProcessDiagram=ct;exports.ProcessStep=D;exports.Trigger=te;exports.useMenuProvider=ee;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),ie=require("react-dom"),se="_container_1uhau_1",re="_step_1uhau_7",oe="_selected_1uhau_22",le="_selectedInvalid_1uhau_28",ce="_isSet_1uhau_34",ae="_invalid_1uhau_38",ue="_filterFlag_1uhau_44",de="_title_1uhau_72",he="_icon_1uhau_89",pe="_content_1uhau_107",me="_dotsButton_1uhau_113",x={container:se,step:re,selected:oe,selectedInvalid:le,isSet:ce,invalid:ae,filterFlag:ue,title:de,icon:he,content:pe,dotsButton:me};var X={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},z=r.createContext&&r.createContext(X),ge=["attr","size","title"];function Ce(t,i){if(t==null)return{};var n=fe(t,i),s,c;if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(t);for(c=0;c<g.length;c++)s=g[c],!(i.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(t,s)&&(n[s]=t[s])}return n}function fe(t,i){if(t==null)return{};var n={};for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)){if(i.indexOf(s)>=0)continue;n[s]=t[s]}return n}function H(){return H=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},H.apply(this,arguments)}function Z(t,i){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);i&&(s=s.filter(function(c){return Object.getOwnPropertyDescriptor(t,c).enumerable})),n.push.apply(n,s)}return n}function $(t){for(var i=1;i<arguments.length;i++){var n=arguments[i]!=null?arguments[i]:{};i%2?Z(Object(n),!0).forEach(function(s){xe(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}function xe(t,i,n){return i=ve(i),i in t?Object.defineProperty(t,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[i]=n,t}function ve(t){var i=_e(t,"string");return typeof i=="symbol"?i:i+""}function _e(t,i){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var s=n.call(t,i);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(t)}function K(t){return t&&t.map((i,n)=>r.createElement(i.tag,$({key:n},i.attr),K(i.child)))}function O(t){return i=>r.createElement(je,H({attr:$({},t.attr)},i),K(t.child))}function je(t){var i=n=>{var{attr:s,size:c,title:g}=t,d=Ce(t,ge),u=c||n.size||"1em",p;return n.className&&(p=n.className),t.className&&(p=(p?p+" ":"")+t.className),r.createElement("svg",H({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,s,d,{className:p,style:$($({color:t.color||n.color},n.style),t.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),g&&r.createElement("title",null,g),t.children)};return z!==void 0?r.createElement(z.Consumer,null,n=>i(n)):i(X)}function ye(t){return O({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.52.359A.5.5 0 0 1 6 0h4a.5.5 0 0 1 .474.658L8.694 6H12.5a.5.5 0 0 1 .395.807l-7 9a.5.5 0 0 1-.873-.454L6.823 9.5H3.5a.5.5 0 0 1-.48-.641zM6.374 1 4.168 8.5H7.5a.5.5 0 0 1 .478.647L6.78 13.04 11.478 7H8a.5.5 0 0 1-.474-.658L9.306 1z"},child:[]}]})(t)}function Y(t){return O({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"},child:[]}]})(t)}function U(t){return O({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z"},child:[]},{tag:"path",attr:{d:"M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z"},child:[]}]})(t)}const we="_panel_19663_1",be="_panelExiting_19663_13",ke="_menuItem_19663_37",Ie="_disabled_19663_52",Me="_menuItemIcon_19663_57",Ne="_menuItemText_19663_63",Pe="_overlay_19663_69",b={panel:we,panelExiting:be,menuItem:ke,disabled:Ie,menuItemIcon:Me,menuItemText:Ne,overlay:Pe},Se=t=>{const n=t.currentTarget??t.target;if(n?.getBoundingClientRect){const c=n.getBoundingClientRect();return{top:c.bottom+2,left:c.left}}const s=t;return{top:(s.clientY??0)+2,left:s.clientX??0}},D=r.forwardRef(function({model:i,popup:n=!0,onHide:s,onClick:c},g){const[d,u]=r.useState(!1),[p,a]=r.useState(!1),[C,w]=r.useState({top:0,left:0}),v=r.useRef(null),f=r.useCallback(()=>{p||a(!0)},[p]),N=r.useCallback(o=>{p&&o.animationName.includes("menuOut")&&(u(!1),a(!1),s?.())},[p,s]),P=r.useCallback(o=>{w(Se(o)),a(!1),u(!0)},[]),L=r.useCallback(o=>{d?f():P(o)},[d,f,P]);r.useImperativeHandle(g,()=>({show:P,hide:f,toggle:L}),[P,f,L]),r.useEffect(()=>{if(!d)return;const o=l=>{l.key==="Escape"&&f()},j=l=>{const m=v.current;m&&!m.contains(l.target)&&f()};return document.addEventListener("keydown",o),document.addEventListener("mousedown",j),()=>{document.removeEventListener("keydown",o),document.removeEventListener("mousedown",j)}},[d,f]);const y=(o,j)=>{j.stopPropagation(),o.command?.({originalEvent:j,item:o}),f()},S=(o,j)=>{const l=m=>y(o,m);return o.template?e.jsx(r.Fragment,{children:o.template(o,{onClick:l})},j):e.jsxs("button",{type:"button",className:`${b.menuItem} ${o.disabled&&b.disabled}`,onClick:m=>{o.disabled||l(m)},children:[o.icon&&e.jsx("span",{className:b.menuItemIcon,children:o.icon}),e.jsx("span",{className:b.menuItemText,children:o.label})]},j)};return!d||!n?null:ie.createPortal(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:b.overlay,"aria-hidden":!0,onClick:()=>f(),onMouseDown:o=>o.stopPropagation()}),e.jsx("div",{ref:v,className:`${b.panel} ${p?b.panelExiting:""}`,role:"menu",style:{top:C.top,left:C.left},onAnimationEnd:N,onClick:o=>{o.stopPropagation(),c?.(o)},children:i.map(S)})]}),document.body)}),J=()=>(t,i)=>e.jsxs("button",{className:b.menuItem,onClick:n=>i.onClick(n),children:[e.jsx("span",{className:b.menuItemIcon,children:t.icon}),e.jsx("span",{className:b.menuItemText,children:t.label})]}),G=({width:t=16,height:i=16,color:n="#3B64A0"})=>e.jsxs("svg",{width:t,height:i,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M8 15C6.14348 15 4.36301 14.2625 3.05025 12.9497C1.7375 11.637 1 9.85652 1 8C1 6.14348 1.7375 4.36301 3.05025 3.05025C4.36301 1.7375 6.14348 1 8 1C9.85652 1 11.637 1.7375 12.9497 3.05025C14.2625 4.36301 15 6.14348 15 8C15 9.85652 14.2625 11.637 12.9497 12.9497C11.637 14.2625 9.85652 15 8 15ZM8 16C10.1217 16 12.1566 15.1571 13.6569 13.6569C15.1571 12.1566 16 10.1217 16 8C16 5.87827 15.1571 3.84344 13.6569 2.34315C12.1566 0.842855 10.1217 0 8 0C5.87827 0 3.84344 0.842855 2.34315 2.34315C0.842855 3.84344 0 5.87827 0 8C0 10.1217 0.842855 12.1566 2.34315 13.6569C3.84344 15.1571 5.87827 16 8 16Z",fill:n}),e.jsx("path",{d:"M7 11.5C7 11.3674 7.05268 11.2402 7.14645 11.1464C7.24021 11.0527 7.36739 11 7.5 11H8.5C8.63261 11 8.75979 11.0527 8.85355 11.1464C8.94732 11.2402 9 11.3674 9 11.5C9 11.6326 8.94732 11.7598 8.85355 11.8536C8.75979 11.9473 8.63261 12 8.5 12H7.5C7.36739 12 7.24021 11.9473 7.14645 11.8536C7.05268 11.7598 7 11.6326 7 11.5ZM5 8.5C5 8.36739 5.05268 8.24021 5.14645 8.14645C5.24021 8.05268 5.36739 8 5.5 8H10.5C10.6326 8 10.7598 8.05268 10.8536 8.14645C10.9473 8.24021 11 8.36739 11 8.5C11 8.63261 10.9473 8.75979 10.8536 8.85355C10.7598 8.94732 10.6326 9 10.5 9H5.5C5.36739 9 5.24021 8.94732 5.14645 8.85355C5.05268 8.75979 5 8.63261 5 8.5ZM3 5.5C3 5.36739 3.05268 5.24021 3.14645 5.14645C3.24021 5.05268 3.36739 5 3.5 5H12.5C12.6326 5 12.7598 5.05268 12.8536 5.14645C12.9473 5.24021 13 5.36739 13 5.5C13 5.63261 12.9473 5.75979 12.8536 5.85355C12.7598 5.94732 12.6326 6 12.5 6H3.5C3.36739 6 3.24021 5.94732 3.14645 5.85355C3.05268 5.75979 3 5.63261 3 5.5Z",fill:n})]}),Q=r.createContext(void 0),Ee=({children:t})=>{const[i,n]=r.useState([]),s=r.useCallback((d,u)=>{n(p=>(p.forEach(a=>{a.current&&a!==d&&a.current.hide(u)}),[])),d.current?.toggle(u),n([d])},[]),c=r.useCallback(d=>{n(u=>u.filter(p=>p!==d))},[]),g=r.useMemo(()=>({openMenus:i,openMenu:s,closeMenu:c}),[i,s,c]);return e.jsx(Q.Provider,{value:g,children:t})},ee=()=>{const t=r.useContext(Q);if(t===void 0)throw new Error("useMenuProvider must be used within a MenuProvider");return t},Le=({color:t="#E32012"})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("g",{clipPath:"url(#clip0_3105_5367)",children:e.jsx("path",{d:"M16 8C16 10.1217 15.1571 12.1566 13.6569 13.6569C12.1566 15.1571 10.1217 16 8 16C5.87827 16 3.84344 15.1571 2.34315 13.6569C0.842855 12.1566 0 10.1217 0 8C0 5.87827 0.842855 3.84344 2.34315 2.34315C3.84344 0.842855 5.87827 0 8 0C10.1217 0 12.1566 0.842855 13.6569 2.34315C15.1571 3.84344 16 5.87827 16 8ZM8 4C7.87361 4.00007 7.74863 4.02662 7.63312 4.07793C7.51761 4.12924 7.41413 4.20418 7.32934 4.29791C7.24456 4.39165 7.18035 4.5021 7.14084 4.62217C7.10134 4.74223 7.08743 4.86923 7.1 4.995L7.45 8.502C7.46176 8.63977 7.5248 8.76811 7.62664 8.86164C7.72849 8.95516 7.86173 9.00705 8 9.00705C8.13827 9.00705 8.27151 8.95516 8.37336 8.86164C8.4752 8.76811 8.53824 8.63977 8.55 8.502L8.9 4.995C8.91257 4.86923 8.89866 4.74223 8.85915 4.62217C8.81965 4.5021 8.75544 4.39165 8.67066 4.29791C8.58587 4.20418 8.48239 4.12924 8.36688 4.07793C8.25137 4.02662 8.12639 4.00007 8 4ZM8.002 10C7.73678 10 7.48243 10.1054 7.29489 10.2929C7.10736 10.4804 7.002 10.7348 7.002 11C7.002 11.2652 7.10736 11.5196 7.29489 11.7071C7.48243 11.8946 7.73678 12 8.002 12C8.26722 12 8.52157 11.8946 8.70911 11.7071C8.89664 11.5196 9.002 11.2652 9.002 11C9.002 10.7348 8.89664 10.4804 8.70911 10.2929C8.52157 10.1054 8.26722 10 8.002 10Z",fill:t})}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_3105_5367",children:e.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),A=t=>{const{isSet:i,isSelected:n,isFilter:s,className:c,title:g,icon:d,contextMenuItems:u=void 0,onClick:p,onDeleteStep:a,onUpdateFilter:C,subtitle:w,isInvalid:v,idx:f}=t,N=r.useRef(null),{openMenu:P,closeMenu:L}=ee(),y=J(),S=r.useMemo(()=>[{label:"Add Step Filter",icon:e.jsx("div",{className:"mr-2 flex items-center justify-center",children:e.jsx(G,{})}),command:h=>{h?.originalEvent?.stopPropagation(),C&&C(f)},template:y},{label:"Remove",icon:e.jsx(U,{className:"mr-2",color:"#3B64A0",size:18}),command:h=>{h?.originalEvent?.stopPropagation(),a&&a(f)},template:y}],[C,a,f]),o=r.useMemo(()=>u!==void 0?u:S,[u,S]),j=h=>{h.stopPropagation(),P(N,h)},l=r.useMemo(()=>n&&v?x.step+" "+x.selectedInvalid:n?x.step+" "+x.selected:i?x.step+" "+x.isSet:v?x.step+" "+x.invalid:x.step,[i,n,v]),m=r.useMemo(()=>v?e.jsx(Le,{color:"#E32012"}):d,[d,v]);return e.jsx("div",{className:x.container+" "+c,children:e.jsxs("div",{children:[e.jsxs("div",{className:l,onClick:p,children:[e.jsxs("div",{className:x.content,children:[e.jsx("div",{className:`${x.icon} ${v&&x.invalid}`,children:m}),e.jsx("div",{className:x.title,children:g})]}),e.jsx("button",{className:x.dotsButton,onClick:j,"aria-haspopup":!0,"aria-label":"Step options",children:e.jsx(Y,{className:x.dots,color:v?"#E32012":"#3B64A0"})}),e.jsx(D,{model:o,popup:!0,ref:N,onClick:h=>h.stopPropagation(),onHide:()=>L(N)})]}),s&&e.jsxs("div",{className:x.filterFlag,role:"button",tabIndex:0,onClick:()=>{C&&C(f)},onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&C&&(h.preventDefault(),C(f))},children:[e.jsx(G,{color:"#3B64A0"}),e.jsx("span",{children:"Filter"}),e.jsx(Y,{className:x.dots,color:v?"#E32012":"#3B64A0",style:{height:"10px"}})]}),w&&e.jsx("div",{className:x.subtitle,children:w})]})})},Oe=()=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[e.jsxs("g",{clipPath:"url(#clip0_6551_9169)",children:[e.jsx("rect",{width:"24",height:"24",rx:"12",fill:"#0C971F"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V11H18C18.5523 11 19 11.4477 19 12C19 12.5523 18.5523 13 18 13H13V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V13H6C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11H11V6Z",fill:"white"})]}),e.jsx("rect",{x:"0.75",y:"0.75",width:"22.5",height:"22.5",rx:"11.25",stroke:"#14BC2B",strokeWidth:"1.5"}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_6551_9169",children:e.jsx("rect",{width:"24",height:"24",rx:"12",fill:"white"})})})]}),Be="_multipleTriggersIcon_oxhdi_1",Te={multipleTriggersIcon:Be},He=()=>e.jsx("div",{className:Te.multipleTriggersIcon,children:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 3.75C1.5 3.15326 1.73705 2.58097 2.15901 2.15901C2.58097 1.73705 3.15326 1.5 3.75 1.5H5.25C5.84674 1.5 6.41903 1.73705 6.84099 2.15901C7.26295 2.58097 7.5 3.15326 7.5 3.75L13.701 3.75C13.8661 3.46404 14.1209 3.24054 14.426 3.11418C14.7311 2.98782 15.0693 2.96565 15.3883 3.05111C15.7072 3.13657 15.9891 3.32489 16.1901 3.58686C16.3911 3.84882 16.5 4.1698 16.5 4.5C16.5 4.8302 16.3911 5.15118 16.1901 5.41314C15.9891 5.67511 15.7072 5.86343 15.3883 5.94889C15.0693 6.03435 14.7311 6.01218 14.426 5.88582C14.1209 5.75946 13.8661 5.53596 13.701 5.25H10.686C10.956 5.52 11.196 5.8215 11.412 6.1575C12.369 7.6455 12.75 9.6885 12.75 12C12.75 14.9895 13.1355 16.638 13.8195 17.55C14.3535 18.264 15.162 18.6315 16.5 18.726C16.5063 18.1334 16.7462 17.5673 17.1674 17.1505C17.5887 16.7337 18.1574 16.5 18.75 16.5H20.25C20.8467 16.5 21.419 16.7371 21.841 17.159C22.2629 17.581 22.5 18.1533 22.5 18.75V20.25C22.5 20.8467 22.2629 21.419 21.841 21.841C21.419 22.2629 20.8467 22.5 20.25 22.5H18.75C18.1533 22.5 17.581 22.2629 17.159 21.841C16.7371 21.419 16.5 20.8467 16.5 20.25H10.299C10.1339 20.536 9.87905 20.7595 9.57399 20.8858C9.26892 21.0122 8.93068 21.0344 8.61173 20.9489C8.29278 20.8634 8.01095 20.6751 7.80993 20.4131C7.60892 20.1512 7.49996 19.8302 7.49996 19.5C7.49996 19.1698 7.60892 18.8488 7.80993 18.5869C8.01095 18.3249 8.29278 18.1366 8.61173 18.0511C8.93068 17.9656 9.26892 17.9878 9.57399 18.1142C9.87905 18.2405 10.1339 18.464 10.299 18.75H12.8655C12.7785 18.6538 12.6959 18.5537 12.618 18.45C11.6145 17.1105 11.25 15.0105 11.25 12C11.25 9.81 10.881 8.1045 10.1505 6.9675C9.5655 6.06 8.7225 5.4675 7.5 5.2995C7.48706 5.88762 7.2443 6.44728 6.82374 6.85859C6.40318 7.2699 5.83826 7.50014 5.25 7.5H3.75C3.15326 7.5 2.58097 7.26295 2.15901 6.84099C1.73705 6.41903 1.5 5.84674 1.5 5.25V3.75ZM3.75 3C3.55109 3 3.36032 3.07902 3.21967 3.21967C3.07902 3.36032 3 3.55109 3 3.75V5.25C3 5.44891 3.07902 5.63968 3.21967 5.78033C3.36032 5.92098 3.55109 6 3.75 6H5.25C5.44891 6 5.63968 5.92098 5.78033 5.78033C5.92098 5.63968 6 5.44891 6 5.25V3.75C6 3.55109 5.92098 3.36032 5.78033 3.21967C5.63968 3.07902 5.44891 3 5.25 3H3.75ZM18.75 18C18.5511 18 18.3603 18.079 18.2197 18.2197C18.079 18.3603 18 18.5511 18 18.75V20.25C18 20.4489 18.079 20.6397 18.2197 20.7803C18.3603 20.921 18.5511 21 18.75 21H20.25C20.4489 21 20.6397 20.921 20.7803 20.7803C20.921 20.6397 21 20.4489 21 20.25V18.75C21 18.5511 20.921 18.3603 20.7803 18.2197C20.6397 18.079 20.4489 18 20.25 18H18.75Z",fill:"white"})})}),$e="_trigger_kfg1y_1",Re="_title_kfg1y_7",Fe="_empty_kfg1y_15",We="_triggerContainer_kfg1y_21",De="_stepsContainer_kfg1y_25",Ae="_stepItem_kfg1y_51",Ve="_curvesSvg_kfg1y_70",ze="_centralNode_kfg1y_78",Ze="_iconWrapper_kfg1y_104",Ye="_fadeIn_kfg1y_127",Ge="_fadeOut_kfg1y_130",qe="_operationContainer_kfg1y_134",_={trigger:$e,title:Re,empty:Fe,triggerContainer:We,stepsContainer:De,stepItem:Ae,curvesSvg:Ve,centralNode:ze,iconWrapper:Ze,fadeIn:Ye,fadeOut:Ge,operationContainer:qe},Xe=()=>e.jsx("div",{style:{height:"1px",marginLeft:"4px",marginRight:"4px",borderTop:"1px solid #a1bbdc"}}),Ke=80,B=34,te=({steps:t,title:i,className:n,onDeleteTrigger:s,onAddTrigger:c,onSelectStep:g,onCenterYUpdate:d})=>{const u=r.useRef(null),p=r.useRef([]),[a,C]=r.useState([]),[w,v]=r.useState({width:0,height:0}),[f,N]=r.useState(!1),[P,L]=r.useState(!1),y=r.useRef(null);r.useEffect(()=>{const l=()=>{if(!u.current)return;const m=[];if(p.current.forEach((h,k)=>{if(h&&u.current){const I=u.current.getBoundingClientRect(),M=h.getBoundingClientRect();m.push({id:t[k]?.id||`step-${k}`,top:M.top-I.top,right:M.right-I.left,centerY:M.top-I.top+M.height/2})}}),C(m),u.current&&m.length>0){const h=u.current.getBoundingClientRect(),k=Math.min(...m.map(E=>E.top)),I=p.current.filter(Boolean).map(E=>E?.offsetHeight||68),M=Math.max(...m.map((E,ne)=>E.top+(I[ne]||68))),R=Math.max(...m.map(E=>E.right))+0,F=Math.max(h.height,M-k+100);v({width:R,height:F})}};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[t]),r.useEffect(()=>(f?(y.current&&(clearTimeout(y.current),y.current=null),setTimeout(()=>{L(!0)},0)):y.current=setTimeout(()=>{L(!1)},140),()=>{y.current&&clearTimeout(y.current)}),[f]);const S=a.length>0?Ke:0,o=r.useMemo(()=>a.length>1?a.reduce((l,m)=>l+m.top+B,0)/a.length:a.length===1?a[0].top+B:0,[a]);if(r.useEffect(()=>{d?.(o)},[o,d]),t.length===0)return e.jsxs("div",{className:`${_.trigger} ${n||""}`,children:[i&&e.jsx("h3",{className:_.title,children:i}),e.jsx("div",{className:_.empty,children:"No steps"})]});const j=(l,m,h,k)=>{const I=h-l,M=Math.min(I*.6,60),V=l+M,R=m,F=h-M;return`M ${l} ${m} C ${V} ${R}, ${F} ${k}, ${h} ${k}`};return e.jsxs("div",{className:`${_.trigger} ${n||""}`,ref:u,children:[i&&e.jsx("h3",{className:_.title,children:i}),e.jsxs("div",{className:_.triggerContainer,children:[e.jsx("div",{className:_.stepsContainer,children:t.map((l,m)=>e.jsx("div",{ref:h=>{p.current[m]=h},children:e.jsx(A,{title:l.title,className:_.stepItem,idx:m,isSet:l.isSet,isSelected:l.isSelected,isInvalid:l.isInvalid,isFilter:l.isFilter,icon:l.icon,onClick:g?()=>g(l.id):()=>{},contextMenuItems:[{label:"Delete",icon:e.jsx(U,{className:"mr-2",color:"#3B64A0",size:18}),command:()=>{s?.(l.id)},disabled:t.length===1},{label:"",template:()=>e.jsx(Xe,{})},{label:"Add More Triggers",icon:e.jsx(ye,{className:"mr-2",color:"#3B64A0",size:18}),command:()=>{c?.()}}]})},l.id))}),e.jsx("div",{style:{position:"relative"},children:a.length>1&&e.jsx("svg",{className:_.curvesSvg,width:w.width,height:w.height,children:a.map(l=>{const h=a.length===1?a[0].top+B:l.top+B,k=S,I=o;return e.jsx("path",{d:j(0,h,k,I),stroke:"#3b64a0",strokeWidth:"2",fill:"none",strokeLinecap:"round"},l.id)})})}),a.length>1?e.jsxs("div",{style:{position:"relative",marginRight:"140px"},children:[e.jsx("div",{className:_.centralNode,style:{"--node-x":`${S}px`,"--node-y":`${o}px`},onMouseEnter:()=>N(!0),onMouseLeave:()=>N(!1),children:P?e.jsx("div",{className:`${_.iconWrapper} ${f?_.fadeIn:_.fadeOut}`,onClick:c,children:e.jsx(Oe,{})}):null}),e.jsx("div",{className:_.operationContainer,style:{"--op-x":`${S+16}px`,"--op-y":`${o}px`},children:e.jsx(He,{})})]}):null]})]})},Ue=()=>e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M6 12L18 12",stroke:"#3B64A0",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("path",{d:"M12 6V18",stroke:"#3B64A0",strokeWidth:"2",strokeLinecap:"round"})]}),Je="_stepLinkIcon_a40q0_1",Qe="_stepLinkLine_a40q0_17",et="_stepLinkContainer_a40q0_39",T={stepLinkIcon:Je,stepLinkLine:Qe,stepLinkContainer:et};function tt(t){return O({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"4"},child:[]},{tag:"line",attr:{x1:"1.05",y1:"12",x2:"7",y2:"12"},child:[]},{tag:"line",attr:{x1:"17.01",y1:"12",x2:"22.96",y2:"12"},child:[]}]})(t)}function nt(t){return O({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"},child:[]}]})(t)}const W=({onAddStep:t,onAddTrigger:i,index:n=0})=>{const s=J(),c=r.useRef(null),g=[{label:"Trigger",icon:e.jsx(nt,{className:"mr-2",color:"#3B64A0",size:18}),command:()=>{i?.(n)},template:s},{label:"Step",icon:e.jsx(tt,{className:"mr-2",color:"#3B64A0",size:18}),command:()=>{t?.(n)},template:s}],d=u=>{c.current?.show(u)};return e.jsxs("div",{className:T.stepLinkContainer,children:[e.jsx("div",{className:T.stepLinkLine}),e.jsx("div",{className:T.stepLinkIcon,onClick:d,"aria-haspopup":!0,children:e.jsx(Ue,{})}),e.jsx(D,{model:n===0?g.splice(1):g,popup:!0,ref:c}),e.jsx("div",{className:T.stepLinkLine})]})},it="_steps_k2je4_1",st="_stepContainer_k2je4_8",q={steps:it,stepContainer:st},rt=({steps:t,centerY:i,className:n,onDeleteStep:s,onUpdateFilter:c,onAddStep:g,onAddTrigger:d,onSelectStep:u})=>{const a=i!==void 0?{marginTop:Math.max(0,i-37)}:void 0;return t.length===0?e.jsxs("div",{style:{width:"100%",marginTop:"23px",display:"flex",flexDirection:"row",flex:1,minWidth:0,...a},children:[e.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:"2px solid #3B64A0"}}),e.jsx(W,{onAddStep:g,onAddTrigger:d,index:0}),e.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:"2px solid #3B64A0"}})]}):e.jsx("div",{className:q.steps+(n?" "+n:""),style:a,children:e.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:1,minWidth:0,width:"100%"},children:[e.jsx(W,{onAddStep:g,onAddTrigger:d,index:0}),t.map((C,w)=>e.jsxs("div",{className:q.stepContainer,children:[e.jsx(A,{idx:w,title:C.title,isSet:C.isSet,isInvalid:C.isInvalid,isFilter:C.isFilter,isSelected:C.isSelected,icon:C.icon,onClick:()=>{u(C.id)},onDeleteStep:s?v=>s(t[v].id):void 0,onUpdateFilter:c?v=>c(t[v].id):void 0}),e.jsx(W,{onAddStep:g,onAddTrigger:d,index:w+1})]},C.id)),e.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",borderTop:"2px solid #3B64A0",marginTop:"36.5px"}})]})})},ot="_container_12c1g_1",lt={container:ot},ct=({process:t,addMultipleTriggers:i,onAddStep:n,onEditTrigger:s,onDeleteTrigger:c,onDeleteStep:g,onUpdateFilter:d,onSelectStep:u,onAddTrigger:p})=>{const[a,C]=r.useState(0);return e.jsxs("div",{className:lt.container,children:[e.jsx(te,{steps:t.triggers,onAddTrigger:i,onDeleteTrigger:c,onEditTrigger:s,onSelectStep:u,onCenterYUpdate:C}),e.jsx(rt,{steps:t.steps,centerY:a,onAddStep:n,onAddTrigger:p,onDeleteStep:g,onUpdateFilter:d,onSelectStep:u})]})};exports.Menu=D;exports.MenuProvider=Ee;exports.ProcessDiagram=ct;exports.ProcessStep=A;exports.Trigger=te;exports.useMenuProvider=ee;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|