@operato/flow 9.0.0-beta.53 → 9.0.0-beta.55

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.
Files changed (49) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/src/base/flow-node-abstract.d.ts +6 -1
  3. package/dist/src/base/flow-node-abstract.js +55 -0
  4. package/dist/src/base/flow-node-abstract.js.map +1 -1
  5. package/dist/src/components/flow-properties-panel.d.ts +2 -0
  6. package/dist/src/components/flow-properties-panel.js +21 -1
  7. package/dist/src/components/flow-properties-panel.js.map +1 -1
  8. package/dist/src/nodes/decision.d.ts +4 -0
  9. package/dist/src/nodes/decision.js +9 -7
  10. package/dist/src/nodes/decision.js.map +1 -1
  11. package/dist/src/nodes/end-event.d.ts +4 -0
  12. package/dist/src/nodes/end-event.js +5 -2
  13. package/dist/src/nodes/end-event.js.map +1 -1
  14. package/dist/src/nodes/intermediate-event.d.ts +4 -0
  15. package/dist/src/nodes/intermediate-event.js +7 -1
  16. package/dist/src/nodes/intermediate-event.js.map +1 -1
  17. package/dist/src/nodes/iterator.d.ts +4 -0
  18. package/dist/src/nodes/iterator.js +8 -5
  19. package/dist/src/nodes/iterator.js.map +1 -1
  20. package/dist/src/nodes/select.d.ts +4 -0
  21. package/dist/src/nodes/select.js +6 -3
  22. package/dist/src/nodes/select.js.map +1 -1
  23. package/dist/src/nodes/start-event.d.ts +4 -0
  24. package/dist/src/nodes/start-event.js +5 -2
  25. package/dist/src/nodes/start-event.js.map +1 -1
  26. package/dist/src/nodes/subflow.d.ts +4 -0
  27. package/dist/src/nodes/subflow.js +8 -5
  28. package/dist/src/nodes/subflow.js.map +1 -1
  29. package/dist/src/nodes/task.d.ts +4 -0
  30. package/dist/src/nodes/task.js +8 -5
  31. package/dist/src/nodes/task.js.map +1 -1
  32. package/dist/src/property-editors/ox-input-anchors.d.ts +12 -0
  33. package/dist/src/property-editors/ox-input-anchors.js +163 -0
  34. package/dist/src/property-editors/ox-input-anchors.js.map +1 -0
  35. package/dist/src/property-editors/ox-input-nodes.d.ts +0 -0
  36. package/dist/src/property-editors/ox-input-nodes.js +2 -0
  37. package/dist/src/property-editors/ox-input-nodes.js.map +1 -0
  38. package/dist/src/property-editors/ox-property-editor-anchors.d.ts +6 -0
  39. package/dist/src/property-editors/ox-property-editor-anchors.js +25 -0
  40. package/dist/src/property-editors/ox-property-editor-anchors.js.map +1 -0
  41. package/dist/src/property-editors/ox-property-editor-nodes.d.ts +6 -0
  42. package/dist/src/property-editors/ox-property-editor-nodes.js +25 -0
  43. package/dist/src/property-editors/ox-property-editor-nodes.js.map +1 -0
  44. package/dist/src/types.d.ts +6 -1
  45. package/dist/src/types.js.map +1 -1
  46. package/dist/stories/ox-flow-editor.stories.js +1 -1
  47. package/dist/stories/ox-flow-editor.stories.js.map +1 -1
  48. package/dist/tsconfig.tsbuildinfo +1 -1
  49. package/package.json +4 -4
@@ -3,6 +3,10 @@ import { AnchorModel } from '../types.js';
3
3
  import { FlowNodeAbstract } from '../base/flow-node-abstract.js';
4
4
  export declare class Subflow extends FlowNodeAbstract {
5
5
  get type(): string;
6
+ get size(): {
7
+ w: number;
8
+ h: number;
9
+ };
6
10
  renderNode(): SVGTemplateResult;
7
11
  get anchorModels(): AnchorModel[];
8
12
  }
