@cyoda/workflow-react 0.2.0 → 0.3.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;
@@ -128,93 +161,8 @@ declare const defaultMessages: {
128
161
  noneManual: string;
129
162
  noneAutomated: string;
130
163
  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
164
  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
- };
165
+ applyModal: string;
218
166
  };
219
167
  };
220
168
  type Messages = typeof defaultMessages;
@@ -234,6 +182,40 @@ declare const I18nContext: react.Context<{
234
182
  addState: string;
235
183
  addNote: string;
236
184
  addStateButton: string;
185
+ help: string;
186
+ };
187
+ help: {
188
+ title: string;
189
+ statesTitle: string;
190
+ stateInitial: string;
191
+ stateDefault: string;
192
+ stateProcessing: string;
193
+ stateManualReview: string;
194
+ stateTerminal: string;
195
+ stateError: string;
196
+ stateWarning: string;
197
+ transitionsTitle: string;
198
+ transitionAutomated: string;
199
+ transitionManual: string;
200
+ transitionConditional: string;
201
+ transitionProcessing: string;
202
+ transitionTerminal: string;
203
+ transitionLoop: string;
204
+ transitionDisabled: string;
205
+ controlsTitle: string;
206
+ shortcutAddState: string;
207
+ shortcutAutoLayout: string;
208
+ shortcutUndo: string;
209
+ shortcutRedo: string;
210
+ shortcutSave: string;
211
+ shortcutDelete: string;
212
+ shortcutEscape: string;
213
+ tipsTitle: string;
214
+ tipDoubleClick: string;
215
+ tipConnect: string;
216
+ tipSelect: string;
217
+ tipMove: string;
218
+ close: string;
237
219
  };
238
220
  issues: {
239
221
  title: string;
@@ -340,93 +322,8 @@ declare const I18nContext: react.Context<{
340
322
  noneManual: string;
341
323
  noneAutomated: string;
342
324
  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
325
  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
- };
326
+ applyModal: string;
430
327
  };
431
328
  }>;
432
329
  declare function useMessages(): Messages;
@@ -461,26 +358,6 @@ type Selection = null | {
461
358
  type JsonEditStatus = LiftResult | {
462
359
  status: "idle";
463
360
  };
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
361
  interface WorkflowJsonEditorConfig {
485
362
  monaco: WorkflowJsonMonacoRuntime;
486
363
  modelUri?: string;
@@ -523,6 +400,8 @@ interface WorkflowEditorProps {
523
400
  layoutMetadata?: WorkflowUiMeta;
524
401
  /** Called whenever layout positions or other editor-only metadata change. */
525
402
  onLayoutMetadataChange?: (meta: WorkflowUiMeta) => void;
403
+ /** Called with the full per-workflow UI map whenever any layout changes — use this for file-based persistence. */
404
+ onWorkflowUiChange?: (workflowUi: Record<string, WorkflowUiMeta>) => void;
526
405
  /**
527
406
  * localStorage key prefix for layout persistence. Defaults to
528
407
  * "cyoda-editor-layout". Pass `null` to disable localStorage persistence.
@@ -536,11 +415,6 @@ interface WorkflowEditorProps {
536
415
  jsonEditor?: WorkflowJsonEditorConfig | null;
537
416
  /** Reports JSON parse/schema/apply status for host UX. */
538
417
  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
418
  /**
545
419
  * Show developer-oriented affordances (raw JSON tab in the inspector and
546
420
  * other diagnostics). Defaults to `false` so SMEs/BAs see a clean view.
@@ -552,7 +426,7 @@ interface WorkflowEditorProps {
552
426
  type WorkflowEditorSurface = "dev-console";
553
427
  type WorkflowEditorLayout = "embedded" | "fullWidth";
554
428
  /** 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;
429
+ 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
430
 
557
431
  interface UseSaveFlowArgs {
558
432
  api: WorkflowApi;
@@ -609,7 +483,7 @@ interface SaveConfirmModalProps {
609
483
  * the warning count.
610
484
  * - The diff summary (if provided) is shown above the tick-boxes.
611
485
  */
612
- declare function SaveConfirmModal({ mode, requiresExplicitConfirm, warningCount, diffSummary, onConfirm, onCancel, }: SaveConfirmModalProps): react_jsx_runtime.JSX.Element;
486
+ declare function SaveConfirmModal({ mode, requiresExplicitConfirm, warningCount, diffSummary, onConfirm, onCancel, }: SaveConfirmModalProps): react.JSX.Element;
613
487
 
614
488
  interface ConflictBannerProps {
615
489
  onReload: () => void;
@@ -619,7 +493,7 @@ interface ConflictBannerProps {
619
493
  * 409-conflict banner per spec §17.4. Non-dismissable; the user must pick
620
494
  * Reload (discard local) or Force overwrite (resend without the token).
621
495
  */
622
- declare function ConflictBanner({ onReload, onForceOverwrite }: ConflictBannerProps): react_jsx_runtime.JSX.Element;
496
+ declare function ConflictBanner({ onReload, onForceOverwrite }: ConflictBannerProps): react.JSX.Element;
623
497
 
624
498
  /**
625
499
  * Produce a short human-readable diff summary between the last-known server
@@ -632,4 +506,4 @@ declare function ConflictBanner({ onReload, onForceOverwrite }: ConflictBannerPr
632
506
  */
633
507
  declare function diffSummary(server: WorkflowEditorDocument | null, local: WorkflowEditorDocument): string | null;
634
508
 
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 };
509
+ 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 };