@operato/flow 9.0.0-beta.52
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/CHANGELOG.md +25 -0
- package/README.md +95 -0
- package/assets/images/no-image.png +0 -0
- package/dist/src/api/tasks.d.ts +7 -0
- package/dist/src/api/tasks.js +2517 -0
- package/dist/src/api/tasks.js.map +1 -0
- package/dist/src/base/anchor-instance.d.ts +30 -0
- package/dist/src/base/anchor-instance.js +82 -0
- package/dist/src/base/anchor-instance.js.map +1 -0
- package/dist/src/base/flow-edge-instance.d.ts +31 -0
- package/dist/src/base/flow-edge-instance.js +170 -0
- package/dist/src/base/flow-edge-instance.js.map +1 -0
- package/dist/src/base/flow-node-abstract.d.ts +44 -0
- package/dist/src/base/flow-node-abstract.js +144 -0
- package/dist/src/base/flow-node-abstract.js.map +1 -0
- package/dist/src/components/flow-debug-panel.d.ts +22 -0
- package/dist/src/components/flow-debug-panel.js +156 -0
- package/dist/src/components/flow-debug-panel.js.map +1 -0
- package/dist/src/components/flow-executor.d.ts +29 -0
- package/dist/src/components/flow-executor.js +88 -0
- package/dist/src/components/flow-executor.js.map +1 -0
- package/dist/src/components/flow-options-builder.d.ts +18 -0
- package/dist/src/components/flow-options-builder.js +145 -0
- package/dist/src/components/flow-options-builder.js.map +1 -0
- package/dist/src/components/flow-properties-panel.d.ts +20 -0
- package/dist/src/components/flow-properties-panel.js +212 -0
- package/dist/src/components/flow-properties-panel.js.map +1 -0
- package/dist/src/components/flow-side-panel.d.ts +9 -0
- package/dist/src/components/flow-side-panel.js +83 -0
- package/dist/src/components/flow-side-panel.js.map +1 -0
- package/dist/src/components/flow-sidebar.d.ts +7 -0
- package/dist/src/components/flow-sidebar.js +84 -0
- package/dist/src/components/flow-sidebar.js.map +1 -0
- package/dist/src/components/flow-toolbar.d.ts +15 -0
- package/dist/src/components/flow-toolbar.js +161 -0
- package/dist/src/components/flow-toolbar.js.map +1 -0
- package/dist/src/components/property-editor.d.ts +34 -0
- package/dist/src/components/property-editor.js +76 -0
- package/dist/src/components/property-editor.js.map +1 -0
- package/dist/src/components/property-panel/data-mapper-popup.d.ts +11 -0
- package/dist/src/components/property-panel/data-mapper-popup.js +86 -0
- package/dist/src/components/property-panel/data-mapper-popup.js.map +1 -0
- package/dist/src/components/property-panel/task-selection-popup.d.ts +10 -0
- package/dist/src/components/property-panel/task-selection-popup.js +106 -0
- package/dist/src/components/property-panel/task-selection-popup.js.map +1 -0
- package/dist/src/context/flow-context.d.ts +21 -0
- package/dist/src/context/flow-context.js +3 -0
- package/dist/src/context/flow-context.js.map +1 -0
- package/dist/src/context/flow-debug-context.d.ts +16 -0
- package/dist/src/context/flow-debug-context.js +3 -0
- package/dist/src/context/flow-debug-context.js.map +1 -0
- package/dist/src/context/flow-edit-context.d.ts +11 -0
- package/dist/src/context/flow-edit-context.js +3 -0
- package/dist/src/context/flow-edit-context.js.map +1 -0
- package/dist/src/handlers/dnd-event-handler.d.ts +9 -0
- package/dist/src/handlers/dnd-event-handler.js +41 -0
- package/dist/src/handlers/dnd-event-handler.js.map +1 -0
- package/dist/src/handlers/flow-event-handler.d.ts +20 -0
- package/dist/src/handlers/flow-event-handler.js +75 -0
- package/dist/src/handlers/flow-event-handler.js.map +1 -0
- package/dist/src/handlers/keydown-event-handler.d.ts +6 -0
- package/dist/src/handlers/keydown-event-handler.js +24 -0
- package/dist/src/handlers/keydown-event-handler.js.map +1 -0
- package/dist/src/handlers/pointer-event-handler.d.ts +9 -0
- package/dist/src/handlers/pointer-event-handler.js +118 -0
- package/dist/src/handlers/pointer-event-handler.js.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/nodes/decision.d.ts +12 -0
- package/dist/src/nodes/decision.js +41 -0
- package/dist/src/nodes/decision.js.map +1 -0
- package/dist/src/nodes/end-event.d.ts +10 -0
- package/dist/src/nodes/end-event.js +44 -0
- package/dist/src/nodes/end-event.js.map +1 -0
- package/dist/src/nodes/index.d.ts +5 -0
- package/dist/src/nodes/index.js +19 -0
- package/dist/src/nodes/index.js.map +1 -0
- package/dist/src/nodes/intermediate-event.d.ts +10 -0
- package/dist/src/nodes/intermediate-event.js +46 -0
- package/dist/src/nodes/intermediate-event.js.map +1 -0
- package/dist/src/nodes/iterator.d.ts +8 -0
- package/dist/src/nodes/iterator.js +26 -0
- package/dist/src/nodes/iterator.js.map +1 -0
- package/dist/src/nodes/select.d.ts +13 -0
- package/dist/src/nodes/select.js +68 -0
- package/dist/src/nodes/select.js.map +1 -0
- package/dist/src/nodes/start-event.d.ts +11 -0
- package/dist/src/nodes/start-event.js +43 -0
- package/dist/src/nodes/start-event.js.map +1 -0
- package/dist/src/nodes/subflow.d.ts +8 -0
- package/dist/src/nodes/subflow.js +27 -0
- package/dist/src/nodes/subflow.js.map +1 -0
- package/dist/src/nodes/task.d.ts +13 -0
- package/dist/src/nodes/task.js +57 -0
- package/dist/src/nodes/task.js.map +1 -0
- package/dist/src/ox-flow-editor.d.ts +94 -0
- package/dist/src/ox-flow-editor.js +426 -0
- package/dist/src/ox-flow-editor.js.map +1 -0
- package/dist/src/ox-flow-monitor.d.ts +24 -0
- package/dist/src/ox-flow-monitor.js +117 -0
- package/dist/src/ox-flow-monitor.js.map +1 -0
- package/dist/src/types.d.ts +92 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/utils/generate-mapping-scheme.d.ts +6 -0
- package/dist/src/utils/generate-mapping-scheme.js +50 -0
- package/dist/src/utils/generate-mapping-scheme.js.map +1 -0
- package/dist/stories/ox-flow-editor.stories.d.ts +24 -0
- package/dist/stories/ox-flow-editor.stories.js +249 -0
- package/dist/stories/ox-flow-editor.stories.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +91 -0
- package/themes/app-theme.css +138 -0
- package/themes/calendar-theme.css +61 -0
- package/themes/dark.css +51 -0
- package/themes/form-theme.css +70 -0
- package/themes/grist-theme.css +175 -0
- package/themes/layout-theme.css +94 -0
- package/themes/light.css +51 -0
- package/themes/material-theme.css +23 -0
- package/themes/md-typescale-styles.css +100 -0
- package/themes/oops-theme.css +22 -0
- package/themes/report-theme.css +47 -0
- package/themes/spacing.css +23 -0
- package/themes/state-color.css +6 -0
- package/themes/tooltip-theme.css +11 -0
- package/translations/en.json +3 -0
- package/translations/ja.json +3 -0
- package/translations/ko.json +3 -0
- package/translations/ms.json +3 -0
- package/translations/zh.json +3 -0
- package/types/dagre-esm.d.ts +4 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Mapping } from '@operato/data-mapper';
|
|
2
|
+
import { PropertySpec } from '@operato/property-editor';
|
|
3
|
+
import { SVGTemplateResult } from 'lit';
|
|
4
|
+
export interface FlowDataSchema {
|
|
5
|
+
type: 'object' | 'array' | 'string' | 'number' | 'boolean';
|
|
6
|
+
properties?: {
|
|
7
|
+
[key: string]: FlowDataSchema;
|
|
8
|
+
};
|
|
9
|
+
required?: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface FlowNodeDataSchema {
|
|
12
|
+
inputSchema: FlowDataSchema | undefined;
|
|
13
|
+
outputSchema: FlowDataSchema | undefined;
|
|
14
|
+
dataSourceSchema: FlowDataSchema | undefined;
|
|
15
|
+
}
|
|
16
|
+
export interface FlowEntityModel {
|
|
17
|
+
id: string;
|
|
18
|
+
type: string;
|
|
19
|
+
subtype?: string;
|
|
20
|
+
label?: string;
|
|
21
|
+
options?: {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface FlowEntity extends FlowEntityModel {
|
|
26
|
+
optionsSpec: PropertySpec[];
|
|
27
|
+
selected: boolean;
|
|
28
|
+
update: (model: Partial<FlowEntityModel>) => void;
|
|
29
|
+
updateOptions: (options: {
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}) => void;
|
|
32
|
+
}
|
|
33
|
+
/** 앵커 타입 */
|
|
34
|
+
export interface AnchorModel extends FlowEntityModel {
|
|
35
|
+
type: 'in' | 'out';
|
|
36
|
+
pos: {
|
|
37
|
+
x: number;
|
|
38
|
+
y: number;
|
|
39
|
+
};
|
|
40
|
+
angle?: number;
|
|
41
|
+
weight?: number;
|
|
42
|
+
}
|
|
43
|
+
export interface Anchor extends AnchorModel {
|
|
44
|
+
node: FlowNode;
|
|
45
|
+
render(): SVGTemplateResult;
|
|
46
|
+
}
|
|
47
|
+
/** 플로우 노드 */
|
|
48
|
+
export interface FlowNodeModel extends FlowEntityModel, FlowNodeDataSchema {
|
|
49
|
+
pos: {
|
|
50
|
+
x: number;
|
|
51
|
+
y: number;
|
|
52
|
+
};
|
|
53
|
+
size: {
|
|
54
|
+
w: number;
|
|
55
|
+
h: number;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export interface FlowNode extends FlowEntity, FlowNodeModel {
|
|
59
|
+
anchors?: Anchor[];
|
|
60
|
+
findAnchor(id: string): Anchor | undefined;
|
|
61
|
+
render(): SVGTemplateResult;
|
|
62
|
+
renderNode(): SVGTemplateResult;
|
|
63
|
+
}
|
|
64
|
+
export interface AnchorPointer {
|
|
65
|
+
nodeId: string;
|
|
66
|
+
anchorId: string;
|
|
67
|
+
}
|
|
68
|
+
/** 플로우 엣지 */
|
|
69
|
+
export interface FlowEdgeModel extends FlowEntityModel {
|
|
70
|
+
type: string;
|
|
71
|
+
from: AnchorPointer;
|
|
72
|
+
to: AnchorPointer;
|
|
73
|
+
weight?: number;
|
|
74
|
+
dataMappings: Mapping[];
|
|
75
|
+
}
|
|
76
|
+
export interface FlowEdge extends FlowEntity, FlowEdgeModel {
|
|
77
|
+
fromAnchor?: Anchor;
|
|
78
|
+
toAnchor?: Anchor;
|
|
79
|
+
render(): SVGTemplateResult;
|
|
80
|
+
}
|
|
81
|
+
export type EditorMode = 'edit' | 'debug';
|
|
82
|
+
export type FlowModel = {
|
|
83
|
+
nodes: FlowNodeModel[];
|
|
84
|
+
edges: FlowEdgeModel[];
|
|
85
|
+
};
|
|
86
|
+
export type FlowNodeImplementation = new (...args: any[]) => FlowNode;
|
|
87
|
+
export type TaskType = {
|
|
88
|
+
name: string;
|
|
89
|
+
description: string | null;
|
|
90
|
+
help: string | null;
|
|
91
|
+
parameterSpec: PropertySpec[];
|
|
92
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Mapping } from '@operato/data-mapper'\nimport { PropertySpec } from '@operato/property-editor'\nimport { SVGTemplateResult } from 'lit'\n\nexport interface FlowDataSchema {\n type: 'object' | 'array' | 'string' | 'number' | 'boolean'\n properties?: { [key: string]: FlowDataSchema }\n required?: string[]\n}\n\nexport interface FlowNodeDataSchema {\n inputSchema: FlowDataSchema | undefined\n outputSchema: FlowDataSchema | undefined\n dataSourceSchema: FlowDataSchema | undefined\n}\n\n// export interface FlowDataMapping {\n// toField: string\n// mappingType: 'direct' | 'expression'\n// fromFields: { nodeId: string; field: string }[] // ⬅ 명확한 데이터 출처 명시\n// expression?: string\n// }\n\nexport interface FlowEntityModel {\n id: string\n type: string\n subtype?: string\n label?: string\n options?: { [key: string]: any }\n}\n\nexport interface FlowEntity extends FlowEntityModel {\n optionsSpec: PropertySpec[]\n selected: boolean\n update: (model: Partial<FlowEntityModel>) => void\n updateOptions: (options: { [key: string]: any }) => void\n}\n\n/** 앵커 타입 */\nexport interface AnchorModel extends FlowEntityModel {\n type: 'in' | 'out'\n pos: { x: number; y: number }\n angle?: number\n weight?: number\n}\n\nexport interface Anchor extends AnchorModel {\n node: FlowNode\n render(): SVGTemplateResult\n}\n\n/** 플로우 노드 */\nexport interface FlowNodeModel extends FlowEntityModel, FlowNodeDataSchema {\n pos: { x: number; y: number }\n size: { w: number; h: number }\n}\n\nexport interface FlowNode extends FlowEntity, FlowNodeModel {\n anchors?: Anchor[]\n findAnchor(id: string): Anchor | undefined\n render(): SVGTemplateResult\n renderNode(): SVGTemplateResult\n}\n\nexport interface AnchorPointer {\n nodeId: string\n anchorId: string\n}\n\n/** 플로우 엣지 */\nexport interface FlowEdgeModel extends FlowEntityModel {\n type: string\n from: AnchorPointer\n to: AnchorPointer\n weight?: number\n dataMappings: Mapping[]\n}\n\nexport interface FlowEdge extends FlowEntity, FlowEdgeModel {\n fromAnchor?: Anchor\n toAnchor?: Anchor\n render(): SVGTemplateResult\n}\n\nexport type EditorMode = 'edit' | 'debug'\n\nexport type FlowModel = { nodes: FlowNodeModel[]; edges: FlowEdgeModel[] }\n\nexport type FlowNodeImplementation = new (...args: any[]) => FlowNode\n\nexport type TaskType = {\n name: string\n description: string | null\n help: string | null\n parameterSpec: PropertySpec[]\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TreeNode } from '@operato/data-mapper';
|
|
2
|
+
import { FlowDataSchema, FlowNode } from '../types.js';
|
|
3
|
+
import { PropertySpec } from '@operato/property-editor';
|
|
4
|
+
export declare function convertNodesToTree(nodes: FlowNode[], except: FlowNode[]): TreeNode;
|
|
5
|
+
export declare function convertSchemaToTree(schema: FlowDataSchema, rootLabel: string): TreeNode;
|
|
6
|
+
export declare function convertPropertySpecsToSchema(propertySpecs: PropertySpec[]): FlowDataSchema;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export function convertNodesToTree(nodes, except) {
|
|
2
|
+
const schema = {
|
|
3
|
+
type: 'object',
|
|
4
|
+
properties: nodes
|
|
5
|
+
.filter(node => !except.includes(node))
|
|
6
|
+
.reduce((sum, node) => {
|
|
7
|
+
const { type, subtype, label, outputSchema } = node;
|
|
8
|
+
sum[label || subtype || type] = outputSchema;
|
|
9
|
+
return sum;
|
|
10
|
+
}, {})
|
|
11
|
+
};
|
|
12
|
+
return convertSchemaToTree(schema, 'Context Data');
|
|
13
|
+
}
|
|
14
|
+
export function convertSchemaToTree(schema, rootLabel) {
|
|
15
|
+
const convert = (schema, idPrefix) => {
|
|
16
|
+
return {
|
|
17
|
+
id: idPrefix,
|
|
18
|
+
label: idPrefix || rootLabel,
|
|
19
|
+
multiplicity: schema.type === 'array' ? '*' : '1',
|
|
20
|
+
children: schema.properties
|
|
21
|
+
? Object.entries(schema.properties).map(([key, subSchema]) => convert(subSchema, `${key}`))
|
|
22
|
+
: undefined
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
return convert(schema, rootLabel.toLowerCase());
|
|
26
|
+
}
|
|
27
|
+
export function convertPropertySpecsToSchema(propertySpecs) {
|
|
28
|
+
return {
|
|
29
|
+
type: 'object',
|
|
30
|
+
properties: propertySpecs.reduce((sum, propertySpec) => {
|
|
31
|
+
const { name, type } = propertySpec;
|
|
32
|
+
let schemaType = 'string';
|
|
33
|
+
switch (type) {
|
|
34
|
+
case 'string':
|
|
35
|
+
case 'number':
|
|
36
|
+
case 'boolena':
|
|
37
|
+
schemaType = type;
|
|
38
|
+
break;
|
|
39
|
+
case 'checkbox':
|
|
40
|
+
schemaType = 'boolean';
|
|
41
|
+
break;
|
|
42
|
+
default:
|
|
43
|
+
schemaType = 'object';
|
|
44
|
+
}
|
|
45
|
+
sum[name] = { type: schemaType };
|
|
46
|
+
return sum;
|
|
47
|
+
}, {})
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=generate-mapping-scheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-mapping-scheme.js","sourceRoot":"","sources":["../../../src/utils/generate-mapping-scheme.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,kBAAkB,CAAC,KAAiB,EAAE,MAAkB;IACtE,MAAM,MAAM,GAAmB;QAC7B,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,KAAK;aACd,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;aACtC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACpB,MAAM,E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Q,CAAC;gBACd,KAAK,QAAQ,CAAC;gBACd,KAAK,SAAS;oBACZ,UAAU,GAAG,IAAW,CAAA;oBACxB,MAAK;gBACP,KAAK,UAAU;oBACb,UAAU,GAAG,SAAS,CAAA;oBACtB,MAAK;gBACP;oBACE,UAAU,GAAG,QAAQ,CAAA;YACzB,CAAC;YAED,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,CAAA;YAEhC,OAAO,GAAG,CAAA;QACZ,CAAC,EACD,EAAuC,CACxC;KACF,CAAA;AACH,CAAC","sourcesContent":["import { TreeNode } from '@operato/data-mapper'\nimport { FlowDataSchema, FlowNode } from '../types.js'\nimport { PropertySpec } from '@operato/property-editor'\n\nexport function convertNodesToTree(nodes: FlowNode[], except: FlowNode[]): TreeNode {\n const schema: FlowDataSchema = {\n type: 'object',\n properties: nodes\n .filter(node => !except.includes(node))\n .reduce((sum, node) => {\n const { type, subtype, label, outputSchema } = node\n sum[label || subtype || type] = outputSchema\n return sum\n }, {} as any)\n }\n\n return convertSchemaToTree(schema, 'Context Data')\n}\n\nexport function convertSchemaToTree(schema: FlowDataSchema, rootLabel: string): TreeNode {\n const convert = (schema: FlowDataSchema, idPrefix: string): TreeNode => {\n return {\n id: idPrefix,\n label: idPrefix || rootLabel,\n multiplicity: schema.type === 'array' ? '*' : '1',\n children: schema.properties\n ? Object.entries(schema.properties).map(([key, subSchema]) => convert(subSchema, `${key}`))\n : undefined\n }\n }\n\n return convert(schema, rootLabel.toLowerCase())\n}\n\nexport function convertPropertySpecsToSchema(propertySpecs: PropertySpec[]): FlowDataSchema {\n return {\n type: 'object',\n properties: propertySpecs.reduce(\n (sum, propertySpec) => {\n const { name, type } = propertySpec\n let schemaType: 'string' | 'number' | 'boolean' | 'object' | 'array' = 'string'\n\n switch (type) {\n case 'string':\n case 'number':\n case 'boolena':\n schemaType = type as any\n break\n case 'checkbox':\n schemaType = 'boolean'\n break\n default:\n schemaType = 'object'\n }\n\n sum[name] = { type: schemaType }\n\n return sum\n },\n {} as { [key: string]: FlowDataSchema }\n )\n }\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import '../src/ox-flow-editor.js';
|
|
2
|
+
import '@material/web/icon/icon.js';
|
|
3
|
+
import { TemplateResult } from 'lit';
|
|
4
|
+
declare const _default: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: string;
|
|
7
|
+
argTypes: {
|
|
8
|
+
model: {
|
|
9
|
+
control: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
14
|
+
interface Story<T> {
|
|
15
|
+
(args: T): TemplateResult;
|
|
16
|
+
args?: Partial<T>;
|
|
17
|
+
argTypes?: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
interface ArgTypes {
|
|
20
|
+
model: object;
|
|
21
|
+
}
|
|
22
|
+
export declare const Regular: Story<ArgTypes>;
|
|
23
|
+
export declare const Standard: Story<ArgTypes>;
|
|
24
|
+
export declare const Select: Story<ArgTypes>;
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import '../src/ox-flow-editor.js';
|
|
2
|
+
import '@material/web/icon/icon.js';
|
|
3
|
+
import { html } from 'lit';
|
|
4
|
+
import availableNodeTypes from '../src/nodes/index.js';
|
|
5
|
+
export default {
|
|
6
|
+
title: 'ox-flow-editor',
|
|
7
|
+
component: 'ox-flow-editor',
|
|
8
|
+
argTypes: {
|
|
9
|
+
model: { control: 'object' }
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const Template = ({ model }) => html `
|
|
13
|
+
<link
|
|
14
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
15
|
+
rel="stylesheet"
|
|
16
|
+
/>
|
|
17
|
+
<link
|
|
18
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
|
19
|
+
rel="stylesheet"
|
|
20
|
+
/>
|
|
21
|
+
<link
|
|
22
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
|
23
|
+
rel="stylesheet"
|
|
24
|
+
/>
|
|
25
|
+
|
|
26
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
|
27
|
+
<link href="/themes/light.css" rel="stylesheet" />
|
|
28
|
+
<link href="/themes/dark.css" rel="stylesheet" />
|
|
29
|
+
<link href="/themes/spacing.css" rel="stylesheet" />
|
|
30
|
+
<link href="/themes/grist-theme.css" rel="stylesheet" />
|
|
31
|
+
<link href="/themes/form-theme.css" rel="stylesheet" />
|
|
32
|
+
|
|
33
|
+
<style>
|
|
34
|
+
ox-flow-editor {
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: 1200px;
|
|
37
|
+
display: flex;
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
40
|
+
|
|
41
|
+
<ox-flow-editor .availableNodeTypes=${availableNodeTypes} .model=${model}></ox-flow-editor>
|
|
42
|
+
`;
|
|
43
|
+
export const Regular = Template.bind({});
|
|
44
|
+
Regular.args = {
|
|
45
|
+
model: {
|
|
46
|
+
nodes: [],
|
|
47
|
+
edges: []
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
export const Standard = Template.bind({});
|
|
51
|
+
Standard.args = {
|
|
52
|
+
model: {
|
|
53
|
+
nodes: [
|
|
54
|
+
{
|
|
55
|
+
id: 'start-1',
|
|
56
|
+
type: 'start',
|
|
57
|
+
label: 'Start',
|
|
58
|
+
pos: { x: 200, y: 100 }
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: 'task-1',
|
|
62
|
+
type: 'task',
|
|
63
|
+
label: 'Task',
|
|
64
|
+
pos: { x: 200, y: 250 }
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: 'decision-1',
|
|
68
|
+
type: 'decision',
|
|
69
|
+
label: 'Decision',
|
|
70
|
+
pos: { x: 200, y: 400 }
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'task-2',
|
|
74
|
+
type: 'task',
|
|
75
|
+
label: 'Yes Task',
|
|
76
|
+
pos: { x: 200, y: 550 }
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: 'task-3',
|
|
80
|
+
type: 'task',
|
|
81
|
+
label: 'No Task',
|
|
82
|
+
pos: { x: 360, y: 550 }
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: 'end-1',
|
|
86
|
+
type: 'end',
|
|
87
|
+
label: 'End',
|
|
88
|
+
pos: { x: 200, y: 700 }
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
edges: [
|
|
92
|
+
{
|
|
93
|
+
id: 'edge1',
|
|
94
|
+
from: { nodeId: 'start-1', anchorId: 'out' },
|
|
95
|
+
to: { nodeId: 'task-1', anchorId: 'in' }
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: 'edge2',
|
|
99
|
+
from: { nodeId: 'task-1', anchorId: 'out' },
|
|
100
|
+
to: { nodeId: 'decision-1', anchorId: 'in' }
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: 'edge3',
|
|
104
|
+
from: { nodeId: 'decision-1', anchorId: 'yes' },
|
|
105
|
+
to: { nodeId: 'task-2', anchorId: 'in' },
|
|
106
|
+
label: 'Yes',
|
|
107
|
+
weight: 2
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: 'edge4',
|
|
111
|
+
from: { nodeId: 'decision-1', anchorId: 'no-2' },
|
|
112
|
+
to: { nodeId: 'task-3', anchorId: 'in' },
|
|
113
|
+
label: 'No',
|
|
114
|
+
weight: 1
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: 'edge5',
|
|
118
|
+
from: { nodeId: 'task-2', anchorId: 'out' },
|
|
119
|
+
to: { nodeId: 'end-1', anchorId: 'in' }
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
id: 'edge6',
|
|
123
|
+
from: { nodeId: 'task-3', anchorId: 'out' },
|
|
124
|
+
to: { nodeId: 'end-1', anchorId: 'in' }
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
export const Select = Template.bind({});
|
|
130
|
+
Select.args = {
|
|
131
|
+
model: {
|
|
132
|
+
nodes: [
|
|
133
|
+
{
|
|
134
|
+
id: 'start-1',
|
|
135
|
+
type: 'start',
|
|
136
|
+
label: 'Start',
|
|
137
|
+
pos: { x: 450, y: 100 }
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
id: 'task-0',
|
|
141
|
+
type: 'task',
|
|
142
|
+
label: 'Task',
|
|
143
|
+
pos: { x: 450, y: 250 }
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: 'select-1',
|
|
147
|
+
type: 'select',
|
|
148
|
+
label: 'Select',
|
|
149
|
+
options: {
|
|
150
|
+
outputCount: 4
|
|
151
|
+
},
|
|
152
|
+
pos: { x: 450, y: 400 }
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
id: 'task-1',
|
|
156
|
+
type: 'task',
|
|
157
|
+
label: 'Task 1',
|
|
158
|
+
pos: { x: 220, y: 550 }
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: 'task-2',
|
|
162
|
+
type: 'task',
|
|
163
|
+
label: 'Task 2',
|
|
164
|
+
pos: { x: 370, y: 550 }
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
id: 'task-3',
|
|
168
|
+
type: 'task',
|
|
169
|
+
label: 'Task 3',
|
|
170
|
+
pos: { x: 520, y: 550 }
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
id: 'task-4',
|
|
174
|
+
type: 'task',
|
|
175
|
+
label: 'Task 4',
|
|
176
|
+
pos: { x: 670, y: 550 }
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
id: 'end-1',
|
|
180
|
+
type: 'end',
|
|
181
|
+
label: 'End',
|
|
182
|
+
pos: { x: 450, y: 700 }
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
edges: [
|
|
186
|
+
{
|
|
187
|
+
id: 'edge1',
|
|
188
|
+
from: { nodeId: 'start-1', anchorId: 'out' },
|
|
189
|
+
to: { nodeId: 'task-0', anchorId: 'in' }
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
id: 'edge2',
|
|
193
|
+
from: { nodeId: 'task-0', anchorId: 'out' },
|
|
194
|
+
to: { nodeId: 'select-1', anchorId: 'in' },
|
|
195
|
+
label: 'case 1',
|
|
196
|
+
weight: 3
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
id: 'edge3',
|
|
200
|
+
from: { nodeId: 'select-1', anchorId: 'out-1' },
|
|
201
|
+
to: { nodeId: 'task-1', anchorId: 'in' },
|
|
202
|
+
label: 'case 1',
|
|
203
|
+
weight: 4
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
id: 'edge4',
|
|
207
|
+
from: { nodeId: 'select-1', anchorId: 'out-2' },
|
|
208
|
+
to: { nodeId: 'task-2', anchorId: 'in' },
|
|
209
|
+
label: 'case 2',
|
|
210
|
+
weight: 3
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
id: 'edge5',
|
|
214
|
+
from: { nodeId: 'select-1', anchorId: 'out-3' },
|
|
215
|
+
to: { nodeId: 'task-3', anchorId: 'in' },
|
|
216
|
+
label: 'case 3',
|
|
217
|
+
weight: 2
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
id: 'edge6',
|
|
221
|
+
from: { nodeId: 'select-1', anchorId: 'out-4' },
|
|
222
|
+
to: { nodeId: 'task-4', anchorId: 'in' },
|
|
223
|
+
label: 'case 4',
|
|
224
|
+
weight: 1
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
id: 'edge7',
|
|
228
|
+
from: { nodeId: 'task-1', anchorId: 'out' },
|
|
229
|
+
to: { nodeId: 'end-1', anchorId: 'in' }
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
id: 'edge8',
|
|
233
|
+
from: { nodeId: 'task-2', anchorId: 'out' },
|
|
234
|
+
to: { nodeId: 'end-1', anchorId: 'in' }
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
id: 'edge9',
|
|
238
|
+
from: { nodeId: 'task-3', anchorId: 'out' },
|
|
239
|
+
to: { nodeId: 'end-1', anchorId: 'in' }
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
id: 'edge10',
|
|
243
|
+
from: { nodeId: 'task-4', anchorId: 'out' },
|
|
244
|
+
to: { nodeId: 'end-1', anchorId: 'in' }
|
|
245
|
+
}
|
|
246
|
+
]
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
//# sourceMappingURL=ox-flow-editor.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ox-flow-editor.stories.js","sourceRoot":"","sources":["../../stories/ox-flow-editor.stories.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAA;AACjC,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAG1C,OAAO,kBAAkB,MAAM,uBAAuB,CAAA;AAEtD,eAAe;IACb,KAAK,EAAE,gBAAgB;IACvB,SAAS,EAAE,gBAAgB;IAC3B,QAAQ,EAAE;QACR,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;KAC7B;CACF,CAAA;AAYD,MAAM,QAAQ,GAAoB,CAAC,EAAE,KAAK,EAAY,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA6BvB,kBAAkB,WAAW,KAAkB;CACtF,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,IAAI,GAAG;IACb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AE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;gBACxC,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,CAAC;aACV;YACD;gBACE,EAAE,EAAE,OAAO;gBACX,IAAI,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE;gBAC/C,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;gBACxC,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,CAAC;aACV;YACD;gBACE,EAAE,EAAE,OAAO;gBACX,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE;gBAC3C,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE;aACxC;YACD;gBACE,EAAE,EAAE,OAAO;gBACX,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE;gBAC3C,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE;aACxC;YACD;gBACE,EAAE,EAAE,OAAO;gBACX,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE;gBAC3C,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE;aACxC;YACD;gBACE,EAAE,EAAE,QAAQ;gBACZ,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE;gBAC3C,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE;aACxC;SACF;KACF;CACF,CAAA","sourcesContent":["import '../src/ox-flow-editor.js'\nimport '@material/web/icon/icon.js'\n\nimport { html, TemplateResult } from 'lit'\n\nimport { FlowModel } from '../src/types.js'\nimport availableNodeTypes from '../src/nodes/index.js'\n\nexport default {\n title: 'ox-flow-editor',\n component: 'ox-flow-editor',\n argTypes: {\n model: { control: 'object' }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n model: object\n}\n\nconst Template: Story<ArgTypes> = ({ model }: ArgTypes) => html`\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n\n <link href=\"/themes/app-theme.css\" rel=\"stylesheet\" />\n <link href=\"/themes/light.css\" rel=\"stylesheet\" />\n <link href=\"/themes/dark.css\" rel=\"stylesheet\" />\n <link href=\"/themes/spacing.css\" rel=\"stylesheet\" />\n <link href=\"/themes/grist-theme.css\" rel=\"stylesheet\" />\n <link href=\"/themes/form-theme.css\" rel=\"stylesheet\" />\n\n <style>\n ox-flow-editor {\n width: 100%;\n height: 1200px;\n display: flex;\n }\n </style>\n\n <ox-flow-editor .availableNodeTypes=${availableNodeTypes} .model=${model as FlowModel}></ox-flow-editor>\n`\n\nexport const Regular = Template.bind({})\nRegular.args = {\n model: {\n nodes: [],\n edges: []\n }\n}\n\nexport const Standard = Template.bind({})\nStandard.args = {\n model: {\n nodes: [\n {\n id: 'start-1',\n type: 'start',\n label: 'Start',\n pos: { x: 200, y: 100 }\n },\n {\n id: 'task-1',\n type: 'task',\n label: 'Task',\n pos: { x: 200, y: 250 }\n },\n {\n id: 'decision-1',\n type: 'decision',\n label: 'Decision',\n pos: { x: 200, y: 400 }\n },\n {\n id: 'task-2',\n type: 'task',\n label: 'Yes Task',\n pos: { x: 200, y: 550 }\n },\n {\n id: 'task-3',\n type: 'task',\n label: 'No Task',\n pos: { x: 360, y: 550 }\n },\n {\n id: 'end-1',\n type: 'end',\n label: 'End',\n pos: { x: 200, y: 700 }\n }\n ],\n edges: [\n {\n id: 'edge1',\n from: { nodeId: 'start-1', anchorId: 'out' },\n to: { nodeId: 'task-1', anchorId: 'in' }\n },\n {\n id: 'edge2',\n from: { nodeId: 'task-1', anchorId: 'out' },\n to: { nodeId: 'decision-1', anchorId: 'in' }\n },\n {\n id: 'edge3',\n from: { nodeId: 'decision-1', anchorId: 'yes' },\n to: { nodeId: 'task-2', anchorId: 'in' },\n label: 'Yes',\n weight: 2\n },\n {\n id: 'edge4',\n from: { nodeId: 'decision-1', anchorId: 'no-2' },\n to: { nodeId: 'task-3', anchorId: 'in' },\n label: 'No',\n weight: 1\n },\n {\n id: 'edge5',\n from: { nodeId: 'task-2', anchorId: 'out' },\n to: { nodeId: 'end-1', anchorId: 'in' }\n },\n {\n id: 'edge6',\n from: { nodeId: 'task-3', anchorId: 'out' },\n to: { nodeId: 'end-1', anchorId: 'in' }\n }\n ]\n }\n}\n\nexport const Select = Template.bind({})\nSelect.args = {\n model: {\n nodes: [\n {\n id: 'start-1',\n type: 'start',\n label: 'Start',\n pos: { x: 450, y: 100 }\n },\n {\n id: 'task-0',\n type: 'task',\n label: 'Task',\n pos: { x: 450, y: 250 }\n },\n {\n id: 'select-1',\n type: 'select',\n label: 'Select',\n options: {\n outputCount: 4\n },\n pos: { x: 450, y: 400 }\n },\n {\n id: 'task-1',\n type: 'task',\n label: 'Task 1',\n pos: { x: 220, y: 550 }\n },\n {\n id: 'task-2',\n type: 'task',\n label: 'Task 2',\n pos: { x: 370, y: 550 }\n },\n {\n id: 'task-3',\n type: 'task',\n label: 'Task 3',\n pos: { x: 520, y: 550 }\n },\n {\n id: 'task-4',\n type: 'task',\n label: 'Task 4',\n pos: { x: 670, y: 550 }\n },\n {\n id: 'end-1',\n type: 'end',\n label: 'End',\n pos: { x: 450, y: 700 }\n }\n ],\n edges: [\n {\n id: 'edge1',\n from: { nodeId: 'start-1', anchorId: 'out' },\n to: { nodeId: 'task-0', anchorId: 'in' }\n },\n {\n id: 'edge2',\n from: { nodeId: 'task-0', anchorId: 'out' },\n to: { nodeId: 'select-1', anchorId: 'in' },\n label: 'case 1',\n weight: 3\n },\n {\n id: 'edge3',\n from: { nodeId: 'select-1', anchorId: 'out-1' },\n to: { nodeId: 'task-1', anchorId: 'in' },\n label: 'case 1',\n weight: 4\n },\n {\n id: 'edge4',\n from: { nodeId: 'select-1', anchorId: 'out-2' },\n to: { nodeId: 'task-2', anchorId: 'in' },\n label: 'case 2',\n weight: 3\n },\n {\n id: 'edge5',\n from: { nodeId: 'select-1', anchorId: 'out-3' },\n to: { nodeId: 'task-3', anchorId: 'in' },\n label: 'case 3',\n weight: 2\n },\n {\n id: 'edge6',\n from: { nodeId: 'select-1', anchorId: 'out-4' },\n to: { nodeId: 'task-4', anchorId: 'in' },\n label: 'case 4',\n weight: 1\n },\n {\n id: 'edge7',\n from: { nodeId: 'task-1', anchorId: 'out' },\n to: { nodeId: 'end-1', anchorId: 'in' }\n },\n {\n id: 'edge8',\n from: { nodeId: 'task-2', anchorId: 'out' },\n to: { nodeId: 'end-1', anchorId: 'in' }\n },\n {\n id: 'edge9',\n from: { nodeId: 'task-3', anchorId: 'out' },\n to: { nodeId: 'end-1', anchorId: 'in' }\n },\n {\n id: 'edge10',\n from: { nodeId: 'task-4', anchorId: 'out' },\n to: { nodeId: 'end-1', anchorId: 'in' }\n }\n ]\n }\n}\n"]}
|