@@ -4,8 +4,11 @@ export class Subflow extends FlowNodeAbstract {
4
4
  get type() {
5
5
  return 'subflow';
6
6
  }
7
+ get size() {
8
+ return this.model.size || { w: 120, h: 60 };
9
+ }
7
10
  renderNode() {
8
- const { w, h } = this.size || { w: 120, h: 60 };
11
+ const { w, h } = this.size;
9
12
  const x = -w / 2;
10
13
  const y = -h / 2;
11
14
  const gap = h * 0.2;
@@ -17,11 +20,11 @@ export class Subflow extends FlowNodeAbstract {
17
20
  `;
18
21
  }
19
22
  get anchorModels() {
20
- const { w, h } = this.size || { w: 120, h: 60 };
23
+ const { w, h } = this.size;
21
24
  return [
22
- { id: 'in', type: 'in', pos: { x: 0, y: -h / 2 } },
23
- { id: 'out', type: 'out', pos: { x: 0, y: h / 2 } }
24
- ];
25
+ { id: 'in', type: 'in', pos: { x: 0, y: -h / 2 }, angle: 270 },
26
+ { id: 'out', type: 'out', pos: { x: 0, y: h / 2 }, angle: 90 }
27
+ ].map(anchorModel => this.applyAnchorsOption(anchorModel));
25
28
  }
26
29
  }
27
30
  //# sourceMappingURL=subflow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"subflow.js","sourceRoot":"","sources":["../../../src/nodes/subflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,KAAK,CAAA;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAEhE,MAAM,OAAO,OAAQ,SAAQ,gBAAgB;IAC3C,IAAI,IAAI;QACN,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,UAAU;QACR,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAA;QAC/C,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;QAChB,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;QAChB,MAAM,GAAG,GAAG,CAAC,GAAG,GAAG,CAAA;QAEnB,OAAO,GAAG,CAAA;sCACwB,CAAC,QAAQ,CAAC,YAAY,CAAC,aAAa,CAAC;oCACvC,CAAC,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,GAAG,aAAa,CAAC,GAAG,GAAG;;mEAEtC,IAAI,CAAC,KAAK;KACxE,CAAA;IACH,CAAC;IAED,IAAI,YAAY;QACd,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAA;QAE/C,OAAO;YACL,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE;YAClD,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE;SACpD,CAAA;IACH,CAAC;CACF","sourcesContent":["import { svg, SVGTemplateResult } from 'lit'\nimport { AnchorModel } from '../types.js'\nimport { FlowNodeAbstract } from '../base/flow-node-abstract.js'\n\nexport class Subflow extends FlowNodeAbstract {\n get type() {\n return 'subflow'\n }\n\n renderNode(): SVGTemplateResult {\n const { w, h } = this.size || { w: 120, h: 60 }\n const x = -w / 2\n const y = -h / 2\n const gap = h * 0.2\n\n return svg`\n <rect class=\"node-outline\" x=\"${x}\" y=\"${y}\" width=\"${w}\" height=\"${h}\" fill=\"#e2e3f3\" stroke-width=\"1\" stroke=\"#666\"/>\n <rect class=\"node-inner\" x=\"${x + gap / 2}\" y=\"${y + gap / 2}\" width=\"${w - gap}\" height=\"${h - gap}\" fill=\"#d6e0f5\" stroke-width=\"1\" stroke=\"#000\"/>\n\n <text class=\"node-label\" x=\"0\" y=\"-5\" text-anchor=\"middle\">${this.label}</text>\n `\n }\n\n get anchorModels(): AnchorModel[] {\n const { w, h } = this.size || { w: 120, h: 60 }\n\n return [\n { id: 'in', type: 'in', pos: { x: 0, y: -h / 2 } },\n { id: 'out', type: 'out', pos: { x: 0, y: h / 2 } }\n ]\n }\n}\n"]}
1
+ {"version":3,"file":"subflow.js","sourceRoot":"","sources":["../../../src/nodes/subflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,KAAK,CAAA;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAEhE,MAAM,O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B,CAAC,CAAC,CAAA;IAC3E,CAAC;CACF","sourcesContent":["import { svg, SVGTemplateResult } from 'lit'\nimport { AnchorModel } from '../types.js'\nimport { FlowNodeAbstract } from '../base/flow-node-abstract.js'\n\nexport class Subflow extends FlowNodeAbstract {\n get type() {\n return 'subflow'\n }\n\n get size(): { w: number; h: number } {\n return this.model!.size || { w: 120, h: 60 }\n }\n\n renderNode(): SVGTemplateResult {\n const { w, h } = this.size\n const x = -w / 2\n const y = -h / 2\n const gap = h * 0.2\n\n return svg`\n <rect class=\"node-outline\" x=\"${x}\" y=\"${y}\" width=\"${w}\" height=\"${h}\" fill=\"#e2e3f3\" stroke-width=\"1\" stroke=\"#666\"/>\n <rect class=\"node-inner\" x=\"${x + gap / 2}\" y=\"${y + gap / 2}\" width=\"${w - gap}\" height=\"${h - gap}\" fill=\"#d6e0f5\" stroke-width=\"1\" stroke=\"#000\"/>\n\n <text class=\"node-label\" x=\"0\" y=\"-5\" text-anchor=\"middle\">${this.label}</text>\n `\n }\n\n get anchorModels(): AnchorModel[] {\n const { w, h } = this.size\n\n return [\n { id: 'in', type: 'in', pos: { x: 0, y: -h / 2 }, angle: 270 },\n { id: 'out', type: 'out', pos: { x: 0, y: h / 2 }, angle: 90 }\n ].map(anchorModel => this.applyAnchorsOption(anchorModel as AnchorModel))\n }\n}\n"]}
@@ -8,6 +8,10 @@ export declare class Task extends FlowNodeAbstract {
8
8
  set propertySpecs(propertySpecs: PropertySpec[] | null);
9
9
  get type(): string;
10
10
  get inputSchema(): import("../types.js").FlowDataSchema;
11
+ get size(): {
12
+ w: number;
13
+ h: number;
14
+ };
11
15
  renderNode(): SVGTemplateResult;
12
16
  get anchorModels(): AnchorModel[];
13
17
  }
@@ -37,8 +37,11 @@ export class Task extends FlowNodeAbstract {
37
37
  get inputSchema() {
38
38
  return convertPropertySpecsToSchema(this.propertySpecs || []);
39
39
  }
40
+ get size() {
41
+ return this.model.size || { w: 120, h: 60 };
42
+ }
40
43
  renderNode() {
41
- const { w, h } = this.size || { w: 120, h: 60 };
44
+ const { w, h } = this.size;
42
45
  const x = -w / 2;
43
46
  const y = -h / 2;
44
47
  return svg `
@@ -47,11 +50,11 @@ export class Task extends FlowNodeAbstract {
47
50
  `;
48
51
  }
49
52
  get anchorModels() {
50
- const { w, h } = this.size || { w: 120, h: 60 };
53
+ const { w, h } = this.size;
51
54
  return [
52
- { id: 'in', type: 'in', pos: { x: 0, y: -h / 2 } },
53
- { id: 'out', type: 'out', pos: { x: 0, y: h / 2 } }
54
- ];
55
+ { id: 'in', type: 'in', pos: { x: 0, y: -h / 2 }, angle: 270 },
56
+ { id: 'out', type: 'out', pos: { x: 0, y: h / 2 }, angle: 90 }
57
+ ].map(anchorModel => this.applyAnchorsOption(anchorModel));
55
58
  }
56
59
  }
57
60
  //# sourceMappingURL=task.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"task.js","sourceRoot":"","sources":["../../../src/nodes/task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,KAAK,CAAA;AAK5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAA;AAElF,MAAM,OAAO,IAAK,SAAQ,gBAAgB;IAA1C;;QACU,mBAAc,GAA0B;YAC9C;gBACE,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,SAAS;aACjB;YACD;gBACE,IAAI,EAAE,qBAAqB;gBAC3B,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,UAAU;aAClB;YACD;gBACE,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,OAAO;gBACd,QAAQ,EAAE;oBACR,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;iBACnC;aACF;SACF,CAAA;IAqCH,CAAC;IAnCC,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,cAAc,CAAA;IAC5B,CAAC;IAED,IAAI,aAAa,CAAC,aAAoC;QACpD,IAAI,CAAC,cAAc,GAAG,aAAa,CAAA;IACrC,CAAC;IAED,IAAI,IAAI;QACN,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAI,WAAW;QACb,OAAO,4BAA4B,CAAC,IAAI,CAAC,aAAa,IAAI,EAAE,CAAC,CAAA;IAC/D,CAAC;IAED,UAAU;QACR,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAA;QAC/C,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;QAChB,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;QAEhB,OAAO,GAAG,CAAA;sCACwB,CAAC,QAAQ,CAAC,YAAY,CAAC,aAAa,CAAC;kEACT,IAAI,CAAC,KAAK;KACvE,CAAA;IACH,CAAC;IAED,IAAI,YAAY;QACd,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAA;QAE/C,OAAO;YACL,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE;YAClD,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE;SACpD,CAAA;IACH,CAAC;CACF","sourcesContent":["import { svg, SVGTemplateResult } from 'lit'\n\nimport { PropertySpec } from '@operato/property-editor'\n\nimport { AnchorModel } from '../types.js'\nimport { FlowNodeAbstract } from '../base/flow-node-abstract.js'\nimport { convertPropertySpecsToSchema } from '../utils/generate-mapping-scheme.js'\n\nexport class Task extends FlowNodeAbstract {\n private _propertySpecs: PropertySpec[] | null = [\n {\n type: 'string',\n name: 'message',\n label: 'message'\n },\n {\n type: 'scenario-step-input',\n name: 'accessor',\n label: 'accessor'\n },\n {\n type: 'select',\n name: 'level',\n label: 'level',\n property: {\n options: ['info', 'warn', 'error']\n }\n }\n ]\n\n get propertySpecs(): PropertySpec[] | null {\n return this._propertySpecs\n }\n\n set propertySpecs(propertySpecs: PropertySpec[] | null) {\n this._propertySpecs = propertySpecs\n }\n\n get type() {\n return 'task'\n }\n\n get inputSchema() {\n return convertPropertySpecsToSchema(this.propertySpecs || [])\n }\n\n renderNode(): SVGTemplateResult {\n const { w, h } = this.size || { w: 120, h: 60 }\n const x = -w / 2\n const y = -h / 2\n\n return svg`\n <rect class=\"node-outline\" x=\"${x}\" y=\"${y}\" width=\"${w}\" height=\"${h}\" fill=\"#d1ecf1\" stroke-width=\"1\"/>\n <text class=\"node-label\" x=\"0\" y=\"5\" text-anchor=\"middle\">${this.label}</text>\n `\n }\n\n get anchorModels(): AnchorModel[] {\n const { w, h } = this.size || { w: 120, h: 60 }\n\n return [\n { id: 'in', type: 'in', pos: { x: 0, y: -h / 2 } },\n { id: 'out', type: 'out', pos: { x: 0, y: h / 2 } }\n ]\n }\n}\n"]}
1
+ {"version":3,"file":"task.js","sourceRoot":"","sources":["../../../src/nodes/task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,KAAK,CAAA;AAK5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAA;AAElF,MAAM,OAAO,IAAK,SAAQ,gBAAgB;IAA1C;;QACU,mBAAc,GAA0B;YAC9C;gBACE,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,SAAS;aACjB;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AE,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE;YAC9D,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;SAC/D,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,WAA0B,CAAC,CAAC,CAAA;IAC3E,CAAC;CACF","sourcesContent":["import { svg, SVGTemplateResult } from 'lit'\n\nimport { PropertySpec } from '@operato/property-editor'\n\nimport { AnchorModel } from '../types.js'\nimport { FlowNodeAbstract } from '../base/flow-node-abstract.js'\nimport { convertPropertySpecsToSchema } from '../utils/generate-mapping-scheme.js'\n\nexport class Task extends FlowNodeAbstract {\n private _propertySpecs: PropertySpec[] | null = [\n {\n type: 'string',\n name: 'message',\n label: 'message'\n },\n {\n type: 'scenario-step-input',\n name: 'accessor',\n label: 'accessor'\n },\n {\n type: 'select',\n name: 'level',\n label: 'level',\n property: {\n options: ['info', 'warn', 'error']\n }\n }\n ]\n\n get propertySpecs(): PropertySpec[] | null {\n return this._propertySpecs\n }\n\n set propertySpecs(propertySpecs: PropertySpec[] | null) {\n this._propertySpecs = propertySpecs\n }\n\n get type() {\n return 'task'\n }\n\n get inputSchema() {\n return convertPropertySpecsToSchema(this.propertySpecs || [])\n }\n\n get size(): { w: number; h: number } {\n return this.model!.size || { w: 120, h: 60 }\n }\n\n renderNode(): SVGTemplateResult {\n const { w, h } = this.size\n const x = -w / 2\n const y = -h / 2\n\n return svg`\n <rect class=\"node-outline\" x=\"${x}\" y=\"${y}\" width=\"${w}\" height=\"${h}\" fill=\"#d1ecf1\" stroke-width=\"1\"/>\n <text class=\"node-label\" x=\"0\" y=\"5\" text-anchor=\"middle\">${this.label}</text>\n `\n }\n\n get anchorModels(): AnchorModel[] {\n const { w, h } = this.size\n\n return [\n { id: 'in', type: 'in', pos: { x: 0, y: -h / 2 }, angle: 270 },\n { id: 'out', type: 'out', pos: { x: 0, y: h / 2 }, angle: 90 }\n ].map(anchorModel => this.applyAnchorsOption(anchorModel as AnchorModel))\n }\n}\n"]}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license Copyright © HatioLab Inc. All rights reserved.
3
+ */
4
+ import '@material/web/icon/icon.js';
5
+ import { OxFormField } from '@operato/input';
6
+ import { AnchorModel } from '../types';
7
+ export declare class OxInputAnchors extends OxFormField<AnchorModel[]> {
8
+ static styles: import("lit").CSSResult[];
9
+ value: AnchorModel[];
10
+ render(): import("lit-html").TemplateResult<1>;
11
+ onClick(e: MouseEvent): void;
12
+ }
@@ -0,0 +1,163 @@
1
+ /**
2
+ * @license Copyright © HatioLab Inc. All rights reserved.
3
+ */
4
+ import { __decorate } from "tslib";
5
+ import '@material/web/icon/icon.js';
6
+ import { css, html } from 'lit';
7
+ import { customElement, property } from 'lit/decorators.js';
8
+ import { OxFormField } from '@operato/input';
9
+ let OxInputAnchors = class OxInputAnchors extends OxFormField {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.value = [];
13
+ }
14
+ render() {
15
+ const anchors = this.value || [];
16
+ return html `
17
+ <fieldset>
18
+ <ul>
19
+ ${anchors.map(({ id, angle, type }) => html `
20
+ <li>
21
+ <div data-id=${id}>${id}</div>
22
+ <div @click=${this.onClick.bind(this)} data-angle=${angle} data-type=${type}>
23
+ ${type == 'in'
24
+ ? html `
25
+ <md-icon ?selected=${angle == 180} data-angle="180">step_into</md-icon>
26
+ <md-icon ?selected=${angle == 90} data-angle="90">step_into</md-icon>
27
+ <md-icon ?selected=${angle == 270} data-angle="270">step_into</md-icon>
28
+ <md-icon ?selected=${angle == 0} data-angle="0">step_into</md-icon>
29
+ `
30
+ : html `
31
+ <md-icon ?selected=${angle == 180} data-angle="180">step_out</md-icon>
32
+ <md-icon ?selected=${angle == 90} data-angle="90">step_out</md-icon>
33
+ <md-icon ?selected=${angle == 270} data-angle="270">step_out</md-icon>
34
+ <md-icon ?selected=${angle == 0} data-angle="0">step_out</md-icon>
35
+ `}
36
+ </div>
37
+ </li>
38
+ `)}
39
+ </ul>
40
+ </fieldset>
41
+ `;
42
+ }
43
+ onClick(e) {
44
+ e.stopPropagation();
45
+ const target = e.target;
46
+ const currentTarget = e.currentTarget;
47
+ if (target === currentTarget || !target.hasAttribute('data-angle')) {
48
+ return;
49
+ }
50
+ const value = target.getAttribute('data-angle');
51
+ currentTarget.setAttribute('data-angle', value);
52
+ const lis = this.renderRoot.querySelectorAll('li');
53
+ this.value = Array.from(lis).map(li => {
54
+ var _a, _b;
55
+ const id = (_a = li.querySelector('[data-id]')) === null || _a === void 0 ? void 0 : _a.getAttribute('data-id');
56
+ const angle = (_b = li.querySelector('div[data-angle]')) === null || _b === void 0 ? void 0 : _b.getAttribute('data-angle');
57
+ const origin = this.value.find(anchor => anchor.id == id);
58
+ return { ...origin, angle: Number(angle) };
59
+ });
60
+ this.dispatchEvent(new CustomEvent('change', {
61
+ bubbles: true,
62
+ composed: true,
63
+ detail: this.value
64
+ }));
65
+ }
66
+ };
67
+ OxInputAnchors.styles = [
68
+ css `
69
+ :host {
70
+ display: flex;
71
+ --md-icon-size: 1.4em;
72
+ }
73
+
74
+ fieldset {
75
+ flex: 1;
76
+ font-size: 0.8em;
77
+ border: 0;
78
+ border-bottom: 1px solid;
79
+ background-color: var(--md-sys-color-surface-variant);
80
+ padding: var(--spacing-medium);
81
+ }
82
+
83
+ ul {
84
+ display: flex;
85
+ flex-direction: column;
86
+ gap: var(--spacing-small);
87
+
88
+ padding: 0;
89
+ margin: 0;
90
+ }
91
+
92
+ li {
93
+ display: flex;
94
+ flex-direction: row;
95
+ align-items: center;
96
+ gap: var(--spacing-large);
97
+ }
98
+
99
+ li > * {
100
+ flex: 1;
101
+ }
102
+
103
+ div[data-id] {
104
+ text-align: right;
105
+ }
106
+
107
+ div[data-angle] {
108
+ display: flex;
109
+ justify-content: space-between;
110
+ }
111
+
112
+ md-icon {
113
+ color: var(--md-sys-color-on-background);
114
+ background-color: var(--md-sys-color-background);
115
+ }
116
+
117
+ md-icon[selected] {
118
+ color: var(--md-sys-color-on-primary);
119
+ background-color: var(--md-sys-color-primary);
120
+ }
121
+
122
+ /* 아이콘 회전 */
123
+ div[data-type='in'] md-icon[data-angle='270'] {
124
+ transform: rotate(0deg);
125
+ }
126
+
127
+ div[data-type='in'] md-icon[data-angle='0'] {
128
+ transform: rotate(90deg);
129
+ }
130
+
131
+ div[data-type='in'] md-icon[data-angle='180'] {
132
+ transform: rotate(-90deg);
133
+ }
134
+
135
+ div[data-type='in'] md-icon[data-angle='90'] {
136
+ transform: rotate(180deg);
137
+ }
138
+
139
+ div[data-type='out'] md-icon[data-angle='270'] {
140
+ transform: rotate(0deg);
141
+ }
142
+
143
+ div[data-type='out'] md-icon[data-angle='0'] {
144
+ transform: rotate(90deg);
145
+ }
146
+
147
+ div[data-type='out'] md-icon[data-angle='180'] {
148
+ transform: rotate(-90deg);
149
+ }
150
+
151
+ div[data-type='out'] md-icon[data-angle='90'] {
152
+ transform: rotate(180deg);
153
+ }
154
+ `
155
+ ];
156
+ __decorate([
157
+ property({ attribute: false })
158
+ ], OxInputAnchors.prototype, "value", void 0);
159
+ OxInputAnchors = __decorate([
160
+ customElement('ox-input-anchors')
161
+ ], OxInputAnchors);
162
+ export { OxInputAnchors };
163
+ //# sourceMappingURL=ox-input-anchors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-input-anchors.js","sourceRoot":"","sources":["../../../src/property-editors/ox-input-anchors.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,WAAW,EAAE,MAA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CAAC,IAAI,CAAC,CAAA;QAClD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;;YACpC,MAAM,EAAE,GAAG,MAAA,EAAE,CAAC,aAAa,CAAC,WAAW,CAAC,0CAAE,YAAY,CAAC,SAAS,CAAE,CAAA;YAClE,MAAM,KAAK,GAAG,MAAA,EAAE,CAAC,aAAa,CAAC,iBAAiB,CAAC,0CAAE,YAAY,CAAC,YAAY,CAAC,CAAA;YAC7E,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAE,CAAA;YAE1D,OAAO,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAA;QAC5C,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,QAAQ,EAAE;YACxB,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,IAAI,CAAC,KAAK;SACnB,CAAC,CACH,CAAA;IACH,CAAC;;AA3JM,qBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAsFF;CACF,AAxFY,CAwFZ;AAE+B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;6CAA0B;AA3F9C,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA6J1B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@material/web/icon/icon.js'\n\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { OxFormField } from '@operato/input'\nimport { AnchorModel } from '../types'\n\n@customElement('ox-input-anchors')\nexport class OxInputAnchors extends OxFormField<AnchorModel[]> {\n static styles = [\n css`\n :host {\n display: flex;\n --md-icon-size: 1.4em;\n }\n\n fieldset {\n flex: 1;\n font-size: 0.8em;\n border: 0;\n border-bottom: 1px solid;\n background-color: var(--md-sys-color-surface-variant);\n padding: var(--spacing-medium);\n }\n\n ul {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-small);\n\n padding: 0;\n margin: 0;\n }\n\n li {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--spacing-large);\n }\n\n li > * {\n flex: 1;\n }\n\n div[data-id] {\n text-align: right;\n }\n\n div[data-angle] {\n display: flex;\n justify-content: space-between;\n }\n\n md-icon {\n color: var(--md-sys-color-on-background);\n background-color: var(--md-sys-color-background);\n }\n\n md-icon[selected] {\n color: var(--md-sys-color-on-primary);\n background-color: var(--md-sys-color-primary);\n }\n\n /* 아이콘 회전 */\n div[data-type='in'] md-icon[data-angle='270'] {\n transform: rotate(0deg);\n }\n\n div[data-type='in'] md-icon[data-angle='0'] {\n transform: rotate(90deg);\n }\n\n div[data-type='in'] md-icon[data-angle='180'] {\n transform: rotate(-90deg);\n }\n\n div[data-type='in'] md-icon[data-angle='90'] {\n transform: rotate(180deg);\n }\n\n div[data-type='out'] md-icon[data-angle='270'] {\n transform: rotate(0deg);\n }\n\n div[data-type='out'] md-icon[data-angle='0'] {\n transform: rotate(90deg);\n }\n\n div[data-type='out'] md-icon[data-angle='180'] {\n transform: rotate(-90deg);\n }\n\n div[data-type='out'] md-icon[data-angle='90'] {\n transform: rotate(180deg);\n }\n `\n ]\n\n @property({ attribute: false }) value: AnchorModel[] = []\n\n render() {\n const anchors = this.value || []\n\n return html`\n <fieldset>\n <ul>\n ${anchors.map(\n ({ id, angle, type }) => html`\n <li>\n <div data-id=${id!}>${id}</div>\n <div @click=${this.onClick.bind(this)} data-angle=${angle!} data-type=${type}>\n ${type == 'in'\n ? html`\n <md-icon ?selected=${angle == 180} data-angle=\"180\">step_into</md-icon>\n <md-icon ?selected=${angle == 90} data-angle=\"90\">step_into</md-icon>\n <md-icon ?selected=${angle == 270} data-angle=\"270\">step_into</md-icon>\n <md-icon ?selected=${angle == 0} data-angle=\"0\">step_into</md-icon>\n `\n : html`\n <md-icon ?selected=${angle == 180} data-angle=\"180\">step_out</md-icon>\n <md-icon ?selected=${angle == 90} data-angle=\"90\">step_out</md-icon>\n <md-icon ?selected=${angle == 270} data-angle=\"270\">step_out</md-icon>\n <md-icon ?selected=${angle == 0} data-angle=\"0\">step_out</md-icon>\n `}\n </div>\n </li>\n `\n )}\n </ul>\n </fieldset>\n `\n }\n\n onClick(e: MouseEvent) {\n e.stopPropagation()\n\n const target = e.target as Element\n const currentTarget = e.currentTarget as Element\n\n if (target === currentTarget || !target.hasAttribute('data-angle')) {\n return\n }\n\n const value = target.getAttribute('data-angle') as string\n\n currentTarget.setAttribute('data-angle', value)\n\n const lis = this.renderRoot.querySelectorAll('li')\n this.value = Array.from(lis).map(li => {\n const id = li.querySelector('[data-id]')?.getAttribute('data-id')!\n const angle = li.querySelector('div[data-angle]')?.getAttribute('data-angle')\n const origin = this.value.find(anchor => anchor.id == id)!\n\n return { ...origin, angle: Number(angle) }\n })\n\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }\n}\n"]}
File without changes
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=ox-input-nodes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-input-nodes.js","sourceRoot":"","sources":["../../../src/property-editors/ox-input-nodes.ts"],"names":[],"mappings":"","sourcesContent":[""]}
@@ -0,0 +1,6 @@
1
+ import './ox-input-anchors';
2
+ import { OxPropertyEditor, PropertySpec } from '@operato/property-editor';
3
+ import { AnchorModel } from '../types';
4
+ export declare class PropertyEditorAnchors extends OxPropertyEditor {
5
+ editorTemplate(value: AnchorModel[], spec: PropertySpec): import("lit-html").TemplateResult<1>;
6
+ }
@@ -0,0 +1,25 @@
1
+ import { __decorate } from "tslib";
2
+ import './ox-input-anchors';
3
+ import { html } from 'lit';
4
+ import { customElement } from 'lit/decorators.js';
5
+ import { OxPropertyEditor } from '@operato/property-editor';
6
+ let PropertyEditorAnchors = class PropertyEditorAnchors extends OxPropertyEditor {
7
+ editorTemplate(value, spec) {
8
+ const { defaultValue = [] } = spec;
9
+ value || (value = []);
10
+ const anchors = defaultValue
11
+ .map(({ id, ...others }) => {
12
+ const anchor = value.find(v => v.id == id);
13
+ if (anchor) {
14
+ return { ...others, ...anchor };
15
+ }
16
+ })
17
+ .filter(Boolean);
18
+ return html ` <ox-input-anchors .value=${anchors} fullwidth></ox-input-anchors> `;
19
+ }
20
+ };
21
+ PropertyEditorAnchors = __decorate([
22
+ customElement('ox-property-editor-anchors')
23
+ ], PropertyEditorAnchors);
24
+ export { PropertyEditorAnchors };
25
+ //# sourceMappingURL=ox-property-editor-anchors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-property-editor-anchors.js","sourceRoot":"","sources":["../../../src/property-editors/ox-property-editor-anchors.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,gBAAgB,EAAgB,MAAM,0BAA0B,CAAA;AAIlE,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,gBAAgB;IACzD,cAAc,CAAC,KAAoB,EAAE,IAAkB;QACrD,MAAM,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,IAAI,CAAA;QAClC,KAAK,KAAL,KAAK,GAAK,EAAE,EAAA;QAEZ,MAAM,OAAO,GAAI,YAA8B;aAC5C,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,EAAE;YACzB,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAA;YAC1C,IAAI,MAAM,EAAE,CAAC;gBACX,OAAO,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,CAAA;YACjC,CAAC;QACH,CAAC,CAAC;aACD,MAAM,CAAC,OAAO,CAAkB,CAAA;QAEnC,OAAO,IAAI,CAAA,6BAA6B,OAAO,iCAAiC,CAAA;IAClF,CAAC;CACF,CAAA;AAhBY,qBAAqB;IADjC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,qBAAqB,CAgBjC","sourcesContent":["import './ox-input-anchors'\n\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { OxPropertyEditor, PropertySpec } from '@operato/property-editor'\nimport { AnchorModel } from '../types'\n\n@customElement('ox-property-editor-anchors')\nexport class PropertyEditorAnchors extends OxPropertyEditor {\n editorTemplate(value: AnchorModel[], spec: PropertySpec) {\n const { defaultValue = [] } = spec\n value ||= []\n\n const anchors = (defaultValue as AnchorModel[])\n .map(({ id, ...others }) => {\n const anchor = value.find(v => v.id == id)\n if (anchor) {\n return { ...others, ...anchor }\n }\n })\n .filter(Boolean) as AnchorModel[]\n\n return html` <ox-input-anchors .value=${anchors} fullwidth></ox-input-anchors> `\n }\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import './ox-input-anchors';
2
+ import { OxPropertyEditor, PropertySpec } from '@operato/property-editor';
3
+ import { Anchor } from '../types';
4
+ export declare class PropertyEditorAnchors extends OxPropertyEditor {
5
+ editorTemplate(value: Anchor[], spec: PropertySpec): import("lit-html").TemplateResult<1>;
6
+ }
@@ -0,0 +1,25 @@
1
+ import { __decorate } from "tslib";
2
+ import './ox-input-anchors';
3
+ import { html } from 'lit';
4
+ import { customElement } from 'lit/decorators.js';
5
+ import { OxPropertyEditor } from '@operato/property-editor';
6
+ let PropertyEditorAnchors = class PropertyEditorAnchors extends OxPropertyEditor {
7
+ editorTemplate(value, spec) {
8
+ const { defaultValue = [] } = spec;
9
+ value || (value = []);
10
+ const anchors = defaultValue
11
+ .map(({ id, ...others }) => {
12
+ const anchor = value.find(v => v.id == id);
13
+ if (anchor) {
14
+ return { ...others, ...anchor };
15
+ }
16
+ })
17
+ .filter(Boolean);
18
+ return html ` <ox-input-anchors .value=${anchors} fullwidth></ox-input-anchors> `;
19
+ }
20
+ };
21
+ PropertyEditorAnchors = __decorate([
22
+ customElement('ox-property-editor-anchors')
23
+ ], PropertyEditorAnchors);
24
+ export { PropertyEditorAnchors };
25
+ //# sourceMappingURL=ox-property-editor-nodes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-property-editor-nodes.js","sourceRoot":"","sources":["../../../src/property-editors/ox-property-editor-nodes.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,gBAAgB,EAAgB,MAAM,0BAA0B,CAAA;AAIlE,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,gBAAgB;IACzD,cAAc,CAAC,KAAe,EAAE,IAAkB;QAChD,MAAM,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,IAAI,CAAA;QAClC,KAAK,KAAL,KAAK,GAAK,EAAE,EAAA;QAEZ,MAAM,OAAO,GAAI,YAAyB;aACvC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,EAAE;YACzB,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAA;YAC1C,IAAI,MAAM,EAAE,CAAC;gBACX,OAAO,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,CAAA;YACjC,CAAC;QACH,CAAC,CAAC;aACD,MAAM,CAAC,OAAO,CAAC,CAAA;QAElB,OAAO,IAAI,CAAA,6BAA6B,OAAO,iCAAiC,CAAA;IAClF,CAAC;CACF,CAAA;AAhBY,qBAAqB;IADjC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,qBAAqB,CAgBjC","sourcesContent":["import './ox-input-anchors'\n\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { OxPropertyEditor, PropertySpec } from '@operato/property-editor'\nimport { Anchor } from '../types'\n\n@customElement('ox-property-editor-anchors')\nexport class PropertyEditorAnchors extends OxPropertyEditor {\n editorTemplate(value: Anchor[], spec: PropertySpec) {\n const { defaultValue = [] } = spec\n value ||= []\n\n const anchors = (defaultValue as Anchor[])\n .map(({ id, ...others }) => {\n const anchor = value.find(v => v.id == id)\n if (anchor) {\n return { ...others, ...anchor }\n }\n })\n .filter(Boolean)\n\n return html` <ox-input-anchors .value=${anchors} fullwidth></ox-input-anchors> `\n }\n}\n"]}
@@ -54,9 +54,14 @@ export interface FlowNodeModel extends FlowEntityModel, FlowNodeDataSchema {
54
54
  w: number;
55
55
  h: number;
56
56
  };
57
+ anchorsOption?: {
58
+ id: string;
59
+ [key: string]: any;
60
+ }[];
57
61
  }
