@cyoda/workflow-react 0.4.0 → 0.4.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/dist/index.cjs CHANGED
@@ -128,6 +128,7 @@ var defaultMessages = {
128
128
  annotationsRevert: "Revert",
129
129
  annotationsRemove: "Remove",
130
130
  annotationsDocChanged: "Document changed underneath \u2014 Revert to reload.",
131
+ format: "Format",
131
132
  executionMode: "Execution mode",
132
133
  addProcessor: "Add processor",
133
134
  removeProcessor: "Remove",
@@ -149,7 +150,12 @@ var defaultMessages = {
149
150
  anchorBottomRight: "Bottom right",
150
151
  anchorLeftTop: "Left top",
151
152
  anchorLeft: "Left",
152
- anchorLeftBottom: "Left bottom"
153
+ anchorLeftBottom: "Left bottom",
154
+ detachPanel: "Detach panel",
155
+ dockPanel: "Dock panel",
156
+ minimize: "Minimize",
157
+ restore: "Restore",
158
+ minimizedTitle: "Inspector"
153
159
  },
154
160
  confirmDelete: {
155
161
  title: "Delete state?",
@@ -203,7 +209,9 @@ var defaultMessages = {
203
209
  noneAutomated: "No criterion. This automated transition will fire as soon as the entity reaches this state.",
204
210
  noneAutomatedWarning: "Automated transitions without criteria should usually be last in the transition order.",
205
211
  cancel: "Cancel",
206
- applyModal: "Apply"
212
+ applyModal: "Apply",
213
+ revert: "Revert",
214
+ collapse: "Collapse"
207
215
  }
208
216
  };
209
217
 
@@ -3352,6 +3360,9 @@ var smallSelectStyle = {
3352
3360
  };
3353
3361
 
3354
3362
  // src/inspector/AnnotationsField.tsx
3363
+ var import_react10 = require("react");
3364
+
3365
+ // src/inspector/JsonMonacoField.tsx
3355
3366
  var import_react9 = require("react");
3356
3367
 
3357
3368
  // src/inspector/CriterionMonacoContext.tsx
@@ -3377,6 +3388,127 @@ function installMonacoCancellationFilter() {
3377
3388
  }
3378
3389
  installMonacoCancellationFilter();
3379
3390
 
3391
+ // src/inspector/JsonMonacoField.tsx
3392
+ var import_jsx_runtime7 = require("react/jsx-runtime");
3393
+ function reformat(text) {
3394
+ try {
3395
+ return JSON.stringify(JSON.parse(text), null, 2);
3396
+ } catch {
3397
+ return null;
3398
+ }
3399
+ }
3400
+ function JsonMonacoField(props) {
3401
+ const monaco = useCriterionMonaco();
3402
+ const messages = useMessages();
3403
+ const onFormat = () => {
3404
+ const next = reformat(props.buffer);
3405
+ if (next !== null && next !== props.buffer) props.onChange(next);
3406
+ };
3407
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
3408
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3409
+ "button",
3410
+ {
3411
+ type: "button",
3412
+ onClick: onFormat,
3413
+ disabled: props.disabled,
3414
+ "data-testid": `${props.testId}-format`,
3415
+ style: { ...ghostBtnStyle, fontSize: 11, padding: "2px 8px" },
3416
+ children: messages.inspector.format
3417
+ }
3418
+ ) }),
3419
+ monaco ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MonacoPane, { ...props, monaco }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3420
+ "textarea",
3421
+ {
3422
+ value: props.buffer,
3423
+ disabled: props.disabled,
3424
+ rows: 12,
3425
+ "data-testid": props.testId,
3426
+ onChange: (e) => props.onChange(e.target.value),
3427
+ style: {
3428
+ fontFamily: fonts.mono,
3429
+ fontSize: 12,
3430
+ padding: 8,
3431
+ whiteSpace: "pre-wrap",
3432
+ wordBreak: "break-word",
3433
+ border: `1px solid ${colors.border}`,
3434
+ borderRadius: radii.sm,
3435
+ background: colors.surface,
3436
+ resize: "vertical",
3437
+ minHeight: props.minHeightPx ?? 120
3438
+ }
3439
+ }
3440
+ )
3441
+ ] });
3442
+ }
3443
+ function MonacoPane({
3444
+ monaco,
3445
+ buffer,
3446
+ disabled,
3447
+ modelUri,
3448
+ onChange,
3449
+ seed,
3450
+ registerSchema,
3451
+ minHeightPx = 120,
3452
+ maxHeightPx = 480,
3453
+ testId
3454
+ }) {
3455
+ const containerRef = (0, import_react9.useRef)(null);
3456
+ const editorRef = (0, import_react9.useRef)(null);
3457
+ const modelRef = (0, import_react9.useRef)(null);
3458
+ (0, import_react9.useEffect)(() => {
3459
+ if (!containerRef.current || editorRef.current) return;
3460
+ const model = monaco.editor.createModel(buffer, "json", monaco.Uri.parse(modelUri));
3461
+ modelRef.current = model;
3462
+ const editor = monaco.editor.create(containerRef.current, {
3463
+ model,
3464
+ automaticLayout: true,
3465
+ minimap: { enabled: false },
3466
+ wordWrap: "on",
3467
+ fontSize: 13,
3468
+ tabSize: 2,
3469
+ scrollBeyondLastLine: false,
3470
+ theme: "vs",
3471
+ readOnly: disabled
3472
+ });
3473
+ editorRef.current = editor;
3474
+ installMonacoCancellationFilter();
3475
+ const schemaHandle = registerSchema?.(monaco) ?? null;
3476
+ const applyHeight = () => {
3477
+ const h = Math.min(Math.max(editor.getContentHeight?.() ?? minHeightPx, minHeightPx), maxHeightPx);
3478
+ if (containerRef.current) containerRef.current.style.height = `${h}px`;
3479
+ editor.layout?.();
3480
+ };
3481
+ applyHeight();
3482
+ const sizeSub = editor.onDidContentSizeChange?.(applyHeight) ?? { dispose() {
3483
+ } };
3484
+ const sub = model.onDidChangeContent(() => onChange(model.getValue()));
3485
+ return () => {
3486
+ sub.dispose();
3487
+ sizeSub.dispose();
3488
+ schemaHandle?.dispose();
3489
+ editor.dispose();
3490
+ editorRef.current = null;
3491
+ model.dispose();
3492
+ modelRef.current = null;
3493
+ };
3494
+ }, [monaco, modelUri]);
3495
+ (0, import_react9.useEffect)(() => {
3496
+ const model = modelRef.current;
3497
+ if (model && seed !== void 0 && model.getValue() !== seed) model.setValue(seed);
3498
+ }, [seed]);
3499
+ (0, import_react9.useEffect)(() => {
3500
+ editorRef.current?.updateOptions?.({ readOnly: disabled });
3501
+ }, [disabled]);
3502
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3503
+ "div",
3504
+ {
3505
+ ref: containerRef,
3506
+ "data-testid": testId,
3507
+ style: { height: minHeightPx, border: `1px solid ${colors.border}`, borderRadius: radii.sm }
3508
+ }
3509
+ );
3510
+ }
3511
+
3380
3512
  // src/inspector/annotationsJson.ts
3381
3513
  var import_workflow_core3 = require("@cyoda/workflow-core");
3382
3514
  function annotationsModelUri(key) {
@@ -3409,14 +3541,14 @@ function parseAnnotationsJson(text) {
3409
3541
  }
3410
3542
 
3411
3543
  // src/inspector/AnnotationsField.tsx
3412
- var import_jsx_runtime7 = require("react/jsx-runtime");
3544
+ var import_jsx_runtime8 = require("react/jsx-runtime");
3413
3545
  var pretty = (v) => JSON.stringify(v, null, 2);
3414
3546
  function AnnotationsField(props) {
3415
3547
  const messages = useMessages();
3416
3548
  if (props.value === void 0) {
3417
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: sectionStyle, children: [
3418
- props.showLabel !== false && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SectionLabel, {}),
3419
- !props.disabled && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3549
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: sectionStyle, children: [
3550
+ props.showLabel !== false && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SectionLabel, {}),
3551
+ !props.disabled && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3420
3552
  "button",
3421
3553
  {
3422
3554
  type: "button",
@@ -3428,7 +3560,7 @@ function AnnotationsField(props) {
3428
3560
  )
3429
3561
  ] });
3430
3562
  }
3431
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AnnotationsEditor, { ...props, value: props.value }, props.modelKey);
3563
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AnnotationsEditor, { ...props, value: props.value }, props.modelKey);
3432
3564
  }
3433
3565
  function AnnotationsEditor({
3434
3566
  value,
@@ -3439,11 +3571,10 @@ function AnnotationsEditor({
3439
3571
  showLabel
3440
3572
  }) {
3441
3573
  const messages = useMessages();
3442
- const monaco = useCriterionMonaco();
3443
- const [buffer, setBuffer] = (0, import_react9.useState)(() => pretty(value));
3444
- const [docChanged, setDocChanged] = (0, import_react9.useState)(false);
3445
- const prevValueRef = (0, import_react9.useRef)(value);
3446
- (0, import_react9.useEffect)(() => {
3574
+ const [buffer, setBuffer] = (0, import_react10.useState)(() => pretty(value));
3575
+ const [docChanged, setDocChanged] = (0, import_react10.useState)(false);
3576
+ const prevValueRef = (0, import_react10.useRef)(value);
3577
+ (0, import_react10.useEffect)(() => {
3447
3578
  if (sameJson(prevValueRef.current, value)) return;
3448
3579
  const parsed = parseAnnotationsJson(buffer).annotations;
3449
3580
  if (parsed !== null && sameJson(parsed, value)) {
@@ -3459,6 +3590,7 @@ function AnnotationsEditor({
3459
3590
  const result = parseAnnotationsJson(buffer);
3460
3591
  const dirty = result.annotations !== null && !sameJson(result.annotations, value);
3461
3592
  const applyEnabled = !disabled && result.annotations !== null && dirty;
3593
+ const canRevert = buffer !== pretty(value);
3462
3594
  const apply = () => {
3463
3595
  if (!applyEnabled || result.annotations === null) return;
3464
3596
  onCommit(result.annotations);
@@ -3468,32 +3600,23 @@ function AnnotationsEditor({
3468
3600
  setBuffer(pretty(value));
3469
3601
  setDocChanged(false);
3470
3602
  };
3471
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: sectionStyle, children: [
3472
- showLabel !== false && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SectionLabel, {}),
3473
- monaco ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3474
- MonacoJsonPane,
3603
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: sectionStyle, children: [
3604
+ showLabel !== false && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SectionLabel, {}),
3605
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3606
+ JsonMonacoField,
3475
3607
  {
3476
- monaco,
3477
3608
  buffer,
3478
3609
  disabled,
3479
3610
  modelUri: annotationsModelUri(modelKey),
3480
- onChange: setBuffer
3481
- }
3482
- ) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3483
- "textarea",
3484
- {
3485
- value: buffer,
3486
- disabled,
3487
- rows: 12,
3488
- "data-testid": "annotations-json-editor",
3489
- style: textareaStyle,
3490
- onChange: (e) => setBuffer(e.target.value)
3611
+ onChange: setBuffer,
3612
+ seed: buffer,
3613
+ testId: "annotations-json-editor"
3491
3614
  }
3492
3615
  ),
3493
- result.error && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { role: "alert", "data-testid": "annotations-error", style: errorStyle, children: result.error }),
3494
- docChanged && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { role: "alert", "data-testid": "annotations-doc-changed", style: warnStyle, children: messages.inspector.annotationsDocChanged }),
3495
- !disabled && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { display: "flex", gap: 6, flexWrap: "wrap" }, children: [
3496
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3616
+ result.error && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { role: "alert", "data-testid": "annotations-error", style: errorStyle, children: result.error }),
3617
+ docChanged && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { role: "alert", "data-testid": "annotations-doc-changed", style: warnStyle, children: messages.inspector.annotationsDocChanged }),
3618
+ !disabled && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { display: "flex", gap: 6, flexWrap: "wrap" }, children: [
3619
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3497
3620
  "button",
3498
3621
  {
3499
3622
  type: "button",
@@ -3504,77 +3627,16 @@ function AnnotationsEditor({
3504
3627
  children: messages.inspector.annotationsApply
3505
3628
  }
3506
3629
  ),
3507
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", onClick: revert, disabled: !dirty, style: ghostBtn, "data-testid": "inspector-annotations-revert", children: messages.inspector.annotationsRevert }),
3508
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", onClick: onRemove, style: dangerBtn, "data-testid": "inspector-annotations-remove", children: messages.inspector.annotationsRemove })
3630
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", onClick: revert, disabled: !canRevert, style: ghostBtn, "data-testid": "inspector-annotations-revert", children: messages.inspector.annotationsRevert }),
3631
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", onClick: onRemove, style: dangerBtn, "data-testid": "inspector-annotations-remove", children: messages.inspector.annotationsRemove })
3509
3632
  ] })
3510
3633
  ] });
3511
3634
  }
3512
- function MonacoJsonPane({
3513
- monaco,
3514
- buffer,
3515
- disabled,
3516
- modelUri,
3517
- onChange
3518
- }) {
3519
- const containerRef = (0, import_react9.useRef)(null);
3520
- const editorRef = (0, import_react9.useRef)(null);
3521
- const modelRef = (0, import_react9.useRef)(null);
3522
- (0, import_react9.useEffect)(() => {
3523
- if (!containerRef.current || editorRef.current) return;
3524
- const model = monaco.editor.createModel(buffer, "json", monaco.Uri.parse(modelUri));
3525
- modelRef.current = model;
3526
- const editor = monaco.editor.create(containerRef.current, {
3527
- model,
3528
- automaticLayout: true,
3529
- minimap: { enabled: false },
3530
- fontSize: 13,
3531
- tabSize: 2,
3532
- scrollBeyondLastLine: false,
3533
- theme: "vs",
3534
- readOnly: disabled
3535
- });
3536
- editorRef.current = editor;
3537
- installMonacoCancellationFilter();
3538
- const sub = model.onDidChangeContent(() => onChange(model.getValue()));
3539
- return () => {
3540
- sub.dispose();
3541
- editor.dispose();
3542
- editorRef.current = null;
3543
- model.dispose();
3544
- modelRef.current = null;
3545
- };
3546
- }, [monaco, modelUri]);
3547
- (0, import_react9.useEffect)(() => {
3548
- const model = modelRef.current;
3549
- if (model && model.getValue() !== buffer) model.setValue(buffer);
3550
- }, [buffer]);
3551
- (0, import_react9.useEffect)(() => {
3552
- editorRef.current?.updateOptions?.({ readOnly: disabled });
3553
- }, [disabled]);
3554
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3555
- "div",
3556
- {
3557
- ref: containerRef,
3558
- "data-testid": "annotations-json-editor",
3559
- style: { height: 220, border: `1px solid ${colors.border}`, borderRadius: radii.sm }
3560
- }
3561
- );
3562
- }
3563
3635
  function SectionLabel() {
3564
3636
  const messages = useMessages();
3565
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: { fontSize: 11, fontWeight: 600, letterSpacing: "0.08em", textTransform: "uppercase", color: colors.textSecondary }, children: messages.inspector.annotations });
3637
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { fontSize: 11, fontWeight: 600, letterSpacing: "0.08em", textTransform: "uppercase", color: colors.textSecondary }, children: messages.inspector.annotations });
3566
3638
  }
3567
3639
  var sectionStyle = { display: "flex", flexDirection: "column", gap: 8 };
3568
- var textareaStyle = {
3569
- fontFamily: fonts.mono,
3570
- fontSize: 12,
3571
- padding: 8,
3572
- minHeight: 180,
3573
- border: `1px solid ${colors.border}`,
3574
- borderRadius: radii.sm,
3575
- background: "white",
3576
- resize: "vertical"
3577
- };
3578
3640
  var ghostBtn = { padding: "6px 10px", background: "white", border: `1px solid ${colors.border}`, borderRadius: radii.sm, fontSize: 12, cursor: "pointer" };
3579
3641
  var primaryBtn = { ...ghostBtn, background: colors.primary, color: "white", borderColor: colors.primary };
3580
3642
  var disabledBtn = { ...primaryBtn, opacity: 0.5, cursor: "not-allowed" };
@@ -3583,15 +3645,15 @@ var errorStyle = { color: colors.danger, fontSize: 11 };
3583
3645
  var warnStyle = { color: colors.warning, fontSize: 11 };
3584
3646
 
3585
3647
  // src/inspector/WorkflowForm.tsx
