@opens/service-workflow-ui 1.1.0 → 1.2.0

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,11 +23,14 @@ 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']"
27
- @change="handleChange"
26
+ :allowed-node-types="[
27
+ { id: 'widget-base-screen' },
28
+ { id: 'widget-identification-screen' },
29
+ { id: 'widget-service-screen' },
30
+ ]"
28
31
  @node="handleNode"
32
+ @change="handleChange"
29
33
  @invalid-change="handleInvalidChange"
30
- @invalid-model="handleInvalidModel"
31
34
  ></app-service-workflow-editor>
32
35
 
33
36
  <app-service-workflow-add-form workflow-id="main-flow"></app-service-workflow-add-form>
@@ -39,22 +42,23 @@ app.use(ServiceWorkflowUi);
39
42
 
40
43
  `workflow-id` connects one editor to external add and edit forms through Pinia. The consumer owns
41
44
  the Pinia instance; the library never installs or replaces it. Both forms can be positioned
42
- anywhere in the application. Selecting an editable `screen`, `service`, or `identification` node
43
- opens the matching form; saving emits the updated workflow through the editor's `v-model` and
44
- `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.
45
49
 
46
- A non-empty flow must contain exactly one rule with `isRoot: true`. Disconnected rules, multiple
47
- parents, and cycles are supported. Invalid models remain visible in read-only mode.
50
+ The editor keeps externally supplied workflows editable, including partially configured rules and
51
+ connections. It does not validate the complete workflow or switch to a global read-only mode.
48
52
 
49
- Node-type descriptors may define a maximum number of outgoing children. Every rule with remaining
50
- capacity displays one rolling purple add placeholder, regardless of how many slots remain.
51
- `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.
52
56
 
53
57
  ```ts
54
58
  const allowedNodeTypes = [
55
- { type: 'screen', maxChildren: 2 },
56
- { type: 'identification', maxChildren: 1 },
57
- { 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 },
58
62
  ];
59
63
  ```
60
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;