58
62
  export interface FlowNode extends FlowEntity, FlowNodeModel {
59
- anchors?: Anchor[];
63
+ anchors: Anchor[];
64
+ anchorModels: AnchorModel[];
60
65
  findAnchor(id: string): Anchor | undefined;
61
66
  render(): SVGTemplateResult;
62
67
  renderNode(): SVGTemplateResult;
@@ -1 +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"]}
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 anchorsOption?: { id: string; [key: string]: any }[]\n}\n\nexport interface FlowNode extends FlowEntity, FlowNodeModel {\n anchors: Anchor[]\n anchorModels: AnchorModel[]\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"]}
@@ -108,7 +108,7 @@ Standard.args = {
108
108
  },
109
109
  {
110
110
  id: 'edge4',
111
- from: { nodeId: 'decision-1', anchorId: 'no-2' },
111
+ from: { nodeId: 'decision-1', anchorId: 'no' },
112
112
  to: { nodeId: 'task-3', anchorId: 'in' },
113
113
  label: 'No',
114
114
  weight: 1
@@ -1 +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,KAAK,EAAE;QACL,KAAK,EAAE,EAAE;QACT,KAAK,EAAE,EAAE;KACV;CACF,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA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AM,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"]}
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,EA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AC3C,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' },\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"]}