@cyoda/workflow-react 0.2.0 → 0.4.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/dist/index.d.ts CHANGED
@@ -1,11 +1,10 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import * as react from 'react';
3
2
  import { ReactNode } from 'react';
4
- import { WorkflowEditorDocument, WorkflowUiMeta, EntityFieldHintProvider, SaveStatus, WorkflowApi, ConcurrencyToken, ImportMode } from '@cyoda/workflow-core';
5
- export { EntityFieldHintProvider, FieldHint } from '@cyoda/workflow-core';
3
+ import { WorkflowEditorDocument, WorkflowUiMeta, SaveStatus, WorkflowApi, ConcurrencyToken, ImportMode } from '@cyoda/workflow-core';
6
4
  import { LayoutOptions } from '@cyoda/workflow-layout';
7
5
  export { LayoutOptions, LayoutPreset, PinnedNode } from '@cyoda/workflow-layout';
8
- import { LiftResult, MonacoLike, TextModelLike, EditorLike } from '@cyoda/workflow-monaco';
6
+ import { LiftResult, WorkflowJsonMonacoRuntime } from '@cyoda/workflow-monaco';
7
+ export { WorkflowJsonEditorInstance, WorkflowJsonModelLike, WorkflowJsonMonacoRuntime } from '@cyoda/workflow-monaco';
9
8
 