3586
- var import_jsx_runtime8 = require("react/jsx-runtime");
3648
+ var import_jsx_runtime9 = require("react/jsx-runtime");
3587
3649
  function WorkflowForm({
3588
3650
  workflow,
3589
3651
  disabled,
3590
3652
  onDispatch
3591
3653
  }) {
3592
3654
  const messages = useMessages();
3593
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(FieldGroup, { title: messages.inspector.properties, children: [
3594
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3655
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FieldGroup, { title: messages.inspector.properties, children: [
3656
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3595
3657
  TextField,
3596
3658
  {
3597
3659
  label: messages.inspector.name,
@@ -3601,7 +3663,7 @@ function WorkflowForm({
3601
3663
  testId: "inspector-workflow-name"
3602
3664
  }
3603
3665
  ),
3604
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3666
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3605
3667
  TextField,
3606
3668
  {
3607
3669
  label: messages.inspector.version,
@@ -3616,7 +3678,7 @@ function WorkflowForm({
3616
3678
  testId: "inspector-workflow-version"
3617
3679
  }
3618
3680
  ),
3619
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3681
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3620
3682
  TextField,
3621
3683
  {
3622
3684
  label: messages.inspector.description,
@@ -3632,7 +3694,7 @@ function WorkflowForm({
3632
3694
  testId: "inspector-workflow-desc"
3633
3695
  }
3634
3696
  ),
3635
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3697
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3636
3698
  CheckboxField,
3637
3699
  {
3638
3700
  label: messages.inspector.active,
@@ -3646,7 +3708,7 @@ function WorkflowForm({
3646
3708
  testId: "inspector-workflow-active"
3647
3709
  }
3648
3710
  ),
3649
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3711
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3650
3712
  TextField,
3651
3713
  {
3652
3714
  label: messages.inspector.initialState,
@@ -3661,7 +3723,7 @@ function WorkflowForm({
3661
3723
  testId: "inspector-workflow-initial"
3662
3724
  }
3663
3725
  ),
3664
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3726
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3665
3727
  AnnotationsField,
3666
3728
  {
3667
3729
  value: workflow.annotations,
@@ -3675,9 +3737,9 @@ function WorkflowForm({
3675
3737
  }
3676
3738
 
3677
3739
  // src/inspector/StateForm.tsx
3678
- var import_react10 = require("react");
3740
+ var import_react11 = require("react");
3679
3741
  var import_workflow_core4 = require("@cyoda/workflow-core");
3680
- var import_jsx_runtime9 = require("react/jsx-runtime");
3742
+ var import_jsx_runtime10 = require("react/jsx-runtime");
3681
3743
  function StateForm({
3682
3744
  workflow,
3683
3745
  stateCode,
@@ -3688,7 +3750,7 @@ function StateForm({
3688
3750
  onRequestDelete
3689
3751
  }) {
3690
3752
  const messages = useMessages();
3691
- const [renameError, setRenameError] = (0, import_react10.useState)(null);
3753
+ const [renameError, setRenameError] = (0, import_react11.useState)(null);
3692
3754
  const outgoing = state.transitions.length;
3693
3755
  const incoming = Object.values(workflow.states).reduce(
3694
3756
  (n, s) => n + s.transitions.filter((t) => t.next === stateCode).length,
@@ -3711,8 +3773,8 @@ function StateForm({
3711
3773
  }
3712
3774
  onDispatch({ op: "renameState", workflow: workflow.name, from: stateCode, to: next });
3713
3775
  };
3714
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FieldGroup, { title: messages.inspector.properties, children: [
3715
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3776
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(FieldGroup, { title: messages.inspector.properties, children: [
3777
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3716
3778
  TextField,
3717
3779
  {
3718
3780
  label: messages.inspector.name,
@@ -3723,19 +3785,19 @@ function StateForm({
3723
3785
  testId: "inspector-state-name"
3724
3786
  }
3725
3787
  ),
3726
- renameError && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { role: "alert", style: { color: colors.danger, fontSize: 12 }, children: renameError }),
3727
- (isInitial || isTerminal || isUnreachable) && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { display: "flex", gap: 6, flexWrap: "wrap" }, children: [
3728
- isInitial && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(StateBadge, { color: "#15803d", bg: "#f0fdf4", label: "Initial" }),
3729
- isTerminal && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(StateBadge, { color: "#0369a1", bg: "#eff6ff", label: "Terminal" }),
3730
- isUnreachable && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(StateBadge, { color: colors.warning, bg: colors.warningBg, label: "Unreachable" })
3788
+ renameError && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { role: "alert", style: { color: colors.danger, fontSize: 12 }, children: renameError }),
3789
+ (isInitial || isTerminal || isUnreachable) && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { display: "flex", gap: 6, flexWrap: "wrap" }, children: [
3790
+ isInitial && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(StateBadge, { color: "#15803d", bg: "#f0fdf4", label: "Initial" }),
3791
+ isTerminal && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(StateBadge, { color: "#0369a1", bg: "#eff6ff", label: "Terminal" }),
3792
+ isUnreachable && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(StateBadge, { color: colors.warning, bg: colors.warningBg, label: "Unreachable" })
3731
3793
  ] }),
3732
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { fontSize: 12, color: colors.textSecondary }, children: [
3794
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { fontSize: 12, color: colors.textSecondary }, children: [
3733
3795
  outgoing,
3734
3796
  " outgoing \xB7 ",
3735
3797
  incoming,
3736
3798
  " incoming"
3737
3799
  ] }),
3738
- !isInitial && !disabled && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3800
+ !isInitial && !disabled && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3739
3801
  "button",
3740
3802
  {
3741
3803
  type: "button",
@@ -3745,7 +3807,7 @@ function StateForm({
3745
3807
  children: "Set as Initial State"
3746
3808
  }
3747
3809
  ),
3748
- issues && issues.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: issues.map((issue, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3810
+ issues && issues.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: issues.map((issue, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3749
3811
  "div",
3750
3812
  {
3751
3813
  role: "alert",
@@ -3761,7 +3823,7 @@ function StateForm({
3761
3823
  },
3762
3824
  `${issue.code}-${i}`
3763
3825
  )) }),
3764
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3826
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3765
3827
  AnnotationsField,
3766
3828
  {
3767
3829
  value: state.annotations,
@@ -3771,7 +3833,7 @@ function StateForm({
3771
3833
  onRemove: () => onDispatch({ op: "setAnnotations", target: { kind: "state", workflow: workflow.name, stateCode } })
3772
3834
  }
3773
3835
  ),
3774
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3836
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3775
3837
  "button",
3776
3838
  {
3777
3839
  type: "button",
@@ -3785,7 +3847,7 @@ function StateForm({
3785
3847
  ] });
3786
3848
  }
3787
3849
  function StateBadge({ color, bg, label }) {
3788
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3850
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3789
3851
  "span",
3790
3852
  {
3791
3853
  style: {
@@ -3841,136 +3903,7 @@ var dangerBtn2 = {
3841
3903
  var import_react15 = require("react");
3842
3904
  var import_workflow_core7 = require("@cyoda/workflow-core");
3843
3905
 
3844
- // src/inspector/CriterionForm.tsx
3845
- var import_react13 = require("react");
3846
-
3847
- // src/modals/DeleteStateModal.tsx
3848
- var import_react11 = require("react");
3849
- var import_jsx_runtime10 = require("react/jsx-runtime");
3850
- function countAffected(doc, workflow, stateCode) {
3851
- let outgoing = 0;
3852
- let incoming = 0;
3853
- const wf = doc.session.workflows.find((w) => w.name === workflow);
3854
- if (!wf) return { outgoing, incoming };
3855
- for (const [code, state] of Object.entries(wf.states)) {
3856
- for (const t of state.transitions) {
3857
- if (code === stateCode) outgoing++;
3858
- if (t.next === stateCode && code !== stateCode) incoming++;
3859
- }
3860
- }
3861
- return { outgoing, incoming };
3862
- }
3863
- function DeleteStateModal({
3864
- document: doc,
3865
- workflow,
3866
- stateCode,
3867
- onConfirm,
3868
- onCancel
3869
- }) {
3870
- const messages = useMessages();
3871
- const counts = (0, import_react11.useMemo)(
3872
- () => countAffected(doc, workflow, stateCode),
3873
- [doc, workflow, stateCode]
3874
- );
3875
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(ModalFrame, { onCancel, children: [
3876
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h2", { style: { margin: 0, fontSize: 16 }, children: messages.confirmDelete.title }),
3877
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { style: { margin: "12px 0", fontSize: 13, color: colors.textSecondary }, children: messages.confirmDelete.message }),
3878
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { padding: 8, background: colors.surfaceMuted, border: `1px solid ${colors.borderSubtle}`, borderRadius: radii.sm, fontSize: 13 }, children: [
3879
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: stateCode }),
3880
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { color: colors.textSecondary }, children: [
3881
- messages.confirmDelete.transitionsAffected,
3882
- ": ",
3883
- counts.outgoing + counts.incoming
3884
- ] })
3885
- ] }),
3886
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, marginTop: 16 }, children: [
3887
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: onCancel, style: ghostBtn3, "data-testid": "modal-delete-cancel", children: messages.confirmDelete.cancel }),
3888
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: onConfirm, style: dangerBtn3, "data-testid": "modal-delete-confirm", children: messages.confirmDelete.confirm })
3889
- ] })
3890
- ] });
3891
- }
3892
- function ModalFrame({
3893
- children,
3894
- onCancel,
3895
- labelledBy
3896
- }) {
3897
- const frameRef = (0, import_react11.useRef)(null);
3898
- const previousFocusRef = (0, import_react11.useRef)(null);
3899
- (0, import_react11.useEffect)(() => {
3900
- previousFocusRef.current = document.activeElement ?? null;
3901
- const node = frameRef.current;
3902
- if (node) {
3903
- const focusable = node.querySelector(
3904
- 'input, select, textarea, button, [tabindex]:not([tabindex="-1"])'
3905
- );
3906
- (focusable ?? node).focus();
3907
- }
3908
- return () => {
3909
- previousFocusRef.current?.focus?.();
3910
- };
3911
- }, []);
3912
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3913
- "div",
3914
- {
3915
- onClick: onCancel,
3916
- onKeyDown: (e) => {
3917
- if (e.key === "Escape") {
3918
- e.stopPropagation();
3919
- onCancel();
3920
- }
3921
- },
3922
- style: {
3923
- position: "fixed",
3924
- inset: 0,
3925
- background: "rgba(15,23,42,0.4)",
3926
- display: "flex",
3927
- alignItems: "center",
3928
- justifyContent: "center",
3929
- zIndex: 1e3
3930
- },
3931
- "data-testid": "modal-backdrop",
3932
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3933
- "div",
3934
- {
3935
- ref: frameRef,
3936
- role: "dialog",
3937
- "aria-modal": "true",
3938
- "aria-labelledby": labelledBy,
3939
- tabIndex: -1,
3940
- onClick: (e) => e.stopPropagation(),
3941
- style: {
3942
- background: "white",
3943
- borderRadius: radii.md,
3944
- padding: 20,
3945
- minWidth: 340,
3946
- boxShadow: "0 10px 30px rgba(15,23,42,0.25)",
3947
- outline: "none",
3948
- fontFamily: fonts.sans,
3949
- color: colors.textPrimary
3950
- },
3951
- "data-testid": "modal-frame",
3952
- children
3953
- }
3954
- )
3955
- }
3956
- );
3957
- }
3958
- var ghostBtn3 = {
3959
- padding: "6px 12px",
3960
- background: "white",
3961
- border: `1px solid ${colors.border}`,
3962
- borderRadius: radii.sm,
3963
- fontSize: 13,
3964
- cursor: "pointer"
3965
- };
3966
- var dangerBtn3 = {
3967
- ...ghostBtn3,
3968
- background: colors.danger,
3969
- color: "white",
3970
- borderColor: colors.danger
3971
- };
3972
-
3973
- // src/inspector/CriterionJsonEditor.tsx
3906
+ // src/inspector/CriterionField.tsx
3974
3907
  var import_react12 = require("react");
3975
3908
  var import_workflow_monaco = require("@cyoda/workflow-monaco");
3976
3909
 
@@ -3998,398 +3931,271 @@ function parseCriterionJson(text) {
3998
3931
  if (blocking) return { criterion: null, error: blocking };
3999
3932
  return { criterion: res.data, error: null };
4000
3933
  }
4001
- let friendly = null;
4002
- if (typeof raw === "object" && raw !== null && typeof raw.type === "string") {
4003
- try {
4004
- friendly = (0, import_workflow_core5.criterionBlockingError)(raw);
4005
- } catch {
4006
- friendly = null;
4007
- }
4008
- }
4009
- return { criterion: null, error: friendly ?? zodMessage(res.error) };
4010
- }
4011
-
4012
- // src/inspector/CriterionJsonEditor.tsx
4013
- var import_jsx_runtime11 = require("react/jsx-runtime");
4014
- function CriterionJsonEditor({ value, disabled, modelKey, onChange }) {
4015
- const monaco = useCriterionMonaco();
4016
- const onChangeRef = (0, import_react12.useRef)(onChange);
4017
- onChangeRef.current = onChange;
4018
- const initialText = (0, import_react12.useRef)(JSON.stringify(value, null, 2)).current;
4019
- if (monaco) {
4020
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4021
- MonacoCriterionEditor,
4022
- {
4023
- monaco,
4024
- initialText,
4025
- disabled,
4026
- modelKey,
4027
- onChangeRef
4028
- }
4029
- );
4030
- }
4031
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4032
- TextareaCriterionEditor,
4033
- {
4034
- initialText,
4035
- disabled,
4036
- onChangeRef
4037
- }
4038
- );
4039
- }
4040
- function TextareaCriterionEditor({
4041
- initialText,
4042
- disabled,
4043
- onChangeRef
4044
- }) {
4045
- (0, import_react12.useEffect)(() => {
4046
- onChangeRef.current(parseCriterionJson(initialText));
4047
- }, [initialText, onChangeRef]);
4048
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4049
- "textarea",
4050
- {
4051
- defaultValue: initialText,
4052
- disabled,
4053
- rows: 16,
4054
- "data-testid": "criterion-json-editor",
4055
- style: jsonTextAreaStyle,
4056
- onChange: (e) => onChangeRef.current(parseCriterionJson(e.target.value))
4057
- }
4058
- );
4059
- }
4060
- function MonacoCriterionEditor({
4061
- monaco,
4062
- initialText,
4063
- disabled,
4064
- modelKey,
4065
- onChangeRef
4066
- }) {
4067
- const containerRef = (0, import_react12.useRef)(null);
4068
- const editorRef = (0, import_react12.useRef)(null);
4069
- (0, import_react12.useEffect)(() => {
4070
- if (!containerRef.current || editorRef.current) return;
4071
- const model = monaco.editor.createModel(
4072
- initialText,
4073
- "json",
4074
- monaco.Uri.parse(criterionModelUri(modelKey))
4075
- );
4076
- const editor = monaco.editor.create(containerRef.current, {
4077
- model,
4078
- automaticLayout: true,
4079
- minimap: { enabled: false },
4080
- fontSize: 13,
4081
- tabSize: 2,
4082
- scrollBeyondLastLine: false,
4083
- theme: "vs",
4084
- readOnly: disabled
4085
- });
4086
- editorRef.current = editor;
4087
- installMonacoCancellationFilter();
4088
- const schemaHandle = (0, import_workflow_monaco.registerCriterionSchema)(monaco);
4089
- const report = () => onChangeRef.current(parseCriterionJson(model.getValue()));
4090
- report();
4091
- const sub = model.onDidChangeContent(report);
4092
- return () => {
4093
- sub.dispose();
4094
- schemaHandle.dispose();
4095
- editor.dispose();
4096
- editorRef.current = null;
4097
- model.dispose();
4098
- };
4099
- }, [monaco, modelKey]);
4100
- (0, import_react12.useEffect)(() => {
4101
- editorRef.current?.updateOptions?.({ readOnly: disabled });
4102
- }, [disabled]);
4103
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4104
- "div",
4105
- {
4106
- ref: containerRef,
4107
- "data-testid": "criterion-json-editor",
4108
- style: { height: 320, border: `1px solid ${colors.border}`, borderRadius: radii.sm }
4109
- }
4110
- );
4111
- }
4112
- var jsonTextAreaStyle = {
4113
- fontFamily: fonts.mono,
4114
- fontSize: 12,
4115
- padding: 8,
4116
- borderWidth: 1,
4117
- borderStyle: "solid",
4118
- borderColor: colors.border,
4119
- borderRadius: radii.sm,
4120
- background: "white",
4121
- resize: "vertical"
4122
- };
4123
-
4124
- // src/inspector/CriterionForm.tsx
4125
- var import_jsx_runtime12 = require("react/jsx-runtime");
4126
- function defaultCriterion(type) {
4127
- switch (type) {
4128
- case "simple":
4129
- return { type: "simple", jsonPath: "", operation: "EQUALS" };
4130
- case "group":
4131
- return { type: "group", operator: "AND", conditions: [] };
4132
- case "function":
4133
- return { type: "function", function: { name: "" } };
4134
- case "lifecycle":
4135
- return { type: "lifecycle", field: "state", operation: "EQUALS" };
4136
- case "array":
4137
- return { type: "array", jsonPath: "", operation: "EQUALS", value: [] };
4138
- }
4139
- }
4140
- function CriterionSection({
4141
- host,
4142
- stateCode,
4143
- transitionName,
4144
- targetState,
4145
- manual,
4146
- criterion,
4147
- disabled,
4148
- onDispatch,
4149
- onSelectionChange
4150
- }) {
4151
- const messages = useMessages();
4152
- const [modalOpen, setModalOpen] = (0, import_react13.useState)(false);
4153
- const path = ["criterion"];
4154
- const removeCriterion = () => {
4155
- onDispatch({ op: "setCriterion", host, path, criterion: void 0 });
4156
- if (host.kind === "transition") {
4157
- onSelectionChange?.({ kind: "transition", transitionUuid: host.transitionUuid });
4158
- }
4159
- };
4160
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
4161
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4162
- CriterionSummaryCard,
4163
- {
4164
- criterion,
4165
- disabled,
4166
- manual,
4167
- onAdd: () => setModalOpen(true),
4168
- onEdit: () => setModalOpen(true),
4169
- onRemove: removeCriterion
4170
- }
4171
- ),
4172
- modalOpen && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4173
- CriterionEditorModal,
4174
- {
4175
- title: criterion ? messages.criterion.editTitle : messages.criterion.addTitle,
4176
- context: `${stateCode ?? host.workflow} \u2192 ${transitionName ?? "transition"} \u2192 ${targetState ?? ""}`,
4177
- host,
4178
- path,
4179
- initialCriterion: criterion,
4180
- disabled,
4181
- onDispatch,
4182
- onCancel: () => setModalOpen(false),
4183
- onApplied: () => {
4184
- setModalOpen(false);
4185
- if (host.kind === "transition") {
4186
- const selection = {
4187
- kind: "transition",
4188
- transitionUuid: host.transitionUuid
4189
- };
4190
- onSelectionChange?.(selection);
4191
- window.setTimeout(() => onSelectionChange?.(selection), 100);
4192
- }
4193
- }
4194
- }
4195
- )
4196
- ] });
3934
+ let friendly = null;
3935
+ if (typeof raw === "object" && raw !== null && typeof raw.type === "string") {
3936
+ try {
3937
+ friendly = (0, import_workflow_core5.criterionBlockingError)(raw);
3938
+ } catch {
3939
+ friendly = null;
3940
+ }
3941
+ }
3942
+ return { criterion: null, error: friendly ?? zodMessage(res.error) };
4197
3943
  }
4198
- function CriterionSummaryCard({
4199
- criterion,
4200
- disabled,
4201
- manual,
4202
- onAdd,
4203
- onEdit,
4204
- onRemove
4205
- }) {
4206
- const messages = useMessages();
4207
- const m = messages.criterion;
4208
- if (!criterion) {
4209
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: cardStyle, "data-testid": "criterion-summary-card", children: [
4210
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SectionHeader, { label: m.heading, badge: "none" }),
4211
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { style: summaryTextStyle, children: manual ? m.noneManual : m.noneAutomated }),
4212
- !manual && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { style: warningCardStyle, "data-testid": "criterion-automated-warning", children: m.noneAutomatedWarning }),
4213
- !disabled && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4214
- "button",
4215
- {
4216
- type: "button",
4217
- onClick: onAdd,
4218
- style: primaryBtn2,
4219
- "data-testid": "inspector-criterion-add",
4220
- children: m.add
4221
- }
4222
- )
3944
+
3945
+ // src/inspector/CriterionField.tsx
3946
+ var import_jsx_runtime11 = require("react/jsx-runtime");
3947
+ function defaultSimpleCriterion() {
3948
+ return { type: "simple", jsonPath: "", operation: "EQUALS" };
3949
+ }
3950
+ var pretty2 = (c) => JSON.stringify(c, null, 2);
3951
+ function CriterionField(props) {
3952
+ const m = useMessages().criterion;
3953
+ if (props.value === void 0) {
3954
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: cardStyle, "data-testid": "criterion-summary-card", children: [
3955
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: summaryTextStyle, children: props.manual ? m.noneManual : m.noneAutomated }),
3956
+ !props.manual && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: warnStyle2, "data-testid": "criterion-automated-warning", children: m.noneAutomatedWarning }),
3957
+ !props.disabled && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", style: primaryBtnStyle, "data-testid": "inspector-criterion-add", onClick: () => props.onCommit(defaultSimpleCriterion()), children: m.add })
4223
3958
  ] });
4224
3959
  }
4225
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: cardStyle, "data-testid": "criterion-summary-card", children: [
4226
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SectionHeader, { label: m.heading, badge: criterion.type }),
4227
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CriterionCompactJson, { criterion }),
4228
- !disabled && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", flexWrap: "wrap", gap: 6 }, children: [
4229
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4230
- "button",
3960
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CriterionEditor, { ...props, value: props.value }, props.modelKey);
3961
+ }
3962
+ function CriterionEditor({ value, disabled, modelKey, onCommit, onRemove }) {
3963
+ const messages = useMessages();
3964
+ const m = messages.criterion;
3965
+ const [expanded, setExpanded] = (0, import_react12.useState)(false);
3966
+ const [buffer, setBuffer] = (0, import_react12.useState)(() => pretty2(value));
3967
+ const [docChanged, setDocChanged] = (0, import_react12.useState)(false);
3968
+ const prevValueRef = (0, import_react12.useRef)(value);
3969
+ (0, import_react12.useEffect)(() => {
3970
+ if (sameJson(prevValueRef.current, value)) return;
3971
+ const parsed = parseCriterionJson(buffer).criterion;
3972
+ if (parsed !== null && sameJson(parsed, value)) {
3973
+ setDocChanged(false);
3974
+ } else if (parsed !== null && sameJson(parsed, prevValueRef.current)) {
3975
+ setBuffer(pretty2(value));
3976
+ setDocChanged(false);
3977
+ } else {
3978
+ setDocChanged(true);
3979
+ }
3980
+ prevValueRef.current = value;
3981
+ }, [value, buffer]);
3982
+ const result = parseCriterionJson(buffer);
3983
+ const dirty = result.criterion !== null && !sameJson(result.criterion, value);
3984
+ const applyEnabled = !disabled && result.criterion !== null && dirty;
3985
+ const canRevert = buffer !== pretty2(value);
3986
+ const apply = () => {
3987
+ if (!applyEnabled || result.criterion === null) return;
3988
+ onCommit(result.criterion);
3989
+ setDocChanged(false);
3990
+ setExpanded(false);
3991
+ };
3992
+ const revert = () => {
3993
+ setBuffer(pretty2(value));
3994
+ setDocChanged(false);
3995
+ };
3996
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: cardStyle, "data-testid": "criterion-summary-card", children: [
3997
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
3998
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: metaChipStyle, children: value.type }),
3999
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { flex: 1 } }),
4000
+ !disabled && !expanded && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", style: ghostBtnStyle, "data-testid": "inspector-criterion-edit", onClick: () => setExpanded(true), children: m.edit }),
4001
+ !disabled && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", style: destructiveBtnStyle, "data-testid": "inspector-criterion-remove", onClick: onRemove, children: m.remove })
4002
+ ] }),
4003
+ !expanded && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CompactJson, { criterion: value }),
4004
+ expanded && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
4005
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4006
+ JsonMonacoField,
4231
4007
  {
4232
- type: "button",
4233
- onClick: onEdit,
4234
- style: ghostBtn4,
4235
- "data-testid": "inspector-criterion-edit",
4236
- children: m.edit
4008
+ buffer,
4009
+ disabled,
4010
+ modelUri: criterionModelUri(modelKey),
4011
+ onChange: setBuffer,
4012
+ seed: buffer,
4013
+ registerSchema: import_workflow_monaco.registerCriterionSchema,
4014
+ testId: "criterion-json-editor"
4237
4015
  }
4238
4016
  ),
