@opens/service-workflow-ui 1.1.1 → 1.2.1

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/README.md CHANGED
@@ -23,7 +23,11 @@ app.use(ServiceWorkflowUi);
23
23
  <app-service-workflow-editor
24
24
  workflow-id="main-flow"
25
25
  v-model="flow"
26
- :allowed-node-types="['screen', 'identification', 'service']"
26
+ :allowed-node-types="[
27
+ { id: 'widget-base-screen' },
28
+ { id: 'widget-identification-screen' },
29
+ { id: 'widget-service-screen' },
30
+ ]"
27
31
  @node="handleNode"
28
32
  @change="handleChange"
29
33
  @invalid-change="handleInvalidChange"
@@ -38,22 +42,23 @@ app.use(ServiceWorkflowUi);
38
42
 
39
43
  `workflow-id` connects one editor to external add and edit forms through Pinia. The consumer owns
40
44
  the Pinia instance; the library never installs or replaces it. Both forms can be positioned
41
- anywhere in the application. Selecting an editable `screen`, `service`, or `identification` node
42
- opens the matching form; saving emits the updated workflow through the editor's `v-model` and
43
- `change` event. The edit form emits `close` whenever an active form closes.
45
+ anywhere in the application. Selecting an editable `widget-base-screen`,
46
+ `widget-service-screen`, or `widget-identification-screen` node opens the matching form; saving
47
+ emits the updated workflow through the editor's `v-model` and `change` event. The edit form emits
48
+ `close` whenever an active form closes.
44
49
 
45
50
  The editor keeps externally supplied workflows editable, including partially configured rules and
46
51
  connections. It does not validate the complete workflow or switch to a global read-only mode.
47
52
 
48
- Node-type descriptors may define a maximum number of outgoing children. Every rule with remaining
49
- capacity displays one rolling purple add placeholder, regardless of how many slots remain.
50
- `maxChildren: 0` disables child creation for that type.
53
+ Node-type descriptors use `id` as their primary key and may define a maximum number of outgoing
54
+ children. Every rule with remaining capacity displays one rolling purple add placeholder,
55
+ regardless of how many slots remain. `maxChildren: 0` disables child creation for that type.
51
56
 
52
57
  ```ts
53
58
  const allowedNodeTypes = [
54
- { type: 'screen', maxChildren: 2 },
55
- { type: 'identification', maxChildren: 1 },
56
- { type: 'service', maxChildren: 0 },
59
+ { id: 'widget-base-screen', maxChildren: 2 },
60
+ { id: 'widget-identification-screen', maxChildren: 1 },
61
+ { id: 'widget-service-screen', maxChildren: 0 },
57
62
  ];
58
63
  ```
59
64
 
package/dist/main.d.ts CHANGED
@@ -20,9 +20,18 @@ declare type __VLS_Props_2 = {
20
20
  declare type __VLS_Props_3 = {
21
21
  workflowId: string;
22
22
  modelValue: any;
23
- allowedNodeTypes?: any[];
23
+ allowedNodeTypes?: AllowedNodeType[];
24
24
  };
25
25
 
26
+ export declare interface AllowedNodeType {
27
+ id: string;
28
+ label?: string;
29
+ color?: string;
30
+ icon?: string;
31
+ defaultName?: string;
32
+ maxChildren?: number;
33
+ }
34
+
26
35
  export declare const AppServiceWorkflowAddForm: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
27
36
 
28
37
  export declare const AppServiceWorkflowEditNodeForm: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
@@ -44,7 +53,7 @@ onNode?: ((rule: any) => any) | undefined;
44
53
  "onInvalid-change"?: ((invalid: InvalidChange) => any) | undefined;
45
54
  "onInvalid-model"?: ((invalid: InvalidModel) => any) | undefined;
46
55
  }>, {
47
- allowedNodeTypes: any[];
56
+ allowedNodeTypes: AllowedNodeType[];
48
57
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
49
58
 
50
59
  declare const _default: {
@@ -62,7 +71,7 @@ export declare interface InvalidModel {
62
71
  }
63
72
 
64
73
  export declare interface NormalizedNodeType {
65
- type: string;
74
+ id: string;
66
75
  label: string;
67
76
  color: string;
68
77
  icon: string;