10
9
  declare const defaultMessages: {
11
10
  toolbar: {
@@ -22,6 +21,40 @@ declare const defaultMessages: {
22
21
  addState: string;
23
22
  addNote: string;
24
23
  addStateButton: string;
24
+ help: string;
25
+ };
26
+ help: {
27
+ title: string;
28
+ statesTitle: string;
29
+ stateInitial: string;
30
+ stateDefault: string;
31
+ stateProcessing: string;
32
+ stateManualReview: string;
33
+ stateTerminal: string;
34
+ stateError: string;
35
+ stateWarning: string;
36
+ transitionsTitle: string;
37
+ transitionAutomated: string;
38
+ transitionManual: string;
39
+ transitionConditional: string;
40
+ transitionProcessing: string;
41
+ transitionTerminal: string;
42
+ transitionLoop: string;
43
+ transitionDisabled: string;
44
+ controlsTitle: string;
45
+ shortcutAddState: string;
46
+ shortcutAutoLayout: string;
47
+ shortcutUndo: string;
48
+ shortcutRedo: string;
49
+ shortcutSave: string;
50
+ shortcutDelete: string;
51
+ shortcutEscape: string;
52
+ tipsTitle: string;
53
+ tipDoubleClick: string;
54
+ tipConnect: string;
55
+ tipSelect: string;
56
+ tipMove: string;
57
+ close: string;
25
58
  };
26
59
  issues: {
27
60
  title: string;
@@ -54,6 +87,12 @@ declare const defaultMessages: {
54
87
  processes: string;
55
88
  criterion: string;
56
89
  criteria: string;
90
+ annotations: string;
91
+ annotationsAdd: string;
92
+ annotationsApply: string;
93
+ annotationsRevert: string;
94
+ annotationsRemove: string;
95
+ annotationsDocChanged: string;
57
96
  executionMode: string;
58
97
  addProcessor: string;
59
98
  removeProcessor: string;
@@ -128,93 +167,8 @@ declare const defaultMessages: {
128
167
  noneManual: string;
129
168
  noneAutomated: string;
130
169
  noneAutomatedWarning: string;
131
- type: string;
132
- jsonPath: string;
133
- operation: string;
134
- value: string;
135
- low: string;
136
- high: string;
137
- apply: string;
138
- applyModal: string;
139
170
  cancel: string;
140
- advanced: string;
141
- editJson: string;
142
- backToForm: string;
143
- preview: string;
144
- changeType: string;
145
- chooseConditionType: string;
146
- types: {
147
- simple: string;
148
- lifecycle: string;
149
- function: string;
150
- array: string;
151
- group: string;
152
- };
153
- invalidJson: string;
154
- valueIgnored: string;
155
- legacySuffix: string;
156
- legacyOperatorBanner: string;
157
- legacyNotBanner: string;
158
- likeHelp: string;
159
- matchesPatternHelpAlways: string;
160
- jsonPathError: {
161
- empty: string;
162
- "missing-root": string;
163
- "recursive-descent": string;
164
- "filter-expression": string;
165
- malformed: string;
166
- };
167
- betweenShape: string;
168
- likeWildcardHelp: string;
169
- matchesPatternHelp: string;
170
- wrapInGroup: string;
171
- group: {
172
- heading: string;
173
- operator: string;
174
- allConditions: string;
175
- anyCondition: string;
176
- addCondition: string;
177
- addGroup: string;
178
- edit: string;
179
- editing: string;
180
- complete: string;
181
- duplicate: string;
182
- moveUp: string;
183
- moveDown: string;
184
- remove: string;
185
- valid: string;
186
- invalid: string;
187
- empty: string;
188
- condition: string;
189
- depthWarning: string;
190
- legacyNotSuffix: string;
191
- };
192
- function: {
193
- name: string;
194
- nameEmpty: string;
195
- nameInvalid: string;
196
- config: string;
197
- configInvalid: string;
198
- precheck: string;
199
- precheckAdd: string;
200
- precheckRemove: string;
201
- };
202
- lifecycle: {
203
- field: string;
204
- };
205
- array: {
206
- values: string;
207
- addValue: string;
208
- addValuePlaceholder: string;
209
- };
210
- hints: {
211
- loading: string;
212
- error: string;
213
- noEntity: string;
214
- noMatches: string;
215
- typeLabel: string;
216
- retry: string;
217
- };
171
+ applyModal: string;
218
172
  };
219
173
  };
220
174
  type Messages = typeof defaultMessages;
@@ -234,6 +188,40 @@ declare const I18nContext: react.Context<{
234
188
  addState: string;
235
189
  addNote: string;
236
190
  addStateButton: string;
191
+ help: string;
192
+ };
193
+ help: {
194
+ title: string;
195
+ statesTitle: string;
196
+ stateInitial: string;
197
+ stateDefault: string;
198
+ stateProcessing: string;
199
+ stateManualReview: string;
200
+ stateTerminal: string;
201
+ stateError: string;
202
+ stateWarning: string;
203
+ transitionsTitle: string;
204
+ transitionAutomated: string;
205
+ transitionManual: string;
206
+ transitionConditional: string;
207
+ transitionProcessing: string;
208
+ transitionTerminal: string;
209
+ transitionLoop: string;
210
+ transitionDisabled: string;
211
+ controlsTitle: string;
212
+ shortcutAddState: string;
213
+ shortcutAutoLayout: string;
214
+ shortcutUndo: string;
215
+ shortcutRedo: string;
216
+ shortcutSave: string;
217
+ shortcutDelete: string;
218
+ shortcutEscape: string;
219
+ tipsTitle: string;
220
+ tipDoubleClick: string;
221
+ tipConnect: string;
222
+ tipSelect: string;
223
+ tipMove: string;
224
+ close: string;
237
225
  };
238
226
  issues: {
239
227
  title: string;
@@ -266,6 +254,12 @@ declare const I18nContext: react.Context<{
266
254
  processes: string;
267
255
  criterion: string;
268
256
  criteria: string;
257
+ annotations: string;
258
+ annotationsAdd: string;
259
+ annotationsApply: string;
260
+ annotationsRevert: string;
261
+ annotationsRemove: string;
262
+ annotationsDocChanged: string;
269
263
  executionMode: string;
270
264
  addProcessor: string;
271
265
  removeProcessor: string;
@@ -340,93 +334,8 @@ declare const I18nContext: react.Context<{
340
334
  noneManual: string;
341
335
  noneAutomated: string;
342
336
  noneAutomatedWarning: string;
343
- type: string;
344
- jsonPath: string;
345
- operation: string;
346
- value: string;
347
- low: string;
348
- high: string;
349
- apply: string;
350
- applyModal: string;
351
337
  cancel: string;
352
- advanced: string;
353
- editJson: string;
354
- backToForm: string;
355
- preview: string;
356
- changeType: string;
357
- chooseConditionType: string;
358
- types: {
359
- simple: string;
360
- lifecycle: string;
361
- function: string;
362
- array: string;
363
- group: string;
364
- };
365
- invalidJson: string;
366
- valueIgnored: string;
367
- legacySuffix: string;
368
- legacyOperatorBanner: string;
369
- legacyNotBanner: string;
370
- likeHelp: string;
371
- matchesPatternHelpAlways: string;
372
- jsonPathError: {
373
- empty: string;
374
- "missing-root": string;
375
- "recursive-descent": string;
376
- "filter-expression": string;
377
- malformed: string;
378
- };
379
- betweenShape: string;
380
- likeWildcardHelp: string;
381
- matchesPatternHelp: string;
382
- wrapInGroup: string;
383
- group: {
384
- heading: string;
385
- operator: string;
386
- allConditions: string;
387
- anyCondition: string;
388
- addCondition: string;
389
- addGroup: string;
390
- edit: string;
391
- editing: string;
392
- complete: string;
393
- duplicate: string;
394
- moveUp: string;
395
- moveDown: string;
396
- remove: string;
397
- valid: string;
398
- invalid: string;
399
- empty: string;
400
- condition: string;
401
- depthWarning: string;
402
- legacyNotSuffix: string;
403
- };
404
- function: {
405
- name: string;
406
- nameEmpty: string;
407
- nameInvalid: string;
408
- config: string;
409
- configInvalid: string;
410
- precheck: string;
411
- precheckAdd: string;
412
- precheckRemove: string;
413
- };
414
- lifecycle: {
415
- field: string;
416
- };
417
- array: {
418
- values: string;
419
- addValue: string;
420
- addValuePlaceholder: string;
421
- };
422
- hints: {
423
- loading: string;
424
- error: string;
425
- noEntity: string;
426
- noMatches: string;
427
- typeLabel: string;
428
- retry: string;
429
- };
338
+ applyModal: string;
430
339
  };
431
340
  }>;
432
341
  declare function useMessages(): Messages;
@@ -461,26 +370,6 @@ type Selection = null | {
461
370
  type JsonEditStatus = LiftResult | {
462
371
  status: "idle";
463
372
  };
464
- interface MonacoUriLike {
465
- toString(): string;
466
- }
467
- interface WorkflowJsonModelLike extends TextModelLike {
468
- dispose(): void;
469
- }
470
- interface WorkflowJsonEditorInstance extends EditorLike {
471
- dispose(): void;
472
- layout?: () => void;
473
- updateOptions?: (options: Record<string, unknown>) => void;
474
- }
475
- interface WorkflowJsonMonacoRuntime extends MonacoLike {
476
- Uri: {
477
- parse(value: string): MonacoUriLike;
478
- };
479
- editor: MonacoLike["editor"] & {
480
- createModel(value: string, language?: string, uri?: MonacoUriLike): WorkflowJsonModelLike;
481
- create(element: HTMLElement, options: Record<string, unknown>): WorkflowJsonEditorInstance;
482
- };
483
- }
484
373
  interface WorkflowJsonEditorConfig {
485
374
  monaco: WorkflowJsonMonacoRuntime;
486
375
  modelUri?: string;
@@ -523,6 +412,8 @@ interface WorkflowEditorProps {
523
412
  layoutMetadata?: WorkflowUiMeta;
524
413
  /** Called whenever layout positions or other editor-only metadata change. */
525
414
  onLayoutMetadataChange?: (meta: WorkflowUiMeta) => void;
415
+ /** Called with the full per-workflow UI map whenever any layout changes — use this for file-based persistence. */
416
+ onWorkflowUiChange?: (workflowUi: Record<string, WorkflowUiMeta>) => void;
526
417
  /**
527
418
  * localStorage key prefix for layout persistence. Defaults to
528
419
  * "cyoda-editor-layout". Pass `null` to disable localStorage persistence.
@@ -536,11 +427,6 @@ interface WorkflowEditorProps {
536
427
  jsonEditor?: WorkflowJsonEditorConfig | null;
537
428
  /** Reports JSON parse/schema/apply status for host UX. */
538
429
  onJsonStatusChange?: (status: JsonEditStatus) => void;
539
- /**
540
- * Optional model-schema autocomplete source for criterion jsonPath inputs.
541
- * When omitted, jsonPath inputs render as plain free-text fields.
542
- */
543
- hintProvider?: EntityFieldHintProvider;
544
430
  /**
545
431
  * Show developer-oriented affordances (raw JSON tab in the inspector and
546
432
  * other diagnostics). Defaults to `false` so SMEs/BAs see a clean view.
@@ -552,7 +438,7 @@ interface WorkflowEditorProps {
552
438
  type WorkflowEditorSurface = "dev-console";
553
439
  type WorkflowEditorLayout = "embedded" | "fullWidth";
554
440
  /** Top-level editor shell — spec §14. Provides viewer/playground/editor modes. */
555
- declare function WorkflowEditor({ document: initialDocument, mode, surface, layout, messages, layoutOptions, chrome, onChange, onSave, showSaveButton, toolbarStart, toolbarCenter, toolbarEnd, layoutMetadata: externalLayoutMeta, onLayoutMetadataChange, localStorageKey, enableJsonEditor, jsonEditorPlacement, jsonEditor, onJsonStatusChange, hintProvider, developerMode, }: WorkflowEditorProps): react_jsx_runtime.JSX.Element;
441
+ declare function WorkflowEditor({ document: initialDocument, mode, surface, layout, messages, layoutOptions, chrome, onChange, onSave, showSaveButton, toolbarStart, toolbarCenter, toolbarEnd, layoutMetadata: externalLayoutMeta, onLayoutMetadataChange, onWorkflowUiChange, localStorageKey, enableJsonEditor, jsonEditorPlacement, jsonEditor, onJsonStatusChange, developerMode, }: WorkflowEditorProps): react.JSX.Element;
556
442
 
557
443
  interface UseSaveFlowArgs {
558
444
  api: WorkflowApi;
@@ -609,7 +495,7 @@ interface SaveConfirmModalProps {
609
495
  * the warning count.
610
496
  * - The diff summary (if provided) is shown above the tick-boxes.
611
497
  */
612
- declare function SaveConfirmModal({ mode, requiresExplicitConfirm, warningCount, diffSummary, onConfirm, onCancel, }: SaveConfirmModalProps): react_jsx_runtime.JSX.Element;
498
+ declare function SaveConfirmModal({ mode, requiresExplicitConfirm, warningCount, diffSummary, onConfirm, onCancel, }: SaveConfirmModalProps): react.JSX.Element;
613
499
 
614
500
  interface ConflictBannerProps {
615
501
  onReload: () => void;
@@ -619,7 +505,7 @@ interface ConflictBannerProps {
619
505
  * 409-conflict banner per spec §17.4. Non-dismissable; the user must pick
620
506
  * Reload (discard local) or Force overwrite (resend without the token).
621
507
  */
622
- declare function ConflictBanner({ onReload, onForceOverwrite }: ConflictBannerProps): react_jsx_runtime.JSX.Element;
508
+ declare function ConflictBanner({ onReload, onForceOverwrite }: ConflictBannerProps): react.JSX.Element;
623
509
 
624
510
  /**
625
511
  * Produce a short human-readable diff summary between the last-known server
@@ -632,4 +518,4 @@ declare function ConflictBanner({ onReload, onForceOverwrite }: ConflictBannerPr
632
518
  */
633
519
  declare function diffSummary(server: WorkflowEditorDocument | null, local: WorkflowEditorDocument): string | null;
634
520
 
635
- export { type ChromeOptions, ConflictBanner, type ConflictBannerProps, type EditorMode, I18nContext, type JsonEditStatus, type Messages, type PartialMessages, SaveConfirmModal, type SaveConfirmModalProps, type SaveFlow, type Selection, type UseSaveFlowArgs, WorkflowEditor, type WorkflowEditorLayout, type WorkflowEditorProps, type WorkflowEditorSurface, type WorkflowJsonEditorConfig, type WorkflowJsonEditorInstance, type WorkflowJsonModelLike, type WorkflowJsonMonacoRuntime, defaultMessages, diffSummary, mergeMessages, useMessages, useSaveFlow };
521
+ export { type ChromeOptions, ConflictBanner, type ConflictBannerProps, type EditorMode, I18nContext, type JsonEditStatus, type Messages, type PartialMessages, SaveConfirmModal, type SaveConfirmModalProps, type SaveFlow, type Selection, type UseSaveFlowArgs, WorkflowEditor, type WorkflowEditorLayout, type WorkflowEditorProps, type WorkflowEditorSurface, type WorkflowJsonEditorConfig, defaultMessages, diffSummary, mergeMessages, useMessages, useSaveFlow };