4239
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4240
- "button",
4241
- {
4242
- type: "button",
4243
- onClick: onRemove,
4244
- style: dangerBtn4,
4245
- "data-testid": "inspector-criterion-remove",
4246
- children: m.remove
4247
- }
4248
- )
4017
+ result.error && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { role: "alert", "data-testid": "criterion-error", style: errorStyle2, children: result.error }),
4018
+ docChanged && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { role: "alert", "data-testid": "criterion-doc-changed", style: warnLineStyle, children: messages.inspector.annotationsDocChanged }),
4019
+ !disabled && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", gap: 6, flexWrap: "wrap" }, children: [
4020
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", onClick: apply, disabled: !applyEnabled, style: applyEnabled ? primaryBtnStyle : { ...primaryBtnStyle, opacity: 0.5, cursor: "not-allowed" }, "data-testid": "inspector-criterion-apply", children: m.applyModal }),
4021
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", onClick: revert, disabled: !canRevert, style: ghostBtnStyle, "data-testid": "inspector-criterion-revert", children: m.revert }),
4022
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", onClick: () => setExpanded(false), style: ghostBtnStyle, "data-testid": "inspector-criterion-collapse", children: m.collapse })
4023
+ ] })
4249
4024
  ] })
4250
4025
  ] });
4251
4026
  }
4252
- function CriterionCompactJson({ criterion }) {
4027
+ function CompactJson({ criterion }) {
4253
4028
  const text = JSON.stringify(criterion);
4254
4029
  const display = text.length > 140 ? `${text.slice(0, 137)}\u2026` : text;
4255
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4256
- "code",
4257
- {
4258
- "data-testid": "criterion-compact-json",
4259
- style: {
4260
- display: "block",
4261
- fontFamily: fonts.mono,
4262
- fontSize: 11,
4263
- color: colors.textSecondary,
4264
- background: colors.surfaceMuted,
4265
- padding: "6px 8px",
4266
- borderRadius: radii.sm,
4267
- whiteSpace: "pre-wrap",
4268
- wordBreak: "break-word"
4269
- },
4270
- children: display
4271
- }
4272
- );
4030
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("code", { "data-testid": "criterion-compact-json", style: { display: "block", fontFamily: fonts.mono, fontSize: 11, color: colors.textSecondary, background: colors.surfaceMuted, padding: "6px 8px", borderRadius: radii.sm, whiteSpace: "pre-wrap", wordBreak: "break-word" }, children: display });
4273
4031
  }
4032
+ var cardStyle = { display: "flex", flexDirection: "column", gap: 8, padding: 10, border: `1px solid ${colors.border}`, borderRadius: radii.md, background: colors.surface };
4033
+ var summaryTextStyle = { margin: 0, fontSize: 12, color: colors.textSecondary, lineHeight: 1.45 };
4034
+ var warnStyle2 = { margin: 0, padding: "6px 8px", background: colors.warningBg, border: `1px solid ${colors.warningBorder}`, borderRadius: radii.sm, color: colors.warning, fontSize: 11 };
4035
+ var errorStyle2 = { color: colors.danger, fontSize: 11 };
4036
+ var warnLineStyle = { color: colors.warning, fontSize: 11 };
4037
+
4038
+ // src/inspector/CriterionForm.tsx
4039
+ var import_jsx_runtime12 = require("react/jsx-runtime");
4274
4040
  function criterionModelKey(host) {
4275
4041
  if (host.kind === "transition") return `transition-${host.transitionUuid}`;
4276
4042
  if (host.kind === "processorConfig") return `processor-${host.processorUuid}`;
4277
4043
  return `host-${host.workflow}`;
4278
4044
  }
4279
- function CriterionEditorModal({
4280
- title,
4281
- context,
4045
+ function CriterionSection({
4282
4046
  host,
4283
- path,
4284
- initialCriterion,
4047
+ manual,
4048
+ criterion,
4285
4049
  disabled,
4286
4050
  onDispatch,
4287
- onCancel,
4288
- onApplied
4051
+ onSelectionChange: _onSelectionChange
4052
+ }) {
4053
+ const path = ["criterion"];
4054
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4055
+ CriterionField,
4056
+ {
4057
+ value: criterion,
4058
+ manual,
4059
+ disabled,
4060
+ modelKey: criterionModelKey(host),
4061
+ onCommit: (next) => onDispatch({ op: "setCriterion", host, path, criterion: next }),
4062
+ onRemove: () => onDispatch({ op: "setCriterion", host, path, criterion: void 0 })
4063
+ }
4064
+ );
4065
+ }
4066
+
4067
+ // src/inspector/ProcessorForm.tsx
4068
+ var import_react14 = require("react");
4069
+ var import_workflow_core6 = require("@cyoda/workflow-core");
4070
+
4071
+ // src/modals/DeleteStateModal.tsx
4072
+ var import_react13 = require("react");
4073
+ var import_jsx_runtime13 = require("react/jsx-runtime");
4074
+ function countAffected(doc, workflow, stateCode) {
4075
+ let outgoing = 0;
4076
+ let incoming = 0;
4077
+ const wf = doc.session.workflows.find((w) => w.name === workflow);
4078
+ if (!wf) return { outgoing, incoming };
4079
+ for (const [code, state] of Object.entries(wf.states)) {
4080
+ for (const t of state.transitions) {
4081
+ if (code === stateCode) outgoing++;
4082
+ if (t.next === stateCode && code !== stateCode) incoming++;
4083
+ }
4084
+ }
4085
+ return { outgoing, incoming };
4086
+ }
4087
+ function DeleteStateModal({
4088
+ document: doc,
4089
+ workflow,
4090
+ stateCode,
4091
+ onConfirm,
4092
+ onCancel
4289
4093
  }) {
4290
4094
  const messages = useMessages();
4291
- const seed = initialCriterion ?? defaultCriterion("simple");
4292
- const [result, setResult] = (0, import_react13.useState)(
4293
- () => parseCriterionJson(JSON.stringify(seed))
4095
+ const counts = (0, import_react13.useMemo)(
4096
+ () => countAffected(doc, workflow, stateCode),
4097
+ [doc, workflow, stateCode]
4294
4098
  );
4295
- const modelKey = criterionModelKey(host);
4296
- const applyDisabled = disabled || result.criterion === null;
4297
- const apply = () => {
4298
- if (applyDisabled || !result.criterion) return;
4299
- onDispatch({ op: "setCriterion", host, path, criterion: result.criterion });
4300
- onApplied();
4301
- };
4302
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ModalFrame, { onCancel, labelledBy: "criterion-modal-title", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: modalStyle, "data-testid": "criterion-editor-modal", children: [
4303
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("header", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
4304
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h2", { id: "criterion-modal-title", style: { margin: 0, fontSize: 18 }, children: title }),
4305
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { style: { margin: 0, fontSize: 12, color: colors.textTertiary }, children: context })
4099
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(ModalFrame, { onCancel, children: [
4100
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h2", { style: { margin: 0, fontSize: 16 }, children: messages.confirmDelete.title }),
4101
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { style: { margin: "12px 0", fontSize: 13, color: colors.textSecondary }, children: messages.confirmDelete.message }),
4102
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { padding: 8, background: colors.surfaceMuted, border: `1px solid ${colors.borderSubtle}`, borderRadius: radii.sm, fontSize: 13 }, children: [
4103
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: stateCode }),
4104
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { color: colors.textSecondary }, children: [
4105
+ messages.confirmDelete.transitionsAffected,
4106
+ ": ",
4107
+ counts.outgoing + counts.incoming
4108
+ ] })
4306
4109
  ] }),
4307
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: modalBodyStyle, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4308
- CriterionJsonEditor,
4309
- {
4310
- value: seed,
4311
- disabled,
4312
- modelKey,
4313
- onChange: setResult
4314
- }
4315
- ) }),
4316
- result.error && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { role: "alert", style: errorStyle2, "data-testid": "criterion-modal-blocking-error", children: result.error }),
4317
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("footer", { style: modalFooterStyle, children: [
4318
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { flex: 1 } }),
4319
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", onClick: onCancel, style: ghostBtn4, "data-testid": "criterion-modal-cancel", children: messages.criterion.cancel }),
4320
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4321
- "button",
4110
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, marginTop: 16 }, children: [
4111
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", onClick: onCancel, style: ghostBtn3, "data-testid": "modal-delete-cancel", children: messages.confirmDelete.cancel }),
4112
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", onClick: onConfirm, style: dangerBtn3, "data-testid": "modal-delete-confirm", children: messages.confirmDelete.confirm })
4113
+ ] })
4114
+ ] });
4115
+ }
4116
+ function ModalFrame({
4117
+ children,
4118
+ onCancel,
4119
+ labelledBy
4120
+ }) {
4121
+ const frameRef = (0, import_react13.useRef)(null);
4122
+ const previousFocusRef = (0, import_react13.useRef)(null);
4123
+ (0, import_react13.useEffect)(() => {
4124
+ previousFocusRef.current = document.activeElement ?? null;
4125
+ const node = frameRef.current;
4126
+ if (node) {
4127
+ const focusable = node.querySelector(
4128
+ 'input, select, textarea, button, [tabindex]:not([tabindex="-1"])'
4129
+ );
4130
+ (focusable ?? node).focus();
4131
+ }
4132
+ return () => {
4133
+ previousFocusRef.current?.focus?.();
4134
+ };
4135
+ }, []);
4136
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4137
+ "div",
4138
+ {
4139
+ onClick: onCancel,
4140
+ onKeyDown: (e) => {
4141
+ if (e.key === "Escape") {
4142
+ e.stopPropagation();
4143
+ onCancel();
4144
+ }
4145
+ },
4146
+ style: {
4147
+ position: "fixed",
4148
+ inset: 0,
4149
+ background: "rgba(15,23,42,0.4)",
4150
+ display: "flex",
4151
+ alignItems: "center",
4152
+ justifyContent: "center",
4153
+ zIndex: 1e3
4154
+ },
4155
+ "data-testid": "modal-backdrop",
4156
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4157
+ "div",
4322
4158
  {
4323
- type: "button",
4324
- onClick: apply,
4325
- disabled: applyDisabled,
4326
- style: applyDisabled ? disabledPrimaryBtn : primaryBtn2,
4327
- "data-testid": "criterion-modal-apply",
4328
- children: messages.criterion.applyModal
4159
+ ref: frameRef,
4160
+ role: "dialog",
4161
+ "aria-modal": "true",
4162
+ "aria-labelledby": labelledBy,
4163
+ tabIndex: -1,
4164
+ onClick: (e) => e.stopPropagation(),
4165
+ style: {
4166
+ background: "white",
4167
+ borderRadius: radii.md,
4168
+ padding: 20,
4169
+ minWidth: 340,
4170
+ boxShadow: "0 10px 30px rgba(15,23,42,0.25)",
4171
+ outline: "none",
4172
+ fontFamily: fonts.sans,
4173
+ color: colors.textPrimary
4174
+ },
4175
+ "data-testid": "modal-frame",
4176
+ children
4329
4177
  }
4330
4178
  )
4331
- ] })
4332
- ] }) });
4333
- }
4334
- function SectionHeader({ label, badge }) {
4335
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
4336
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 11, fontWeight: 600, letterSpacing: "0.08em", textTransform: "uppercase", color: colors.textSecondary }, children: label }),
4337
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 11, padding: "1px 6px", background: colors.surfaceMuted, borderRadius: radii.pill, color: colors.textTertiary }, children: badge })
4338
- ] });
4179
+ }
4180
+ );
4339
4181
  }
4340
- var cardStyle = {
4341
- display: "flex",
4342
- flexDirection: "column",
4343
- gap: 8,
4344
- padding: 10,
4182
+ var ghostBtn3 = {
4183
+ padding: "6px 12px",
4184
+ background: "white",
4345
4185
  border: `1px solid ${colors.border}`,
4346
- borderRadius: radii.md,
4347
- background: "white"
4348
- };
4349
- var summaryTextStyle = { margin: 0, fontSize: 12, color: colors.textSecondary, lineHeight: 1.45 };
4350
- var warningCardStyle = {
4351
- margin: 0,
4352
- padding: "6px 8px",
4353
- background: colors.warningBg,
4354
- border: `1px solid ${colors.warningBorder}`,
4355
4186
  borderRadius: radii.sm,
4356
- color: colors.warning,
4357
- fontSize: 11
4358
- };
4359
- var modalStyle = {
4360
- width: "min(760px, calc(100vw - 48px))",
4361
- maxHeight: "min(760px, calc(100vh - 72px))",
4362
- display: "flex",
4363
- flexDirection: "column",
4364
- gap: 14
4365
- };
4366
- var modalBodyStyle = {
4367
- overflow: "auto",
4368
- padding: 12,
4369
- border: `1px solid ${colors.borderSubtle}`,
4370
- borderRadius: radii.md,
4371
- background: colors.surfaceMuted
4187
+ fontSize: 13,
4188
+ cursor: "pointer"
4372
4189
  };
4373
- var modalFooterStyle = {
4374
- display: "flex",
4375
- alignItems: "center",
4376
- gap: 8,
4377
- position: "sticky",
4378
- bottom: 0,
4379
- paddingTop: 10,
4380
- borderTop: `1px solid ${colors.borderSubtle}`,
4381
- background: "white"
4190
+ var dangerBtn3 = {
4191
+ ...ghostBtn3,
4192
+ background: colors.danger,
4193
+ color: "white",
4194
+ borderColor: colors.danger
4382
4195
  };
4383
- var ghostBtn4 = { padding: "6px 10px", background: "white", border: `1px solid ${colors.border}`, borderRadius: radii.sm, fontSize: 12, cursor: "pointer" };
4384
- var primaryBtn2 = { ...ghostBtn4, background: colors.primary, color: "white", borderColor: colors.primary };
4385
- var disabledPrimaryBtn = { ...primaryBtn2, opacity: 0.5, cursor: "not-allowed" };
4386
- var dangerBtn4 = { ...ghostBtn4, background: colors.dangerBg, borderColor: colors.dangerBorder, color: colors.danger };
4387
- var errorStyle2 = { color: colors.danger, fontSize: 11 };
4388
4196
 
4389
4197
  // src/inspector/ProcessorForm.tsx
4390
- var import_react14 = require("react");
4391
- var import_workflow_core6 = require("@cyoda/workflow-core");
4392
- var import_jsx_runtime13 = require("react/jsx-runtime");
4198
+ var import_jsx_runtime14 = require("react/jsx-runtime");
4393
4199
  var EXECUTION_MODES = [
4394
4200
  "ASYNC_NEW_TX",
4395
4201
  "ASYNC_SAME_TX",
@@ -4495,13 +4301,13 @@ function ProcessorEditorModal({
4495
4301
  if (disabled || error) return;
4496
4302
  onApply(toProcessor(draft));
4497
4303
  };
4498
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ModalFrame, { onCancel, labelledBy: "processor-modal-title", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: modalStyle2, "data-testid": "processor-editor-modal", children: [
4499
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("header", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
4500
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h2", { id: "processor-modal-title", style: { margin: 0, fontSize: 18 }, children: title }),
4501
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { style: { margin: 0, fontSize: 12, color: colors.textTertiary }, children: "Processor changes stay local until Apply." })
4304
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ModalFrame, { onCancel, labelledBy: "processor-modal-title", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: modalStyle, "data-testid": "processor-editor-modal", children: [
4305
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
4306
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h2", { id: "processor-modal-title", style: { margin: 0, fontSize: 18 }, children: title }),
4307
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { style: { margin: 0, fontSize: 12, color: colors.textTertiary }, children: "Processor changes stay local until Apply." })
4502
4308
  ] }),
4503
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: modalBodyStyle2, children: [
4504
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormField, { label: "Name", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4309
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: modalBodyStyle, children: [
4310
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "Name", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4505
4311
  "input",
4506
4312
  {
4507
4313
  type: "text",
@@ -4511,7 +4317,7 @@ function ProcessorEditorModal({
4511
4317
  style: inputStyle2
4512
4318
  }
4513
4319
  ) }),
4514
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormField, { label: "Execution mode", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4320
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "Execution mode", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4515
4321
  CustomSelectInput,
4516
4322
  {
4517
4323
  value: draft.executionMode,
@@ -4520,8 +4326,8 @@ function ProcessorEditorModal({
4520
4326
  testId: "processor-execution-mode"
4521
4327
  }
4522
4328
  ) }),
4523
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: checkboxRowStyle, children: [
4524
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4329
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { style: checkboxRowStyle, children: [
4330
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4525
4331
  "input",
4526
4332
  {
4527
4333
  type: "checkbox",
@@ -4529,9 +4335,9 @@ function ProcessorEditorModal({
4529
4335
  onChange: (event) => setDraft((current) => ({ ...current, attachEntity: event.target.checked }))
4530
4336
  }
4531
4337
  ),
4532
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "Attach entity" })
4338
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "Attach entity" })
4533
4339
  ] }),
4534
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormField, { label: "Calculation node tags", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4340
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "Calculation node tags", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4535
4341
  "input",
4536
4342
  {
4537
4343
  type: "text",
@@ -4544,7 +4350,7 @@ function ProcessorEditorModal({
4544
4350
  style: inputStyle2
4545
4351
  }
4546
4352
  ) }),
4547
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormField, { label: "Response timeout ms", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4353
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "Response timeout ms", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4548
4354
  "input",
4549
4355
  {
4550
4356
  type: "text",
@@ -4556,7 +4362,7 @@ function ProcessorEditorModal({
4556
4362
  style: inputStyle2
4557
4363
  }
4558
4364
  ) }),
4559
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormField, { label: "Retry policy", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4365
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "Retry policy", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4560
4366
  "input",
4561
4367
  {
4562
4368
  type: "text",
@@ -4565,8 +4371,8 @@ function ProcessorEditorModal({
4565
4371
  style: inputStyle2
4566
4372
  }
4567
4373
  ) }),
4568
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: checkboxRowStyle, children: [
4569
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4374
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { style: checkboxRowStyle, children: [
4375
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4570
4376
  "input",
4571
4377
  {
4572
4378
  type: "checkbox",
@@ -4579,9 +4385,9 @@ function ProcessorEditorModal({
4579
4385
  "data-testid": "processor-async-result"
4580
4386
  }
4581
4387
  ),
4582
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "Async result" })
4388
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "Async result" })
4583
4389
  ] }),
4584
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormField, { label: "Crossover to async ms", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4390
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "Crossover to async ms", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4585
4391
  "input",
4586
4392
  {
4587
4393
  type: "text",
@@ -4596,16 +4402,16 @@ function ProcessorEditorModal({
4596
4402
  }
4597
4403
  ) })
4598
4404
  ] }),
4599
- error && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { role: "alert", style: errorStyle3, "data-testid": "processor-modal-error", children: error }),
4600
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("footer", { style: modalFooterStyle2, children: [
4601
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", onClick: onCancel, style: ghostBtn5, "data-testid": "processor-modal-cancel", children: "Cancel" }),
4602
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4405
+ error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { role: "alert", style: errorStyle3, "data-testid": "processor-modal-error", children: error }),
4406
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("footer", { style: modalFooterStyle, children: [
4407
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: onCancel, style: ghostBtn4, "data-testid": "processor-modal-cancel", children: "Cancel" }),
4408
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4603
4409
  "button",
4604
4410
  {
4605
4411
  type: "button",
4606
4412
  onClick: apply,
4607
4413
  disabled: disabled || !!error,
4608
- style: disabled || error ? disabledPrimaryBtn2 : primaryBtn3,
4414
+ style: disabled || error ? disabledPrimaryBtn : primaryBtn2,
4609
4415
  "data-testid": "processor-modal-apply",
4610
4416
  children: "Apply processor"
4611
4417
  }
@@ -4617,8 +4423,8 @@ function FormField({
4617
4423
  label,
4618
4424
  children
4619
4425
  }) {
4620
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
4621
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: labelStyle2, children: label }),
4426
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
4427
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: labelStyle2, children: label }),
4622
4428
  children
4623
4429
  ] });
4624
4430
  }
@@ -4633,17 +4439,17 @@ function ProcessorForm({
4633
4439
  }) {
4634
4440
  const messages = useMessages();
4635
4441
  const [modalOpen, setModalOpen] = (0, import_react14.useState)(false);
4636
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: summaryCardStyle, children: [
4637
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", gap: 8 }, children: [
4638
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
4639
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { style: { fontSize: 13 }, children: processor.name }),
4640
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 12, color: colors.textSecondary }, children: summarizeProcessor(processor) })
4442
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: summaryCardStyle, children: [
4443
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", gap: 8 }, children: [
4444
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
4445
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { style: { fontSize: 13 }, children: processor.name }),
4446
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontSize: 12, color: colors.textSecondary }, children: summarizeProcessor(processor) })
4641
4447
  ] }),
4642
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: chipStyle, children: processor.type })
4448
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: chipStyle, children: processor.type })
4643
4449
  ] }),
4644
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", gap: 6, flexWrap: "wrap" }, children: [
4645
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", onClick: () => setModalOpen(true), style: ghostBtn5, children: "Edit" }),
4646
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4450
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", gap: 6, flexWrap: "wrap" }, children: [
4451
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => setModalOpen(true), style: ghostBtn4, children: "Edit" }),
4452
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4647
4453
  "button",
4648
4454
  {
4649
4455
  type: "button",
@@ -4654,11 +4460,11 @@ function ProcessorForm({
4654
4460
  processorUuid,
4655
4461
  toIndex: processorIndex - 1
4656
4462
  }),
4657
- style: ghostBtn5,
4463
+ style: ghostBtn4,
4658
4464
  children: messages.inspector.moveUp
4659
4465
  }
4660
4466
  ),
4661
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4467
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4662
4468
  "button",
4663
4469
  {
4664
4470
  type: "button",
@@ -4669,23 +4475,23 @@ function ProcessorForm({
4669
4475
  processorUuid,
4670
4476
  toIndex: processorIndex + 1
4671
4477
  }),
4672
- style: ghostBtn5,
4478
+ style: ghostBtn4,
4673
4479
  children: messages.inspector.moveDown
4674
4480
  }
4675
4481
  ),
4676
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4482
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4677
4483
  "button",
4678
4484
  {
4679
4485
  type: "button",
4680
4486
  disabled,
4681
4487
  onClick: () => onDispatch({ op: "removeProcessor", processorUuid }),
4682
- style: dangerBtn5,
4488
+ style: dangerBtn4,
4683
4489
  "data-testid": "inspector-processor-delete",
4684
4490
  children: messages.inspector.removeProcessor
4685
4491
  }
4686
4492
  )
4687
4493
  ] }),
4688
- modalOpen && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4494
+ modalOpen && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4689
4495
  ProcessorEditorModal,
4690
4496
  {
4691
4497
  title: `Edit ${processor.name}`,
@@ -4722,18 +4528,18 @@ var disabledInputStyle = {
4722
4528
  background: colors.surfaceMuted,
4723
4529
  color: colors.textTertiary
4724
4530
  };
4725
- var modalStyle2 = {
4531
+ var modalStyle = {
4726
4532
  width: "min(760px, calc(100vw - 48px))",
4727
4533
  display: "flex",
4728
4534
  flexDirection: "column",
4729
4535
  gap: 16
4730
4536
  };
4731
- var modalBodyStyle2 = {
4537
+ var modalBodyStyle = {
4732
4538
  display: "grid",
4733
4539
  gridTemplateColumns: "1fr 1fr",
4734
4540
  gap: 12
4735
4541
  };
4736
- var modalFooterStyle2 = {
4542
+ var modalFooterStyle = {
4737
4543
  display: "flex",
4738
4544
  justifyContent: "flex-end",
4739
4545
  gap: 8
@@ -4755,7 +4561,7 @@ var errorStyle3 = {
4755
4561
  color: colors.danger,
4756
4562
  fontSize: 12
4757
4563
  };
4758
- var ghostBtn5 = {
4564
+ var ghostBtn4 = {
4759
4565
  padding: "6px 10px",
4760
4566
  background: "white",
4761
4567
  border: `1px solid ${colors.border}`,
@@ -4763,19 +4569,19 @@ var ghostBtn5 = {
4763
4569
  fontSize: 12,
4764
4570
  cursor: "pointer"
4765
4571
  };
4766
- var primaryBtn3 = {
4767
- ...ghostBtn5,
4572
+ var primaryBtn2 = {
4573
+ ...ghostBtn4,
4768
4574
  background: colors.primary,
4769
4575
  color: "white",
4770
4576
  borderColor: colors.primary
4771
4577
  };
4772
- var disabledPrimaryBtn2 = {
4773
- ...primaryBtn3,
4578
+ var disabledPrimaryBtn = {
4579
+ ...primaryBtn2,
4774
4580
  opacity: 0.5,
4775
4581
  cursor: "not-allowed"
4776
4582
  };
4777
- var dangerBtn5 = {
4778
- ...ghostBtn5,
4583
+ var dangerBtn4 = {
4584
+ ...ghostBtn4,
4779
4585
  background: colors.dangerBg,
4780
4586
  borderColor: colors.dangerBorder,
4781
4587
  color: colors.danger
@@ -4799,7 +4605,7 @@ var summaryCardStyle = {
4799
4605
  };
4800
4606
 
4801
4607
  // src/inspector/TransitionForm.tsx
4802
- var import_jsx_runtime14 = require("react/jsx-runtime");
4608
+ var import_jsx_runtime15 = require("react/jsx-runtime");
4803
4609
  function TransitionForm({
4804
4610
  workflow,
4805
4611
  stateCode,
@@ -4920,9 +4726,9 @@ function TransitionForm({
4920
4726
  index: index + 1
4921
4727
  });
4922
4728
  };
4923
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: transitionFormStyle, children: [
4924
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(FieldGroup, { title: messages.inspector.properties, children: [
4925
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4729
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: transitionFormStyle, children: [
4730
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(FieldGroup, { title: messages.inspector.properties, children: [
4731
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
4926
4732
  TextField,
4927
4733
  {
4928
4734
  label: messages.inspector.name,
@@ -4933,8 +4739,8 @@ function TransitionForm({
4933
4739
  testId: "inspector-transition-name"
4934
4740
  }
4935
4741
  ),
4936
- renameError && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { role: "alert", style: { color: colors.danger, fontSize: 12 }, children: renameError }),
4937
- !disabled && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4742
+ renameError && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { role: "alert", style: { color: colors.danger, fontSize: 12 }, children: renameError }),
4743
+ !disabled && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
4938
4744
  SelectField,
4939
4745
  {
4940
4746
  label: "Source state",
@@ -4954,7 +4760,7 @@ function TransitionForm({
4954
4760
  testId: "inspector-transition-source-state"
4955
4761
  }
4956
4762
  ),
4957
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4763
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
4958
4764
  SelectField,
4959
4765
  {
4960
4766
  label: "Target state",
@@ -4965,7 +4771,7 @@ function TransitionForm({
4965
4771
  testId: "inspector-transition-next"
4966
4772
  }
4967
4773
  ),
4968
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4774
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
4969
4775
  SelectField,
4970
4776
  {
4971
4777
  label: messages.inspector.transitionType,
@@ -4979,7 +4785,7 @@ function TransitionForm({
4979
4785
  testId: "inspector-transition-manual"
4980
4786
  }
4981
4787
  ),
4982
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4788
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
4983
4789
  CheckboxField,
4984
4790
  {
4985
4791
  label: messages.inspector.disabled,
@@ -4989,7 +4795,7 @@ function TransitionForm({
4989
4795
  testId: "inspector-transition-disabled"
4990
4796
  }
4991
4797
  ),
4992
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4798
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
4993
4799
  AnchorSelect,
4994
4800
  {
4995
4801
  label: messages.inspector.sourceAnchor,
@@ -5000,7 +4806,7 @@ function TransitionForm({
5000
4806
  testId: "inspector-transition-source-anchor"
5001
4807
  }
5002
4808
  ),
5003
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4809
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5004
4810
  AnchorSelect,
5005
4811
  {
5006
4812
  label: messages.inspector.targetAnchor,
@@ -5011,12 +4817,12 @@ function TransitionForm({
5011
4817
  testId: "inspector-transition-target-anchor"
5012
4818
  }
5013
4819
  ),
5014
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
5015
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", gap: 6 }, children: [
5016
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled, onClick: () => reorder(-1), style: ghostBtn6, children: messages.inspector.moveUp }),
5017
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled, onClick: () => reorder(1), style: ghostBtn6, children: messages.inspector.moveDown })
4820
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
4821
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", gap: 6 }, children: [
4822
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", disabled, onClick: () => reorder(-1), style: ghostBtn5, children: messages.inspector.moveUp }),
4823
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", disabled, onClick: () => reorder(1), style: ghostBtn5, children: messages.inspector.moveDown })
5018
4824
  ] }),
5019
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4825
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5020
4826
  "p",
5021
4827
  {
5022
4828
  style: {
@@ -5030,20 +4836,20 @@ function TransitionForm({
5030
4836
  }
5031
4837
  )
5032
4838
  ] }),
5033
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("hr", { style: { border: "none", borderTop: `1px solid ${colors.borderSubtle}`, margin: 0 } }),
5034
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4839
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("hr", { style: { border: "none", borderTop: `1px solid ${colors.borderSubtle}`, margin: 0 } }),
4840
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5035
4841
  "button",
5036
4842
  {
5037
4843
  type: "button",
5038
4844
  disabled,
5039
4845
  onClick: removeTransition,
5040
- style: dangerBtn6,
4846
+ style: dangerBtn5,
5041
4847
  "data-testid": "inspector-transition-delete",
5042
4848
  children: "Delete transition"
5043
4849
  }
5044
4850
  ),
5045
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("hr", { style: { border: "none", borderTop: `1px solid ${colors.borderSubtle}`, margin: 0 } }),
5046
- issues && issues.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: issues.map((issue, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4851
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("hr", { style: { border: "none", borderTop: `1px solid ${colors.borderSubtle}`, margin: 0 } }),
4852
+ issues && issues.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: issues.map((issue, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5047
4853
  "div",
5048
4854
  {
5049
4855
  role: "alert",
@@ -5060,12 +4866,12 @@ function TransitionForm({
5060
4866
  `${issue.code}-${i}`
5061
4867
  )) })
5062
4868
  ] }),
5063
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4869
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5064
4870
  TransitionSection,
5065
4871
  {
5066
4872
  title: messages.inspector.criteria,
5067
4873
  testId: "inspector-transition-criteria-section",
5068
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4874
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5069
4875
  CriterionSection,
5070
4876
  {
5071
4877
  host,
@@ -5081,18 +4887,18 @@ function TransitionForm({
5081
4887
  )
5082
4888
  }
5083
4889
  ),
5084
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
4890
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
5085
4891
  TransitionSection,
5086
4892
  {
5087
4893
  title: "Scheduled transition",
5088
4894
  testId: "inspector-transition-schedule-section",
5089
4895
  children: [
5090
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
4896
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
5091
4897
  "label",
5092
4898
  {
5093
4899
  style: { display: "flex", flexDirection: "row", alignItems: "center", gap: 8, fontSize: 12, color: colors.textSecondary, cursor: "pointer" },
5094
4900
  children: [
5095
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4901
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5096
4902
  "input",
5097
4903
  {
5098
4904
  type: "checkbox",
@@ -5112,14 +4918,14 @@ function TransitionForm({
5112
4918
  }
5113
4919
  }
5114
4920
  ),
5115
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "Enable schedule" })
4921
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "Enable schedule" })
5116
4922
  ]
5117
4923
  }
5118
4924
  ),
5119
- transition.schedule !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
5120
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { style: { display: "flex", flexDirection: "column", gap: 4, fontSize: 12, color: colors.textSecondary }, children: [
5121
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontWeight: 500 }, children: "Delay (ms)" }),
5122
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4925
+ transition.schedule !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
4926
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { style: { display: "flex", flexDirection: "column", gap: 4, fontSize: 12, color: colors.textSecondary }, children: [
4927
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontWeight: 500 }, children: "Delay (ms)" }),
4928
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5123
4929
  "input",
5124
4930
  {
5125
4931
  type: "text",
@@ -5135,9 +4941,9 @@ function TransitionForm({
5135
4941
  }
5136
4942
  )
5137
4943
  ] }),
5138
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { style: { display: "flex", flexDirection: "column", gap: 4, fontSize: 12, color: colors.textSecondary }, children: [
5139
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontWeight: 500 }, children: "Timeout (ms)" }),
5140
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4944
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { style: { display: "flex", flexDirection: "column", gap: 4, fontSize: 12, color: colors.textSecondary }, children: [
4945
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontWeight: 500 }, children: "Timeout (ms)" }),
4946
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5141
4947
  "input",
5142
4948
  {
5143
4949
  type: "text",
@@ -5154,7 +4960,7 @@ function TransitionForm({
5154
4960
  )
5155
4961
  ] })
5156
4962
  ] }),
5157
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4963
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5158
4964
  "p",
5159
4965
  {
5160
4966
  style: {
@@ -5174,28 +4980,28 @@ function TransitionForm({
5174
4980
  ]
5175
4981
  }
5176
4982
  ),
5177
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
4983
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
5178
4984
  TransitionSection,
5179
4985
  {
5180
4986
  title: messages.inspector.processors,
5181
4987
  testId: "inspector-transition-processes-section",
5182
4988
  children: [
5183
- processorCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: emptyProcessorStateStyle, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { style: summaryTextStyle2, children: "No processors run on this transition." }) }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
5184
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { style: processorHelperStyle, children: "Processors run sequentially in the order shown." }),
5185
- processors.map((processor, index) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: processorRowStyle, children: [
5186
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", gap: 10, alignItems: "center" }, children: [
5187
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { style: processorOrderStyle, children: [
4989
+ processorCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: emptyProcessorStateStyle, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { style: summaryTextStyle2, children: "No processors run on this transition." }) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
4990
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { style: processorHelperStyle, children: "Processors run sequentially in the order shown." }),
4991
+ processors.map((processor, index) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: processorRowStyle, children: [
4992
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", gap: 10, alignItems: "center" }, children: [
4993
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { style: processorOrderStyle, children: [
5188
4994
  index + 1,
5189
4995
  "."
5190
4996
  ] }),
5191
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: processorTypeChipStyle, children: processor.type }),
5192
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 2, minWidth: 0 }, children: [
5193
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { style: { fontSize: 13 }, children: processor.name }),
5194
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: summaryTextStyle2, children: summarizeProcessor(processor) })
4997
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: processorTypeChipStyle, children: processor.type }),
4998
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 2, minWidth: 0 }, children: [
4999
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { style: { fontSize: 13 }, children: processor.name }),
5000
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: summaryTextStyle2, children: summarizeProcessor(processor) })
5195
5001
  ] })
5196
5002
  ] }),
5197
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", gap: 6, flexWrap: "wrap" }, children: [
5198
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5003
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", gap: 6, flexWrap: "wrap" }, children: [
5004
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5199
5005
  "button",
5200
5006
  {
5201
5007
  type: "button",
@@ -5205,23 +5011,23 @@ function TransitionForm({
5205
5011
  processorUuid: processorUuids[index],
5206
5012
  processorIndex: index
5207
5013
  }),
5208
- style: ghostBtn6,
5014
+ style: ghostBtn5,
5209
5015
  "data-testid": `processor-edit-${index}`,
5210
5016
  children: "Edit"
5211
5017
  }
5212
5018
  ),
5213
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5019
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5214
5020
  "button",
5215
5021
  {
5216
5022
  type: "button",
5217
5023
  disabled,
5218
5024
  onClick: () => duplicateProcessor(processor, index),
5219
- style: ghostBtn6,
5025
+ style: ghostBtn5,
5220
5026
  "data-testid": `processor-duplicate-${index}`,
5221
5027
  children: "Duplicate"
5222
5028
  }
5223
5029
  ),
5224
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5030
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5225
5031
  "button",
5226
5032
  {
5227
5033
  type: "button",
@@ -5232,12 +5038,12 @@ function TransitionForm({
5232
5038
  processorUuid: processorUuids[index],
5233
5039
  toIndex: index - 1
5234
5040
  }),
5235
- style: ghostBtn6,
5041
+ style: ghostBtn5,
5236
5042
  "data-testid": `processor-move-up-${index}`,
5237
5043
  children: "Move up"
5238
5044
  }
5239
5045
  ),
5240
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5046
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5241
5047
  "button",
5242
5048
  {
5243
5049
  type: "button",
@@ -5248,18 +5054,18 @@ function TransitionForm({
5248
5054
  processorUuid: processorUuids[index],
5249
5055
  toIndex: index + 1
5250
5056
  }),
5251
- style: ghostBtn6,
5057
+ style: ghostBtn5,
5252
5058
  "data-testid": `processor-move-down-${index}`,
5253
5059
  children: "Move down"
5254
5060
  }
5255
5061
  ),
5256
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5062
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5257
5063
  "button",
5258
5064
  {
5259
5065
  type: "button",
5260
5066
  disabled: disabled || !processorUuids[index],
5261
5067
  onClick: () => processorUuids[index] && onDispatch({ op: "removeProcessor", processorUuid: processorUuids[index] }),
5262
- style: dangerBtn6,
5068
+ style: dangerBtn5,
5263
5069
  "data-testid": `processor-delete-${index}`,
5264
5070
  children: "Delete"
5265
5071
  }
@@ -5267,13 +5073,13 @@ function TransitionForm({
5267
5073
  ] })
5268
5074
  ] }, processorUuids[index] ?? `${processor.name}-${index}`))
5269
5075
  ] }),
5270
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5076
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5271
5077
  "button",
5272
5078
  {
5273
5079
  type: "button",
5274
5080
  disabled,
5275
5081
  onClick: () => setProcessorModal({ mode: "add" }),
5276
- style: ghostBtn6,
5082
+ style: ghostBtn5,
5277
5083
  "data-testid": "inspector-add-processor",
5278
5084
  children: messages.inspector.addProcessor
5279
5085
  }
@@ -5281,7 +5087,7 @@ function TransitionForm({
5281
5087
  ]
5282
5088
  }
5283
5089
  ),
5284
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TransitionSection, { title: "Annotations", testId: "inspector-transition-annotations-section", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5090
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TransitionSection, { title: "Annotations", testId: "inspector-transition-annotations-section", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5285
5091
  AnnotationsField,
5286
5092
  {
5287
5093
  value: transition.annotations,
@@ -5292,7 +5098,7 @@ function TransitionForm({
5292
5098
  onRemove: () => onDispatch({ op: "setAnnotations", target: { kind: "transition", transitionUuid } })
5293
5099
  }
5294
5100
  ) }),
5295
- processorModal && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5101
+ processorModal && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5296
5102
  ProcessorEditorModal,
5297
5103
  {
5298
5104
  title: processorModal.mode === "add" ? "Add processor" : "Edit processor",
@@ -5312,8 +5118,8 @@ function TransitionSection({
5312
5118
  testId,
5313
5119
  children
5314
5120
  }) {
5315
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { style: transitionSectionStyle, "data-testid": testId, children: [
5316
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("header", { style: sectionHeaderStyle, children: title }),
5121
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { style: transitionSectionStyle, "data-testid": testId, children: [
5122
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("header", { style: sectionHeaderStyle, children: title }),
5317
5123
  children
5318
5124
  ] });
5319
5125
  }
@@ -5336,7 +5142,7 @@ var sectionHeaderStyle = {
5336
5142
  textTransform: "uppercase",
5337
5143
  color: colors.textSecondary
5338
5144
  };
5339
- var ghostBtn6 = {
5145
+ var ghostBtn5 = {
5340
5146
  padding: "4px 8px",
5341
5147
  background: "white",
5342
5148
  border: `1px solid ${colors.border}`,
@@ -5344,8 +5150,8 @@ var ghostBtn6 = {
5344
5150
  fontSize: 12,
5345
5151
  cursor: "pointer"
5346
5152
  };
5347
- var dangerBtn6 = {
5348
- ...ghostBtn6,
5153
+ var dangerBtn5 = {
5154
+ ...ghostBtn5,
5349
5155
  background: colors.dangerBg,
5350
5156
  borderColor: colors.dangerBorder,
5351
5157
  color: colors.danger
@@ -5420,9 +5226,9 @@ function AnchorSelect({
5420
5226
  { value: "left", label: messages.inspector.anchorLeft },
5421
5227
  { value: "left-bottom", label: messages.inspector.anchorLeftBottom }
5422
5228
  ];
5423
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { style: { display: "flex", flexDirection: "column", gap: 4, fontSize: 12, color: colors.textSecondary }, children: [
5424
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontWeight: 500 }, children: label }),
5425
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5229
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { style: { display: "flex", flexDirection: "column", gap: 4, fontSize: 12, color: colors.textSecondary }, children: [
5230
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontWeight: 500 }, children: label }),
5231
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5426
5232
  CustomSelectInput,
5427
5233
  {
5428
5234
  value: value ?? "",
@@ -5437,7 +5243,7 @@ function AnchorSelect({
5437
5243
  }
5438
5244
 
5439
5245
  // src/inspector/Inspector.tsx
5440
- var import_jsx_runtime15 = require("react/jsx-runtime");
5246
+ var import_jsx_runtime16 = require("react/jsx-runtime");
5441
5247
  function issueKeyForSelection(selection) {
5442
5248
  if (!selection) return null;
5443
5249
  switch (selection.kind) {
@@ -5462,7 +5268,9 @@ function Inspector({
5462
5268
  onSelectionChange,
5463
5269
  onClose,
5464
5270
  onRequestDeleteState,
5465
- width = 384
5271
+ docked,
5272
+ onToggleDock,
5273
+ onMinimize
5466
5274
  }) {
5467
5275
  const messages = useMessages();
5468
5276
  const { developerMode } = useEditorConfig();
@@ -5475,7 +5283,7 @@ function Inspector({
5475
5283
  return issues.filter((i) => i.targetId === selectionIssueKey);
5476
5284
  }, [issues, selectionIssueKey]);
5477
5285
  const breadcrumb = renderBreadcrumb(resolved);
5478
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
5286
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
5479
5287
  "aside",
5480
5288
  {
5481
5289
  style: {
@@ -5484,16 +5292,17 @@ function Inspector({
5484
5292
  flexDirection: "column",
5485
5293
  background: colors.surfaceMuted,
5486
5294
  borderLeft: `1px solid ${colors.borderSubtle}`,
5487
- flex: `0 0 ${width}px`,
5488
- width,
5489
- minWidth: 360,
5295
+ flex: "1 1 auto",
5296
+ width: "100%",
5297
+ minWidth: 0,
5490
5298
  fontFamily: fonts.sans
5491
5299
  },
5492
5300
  "data-testid": "inspector",
5493
5301
  children: [
5494
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
5302
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
5495
5303
  "header",
5496
5304
  {
5305
+ "data-inspector-drag-handle": true,
5497
5306
  style: {
5498
5307
  padding: "10px 12px",
5499
5308
  borderBottom: `1px solid ${colors.borderSubtle}`,
@@ -5504,8 +5313,59 @@ function Inspector({
5504
5313
  gap: 8
5505
5314
  },
5506
5315
  children: [
5507
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: breadcrumb }),
5508
- onClose && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5316
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: breadcrumb }),
5317
+ onToggleDock && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
5318
+ "button",
5319
+ {
5320
+ type: "button",
5321
+ "aria-label": docked ? messages.inspector.detachPanel : messages.inspector.dockPanel,
5322
+ title: docked ? messages.inspector.detachPanel : messages.inspector.dockPanel,
5323
+ "data-testid": "inspector-dock-toggle",
5324
+ onClick: onToggleDock,
5325
+ style: {
5326
+ width: 24,
5327
+ height: 24,
5328
+ border: `1px solid ${colors.border}`,
5329
+ borderRadius: radii.sm,
5330
+ background: "white",
5331
+ color: colors.textSecondary,
5332
+ cursor: "pointer",
5333
+ display: "inline-flex",
5334
+ alignItems: "center",
5335
+ justifyContent: "center",
5336
+ padding: 0,
5337
+ fontSize: 13
5338
+ },
5339
+ children: docked ? "\u2922" : "\u2921"
5340
+ }
5341
+ ),
5342
+ onMinimize && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
5343
+ "button",
5344
+ {
5345
+ type: "button",
5346
+ "aria-label": messages.inspector.minimize,
5347
+ title: messages.inspector.minimize,
5348
+ "data-testid": "inspector-minimize",
5349
+ onClick: onMinimize,
5350
+ style: {
5351
+ width: 24,
5352
+ height: 24,
5353
+ border: `1px solid ${colors.border}`,
5354
+ borderRadius: radii.sm,
5355
+ background: "white",
5356
+ color: colors.textSecondary,
5357
+ cursor: "pointer",
5358
+ display: "inline-flex",
5359
+ alignItems: "flex-end",
5360
+ justifyContent: "center",
5361
+ padding: "0 0 5px",
5362
+ fontSize: 18,
5363
+ lineHeight: "10px"
5364
+ },
5365
+ children: "\u2013"
5366
+ }
5367
+ ),
5368
+ onClose && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
5509
5369
  "button",
5510
5370
  {
5511
5371
  type: "button",
@@ -5533,8 +5393,8 @@ function Inspector({
5533
5393
  ]
5534
5394
  }
5535
5395
  ),
5536
- developerMode && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", borderBottom: `1px solid ${colors.borderSubtle}` }, children: [
5537
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5396
+ developerMode && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", borderBottom: `1px solid ${colors.borderSubtle}` }, children: [
5397
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
5538
5398
  TabButton,
5539
5399
  {
5540
5400
  active: effectiveTab === "properties",
@@ -5543,7 +5403,7 @@ function Inspector({
5543
5403
  children: messages.inspector.properties
5544
5404
  }
5545
5405
  ),
5546
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5406
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
5547
5407
  TabButton,
5548
5408
  {
5549
5409
  active: effectiveTab === "json",
@@ -5553,11 +5413,11 @@ function Inspector({
5553
5413
  }
5554
5414
  )
5555
5415
  ] }),
5556
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { padding: 12, overflowY: "auto", flex: 1, display: "flex", flexDirection: "column", gap: 16 }, children: [
5557
- effectiveTab === "properties" && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
5558
- !resolved && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(EmptyState, { message: messages.inspector.empty }),
5559
- resolved?.kind === "workflow" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WorkflowForm, { workflow: resolved.workflow, disabled: readOnly, onDispatch }, resolved.workflow.name),
5560
- resolved?.kind === "state" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5416
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { padding: 12, overflowY: "auto", flex: 1, display: "flex", flexDirection: "column", gap: 16 }, children: [
5417
+ effectiveTab === "properties" && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
5418
+ !resolved && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(EmptyState, { message: messages.inspector.empty }),
5419
+ resolved?.kind === "workflow" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(WorkflowForm, { workflow: resolved.workflow, disabled: readOnly, onDispatch }, resolved.workflow.name),
5420
+ resolved?.kind === "state" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
5561
5421
  StateForm,
5562
5422
  {
5563
5423
  workflow: resolved.workflow,
@@ -5570,7 +5430,7 @@ function Inspector({
5570
5430
  },
5571
5431
  `${resolved.workflow.name}:${resolved.stateCode}`
5572
5432
  ),
5573
- resolved?.kind === "transition" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5433
+ resolved?.kind === "transition" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
5574
5434
  TransitionForm,
5575
5435
  {
5576
5436
  workflow: resolved.workflow,
@@ -5587,7 +5447,7 @@ function Inspector({
5587
5447
  },
5588
5448
  resolved.transitionUuid
5589
5449
  ),
5590
- resolved?.kind === "processor" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5450
+ resolved?.kind === "processor" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
5591
5451
  ProcessorForm,
5592
5452
  {
5593
5453
  processor: resolved.processor,
@@ -5601,8 +5461,8 @@ function Inspector({
5601
5461
  resolved.processorUuid
5602
5462
  )
5603
5463
  ] }),
5604
- developerMode && effectiveTab === "json" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(JsonPreview, { document: doc, resolved }),
5605
- selectionIssues.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IssuesList, { issues: selectionIssues, title: messages.inspector.issues })
5464
+ developerMode && effectiveTab === "json" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(JsonPreview, { document: doc, resolved }),
5465
+ selectionIssues.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(IssuesList, { issues: selectionIssues, title: messages.inspector.issues })
5606
5466
  ] })
5607
5467
  ]
5608
5468
  }
@@ -5625,7 +5485,7 @@ function TabButton({
5625
5485
  children,
5626
5486
  testId
5627
5487
  }) {
5628
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5488
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
5629
5489
  "button",
5630
5490
  {
5631
5491
  type: "button",
@@ -5646,17 +5506,17 @@ function TabButton({
5646
5506
  );
5647
5507
  }
5648
5508
  function EmptyState({ message }) {
5649
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { style: { color: colors.textTertiary, fontSize: 13 }, children: message });
5509
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { style: { color: colors.textTertiary, fontSize: 13 }, children: message });
5650
5510
  }
5651
5511
  function IssuesList({
5652
5512
  issues,
5653
5513
  title
5654
5514
  }) {
5655
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
5656
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("header", { style: { fontSize: 11, fontWeight: 600, letterSpacing: "0.08em", textTransform: "uppercase", color: colors.textSecondary }, children: title }),
5515
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("section", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
5516
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("header", { style: { fontSize: 11, fontWeight: 600, letterSpacing: "0.08em", textTransform: "uppercase", color: colors.textSecondary }, children: title }),
5657
5517
  issues.map((issue, i) => {
5658
5518
  const tone = severityTone(issue.severity);
5659
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
5519
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
5660
5520
  "div",
5661
5521
  {
5662
5522
  style: {
@@ -5667,8 +5527,8 @@ function IssuesList({
5667
5527
  fontSize: 12
5668
5528
  },
5669
5529
  children: [
5670
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: issue.code }),
5671
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: issue.message })
5530
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("strong", { children: issue.code }),
5531
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { children: issue.message })
5672
5532
  ]
5673
5533
  },
5674
5534
  `${issue.code}-${i}`
@@ -5688,7 +5548,7 @@ function JsonPreview({
5688
5548
  if (resolved.kind === "processor") return JSON.stringify(resolved.processor, null, 2);
5689
5549
  return "";
5690
5550
  }, [doc, resolved]);
5691
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5551
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
5692
5552
  "pre",
5693
5553
  {
5694
5554
  style: {
@@ -5710,8 +5570,221 @@ function JsonPreview({
5710
5570
  );
5711
5571
  }
5712
5572
 
5573
+ // src/inspector/inspectorPlacement.ts
5574
+ var MIN_FLOAT_W = 340;
5575
+ var MIN_FLOAT_H = 260;
5576
+ function clampRect(rect, viewport) {
5577
+ const width = Math.min(Math.max(rect.width, MIN_FLOAT_W), viewport.w);
5578
+ const height = Math.min(Math.max(rect.height, MIN_FLOAT_H), viewport.h);
5579
+ const left = Math.min(Math.max(rect.left, 0), Math.max(0, viewport.w - width));
5580
+ const top = Math.min(Math.max(rect.top, 0), Math.max(0, viewport.h - height));
5581
+ return { left, top, width, height };
5582
+ }
5583
+ function placementStorageKey(base) {
5584
+ return `${base}:inspector`;
5585
+ }
5586
+ function loadPlacement(base) {
5587
+ if (base === null) return null;
5588
+ try {
5589
+ const raw = localStorage.getItem(placementStorageKey(base));
5590
+ if (!raw) return null;
5591
+ const p = JSON.parse(raw);
5592
+ if (p && (p.mode === "docked" || p.mode === "floating" || p.mode === "minimized") && p.rect && typeof p.rect.left === "number" && typeof p.rect.top === "number" && typeof p.rect.width === "number" && typeof p.rect.height === "number") {
5593
+ return p;
5594
+ }
5595
+ return null;
5596
+ } catch {
5597
+ return null;
5598
+ }
5599
+ }
5600
+ function savePlacement(base, p) {
5601
+ if (base === null) return;
5602
+ try {
5603
+ localStorage.setItem(placementStorageKey(base), JSON.stringify(p));
5604
+ } catch {
5605
+ }
5606
+ }
5607
+
5608
+ // src/inspector/InspectorFrame.tsx
5609
+ var import_jsx_runtime17 = require("react/jsx-runtime");
5610
+ var FLOATING_Z = 40;
5611
+ var MIN_BAR_Z = 50;
5612
+ function InspectorFrame({
5613
+ mode,
5614
+ rect,
5615
+ dockedWidth,
5616
+ onRectChange,
5617
+ onDockedWidthChange,
5618
+ onRestore,
5619
+ onClose,
5620
+ children
5621
+ }) {
5622
+ const messages = useMessages();
5623
+ const startWidthDrag = (e) => {
5624
+ e.preventDefault();
5625
+ const startX = e.clientX;
5626
+ const startW = dockedWidth;
5627
+ const onMove = (ev) => onDockedWidthChange(Math.max(360, startW + (startX - ev.clientX)));
5628
+ const onUp = () => {
5629
+ document.removeEventListener("mousemove", onMove);
5630
+ document.removeEventListener("mouseup", onUp);
5631
+ };
5632
+ document.addEventListener("mousemove", onMove);
5633
+ document.addEventListener("mouseup", onUp);
5634
+ };
5635
+ const viewport = () => ({ w: window.innerWidth, h: window.innerHeight });
5636
+ const startMove = (e) => {
5637
+ const target = e.target;
5638
+ if (target.closest("button")) return;
5639
+ if (!target.closest("[data-inspector-drag-handle]")) return;
5640
+ e.preventDefault();
5641
+ const dx = e.clientX - rect.left;
5642
+ const dy = e.clientY - rect.top;
5643
+ const onMove = (ev) => onRectChange(clampRect({ ...rect, left: ev.clientX - dx, top: ev.clientY - dy }, viewport()));
5644
+ const onUp = () => {
5645
+ document.removeEventListener("mousemove", onMove);
5646
+ document.removeEventListener("mouseup", onUp);
5647
+ };
5648
+ document.addEventListener("mousemove", onMove);
5649
+ document.addEventListener("mouseup", onUp);
5650
+ };
5651
+ const startResize = (e) => {
5652
+ e.preventDefault();
5653
+ e.stopPropagation();
5654
+ const sx = e.clientX, sy = e.clientY, sw = rect.width, sh = rect.height;
5655
+ const onMove = (ev) => onRectChange(clampRect({ ...rect, width: Math.max(MIN_FLOAT_W, sw + (ev.clientX - sx)), height: Math.max(MIN_FLOAT_H, sh + (ev.clientY - sy)) }, viewport()));
5656
+ const onUp = () => {
5657
+ document.removeEventListener("mousemove", onMove);
5658
+ document.removeEventListener("mouseup", onUp);
5659
+ };
5660
+ document.addEventListener("mousemove", onMove);
5661
+ document.addEventListener("mouseup", onUp);
5662
+ };
5663
+ const floating = mode === "floating";
5664
+ const minimized = mode === "minimized";
5665
+ const style = floating || minimized ? {
5666
+ position: "fixed",
5667
+ left: rect.left,
5668
+ top: rect.top,
5669
+ width: rect.width,
5670
+ height: rect.height,
5671
+ zIndex: FLOATING_Z,
5672
+ boxShadow: "0 24px 50px -12px rgba(15,23,42,0.45)",
5673
+ borderRadius: 12,
5674
+ overflow: "hidden",
5675
+ display: minimized ? "none" : "flex"
5676
+ } : { position: "relative", flex: `0 0 ${dockedWidth}px`, width: dockedWidth, height: "100%", display: "flex" };
5677
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
5678
+ mode === "docked" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
5679
+ "div",
5680
+ {
5681
+ "data-testid": "inspector-resize-handle",
5682
+ onMouseDown: startWidthDrag,
5683
+ style: { width: 3, flexShrink: 0, cursor: "col-resize", background: "transparent", borderLeft: `1px solid ${colors.borderSubtle}`, zIndex: 10 },
5684
+ onMouseEnter: (e) => e.currentTarget.style.background = colors.border,
5685
+ onMouseLeave: (e) => e.currentTarget.style.background = "transparent"
5686
+ }
5687
+ ),
5688
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
5689
+ "div",
5690
+ {
5691
+ "data-testid": "inspector-frame",
5692
+ onMouseDownCapture: floating ? startMove : void 0,
5693
+ style,
5694
+ children: [
5695
+ children,
5696
+ floating && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
5697
+ "div",
5698
+ {
5699
+ "data-testid": "inspector-resize-grip",
5700
+ onMouseDown: startResize,
5701
+ style: { position: "absolute", right: 2, bottom: 2, width: 16, height: 16, cursor: "nwse-resize", zIndex: 5 }
5702
+ }
5703
+ )
5704
+ ]
5705
+ }
5706
+ ),
5707
+ minimized && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
5708
+ "div",
5709
+ {
5710
+ "data-testid": "inspector-min-bar",
5711
+ onClick: onRestore,
5712
+ title: messages.inspector.restore,
5713
+ style: minBarStyle,
5714
+ children: [
5715
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { width: 8, height: 8, borderRadius: "50%", background: colors.primary, flex: "0 0 auto" } }),
5716
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", fontSize: 12, color: colors.textSecondary }, children: messages.inspector.minimizedTitle }),
5717
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
5718
+ "button",
5719
+ {
5720
+ type: "button",
5721
+ "data-testid": "inspector-restore",
5722
+ "aria-label": messages.inspector.restore,
5723
+ title: messages.inspector.restore,
5724
+ onClick: (e) => {
5725
+ e.stopPropagation();
5726
+ onRestore();
5727
+ },
5728
+ style: barBtnStyle,
5729
+ children: "\u2922"
5730
+ }
5731
+ ),
5732
+ onClose && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
5733
+ "button",
5734
+ {
5735
+ type: "button",
5736
+ "data-testid": "inspector-min-close",
5737
+ "aria-label": "Close inspector",
5738
+ title: "Close inspector",
5739
+ onClick: (e) => {
5740
+ e.stopPropagation();
5741
+ onClose();
5742
+ },
5743
+ style: { ...barBtnStyle, fontSize: 16 },
5744
+ children: "\xD7"
5745
+ }
5746
+ )
5747
+ ]
5748
+ }
5749
+ )
5750
+ ] });
5751
+ }
5752
+ var minBarStyle = {
5753
+ position: "fixed",
5754
+ right: 16,
5755
+ bottom: 16,
5756
+ zIndex: MIN_BAR_Z,
5757
+ display: "flex",
5758
+ alignItems: "center",
5759
+ gap: 8,
5760
+ width: 260,
5761
+ height: 40,
5762
+ padding: "0 6px 0 12px",
5763
+ borderRadius: 10,
5764
+ background: "white",
5765
+ border: `1px solid ${colors.border}`,
5766
+ boxShadow: "0 12px 28px -10px rgba(15,23,42,0.4)",
5767
+ cursor: "pointer",
5768
+ userSelect: "none"
5769
+ };
5770
+ var barBtnStyle = {
5771
+ width: 24,
5772
+ height: 24,
5773
+ flex: "0 0 auto",
5774
+ border: `1px solid ${colors.border}`,
5775
+ borderRadius: radii.sm,
5776
+ background: "white",
5777
+ color: colors.textSecondary,
5778
+ cursor: "pointer",
5779
+ display: "inline-flex",
5780
+ alignItems: "center",
5781
+ justifyContent: "center",
5782
+ padding: 0,
5783
+ fontSize: 13
5784
+ };
5785
+
5713
5786
  // src/toolbar/Toolbar.tsx
5714
- var import_jsx_runtime16 = require("react/jsx-runtime");
5787
+ var import_jsx_runtime18 = require("react/jsx-runtime");
5715
5788
  function Toolbar({
5716
5789
  derived,
5717
5790
  readOnly,
@@ -5725,7 +5798,7 @@ function Toolbar({
5725
5798
  toolbarEnd
5726
5799
  }) {
5727
5800
  const messages = useMessages();
5728
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
5801
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
5729
5802
  "footer",
5730
5803
  {
5731
5804
  style: {
@@ -5740,11 +5813,11 @@ function Toolbar({
5740
5813
  },
5741
5814
  "data-testid": "toolbar",
5742
5815
  children: [
5743
- toolbarStart && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: slotStyle, "data-testid": "toolbar-start", children: toolbarStart }),
5744
- toolbarCenter && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { ...slotStyle, flex: 1, justifyContent: "center" }, "data-testid": "toolbar-center", children: toolbarCenter }),
5745
- !toolbarCenter && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { flex: 1 } }),
5746
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { role: "status", "aria-live": "polite", style: { display: "inline-flex", gap: 6 }, children: [
5747
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
5816
+ toolbarStart && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: slotStyle, "data-testid": "toolbar-start", children: toolbarStart }),
5817
+ toolbarCenter && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { ...slotStyle, flex: 1, justifyContent: "center" }, "data-testid": "toolbar-center", children: toolbarCenter }),
5818
+ !toolbarCenter && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { flex: 1 } }),
5819
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { role: "status", "aria-live": "polite", style: { display: "inline-flex", gap: 6 }, children: [
5820
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5748
5821
  ValidationPill,
5749
5822
  {
5750
5823
  severity: "error",
@@ -5756,7 +5829,7 @@ function Toolbar({
5756
5829
  testId: "toolbar-errors"
5757
5830
  }
5758
5831
  ),
5759
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
5832
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5760
5833
  ValidationPill,
5761
5834
  {
5762
5835
  severity: "warning",
@@ -5768,7 +5841,7 @@ function Toolbar({
5768
5841
  testId: "toolbar-warnings"
5769
5842
  }
5770
5843
  ),
5771
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
5844
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5772
5845
  ValidationPill,
5773
5846
  {
5774
5847
  severity: "info",
@@ -5781,7 +5854,7 @@ function Toolbar({
5781
5854
  }
5782
5855
  )
5783
5856
  ] }),
5784
- onSave && showSaveButton && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
5857
+ onSave && showSaveButton && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5785
5858
  "button",
5786
5859
  {
5787
5860
  type: "button",
@@ -5792,7 +5865,7 @@ function Toolbar({
5792
5865
  children: messages.toolbar.save
5793
5866
  }
5794
5867
  ),
5795
- toolbarEnd && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: slotStyle, "data-testid": "toolbar-end", children: toolbarEnd })
5868
+ toolbarEnd && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: slotStyle, "data-testid": "toolbar-end", children: toolbarEnd })
5796
5869
  ]
5797
5870
  }
5798
5871
  );
@@ -5814,7 +5887,7 @@ function ValidationPill({
5814
5887
  const tone = severityTone(severity);
5815
5888
  const interactive = count > 0 && !!onClick;
5816
5889
  const hasIssues = count > 0;
5817
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
5890
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
5818
5891
  "button",
5819
5892
  {
5820
5893
  type: "button",
@@ -5841,7 +5914,7 @@ function ValidationPill({
5841
5914
  height: 20
5842
5915
  },
5843
5916
  children: [
5844
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: severity === "info" ? 14 : 10, lineHeight: 1 }, children: SEVERITY_ICON[severity] }),
5917
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { style: { fontSize: severity === "info" ? 14 : 10, lineHeight: 1 }, children: SEVERITY_ICON[severity] }),
5845
5918
  count
5846
5919
  ]
5847
5920
  }
@@ -5866,7 +5939,7 @@ var slotStyle = {
5866
5939
 
5867
5940
  // src/toolbar/IssuesDrawer.tsx
5868
5941
  var import_react17 = require("react");
5869
- var import_jsx_runtime17 = require("react/jsx-runtime");
5942
+ var import_jsx_runtime19 = require("react/jsx-runtime");
5870
5943
  function resolveTarget(doc, targetId) {
5871
5944
  if (!targetId) return null;
5872
5945
  const ids = doc.meta.ids;
@@ -5955,7 +6028,7 @@ function IssuesDrawer({
5955
6028
  }, [severity, messages]);
5956
6029
  const tone = severityTone(severity);
5957
6030
  if (!open) return null;
5958
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
6031
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
5959
6032
  "div",
5960
6033
  {
5961
6034
  ref,
@@ -5979,7 +6052,7 @@ function IssuesDrawer({
5979
6052
  flexDirection: "column"
5980
6053
  },
5981
6054
  children: [
5982
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
6055
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
5983
6056
  "header",
5984
6057
  {
5985
6058
  style: {
@@ -5990,7 +6063,7 @@ function IssuesDrawer({
5990
6063
  gap: 8
5991
6064
  },
5992
6065
  children: [
5993
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6066
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
5994
6067
  "span",
5995
6068
  {
5996
6069
  style: {
@@ -6003,12 +6076,12 @@ function IssuesDrawer({
6003
6076
  "aria-hidden": true
6004
6077
  }
6005
6078
  ),
6006
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("strong", { style: { flex: 1, fontSize: 13, color: colors.textPrimary }, children: [
6079
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("strong", { style: { flex: 1, fontSize: 13, color: colors.textPrimary }, children: [
6007
6080
  title,
6008
6081
  " \xB7 ",
6009
6082
  filtered.length
6010
6083
  ] }),
6011
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6084
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6012
6085
  "button",
6013
6086
  {
6014
6087
  type: "button",
@@ -6031,14 +6104,14 @@ function IssuesDrawer({
6031
6104
  ]
6032
6105
  }
6033
6106
  ),
6034
- filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6107
+ filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6035
6108
  "p",
6036
6109
  {
6037
6110
  style: { padding: 12, color: colors.textTertiary, fontSize: 12, margin: 0 },
6038
6111
  "data-testid": "issues-drawer-empty",
6039
6112
  children: messages.issues.none
6040
6113
  }
6041
- ) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6114
+ ) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6042
6115
  "ul",
6043
6116
  {
6044
6117
  style: {
@@ -6052,7 +6125,7 @@ function IssuesDrawer({
6052
6125
  children: filtered.map((issue, idx) => {
6053
6126
  const target = resolveTarget(doc, issue.targetId);
6054
6127
  const targetLabel = target ? target.kind === "transition" ? `${messages.issues.relatedTransition}: ${target.label}` : target.kind === "state" ? `${messages.issues.relatedState}: ${target.label}` : target.label : null;
6055
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
6128
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
6056
6129
  "li",
6057
6130
  {
6058
6131
  style: {
@@ -6066,10 +6139,10 @@ function IssuesDrawer({
6066
6139
  },
6067
6140
  "data-testid": `issues-drawer-item-${idx}`,
6068
6141
  children: [
6069
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { fontSize: 11, fontWeight: 700, color: tone.fg }, children: issue.code }),
6070
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { fontSize: 12, color: colors.textPrimary }, children: issue.message }),
6071
- targetLabel && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { fontSize: 11, color: colors.textSecondary }, children: targetLabel }),
6072
- target && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6142
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { fontSize: 11, fontWeight: 700, color: tone.fg }, children: issue.code }),
6143
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { fontSize: 12, color: colors.textPrimary }, children: issue.message }),
6144
+ targetLabel && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { fontSize: 11, color: colors.textSecondary }, children: targetLabel }),
6145
+ target && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6073
6146
  "button",
6074
6147
  {
6075
6148
  type: "button",
@@ -6109,7 +6182,7 @@ var import_react19 = require("react");
6109
6182
  // src/toolbar/VersionBadge.tsx
6110
6183
  var import_react18 = require("react");
6111
6184
  var import_react_dom2 = require("react-dom");
6112
- var import_jsx_runtime18 = require("react/jsx-runtime");
6185
+ var import_jsx_runtime20 = require("react/jsx-runtime");
6113
6186
  function VersionBadge({
6114
6187
  version,
6115
6188
  supportedVersions,
@@ -6142,7 +6215,7 @@ function VersionBadge({
6142
6215
  setOpen((o) => !o);
6143
6216
  };
6144
6217
  if (readOnly) {
6145
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6218
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
6146
6219
  "div",
6147
6220
  {
6148
6221
  "data-testid": "version-badge",
@@ -6161,7 +6234,7 @@ function VersionBadge({
6161
6234
  );
6162
6235
  }
6163
6236
  const dropdown = open && dropdownPos ? (0, import_react_dom2.createPortal)(
6164
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
6237
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
6165
6238
  "div",
6166
6239
  {
6167
6240
  ref: dropdownRef,
@@ -6180,7 +6253,7 @@ function VersionBadge({
6180
6253
  zIndex: 9999
6181
6254
  },
6182
6255
  children: [
6183
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6256
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
6184
6257
  "div",
6185
6258
  {
6186
6259
  style: {
@@ -6197,7 +6270,7 @@ function VersionBadge({
6197
6270
  ),
6198
6271
  [...supportedVersions].reverse().map((v) => {
6199
6272
  const isCurrent = v === version.replace(/^v/, "");
6200
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
6273
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
6201
6274
  "button",
6202
6275
  {
6203
6276
  type: "button",
@@ -6220,16 +6293,16 @@ function VersionBadge({
6220
6293
  textAlign: "left"
6221
6294
  },
6222
6295
  children: [
6223
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { children: [
6296
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
6224
6297
  v,
6225
6298
  " ",
6226
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { style: { fontSize: 11, color: isCurrent ? "#93C5FD" : "#94A3B8" }, children: [
6299
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { fontSize: 11, color: isCurrent ? "#93C5FD" : "#94A3B8" }, children: [
6227
6300
  "cyoda-go ",
6228
6301
  v,
6229
6302
  ".x"
6230
6303
  ] })
6231
6304
  ] }),
6232
- isCurrent && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6305
+ isCurrent && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
6233
6306
  "span",
6234
6307
  {
6235
6308
  style: {
@@ -6253,8 +6326,8 @@ function VersionBadge({
6253
6326
  ),
6254
6327
  document.body
6255
6328
  ) : null;
6256
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
6257
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
6329
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
6330
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
6258
6331
  "button",
6259
6332
  {
6260
6333
  ref: buttonRef,
@@ -6277,7 +6350,7 @@ function VersionBadge({
6277
6350
  },
6278
6351
  children: [
6279
6352
  version,
6280
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { style: { fontSize: 10, opacity: 0.7 }, children: open ? "\u25B4" : "\u25BE" })
6353
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { style: { fontSize: 10, opacity: 0.7 }, children: open ? "\u25B4" : "\u25BE" })
6281
6354
  ]
6282
6355
  }
6283
6356
  ),
@@ -6286,7 +6359,7 @@ function VersionBadge({
6286
6359
  }
6287
6360
 
6288
6361
  // src/toolbar/WorkflowTabs.tsx
6289
- var import_jsx_runtime19 = require("react/jsx-runtime");
6362
+ var import_jsx_runtime21 = require("react/jsx-runtime");
6290
6363
  function WorkflowTabs({
6291
6364
  workflows,
6292
6365
  activeWorkflow,
@@ -6323,7 +6396,7 @@ function WorkflowTabs({
6323
6396
  setEditingTab(null);
6324
6397
  };
6325
6398
  const cancelEdit = () => setEditingTab(null);
6326
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
6399
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
6327
6400
  "nav",
6328
6401
  {
6329
6402
  style: {
@@ -6341,7 +6414,7 @@ function WorkflowTabs({
6341
6414
  workflows.map((w) => {
6342
6415
  const active = w.name === activeWorkflow;
6343
6416
  const isEditing = editingTab === w.name;
6344
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
6417
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
6345
6418
  "div",
6346
6419
  {
6347
6420
  style: {
@@ -6352,7 +6425,7 @@ function WorkflowTabs({
6352
6425
  background: active ? "white" : "transparent"
6353
6426
  },
6354
6427
  children: [
6355
- isEditing ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6428
+ isEditing ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
6356
6429
  "input",
6357
6430
  {
6358
6431
  ref: inputRef,
@@ -6383,7 +6456,7 @@ function WorkflowTabs({
6383
6456
  width: Math.max(60, draftName.length * 8)
6384
6457
  }
6385
6458
  }
6386
- ) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6459
+ ) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
6387
6460
  "button",
6388
6461
  {
6389
6462
  type: "button",
@@ -6402,7 +6475,7 @@ function WorkflowTabs({
6402
6475
  children: w.name || messages.tabs.untitled
6403
6476
  }
6404
6477
  ),
6405
- onClose && !readOnly && workflows.length > 1 && !isEditing && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6478
+ onClose && !readOnly && workflows.length > 1 && !isEditing && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
6406
6479
  "button",
6407
6480
  {
6408
6481
  type: "button",
@@ -6425,7 +6498,7 @@ function WorkflowTabs({
6425
6498
  w.name
6426
6499
  );
6427
6500
  }),
6428
- onAdd && !readOnly && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
6501
+ onAdd && !readOnly && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
6429
6502
  "button",
6430
6503
  {
6431
6504
  type: "button",
@@ -6450,9 +6523,9 @@ function WorkflowTabs({
6450
6523
  ]
6451
6524
  }
6452
6525
  ),
6453
- dialectVersion && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
6454
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { flex: 1 } }),
6455
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6526
+ dialectVersion && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
6527
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: { flex: 1 } }),
6528
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
6456
6529
  VersionBadge,
6457
6530
  {
6458
6531
  version: dialectVersion,
@@ -6470,7 +6543,7 @@ function WorkflowTabs({
6470
6543
  // src/modals/DragConnectModal.tsx
6471
6544
  var import_react20 = require("react");
6472
6545
  var import_workflow_core9 = require("@cyoda/workflow-core");
6473
- var import_jsx_runtime20 = require("react/jsx-runtime");
6546
+ var import_jsx_runtime22 = require("react/jsx-runtime");
6474
6547
  function generateDefault(toState, existing) {
6475
6548
  const base = `to_${toState}`;
6476
6549
  if (!existing.has(base)) return base;
@@ -6491,16 +6564,16 @@ function DragConnectModal({
6491
6564
  const invalidFormat = !!name && !import_workflow_core9.NAME_REGEX.test(name);
6492
6565
  const duplicate = existing.has(name);
6493
6566
  const blocked = name.length === 0 || invalidFormat || duplicate;
6494
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(ModalFrame, { onCancel, children: [
6495
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h2", { style: { margin: 0, fontSize: 16 }, children: messages.dragConnect.title }),
6496
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("p", { style: { margin: "6px 0 14px", fontSize: 12, color: colors.textSecondary }, children: [
6567
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(ModalFrame, { onCancel, children: [
6568
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h2", { style: { margin: 0, fontSize: 16 }, children: messages.dragConnect.title }),
6569
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("p", { style: { margin: "6px 0 14px", fontSize: 12, color: colors.textSecondary }, children: [
6497
6570
  fromState,
6498
6571
  " \u2192 ",
6499
6572
  toState
6500
6573
  ] }),
6501
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
6502
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { style: { fontSize: 12, color: colors.textSecondary }, children: messages.dragConnect.transitionName }),
6503
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
6574
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
6575
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { fontSize: 12, color: colors.textSecondary }, children: messages.dragConnect.transitionName }),
6576
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
6504
6577
  "input",
6505
6578
  {
6506
6579
  type: "text",
@@ -6520,17 +6593,17 @@ function DragConnectModal({
6520
6593
  }
6521
6594
  )
6522
6595
  ] }),
6523
- invalidFormat && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: errorMsg, "data-testid": "dragconnect-error-format", children: messages.dragConnect.invalidName }),
6524
- duplicate && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: errorMsg, "data-testid": "dragconnect-error-duplicate", children: messages.dragConnect.duplicateName }),
6525
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, marginTop: 16 }, children: [
6526
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", onClick: onCancel, style: ghostBtn7, "data-testid": "dragconnect-cancel", children: messages.dragConnect.cancel }),
6527
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
6596
+ invalidFormat && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: errorMsg, "data-testid": "dragconnect-error-format", children: messages.dragConnect.invalidName }),
6597
+ duplicate && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: errorMsg, "data-testid": "dragconnect-error-duplicate", children: messages.dragConnect.duplicateName }),
6598
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, marginTop: 16 }, children: [
6599
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { type: "button", onClick: onCancel, style: ghostBtn6, "data-testid": "dragconnect-cancel", children: messages.dragConnect.cancel }),
6600
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
6528
6601
  "button",
6529
6602
  {
6530
6603
  type: "button",
6531
6604
  onClick: () => !blocked && onCreate(name),
6532
6605
  disabled: blocked,
6533
- style: primaryBtn4,
6606
+ style: primaryBtn3,
6534
6607
  "data-testid": "dragconnect-create",
6535
6608
  children: messages.dragConnect.create
6536
6609
  }
@@ -6543,7 +6616,7 @@ var errorMsg = {
6543
6616
  fontSize: 12,
6544
6617
  color: colors.danger
6545
6618
  };
6546
- var ghostBtn7 = {
6619
+ var ghostBtn6 = {
6547
6620
  padding: "6px 12px",
6548
6621
  background: "white",
6549
6622
  border: `1px solid ${colors.border}`,
@@ -6551,8 +6624,8 @@ var ghostBtn7 = {
6551
6624
  fontSize: 13,
6552
6625
  cursor: "pointer"
6553
6626
  };
6554
- var primaryBtn4 = {
6555
- ...ghostBtn7,
6627
+ var primaryBtn3 = {
6628
+ ...ghostBtn6,
6556
6629
  background: colors.primary,
6557
6630
  color: "white",
6558
6631
  borderColor: colors.primary
@@ -6561,7 +6634,7 @@ var primaryBtn4 = {
6561
6634
  // src/modals/AddStateModal.tsx
6562
6635
  var import_react21 = require("react");
6563
6636
  var import_workflow_core10 = require("@cyoda/workflow-core");
6564
- var import_jsx_runtime21 = require("react/jsx-runtime");
6637
+ var import_jsx_runtime23 = require("react/jsx-runtime");
6565
6638
  function generateName(existing) {
6566
6639
  let n = 1;
6567
6640
  while (existing.includes(`state${n}`)) n++;
@@ -6589,11 +6662,11 @@ function AddStateModal({ existingNames, onCreate, onCancel }) {
6589
6662
  }
6590
6663
  onCreate(name.trim());
6591
6664
  };
6592
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(ModalFrame, { onCancel, labelledBy: "add-state-title", children: [
6593
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h2", { id: "add-state-title", style: { margin: 0, fontSize: 16 }, children: "Add State" }),
6594
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { marginTop: 16, display: "flex", flexDirection: "column", gap: 6 }, children: [
6595
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: "add-state-name-input", style: { fontSize: 12, color: colors.textSecondary }, children: "State name" }),
6596
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
6665
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(ModalFrame, { onCancel, labelledBy: "add-state-title", children: [
6666
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h2", { id: "add-state-title", style: { margin: 0, fontSize: 16 }, children: "Add State" }),
6667
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { marginTop: 16, display: "flex", flexDirection: "column", gap: 6 }, children: [
6668
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("label", { htmlFor: "add-state-name-input", style: { fontSize: 12, color: colors.textSecondary }, children: "State name" }),
6669
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
6597
6670
  "input",
6598
6671
  {
6599
6672
  ref: inputRef,
@@ -6619,7 +6692,7 @@ function AddStateModal({ existingNames, onCreate, onCancel }) {
6619
6692
  }
6620
6693
  }
6621
6694
  ),
6622
- error && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
6695
+ error && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
6623
6696
  "div",
6624
6697
  {
6625
6698
  id: "add-state-error",
@@ -6629,23 +6702,23 @@ function AddStateModal({ existingNames, onCreate, onCancel }) {
6629
6702
  }
6630
6703
  )
6631
6704
  ] }),
6632
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, marginTop: 20 }, children: [
6633
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
6705
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, marginTop: 20 }, children: [
6706
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
6634
6707
  "button",
6635
6708
  {
6636
6709
  type: "button",
6637
6710
  onClick: onCancel,
6638
- style: ghostBtn8,
6711
+ style: ghostBtn7,
6639
6712
  "data-testid": "add-state-cancel",
6640
6713
  children: "Cancel"
6641
6714
  }
6642
6715
  ),
6643
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
6716
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
6644
6717
  "button",
6645
6718
  {
6646
6719
  type: "button",
6647
6720
  onClick: handleSubmit,
6648
- style: primaryBtn5,
6721
+ style: primaryBtn4,
6649
6722
  "data-testid": "add-state-confirm",
6650
6723
  children: "Add State"
6651
6724
  }
@@ -6653,7 +6726,7 @@ function AddStateModal({ existingNames, onCreate, onCancel }) {
6653
6726
  ] })
6654
6727
  ] });
6655
6728
  }
6656
- var ghostBtn8 = {
6729
+ var ghostBtn7 = {
6657
6730
  padding: "6px 12px",
6658
6731
  background: "white",
6659
6732
  border: `1px solid ${colors.border}`,
@@ -6661,8 +6734,8 @@ var ghostBtn8 = {
6661
6734
  fontSize: 13,
6662
6735
  cursor: "pointer"
6663
6736
  };
6664
- var primaryBtn5 = {
6665
- ...ghostBtn8,
6737
+ var primaryBtn4 = {
6738
+ ...ghostBtn7,
6666
6739
  background: colors.primary,
6667
6740
  color: "white",
6668
6741
  borderColor: colors.primary
@@ -6670,15 +6743,15 @@ var primaryBtn5 = {
6670
6743
 
6671
6744
  // src/modals/HelpModal.tsx
6672
6745
  var import_theme6 = require("@cyoda/workflow-viewer/theme");
6673
- var import_jsx_runtime22 = require("react/jsx-runtime");
6746
+ var import_jsx_runtime24 = require("react/jsx-runtime");
6674
6747
  function HelpModal({ onCancel }) {
6675
6748
  const messages = useMessages();
6676
6749
  const h = messages.help;
6677
6750
  const node = import_theme6.workflowPalette.node;
6678
6751
  const edge = import_theme6.workflowPalette.edge;
6679
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ModalFrame, { onCancel, labelledBy: "workflow-help-title", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { width: 480, maxWidth: "85vw" }, children: [
6680
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h2", { id: "workflow-help-title", style: { margin: 0, fontSize: 16 }, children: h.title }),
6681
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
6752
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ModalFrame, { onCancel, labelledBy: "workflow-help-title", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { width: 480, maxWidth: "85vw" }, children: [
6753
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h2", { id: "workflow-help-title", style: { margin: 0, fontSize: 16 }, children: h.title }),
6754
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
6682
6755
  "div",
6683
6756
  {
6684
6757
  style: {
@@ -6691,48 +6764,48 @@ function HelpModal({ onCancel }) {
6691
6764
  gap: 16
6692
6765
  },
6693
6766
  children: [
6694
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Section, { title: h.statesTitle, children: [
6695
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ColorRow, { fill: node.initial.fill, border: node.initial.border, label: h.stateInitial }),
6696
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ColorRow, { fill: node.default.fill, border: node.default.border, label: h.stateDefault }),
6697
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ColorRow, { fill: node.processing.fill, border: node.processing.border, label: h.stateProcessing }),
6698
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ColorRow, { fill: node.manualReview.fill, border: node.manualReview.border, label: h.stateManualReview }),
6699
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ColorRow, { fill: node.terminal.fill, border: node.terminal.border, label: h.stateTerminal }),
6700
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ColorRow, { fill: "#FFFFFF", border: colors.danger, label: h.stateError }),
6701
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ColorRow, { fill: "#FFFFFF", border: colors.warning, label: h.stateWarning })
6767
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Section, { title: h.statesTitle, children: [
6768
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ColorRow, { fill: node.initial.fill, border: node.initial.border, label: h.stateInitial }),
6769
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ColorRow, { fill: node.default.fill, border: node.default.border, label: h.stateDefault }),
6770
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ColorRow, { fill: node.processing.fill, border: node.processing.border, label: h.stateProcessing }),
6771
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ColorRow, { fill: node.manualReview.fill, border: node.manualReview.border, label: h.stateManualReview }),
6772
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ColorRow, { fill: node.terminal.fill, border: node.terminal.border, label: h.stateTerminal }),
6773
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ColorRow, { fill: "#FFFFFF", border: colors.danger, label: h.stateError }),
6774
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ColorRow, { fill: "#FFFFFF", border: colors.warning, label: h.stateWarning })
6702
6775
  ] }),
6703
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Section, { title: h.transitionsTitle, children: [
6704
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(LineRow, { color: edge.automated, label: h.transitionAutomated }),
6705
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(LineRow, { color: edge.manual, dashed: true, label: h.transitionManual }),
6706
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(LineRow, { color: edge.conditional, label: h.transitionConditional }),
6707
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(LineRow, { color: edge.processing, label: h.transitionProcessing }),
6708
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(LineRow, { color: edge.terminal, label: h.transitionTerminal }),
6709
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(LineRow, { color: edge.loop, label: h.transitionLoop }),
6710
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(LineRow, { color: edge.disabled, label: h.transitionDisabled })
6776
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Section, { title: h.transitionsTitle, children: [
6777
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(LineRow, { color: edge.automated, label: h.transitionAutomated }),
6778
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(LineRow, { color: edge.manual, dashed: true, label: h.transitionManual }),
6779
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(LineRow, { color: edge.conditional, label: h.transitionConditional }),
6780
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(LineRow, { color: edge.processing, label: h.transitionProcessing }),
6781
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(LineRow, { color: edge.terminal, label: h.transitionTerminal }),
6782
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(LineRow, { color: edge.loop, label: h.transitionLoop }),
6783
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(LineRow, { color: edge.disabled, label: h.transitionDisabled })
6711
6784
  ] }),
6712
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Section, { title: h.controlsTitle, children: [
6713
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ShortcutRow, { keys: "A", label: h.shortcutAddState }),
6714
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ShortcutRow, { keys: "L", label: h.shortcutAutoLayout }),
6715
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ShortcutRow, { keys: "Ctrl/\u2318 Z", label: h.shortcutUndo }),
6716
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ShortcutRow, { keys: "Ctrl/\u2318 \u21E7 Z", label: h.shortcutRedo }),
6717
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ShortcutRow, { keys: "Ctrl/\u2318 S", label: h.shortcutSave }),
6718
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ShortcutRow, { keys: "Delete", label: h.shortcutDelete }),
6719
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ShortcutRow, { keys: "Esc", label: h.shortcutEscape })
6785
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Section, { title: h.controlsTitle, children: [
6786
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ShortcutRow, { keys: "A", label: h.shortcutAddState }),
6787
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ShortcutRow, { keys: "L", label: h.shortcutAutoLayout }),
6788
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ShortcutRow, { keys: "Ctrl/\u2318 Z", label: h.shortcutUndo }),
6789
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ShortcutRow, { keys: "Ctrl/\u2318 \u21E7 Z", label: h.shortcutRedo }),
6790
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ShortcutRow, { keys: "Ctrl/\u2318 S", label: h.shortcutSave }),
6791
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ShortcutRow, { keys: "Delete", label: h.shortcutDelete }),
6792
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ShortcutRow, { keys: "Esc", label: h.shortcutEscape })
6720
6793
  ] }),
6721
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Section, { title: h.tipsTitle, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("ul", { style: { margin: 0, paddingLeft: 18, fontSize: 13, color: colors.textSecondary, display: "flex", flexDirection: "column", gap: 6 }, children: [
6722
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("li", { children: h.tipDoubleClick }),
6723
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("li", { children: h.tipConnect }),
6724
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("li", { children: h.tipSelect }),
6725
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("li", { children: h.tipMove })
6794
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Section, { title: h.tipsTitle, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("ul", { style: { margin: 0, paddingLeft: 18, fontSize: 13, color: colors.textSecondary, display: "flex", flexDirection: "column", gap: 6 }, children: [
6795
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("li", { children: h.tipDoubleClick }),
6796
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("li", { children: h.tipConnect }),
6797
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("li", { children: h.tipSelect }),
6798
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("li", { children: h.tipMove })
6726
6799
  ] }) })
6727
6800
  ]
6728
6801
  }
6729
6802
  ),
6730
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { display: "flex", justifyContent: "flex-end", marginTop: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { type: "button", onClick: onCancel, style: ghostBtnStyle, "data-testid": "help-modal-close", children: h.close }) })
6803
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: { display: "flex", justifyContent: "flex-end", marginTop: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "button", onClick: onCancel, style: ghostBtnStyle, "data-testid": "help-modal-close", children: h.close }) })
6731
6804
  ] }) });
6732
6805
  }
6733
6806
  function Section({ title, children }) {
6734
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
6735
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
6807
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
6808
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
6736
6809
  "h3",
6737
6810
  {
6738
6811
  style: {
@@ -6746,12 +6819,12 @@ function Section({ title, children }) {
6746
6819
  children: title
6747
6820
  }
6748
6821
  ),
6749
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children })
6822
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children })
6750
6823
  ] });
6751
6824
  }
6752
6825
  function ColorRow({ fill, border, label }) {
6753
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 10, fontSize: 13, color: colors.textPrimary }, children: [
6754
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
6826
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 10, fontSize: 13, color: colors.textPrimary }, children: [
6827
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
6755
6828
  "span",
6756
6829
  {
6757
6830
  style: {
@@ -6764,12 +6837,12 @@ function ColorRow({ fill, border, label }) {
6764
6837
  }
6765
6838
  }
6766
6839
  ),
6767
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: label })
6840
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: label })
6768
6841
  ] });
6769
6842
  }
6770
6843
  function LineRow({ color, label, dashed }) {
6771
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 10, fontSize: 13, color: colors.textPrimary }, children: [
6772
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("svg", { width: "28", height: "14", style: { flexShrink: 0 }, "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
6844
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 10, fontSize: 13, color: colors.textPrimary }, children: [
6845
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("svg", { width: "28", height: "14", style: { flexShrink: 0 }, "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
6773
6846
  "line",
6774
6847
  {
6775
6848
  x1: "2",
@@ -6782,12 +6855,12 @@ function LineRow({ color, label, dashed }) {
6782
6855
  ...dashed ? { strokeDasharray: "3 3" } : {}
6783
6856
  }
6784
6857
  ) }),
6785
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: label })
6858
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: label })
6786
6859
  ] });
6787
6860
  }
6788
6861
  function ShortcutRow({ keys, label }) {
6789
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 10, fontSize: 13, color: colors.textPrimary }, children: [
6790
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
6862
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 10, fontSize: 13, color: colors.textPrimary }, children: [
6863
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
6791
6864
  "kbd",
6792
6865
  {
6793
6866
  style: {
@@ -6807,12 +6880,12 @@ function ShortcutRow({ keys, label }) {
6807
6880
  children: keys
6808
6881
  }
6809
6882
  ),
6810
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: label })
6883
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: label })
6811
6884
  ] });
6812
6885
  }
6813
6886
 
6814
6887
  // src/modals/VersionSwitchModal.tsx
6815
- var import_jsx_runtime23 = require("react/jsx-runtime");
6888
+ var import_jsx_runtime25 = require("react/jsx-runtime");
6816
6889
  function VersionSwitchModal({
6817
6890
  fromVersion,
6818
6891
  toVersion,
@@ -6820,7 +6893,7 @@ function VersionSwitchModal({
6820
6893
  onConfirm,
6821
6894
  onCancel
6822
6895
  }) {
6823
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
6896
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
6824
6897
  "div",
6825
6898
  {
6826
6899
  style: {
@@ -6832,7 +6905,7 @@ function VersionSwitchModal({
6832
6905
  justifyContent: "center",
6833
6906
  zIndex: 1e3
6834
6907
  },
6835
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
6908
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
6836
6909
  "div",
6837
6910
  {
6838
6911
  "data-testid": "version-switch-modal",
@@ -6846,8 +6919,8 @@ function VersionSwitchModal({
6846
6919
  fontFamily: "inherit"
6847
6920
  },
6848
6921
  children: [
6849
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { padding: "16px 20px 0", display: "flex", alignItems: "flex-start", gap: 12 }, children: [
6850
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
6922
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { style: { padding: "16px 20px 0", display: "flex", alignItems: "flex-start", gap: 12 }, children: [
6923
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
6851
6924
  "div",
6852
6925
  {
6853
6926
  style: {
@@ -6864,20 +6937,20 @@ function VersionSwitchModal({
6864
6937
  children: "\u26A0\uFE0F"
6865
6938
  }
6866
6939
  ),
6867
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { children: [
6868
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { fontWeight: 600, fontSize: 14, color: "#0F172A", marginBottom: 4 }, children: [
6940
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
6941
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { style: { fontWeight: 600, fontSize: 14, color: "#0F172A", marginBottom: 4 }, children: [
6869
6942
  "Switch to ",
6870
6943
  toVersion,
6871
6944
  "?"
6872
6945
  ] }),
6873
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { color: "#475569", lineHeight: 1.5, fontSize: 13 }, children: [
6946
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { style: { color: "#475569", lineHeight: 1.5, fontSize: 13 }, children: [
6874
6947
  "Switching to ",
6875
6948
  toVersion,
6876
6949
  " will remove data not supported in that dialect:"
6877
6950
  ] })
6878
6951
  ] })
6879
6952
  ] }),
6880
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
6953
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
6881
6954
  "div",
6882
6955
  {
6883
6956
  style: {
@@ -6890,17 +6963,17 @@ function VersionSwitchModal({
6890
6963
  fontSize: 12
6891
6964
  },
6892
6965
  children: [
6893
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { style: { fontWeight: 600, marginBottom: 6 }, children: "Will be removed:" }),
6894
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("ul", { style: { margin: 0, paddingLeft: 16, lineHeight: 1.8 }, children: warnings.map((w, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("li", { children: w }, i)) })
6966
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { style: { fontWeight: 600, marginBottom: 6 }, children: "Will be removed:" }),
6967
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("ul", { style: { margin: 0, paddingLeft: 16, lineHeight: 1.8 }, children: warnings.map((w, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("li", { children: w }, i)) })
6895
6968
  ]
6896
6969
  }
6897
6970
  ),
6898
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { padding: "10px 20px 0 64px", color: "#64748B", fontSize: 12, lineHeight: 1.5 }, children: [
6971
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { style: { padding: "10px 20px 0 64px", color: "#64748B", fontSize: 12, lineHeight: 1.5 }, children: [
6899
6972
  "This cannot be undone. You can switch back to ",
6900
6973
  fromVersion,
6901
6974
  " any time, but the removed data will not be restored."
6902
6975
  ] }),
6903
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
6976
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
6904
6977
  "div",
6905
6978
  {
6906
6979
  style: {
@@ -6912,7 +6985,7 @@ function VersionSwitchModal({
6912
6985
  marginTop: 16
6913
6986
  },
6914
6987
  children: [
6915
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
6988
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
6916
6989
  "button",
6917
6990
  {
6918
6991
  type: "button",
@@ -6930,7 +7003,7 @@ function VersionSwitchModal({
6930
7003
  children: "Cancel"
6931
7004
  }
6932
7005
  ),
6933
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
7006
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
6934
7007
  "button",
6935
7008
  {
6936
7009
  type: "button",
@@ -6965,7 +7038,7 @@ function VersionSwitchModal({
6965
7038
 
6966
7039
  // src/components/CommentNode.tsx
6967
7040
  var import_react22 = require("react");
6968
- var import_jsx_runtime24 = require("react/jsx-runtime");
7041
+ var import_jsx_runtime26 = require("react/jsx-runtime");
6969
7042
  function CommentNode({ comment, disabled, onUpdate, onRemove }) {
6970
7043
  const [editing, setEditing] = (0, import_react22.useState)(false);
6971
7044
  const [draft, setDraft] = (0, import_react22.useState)(comment.text);
@@ -6974,7 +7047,7 @@ function CommentNode({ comment, disabled, onUpdate, onRemove }) {
6974
7047
  setEditing(false);
6975
7048
  if (draft !== comment.text) onUpdate({ text: draft });
6976
7049
  };
6977
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
7050
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
6978
7051
  "div",
6979
7052
  {
6980
7053
  "data-testid": `comment-${comment.id}`,
@@ -6995,8 +7068,8 @@ function CommentNode({ comment, disabled, onUpdate, onRemove }) {
6995
7068
  userSelect: "none"
6996
7069
  },
6997
7070
  children: [
6998
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", justifyContent: "flex-end", gap: 4, marginBottom: 4 }, children: [
6999
- !disabled && !editing && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
7071
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { style: { display: "flex", justifyContent: "flex-end", gap: 4, marginBottom: 4 }, children: [
7072
+ !disabled && !editing && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
7000
7073
  "button",
7001
7074
  {
7002
7075
  type: "button",
@@ -7011,7 +7084,7 @@ function CommentNode({ comment, disabled, onUpdate, onRemove }) {
7011
7084
  children: "\u270F\uFE0F"
7012
7085
  }
7013
7086
  ),
7014
- !disabled && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
7087
+ !disabled && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
7015
7088
  "button",
7016
7089
  {
7017
7090
  type: "button",
@@ -7023,7 +7096,7 @@ function CommentNode({ comment, disabled, onUpdate, onRemove }) {
7023
7096
  }
7024
7097
  )
7025
7098
  ] }),
7026
- editing ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
7099
+ editing ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
7027
7100
  "textarea",
7028
7101
  {
7029
7102
  ref: textareaRef,
@@ -7049,7 +7122,7 @@ function CommentNode({ comment, disabled, onUpdate, onRemove }) {
7049
7122
  },
7050
7123
  "data-testid": `comment-textarea-${comment.id}`
7051
7124
  }
7052
- ) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
7125
+ ) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
7053
7126
  "div",
7054
7127
  {
7055
7128
  onDoubleClick: () => {
@@ -7059,7 +7132,7 @@ function CommentNode({ comment, disabled, onUpdate, onRemove }) {
7059
7132
  }
7060
7133
  },
7061
7134
  style: { whiteSpace: "pre-wrap", wordBreak: "break-word", minHeight: 20 },
7062
- children: comment.text || /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("em", { style: { color: "#94a3b8" }, children: "empty note" })
7135
+ children: comment.text || /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("em", { style: { color: "#94a3b8" }, children: "empty note" })
7063
7136
  }
7064
7137
  )
7065
7138
  ]
@@ -7079,7 +7152,7 @@ var iconBtn = {
7079
7152
  // src/components/WorkflowJsonEditor.tsx
7080
7153
  var import_react23 = require("react");
7081
7154
  var import_workflow_monaco2 = require("@cyoda/workflow-monaco");
7082
- var import_jsx_runtime25 = require("react/jsx-runtime");
7155
+ var import_jsx_runtime27 = require("react/jsx-runtime");
7083
7156
  function WorkflowJsonEditor({
7084
7157
  document: document2,
7085
7158
  issues,
@@ -7204,7 +7277,7 @@ function WorkflowJsonEditor({
7204
7277
  return () => window.clearTimeout(timeout);
7205
7278
  }, [document2, selectedId, visible]);
7206
7279
  if (!config) {
7207
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7280
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
7208
7281
  "div",
7209
7282
  {
7210
7283
  "data-testid": "workflow-json-unavailable",
@@ -7219,11 +7292,11 @@ function WorkflowJsonEditor({
7219
7292
  textAlign: "center",
7220
7293
  background: "#F8FAFC"
7221
7294
  },
7222
- children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(UnavailableMessage, {})
7295
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(UnavailableMessage, {})
7223
7296
  }
7224
7297
  );
7225
7298
  }
7226
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
7299
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
7227
7300
  "div",
7228
7301
  {
7229
7302
  "data-testid": "workflow-json-editor",
@@ -7235,8 +7308,8 @@ function WorkflowJsonEditor({
7235
7308
  minHeight: 0
7236
7309
  },
7237
7310
  children: [
7238
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(JsonStatusBanner, { status }),
7239
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7311
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(JsonStatusBanner, { status }),
7312
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
7240
7313
  "div",
7241
7314
  {
7242
7315
  ref: containerRef,
@@ -7249,7 +7322,7 @@ function WorkflowJsonEditor({
7249
7322
  }
7250
7323
  function UnavailableMessage() {
7251
7324
  const messages = useMessages();
7252
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children: messages.editorView.unavailable });
7325
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_jsx_runtime27.Fragment, { children: messages.editorView.unavailable });
7253
7326
  }
7254
7327
  function JsonStatusBanner({ status }) {
7255
7328
  const messages = useMessages();
@@ -7258,7 +7331,7 @@ function JsonStatusBanner({ status }) {
7258
7331
  }
7259
7332
  const tone = status.status === "semantic-errors" ? { border: "#FCD34D", bg: "#FFFBEB", text: "#92400E" } : { border: "#FCA5A5", bg: "#FEF2F2", text: "#991B1B" };
7260
7333
  const body = status.status === "semantic-errors" ? messages.editorView.semanticErrors : status.status === "invalid-schema" ? messages.editorView.invalidSchema : `${messages.editorView.invalidJson}${status.message ? ` ${status.message}` : ""}`;
7261
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7334
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
7262
7335
  "div",
7263
7336
  {
7264
7337
  role: "status",
@@ -7302,7 +7375,7 @@ function selectionFromJsonId(doc, id) {
7302
7375
  }
7303
7376
 
7304
7377
  // src/components/WorkflowEditor.tsx
7305
- var import_jsx_runtime26 = require("react/jsx-runtime");
7378
+ var import_jsx_runtime28 = require("react/jsx-runtime");
7306
7379
  function hasPersistedWorkflowUi(meta) {
7307
7380
  return !!meta && Object.values(meta).some((value) => value !== void 0);
7308
7381
  }
@@ -7382,6 +7455,16 @@ function WorkflowEditor({
7382
7455
  const [jsonStatus, setJsonStatus] = (0, import_react24.useState)({ status: "idle" });
7383
7456
  const [openIssueSeverity, setOpenIssueSeverity] = (0, import_react24.useState)(null);
7384
7457
  const [inspectorOpen, setInspectorOpen] = (0, import_react24.useState)(false);
7458
+ const [placement, setPlacement] = (0, import_react24.useState)(() => {
7459
+ const loaded = loadPlacement(localStorageKey);
7460
+ if (loaded) {
7461
+ return {
7462
+ ...loaded,
7463
+ rect: clampRect(loaded.rect, { w: window.innerWidth, h: window.innerHeight })
7464
+ };
7465
+ }
7466
+ return { mode: "docked", rect: { left: 120, top: 96, width: 460, height: 560 } };
7467
+ });
7385
7468
  const [pendingVersionSwitch, setPendingVersionSwitch] = (0, import_react24.useState)(null);
7386
7469
  const selectionRef = (0, import_react24.useRef)(state.selection);
7387
7470
  const documentStateRef = (0, import_react24.useRef)(state.document);
@@ -7422,21 +7505,33 @@ function WorkflowEditor({
7422
7505
  const ui = state.document.meta.workflowUi[state.activeWorkflow];
7423
7506
  if (ui) onLayoutMetadataChange(ui);
7424
7507
  }, [state.document.meta.workflowUi, state.activeWorkflow, onLayoutMetadataChange]);
7425
- const handleInspectorResizeStart = (0, import_react24.useCallback)((e) => {
7426
- e.preventDefault();
7427
- const startX = e.clientX;
7428
- const startWidth = inspectorWidth;
7429
- const onMove = (ev) => {
7430
- const delta = startX - ev.clientX;
7431
- setInspectorWidth(Math.max(360, startWidth + delta));
7432
- };
7433
- const onUp = () => {
7434
- document.removeEventListener("mousemove", onMove);
7435
- document.removeEventListener("mouseup", onUp);
7436
- };
7437
- document.addEventListener("mousemove", onMove);
7438
- document.addEventListener("mouseup", onUp);
7439
- }, [inspectorWidth]);
7508
+ (0, import_react24.useEffect)(() => {
7509
+ savePlacement(localStorageKey, placement);
7510
+ }, [placement, localStorageKey]);
7511
+ const toggleDock = (0, import_react24.useCallback)(() => {
7512
+ setPlacement((p) => {
7513
+ const viewport = { w: window.innerWidth, h: window.innerHeight };
7514
+ if (p.mode === "docked") {
7515
+ return { mode: "floating", rect: clampRect(p.rect, viewport) };
7516
+ }
7517
+ return { ...p, mode: "docked" };
7518
+ });
7519
+ }, []);
7520
+ const minimizeInspector = (0, import_react24.useCallback)(() => {
7521
+ setPlacement(
7522
+ (p) => p.mode === "minimized" ? p : { mode: "minimized", rect: p.rect, restoreMode: p.mode }
7523
+ );
7524
+ }, []);
7525
+ const restoreInspector = (0, import_react24.useCallback)(() => {
7526
+ setPlacement((p) => {
7527
+ if (p.mode !== "minimized") return p;
7528
+ const back = p.restoreMode ?? "docked";
7529
+ if (back === "floating") {
7530
+ return { mode: "floating", rect: clampRect(p.rect, { w: window.innerWidth, h: window.innerHeight }) };
7531
+ }
7532
+ return { mode: "docked", rect: p.rect };
7533
+ });
7534
+ }, []);
7440
7535
  const handleToggleFullscreen = (0, import_react24.useCallback)(() => {
7441
7536
  setIsFullscreen((v) => !v);
7442
7537
  }, []);
@@ -7452,13 +7547,6 @@ function WorkflowEditor({
7452
7547
  kind: "transition",
7453
7548
  transitionUuid: patch.host.transitionUuid
7454
7549
  };
7455
- pendingSelectionRestoreRef.current = restoreSelection;
7456
- window.setTimeout(() => {
7457
- if (sameSelection(pendingSelectionRestoreRef.current, restoreSelection)) {
7458
- actions.setSelection(restoreSelection);
7459
- pendingSelectionRestoreRef.current = null;
7460
- }
7461
- }, 50);
7462
7550
  actions.dispatchTransaction({
7463
7551
  summary: patch.criterion ? "Set criterion" : "Clear criterion",
7464
7552
  patches: [patch],
@@ -7871,13 +7959,13 @@ function WorkflowEditor({
7871
7959
  if (readOnly || anyModalOpen) return;
7872
7960
  openAddStateModal({ x, y });
7873
7961
  }, [anyModalOpen, openAddStateModal, readOnly]);
7874
- const graphPane = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
7962
+ const graphPane = /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
7875
7963
  "div",
7876
7964
  {
7877
7965
  "data-testid": "workflow-editor-graph-pane",
7878
7966
  style: { flex: 1, minWidth: 0, minHeight: 0, height: "100%", position: "relative" },
7879
7967
  children: [
7880
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
7968
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
7881
7969
  Canvas,
7882
7970
  {
7883
7971
  graph: derived.graph,
@@ -7922,7 +8010,7 @@ function WorkflowEditor({
7922
8010
  helpLabel: mergedMessages.toolbar.help
7923
8011
  }
7924
8012
  ),
7925
- reconnectError && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
8013
+ reconnectError && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
7926
8014
  "div",
7927
8015
  {
7928
8016
  role: "alert",
@@ -7947,7 +8035,7 @@ function WorkflowEditor({
7947
8035
  state.activeWorkflow && (() => {
7948
8036
  const comments = state.document.meta.workflowUi[state.activeWorkflow]?.comments;
7949
8037
  if (!comments) return null;
7950
- return Object.values(comments).map((c) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
8038
+ return Object.values(comments).map((c) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
7951
8039
  CommentNode,
7952
8040
  {
7953
8041
  comment: c,
@@ -7970,12 +8058,12 @@ function WorkflowEditor({
7970
8058
  ]
7971
8059
  }
7972
8060
  );
7973
- const jsonPane = enableJsonEditor ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
8061
+ const jsonPane = enableJsonEditor ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
7974
8062
  "div",
7975
8063
  {
7976
8064
  "data-testid": "workflow-editor-json-pane",
7977
8065
  style: { flex: 1, minWidth: 0, minHeight: 0, height: "100%" },
7978
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
8066
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
7979
8067
  WorkflowJsonEditor,
7980
8068
  {
7981
8069
  document: state.document,
@@ -7991,7 +8079,7 @@ function WorkflowEditor({
7991
8079
  )
7992
8080
  }
7993
8081
  ) : null;
7994
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CriterionMonacoProvider, { value: jsonEditor?.monaco ?? null, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(I18nContext.Provider, { value: mergedMessages, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(EditorConfigContext.Provider, { value: editorConfig, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
8082
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CriterionMonacoProvider, { value: jsonEditor?.monaco ?? null, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(I18nContext.Provider, { value: mergedMessages, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(EditorConfigContext.Provider, { value: editorConfig, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
7995
8083
  "div",
7996
8084
  {
7997
8085
  ref: editorContainerRef,
@@ -8012,7 +8100,7 @@ function WorkflowEditor({
8012
8100
  onKeyDown: handleKeyDown,
8013
8101
  tabIndex: -1,
8014
8102
  children: [
8015
- chrome?.tabs !== false && showTabs && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
8103
+ chrome?.tabs !== false && showTabs && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
8016
8104
  WorkflowTabs,
8017
8105
  {
8018
8106
  workflows,
@@ -8039,9 +8127,9 @@ function WorkflowEditor({
8039
8127
  onVersionChange: handleVersionChange
8040
8128
  }
8041
8129
  ),
8042
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { style: { flex: 1, display: "flex", minHeight: 0 }, children: [
8043
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { style: { flex: 1, minWidth: 0, minHeight: 0, display: "flex", flexDirection: "column" }, children: [
8044
- (enableJsonEditor && jsonEditorPlacement === "tab" || !readOnly && graphVisible) && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
8130
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { style: { flex: 1, display: "flex", minHeight: 0 }, children: [
8131
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { style: { flex: 1, minWidth: 0, minHeight: 0, display: "flex", flexDirection: "column" }, children: [
8132
+ (enableJsonEditor && jsonEditorPlacement === "tab" || !readOnly && graphVisible) && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
8045
8133
  "div",
8046
8134
  {
8047
8135
  style: {
@@ -8055,8 +8143,8 @@ function WorkflowEditor({
8055
8143
  },
8056
8144
  "data-testid": "workflow-editor-surface-tabs",
8057
8145
  children: [
8058
- enableJsonEditor && jsonEditorPlacement === "tab" && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
8059
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
8146
+ enableJsonEditor && jsonEditorPlacement === "tab" && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
8147
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
8060
8148
  SurfaceTab,
8061
8149
  {
8062
8150
  active: activeSurface === "graph",
@@ -8064,7 +8152,7 @@ function WorkflowEditor({
8064
8152
  children: mergedMessages.editorView.graph
8065
8153
  }
8066
8154
  ),
8067
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
8155
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
8068
8156
  SurfaceTab,
8069
8157
  {
8070
8158
  active: activeSurface === "json",
@@ -8073,8 +8161,8 @@ function WorkflowEditor({
8073
8161
  }
8074
8162
  )
8075
8163
  ] }),
8076
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { style: { flex: 1 } }),
8077
- !readOnly && activeSurface === "graph" && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
8164
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { style: { flex: 1 } }),
8165
+ !readOnly && activeSurface === "graph" && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
8078
8166
  "button",
8079
8167
  {
8080
8168
  type: "button",
@@ -8095,7 +8183,7 @@ function WorkflowEditor({
8095
8183
  cursor: "pointer"
8096
8184
  },
8097
8185
  children: [
8098
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("path", { d: "M12 5v14M5 12h14" }) }),
8186
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("path", { d: "M12 5v14M5 12h14" }) }),
8099
8187
  mergedMessages.toolbar.addStateButton
8100
8188
  ]
8101
8189
  }
@@ -8103,7 +8191,7 @@ function WorkflowEditor({
8103
8191
  ]
8104
8192
  }
8105
8193
  ),
8106
- enableJsonEditor && jsonEditorPlacement === "split" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
8194
+ enableJsonEditor && jsonEditorPlacement === "split" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
8107
8195
  "div",
8108
8196
  {
8109
8197
  style: {
@@ -8116,10 +8204,10 @@ function WorkflowEditor({
8116
8204
  "data-testid": "workflow-editor-split-view",
8117
8205
  children: [
8118
8206
  graphPane,
8119
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { style: { borderLeft: "1px solid #E2E8F0", minWidth: 0 }, children: jsonPane })
8207
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { style: { borderLeft: "1px solid #E2E8F0", minWidth: 0 }, children: jsonPane })
8120
8208
  ]
8121
8209
  }
8122
- ) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
8210
+ ) : /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
8123
8211
  "div",
8124
8212
  {
8125
8213
  style: {
@@ -8131,8 +8219,8 @@ function WorkflowEditor({
8131
8219
  flexDirection: "column"
8132
8220
  },
8133
8221
  children: [
8134
- graphVisible ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { style: { flex: 1, minHeight: 0, minWidth: 0 }, children: graphPane }) : null,
8135
- enableJsonEditor ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
8222
+ graphVisible ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { style: { flex: 1, minHeight: 0, minWidth: 0 }, children: graphPane }) : null,
8223
+ enableJsonEditor ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
8136
8224
  "div",
8137
8225
  {
8138
8226
  style: {
@@ -8149,41 +8237,36 @@ function WorkflowEditor({
8149
8237
  }
8150
8238
  )
8151
8239
  ] }),
8152
- inspectorVisible && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
8153
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
8154
- "div",
8155
- {
8156
- onMouseDown: handleInspectorResizeStart,
8157
- style: {
8158
- width: 3,
8159
- flexShrink: 0,
8160
- cursor: "col-resize",
8161
- background: "transparent",
8162
- borderLeft: "1px solid #E2E8F0",
8163
- transition: "background 0.15s",
8164
- zIndex: 10
8165
- },
8166
- onMouseEnter: (e) => e.currentTarget.style.background = "#CBD5E1",
8167
- onMouseLeave: (e) => e.currentTarget.style.background = "transparent"
8168
- }
8169
- ),
8170
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
8171
- Inspector,
8172
- {
8173
- document: state.document,
8174
- selection: state.selection,
8175
- issues: derived.issues,
8176
- readOnly,
8177
- onDispatch: dispatch,
8178
- onSelectionChange: handleSelectionChange,
8179
- onClose: () => handleSelectionChange(null),
8180
- onRequestDeleteState: requestDeleteState,
8181
- width: inspectorWidth
8182
- }
8183
- )
8184
- ] })
8240
+ inspectorVisible && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
8241
+ InspectorFrame,
8242
+ {
8243
+ mode: placement.mode,
8244
+ rect: placement.rect,
8245
+ dockedWidth: inspectorWidth,
8246
+ onRectChange: (rect) => setPlacement((p) => ({ ...p, rect })),
8247
+ onDockedWidthChange: setInspectorWidth,
8248
+ onRestore: restoreInspector,
8249
+ onClose: () => handleSelectionChange(null),
8250
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
8251
+ Inspector,
8252
+ {
8253
+ document: state.document,
8254
+ selection: state.selection,
8255
+ issues: derived.issues,
8256
+ readOnly,
8257
+ onDispatch: dispatch,
8258
+ onSelectionChange: handleSelectionChange,
8259
+ onClose: () => handleSelectionChange(null),
8260
+ onRequestDeleteState: requestDeleteState,
8261
+ docked: placement.mode === "docked",
8262
+ onToggleDock: toggleDock,
8263
+ onMinimize: minimizeInspector
8264
+ }
8265
+ )
8266
+ }
8267
+ )
8185
8268
  ] }),
8186
- pendingAddState !== null && state.activeWorkflow && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
8269
+ pendingAddState !== null && state.activeWorkflow && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
8187
8270
  AddStateModal,
8188
8271
  {
8189
8272
  existingNames: Object.keys(
@@ -8195,7 +8278,7 @@ function WorkflowEditor({
8195
8278
  onCancel: () => setPendingAddState(null)
8196
8279
  }
8197
8280
  ),
8198
- pendingDelete && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
8281
+ pendingDelete && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
8199
8282
  DeleteStateModal,
8200
8283
  {
8201
8284
  document: state.document,
@@ -8205,7 +8288,7 @@ function WorkflowEditor({
8205
8288
  onCancel: () => setPendingDelete(null)
8206
8289
  }
8207
8290
  ),
8208
- pendingConnect && pendingConnectState && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
8291
+ pendingConnect && pendingConnectState && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
8209
8292
  DragConnectModal,
8210
8293
  {
8211
8294
  source: pendingConnectState,
@@ -8215,8 +8298,8 @@ function WorkflowEditor({
8215
8298
  onCancel: () => setPendingConnect(null)
8216
8299
  }
8217
8300
  ),
8218
- helpOpen && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(HelpModal, { onCancel: () => setHelpOpen(false) }),
8219
- pendingVersionSwitch && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
8301
+ helpOpen && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(HelpModal, { onCancel: () => setHelpOpen(false) }),
8302
+ pendingVersionSwitch && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
8220
8303
  VersionSwitchModal,
8221
8304
  {
8222
8305
  fromVersion: `v${state.document.meta.cyodaVersion ?? import_workflow_core11.LATEST_CYODA_VERSION}`,
@@ -8229,8 +8312,8 @@ function WorkflowEditor({
8229
8312
  onCancel: () => setPendingVersionSwitch(null)
8230
8313
  }
8231
8314
  ),
8232
- chrome?.toolbar !== false && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { style: { position: "relative" }, children: [
8233
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
8315
+ chrome?.toolbar !== false && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { style: { position: "relative" }, children: [
8316
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
8234
8317
  Toolbar,
8235
8318
  {
8236
8319
  derived,
@@ -8245,7 +8328,7 @@ function WorkflowEditor({
8245
8328
  toolbarEnd
8246
8329
  }
8247
8330
  ),
8248
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
8331
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
8249
8332
  IssuesDrawer,
8250
8333
  {
8251
8334
  open: openIssueSeverity !== null,
@@ -8403,22 +8486,6 @@ function normalizeAnchorPair(anchors) {
8403
8486
  function sameAnchors(a, b) {
8404
8487
  return a?.source === b?.source && a?.target === b?.target;
8405
8488
  }
8406
- function sameSelection(a, b) {
8407
- if (a === b) return true;
8408
- if (!a || !b || a.kind !== b.kind) return false;
8409
- switch (a.kind) {
8410
- case "workflow":
8411
- return b.kind === "workflow" && a.workflow === b.workflow;
8412
- case "state":
8413
- return b.kind === "state" && a.workflow === b.workflow && a.stateCode === b.stateCode && a.nodeId === b.nodeId;
8414
- case "transition":
8415
- return b.kind === "transition" && a.transitionUuid === b.transitionUuid;
8416
- case "processor":
8417
- return b.kind === "processor" && a.processorUuid === b.processorUuid;
8418
- case "criterion":
8419
- return b.kind === "criterion" && a.hostKind === b.hostKind && a.hostId === b.hostId && a.path.length === b.path.length && a.path.every((part, index) => part === b.path[index]);
8420
- }
8421
- }
8422
8489
  function workflowForSelection(doc, selection) {
8423
8490
  if (!selection) return null;
8424
8491
  if (selection.kind === "workflow" || selection.kind === "state") return selection.workflow;
@@ -8441,7 +8508,7 @@ function SurfaceTab({
8441
8508
  onClick,
8442
8509
  children
8443
8510
  }) {
8444
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
8511
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
8445
8512
  "button",
8446
8513
  {
8447
8514
  type: "button",
@@ -8572,7 +8639,7 @@ function useSaveFlow(args) {
8572
8639
 
8573
8640
  // src/save/SaveConfirmModal.tsx
8574
8641
  var import_react26 = require("react");
8575
- var import_jsx_runtime27 = require("react/jsx-runtime");
8642
+ var import_jsx_runtime29 = require("react/jsx-runtime");
8576
8643
  function SaveConfirmModal({
8577
8644
  mode,
8578
8645
  requiresExplicitConfirm,
@@ -8585,14 +8652,14 @@ function SaveConfirmModal({
8585
8652
  const [ackMode, setAckMode] = (0, import_react26.useState)(!requiresExplicitConfirm);
8586
8653
  const [ackWarnings, setAckWarnings] = (0, import_react26.useState)(warningCount === 0);
8587
8654
  const blocked = !ackMode || !ackWarnings;
8588
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(ModalFrame, { onCancel, children: [
8589
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h2", { style: { margin: 0, fontSize: 16 }, children: messages.saveConfirm.title }),
8590
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("p", { style: { margin: "12px 0", fontSize: 13, color: colors.textSecondary }, children: [
8655
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(ModalFrame, { onCancel, children: [
8656
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("h2", { style: { margin: 0, fontSize: 16 }, children: messages.saveConfirm.title }),
8657
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("p", { style: { margin: "12px 0", fontSize: 13, color: colors.textSecondary }, children: [
8591
8658
  messages.saveConfirm.modeLabel,
8592
8659
  ": ",
8593
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("strong", { children: mode })
8660
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("strong", { children: mode })
8594
8661
  ] }),
8595
- diffSummary2 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
8662
+ diffSummary2 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
8596
8663
  "pre",
8597
8664
  {
8598
8665
  style: {
@@ -8611,8 +8678,8 @@ function SaveConfirmModal({
8611
8678
  children: diffSummary2
8612
8679
  }
8613
8680
  ),
8614
- requiresExplicitConfirm && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { style: checkRow, "data-testid": "save-ack-mode", children: [
8615
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
8681
+ requiresExplicitConfirm && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("label", { style: checkRow, "data-testid": "save-ack-mode", children: [
8682
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
8616
8683
  "input",
8617
8684
  {
8618
8685
  type: "checkbox",
@@ -8620,10 +8687,10 @@ function SaveConfirmModal({
8620
8687
  onChange: (e) => setAckMode(e.target.checked)
8621
8688
  }
8622
8689
  ),
8623
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: mode === "REPLACE" ? messages.saveConfirm.ackReplace : messages.saveConfirm.ackActivate })
8690
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: mode === "REPLACE" ? messages.saveConfirm.ackReplace : messages.saveConfirm.ackActivate })
8624
8691
  ] }),
8625
- warningCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { style: checkRow, "data-testid": "save-ack-warnings", children: [
8626
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
8692
+ warningCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("label", { style: checkRow, "data-testid": "save-ack-warnings", children: [
8693
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
8627
8694
  "input",
8628
8695
  {
8629
8696
  type: "checkbox",
@@ -8631,17 +8698,17 @@ function SaveConfirmModal({
8631
8698
  onChange: (e) => setAckWarnings(e.target.checked)
8632
8699
  }
8633
8700
  ),
8634
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: messages.saveConfirm.ackWarnings.replace("{count}", String(warningCount)) })
8701
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: messages.saveConfirm.ackWarnings.replace("{count}", String(warningCount)) })
8635
8702
  ] }),
8636
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, marginTop: 16 }, children: [
8637
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("button", { type: "button", onClick: onCancel, style: ghostBtn9, "data-testid": "save-cancel", children: messages.saveConfirm.cancel }),
8638
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
8703
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, marginTop: 16 }, children: [
8704
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", onClick: onCancel, style: ghostBtn8, "data-testid": "save-cancel", children: messages.saveConfirm.cancel }),
8705
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
8639
8706
  "button",
8640
8707
  {
8641
8708
  type: "button",
8642
8709
  disabled: blocked,
8643
8710
  onClick: onConfirm,
8644
- style: primaryBtn6,
8711
+ style: primaryBtn5,
8645
8712
  "data-testid": "save-confirm",
8646
8713
  children: messages.saveConfirm.confirm
8647
8714
  }
@@ -8657,7 +8724,7 @@ var checkRow = {
8657
8724
  color: colors.textPrimary,
8658
8725
  margin: "8px 0"
8659
8726
  };
8660
- var ghostBtn9 = {
8727
+ var ghostBtn8 = {
8661
8728
  padding: "6px 12px",
8662
8729
  background: "white",
8663
8730
  border: `1px solid ${colors.border}`,
@@ -8665,18 +8732,18 @@ var ghostBtn9 = {
8665
8732
  fontSize: 13,
8666
8733
  cursor: "pointer"
8667
8734
  };
8668
- var primaryBtn6 = {
8669
- ...ghostBtn9,
8735
+ var primaryBtn5 = {
8736
+ ...ghostBtn8,
8670
8737
  background: colors.primary,
8671
8738
  color: "white",
8672
8739
  borderColor: colors.primary
8673
8740
  };
8674
8741
 
8675
8742
  // src/save/ConflictBanner.tsx
8676
- var import_jsx_runtime28 = require("react/jsx-runtime");
8743
+ var import_jsx_runtime30 = require("react/jsx-runtime");
8677
8744
  function ConflictBanner({ onReload, onForceOverwrite }) {
8678
8745
  const messages = useMessages();
8679
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
8746
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
8680
8747
  "div",
8681
8748
  {
8682
8749
  style: {
@@ -8692,8 +8759,8 @@ function ConflictBanner({ onReload, onForceOverwrite }) {
8692
8759
  role: "alert",
8693
8760
  "data-testid": "conflict-banner",
8694
8761
  children: [
8695
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { style: { flex: 1 }, children: messages.conflict.message }),
8696
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
8762
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { style: { flex: 1 }, children: messages.conflict.message }),
8763
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
8697
8764
  "button",
8698
8765
  {
8699
8766
  type: "button",
@@ -8703,7 +8770,7 @@ function ConflictBanner({ onReload, onForceOverwrite }) {
8703
8770
  children: messages.conflict.reload
8704
8771
  }
8705
8772
  ),
8706
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
8773
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
8707
8774
  "button",
8708
8775
  {
8709
8776
  type: "button",