@cyoda/workflow-react 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +907 -640
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +836 -569
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -33,8 +33,8 @@ __export(index_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(index_exports);
|
|
34
34
|
|
|
35
35
|
// src/components/WorkflowEditor.tsx
|
|
36
|
-
var
|
|
37
|
-
var
|
|
36
|
+
var import_react24 = require("react");
|
|
37
|
+
var import_workflow_core11 = require("@cyoda/workflow-core");
|
|
38
38
|
var import_workflow_layout2 = require("@cyoda/workflow-layout");
|
|
39
39
|
|
|
40
40
|
// src/i18n/context.ts
|
|
@@ -122,6 +122,12 @@ var defaultMessages = {
|
|
|
122
122
|
processes: "Processes",
|
|
123
123
|
criterion: "Criterion",
|
|
124
124
|
criteria: "Criteria",
|
|
125
|
+
annotations: "Annotations",
|
|
126
|
+
annotationsAdd: "Add annotations",
|
|
127
|
+
annotationsApply: "Apply",
|
|
128
|
+
annotationsRevert: "Revert",
|
|
129
|
+
annotationsRemove: "Remove",
|
|
130
|
+
annotationsDocChanged: "Document changed underneath \u2014 Revert to reload.",
|
|
125
131
|
executionMode: "Execution mode",
|
|
126
132
|
addProcessor: "Add processor",
|
|
127
133
|
removeProcessor: "Remove",
|
|
@@ -265,6 +271,8 @@ function summarize(patch) {
|
|
|
265
271
|
return `Reorder processor`;
|
|
266
272
|
case "setCriterion":
|
|
267
273
|
return patch.criterion ? `Set criterion` : `Clear criterion`;
|
|
274
|
+
case "setAnnotations":
|
|
275
|
+
return patch.annotations ? `Set annotations` : `Clear annotations`;
|
|
268
276
|
case "setImportMode":
|
|
269
277
|
return `Set import mode to "${patch.mode}"`;
|
|
270
278
|
case "setEntity":
|
|
@@ -2718,7 +2726,17 @@ function CanvasInner({
|
|
|
2718
2726
|
onHelp && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
2719
2727
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { height: 1, background: "#E2E8F0" } }),
|
|
2720
2728
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CtrlBtn, { onClick: onHelp, title: helpLabel ?? "Help", testId: "canvas-help", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(HelpIcon, {}) })
|
|
2721
|
-
] })
|
|
2729
|
+
] }),
|
|
2730
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { height: 1, background: "#E2E8F0" } }),
|
|
2731
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
2732
|
+
CtrlBtn,
|
|
2733
|
+
{
|
|
2734
|
+
onClick: () => onSelectionChange(activeWorkflow ? { kind: "workflow", workflow: activeWorkflow } : null),
|
|
2735
|
+
title: "Workflow settings",
|
|
2736
|
+
testId: "canvas-workflow-settings",
|
|
2737
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WorkflowSettingsIcon, {})
|
|
2738
|
+
}
|
|
2739
|
+
)
|
|
2722
2740
|
]
|
|
2723
2741
|
}
|
|
2724
2742
|
),
|
|
@@ -2838,6 +2856,16 @@ function HelpIcon() {
|
|
|
2838
2856
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
2839
2857
|
] });
|
|
2840
2858
|
}
|
|
2859
|
+
function WorkflowSettingsIcon() {
|
|
2860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2861
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("line", { x1: "4", y1: "6", x2: "20", y2: "6" }),
|
|
2862
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("line", { x1: "4", y1: "12", x2: "20", y2: "12" }),
|
|
2863
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("line", { x1: "4", y1: "18", x2: "20", y2: "18" }),
|
|
2864
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "9", cy: "6", r: "2", fill: "white" }),
|
|
2865
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "15", cy: "12", r: "2", fill: "white" }),
|
|
2866
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "8", cy: "18", r: "2", fill: "white" })
|
|
2867
|
+
] });
|
|
2868
|
+
}
|
|
2841
2869
|
function Canvas(props) {
|
|
2842
2870
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_reactflow4.ReactFlowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CanvasInner, { ...props }) });
|
|
2843
2871
|
}
|
|
@@ -2858,8 +2886,8 @@ function resolveConnection(doc, connection) {
|
|
|
2858
2886
|
}
|
|
2859
2887
|
|
|
2860
2888
|
// src/inspector/Inspector.tsx
|
|
2861
|
-
var
|
|
2862
|
-
var
|
|
2889
|
+
var import_react16 = require("react");
|
|
2890
|
+
var import_workflow_core8 = require("@cyoda/workflow-core");
|
|
2863
2891
|
|
|
2864
2892
|
// src/style/tokens.ts
|
|
2865
2893
|
var colors = {
|
|
@@ -3323,16 +3351,247 @@ var smallSelectStyle = {
|
|
|
3323
3351
|
userSelect: "none"
|
|
3324
3352
|
};
|
|
3325
3353
|
|
|
3326
|
-
// src/inspector/
|
|
3354
|
+
// src/inspector/AnnotationsField.tsx
|
|
3355
|
+
var import_react9 = require("react");
|
|
3356
|
+
|
|
3357
|
+
// src/inspector/CriterionMonacoContext.tsx
|
|
3358
|
+
var import_react8 = require("react");
|
|
3359
|
+
var CriterionMonacoContext = (0, import_react8.createContext)(null);
|
|
3360
|
+
var CriterionMonacoProvider = CriterionMonacoContext.Provider;
|
|
3361
|
+
function useCriterionMonaco() {
|
|
3362
|
+
return (0, import_react8.useContext)(CriterionMonacoContext);
|
|
3363
|
+
}
|
|
3364
|
+
|
|
3365
|
+
// src/components/monacoDisposal.ts
|
|
3366
|
+
var installed = false;
|
|
3367
|
+
function isMonacoCanceled(reason) {
|
|
3368
|
+
if (reason == null || typeof reason !== "object") return false;
|
|
3369
|
+
return reason.name === "Canceled";
|
|
3370
|
+
}
|
|
3371
|
+
function installMonacoCancellationFilter() {
|
|
3372
|
+
if (installed || typeof window === "undefined") return;
|
|
3373
|
+
installed = true;
|
|
3374
|
+
window.addEventListener("unhandledrejection", (e) => {
|
|
3375
|
+
if (isMonacoCanceled(e.reason)) e.preventDefault();
|
|
3376
|
+
});
|
|
3377
|
+
}
|
|
3378
|
+
installMonacoCancellationFilter();
|
|
3379
|
+
|
|
3380
|
+
// src/inspector/annotationsJson.ts
|
|
3381
|
+
var import_workflow_core3 = require("@cyoda/workflow-core");
|
|
3382
|
+
function annotationsModelUri(key) {
|
|
3383
|
+
return `cyoda://annotations/${key}.json`;
|
|
3384
|
+
}
|
|
3385
|
+
function annotationBytes(value) {
|
|
3386
|
+
return new TextEncoder().encode(JSON.stringify(value)).length;
|
|
3387
|
+
}
|
|
3388
|
+
function sameJson(a, b) {
|
|
3389
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
3390
|
+
}
|
|
3391
|
+
function parseAnnotationsJson(text) {
|
|
3392
|
+
let raw;
|
|
3393
|
+
try {
|
|
3394
|
+
raw = JSON.parse(text);
|
|
3395
|
+
} catch {
|
|
3396
|
+
return { annotations: null, error: "Invalid JSON." };
|
|
3397
|
+
}
|
|
3398
|
+
if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
|
|
3399
|
+
return { annotations: null, error: "Annotations must be a JSON object." };
|
|
3400
|
+
}
|
|
3401
|
+
const bytes = annotationBytes(raw);
|
|
3402
|
+
if (bytes > import_workflow_core3.ANNOTATIONS_MAX_BYTES) {
|
|
3403
|
+
return {
|
|
3404
|
+
annotations: null,
|
|
3405
|
+
error: `Annotations are ${bytes} bytes, over the ${import_workflow_core3.ANNOTATIONS_MAX_BYTES}-byte limit.`
|
|
3406
|
+
};
|
|
3407
|
+
}
|
|
3408
|
+
return { annotations: raw, error: null };
|
|
3409
|
+
}
|
|
3410
|
+
|
|
3411
|
+
// src/inspector/AnnotationsField.tsx
|
|
3327
3412
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
3413
|
+
var pretty = (v) => JSON.stringify(v, null, 2);
|
|
3414
|
+
function AnnotationsField(props) {
|
|
3415
|
+
const messages = useMessages();
|
|
3416
|
+
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)(
|
|
3420
|
+
"button",
|
|
3421
|
+
{
|
|
3422
|
+
type: "button",
|
|
3423
|
+
style: primaryBtn,
|
|
3424
|
+
"data-testid": "inspector-annotations-add",
|
|
3425
|
+
onClick: () => props.onCommit({}),
|
|
3426
|
+
children: messages.inspector.annotationsAdd
|
|
3427
|
+
}
|
|
3428
|
+
)
|
|
3429
|
+
] });
|
|
3430
|
+
}
|
|
3431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AnnotationsEditor, { ...props, value: props.value }, props.modelKey);
|
|
3432
|
+
}
|
|
3433
|
+
function AnnotationsEditor({
|
|
3434
|
+
value,
|
|
3435
|
+
disabled,
|
|
3436
|
+
modelKey,
|
|
3437
|
+
onCommit,
|
|
3438
|
+
onRemove,
|
|
3439
|
+
showLabel
|
|
3440
|
+
}) {
|
|
3441
|
+
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)(() => {
|
|
3447
|
+
if (sameJson(prevValueRef.current, value)) return;
|
|
3448
|
+
const parsed = parseAnnotationsJson(buffer).annotations;
|
|
3449
|
+
if (parsed !== null && sameJson(parsed, value)) {
|
|
3450
|
+
setDocChanged(false);
|
|
3451
|
+
} else if (parsed !== null && sameJson(parsed, prevValueRef.current)) {
|
|
3452
|
+
setBuffer(pretty(value));
|
|
3453
|
+
setDocChanged(false);
|
|
3454
|
+
} else {
|
|
3455
|
+
setDocChanged(true);
|
|
3456
|
+
}
|
|
3457
|
+
prevValueRef.current = value;
|
|
3458
|
+
}, [value, buffer]);
|
|
3459
|
+
const result = parseAnnotationsJson(buffer);
|
|
3460
|
+
const dirty = result.annotations !== null && !sameJson(result.annotations, value);
|
|
3461
|
+
const applyEnabled = !disabled && result.annotations !== null && dirty;
|
|
3462
|
+
const apply = () => {
|
|
3463
|
+
if (!applyEnabled || result.annotations === null) return;
|
|
3464
|
+
onCommit(result.annotations);
|
|
3465
|
+
setDocChanged(false);
|
|
3466
|
+
};
|
|
3467
|
+
const revert = () => {
|
|
3468
|
+
setBuffer(pretty(value));
|
|
3469
|
+
setDocChanged(false);
|
|
3470
|
+
};
|
|
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,
|
|
3475
|
+
{
|
|
3476
|
+
monaco,
|
|
3477
|
+
buffer,
|
|
3478
|
+
disabled,
|
|
3479
|
+
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)
|
|
3491
|
+
}
|
|
3492
|
+
),
|
|
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)(
|
|
3497
|
+
"button",
|
|
3498
|
+
{
|
|
3499
|
+
type: "button",
|
|
3500
|
+
onClick: apply,
|
|
3501
|
+
disabled: !applyEnabled,
|
|
3502
|
+
style: applyEnabled ? primaryBtn : disabledBtn,
|
|
3503
|
+
"data-testid": "inspector-annotations-apply",
|
|
3504
|
+
children: messages.inspector.annotationsApply
|
|
3505
|
+
}
|
|
3506
|
+
),
|
|
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 })
|
|
3509
|
+
] })
|
|
3510
|
+
] });
|
|
3511
|
+
}
|
|
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
|
+
function SectionLabel() {
|
|
3564
|
+
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 });
|
|
3566
|
+
}
|
|
3567
|
+
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
|
+
var ghostBtn = { padding: "6px 10px", background: "white", border: `1px solid ${colors.border}`, borderRadius: radii.sm, fontSize: 12, cursor: "pointer" };
|
|
3579
|
+
var primaryBtn = { ...ghostBtn, background: colors.primary, color: "white", borderColor: colors.primary };
|
|
3580
|
+
var disabledBtn = { ...primaryBtn, opacity: 0.5, cursor: "not-allowed" };
|
|
3581
|
+
var dangerBtn = { ...ghostBtn, background: colors.dangerBg, borderColor: colors.dangerBorder, color: colors.danger };
|
|
3582
|
+
var errorStyle = { color: colors.danger, fontSize: 11 };
|
|
3583
|
+
var warnStyle = { color: colors.warning, fontSize: 11 };
|
|
3584
|
+
|
|
3585
|
+
// src/inspector/WorkflowForm.tsx
|
|
3586
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
3328
3587
|
function WorkflowForm({
|
|
3329
3588
|
workflow,
|
|
3330
3589
|
disabled,
|
|
3331
3590
|
onDispatch
|
|
3332
3591
|
}) {
|
|
3333
3592
|
const messages = useMessages();
|
|
3334
|
-
return /* @__PURE__ */ (0,
|
|
3335
|
-
/* @__PURE__ */ (0,
|
|
3593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(FieldGroup, { title: messages.inspector.properties, children: [
|
|
3594
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3336
3595
|
TextField,
|
|
3337
3596
|
{
|
|
3338
3597
|
label: messages.inspector.name,
|
|
@@ -3342,7 +3601,7 @@ function WorkflowForm({
|
|
|
3342
3601
|
testId: "inspector-workflow-name"
|
|
3343
3602
|
}
|
|
3344
3603
|
),
|
|
3345
|
-
/* @__PURE__ */ (0,
|
|
3604
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3346
3605
|
TextField,
|
|
3347
3606
|
{
|
|
3348
3607
|
label: messages.inspector.version,
|
|
@@ -3357,7 +3616,7 @@ function WorkflowForm({
|
|
|
3357
3616
|
testId: "inspector-workflow-version"
|
|
3358
3617
|
}
|
|
3359
3618
|
),
|
|
3360
|
-
/* @__PURE__ */ (0,
|
|
3619
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3361
3620
|
TextField,
|
|
3362
3621
|
{
|
|
3363
3622
|
label: messages.inspector.description,
|
|
@@ -3373,7 +3632,7 @@ function WorkflowForm({
|
|
|
3373
3632
|
testId: "inspector-workflow-desc"
|
|
3374
3633
|
}
|
|
3375
3634
|
),
|
|
3376
|
-
/* @__PURE__ */ (0,
|
|
3635
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3377
3636
|
CheckboxField,
|
|
3378
3637
|
{
|
|
3379
3638
|
label: messages.inspector.active,
|
|
@@ -3387,7 +3646,7 @@ function WorkflowForm({
|
|
|
3387
3646
|
testId: "inspector-workflow-active"
|
|
3388
3647
|
}
|
|
3389
3648
|
),
|
|
3390
|
-
/* @__PURE__ */ (0,
|
|
3649
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3391
3650
|
TextField,
|
|
3392
3651
|
{
|
|
3393
3652
|
label: messages.inspector.initialState,
|
|
@@ -3401,14 +3660,24 @@ function WorkflowForm({
|
|
|
3401
3660
|
}),
|
|
3402
3661
|
testId: "inspector-workflow-initial"
|
|
3403
3662
|
}
|
|
3663
|
+
),
|
|
3664
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3665
|
+
AnnotationsField,
|
|
3666
|
+
{
|
|
3667
|
+
value: workflow.annotations,
|
|
3668
|
+
disabled,
|
|
3669
|
+
modelKey: `workflow-${workflow.name}`,
|
|
3670
|
+
onCommit: (annotations) => onDispatch({ op: "setAnnotations", target: { kind: "workflow", workflow: workflow.name }, annotations }),
|
|
3671
|
+
onRemove: () => onDispatch({ op: "setAnnotations", target: { kind: "workflow", workflow: workflow.name } })
|
|
3672
|
+
}
|
|
3404
3673
|
)
|
|
3405
3674
|
] });
|
|
3406
3675
|
}
|
|
3407
3676
|
|
|
3408
3677
|
// src/inspector/StateForm.tsx
|
|
3409
|
-
var
|
|
3410
|
-
var
|
|
3411
|
-
var
|
|
3678
|
+
var import_react10 = require("react");
|
|
3679
|
+
var import_workflow_core4 = require("@cyoda/workflow-core");
|
|
3680
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
3412
3681
|
function StateForm({
|
|
3413
3682
|
workflow,
|
|
3414
3683
|
stateCode,
|
|
@@ -3419,7 +3688,7 @@ function StateForm({
|
|
|
3419
3688
|
onRequestDelete
|
|
3420
3689
|
}) {
|
|
3421
3690
|
const messages = useMessages();
|
|
3422
|
-
const [renameError, setRenameError] = (0,
|
|
3691
|
+
const [renameError, setRenameError] = (0, import_react10.useState)(null);
|
|
3423
3692
|
const outgoing = state.transitions.length;
|
|
3424
3693
|
const incoming = Object.values(workflow.states).reduce(
|
|
3425
3694
|
(n, s) => n + s.transitions.filter((t) => t.next === stateCode).length,
|
|
@@ -3432,7 +3701,7 @@ function StateForm({
|
|
|
3432
3701
|
const handleRename = (next) => {
|
|
3433
3702
|
if (next === stateCode) return;
|
|
3434
3703
|
setRenameError(null);
|
|
3435
|
-
if (!
|
|
3704
|
+
if (!import_workflow_core4.NAME_REGEX.test(next)) {
|
|
3436
3705
|
setRenameError(`"${next}" is not a valid state name`);
|
|
3437
3706
|
return;
|
|
3438
3707
|
}
|
|
@@ -3442,8 +3711,8 @@ function StateForm({
|
|
|
3442
3711
|
}
|
|
3443
3712
|
onDispatch({ op: "renameState", workflow: workflow.name, from: stateCode, to: next });
|
|
3444
3713
|
};
|
|
3445
|
-
return /* @__PURE__ */ (0,
|
|
3446
|
-
/* @__PURE__ */ (0,
|
|
3714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FieldGroup, { title: messages.inspector.properties, children: [
|
|
3715
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3447
3716
|
TextField,
|
|
3448
3717
|
{
|
|
3449
3718
|
label: messages.inspector.name,
|
|
@@ -3454,29 +3723,29 @@ function StateForm({
|
|
|
3454
3723
|
testId: "inspector-state-name"
|
|
3455
3724
|
}
|
|
3456
3725
|
),
|
|
3457
|
-
renameError && /* @__PURE__ */ (0,
|
|
3458
|
-
(isInitial || isTerminal || isUnreachable) && /* @__PURE__ */ (0,
|
|
3459
|
-
isInitial && /* @__PURE__ */ (0,
|
|
3460
|
-
isTerminal && /* @__PURE__ */ (0,
|
|
3461
|
-
isUnreachable && /* @__PURE__ */ (0,
|
|
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" })
|
|
3462
3731
|
] }),
|
|
3463
|
-
/* @__PURE__ */ (0,
|
|
3732
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { fontSize: 12, color: colors.textSecondary }, children: [
|
|
3464
3733
|
outgoing,
|
|
3465
3734
|
" outgoing \xB7 ",
|
|
3466
3735
|
incoming,
|
|
3467
3736
|
" incoming"
|
|
3468
3737
|
] }),
|
|
3469
|
-
!isInitial && !disabled && /* @__PURE__ */ (0,
|
|
3738
|
+
!isInitial && !disabled && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3470
3739
|
"button",
|
|
3471
3740
|
{
|
|
3472
3741
|
type: "button",
|
|
3473
3742
|
onClick: () => onDispatch({ op: "setInitialState", workflow: workflow.name, stateCode }),
|
|
3474
|
-
style:
|
|
3743
|
+
style: ghostBtn2,
|
|
3475
3744
|
"data-testid": "inspector-state-set-initial",
|
|
3476
3745
|
children: "Set as Initial State"
|
|
3477
3746
|
}
|
|
3478
3747
|
),
|
|
3479
|
-
issues && issues.length > 0 && /* @__PURE__ */ (0,
|
|
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)(
|
|
3480
3749
|
"div",
|
|
3481
3750
|
{
|
|
3482
3751
|
role: "alert",
|
|
@@ -3492,21 +3761,31 @@ function StateForm({
|
|
|
3492
3761
|
},
|
|
3493
3762
|
`${issue.code}-${i}`
|
|
3494
3763
|
)) }),
|
|
3495
|
-
/* @__PURE__ */ (0,
|
|
3764
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3765
|
+
AnnotationsField,
|
|
3766
|
+
{
|
|
3767
|
+
value: state.annotations,
|
|
3768
|
+
disabled,
|
|
3769
|
+
modelKey: `state-${workflow.name}-${stateCode}`,
|
|
3770
|
+
onCommit: (annotations) => onDispatch({ op: "setAnnotations", target: { kind: "state", workflow: workflow.name, stateCode }, annotations }),
|
|
3771
|
+
onRemove: () => onDispatch({ op: "setAnnotations", target: { kind: "state", workflow: workflow.name, stateCode } })
|
|
3772
|
+
}
|
|
3773
|
+
),
|
|
3774
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3496
3775
|
"button",
|
|
3497
3776
|
{
|
|
3498
3777
|
type: "button",
|
|
3499
3778
|
onClick: onRequestDelete,
|
|
3500
3779
|
disabled,
|
|
3501
3780
|
"data-testid": "inspector-state-delete",
|
|
3502
|
-
style:
|
|
3781
|
+
style: dangerBtn2,
|
|
3503
3782
|
children: "Delete state\u2026"
|
|
3504
3783
|
}
|
|
3505
3784
|
)
|
|
3506
3785
|
] });
|
|
3507
3786
|
}
|
|
3508
3787
|
function StateBadge({ color, bg, label }) {
|
|
3509
|
-
return /* @__PURE__ */ (0,
|
|
3788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3510
3789
|
"span",
|
|
3511
3790
|
{
|
|
3512
3791
|
style: {
|
|
@@ -3538,7 +3817,7 @@ function reachableStates(wf) {
|
|
|
3538
3817
|
}
|
|
3539
3818
|
return visited;
|
|
3540
3819
|
}
|
|
3541
|
-
var
|
|
3820
|
+
var ghostBtn2 = {
|
|
3542
3821
|
alignSelf: "flex-start",
|
|
3543
3822
|
padding: "5px 10px",
|
|
3544
3823
|
background: "white",
|
|
@@ -3547,7 +3826,7 @@ var ghostBtn = {
|
|
|
3547
3826
|
fontSize: 13,
|
|
3548
3827
|
cursor: "pointer"
|
|
3549
3828
|
};
|
|
3550
|
-
var
|
|
3829
|
+
var dangerBtn2 = {
|
|
3551
3830
|
alignSelf: "flex-start",
|
|
3552
3831
|
padding: "6px 10px",
|
|
3553
3832
|
background: colors.dangerBg,
|
|
@@ -3559,15 +3838,15 @@ var dangerBtn = {
|
|
|
3559
3838
|
};
|
|
3560
3839
|
|
|
3561
3840
|
// src/inspector/TransitionForm.tsx
|
|
3562
|
-
var
|
|
3563
|
-
var
|
|
3841
|
+
var import_react15 = require("react");
|
|
3842
|
+
var import_workflow_core7 = require("@cyoda/workflow-core");
|
|
3564
3843
|
|
|
3565
3844
|
// src/inspector/CriterionForm.tsx
|
|
3566
|
-
var
|
|
3845
|
+
var import_react13 = require("react");
|
|
3567
3846
|
|
|
3568
3847
|
// src/modals/DeleteStateModal.tsx
|
|
3569
|
-
var
|
|
3570
|
-
var
|
|
3848
|
+
var import_react11 = require("react");
|
|
3849
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
3571
3850
|
function countAffected(doc, workflow, stateCode) {
|
|
3572
3851
|
let outgoing = 0;
|
|
3573
3852
|
let incoming = 0;
|
|
@@ -3589,24 +3868,24 @@ function DeleteStateModal({
|
|
|
3589
3868
|
onCancel
|
|
3590
3869
|
}) {
|
|
3591
3870
|
const messages = useMessages();
|
|
3592
|
-
const counts = (0,
|
|
3871
|
+
const counts = (0, import_react11.useMemo)(
|
|
3593
3872
|
() => countAffected(doc, workflow, stateCode),
|
|
3594
3873
|
[doc, workflow, stateCode]
|
|
3595
3874
|
);
|
|
3596
|
-
return /* @__PURE__ */ (0,
|
|
3597
|
-
/* @__PURE__ */ (0,
|
|
3598
|
-
/* @__PURE__ */ (0,
|
|
3599
|
-
/* @__PURE__ */ (0,
|
|
3600
|
-
/* @__PURE__ */ (0,
|
|
3601
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
3602
3881
|
messages.confirmDelete.transitionsAffected,
|
|
3603
3882
|
": ",
|
|
3604
3883
|
counts.outgoing + counts.incoming
|
|
3605
3884
|
] })
|
|
3606
3885
|
] }),
|
|
3607
|
-
/* @__PURE__ */ (0,
|
|
3608
|
-
/* @__PURE__ */ (0,
|
|
3609
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
3610
3889
|
] })
|
|
3611
3890
|
] });
|
|
3612
3891
|
}
|
|
@@ -3615,9 +3894,9 @@ function ModalFrame({
|
|
|
3615
3894
|
onCancel,
|
|
3616
3895
|
labelledBy
|
|
3617
3896
|
}) {
|
|
3618
|
-
const frameRef = (0,
|
|
3619
|
-
const previousFocusRef = (0,
|
|
3620
|
-
(0,
|
|
3897
|
+
const frameRef = (0, import_react11.useRef)(null);
|
|
3898
|
+
const previousFocusRef = (0, import_react11.useRef)(null);
|
|
3899
|
+
(0, import_react11.useEffect)(() => {
|
|
3621
3900
|
previousFocusRef.current = document.activeElement ?? null;
|
|
3622
3901
|
const node = frameRef.current;
|
|
3623
3902
|
if (node) {
|
|
@@ -3630,7 +3909,7 @@ function ModalFrame({
|
|
|
3630
3909
|
previousFocusRef.current?.focus?.();
|
|
3631
3910
|
};
|
|
3632
3911
|
}, []);
|
|
3633
|
-
return /* @__PURE__ */ (0,
|
|
3912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3634
3913
|
"div",
|
|
3635
3914
|
{
|
|
3636
3915
|
onClick: onCancel,
|
|
@@ -3650,7 +3929,7 @@ function ModalFrame({
|
|
|
3650
3929
|
zIndex: 1e3
|
|
3651
3930
|
},
|
|
3652
3931
|
"data-testid": "modal-backdrop",
|
|
3653
|
-
children: /* @__PURE__ */ (0,
|
|
3932
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3654
3933
|
"div",
|
|
3655
3934
|
{
|
|
3656
3935
|
ref: frameRef,
|
|
@@ -3676,7 +3955,7 @@ function ModalFrame({
|
|
|
3676
3955
|
}
|
|
3677
3956
|
);
|
|
3678
3957
|
}
|
|
3679
|
-
var
|
|
3958
|
+
var ghostBtn3 = {
|
|
3680
3959
|
padding: "6px 12px",
|
|
3681
3960
|
background: "white",
|
|
3682
3961
|
border: `1px solid ${colors.border}`,
|
|
@@ -3684,42 +3963,19 @@ var ghostBtn2 = {
|
|
|
3684
3963
|
fontSize: 13,
|
|
3685
3964
|
cursor: "pointer"
|
|
3686
3965
|
};
|
|
3687
|
-
var
|
|
3688
|
-
...
|
|
3966
|
+
var dangerBtn3 = {
|
|
3967
|
+
...ghostBtn3,
|
|
3689
3968
|
background: colors.danger,
|
|
3690
3969
|
color: "white",
|
|
3691
3970
|
borderColor: colors.danger
|
|
3692
3971
|
};
|
|
3693
3972
|
|
|
3694
3973
|
// src/inspector/CriterionJsonEditor.tsx
|
|
3695
|
-
var
|
|
3974
|
+
var import_react12 = require("react");
|
|
3696
3975
|
var import_workflow_monaco = require("@cyoda/workflow-monaco");
|
|
3697
3976
|
|
|
3698
|
-
// src/inspector/CriterionMonacoContext.tsx
|
|
3699
|
-
var import_react10 = require("react");
|
|
3700
|
-
var CriterionMonacoContext = (0, import_react10.createContext)(null);
|
|
3701
|
-
var CriterionMonacoProvider = CriterionMonacoContext.Provider;
|
|
3702
|
-
function useCriterionMonaco() {
|
|
3703
|
-
return (0, import_react10.useContext)(CriterionMonacoContext);
|
|
3704
|
-
}
|
|
3705
|
-
|
|
3706
|
-
// src/components/monacoDisposal.ts
|
|
3707
|
-
var installed = false;
|
|
3708
|
-
function isMonacoCanceled(reason) {
|
|
3709
|
-
if (reason == null || typeof reason !== "object") return false;
|
|
3710
|
-
return reason.name === "Canceled";
|
|
3711
|
-
}
|
|
3712
|
-
function installMonacoCancellationFilter() {
|
|
3713
|
-
if (installed || typeof window === "undefined") return;
|
|
3714
|
-
installed = true;
|
|
3715
|
-
window.addEventListener("unhandledrejection", (e) => {
|
|
3716
|
-
if (isMonacoCanceled(e.reason)) e.preventDefault();
|
|
3717
|
-
});
|
|
3718
|
-
}
|
|
3719
|
-
installMonacoCancellationFilter();
|
|
3720
|
-
|
|
3721
3977
|
// src/inspector/criterionJson.ts
|
|
3722
|
-
var
|
|
3978
|
+
var import_workflow_core5 = require("@cyoda/workflow-core");
|
|
3723
3979
|
function criterionModelUri(key) {
|
|
3724
3980
|
return `cyoda://criterion/${key}.json`;
|
|
3725
3981
|
}
|
|
@@ -3736,16 +3992,16 @@ function parseCriterionJson(text) {
|
|
|
3736
3992
|
} catch {
|
|
3737
3993
|
return { criterion: null, error: "Invalid JSON." };
|
|
3738
3994
|
}
|
|
3739
|
-
const res =
|
|
3995
|
+
const res = import_workflow_core5.CriterionSchema.safeParse(raw);
|
|
3740
3996
|
if (res.success) {
|
|
3741
|
-
const blocking = (0,
|
|
3997
|
+
const blocking = (0, import_workflow_core5.criterionBlockingError)(res.data);
|
|
3742
3998
|
if (blocking) return { criterion: null, error: blocking };
|
|
3743
3999
|
return { criterion: res.data, error: null };
|
|
3744
4000
|
}
|
|
3745
4001
|
let friendly = null;
|
|
3746
4002
|
if (typeof raw === "object" && raw !== null && typeof raw.type === "string") {
|
|
3747
4003
|
try {
|
|
3748
|
-
friendly = (0,
|
|
4004
|
+
friendly = (0, import_workflow_core5.criterionBlockingError)(raw);
|
|
3749
4005
|
} catch {
|
|
3750
4006
|
friendly = null;
|
|
3751
4007
|
}
|
|
@@ -3754,14 +4010,14 @@ function parseCriterionJson(text) {
|
|
|
3754
4010
|
}
|
|
3755
4011
|
|
|
3756
4012
|
// src/inspector/CriterionJsonEditor.tsx
|
|
3757
|
-
var
|
|
4013
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
3758
4014
|
function CriterionJsonEditor({ value, disabled, modelKey, onChange }) {
|
|
3759
4015
|
const monaco = useCriterionMonaco();
|
|
3760
|
-
const onChangeRef = (0,
|
|
4016
|
+
const onChangeRef = (0, import_react12.useRef)(onChange);
|
|
3761
4017
|
onChangeRef.current = onChange;
|
|
3762
|
-
const initialText = (0,
|
|
4018
|
+
const initialText = (0, import_react12.useRef)(JSON.stringify(value, null, 2)).current;
|
|
3763
4019
|
if (monaco) {
|
|
3764
|
-
return /* @__PURE__ */ (0,
|
|
4020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3765
4021
|
MonacoCriterionEditor,
|
|
3766
4022
|
{
|
|
3767
4023
|
monaco,
|
|
@@ -3772,7 +4028,7 @@ function CriterionJsonEditor({ value, disabled, modelKey, onChange }) {
|
|
|
3772
4028
|
}
|
|
3773
4029
|
);
|
|
3774
4030
|
}
|
|
3775
|
-
return /* @__PURE__ */ (0,
|
|
4031
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3776
4032
|
TextareaCriterionEditor,
|
|
3777
4033
|
{
|
|
3778
4034
|
initialText,
|
|
@@ -3786,10 +4042,10 @@ function TextareaCriterionEditor({
|
|
|
3786
4042
|
disabled,
|
|
3787
4043
|
onChangeRef
|
|
3788
4044
|
}) {
|
|
3789
|
-
(0,
|
|
4045
|
+
(0, import_react12.useEffect)(() => {
|
|
3790
4046
|
onChangeRef.current(parseCriterionJson(initialText));
|
|
3791
4047
|
}, [initialText, onChangeRef]);
|
|
3792
|
-
return /* @__PURE__ */ (0,
|
|
4048
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3793
4049
|
"textarea",
|
|
3794
4050
|
{
|
|
3795
4051
|
defaultValue: initialText,
|
|
@@ -3808,9 +4064,9 @@ function MonacoCriterionEditor({
|
|
|
3808
4064
|
modelKey,
|
|
3809
4065
|
onChangeRef
|
|
3810
4066
|
}) {
|
|
3811
|
-
const containerRef = (0,
|
|
3812
|
-
const editorRef = (0,
|
|
3813
|
-
(0,
|
|
4067
|
+
const containerRef = (0, import_react12.useRef)(null);
|
|
4068
|
+
const editorRef = (0, import_react12.useRef)(null);
|
|
4069
|
+
(0, import_react12.useEffect)(() => {
|
|
3814
4070
|
if (!containerRef.current || editorRef.current) return;
|
|
3815
4071
|
const model = monaco.editor.createModel(
|
|
3816
4072
|
initialText,
|
|
@@ -3841,10 +4097,10 @@ function MonacoCriterionEditor({
|
|
|
3841
4097
|
model.dispose();
|
|
3842
4098
|
};
|
|
3843
4099
|
}, [monaco, modelKey]);
|
|
3844
|
-
(0,
|
|
4100
|
+
(0, import_react12.useEffect)(() => {
|
|
3845
4101
|
editorRef.current?.updateOptions?.({ readOnly: disabled });
|
|
3846
4102
|
}, [disabled]);
|
|
3847
|
-
return /* @__PURE__ */ (0,
|
|
4103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3848
4104
|
"div",
|
|
3849
4105
|
{
|
|
3850
4106
|
ref: containerRef,
|
|
@@ -3866,7 +4122,7 @@ var jsonTextAreaStyle = {
|
|
|
3866
4122
|
};
|
|
3867
4123
|
|
|
3868
4124
|
// src/inspector/CriterionForm.tsx
|
|
3869
|
-
var
|
|
4125
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
3870
4126
|
function defaultCriterion(type) {
|
|
3871
4127
|
switch (type) {
|
|
3872
4128
|
case "simple":
|
|
@@ -3893,7 +4149,7 @@ function CriterionSection({
|
|
|
3893
4149
|
onSelectionChange
|
|
3894
4150
|
}) {
|
|
3895
4151
|
const messages = useMessages();
|
|
3896
|
-
const [modalOpen, setModalOpen] = (0,
|
|
4152
|
+
const [modalOpen, setModalOpen] = (0, import_react13.useState)(false);
|
|
3897
4153
|
const path = ["criterion"];
|
|
3898
4154
|
const removeCriterion = () => {
|
|
3899
4155
|
onDispatch({ op: "setCriterion", host, path, criterion: void 0 });
|
|
@@ -3901,8 +4157,8 @@ function CriterionSection({
|
|
|
3901
4157
|
onSelectionChange?.({ kind: "transition", transitionUuid: host.transitionUuid });
|
|
3902
4158
|
}
|
|
3903
4159
|
};
|
|
3904
|
-
return /* @__PURE__ */ (0,
|
|
3905
|
-
/* @__PURE__ */ (0,
|
|
4160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
4161
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3906
4162
|
CriterionSummaryCard,
|
|
3907
4163
|
{
|
|
3908
4164
|
criterion,
|
|
@@ -3913,7 +4169,7 @@ function CriterionSection({
|
|
|
3913
4169
|
onRemove: removeCriterion
|
|
3914
4170
|
}
|
|
3915
4171
|
),
|
|
3916
|
-
modalOpen && /* @__PURE__ */ (0,
|
|
4172
|
+
modalOpen && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3917
4173
|
CriterionEditorModal,
|
|
3918
4174
|
{
|
|
3919
4175
|
title: criterion ? messages.criterion.editTitle : messages.criterion.addTitle,
|
|
@@ -3950,42 +4206,42 @@ function CriterionSummaryCard({
|
|
|
3950
4206
|
const messages = useMessages();
|
|
3951
4207
|
const m = messages.criterion;
|
|
3952
4208
|
if (!criterion) {
|
|
3953
|
-
return /* @__PURE__ */ (0,
|
|
3954
|
-
/* @__PURE__ */ (0,
|
|
3955
|
-
/* @__PURE__ */ (0,
|
|
3956
|
-
!manual && /* @__PURE__ */ (0,
|
|
3957
|
-
!disabled && /* @__PURE__ */ (0,
|
|
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)(
|
|
3958
4214
|
"button",
|
|
3959
4215
|
{
|
|
3960
4216
|
type: "button",
|
|
3961
4217
|
onClick: onAdd,
|
|
3962
|
-
style:
|
|
4218
|
+
style: primaryBtn2,
|
|
3963
4219
|
"data-testid": "inspector-criterion-add",
|
|
3964
4220
|
children: m.add
|
|
3965
4221
|
}
|
|
3966
4222
|
)
|
|
3967
4223
|
] });
|
|
3968
4224
|
}
|
|
3969
|
-
return /* @__PURE__ */ (0,
|
|
3970
|
-
/* @__PURE__ */ (0,
|
|
3971
|
-
/* @__PURE__ */ (0,
|
|
3972
|
-
!disabled && /* @__PURE__ */ (0,
|
|
3973
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
3974
4230
|
"button",
|
|
3975
4231
|
{
|
|
3976
4232
|
type: "button",
|
|
3977
4233
|
onClick: onEdit,
|
|
3978
|
-
style:
|
|
4234
|
+
style: ghostBtn4,
|
|
3979
4235
|
"data-testid": "inspector-criterion-edit",
|
|
3980
4236
|
children: m.edit
|
|
3981
4237
|
}
|
|
3982
4238
|
),
|
|
3983
|
-
/* @__PURE__ */ (0,
|
|
4239
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3984
4240
|
"button",
|
|
3985
4241
|
{
|
|
3986
4242
|
type: "button",
|
|
3987
4243
|
onClick: onRemove,
|
|
3988
|
-
style:
|
|
4244
|
+
style: dangerBtn4,
|
|
3989
4245
|
"data-testid": "inspector-criterion-remove",
|
|
3990
4246
|
children: m.remove
|
|
3991
4247
|
}
|
|
@@ -3996,7 +4252,7 @@ function CriterionSummaryCard({
|
|
|
3996
4252
|
function CriterionCompactJson({ criterion }) {
|
|
3997
4253
|
const text = JSON.stringify(criterion);
|
|
3998
4254
|
const display = text.length > 140 ? `${text.slice(0, 137)}\u2026` : text;
|
|
3999
|
-
return /* @__PURE__ */ (0,
|
|
4255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4000
4256
|
"code",
|
|
4001
4257
|
{
|
|
4002
4258
|
"data-testid": "criterion-compact-json",
|
|
@@ -4033,7 +4289,7 @@ function CriterionEditorModal({
|
|
|
4033
4289
|
}) {
|
|
4034
4290
|
const messages = useMessages();
|
|
4035
4291
|
const seed = initialCriterion ?? defaultCriterion("simple");
|
|
4036
|
-
const [result, setResult] = (0,
|
|
4292
|
+
const [result, setResult] = (0, import_react13.useState)(
|
|
4037
4293
|
() => parseCriterionJson(JSON.stringify(seed))
|
|
4038
4294
|
);
|
|
4039
4295
|
const modelKey = criterionModelKey(host);
|
|
@@ -4043,12 +4299,12 @@ function CriterionEditorModal({
|
|
|
4043
4299
|
onDispatch({ op: "setCriterion", host, path, criterion: result.criterion });
|
|
4044
4300
|
onApplied();
|
|
4045
4301
|
};
|
|
4046
|
-
return /* @__PURE__ */ (0,
|
|
4047
|
-
/* @__PURE__ */ (0,
|
|
4048
|
-
/* @__PURE__ */ (0,
|
|
4049
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
4050
4306
|
] }),
|
|
4051
|
-
/* @__PURE__ */ (0,
|
|
4307
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: modalBodyStyle, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4052
4308
|
CriterionJsonEditor,
|
|
4053
4309
|
{
|
|
4054
4310
|
value: seed,
|
|
@@ -4057,17 +4313,17 @@ function CriterionEditorModal({
|
|
|
4057
4313
|
onChange: setResult
|
|
4058
4314
|
}
|
|
4059
4315
|
) }),
|
|
4060
|
-
result.error && /* @__PURE__ */ (0,
|
|
4061
|
-
/* @__PURE__ */ (0,
|
|
4062
|
-
/* @__PURE__ */ (0,
|
|
4063
|
-
/* @__PURE__ */ (0,
|
|
4064
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
4065
4321
|
"button",
|
|
4066
4322
|
{
|
|
4067
4323
|
type: "button",
|
|
4068
4324
|
onClick: apply,
|
|
4069
4325
|
disabled: applyDisabled,
|
|
4070
|
-
style: applyDisabled ? disabledPrimaryBtn :
|
|
4326
|
+
style: applyDisabled ? disabledPrimaryBtn : primaryBtn2,
|
|
4071
4327
|
"data-testid": "criterion-modal-apply",
|
|
4072
4328
|
children: messages.criterion.applyModal
|
|
4073
4329
|
}
|
|
@@ -4076,9 +4332,9 @@ function CriterionEditorModal({
|
|
|
4076
4332
|
] }) });
|
|
4077
4333
|
}
|
|
4078
4334
|
function SectionHeader({ label, badge }) {
|
|
4079
|
-
return /* @__PURE__ */ (0,
|
|
4080
|
-
/* @__PURE__ */ (0,
|
|
4081
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
4082
4338
|
] });
|
|
4083
4339
|
}
|
|
4084
4340
|
var cardStyle = {
|
|
@@ -4124,16 +4380,16 @@ var modalFooterStyle = {
|
|
|
4124
4380
|
borderTop: `1px solid ${colors.borderSubtle}`,
|
|
4125
4381
|
background: "white"
|
|
4126
4382
|
};
|
|
4127
|
-
var
|
|
4128
|
-
var
|
|
4129
|
-
var disabledPrimaryBtn = { ...
|
|
4130
|
-
var
|
|
4131
|
-
var
|
|
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 };
|
|
4132
4388
|
|
|
4133
4389
|
// src/inspector/ProcessorForm.tsx
|
|
4134
|
-
var
|
|
4135
|
-
var
|
|
4136
|
-
var
|
|
4390
|
+
var import_react14 = require("react");
|
|
4391
|
+
var import_workflow_core6 = require("@cyoda/workflow-core");
|
|
4392
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
4137
4393
|
var EXECUTION_MODES = [
|
|
4138
4394
|
"ASYNC_NEW_TX",
|
|
4139
4395
|
"ASYNC_SAME_TX",
|
|
@@ -4193,7 +4449,7 @@ function toProcessor(draft) {
|
|
|
4193
4449
|
function validateDraft(draft, existingNames, originalName) {
|
|
4194
4450
|
const name = draft.name.trim();
|
|
4195
4451
|
if (name.length === 0) return "Processor name is required.";
|
|
4196
|
-
if (!
|
|
4452
|
+
if (!import_workflow_core6.NAME_REGEX.test(name)) {
|
|
4197
4453
|
return "Processor name must start with a letter and contain only letters, digits, underscores, or hyphens.";
|
|
4198
4454
|
}
|
|
4199
4455
|
if (existingNames.some((existing) => existing === name && existing !== originalName)) {
|
|
@@ -4230,8 +4486,8 @@ function ProcessorEditorModal({
|
|
|
4230
4486
|
onCancel,
|
|
4231
4487
|
onApply
|
|
4232
4488
|
}) {
|
|
4233
|
-
const [draft, setDraft] = (0,
|
|
4234
|
-
(0,
|
|
4489
|
+
const [draft, setDraft] = (0, import_react14.useState)(() => toDraft(initialProcessor));
|
|
4490
|
+
(0, import_react14.useEffect)(() => {
|
|
4235
4491
|
setDraft(toDraft(initialProcessor));
|
|
4236
4492
|
}, [initialProcessor]);
|
|
4237
4493
|
const error = validateDraft(draft, existingNames, initialProcessor?.name);
|
|
@@ -4239,13 +4495,13 @@ function ProcessorEditorModal({
|
|
|
4239
4495
|
if (disabled || error) return;
|
|
4240
4496
|
onApply(toProcessor(draft));
|
|
4241
4497
|
};
|
|
4242
|
-
return /* @__PURE__ */ (0,
|
|
4243
|
-
/* @__PURE__ */ (0,
|
|
4244
|
-
/* @__PURE__ */ (0,
|
|
4245
|
-
/* @__PURE__ */ (0,
|
|
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." })
|
|
4246
4502
|
] }),
|
|
4247
|
-
/* @__PURE__ */ (0,
|
|
4248
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
4249
4505
|
"input",
|
|
4250
4506
|
{
|
|
4251
4507
|
type: "text",
|
|
@@ -4255,7 +4511,7 @@ function ProcessorEditorModal({
|
|
|
4255
4511
|
style: inputStyle2
|
|
4256
4512
|
}
|
|
4257
4513
|
) }),
|
|
4258
|
-
/* @__PURE__ */ (0,
|
|
4514
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormField, { label: "Execution mode", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4259
4515
|
CustomSelectInput,
|
|
4260
4516
|
{
|
|
4261
4517
|
value: draft.executionMode,
|
|
@@ -4264,8 +4520,8 @@ function ProcessorEditorModal({
|
|
|
4264
4520
|
testId: "processor-execution-mode"
|
|
4265
4521
|
}
|
|
4266
4522
|
) }),
|
|
4267
|
-
/* @__PURE__ */ (0,
|
|
4268
|
-
/* @__PURE__ */ (0,
|
|
4523
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: checkboxRowStyle, children: [
|
|
4524
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4269
4525
|
"input",
|
|
4270
4526
|
{
|
|
4271
4527
|
type: "checkbox",
|
|
@@ -4273,9 +4529,9 @@ function ProcessorEditorModal({
|
|
|
4273
4529
|
onChange: (event) => setDraft((current) => ({ ...current, attachEntity: event.target.checked }))
|
|
4274
4530
|
}
|
|
4275
4531
|
),
|
|
4276
|
-
/* @__PURE__ */ (0,
|
|
4532
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "Attach entity" })
|
|
4277
4533
|
] }),
|
|
4278
|
-
/* @__PURE__ */ (0,
|
|
4534
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormField, { label: "Calculation node tags", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4279
4535
|
"input",
|
|
4280
4536
|
{
|
|
4281
4537
|
type: "text",
|
|
@@ -4288,7 +4544,7 @@ function ProcessorEditorModal({
|
|
|
4288
4544
|
style: inputStyle2
|
|
4289
4545
|
}
|
|
4290
4546
|
) }),
|
|
4291
|
-
/* @__PURE__ */ (0,
|
|
4547
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormField, { label: "Response timeout ms", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4292
4548
|
"input",
|
|
4293
4549
|
{
|
|
4294
4550
|
type: "text",
|
|
@@ -4300,7 +4556,7 @@ function ProcessorEditorModal({
|
|
|
4300
4556
|
style: inputStyle2
|
|
4301
4557
|
}
|
|
4302
4558
|
) }),
|
|
4303
|
-
/* @__PURE__ */ (0,
|
|
4559
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormField, { label: "Retry policy", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4304
4560
|
"input",
|
|
4305
4561
|
{
|
|
4306
4562
|
type: "text",
|
|
@@ -4309,8 +4565,8 @@ function ProcessorEditorModal({
|
|
|
4309
4565
|
style: inputStyle2
|
|
4310
4566
|
}
|
|
4311
4567
|
) }),
|
|
4312
|
-
/* @__PURE__ */ (0,
|
|
4313
|
-
/* @__PURE__ */ (0,
|
|
4568
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: checkboxRowStyle, children: [
|
|
4569
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4314
4570
|
"input",
|
|
4315
4571
|
{
|
|
4316
4572
|
type: "checkbox",
|
|
@@ -4323,9 +4579,9 @@ function ProcessorEditorModal({
|
|
|
4323
4579
|
"data-testid": "processor-async-result"
|
|
4324
4580
|
}
|
|
4325
4581
|
),
|
|
4326
|
-
/* @__PURE__ */ (0,
|
|
4582
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "Async result" })
|
|
4327
4583
|
] }),
|
|
4328
|
-
/* @__PURE__ */ (0,
|
|
4584
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormField, { label: "Crossover to async ms", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4329
4585
|
"input",
|
|
4330
4586
|
{
|
|
4331
4587
|
type: "text",
|
|
@@ -4340,16 +4596,16 @@ function ProcessorEditorModal({
|
|
|
4340
4596
|
}
|
|
4341
4597
|
) })
|
|
4342
4598
|
] }),
|
|
4343
|
-
error && /* @__PURE__ */ (0,
|
|
4344
|
-
/* @__PURE__ */ (0,
|
|
4345
|
-
/* @__PURE__ */ (0,
|
|
4346
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
4347
4603
|
"button",
|
|
4348
4604
|
{
|
|
4349
4605
|
type: "button",
|
|
4350
4606
|
onClick: apply,
|
|
4351
4607
|
disabled: disabled || !!error,
|
|
4352
|
-
style: disabled || error ? disabledPrimaryBtn2 :
|
|
4608
|
+
style: disabled || error ? disabledPrimaryBtn2 : primaryBtn3,
|
|
4353
4609
|
"data-testid": "processor-modal-apply",
|
|
4354
4610
|
children: "Apply processor"
|
|
4355
4611
|
}
|
|
@@ -4361,8 +4617,8 @@ function FormField({
|
|
|
4361
4617
|
label,
|
|
4362
4618
|
children
|
|
4363
4619
|
}) {
|
|
4364
|
-
return /* @__PURE__ */ (0,
|
|
4365
|
-
/* @__PURE__ */ (0,
|
|
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 }),
|
|
4366
4622
|
children
|
|
4367
4623
|
] });
|
|
4368
4624
|
}
|
|
@@ -4376,18 +4632,18 @@ function ProcessorForm({
|
|
|
4376
4632
|
onDispatch
|
|
4377
4633
|
}) {
|
|
4378
4634
|
const messages = useMessages();
|
|
4379
|
-
const [modalOpen, setModalOpen] = (0,
|
|
4380
|
-
return /* @__PURE__ */ (0,
|
|
4381
|
-
/* @__PURE__ */ (0,
|
|
4382
|
-
/* @__PURE__ */ (0,
|
|
4383
|
-
/* @__PURE__ */ (0,
|
|
4384
|
-
/* @__PURE__ */ (0,
|
|
4635
|
+
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) })
|
|
4385
4641
|
] }),
|
|
4386
|
-
/* @__PURE__ */ (0,
|
|
4642
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: chipStyle, children: processor.type })
|
|
4387
4643
|
] }),
|
|
4388
|
-
/* @__PURE__ */ (0,
|
|
4389
|
-
/* @__PURE__ */ (0,
|
|
4390
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
4391
4647
|
"button",
|
|
4392
4648
|
{
|
|
4393
4649
|
type: "button",
|
|
@@ -4398,11 +4654,11 @@ function ProcessorForm({
|
|
|
4398
4654
|
processorUuid,
|
|
4399
4655
|
toIndex: processorIndex - 1
|
|
4400
4656
|
}),
|
|
4401
|
-
style:
|
|
4657
|
+
style: ghostBtn5,
|
|
4402
4658
|
children: messages.inspector.moveUp
|
|
4403
4659
|
}
|
|
4404
4660
|
),
|
|
4405
|
-
/* @__PURE__ */ (0,
|
|
4661
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4406
4662
|
"button",
|
|
4407
4663
|
{
|
|
4408
4664
|
type: "button",
|
|
@@ -4413,23 +4669,23 @@ function ProcessorForm({
|
|
|
4413
4669
|
processorUuid,
|
|
4414
4670
|
toIndex: processorIndex + 1
|
|
4415
4671
|
}),
|
|
4416
|
-
style:
|
|
4672
|
+
style: ghostBtn5,
|
|
4417
4673
|
children: messages.inspector.moveDown
|
|
4418
4674
|
}
|
|
4419
4675
|
),
|
|
4420
|
-
/* @__PURE__ */ (0,
|
|
4676
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4421
4677
|
"button",
|
|
4422
4678
|
{
|
|
4423
4679
|
type: "button",
|
|
4424
4680
|
disabled,
|
|
4425
4681
|
onClick: () => onDispatch({ op: "removeProcessor", processorUuid }),
|
|
4426
|
-
style:
|
|
4682
|
+
style: dangerBtn5,
|
|
4427
4683
|
"data-testid": "inspector-processor-delete",
|
|
4428
4684
|
children: messages.inspector.removeProcessor
|
|
4429
4685
|
}
|
|
4430
4686
|
)
|
|
4431
4687
|
] }),
|
|
4432
|
-
modalOpen && /* @__PURE__ */ (0,
|
|
4688
|
+
modalOpen && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4433
4689
|
ProcessorEditorModal,
|
|
4434
4690
|
{
|
|
4435
4691
|
title: `Edit ${processor.name}`,
|
|
@@ -4491,7 +4747,7 @@ var checkboxRowStyle = {
|
|
|
4491
4747
|
color: colors.textSecondary,
|
|
4492
4748
|
cursor: "pointer"
|
|
4493
4749
|
};
|
|
4494
|
-
var
|
|
4750
|
+
var errorStyle3 = {
|
|
4495
4751
|
padding: "8px 10px",
|
|
4496
4752
|
border: `1px solid ${colors.dangerBorder}`,
|
|
4497
4753
|
background: colors.dangerBg,
|
|
@@ -4499,7 +4755,7 @@ var errorStyle2 = {
|
|
|
4499
4755
|
color: colors.danger,
|
|
4500
4756
|
fontSize: 12
|
|
4501
4757
|
};
|
|
4502
|
-
var
|
|
4758
|
+
var ghostBtn5 = {
|
|
4503
4759
|
padding: "6px 10px",
|
|
4504
4760
|
background: "white",
|
|
4505
4761
|
border: `1px solid ${colors.border}`,
|
|
@@ -4507,19 +4763,19 @@ var ghostBtn4 = {
|
|
|
4507
4763
|
fontSize: 12,
|
|
4508
4764
|
cursor: "pointer"
|
|
4509
4765
|
};
|
|
4510
|
-
var
|
|
4511
|
-
...
|
|
4766
|
+
var primaryBtn3 = {
|
|
4767
|
+
...ghostBtn5,
|
|
4512
4768
|
background: colors.primary,
|
|
4513
4769
|
color: "white",
|
|
4514
4770
|
borderColor: colors.primary
|
|
4515
4771
|
};
|
|
4516
4772
|
var disabledPrimaryBtn2 = {
|
|
4517
|
-
...
|
|
4773
|
+
...primaryBtn3,
|
|
4518
4774
|
opacity: 0.5,
|
|
4519
4775
|
cursor: "not-allowed"
|
|
4520
4776
|
};
|
|
4521
|
-
var
|
|
4522
|
-
...
|
|
4777
|
+
var dangerBtn5 = {
|
|
4778
|
+
...ghostBtn5,
|
|
4523
4779
|
background: colors.dangerBg,
|
|
4524
4780
|
borderColor: colors.dangerBorder,
|
|
4525
4781
|
color: colors.danger
|
|
@@ -4543,7 +4799,7 @@ var summaryCardStyle = {
|
|
|
4543
4799
|
};
|
|
4544
4800
|
|
|
4545
4801
|
// src/inspector/TransitionForm.tsx
|
|
4546
|
-
var
|
|
4802
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
4547
4803
|
function TransitionForm({
|
|
4548
4804
|
workflow,
|
|
4549
4805
|
stateCode,
|
|
@@ -4558,15 +4814,15 @@ function TransitionForm({
|
|
|
4558
4814
|
onSelectionChange
|
|
4559
4815
|
}) {
|
|
4560
4816
|
const messages = useMessages();
|
|
4561
|
-
const [renameError, setRenameError] = (0,
|
|
4562
|
-
const [processorModal, setProcessorModal] = (0,
|
|
4563
|
-
const [scheduleDelayDraft, setScheduleDelayDraft] = (0,
|
|
4817
|
+
const [renameError, setRenameError] = (0, import_react15.useState)(null);
|
|
4818
|
+
const [processorModal, setProcessorModal] = (0, import_react15.useState)(null);
|
|
4819
|
+
const [scheduleDelayDraft, setScheduleDelayDraft] = (0, import_react15.useState)(
|
|
4564
4820
|
transition.schedule?.delayMs !== void 0 ? String(transition.schedule.delayMs) : ""
|
|
4565
4821
|
);
|
|
4566
|
-
const [scheduleTimeoutDraft, setScheduleTimeoutDraft] = (0,
|
|
4822
|
+
const [scheduleTimeoutDraft, setScheduleTimeoutDraft] = (0, import_react15.useState)(
|
|
4567
4823
|
transition.schedule?.timeoutMs !== void 0 ? String(transition.schedule.timeoutMs) : ""
|
|
4568
4824
|
);
|
|
4569
|
-
const prevTransitionUuidRef = (0,
|
|
4825
|
+
const prevTransitionUuidRef = (0, import_react15.useRef)(transitionUuid);
|
|
4570
4826
|
if (prevTransitionUuidRef.current !== transitionUuid) {
|
|
4571
4827
|
prevTransitionUuidRef.current = transitionUuid;
|
|
4572
4828
|
setScheduleDelayDraft(
|
|
@@ -4581,7 +4837,7 @@ function TransitionForm({
|
|
|
4581
4837
|
const handleRename = (next) => {
|
|
4582
4838
|
if (next === transition.name) return;
|
|
4583
4839
|
setRenameError(null);
|
|
4584
|
-
if (!
|
|
4840
|
+
if (!import_workflow_core7.NAME_REGEX.test(next)) {
|
|
4585
4841
|
setRenameError(`"${next}" is not a valid transition name`);
|
|
4586
4842
|
return;
|
|
4587
4843
|
}
|
|
@@ -4664,9 +4920,9 @@ function TransitionForm({
|
|
|
4664
4920
|
index: index + 1
|
|
4665
4921
|
});
|
|
4666
4922
|
};
|
|
4667
|
-
return /* @__PURE__ */ (0,
|
|
4668
|
-
/* @__PURE__ */ (0,
|
|
4669
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
4670
4926
|
TextField,
|
|
4671
4927
|
{
|
|
4672
4928
|
label: messages.inspector.name,
|
|
@@ -4677,8 +4933,8 @@ function TransitionForm({
|
|
|
4677
4933
|
testId: "inspector-transition-name"
|
|
4678
4934
|
}
|
|
4679
4935
|
),
|
|
4680
|
-
renameError && /* @__PURE__ */ (0,
|
|
4681
|
-
!disabled && /* @__PURE__ */ (0,
|
|
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)(
|
|
4682
4938
|
SelectField,
|
|
4683
4939
|
{
|
|
4684
4940
|
label: "Source state",
|
|
@@ -4698,7 +4954,7 @@ function TransitionForm({
|
|
|
4698
4954
|
testId: "inspector-transition-source-state"
|
|
4699
4955
|
}
|
|
4700
4956
|
),
|
|
4701
|
-
/* @__PURE__ */ (0,
|
|
4957
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4702
4958
|
SelectField,
|
|
4703
4959
|
{
|
|
4704
4960
|
label: "Target state",
|
|
@@ -4709,7 +4965,7 @@ function TransitionForm({
|
|
|
4709
4965
|
testId: "inspector-transition-next"
|
|
4710
4966
|
}
|
|
4711
4967
|
),
|
|
4712
|
-
/* @__PURE__ */ (0,
|
|
4968
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4713
4969
|
SelectField,
|
|
4714
4970
|
{
|
|
4715
4971
|
label: messages.inspector.transitionType,
|
|
@@ -4723,7 +4979,7 @@ function TransitionForm({
|
|
|
4723
4979
|
testId: "inspector-transition-manual"
|
|
4724
4980
|
}
|
|
4725
4981
|
),
|
|
4726
|
-
/* @__PURE__ */ (0,
|
|
4982
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4727
4983
|
CheckboxField,
|
|
4728
4984
|
{
|
|
4729
4985
|
label: messages.inspector.disabled,
|
|
@@ -4733,7 +4989,7 @@ function TransitionForm({
|
|
|
4733
4989
|
testId: "inspector-transition-disabled"
|
|
4734
4990
|
}
|
|
4735
4991
|
),
|
|
4736
|
-
/* @__PURE__ */ (0,
|
|
4992
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4737
4993
|
AnchorSelect,
|
|
4738
4994
|
{
|
|
4739
4995
|
label: messages.inspector.sourceAnchor,
|
|
@@ -4744,7 +5000,7 @@ function TransitionForm({
|
|
|
4744
5000
|
testId: "inspector-transition-source-anchor"
|
|
4745
5001
|
}
|
|
4746
5002
|
),
|
|
4747
|
-
/* @__PURE__ */ (0,
|
|
5003
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4748
5004
|
AnchorSelect,
|
|
4749
5005
|
{
|
|
4750
5006
|
label: messages.inspector.targetAnchor,
|
|
@@ -4755,12 +5011,12 @@ function TransitionForm({
|
|
|
4755
5011
|
testId: "inspector-transition-target-anchor"
|
|
4756
5012
|
}
|
|
4757
5013
|
),
|
|
4758
|
-
/* @__PURE__ */ (0,
|
|
4759
|
-
/* @__PURE__ */ (0,
|
|
4760
|
-
/* @__PURE__ */ (0,
|
|
4761
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
4762
5018
|
] }),
|
|
4763
|
-
/* @__PURE__ */ (0,
|
|
5019
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4764
5020
|
"p",
|
|
4765
5021
|
{
|
|
4766
5022
|
style: {
|
|
@@ -4774,20 +5030,20 @@ function TransitionForm({
|
|
|
4774
5030
|
}
|
|
4775
5031
|
)
|
|
4776
5032
|
] }),
|
|
4777
|
-
/* @__PURE__ */ (0,
|
|
4778
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
4779
5035
|
"button",
|
|
4780
5036
|
{
|
|
4781
5037
|
type: "button",
|
|
4782
5038
|
disabled,
|
|
4783
5039
|
onClick: removeTransition,
|
|
4784
|
-
style:
|
|
5040
|
+
style: dangerBtn6,
|
|
4785
5041
|
"data-testid": "inspector-transition-delete",
|
|
4786
5042
|
children: "Delete transition"
|
|
4787
5043
|
}
|
|
4788
5044
|
),
|
|
4789
|
-
/* @__PURE__ */ (0,
|
|
4790
|
-
issues && issues.length > 0 && /* @__PURE__ */ (0,
|
|
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)(
|
|
4791
5047
|
"div",
|
|
4792
5048
|
{
|
|
4793
5049
|
role: "alert",
|
|
@@ -4804,12 +5060,12 @@ function TransitionForm({
|
|
|
4804
5060
|
`${issue.code}-${i}`
|
|
4805
5061
|
)) })
|
|
4806
5062
|
] }),
|
|
4807
|
-
/* @__PURE__ */ (0,
|
|
5063
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4808
5064
|
TransitionSection,
|
|
4809
5065
|
{
|
|
4810
5066
|
title: messages.inspector.criteria,
|
|
4811
5067
|
testId: "inspector-transition-criteria-section",
|
|
4812
|
-
children: /* @__PURE__ */ (0,
|
|
5068
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4813
5069
|
CriterionSection,
|
|
4814
5070
|
{
|
|
4815
5071
|
host,
|
|
@@ -4825,18 +5081,18 @@ function TransitionForm({
|
|
|
4825
5081
|
)
|
|
4826
5082
|
}
|
|
4827
5083
|
),
|
|
4828
|
-
/* @__PURE__ */ (0,
|
|
5084
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
4829
5085
|
TransitionSection,
|
|
4830
5086
|
{
|
|
4831
5087
|
title: "Scheduled transition",
|
|
4832
5088
|
testId: "inspector-transition-schedule-section",
|
|
4833
5089
|
children: [
|
|
4834
|
-
/* @__PURE__ */ (0,
|
|
5090
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
4835
5091
|
"label",
|
|
4836
5092
|
{
|
|
4837
5093
|
style: { display: "flex", flexDirection: "row", alignItems: "center", gap: 8, fontSize: 12, color: colors.textSecondary, cursor: "pointer" },
|
|
4838
5094
|
children: [
|
|
4839
|
-
/* @__PURE__ */ (0,
|
|
5095
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4840
5096
|
"input",
|
|
4841
5097
|
{
|
|
4842
5098
|
type: "checkbox",
|
|
@@ -4856,14 +5112,14 @@ function TransitionForm({
|
|
|
4856
5112
|
}
|
|
4857
5113
|
}
|
|
4858
5114
|
),
|
|
4859
|
-
/* @__PURE__ */ (0,
|
|
5115
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "Enable schedule" })
|
|
4860
5116
|
]
|
|
4861
5117
|
}
|
|
4862
5118
|
),
|
|
4863
|
-
transition.schedule !== void 0 && /* @__PURE__ */ (0,
|
|
4864
|
-
/* @__PURE__ */ (0,
|
|
4865
|
-
/* @__PURE__ */ (0,
|
|
4866
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
4867
5123
|
"input",
|
|
4868
5124
|
{
|
|
4869
5125
|
type: "text",
|
|
@@ -4879,9 +5135,9 @@ function TransitionForm({
|
|
|
4879
5135
|
}
|
|
4880
5136
|
)
|
|
4881
5137
|
] }),
|
|
4882
|
-
/* @__PURE__ */ (0,
|
|
4883
|
-
/* @__PURE__ */ (0,
|
|
4884
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
4885
5141
|
"input",
|
|
4886
5142
|
{
|
|
4887
5143
|
type: "text",
|
|
@@ -4898,7 +5154,7 @@ function TransitionForm({
|
|
|
4898
5154
|
)
|
|
4899
5155
|
] })
|
|
4900
5156
|
] }),
|
|
4901
|
-
/* @__PURE__ */ (0,
|
|
5157
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4902
5158
|
"p",
|
|
4903
5159
|
{
|
|
4904
5160
|
style: {
|
|
@@ -4918,28 +5174,28 @@ function TransitionForm({
|
|
|
4918
5174
|
]
|
|
4919
5175
|
}
|
|
4920
5176
|
),
|
|
4921
|
-
/* @__PURE__ */ (0,
|
|
5177
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
4922
5178
|
TransitionSection,
|
|
4923
5179
|
{
|
|
4924
5180
|
title: messages.inspector.processors,
|
|
4925
5181
|
testId: "inspector-transition-processes-section",
|
|
4926
5182
|
children: [
|
|
4927
|
-
processorCount === 0 ? /* @__PURE__ */ (0,
|
|
4928
|
-
/* @__PURE__ */ (0,
|
|
4929
|
-
processors.map((processor, index) => /* @__PURE__ */ (0,
|
|
4930
|
-
/* @__PURE__ */ (0,
|
|
4931
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
4932
5188
|
index + 1,
|
|
4933
5189
|
"."
|
|
4934
5190
|
] }),
|
|
4935
|
-
/* @__PURE__ */ (0,
|
|
4936
|
-
/* @__PURE__ */ (0,
|
|
4937
|
-
/* @__PURE__ */ (0,
|
|
4938
|
-
/* @__PURE__ */ (0,
|
|
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) })
|
|
4939
5195
|
] })
|
|
4940
5196
|
] }),
|
|
4941
|
-
/* @__PURE__ */ (0,
|
|
4942
|
-
/* @__PURE__ */ (0,
|
|
5197
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", gap: 6, flexWrap: "wrap" }, children: [
|
|
5198
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4943
5199
|
"button",
|
|
4944
5200
|
{
|
|
4945
5201
|
type: "button",
|
|
@@ -4949,23 +5205,23 @@ function TransitionForm({
|
|
|
4949
5205
|
processorUuid: processorUuids[index],
|
|
4950
5206
|
processorIndex: index
|
|
4951
5207
|
}),
|
|
4952
|
-
style:
|
|
5208
|
+
style: ghostBtn6,
|
|
4953
5209
|
"data-testid": `processor-edit-${index}`,
|
|
4954
5210
|
children: "Edit"
|
|
4955
5211
|
}
|
|
4956
5212
|
),
|
|
4957
|
-
/* @__PURE__ */ (0,
|
|
5213
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4958
5214
|
"button",
|
|
4959
5215
|
{
|
|
4960
5216
|
type: "button",
|
|
4961
5217
|
disabled,
|
|
4962
5218
|
onClick: () => duplicateProcessor(processor, index),
|
|
4963
|
-
style:
|
|
5219
|
+
style: ghostBtn6,
|
|
4964
5220
|
"data-testid": `processor-duplicate-${index}`,
|
|
4965
5221
|
children: "Duplicate"
|
|
4966
5222
|
}
|
|
4967
5223
|
),
|
|
4968
|
-
/* @__PURE__ */ (0,
|
|
5224
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4969
5225
|
"button",
|
|
4970
5226
|
{
|
|
4971
5227
|
type: "button",
|
|
@@ -4976,12 +5232,12 @@ function TransitionForm({
|
|
|
4976
5232
|
processorUuid: processorUuids[index],
|
|
4977
5233
|
toIndex: index - 1
|
|
4978
5234
|
}),
|
|
4979
|
-
style:
|
|
5235
|
+
style: ghostBtn6,
|
|
4980
5236
|
"data-testid": `processor-move-up-${index}`,
|
|
4981
5237
|
children: "Move up"
|
|
4982
5238
|
}
|
|
4983
5239
|
),
|
|
4984
|
-
/* @__PURE__ */ (0,
|
|
5240
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4985
5241
|
"button",
|
|
4986
5242
|
{
|
|
4987
5243
|
type: "button",
|
|
@@ -4992,18 +5248,18 @@ function TransitionForm({
|
|
|
4992
5248
|
processorUuid: processorUuids[index],
|
|
4993
5249
|
toIndex: index + 1
|
|
4994
5250
|
}),
|
|
4995
|
-
style:
|
|
5251
|
+
style: ghostBtn6,
|
|
4996
5252
|
"data-testid": `processor-move-down-${index}`,
|
|
4997
5253
|
children: "Move down"
|
|
4998
5254
|
}
|
|
4999
5255
|
),
|
|
5000
|
-
/* @__PURE__ */ (0,
|
|
5256
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
5001
5257
|
"button",
|
|
5002
5258
|
{
|
|
5003
5259
|
type: "button",
|
|
5004
5260
|
disabled: disabled || !processorUuids[index],
|
|
5005
5261
|
onClick: () => processorUuids[index] && onDispatch({ op: "removeProcessor", processorUuid: processorUuids[index] }),
|
|
5006
|
-
style:
|
|
5262
|
+
style: dangerBtn6,
|
|
5007
5263
|
"data-testid": `processor-delete-${index}`,
|
|
5008
5264
|
children: "Delete"
|
|
5009
5265
|
}
|
|
@@ -5011,13 +5267,13 @@ function TransitionForm({
|
|
|
5011
5267
|
] })
|
|
5012
5268
|
] }, processorUuids[index] ?? `${processor.name}-${index}`))
|
|
5013
5269
|
] }),
|
|
5014
|
-
/* @__PURE__ */ (0,
|
|
5270
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
5015
5271
|
"button",
|
|
5016
5272
|
{
|
|
5017
5273
|
type: "button",
|
|
5018
5274
|
disabled,
|
|
5019
5275
|
onClick: () => setProcessorModal({ mode: "add" }),
|
|
5020
|
-
style:
|
|
5276
|
+
style: ghostBtn6,
|
|
5021
5277
|
"data-testid": "inspector-add-processor",
|
|
5022
5278
|
children: messages.inspector.addProcessor
|
|
5023
5279
|
}
|
|
@@ -5025,7 +5281,18 @@ function TransitionForm({
|
|
|
5025
5281
|
]
|
|
5026
5282
|
}
|
|
5027
5283
|
),
|
|
5028
|
-
|
|
5284
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TransitionSection, { title: "Annotations", testId: "inspector-transition-annotations-section", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
5285
|
+
AnnotationsField,
|
|
5286
|
+
{
|
|
5287
|
+
value: transition.annotations,
|
|
5288
|
+
disabled,
|
|
5289
|
+
showLabel: false,
|
|
5290
|
+
modelKey: `transition-${transitionUuid}`,
|
|
5291
|
+
onCommit: (annotations) => onDispatch({ op: "setAnnotations", target: { kind: "transition", transitionUuid }, annotations }),
|
|
5292
|
+
onRemove: () => onDispatch({ op: "setAnnotations", target: { kind: "transition", transitionUuid } })
|
|
5293
|
+
}
|
|
5294
|
+
) }),
|
|
5295
|
+
processorModal && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
5029
5296
|
ProcessorEditorModal,
|
|
5030
5297
|
{
|
|
5031
5298
|
title: processorModal.mode === "add" ? "Add processor" : "Edit processor",
|
|
@@ -5045,8 +5312,8 @@ function TransitionSection({
|
|
|
5045
5312
|
testId,
|
|
5046
5313
|
children
|
|
5047
5314
|
}) {
|
|
5048
|
-
return /* @__PURE__ */ (0,
|
|
5049
|
-
/* @__PURE__ */ (0,
|
|
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 }),
|
|
5050
5317
|
children
|
|
5051
5318
|
] });
|
|
5052
5319
|
}
|
|
@@ -5069,7 +5336,7 @@ var sectionHeaderStyle = {
|
|
|
5069
5336
|
textTransform: "uppercase",
|
|
5070
5337
|
color: colors.textSecondary
|
|
5071
5338
|
};
|
|
5072
|
-
var
|
|
5339
|
+
var ghostBtn6 = {
|
|
5073
5340
|
padding: "4px 8px",
|
|
5074
5341
|
background: "white",
|
|
5075
5342
|
border: `1px solid ${colors.border}`,
|
|
@@ -5077,8 +5344,8 @@ var ghostBtn5 = {
|
|
|
5077
5344
|
fontSize: 12,
|
|
5078
5345
|
cursor: "pointer"
|
|
5079
5346
|
};
|
|
5080
|
-
var
|
|
5081
|
-
...
|
|
5347
|
+
var dangerBtn6 = {
|
|
5348
|
+
...ghostBtn6,
|
|
5082
5349
|
background: colors.dangerBg,
|
|
5083
5350
|
borderColor: colors.dangerBorder,
|
|
5084
5351
|
color: colors.danger
|
|
@@ -5153,9 +5420,9 @@ function AnchorSelect({
|
|
|
5153
5420
|
{ value: "left", label: messages.inspector.anchorLeft },
|
|
5154
5421
|
{ value: "left-bottom", label: messages.inspector.anchorLeftBottom }
|
|
5155
5422
|
];
|
|
5156
|
-
return /* @__PURE__ */ (0,
|
|
5157
|
-
/* @__PURE__ */ (0,
|
|
5158
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
5159
5426
|
CustomSelectInput,
|
|
5160
5427
|
{
|
|
5161
5428
|
value: value ?? "",
|
|
@@ -5170,7 +5437,7 @@ function AnchorSelect({
|
|
|
5170
5437
|
}
|
|
5171
5438
|
|
|
5172
5439
|
// src/inspector/Inspector.tsx
|
|
5173
|
-
var
|
|
5440
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
5174
5441
|
function issueKeyForSelection(selection) {
|
|
5175
5442
|
if (!selection) return null;
|
|
5176
5443
|
switch (selection.kind) {
|
|
@@ -5199,16 +5466,16 @@ function Inspector({
|
|
|
5199
5466
|
}) {
|
|
5200
5467
|
const messages = useMessages();
|
|
5201
5468
|
const { developerMode } = useEditorConfig();
|
|
5202
|
-
const [tab, setTab] = (0,
|
|
5469
|
+
const [tab, setTab] = (0, import_react16.useState)("properties");
|
|
5203
5470
|
const effectiveTab = developerMode ? tab : "properties";
|
|
5204
|
-
const resolved = (0,
|
|
5471
|
+
const resolved = (0, import_react16.useMemo)(() => resolveSelection(doc, selection), [doc, selection]);
|
|
5205
5472
|
const selectionIssueKey = issueKeyForSelection(selection);
|
|
5206
|
-
const selectionIssues = (0,
|
|
5473
|
+
const selectionIssues = (0, import_react16.useMemo)(() => {
|
|
5207
5474
|
if (!selectionIssueKey) return [];
|
|
5208
5475
|
return issues.filter((i) => i.targetId === selectionIssueKey);
|
|
5209
5476
|
}, [issues, selectionIssueKey]);
|
|
5210
5477
|
const breadcrumb = renderBreadcrumb(resolved);
|
|
5211
|
-
return /* @__PURE__ */ (0,
|
|
5478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5212
5479
|
"aside",
|
|
5213
5480
|
{
|
|
5214
5481
|
style: {
|
|
@@ -5224,7 +5491,7 @@ function Inspector({
|
|
|
5224
5491
|
},
|
|
5225
5492
|
"data-testid": "inspector",
|
|
5226
5493
|
children: [
|
|
5227
|
-
/* @__PURE__ */ (0,
|
|
5494
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5228
5495
|
"header",
|
|
5229
5496
|
{
|
|
5230
5497
|
style: {
|
|
@@ -5237,8 +5504,8 @@ function Inspector({
|
|
|
5237
5504
|
gap: 8
|
|
5238
5505
|
},
|
|
5239
5506
|
children: [
|
|
5240
|
-
/* @__PURE__ */ (0,
|
|
5241
|
-
onClose && /* @__PURE__ */ (0,
|
|
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)(
|
|
5242
5509
|
"button",
|
|
5243
5510
|
{
|
|
5244
5511
|
type: "button",
|
|
@@ -5266,8 +5533,8 @@ function Inspector({
|
|
|
5266
5533
|
]
|
|
5267
5534
|
}
|
|
5268
5535
|
),
|
|
5269
|
-
developerMode && /* @__PURE__ */ (0,
|
|
5270
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
5271
5538
|
TabButton,
|
|
5272
5539
|
{
|
|
5273
5540
|
active: effectiveTab === "properties",
|
|
@@ -5276,7 +5543,7 @@ function Inspector({
|
|
|
5276
5543
|
children: messages.inspector.properties
|
|
5277
5544
|
}
|
|
5278
5545
|
),
|
|
5279
|
-
/* @__PURE__ */ (0,
|
|
5546
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5280
5547
|
TabButton,
|
|
5281
5548
|
{
|
|
5282
5549
|
active: effectiveTab === "json",
|
|
@@ -5286,11 +5553,11 @@ function Inspector({
|
|
|
5286
5553
|
}
|
|
5287
5554
|
)
|
|
5288
5555
|
] }),
|
|
5289
|
-
/* @__PURE__ */ (0,
|
|
5290
|
-
effectiveTab === "properties" && /* @__PURE__ */ (0,
|
|
5291
|
-
!resolved && /* @__PURE__ */ (0,
|
|
5292
|
-
resolved?.kind === "workflow" && /* @__PURE__ */ (0,
|
|
5293
|
-
resolved?.kind === "state" && /* @__PURE__ */ (0,
|
|
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)(
|
|
5294
5561
|
StateForm,
|
|
5295
5562
|
{
|
|
5296
5563
|
workflow: resolved.workflow,
|
|
@@ -5303,7 +5570,7 @@ function Inspector({
|
|
|
5303
5570
|
},
|
|
5304
5571
|
`${resolved.workflow.name}:${resolved.stateCode}`
|
|
5305
5572
|
),
|
|
5306
|
-
resolved?.kind === "transition" && /* @__PURE__ */ (0,
|
|
5573
|
+
resolved?.kind === "transition" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5307
5574
|
TransitionForm,
|
|
5308
5575
|
{
|
|
5309
5576
|
workflow: resolved.workflow,
|
|
@@ -5320,7 +5587,7 @@ function Inspector({
|
|
|
5320
5587
|
},
|
|
5321
5588
|
resolved.transitionUuid
|
|
5322
5589
|
),
|
|
5323
|
-
resolved?.kind === "processor" && /* @__PURE__ */ (0,
|
|
5590
|
+
resolved?.kind === "processor" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5324
5591
|
ProcessorForm,
|
|
5325
5592
|
{
|
|
5326
5593
|
processor: resolved.processor,
|
|
@@ -5334,8 +5601,8 @@ function Inspector({
|
|
|
5334
5601
|
resolved.processorUuid
|
|
5335
5602
|
)
|
|
5336
5603
|
] }),
|
|
5337
|
-
developerMode && effectiveTab === "json" && /* @__PURE__ */ (0,
|
|
5338
|
-
selectionIssues.length > 0 && /* @__PURE__ */ (0,
|
|
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 })
|
|
5339
5606
|
] })
|
|
5340
5607
|
]
|
|
5341
5608
|
}
|
|
@@ -5358,7 +5625,7 @@ function TabButton({
|
|
|
5358
5625
|
children,
|
|
5359
5626
|
testId
|
|
5360
5627
|
}) {
|
|
5361
|
-
return /* @__PURE__ */ (0,
|
|
5628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5362
5629
|
"button",
|
|
5363
5630
|
{
|
|
5364
5631
|
type: "button",
|
|
@@ -5379,17 +5646,17 @@ function TabButton({
|
|
|
5379
5646
|
);
|
|
5380
5647
|
}
|
|
5381
5648
|
function EmptyState({ message }) {
|
|
5382
|
-
return /* @__PURE__ */ (0,
|
|
5649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { style: { color: colors.textTertiary, fontSize: 13 }, children: message });
|
|
5383
5650
|
}
|
|
5384
5651
|
function IssuesList({
|
|
5385
5652
|
issues,
|
|
5386
5653
|
title
|
|
5387
5654
|
}) {
|
|
5388
|
-
return /* @__PURE__ */ (0,
|
|
5389
|
-
/* @__PURE__ */ (0,
|
|
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 }),
|
|
5390
5657
|
issues.map((issue, i) => {
|
|
5391
5658
|
const tone = severityTone(issue.severity);
|
|
5392
|
-
return /* @__PURE__ */ (0,
|
|
5659
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5393
5660
|
"div",
|
|
5394
5661
|
{
|
|
5395
5662
|
style: {
|
|
@@ -5400,8 +5667,8 @@ function IssuesList({
|
|
|
5400
5667
|
fontSize: 12
|
|
5401
5668
|
},
|
|
5402
5669
|
children: [
|
|
5403
|
-
/* @__PURE__ */ (0,
|
|
5404
|
-
/* @__PURE__ */ (0,
|
|
5670
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: issue.code }),
|
|
5671
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: issue.message })
|
|
5405
5672
|
]
|
|
5406
5673
|
},
|
|
5407
5674
|
`${issue.code}-${i}`
|
|
@@ -5413,15 +5680,15 @@ function JsonPreview({
|
|
|
5413
5680
|
document: doc,
|
|
5414
5681
|
resolved
|
|
5415
5682
|
}) {
|
|
5416
|
-
const json = (0,
|
|
5417
|
-
if (!resolved) return (0,
|
|
5683
|
+
const json = (0, import_react16.useMemo)(() => {
|
|
5684
|
+
if (!resolved) return (0, import_workflow_core8.serializeEditorDocument)(doc);
|
|
5418
5685
|
if (resolved.kind === "workflow") return JSON.stringify(resolved.workflow, null, 2);
|
|
5419
5686
|
if (resolved.kind === "state") return JSON.stringify(resolved.state, null, 2);
|
|
5420
5687
|
if (resolved.kind === "transition") return JSON.stringify(resolved.transition, null, 2);
|
|
5421
5688
|
if (resolved.kind === "processor") return JSON.stringify(resolved.processor, null, 2);
|
|
5422
5689
|
return "";
|
|
5423
5690
|
}, [doc, resolved]);
|
|
5424
|
-
return /* @__PURE__ */ (0,
|
|
5691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5425
5692
|
"pre",
|
|
5426
5693
|
{
|
|
5427
5694
|
style: {
|
|
@@ -5444,7 +5711,7 @@ function JsonPreview({
|
|
|
5444
5711
|
}
|
|
5445
5712
|
|
|
5446
5713
|
// src/toolbar/Toolbar.tsx
|
|
5447
|
-
var
|
|
5714
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
5448
5715
|
function Toolbar({
|
|
5449
5716
|
derived,
|
|
5450
5717
|
readOnly,
|
|
@@ -5458,7 +5725,7 @@ function Toolbar({
|
|
|
5458
5725
|
toolbarEnd
|
|
5459
5726
|
}) {
|
|
5460
5727
|
const messages = useMessages();
|
|
5461
|
-
return /* @__PURE__ */ (0,
|
|
5728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5462
5729
|
"footer",
|
|
5463
5730
|
{
|
|
5464
5731
|
style: {
|
|
@@ -5473,11 +5740,11 @@ function Toolbar({
|
|
|
5473
5740
|
},
|
|
5474
5741
|
"data-testid": "toolbar",
|
|
5475
5742
|
children: [
|
|
5476
|
-
toolbarStart && /* @__PURE__ */ (0,
|
|
5477
|
-
toolbarCenter && /* @__PURE__ */ (0,
|
|
5478
|
-
!toolbarCenter && /* @__PURE__ */ (0,
|
|
5479
|
-
/* @__PURE__ */ (0,
|
|
5480
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
5481
5748
|
ValidationPill,
|
|
5482
5749
|
{
|
|
5483
5750
|
severity: "error",
|
|
@@ -5489,7 +5756,7 @@ function Toolbar({
|
|
|
5489
5756
|
testId: "toolbar-errors"
|
|
5490
5757
|
}
|
|
5491
5758
|
),
|
|
5492
|
-
/* @__PURE__ */ (0,
|
|
5759
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5493
5760
|
ValidationPill,
|
|
5494
5761
|
{
|
|
5495
5762
|
severity: "warning",
|
|
@@ -5501,7 +5768,7 @@ function Toolbar({
|
|
|
5501
5768
|
testId: "toolbar-warnings"
|
|
5502
5769
|
}
|
|
5503
5770
|
),
|
|
5504
|
-
/* @__PURE__ */ (0,
|
|
5771
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5505
5772
|
ValidationPill,
|
|
5506
5773
|
{
|
|
5507
5774
|
severity: "info",
|
|
@@ -5514,7 +5781,7 @@ function Toolbar({
|
|
|
5514
5781
|
}
|
|
5515
5782
|
)
|
|
5516
5783
|
] }),
|
|
5517
|
-
onSave && showSaveButton && /* @__PURE__ */ (0,
|
|
5784
|
+
onSave && showSaveButton && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5518
5785
|
"button",
|
|
5519
5786
|
{
|
|
5520
5787
|
type: "button",
|
|
@@ -5525,7 +5792,7 @@ function Toolbar({
|
|
|
5525
5792
|
children: messages.toolbar.save
|
|
5526
5793
|
}
|
|
5527
5794
|
),
|
|
5528
|
-
toolbarEnd && /* @__PURE__ */ (0,
|
|
5795
|
+
toolbarEnd && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: slotStyle, "data-testid": "toolbar-end", children: toolbarEnd })
|
|
5529
5796
|
]
|
|
5530
5797
|
}
|
|
5531
5798
|
);
|
|
@@ -5547,7 +5814,7 @@ function ValidationPill({
|
|
|
5547
5814
|
const tone = severityTone(severity);
|
|
5548
5815
|
const interactive = count > 0 && !!onClick;
|
|
5549
5816
|
const hasIssues = count > 0;
|
|
5550
|
-
return /* @__PURE__ */ (0,
|
|
5817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5551
5818
|
"button",
|
|
5552
5819
|
{
|
|
5553
5820
|
type: "button",
|
|
@@ -5574,7 +5841,7 @@ function ValidationPill({
|
|
|
5574
5841
|
height: 20
|
|
5575
5842
|
},
|
|
5576
5843
|
children: [
|
|
5577
|
-
/* @__PURE__ */ (0,
|
|
5844
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: severity === "info" ? 14 : 10, lineHeight: 1 }, children: SEVERITY_ICON[severity] }),
|
|
5578
5845
|
count
|
|
5579
5846
|
]
|
|
5580
5847
|
}
|
|
@@ -5598,8 +5865,8 @@ var slotStyle = {
|
|
|
5598
5865
|
};
|
|
5599
5866
|
|
|
5600
5867
|
// src/toolbar/IssuesDrawer.tsx
|
|
5601
|
-
var
|
|
5602
|
-
var
|
|
5868
|
+
var import_react17 = require("react");
|
|
5869
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
5603
5870
|
function resolveTarget(doc, targetId) {
|
|
5604
5871
|
if (!targetId) return null;
|
|
5605
5872
|
const ids = doc.meta.ids;
|
|
@@ -5652,8 +5919,8 @@ function IssuesDrawer({
|
|
|
5652
5919
|
onJumpTo
|
|
5653
5920
|
}) {
|
|
5654
5921
|
const messages = useMessages();
|
|
5655
|
-
const ref = (0,
|
|
5656
|
-
(0,
|
|
5922
|
+
const ref = (0, import_react17.useRef)(null);
|
|
5923
|
+
(0, import_react17.useEffect)(() => {
|
|
5657
5924
|
if (!open) return;
|
|
5658
5925
|
function onKey(e) {
|
|
5659
5926
|
if (e.key === "Escape") {
|
|
@@ -5677,18 +5944,18 @@ function IssuesDrawer({
|
|
|
5677
5944
|
window.removeEventListener("mousedown", onClick);
|
|
5678
5945
|
};
|
|
5679
5946
|
}, [open, onClose]);
|
|
5680
|
-
const filtered = (0,
|
|
5947
|
+
const filtered = (0, import_react17.useMemo)(
|
|
5681
5948
|
() => issues.filter((i) => i.severity === severity),
|
|
5682
5949
|
[issues, severity]
|
|
5683
5950
|
);
|
|
5684
|
-
const title = (0,
|
|
5951
|
+
const title = (0, import_react17.useMemo)(() => {
|
|
5685
5952
|
if (severity === "error") return messages.issues.errors;
|
|
5686
5953
|
if (severity === "warning") return messages.issues.warnings;
|
|
5687
5954
|
return messages.issues.infos;
|
|
5688
5955
|
}, [severity, messages]);
|
|
5689
5956
|
const tone = severityTone(severity);
|
|
5690
5957
|
if (!open) return null;
|
|
5691
|
-
return /* @__PURE__ */ (0,
|
|
5958
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
5692
5959
|
"div",
|
|
5693
5960
|
{
|
|
5694
5961
|
ref,
|
|
@@ -5712,7 +5979,7 @@ function IssuesDrawer({
|
|
|
5712
5979
|
flexDirection: "column"
|
|
5713
5980
|
},
|
|
5714
5981
|
children: [
|
|
5715
|
-
/* @__PURE__ */ (0,
|
|
5982
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
5716
5983
|
"header",
|
|
5717
5984
|
{
|
|
5718
5985
|
style: {
|
|
@@ -5723,7 +5990,7 @@ function IssuesDrawer({
|
|
|
5723
5990
|
gap: 8
|
|
5724
5991
|
},
|
|
5725
5992
|
children: [
|
|
5726
|
-
/* @__PURE__ */ (0,
|
|
5993
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5727
5994
|
"span",
|
|
5728
5995
|
{
|
|
5729
5996
|
style: {
|
|
@@ -5736,12 +6003,12 @@ function IssuesDrawer({
|
|
|
5736
6003
|
"aria-hidden": true
|
|
5737
6004
|
}
|
|
5738
6005
|
),
|
|
5739
|
-
/* @__PURE__ */ (0,
|
|
6006
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("strong", { style: { flex: 1, fontSize: 13, color: colors.textPrimary }, children: [
|
|
5740
6007
|
title,
|
|
5741
6008
|
" \xB7 ",
|
|
5742
6009
|
filtered.length
|
|
5743
6010
|
] }),
|
|
5744
|
-
/* @__PURE__ */ (0,
|
|
6011
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5745
6012
|
"button",
|
|
5746
6013
|
{
|
|
5747
6014
|
type: "button",
|
|
@@ -5764,14 +6031,14 @@ function IssuesDrawer({
|
|
|
5764
6031
|
]
|
|
5765
6032
|
}
|
|
5766
6033
|
),
|
|
5767
|
-
filtered.length === 0 ? /* @__PURE__ */ (0,
|
|
6034
|
+
filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5768
6035
|
"p",
|
|
5769
6036
|
{
|
|
5770
6037
|
style: { padding: 12, color: colors.textTertiary, fontSize: 12, margin: 0 },
|
|
5771
6038
|
"data-testid": "issues-drawer-empty",
|
|
5772
6039
|
children: messages.issues.none
|
|
5773
6040
|
}
|
|
5774
|
-
) : /* @__PURE__ */ (0,
|
|
6041
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5775
6042
|
"ul",
|
|
5776
6043
|
{
|
|
5777
6044
|
style: {
|
|
@@ -5785,7 +6052,7 @@ function IssuesDrawer({
|
|
|
5785
6052
|
children: filtered.map((issue, idx) => {
|
|
5786
6053
|
const target = resolveTarget(doc, issue.targetId);
|
|
5787
6054
|
const targetLabel = target ? target.kind === "transition" ? `${messages.issues.relatedTransition}: ${target.label}` : target.kind === "state" ? `${messages.issues.relatedState}: ${target.label}` : target.label : null;
|
|
5788
|
-
return /* @__PURE__ */ (0,
|
|
6055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
5789
6056
|
"li",
|
|
5790
6057
|
{
|
|
5791
6058
|
style: {
|
|
@@ -5799,10 +6066,10 @@ function IssuesDrawer({
|
|
|
5799
6066
|
},
|
|
5800
6067
|
"data-testid": `issues-drawer-item-${idx}`,
|
|
5801
6068
|
children: [
|
|
5802
|
-
/* @__PURE__ */ (0,
|
|
5803
|
-
/* @__PURE__ */ (0,
|
|
5804
|
-
targetLabel && /* @__PURE__ */ (0,
|
|
5805
|
-
target && /* @__PURE__ */ (0,
|
|
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)(
|
|
5806
6073
|
"button",
|
|
5807
6074
|
{
|
|
5808
6075
|
type: "button",
|
|
@@ -5837,23 +6104,23 @@ function IssuesDrawer({
|
|
|
5837
6104
|
}
|
|
5838
6105
|
|
|
5839
6106
|
// src/toolbar/WorkflowTabs.tsx
|
|
5840
|
-
var
|
|
6107
|
+
var import_react19 = require("react");
|
|
5841
6108
|
|
|
5842
6109
|
// src/toolbar/VersionBadge.tsx
|
|
5843
|
-
var
|
|
6110
|
+
var import_react18 = require("react");
|
|
5844
6111
|
var import_react_dom2 = require("react-dom");
|
|
5845
|
-
var
|
|
6112
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
5846
6113
|
function VersionBadge({
|
|
5847
6114
|
version,
|
|
5848
6115
|
supportedVersions,
|
|
5849
6116
|
readOnly = false,
|
|
5850
6117
|
onVersionChange
|
|
5851
6118
|
}) {
|
|
5852
|
-
const [open, setOpen] = (0,
|
|
5853
|
-
const [dropdownPos, setDropdownPos] = (0,
|
|
5854
|
-
const buttonRef = (0,
|
|
5855
|
-
const dropdownRef = (0,
|
|
5856
|
-
(0,
|
|
6119
|
+
const [open, setOpen] = (0, import_react18.useState)(false);
|
|
6120
|
+
const [dropdownPos, setDropdownPos] = (0, import_react18.useState)(null);
|
|
6121
|
+
const buttonRef = (0, import_react18.useRef)(null);
|
|
6122
|
+
const dropdownRef = (0, import_react18.useRef)(null);
|
|
6123
|
+
(0, import_react18.useEffect)(() => {
|
|
5857
6124
|
if (!open) return;
|
|
5858
6125
|
const handler = (e) => {
|
|
5859
6126
|
const target = e.target;
|
|
@@ -5875,7 +6142,7 @@ function VersionBadge({
|
|
|
5875
6142
|
setOpen((o) => !o);
|
|
5876
6143
|
};
|
|
5877
6144
|
if (readOnly) {
|
|
5878
|
-
return /* @__PURE__ */ (0,
|
|
6145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
5879
6146
|
"div",
|
|
5880
6147
|
{
|
|
5881
6148
|
"data-testid": "version-badge",
|
|
@@ -5894,7 +6161,7 @@ function VersionBadge({
|
|
|
5894
6161
|
);
|
|
5895
6162
|
}
|
|
5896
6163
|
const dropdown = open && dropdownPos ? (0, import_react_dom2.createPortal)(
|
|
5897
|
-
/* @__PURE__ */ (0,
|
|
6164
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
5898
6165
|
"div",
|
|
5899
6166
|
{
|
|
5900
6167
|
ref: dropdownRef,
|
|
@@ -5913,7 +6180,7 @@ function VersionBadge({
|
|
|
5913
6180
|
zIndex: 9999
|
|
5914
6181
|
},
|
|
5915
6182
|
children: [
|
|
5916
|
-
/* @__PURE__ */ (0,
|
|
6183
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
5917
6184
|
"div",
|
|
5918
6185
|
{
|
|
5919
6186
|
style: {
|
|
@@ -5930,7 +6197,7 @@ function VersionBadge({
|
|
|
5930
6197
|
),
|
|
5931
6198
|
[...supportedVersions].reverse().map((v) => {
|
|
5932
6199
|
const isCurrent = v === version.replace(/^v/, "");
|
|
5933
|
-
return /* @__PURE__ */ (0,
|
|
6200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
5934
6201
|
"button",
|
|
5935
6202
|
{
|
|
5936
6203
|
type: "button",
|
|
@@ -5953,16 +6220,16 @@ function VersionBadge({
|
|
|
5953
6220
|
textAlign: "left"
|
|
5954
6221
|
},
|
|
5955
6222
|
children: [
|
|
5956
|
-
/* @__PURE__ */ (0,
|
|
6223
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { children: [
|
|
5957
6224
|
v,
|
|
5958
6225
|
" ",
|
|
5959
|
-
/* @__PURE__ */ (0,
|
|
6226
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { style: { fontSize: 11, color: isCurrent ? "#93C5FD" : "#94A3B8" }, children: [
|
|
5960
6227
|
"cyoda-go ",
|
|
5961
6228
|
v,
|
|
5962
6229
|
".x"
|
|
5963
6230
|
] })
|
|
5964
6231
|
] }),
|
|
5965
|
-
isCurrent && /* @__PURE__ */ (0,
|
|
6232
|
+
isCurrent && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
5966
6233
|
"span",
|
|
5967
6234
|
{
|
|
5968
6235
|
style: {
|
|
@@ -5986,8 +6253,8 @@ function VersionBadge({
|
|
|
5986
6253
|
),
|
|
5987
6254
|
document.body
|
|
5988
6255
|
) : null;
|
|
5989
|
-
return /* @__PURE__ */ (0,
|
|
5990
|
-
/* @__PURE__ */ (0,
|
|
6256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
6257
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
5991
6258
|
"button",
|
|
5992
6259
|
{
|
|
5993
6260
|
ref: buttonRef,
|
|
@@ -6010,7 +6277,7 @@ function VersionBadge({
|
|
|
6010
6277
|
},
|
|
6011
6278
|
children: [
|
|
6012
6279
|
version,
|
|
6013
|
-
/* @__PURE__ */ (0,
|
|
6280
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { style: { fontSize: 10, opacity: 0.7 }, children: open ? "\u25B4" : "\u25BE" })
|
|
6014
6281
|
]
|
|
6015
6282
|
}
|
|
6016
6283
|
),
|
|
@@ -6019,7 +6286,7 @@ function VersionBadge({
|
|
|
6019
6286
|
}
|
|
6020
6287
|
|
|
6021
6288
|
// src/toolbar/WorkflowTabs.tsx
|
|
6022
|
-
var
|
|
6289
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
6023
6290
|
function WorkflowTabs({
|
|
6024
6291
|
workflows,
|
|
6025
6292
|
activeWorkflow,
|
|
@@ -6033,10 +6300,10 @@ function WorkflowTabs({
|
|
|
6033
6300
|
onVersionChange
|
|
6034
6301
|
}) {
|
|
6035
6302
|
const messages = useMessages();
|
|
6036
|
-
const [editingTab, setEditingTab] = (0,
|
|
6037
|
-
const [draftName, setDraftName] = (0,
|
|
6038
|
-
const inputRef = (0,
|
|
6039
|
-
(0,
|
|
6303
|
+
const [editingTab, setEditingTab] = (0, import_react19.useState)(null);
|
|
6304
|
+
const [draftName, setDraftName] = (0, import_react19.useState)("");
|
|
6305
|
+
const inputRef = (0, import_react19.useRef)(null);
|
|
6306
|
+
(0, import_react19.useEffect)(() => {
|
|
6040
6307
|
if (editingTab !== null) inputRef.current?.select();
|
|
6041
6308
|
}, [editingTab]);
|
|
6042
6309
|
const startEditing = (name) => {
|
|
@@ -6056,7 +6323,7 @@ function WorkflowTabs({
|
|
|
6056
6323
|
setEditingTab(null);
|
|
6057
6324
|
};
|
|
6058
6325
|
const cancelEdit = () => setEditingTab(null);
|
|
6059
|
-
return /* @__PURE__ */ (0,
|
|
6326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
6060
6327
|
"nav",
|
|
6061
6328
|
{
|
|
6062
6329
|
style: {
|
|
@@ -6074,7 +6341,7 @@ function WorkflowTabs({
|
|
|
6074
6341
|
workflows.map((w) => {
|
|
6075
6342
|
const active = w.name === activeWorkflow;
|
|
6076
6343
|
const isEditing = editingTab === w.name;
|
|
6077
|
-
return /* @__PURE__ */ (0,
|
|
6344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
6078
6345
|
"div",
|
|
6079
6346
|
{
|
|
6080
6347
|
style: {
|
|
@@ -6085,7 +6352,7 @@ function WorkflowTabs({
|
|
|
6085
6352
|
background: active ? "white" : "transparent"
|
|
6086
6353
|
},
|
|
6087
6354
|
children: [
|
|
6088
|
-
isEditing ? /* @__PURE__ */ (0,
|
|
6355
|
+
isEditing ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
6089
6356
|
"input",
|
|
6090
6357
|
{
|
|
6091
6358
|
ref: inputRef,
|
|
@@ -6116,7 +6383,7 @@ function WorkflowTabs({
|
|
|
6116
6383
|
width: Math.max(60, draftName.length * 8)
|
|
6117
6384
|
}
|
|
6118
6385
|
}
|
|
6119
|
-
) : /* @__PURE__ */ (0,
|
|
6386
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
6120
6387
|
"button",
|
|
6121
6388
|
{
|
|
6122
6389
|
type: "button",
|
|
@@ -6135,7 +6402,7 @@ function WorkflowTabs({
|
|
|
6135
6402
|
children: w.name || messages.tabs.untitled
|
|
6136
6403
|
}
|
|
6137
6404
|
),
|
|
6138
|
-
onClose && !readOnly && workflows.length > 1 && !isEditing && /* @__PURE__ */ (0,
|
|
6405
|
+
onClose && !readOnly && workflows.length > 1 && !isEditing && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
6139
6406
|
"button",
|
|
6140
6407
|
{
|
|
6141
6408
|
type: "button",
|
|
@@ -6158,7 +6425,7 @@ function WorkflowTabs({
|
|
|
6158
6425
|
w.name
|
|
6159
6426
|
);
|
|
6160
6427
|
}),
|
|
6161
|
-
onAdd && !readOnly && /* @__PURE__ */ (0,
|
|
6428
|
+
onAdd && !readOnly && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
6162
6429
|
"button",
|
|
6163
6430
|
{
|
|
6164
6431
|
type: "button",
|
|
@@ -6183,9 +6450,9 @@ function WorkflowTabs({
|
|
|
6183
6450
|
]
|
|
6184
6451
|
}
|
|
6185
6452
|
),
|
|
6186
|
-
dialectVersion && /* @__PURE__ */ (0,
|
|
6187
|
-
/* @__PURE__ */ (0,
|
|
6188
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
6189
6456
|
VersionBadge,
|
|
6190
6457
|
{
|
|
6191
6458
|
version: dialectVersion,
|
|
@@ -6201,9 +6468,9 @@ function WorkflowTabs({
|
|
|
6201
6468
|
}
|
|
6202
6469
|
|
|
6203
6470
|
// src/modals/DragConnectModal.tsx
|
|
6204
|
-
var
|
|
6205
|
-
var
|
|
6206
|
-
var
|
|
6471
|
+
var import_react20 = require("react");
|
|
6472
|
+
var import_workflow_core9 = require("@cyoda/workflow-core");
|
|
6473
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
6207
6474
|
function generateDefault(toState, existing) {
|
|
6208
6475
|
const base = `to_${toState}`;
|
|
6209
6476
|
if (!existing.has(base)) return base;
|
|
@@ -6220,20 +6487,20 @@ function DragConnectModal({
|
|
|
6220
6487
|
}) {
|
|
6221
6488
|
const messages = useMessages();
|
|
6222
6489
|
const existing = new Set(source.transitions.map((t) => t.name));
|
|
6223
|
-
const [name, setName] = (0,
|
|
6224
|
-
const invalidFormat = !!name && !
|
|
6490
|
+
const [name, setName] = (0, import_react20.useState)(() => generateDefault(toState, existing));
|
|
6491
|
+
const invalidFormat = !!name && !import_workflow_core9.NAME_REGEX.test(name);
|
|
6225
6492
|
const duplicate = existing.has(name);
|
|
6226
6493
|
const blocked = name.length === 0 || invalidFormat || duplicate;
|
|
6227
|
-
return /* @__PURE__ */ (0,
|
|
6228
|
-
/* @__PURE__ */ (0,
|
|
6229
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
6230
6497
|
fromState,
|
|
6231
6498
|
" \u2192 ",
|
|
6232
6499
|
toState
|
|
6233
6500
|
] }),
|
|
6234
|
-
/* @__PURE__ */ (0,
|
|
6235
|
-
/* @__PURE__ */ (0,
|
|
6236
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
6237
6504
|
"input",
|
|
6238
6505
|
{
|
|
6239
6506
|
type: "text",
|
|
@@ -6253,17 +6520,17 @@ function DragConnectModal({
|
|
|
6253
6520
|
}
|
|
6254
6521
|
)
|
|
6255
6522
|
] }),
|
|
6256
|
-
invalidFormat && /* @__PURE__ */ (0,
|
|
6257
|
-
duplicate && /* @__PURE__ */ (0,
|
|
6258
|
-
/* @__PURE__ */ (0,
|
|
6259
|
-
/* @__PURE__ */ (0,
|
|
6260
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
6261
6528
|
"button",
|
|
6262
6529
|
{
|
|
6263
6530
|
type: "button",
|
|
6264
6531
|
onClick: () => !blocked && onCreate(name),
|
|
6265
6532
|
disabled: blocked,
|
|
6266
|
-
style:
|
|
6533
|
+
style: primaryBtn4,
|
|
6267
6534
|
"data-testid": "dragconnect-create",
|
|
6268
6535
|
children: messages.dragConnect.create
|
|
6269
6536
|
}
|
|
@@ -6276,7 +6543,7 @@ var errorMsg = {
|
|
|
6276
6543
|
fontSize: 12,
|
|
6277
6544
|
color: colors.danger
|
|
6278
6545
|
};
|
|
6279
|
-
var
|
|
6546
|
+
var ghostBtn7 = {
|
|
6280
6547
|
padding: "6px 12px",
|
|
6281
6548
|
background: "white",
|
|
6282
6549
|
border: `1px solid ${colors.border}`,
|
|
@@ -6284,33 +6551,33 @@ var ghostBtn6 = {
|
|
|
6284
6551
|
fontSize: 13,
|
|
6285
6552
|
cursor: "pointer"
|
|
6286
6553
|
};
|
|
6287
|
-
var
|
|
6288
|
-
...
|
|
6554
|
+
var primaryBtn4 = {
|
|
6555
|
+
...ghostBtn7,
|
|
6289
6556
|
background: colors.primary,
|
|
6290
6557
|
color: "white",
|
|
6291
6558
|
borderColor: colors.primary
|
|
6292
6559
|
};
|
|
6293
6560
|
|
|
6294
6561
|
// src/modals/AddStateModal.tsx
|
|
6295
|
-
var
|
|
6296
|
-
var
|
|
6297
|
-
var
|
|
6562
|
+
var import_react21 = require("react");
|
|
6563
|
+
var import_workflow_core10 = require("@cyoda/workflow-core");
|
|
6564
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
6298
6565
|
function generateName(existing) {
|
|
6299
6566
|
let n = 1;
|
|
6300
6567
|
while (existing.includes(`state${n}`)) n++;
|
|
6301
6568
|
return `state${n}`;
|
|
6302
6569
|
}
|
|
6303
6570
|
function AddStateModal({ existingNames, onCreate, onCancel }) {
|
|
6304
|
-
const [name, setName] = (0,
|
|
6305
|
-
const [error, setError] = (0,
|
|
6306
|
-
const inputRef = (0,
|
|
6307
|
-
(0,
|
|
6571
|
+
const [name, setName] = (0, import_react21.useState)(() => generateName(existingNames));
|
|
6572
|
+
const [error, setError] = (0, import_react21.useState)(null);
|
|
6573
|
+
const inputRef = (0, import_react21.useRef)(null);
|
|
6574
|
+
(0, import_react21.useEffect)(() => {
|
|
6308
6575
|
inputRef.current?.select();
|
|
6309
6576
|
}, []);
|
|
6310
6577
|
const validate = (v) => {
|
|
6311
6578
|
const trimmed = v.trim();
|
|
6312
6579
|
if (!trimmed) return "Name is required";
|
|
6313
|
-
if (!
|
|
6580
|
+
if (!import_workflow_core10.NAME_REGEX.test(trimmed)) return "Must start with a letter and contain only letters, numbers, and underscores";
|
|
6314
6581
|
if (existingNames.includes(trimmed)) return `State "${trimmed}" already exists`;
|
|
6315
6582
|
return null;
|
|
6316
6583
|
};
|
|
@@ -6322,11 +6589,11 @@ function AddStateModal({ existingNames, onCreate, onCancel }) {
|
|
|
6322
6589
|
}
|
|
6323
6590
|
onCreate(name.trim());
|
|
6324
6591
|
};
|
|
6325
|
-
return /* @__PURE__ */ (0,
|
|
6326
|
-
/* @__PURE__ */ (0,
|
|
6327
|
-
/* @__PURE__ */ (0,
|
|
6328
|
-
/* @__PURE__ */ (0,
|
|
6329
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
6330
6597
|
"input",
|
|
6331
6598
|
{
|
|
6332
6599
|
ref: inputRef,
|
|
@@ -6352,7 +6619,7 @@ function AddStateModal({ existingNames, onCreate, onCancel }) {
|
|
|
6352
6619
|
}
|
|
6353
6620
|
}
|
|
6354
6621
|
),
|
|
6355
|
-
error && /* @__PURE__ */ (0,
|
|
6622
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
6356
6623
|
"div",
|
|
6357
6624
|
{
|
|
6358
6625
|
id: "add-state-error",
|
|
@@ -6362,23 +6629,23 @@ function AddStateModal({ existingNames, onCreate, onCancel }) {
|
|
|
6362
6629
|
}
|
|
6363
6630
|
)
|
|
6364
6631
|
] }),
|
|
6365
|
-
/* @__PURE__ */ (0,
|
|
6366
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
6367
6634
|
"button",
|
|
6368
6635
|
{
|
|
6369
6636
|
type: "button",
|
|
6370
6637
|
onClick: onCancel,
|
|
6371
|
-
style:
|
|
6638
|
+
style: ghostBtn8,
|
|
6372
6639
|
"data-testid": "add-state-cancel",
|
|
6373
6640
|
children: "Cancel"
|
|
6374
6641
|
}
|
|
6375
6642
|
),
|
|
6376
|
-
/* @__PURE__ */ (0,
|
|
6643
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
6377
6644
|
"button",
|
|
6378
6645
|
{
|
|
6379
6646
|
type: "button",
|
|
6380
6647
|
onClick: handleSubmit,
|
|
6381
|
-
style:
|
|
6648
|
+
style: primaryBtn5,
|
|
6382
6649
|
"data-testid": "add-state-confirm",
|
|
6383
6650
|
children: "Add State"
|
|
6384
6651
|
}
|
|
@@ -6386,7 +6653,7 @@ function AddStateModal({ existingNames, onCreate, onCancel }) {
|
|
|
6386
6653
|
] })
|
|
6387
6654
|
] });
|
|
6388
6655
|
}
|
|
6389
|
-
var
|
|
6656
|
+
var ghostBtn8 = {
|
|
6390
6657
|
padding: "6px 12px",
|
|
6391
6658
|
background: "white",
|
|
6392
6659
|
border: `1px solid ${colors.border}`,
|
|
@@ -6394,8 +6661,8 @@ var ghostBtn7 = {
|
|
|
6394
6661
|
fontSize: 13,
|
|
6395
6662
|
cursor: "pointer"
|
|
6396
6663
|
};
|
|
6397
|
-
var
|
|
6398
|
-
...
|
|
6664
|
+
var primaryBtn5 = {
|
|
6665
|
+
...ghostBtn8,
|
|
6399
6666
|
background: colors.primary,
|
|
6400
6667
|
color: "white",
|
|
6401
6668
|
borderColor: colors.primary
|
|
@@ -6403,15 +6670,15 @@ var primaryBtn4 = {
|
|
|
6403
6670
|
|
|
6404
6671
|
// src/modals/HelpModal.tsx
|
|
6405
6672
|
var import_theme6 = require("@cyoda/workflow-viewer/theme");
|
|
6406
|
-
var
|
|
6673
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
6407
6674
|
function HelpModal({ onCancel }) {
|
|
6408
6675
|
const messages = useMessages();
|
|
6409
6676
|
const h = messages.help;
|
|
6410
6677
|
const node = import_theme6.workflowPalette.node;
|
|
6411
6678
|
const edge = import_theme6.workflowPalette.edge;
|
|
6412
|
-
return /* @__PURE__ */ (0,
|
|
6413
|
-
/* @__PURE__ */ (0,
|
|
6414
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
6415
6682
|
"div",
|
|
6416
6683
|
{
|
|
6417
6684
|
style: {
|
|
@@ -6424,48 +6691,48 @@ function HelpModal({ onCancel }) {
|
|
|
6424
6691
|
gap: 16
|
|
6425
6692
|
},
|
|
6426
6693
|
children: [
|
|
6427
|
-
/* @__PURE__ */ (0,
|
|
6428
|
-
/* @__PURE__ */ (0,
|
|
6429
|
-
/* @__PURE__ */ (0,
|
|
6430
|
-
/* @__PURE__ */ (0,
|
|
6431
|
-
/* @__PURE__ */ (0,
|
|
6432
|
-
/* @__PURE__ */ (0,
|
|
6433
|
-
/* @__PURE__ */ (0,
|
|
6434
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
6435
6702
|
] }),
|
|
6436
|
-
/* @__PURE__ */ (0,
|
|
6437
|
-
/* @__PURE__ */ (0,
|
|
6438
|
-
/* @__PURE__ */ (0,
|
|
6439
|
-
/* @__PURE__ */ (0,
|
|
6440
|
-
/* @__PURE__ */ (0,
|
|
6441
|
-
/* @__PURE__ */ (0,
|
|
6442
|
-
/* @__PURE__ */ (0,
|
|
6443
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
6444
6711
|
] }),
|
|
6445
|
-
/* @__PURE__ */ (0,
|
|
6446
|
-
/* @__PURE__ */ (0,
|
|
6447
|
-
/* @__PURE__ */ (0,
|
|
6448
|
-
/* @__PURE__ */ (0,
|
|
6449
|
-
/* @__PURE__ */ (0,
|
|
6450
|
-
/* @__PURE__ */ (0,
|
|
6451
|
-
/* @__PURE__ */ (0,
|
|
6452
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
6453
6720
|
] }),
|
|
6454
|
-
/* @__PURE__ */ (0,
|
|
6455
|
-
/* @__PURE__ */ (0,
|
|
6456
|
-
/* @__PURE__ */ (0,
|
|
6457
|
-
/* @__PURE__ */ (0,
|
|
6458
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
6459
6726
|
] }) })
|
|
6460
6727
|
]
|
|
6461
6728
|
}
|
|
6462
6729
|
),
|
|
6463
|
-
/* @__PURE__ */ (0,
|
|
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 }) })
|
|
6464
6731
|
] }) });
|
|
6465
6732
|
}
|
|
6466
6733
|
function Section({ title, children }) {
|
|
6467
|
-
return /* @__PURE__ */ (0,
|
|
6468
|
-
/* @__PURE__ */ (0,
|
|
6734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
|
|
6735
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
6469
6736
|
"h3",
|
|
6470
6737
|
{
|
|
6471
6738
|
style: {
|
|
@@ -6479,12 +6746,12 @@ function Section({ title, children }) {
|
|
|
6479
6746
|
children: title
|
|
6480
6747
|
}
|
|
6481
6748
|
),
|
|
6482
|
-
/* @__PURE__ */ (0,
|
|
6749
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children })
|
|
6483
6750
|
] });
|
|
6484
6751
|
}
|
|
6485
6752
|
function ColorRow({ fill, border, label }) {
|
|
6486
|
-
return /* @__PURE__ */ (0,
|
|
6487
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
6488
6755
|
"span",
|
|
6489
6756
|
{
|
|
6490
6757
|
style: {
|
|
@@ -6497,12 +6764,12 @@ function ColorRow({ fill, border, label }) {
|
|
|
6497
6764
|
}
|
|
6498
6765
|
}
|
|
6499
6766
|
),
|
|
6500
|
-
/* @__PURE__ */ (0,
|
|
6767
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: label })
|
|
6501
6768
|
] });
|
|
6502
6769
|
}
|
|
6503
6770
|
function LineRow({ color, label, dashed }) {
|
|
6504
|
-
return /* @__PURE__ */ (0,
|
|
6505
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
6506
6773
|
"line",
|
|
6507
6774
|
{
|
|
6508
6775
|
x1: "2",
|
|
@@ -6515,12 +6782,12 @@ function LineRow({ color, label, dashed }) {
|
|
|
6515
6782
|
...dashed ? { strokeDasharray: "3 3" } : {}
|
|
6516
6783
|
}
|
|
6517
6784
|
) }),
|
|
6518
|
-
/* @__PURE__ */ (0,
|
|
6785
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: label })
|
|
6519
6786
|
] });
|
|
6520
6787
|
}
|
|
6521
6788
|
function ShortcutRow({ keys, label }) {
|
|
6522
|
-
return /* @__PURE__ */ (0,
|
|
6523
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
6524
6791
|
"kbd",
|
|
6525
6792
|
{
|
|
6526
6793
|
style: {
|
|
@@ -6540,12 +6807,12 @@ function ShortcutRow({ keys, label }) {
|
|
|
6540
6807
|
children: keys
|
|
6541
6808
|
}
|
|
6542
6809
|
),
|
|
6543
|
-
/* @__PURE__ */ (0,
|
|
6810
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: label })
|
|
6544
6811
|
] });
|
|
6545
6812
|
}
|
|
6546
6813
|
|
|
6547
6814
|
// src/modals/VersionSwitchModal.tsx
|
|
6548
|
-
var
|
|
6815
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
6549
6816
|
function VersionSwitchModal({
|
|
6550
6817
|
fromVersion,
|
|
6551
6818
|
toVersion,
|
|
@@ -6553,7 +6820,7 @@ function VersionSwitchModal({
|
|
|
6553
6820
|
onConfirm,
|
|
6554
6821
|
onCancel
|
|
6555
6822
|
}) {
|
|
6556
|
-
return /* @__PURE__ */ (0,
|
|
6823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6557
6824
|
"div",
|
|
6558
6825
|
{
|
|
6559
6826
|
style: {
|
|
@@ -6565,7 +6832,7 @@ function VersionSwitchModal({
|
|
|
6565
6832
|
justifyContent: "center",
|
|
6566
6833
|
zIndex: 1e3
|
|
6567
6834
|
},
|
|
6568
|
-
children: /* @__PURE__ */ (0,
|
|
6835
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
6569
6836
|
"div",
|
|
6570
6837
|
{
|
|
6571
6838
|
"data-testid": "version-switch-modal",
|
|
@@ -6579,8 +6846,8 @@ function VersionSwitchModal({
|
|
|
6579
6846
|
fontFamily: "inherit"
|
|
6580
6847
|
},
|
|
6581
6848
|
children: [
|
|
6582
|
-
/* @__PURE__ */ (0,
|
|
6583
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
6584
6851
|
"div",
|
|
6585
6852
|
{
|
|
6586
6853
|
style: {
|
|
@@ -6597,20 +6864,20 @@ function VersionSwitchModal({
|
|
|
6597
6864
|
children: "\u26A0\uFE0F"
|
|
6598
6865
|
}
|
|
6599
6866
|
),
|
|
6600
|
-
/* @__PURE__ */ (0,
|
|
6601
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
6602
6869
|
"Switch to ",
|
|
6603
6870
|
toVersion,
|
|
6604
6871
|
"?"
|
|
6605
6872
|
] }),
|
|
6606
|
-
/* @__PURE__ */ (0,
|
|
6873
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { color: "#475569", lineHeight: 1.5, fontSize: 13 }, children: [
|
|
6607
6874
|
"Switching to ",
|
|
6608
6875
|
toVersion,
|
|
6609
6876
|
" will remove data not supported in that dialect:"
|
|
6610
6877
|
] })
|
|
6611
6878
|
] })
|
|
6612
6879
|
] }),
|
|
6613
|
-
/* @__PURE__ */ (0,
|
|
6880
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
6614
6881
|
"div",
|
|
6615
6882
|
{
|
|
6616
6883
|
style: {
|
|
@@ -6623,17 +6890,17 @@ function VersionSwitchModal({
|
|
|
6623
6890
|
fontSize: 12
|
|
6624
6891
|
},
|
|
6625
6892
|
children: [
|
|
6626
|
-
/* @__PURE__ */ (0,
|
|
6627
|
-
/* @__PURE__ */ (0,
|
|
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)) })
|
|
6628
6895
|
]
|
|
6629
6896
|
}
|
|
6630
6897
|
),
|
|
6631
|
-
/* @__PURE__ */ (0,
|
|
6898
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { padding: "10px 20px 0 64px", color: "#64748B", fontSize: 12, lineHeight: 1.5 }, children: [
|
|
6632
6899
|
"This cannot be undone. You can switch back to ",
|
|
6633
6900
|
fromVersion,
|
|
6634
6901
|
" any time, but the removed data will not be restored."
|
|
6635
6902
|
] }),
|
|
6636
|
-
/* @__PURE__ */ (0,
|
|
6903
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
6637
6904
|
"div",
|
|
6638
6905
|
{
|
|
6639
6906
|
style: {
|
|
@@ -6645,7 +6912,7 @@ function VersionSwitchModal({
|
|
|
6645
6912
|
marginTop: 16
|
|
6646
6913
|
},
|
|
6647
6914
|
children: [
|
|
6648
|
-
/* @__PURE__ */ (0,
|
|
6915
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
6649
6916
|
"button",
|
|
6650
6917
|
{
|
|
6651
6918
|
type: "button",
|
|
@@ -6663,7 +6930,7 @@ function VersionSwitchModal({
|
|
|
6663
6930
|
children: "Cancel"
|
|
6664
6931
|
}
|
|
6665
6932
|
),
|
|
6666
|
-
/* @__PURE__ */ (0,
|
|
6933
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
6667
6934
|
"button",
|
|
6668
6935
|
{
|
|
6669
6936
|
type: "button",
|
|
@@ -6697,17 +6964,17 @@ function VersionSwitchModal({
|
|
|
6697
6964
|
}
|
|
6698
6965
|
|
|
6699
6966
|
// src/components/CommentNode.tsx
|
|
6700
|
-
var
|
|
6701
|
-
var
|
|
6967
|
+
var import_react22 = require("react");
|
|
6968
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
6702
6969
|
function CommentNode({ comment, disabled, onUpdate, onRemove }) {
|
|
6703
|
-
const [editing, setEditing] = (0,
|
|
6704
|
-
const [draft, setDraft] = (0,
|
|
6705
|
-
const textareaRef = (0,
|
|
6970
|
+
const [editing, setEditing] = (0, import_react22.useState)(false);
|
|
6971
|
+
const [draft, setDraft] = (0, import_react22.useState)(comment.text);
|
|
6972
|
+
const textareaRef = (0, import_react22.useRef)(null);
|
|
6706
6973
|
const commitEdit = () => {
|
|
6707
6974
|
setEditing(false);
|
|
6708
6975
|
if (draft !== comment.text) onUpdate({ text: draft });
|
|
6709
6976
|
};
|
|
6710
|
-
return /* @__PURE__ */ (0,
|
|
6977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
6711
6978
|
"div",
|
|
6712
6979
|
{
|
|
6713
6980
|
"data-testid": `comment-${comment.id}`,
|
|
@@ -6728,8 +6995,8 @@ function CommentNode({ comment, disabled, onUpdate, onRemove }) {
|
|
|
6728
6995
|
userSelect: "none"
|
|
6729
6996
|
},
|
|
6730
6997
|
children: [
|
|
6731
|
-
/* @__PURE__ */ (0,
|
|
6732
|
-
!disabled && !editing && /* @__PURE__ */ (0,
|
|
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)(
|
|
6733
7000
|
"button",
|
|
6734
7001
|
{
|
|
6735
7002
|
type: "button",
|
|
@@ -6744,7 +7011,7 @@ function CommentNode({ comment, disabled, onUpdate, onRemove }) {
|
|
|
6744
7011
|
children: "\u270F\uFE0F"
|
|
6745
7012
|
}
|
|
6746
7013
|
),
|
|
6747
|
-
!disabled && /* @__PURE__ */ (0,
|
|
7014
|
+
!disabled && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
6748
7015
|
"button",
|
|
6749
7016
|
{
|
|
6750
7017
|
type: "button",
|
|
@@ -6756,7 +7023,7 @@ function CommentNode({ comment, disabled, onUpdate, onRemove }) {
|
|
|
6756
7023
|
}
|
|
6757
7024
|
)
|
|
6758
7025
|
] }),
|
|
6759
|
-
editing ? /* @__PURE__ */ (0,
|
|
7026
|
+
editing ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
6760
7027
|
"textarea",
|
|
6761
7028
|
{
|
|
6762
7029
|
ref: textareaRef,
|
|
@@ -6782,7 +7049,7 @@ function CommentNode({ comment, disabled, onUpdate, onRemove }) {
|
|
|
6782
7049
|
},
|
|
6783
7050
|
"data-testid": `comment-textarea-${comment.id}`
|
|
6784
7051
|
}
|
|
6785
|
-
) : /* @__PURE__ */ (0,
|
|
7052
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
6786
7053
|
"div",
|
|
6787
7054
|
{
|
|
6788
7055
|
onDoubleClick: () => {
|
|
@@ -6792,7 +7059,7 @@ function CommentNode({ comment, disabled, onUpdate, onRemove }) {
|
|
|
6792
7059
|
}
|
|
6793
7060
|
},
|
|
6794
7061
|
style: { whiteSpace: "pre-wrap", wordBreak: "break-word", minHeight: 20 },
|
|
6795
|
-
children: comment.text || /* @__PURE__ */ (0,
|
|
7062
|
+
children: comment.text || /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("em", { style: { color: "#94a3b8" }, children: "empty note" })
|
|
6796
7063
|
}
|
|
6797
7064
|
)
|
|
6798
7065
|
]
|
|
@@ -6810,9 +7077,9 @@ var iconBtn = {
|
|
|
6810
7077
|
};
|
|
6811
7078
|
|
|
6812
7079
|
// src/components/WorkflowJsonEditor.tsx
|
|
6813
|
-
var
|
|
7080
|
+
var import_react23 = require("react");
|
|
6814
7081
|
var import_workflow_monaco2 = require("@cyoda/workflow-monaco");
|
|
6815
|
-
var
|
|
7082
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
6816
7083
|
function WorkflowJsonEditor({
|
|
6817
7084
|
document: document2,
|
|
6818
7085
|
issues,
|
|
@@ -6824,20 +7091,20 @@ function WorkflowJsonEditor({
|
|
|
6824
7091
|
onSelectionChange,
|
|
6825
7092
|
onStatusChange
|
|
6826
7093
|
}) {
|
|
6827
|
-
const containerRef = (0,
|
|
6828
|
-
const documentRef = (0,
|
|
6829
|
-
const issuesRef = (0,
|
|
6830
|
-
const readOnlyRef = (0,
|
|
6831
|
-
const onPatchRef = (0,
|
|
6832
|
-
const onSelectionChangeRef = (0,
|
|
6833
|
-
const onStatusChangeRef = (0,
|
|
6834
|
-
const editorRef = (0,
|
|
6835
|
-
const controllerRef = (0,
|
|
6836
|
-
const schemaHandleRef = (0,
|
|
6837
|
-
const cursorBridgeRef = (0,
|
|
6838
|
-
const applyingGraphSelectionRef = (0,
|
|
6839
|
-
const visibleRef = (0,
|
|
6840
|
-
const [status, setStatus] = (0,
|
|
7094
|
+
const containerRef = (0, import_react23.useRef)(null);
|
|
7095
|
+
const documentRef = (0, import_react23.useRef)(document2);
|
|
7096
|
+
const issuesRef = (0, import_react23.useRef)(issues);
|
|
7097
|
+
const readOnlyRef = (0, import_react23.useRef)(readOnly);
|
|
7098
|
+
const onPatchRef = (0, import_react23.useRef)(onPatch);
|
|
7099
|
+
const onSelectionChangeRef = (0, import_react23.useRef)(onSelectionChange);
|
|
7100
|
+
const onStatusChangeRef = (0, import_react23.useRef)(onStatusChange);
|
|
7101
|
+
const editorRef = (0, import_react23.useRef)(null);
|
|
7102
|
+
const controllerRef = (0, import_react23.useRef)(null);
|
|
7103
|
+
const schemaHandleRef = (0, import_react23.useRef)(null);
|
|
7104
|
+
const cursorBridgeRef = (0, import_react23.useRef)(null);
|
|
7105
|
+
const applyingGraphSelectionRef = (0, import_react23.useRef)(false);
|
|
7106
|
+
const visibleRef = (0, import_react23.useRef)(visible);
|
|
7107
|
+
const [status, setStatus] = (0, import_react23.useState)({ status: "idle" });
|
|
6841
7108
|
documentRef.current = document2;
|
|
6842
7109
|
issuesRef.current = issues;
|
|
6843
7110
|
readOnlyRef.current = readOnly;
|
|
@@ -6845,7 +7112,7 @@ function WorkflowJsonEditor({
|
|
|
6845
7112
|
onPatchRef.current = onPatch;
|
|
6846
7113
|
onSelectionChangeRef.current = onSelectionChange;
|
|
6847
7114
|
onStatusChangeRef.current = onStatusChange;
|
|
6848
|
-
const selectedId = (0,
|
|
7115
|
+
const selectedId = (0, import_react23.useMemo)(
|
|
6849
7116
|
() => selectionToJsonId(document2, selection),
|
|
6850
7117
|
[document2, selection]
|
|
6851
7118
|
);
|
|
@@ -6853,7 +7120,7 @@ function WorkflowJsonEditor({
|
|
|
6853
7120
|
const modelUri = config?.modelUri;
|
|
6854
7121
|
const editorOptions = config?.editorOptions;
|
|
6855
7122
|
const debounceMs = config?.debounceMs;
|
|
6856
|
-
(0,
|
|
7123
|
+
(0, import_react23.useEffect)(() => {
|
|
6857
7124
|
if (!monaco || !containerRef.current || editorRef.current) return;
|
|
6858
7125
|
const model = monaco.editor.createModel(
|
|
6859
7126
|
"",
|
|
@@ -6908,7 +7175,7 @@ function WorkflowJsonEditor({
|
|
|
6908
7175
|
model.dispose();
|
|
6909
7176
|
};
|
|
6910
7177
|
}, [monaco, modelUri]);
|
|
6911
|
-
(0,
|
|
7178
|
+
(0, import_react23.useEffect)(() => {
|
|
6912
7179
|
const editor = editorRef.current;
|
|
6913
7180
|
const controller = controllerRef.current;
|
|
6914
7181
|
if (!editor || !controller || !config) return;
|
|
@@ -6916,17 +7183,17 @@ function WorkflowJsonEditor({
|
|
|
6916
7183
|
controller.syncFromDocument(document2);
|
|
6917
7184
|
controller.renderIssues(issues, document2);
|
|
6918
7185
|
}, [config, document2, issues, readOnly]);
|
|
6919
|
-
(0,
|
|
7186
|
+
(0, import_react23.useEffect)(() => {
|
|
6920
7187
|
if (!visible) return;
|
|
6921
7188
|
editorRef.current?.layout?.();
|
|
6922
7189
|
}, [visible]);
|
|
6923
|
-
(0,
|
|
7190
|
+
(0, import_react23.useEffect)(() => {
|
|
6924
7191
|
if (!config) {
|
|
6925
7192
|
setStatus({ status: "idle" });
|
|
6926
7193
|
onStatusChangeRef.current?.({ status: "idle" });
|
|
6927
7194
|
}
|
|
6928
7195
|
}, [config]);
|
|
6929
|
-
(0,
|
|
7196
|
+
(0, import_react23.useEffect)(() => {
|
|
6930
7197
|
const editor = editorRef.current;
|
|
6931
7198
|
if (!editor || !visible || !selectedId) return;
|
|
6932
7199
|
applyingGraphSelectionRef.current = true;
|
|
@@ -6937,7 +7204,7 @@ function WorkflowJsonEditor({
|
|
|
6937
7204
|
return () => window.clearTimeout(timeout);
|
|
6938
7205
|
}, [document2, selectedId, visible]);
|
|
6939
7206
|
if (!config) {
|
|
6940
|
-
return /* @__PURE__ */ (0,
|
|
7207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
6941
7208
|
"div",
|
|
6942
7209
|
{
|
|
6943
7210
|
"data-testid": "workflow-json-unavailable",
|
|
@@ -6952,11 +7219,11 @@ function WorkflowJsonEditor({
|
|
|
6952
7219
|
textAlign: "center",
|
|
6953
7220
|
background: "#F8FAFC"
|
|
6954
7221
|
},
|
|
6955
|
-
children: /* @__PURE__ */ (0,
|
|
7222
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(UnavailableMessage, {})
|
|
6956
7223
|
}
|
|
6957
7224
|
);
|
|
6958
7225
|
}
|
|
6959
|
-
return /* @__PURE__ */ (0,
|
|
7226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
6960
7227
|
"div",
|
|
6961
7228
|
{
|
|
6962
7229
|
"data-testid": "workflow-json-editor",
|
|
@@ -6968,8 +7235,8 @@ function WorkflowJsonEditor({
|
|
|
6968
7235
|
minHeight: 0
|
|
6969
7236
|
},
|
|
6970
7237
|
children: [
|
|
6971
|
-
/* @__PURE__ */ (0,
|
|
6972
|
-
/* @__PURE__ */ (0,
|
|
7238
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(JsonStatusBanner, { status }),
|
|
7239
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
6973
7240
|
"div",
|
|
6974
7241
|
{
|
|
6975
7242
|
ref: containerRef,
|
|
@@ -6982,7 +7249,7 @@ function WorkflowJsonEditor({
|
|
|
6982
7249
|
}
|
|
6983
7250
|
function UnavailableMessage() {
|
|
6984
7251
|
const messages = useMessages();
|
|
6985
|
-
return /* @__PURE__ */ (0,
|
|
7252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children: messages.editorView.unavailable });
|
|
6986
7253
|
}
|
|
6987
7254
|
function JsonStatusBanner({ status }) {
|
|
6988
7255
|
const messages = useMessages();
|
|
@@ -6991,7 +7258,7 @@ function JsonStatusBanner({ status }) {
|
|
|
6991
7258
|
}
|
|
6992
7259
|
const tone = status.status === "semantic-errors" ? { border: "#FCD34D", bg: "#FFFBEB", text: "#92400E" } : { border: "#FCA5A5", bg: "#FEF2F2", text: "#991B1B" };
|
|
6993
7260
|
const body = status.status === "semantic-errors" ? messages.editorView.semanticErrors : status.status === "invalid-schema" ? messages.editorView.invalidSchema : `${messages.editorView.invalidJson}${status.message ? ` ${status.message}` : ""}`;
|
|
6994
|
-
return /* @__PURE__ */ (0,
|
|
7261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
6995
7262
|
"div",
|
|
6996
7263
|
{
|
|
6997
7264
|
role: "status",
|
|
@@ -7035,7 +7302,7 @@ function selectionFromJsonId(doc, id) {
|
|
|
7035
7302
|
}
|
|
7036
7303
|
|
|
7037
7304
|
// src/components/WorkflowEditor.tsx
|
|
7038
|
-
var
|
|
7305
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
7039
7306
|
function hasPersistedWorkflowUi(meta) {
|
|
7040
7307
|
return !!meta && Object.values(meta).some((value) => value !== void 0);
|
|
7041
7308
|
}
|
|
@@ -7081,9 +7348,9 @@ function WorkflowEditor({
|
|
|
7081
7348
|
onJsonStatusChange,
|
|
7082
7349
|
developerMode = false
|
|
7083
7350
|
}) {
|
|
7084
|
-
const mergedMessages = (0,
|
|
7085
|
-
const editorConfig = (0,
|
|
7086
|
-
const initialDocumentWithLayout = (0,
|
|
7351
|
+
const mergedMessages = (0, import_react24.useMemo)(() => mergeMessages(messages), [messages]);
|
|
7352
|
+
const editorConfig = (0, import_react24.useMemo)(() => ({ developerMode }), [developerMode]);
|
|
7353
|
+
const initialDocumentWithLayout = (0, import_react24.useMemo)(() => {
|
|
7087
7354
|
if (localStorageKey === null) return initialDocument;
|
|
7088
7355
|
try {
|
|
7089
7356
|
const stored = localStorage.getItem(localStorageKey);
|
|
@@ -7102,36 +7369,36 @@ function WorkflowEditor({
|
|
|
7102
7369
|
}
|
|
7103
7370
|
}, []);
|
|
7104
7371
|
const [state, actions] = useEditorStore(initialDocumentWithLayout, mode);
|
|
7105
|
-
const [isFullscreen, setIsFullscreen] = (0,
|
|
7106
|
-
const [inspectorWidth, setInspectorWidth] = (0,
|
|
7107
|
-
const editorContainerRef = (0,
|
|
7108
|
-
const [pendingDelete, setPendingDelete] = (0,
|
|
7109
|
-
const [pendingConnect, setPendingConnect] = (0,
|
|
7110
|
-
const [pendingAddState, setPendingAddState] = (0,
|
|
7111
|
-
const [helpOpen, setHelpOpen] = (0,
|
|
7112
|
-
const [reconnectError, setReconnectError] = (0,
|
|
7113
|
-
const [layoutKey, setLayoutKey] = (0,
|
|
7114
|
-
const [activeSurface, setActiveSurface] = (0,
|
|
7115
|
-
const [jsonStatus, setJsonStatus] = (0,
|
|
7116
|
-
const [openIssueSeverity, setOpenIssueSeverity] = (0,
|
|
7117
|
-
const [inspectorOpen, setInspectorOpen] = (0,
|
|
7118
|
-
const [pendingVersionSwitch, setPendingVersionSwitch] = (0,
|
|
7119
|
-
const selectionRef = (0,
|
|
7120
|
-
const documentStateRef = (0,
|
|
7121
|
-
const activeWorkflowRef = (0,
|
|
7122
|
-
const pendingSelectionRestoreRef = (0,
|
|
7123
|
-
const newStatePositionRef = (0,
|
|
7124
|
-
(0,
|
|
7372
|
+
const [isFullscreen, setIsFullscreen] = (0, import_react24.useState)(false);
|
|
7373
|
+
const [inspectorWidth, setInspectorWidth] = (0, import_react24.useState)(384);
|
|
7374
|
+
const editorContainerRef = (0, import_react24.useRef)(null);
|
|
7375
|
+
const [pendingDelete, setPendingDelete] = (0, import_react24.useState)(null);
|
|
7376
|
+
const [pendingConnect, setPendingConnect] = (0, import_react24.useState)(null);
|
|
7377
|
+
const [pendingAddState, setPendingAddState] = (0, import_react24.useState)(null);
|
|
7378
|
+
const [helpOpen, setHelpOpen] = (0, import_react24.useState)(false);
|
|
7379
|
+
const [reconnectError, setReconnectError] = (0, import_react24.useState)(null);
|
|
7380
|
+
const [layoutKey, setLayoutKey] = (0, import_react24.useState)(0);
|
|
7381
|
+
const [activeSurface, setActiveSurface] = (0, import_react24.useState)("graph");
|
|
7382
|
+
const [jsonStatus, setJsonStatus] = (0, import_react24.useState)({ status: "idle" });
|
|
7383
|
+
const [openIssueSeverity, setOpenIssueSeverity] = (0, import_react24.useState)(null);
|
|
7384
|
+
const [inspectorOpen, setInspectorOpen] = (0, import_react24.useState)(false);
|
|
7385
|
+
const [pendingVersionSwitch, setPendingVersionSwitch] = (0, import_react24.useState)(null);
|
|
7386
|
+
const selectionRef = (0, import_react24.useRef)(state.selection);
|
|
7387
|
+
const documentStateRef = (0, import_react24.useRef)(state.document);
|
|
7388
|
+
const activeWorkflowRef = (0, import_react24.useRef)(state.activeWorkflow);
|
|
7389
|
+
const pendingSelectionRestoreRef = (0, import_react24.useRef)(null);
|
|
7390
|
+
const newStatePositionRef = (0, import_react24.useRef)(null);
|
|
7391
|
+
(0, import_react24.useEffect)(() => {
|
|
7125
7392
|
selectionRef.current = state.selection;
|
|
7126
7393
|
}, [state.selection]);
|
|
7127
|
-
(0,
|
|
7394
|
+
(0, import_react24.useEffect)(() => {
|
|
7128
7395
|
documentStateRef.current = state.document;
|
|
7129
7396
|
activeWorkflowRef.current = state.activeWorkflow;
|
|
7130
7397
|
}, [state.document, state.activeWorkflow]);
|
|
7131
|
-
(0,
|
|
7398
|
+
(0, import_react24.useEffect)(() => {
|
|
7132
7399
|
onChange?.(state.document);
|
|
7133
7400
|
}, [state.document, onChange]);
|
|
7134
|
-
(0,
|
|
7401
|
+
(0, import_react24.useEffect)(() => {
|
|
7135
7402
|
try {
|
|
7136
7403
|
const toStore = {};
|
|
7137
7404
|
for (const [wfName, ui] of Object.entries(state.document.meta.workflowUi)) {
|
|
@@ -7150,12 +7417,12 @@ function WorkflowEditor({
|
|
|
7150
7417
|
} catch {
|
|
7151
7418
|
}
|
|
7152
7419
|
}, [state.document.meta.workflowUi, localStorageKey, onWorkflowUiChange]);
|
|
7153
|
-
(0,
|
|
7420
|
+
(0, import_react24.useEffect)(() => {
|
|
7154
7421
|
if (!onLayoutMetadataChange || !state.activeWorkflow) return;
|
|
7155
7422
|
const ui = state.document.meta.workflowUi[state.activeWorkflow];
|
|
7156
7423
|
if (ui) onLayoutMetadataChange(ui);
|
|
7157
7424
|
}, [state.document.meta.workflowUi, state.activeWorkflow, onLayoutMetadataChange]);
|
|
7158
|
-
const handleInspectorResizeStart = (0,
|
|
7425
|
+
const handleInspectorResizeStart = (0, import_react24.useCallback)((e) => {
|
|
7159
7426
|
e.preventDefault();
|
|
7160
7427
|
const startX = e.clientX;
|
|
7161
7428
|
const startWidth = inspectorWidth;
|
|
@@ -7170,15 +7437,15 @@ function WorkflowEditor({
|
|
|
7170
7437
|
document.addEventListener("mousemove", onMove);
|
|
7171
7438
|
document.addEventListener("mouseup", onUp);
|
|
7172
7439
|
}, [inspectorWidth]);
|
|
7173
|
-
const handleToggleFullscreen = (0,
|
|
7440
|
+
const handleToggleFullscreen = (0, import_react24.useCallback)(() => {
|
|
7174
7441
|
setIsFullscreen((v) => !v);
|
|
7175
7442
|
}, []);
|
|
7176
7443
|
const readOnly = state.mode === "viewer";
|
|
7177
|
-
const derived = (0,
|
|
7444
|
+
const derived = (0, import_react24.useMemo)(
|
|
7178
7445
|
() => deriveFromDocument(state.document),
|
|
7179
7446
|
[state.document]
|
|
7180
7447
|
);
|
|
7181
|
-
const dispatch = (0,
|
|
7448
|
+
const dispatch = (0, import_react24.useCallback)(
|
|
7182
7449
|
(patch) => {
|
|
7183
7450
|
if (patch.op === "setCriterion" && patch.host.kind === "transition") {
|
|
7184
7451
|
const restoreSelection = {
|
|
@@ -7195,13 +7462,13 @@ function WorkflowEditor({
|
|
|
7195
7462
|
actions.dispatchTransaction({
|
|
7196
7463
|
summary: patch.criterion ? "Set criterion" : "Clear criterion",
|
|
7197
7464
|
patches: [patch],
|
|
7198
|
-
inverses: [(0,
|
|
7465
|
+
inverses: [(0, import_workflow_core11.invertPatch)(state.document, patch)],
|
|
7199
7466
|
selectionAfter: restoreSelection
|
|
7200
7467
|
});
|
|
7201
7468
|
return;
|
|
7202
7469
|
}
|
|
7203
7470
|
if (patch.op === "renameState" && selectionRef.current?.kind === "state" && selectionRef.current.stateCode === patch.from && selectionRef.current.workflow === patch.workflow) {
|
|
7204
|
-
const nextDoc = (0,
|
|
7471
|
+
const nextDoc = (0, import_workflow_core11.applyPatch)(state.document, patch);
|
|
7205
7472
|
const newNodeId = Object.entries(nextDoc.meta.ids.states).find(([, ptr]) => ptr.workflow === patch.workflow && ptr.state === patch.to)?.[0] ?? "";
|
|
7206
7473
|
actions.dispatchTransaction({
|
|
7207
7474
|
summary: `Rename state "${patch.from}" \u2192 "${patch.to}"`,
|
|
@@ -7212,7 +7479,7 @@ function WorkflowEditor({
|
|
|
7212
7479
|
return;
|
|
7213
7480
|
}
|
|
7214
7481
|
if (patch.op === "moveTransitionSource") {
|
|
7215
|
-
const nextDoc = (0,
|
|
7482
|
+
const nextDoc = (0, import_workflow_core11.applyPatch)(state.document, patch);
|
|
7216
7483
|
const newUuid = transitionUuidByName(nextDoc, patch.workflow, patch.toState, patch.transitionName);
|
|
7217
7484
|
actions.dispatchTransaction({
|
|
7218
7485
|
summary: `Move transition "${patch.transitionName}" to "${patch.toState}"`,
|
|
@@ -7226,7 +7493,7 @@ function WorkflowEditor({
|
|
|
7226
7493
|
},
|
|
7227
7494
|
[actions, state.document]
|
|
7228
7495
|
);
|
|
7229
|
-
const handleJsonStatusChange = (0,
|
|
7496
|
+
const handleJsonStatusChange = (0, import_react24.useCallback)(
|
|
7230
7497
|
(status) => {
|
|
7231
7498
|
setJsonStatus(status);
|
|
7232
7499
|
onJsonStatusChange?.(status);
|
|
@@ -7238,7 +7505,7 @@ function WorkflowEditor({
|
|
|
7238
7505
|
const inspectorVisible = chrome?.inspector !== false && inspectorOpen && (!enableJsonEditor || jsonEditorPlacement !== "tab" || activeSurface === "graph");
|
|
7239
7506
|
const saveBlockedByJson = jsonStatus.status === "invalid-json" || jsonStatus.status === "invalid-schema";
|
|
7240
7507
|
const saveDisabled = readOnly || derived.errorCount > 0 || saveBlockedByJson;
|
|
7241
|
-
const handleNodeDragStop = (0,
|
|
7508
|
+
const handleNodeDragStop = (0, import_react24.useCallback)(
|
|
7242
7509
|
(nodeId, _x, _y, allPositions) => {
|
|
7243
7510
|
const ids = state.document.meta.ids.states;
|
|
7244
7511
|
const patches = [];
|
|
@@ -7259,12 +7526,12 @@ function WorkflowEditor({
|
|
|
7259
7526
|
}
|
|
7260
7527
|
}
|
|
7261
7528
|
}
|
|
7262
|
-
const inverses = patches.map((p) => (0,
|
|
7529
|
+
const inverses = patches.map((p) => (0, import_workflow_core11.invertPatch)(state.document, p));
|
|
7263
7530
|
actions.dispatchTransaction({ patches, inverses, summary: "Move state" });
|
|
7264
7531
|
},
|
|
7265
7532
|
[state.document, derived.graph, actions]
|
|
7266
7533
|
);
|
|
7267
|
-
const handleAutoLayout = (0,
|
|
7534
|
+
const handleAutoLayout = (0, import_react24.useCallback)(() => {
|
|
7268
7535
|
const workflow = state.activeWorkflow;
|
|
7269
7536
|
if (!workflow) return;
|
|
7270
7537
|
const workflowUi = { ...state.document.meta.workflowUi };
|
|
@@ -7279,11 +7546,11 @@ function WorkflowEditor({
|
|
|
7279
7546
|
);
|
|
7280
7547
|
setLayoutKey((k) => k + 1);
|
|
7281
7548
|
}, [state.activeWorkflow, state.document, actions]);
|
|
7282
|
-
const openAddStateModal = (0,
|
|
7549
|
+
const openAddStateModal = (0, import_react24.useCallback)((position) => {
|
|
7283
7550
|
const resolved = position ?? newStatePositionRef.current?.() ?? void 0;
|
|
7284
7551
|
setPendingAddState(resolved ? { position: resolved } : {});
|
|
7285
7552
|
}, []);
|
|
7286
|
-
const pinnedNodes = (0,
|
|
7553
|
+
const pinnedNodes = (0, import_react24.useMemo)(() => {
|
|
7287
7554
|
const workflow = state.activeWorkflow;
|
|
7288
7555
|
if (!workflow) return void 0;
|
|
7289
7556
|
const layoutNodes = externalLayoutMeta?.layout?.nodes ?? state.document.meta.workflowUi[workflow]?.layout?.nodes;
|
|
@@ -7303,12 +7570,12 @@ function WorkflowEditor({
|
|
|
7303
7570
|
state.document.meta.workflowUi,
|
|
7304
7571
|
externalLayoutMeta
|
|
7305
7572
|
]);
|
|
7306
|
-
const transitionPositions = (0,
|
|
7573
|
+
const transitionPositions = (0, import_react24.useMemo)(() => {
|
|
7307
7574
|
const workflow = state.activeWorkflow;
|
|
7308
7575
|
if (!workflow) return void 0;
|
|
7309
7576
|
return state.document.meta.workflowUi[workflow]?.transitionPositions;
|
|
7310
7577
|
}, [state.activeWorkflow, state.document.meta.workflowUi]);
|
|
7311
|
-
const handleTransitionLabelDragEnd = (0,
|
|
7578
|
+
const handleTransitionLabelDragEnd = (0, import_react24.useCallback)(
|
|
7312
7579
|
(edgeId, x, y) => {
|
|
7313
7580
|
actions.dispatchTransaction({
|
|
7314
7581
|
summary: "Move transition label",
|
|
@@ -7318,17 +7585,17 @@ function WorkflowEditor({
|
|
|
7318
7585
|
},
|
|
7319
7586
|
[actions]
|
|
7320
7587
|
);
|
|
7321
|
-
const handleVersionChange = (0,
|
|
7588
|
+
const handleVersionChange = (0, import_react24.useCallback)(
|
|
7322
7589
|
(targetVersion) => {
|
|
7323
|
-
const wireJson = (0,
|
|
7324
|
-
const result = (0,
|
|
7590
|
+
const wireJson = (0, import_workflow_core11.serializeImportPayload)(state.document);
|
|
7591
|
+
const result = (0, import_workflow_core11.parseImportPayload)(wireJson, state.document.meta, { sourceVersion: targetVersion });
|
|
7325
7592
|
if (!result.ok || !result.document) return;
|
|
7326
7593
|
const docWithVersion = {
|
|
7327
7594
|
...result.document,
|
|
7328
7595
|
meta: { ...result.document.meta, cyodaVersion: targetVersion }
|
|
7329
7596
|
};
|
|
7330
7597
|
const beforeJson = wireJson;
|
|
7331
|
-
const afterJson = (0,
|
|
7598
|
+
const afterJson = (0, import_workflow_core11.serializeImportPayload)(docWithVersion);
|
|
7332
7599
|
const parseWarnings = result.warnings ?? [];
|
|
7333
7600
|
const isLossy = beforeJson !== afterJson || parseWarnings.length > 0;
|
|
7334
7601
|
const warnings = parseWarnings.length > 0 ? parseWarnings : isLossy ? ["Some fields supported in the current version are not present in the target version and will be removed."] : [];
|
|
@@ -7356,7 +7623,7 @@ function WorkflowEditor({
|
|
|
7356
7623
|
const resolved = resolveConnection(state.document, connection);
|
|
7357
7624
|
if (resolved) setPendingConnect(resolved);
|
|
7358
7625
|
};
|
|
7359
|
-
const handleReconnect = (0,
|
|
7626
|
+
const handleReconnect = (0, import_react24.useCallback)(
|
|
7360
7627
|
(edge, connection) => {
|
|
7361
7628
|
setReconnectError(null);
|
|
7362
7629
|
const tx = buildReconnectTransaction(state.document, edge, connection);
|
|
@@ -7367,7 +7634,7 @@ function WorkflowEditor({
|
|
|
7367
7634
|
try {
|
|
7368
7635
|
actions.dispatchTransaction(tx.transaction);
|
|
7369
7636
|
} catch (error) {
|
|
7370
|
-
if (error instanceof
|
|
7637
|
+
if (error instanceof import_workflow_core11.PatchConflictError) {
|
|
7371
7638
|
setReconnectError(error.message);
|
|
7372
7639
|
return;
|
|
7373
7640
|
}
|
|
@@ -7376,7 +7643,7 @@ function WorkflowEditor({
|
|
|
7376
7643
|
},
|
|
7377
7644
|
[actions, state.document]
|
|
7378
7645
|
);
|
|
7379
|
-
const confirmConnect = (0,
|
|
7646
|
+
const confirmConnect = (0, import_react24.useCallback)(
|
|
7380
7647
|
(name) => {
|
|
7381
7648
|
if (!pendingConnect) return;
|
|
7382
7649
|
const addPatch = {
|
|
@@ -7386,7 +7653,7 @@ function WorkflowEditor({
|
|
|
7386
7653
|
transition: { name, next: pendingConnect.toState, manual: false, disabled: false }
|
|
7387
7654
|
};
|
|
7388
7655
|
const priorUUIDs = new Set(Object.keys(state.document.meta.ids.transitions));
|
|
7389
|
-
const afterApply = (0,
|
|
7656
|
+
const afterApply = (0, import_workflow_core11.applyPatch)(state.document, addPatch);
|
|
7390
7657
|
const newUUID = Object.keys(afterApply.meta.ids.transitions).find(
|
|
7391
7658
|
(u) => !priorUUIDs.has(u)
|
|
7392
7659
|
);
|
|
@@ -7402,7 +7669,7 @@ function WorkflowEditor({
|
|
|
7402
7669
|
);
|
|
7403
7670
|
const workflows = state.document.session.workflows;
|
|
7404
7671
|
const showTabs = workflows.length > 1 || state.mode !== "viewer";
|
|
7405
|
-
const handleSelectionChange = (0,
|
|
7672
|
+
const handleSelectionChange = (0, import_react24.useCallback)(
|
|
7406
7673
|
(selection) => {
|
|
7407
7674
|
const pendingRestore = pendingSelectionRestoreRef.current;
|
|
7408
7675
|
if (!selection && pendingRestore) {
|
|
@@ -7420,7 +7687,7 @@ function WorkflowEditor({
|
|
|
7420
7687
|
},
|
|
7421
7688
|
[actions]
|
|
7422
7689
|
);
|
|
7423
|
-
const confirmAddState = (0,
|
|
7690
|
+
const confirmAddState = (0, import_react24.useCallback)(
|
|
7424
7691
|
(name) => {
|
|
7425
7692
|
const workflow = state.activeWorkflow;
|
|
7426
7693
|
const requestedPosition = pendingAddState?.position;
|
|
@@ -7448,7 +7715,7 @@ function WorkflowEditor({
|
|
|
7448
7715
|
[pendingAddState, state.activeWorkflow, actions]
|
|
7449
7716
|
);
|
|
7450
7717
|
const anyModalOpen = pendingDelete !== null || pendingConnect !== null || pendingAddState !== null || helpOpen;
|
|
7451
|
-
const handleKeyDown = (0,
|
|
7718
|
+
const handleKeyDown = (0, import_react24.useCallback)(
|
|
7452
7719
|
(e) => {
|
|
7453
7720
|
if (anyModalOpen) return;
|
|
7454
7721
|
if (isTypingTarget(e.target)) return;
|
|
@@ -7508,7 +7775,7 @@ function WorkflowEditor({
|
|
|
7508
7775
|
inspectorOpen
|
|
7509
7776
|
]
|
|
7510
7777
|
);
|
|
7511
|
-
const handleDeleteKeyDownCapture = (0,
|
|
7778
|
+
const handleDeleteKeyDownCapture = (0, import_react24.useCallback)(
|
|
7512
7779
|
(e) => {
|
|
7513
7780
|
if (anyModalOpen || readOnly || isTypingTarget(e.target)) return;
|
|
7514
7781
|
if (e.ctrlKey || e.metaKey || e.altKey) return;
|
|
@@ -7528,7 +7795,7 @@ function WorkflowEditor({
|
|
|
7528
7795
|
},
|
|
7529
7796
|
[anyModalOpen, readOnly, state.selection]
|
|
7530
7797
|
);
|
|
7531
|
-
(0,
|
|
7798
|
+
(0, import_react24.useEffect)(() => {
|
|
7532
7799
|
const handleDocumentDeleteKeyDown = (event) => {
|
|
7533
7800
|
if (anyModalOpen || readOnly || isTypingTarget(event.target)) return;
|
|
7534
7801
|
if (event.ctrlKey || event.metaKey || event.altKey) return;
|
|
@@ -7551,7 +7818,7 @@ function WorkflowEditor({
|
|
|
7551
7818
|
document.removeEventListener("keydown", handleDocumentDeleteKeyDown, true);
|
|
7552
7819
|
};
|
|
7553
7820
|
}, [anyModalOpen, readOnly, dispatch]);
|
|
7554
|
-
const pendingConnectState = (0,
|
|
7821
|
+
const pendingConnectState = (0, import_react24.useMemo)(() => {
|
|
7555
7822
|
if (!pendingConnect) return null;
|
|
7556
7823
|
const wf = state.document.session.workflows.find(
|
|
7557
7824
|
(w) => w.name === pendingConnect.workflow
|
|
@@ -7560,17 +7827,17 @@ function WorkflowEditor({
|
|
|
7560
7827
|
return wf.states[pendingConnect.fromState] ?? null;
|
|
7561
7828
|
}, [pendingConnect, state.document]);
|
|
7562
7829
|
const orientation = layoutOptions?.orientation ?? "vertical";
|
|
7563
|
-
const effectiveLayoutOptions = (0,
|
|
7830
|
+
const effectiveLayoutOptions = (0, import_react24.useMemo)(
|
|
7564
7831
|
() => ({ ...layoutOptions, pinned: pinnedNodes }),
|
|
7565
7832
|
[layoutOptions, pinnedNodes]
|
|
7566
7833
|
);
|
|
7567
7834
|
const savedViewport = state.activeWorkflow ? state.document.meta.workflowUi[state.activeWorkflow]?.viewports?.[orientation] : void 0;
|
|
7568
|
-
(0,
|
|
7835
|
+
(0, import_react24.useEffect)(() => {
|
|
7569
7836
|
if (enableJsonEditor) return;
|
|
7570
7837
|
setJsonStatus({ status: "idle" });
|
|
7571
7838
|
onJsonStatusChange?.({ status: "idle" });
|
|
7572
7839
|
}, [enableJsonEditor, onJsonStatusChange]);
|
|
7573
|
-
const handleViewportChange = (0,
|
|
7840
|
+
const handleViewportChange = (0, import_react24.useCallback)(
|
|
7574
7841
|
(viewport) => {
|
|
7575
7842
|
const workflow = state.activeWorkflow;
|
|
7576
7843
|
if (!workflow) return;
|
|
@@ -7600,17 +7867,17 @@ function WorkflowEditor({
|
|
|
7600
7867
|
},
|
|
7601
7868
|
[actions, orientation, state.activeWorkflow, state.document]
|
|
7602
7869
|
);
|
|
7603
|
-
const handlePaneDoubleClick = (0,
|
|
7870
|
+
const handlePaneDoubleClick = (0, import_react24.useCallback)((x, y) => {
|
|
7604
7871
|
if (readOnly || anyModalOpen) return;
|
|
7605
7872
|
openAddStateModal({ x, y });
|
|
7606
7873
|
}, [anyModalOpen, openAddStateModal, readOnly]);
|
|
7607
|
-
const graphPane = /* @__PURE__ */ (0,
|
|
7874
|
+
const graphPane = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
7608
7875
|
"div",
|
|
7609
7876
|
{
|
|
7610
7877
|
"data-testid": "workflow-editor-graph-pane",
|
|
7611
7878
|
style: { flex: 1, minWidth: 0, minHeight: 0, height: "100%", position: "relative" },
|
|
7612
7879
|
children: [
|
|
7613
|
-
/* @__PURE__ */ (0,
|
|
7880
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7614
7881
|
Canvas,
|
|
7615
7882
|
{
|
|
7616
7883
|
graph: derived.graph,
|
|
@@ -7655,7 +7922,7 @@ function WorkflowEditor({
|
|
|
7655
7922
|
helpLabel: mergedMessages.toolbar.help
|
|
7656
7923
|
}
|
|
7657
7924
|
),
|
|
7658
|
-
reconnectError && /* @__PURE__ */ (0,
|
|
7925
|
+
reconnectError && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7659
7926
|
"div",
|
|
7660
7927
|
{
|
|
7661
7928
|
role: "alert",
|
|
@@ -7680,7 +7947,7 @@ function WorkflowEditor({
|
|
|
7680
7947
|
state.activeWorkflow && (() => {
|
|
7681
7948
|
const comments = state.document.meta.workflowUi[state.activeWorkflow]?.comments;
|
|
7682
7949
|
if (!comments) return null;
|
|
7683
|
-
return Object.values(comments).map((c) => /* @__PURE__ */ (0,
|
|
7950
|
+
return Object.values(comments).map((c) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7684
7951
|
CommentNode,
|
|
7685
7952
|
{
|
|
7686
7953
|
comment: c,
|
|
@@ -7703,12 +7970,12 @@ function WorkflowEditor({
|
|
|
7703
7970
|
]
|
|
7704
7971
|
}
|
|
7705
7972
|
);
|
|
7706
|
-
const jsonPane = enableJsonEditor ? /* @__PURE__ */ (0,
|
|
7973
|
+
const jsonPane = enableJsonEditor ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7707
7974
|
"div",
|
|
7708
7975
|
{
|
|
7709
7976
|
"data-testid": "workflow-editor-json-pane",
|
|
7710
7977
|
style: { flex: 1, minWidth: 0, minHeight: 0, height: "100%" },
|
|
7711
|
-
children: /* @__PURE__ */ (0,
|
|
7978
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7712
7979
|
WorkflowJsonEditor,
|
|
7713
7980
|
{
|
|
7714
7981
|
document: state.document,
|
|
@@ -7724,7 +7991,7 @@ function WorkflowEditor({
|
|
|
7724
7991
|
)
|
|
7725
7992
|
}
|
|
7726
7993
|
) : null;
|
|
7727
|
-
return /* @__PURE__ */ (0,
|
|
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)(
|
|
7728
7995
|
"div",
|
|
7729
7996
|
{
|
|
7730
7997
|
ref: editorContainerRef,
|
|
@@ -7745,7 +8012,7 @@ function WorkflowEditor({
|
|
|
7745
8012
|
onKeyDown: handleKeyDown,
|
|
7746
8013
|
tabIndex: -1,
|
|
7747
8014
|
children: [
|
|
7748
|
-
chrome?.tabs !== false && showTabs && /* @__PURE__ */ (0,
|
|
8015
|
+
chrome?.tabs !== false && showTabs && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7749
8016
|
WorkflowTabs,
|
|
7750
8017
|
{
|
|
7751
8018
|
workflows,
|
|
@@ -7767,14 +8034,14 @@ function WorkflowEditor({
|
|
|
7767
8034
|
});
|
|
7768
8035
|
actions.setActiveWorkflow(to);
|
|
7769
8036
|
},
|
|
7770
|
-
dialectVersion: `v${state.document.meta.cyodaVersion ??
|
|
7771
|
-
supportedVersions:
|
|
8037
|
+
dialectVersion: `v${state.document.meta.cyodaVersion ?? import_workflow_core11.LATEST_CYODA_VERSION}`,
|
|
8038
|
+
supportedVersions: import_workflow_core11.SUPPORTED_CYODA_VERSIONS,
|
|
7772
8039
|
onVersionChange: handleVersionChange
|
|
7773
8040
|
}
|
|
7774
8041
|
),
|
|
7775
|
-
/* @__PURE__ */ (0,
|
|
7776
|
-
/* @__PURE__ */ (0,
|
|
7777
|
-
(enableJsonEditor && jsonEditorPlacement === "tab" || !readOnly && graphVisible) && /* @__PURE__ */ (0,
|
|
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)(
|
|
7778
8045
|
"div",
|
|
7779
8046
|
{
|
|
7780
8047
|
style: {
|
|
@@ -7788,8 +8055,8 @@ function WorkflowEditor({
|
|
|
7788
8055
|
},
|
|
7789
8056
|
"data-testid": "workflow-editor-surface-tabs",
|
|
7790
8057
|
children: [
|
|
7791
|
-
enableJsonEditor && jsonEditorPlacement === "tab" && /* @__PURE__ */ (0,
|
|
7792
|
-
/* @__PURE__ */ (0,
|
|
8058
|
+
enableJsonEditor && jsonEditorPlacement === "tab" && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
8059
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7793
8060
|
SurfaceTab,
|
|
7794
8061
|
{
|
|
7795
8062
|
active: activeSurface === "graph",
|
|
@@ -7797,7 +8064,7 @@ function WorkflowEditor({
|
|
|
7797
8064
|
children: mergedMessages.editorView.graph
|
|
7798
8065
|
}
|
|
7799
8066
|
),
|
|
7800
|
-
/* @__PURE__ */ (0,
|
|
8067
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7801
8068
|
SurfaceTab,
|
|
7802
8069
|
{
|
|
7803
8070
|
active: activeSurface === "json",
|
|
@@ -7806,8 +8073,8 @@ function WorkflowEditor({
|
|
|
7806
8073
|
}
|
|
7807
8074
|
)
|
|
7808
8075
|
] }),
|
|
7809
|
-
/* @__PURE__ */ (0,
|
|
7810
|
-
!readOnly && activeSurface === "graph" && /* @__PURE__ */ (0,
|
|
8076
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { style: { flex: 1 } }),
|
|
8077
|
+
!readOnly && activeSurface === "graph" && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
7811
8078
|
"button",
|
|
7812
8079
|
{
|
|
7813
8080
|
type: "button",
|
|
@@ -7828,7 +8095,7 @@ function WorkflowEditor({
|
|
|
7828
8095
|
cursor: "pointer"
|
|
7829
8096
|
},
|
|
7830
8097
|
children: [
|
|
7831
|
-
/* @__PURE__ */ (0,
|
|
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" }) }),
|
|
7832
8099
|
mergedMessages.toolbar.addStateButton
|
|
7833
8100
|
]
|
|
7834
8101
|
}
|
|
@@ -7836,7 +8103,7 @@ function WorkflowEditor({
|
|
|
7836
8103
|
]
|
|
7837
8104
|
}
|
|
7838
8105
|
),
|
|
7839
|
-
enableJsonEditor && jsonEditorPlacement === "split" ? /* @__PURE__ */ (0,
|
|
8106
|
+
enableJsonEditor && jsonEditorPlacement === "split" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
7840
8107
|
"div",
|
|
7841
8108
|
{
|
|
7842
8109
|
style: {
|
|
@@ -7849,10 +8116,10 @@ function WorkflowEditor({
|
|
|
7849
8116
|
"data-testid": "workflow-editor-split-view",
|
|
7850
8117
|
children: [
|
|
7851
8118
|
graphPane,
|
|
7852
|
-
/* @__PURE__ */ (0,
|
|
8119
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { style: { borderLeft: "1px solid #E2E8F0", minWidth: 0 }, children: jsonPane })
|
|
7853
8120
|
]
|
|
7854
8121
|
}
|
|
7855
|
-
) : /* @__PURE__ */ (0,
|
|
8122
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
7856
8123
|
"div",
|
|
7857
8124
|
{
|
|
7858
8125
|
style: {
|
|
@@ -7864,8 +8131,8 @@ function WorkflowEditor({
|
|
|
7864
8131
|
flexDirection: "column"
|
|
7865
8132
|
},
|
|
7866
8133
|
children: [
|
|
7867
|
-
graphVisible ? /* @__PURE__ */ (0,
|
|
7868
|
-
enableJsonEditor ? /* @__PURE__ */ (0,
|
|
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)(
|
|
7869
8136
|
"div",
|
|
7870
8137
|
{
|
|
7871
8138
|
style: {
|
|
@@ -7882,8 +8149,8 @@ function WorkflowEditor({
|
|
|
7882
8149
|
}
|
|
7883
8150
|
)
|
|
7884
8151
|
] }),
|
|
7885
|
-
inspectorVisible && /* @__PURE__ */ (0,
|
|
7886
|
-
/* @__PURE__ */ (0,
|
|
8152
|
+
inspectorVisible && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
8153
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7887
8154
|
"div",
|
|
7888
8155
|
{
|
|
7889
8156
|
onMouseDown: handleInspectorResizeStart,
|
|
@@ -7900,7 +8167,7 @@ function WorkflowEditor({
|
|
|
7900
8167
|
onMouseLeave: (e) => e.currentTarget.style.background = "transparent"
|
|
7901
8168
|
}
|
|
7902
8169
|
),
|
|
7903
|
-
/* @__PURE__ */ (0,
|
|
8170
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7904
8171
|
Inspector,
|
|
7905
8172
|
{
|
|
7906
8173
|
document: state.document,
|
|
@@ -7916,7 +8183,7 @@ function WorkflowEditor({
|
|
|
7916
8183
|
)
|
|
7917
8184
|
] })
|
|
7918
8185
|
] }),
|
|
7919
|
-
pendingAddState !== null && state.activeWorkflow && /* @__PURE__ */ (0,
|
|
8186
|
+
pendingAddState !== null && state.activeWorkflow && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7920
8187
|
AddStateModal,
|
|
7921
8188
|
{
|
|
7922
8189
|
existingNames: Object.keys(
|
|
@@ -7928,7 +8195,7 @@ function WorkflowEditor({
|
|
|
7928
8195
|
onCancel: () => setPendingAddState(null)
|
|
7929
8196
|
}
|
|
7930
8197
|
),
|
|
7931
|
-
pendingDelete && /* @__PURE__ */ (0,
|
|
8198
|
+
pendingDelete && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7932
8199
|
DeleteStateModal,
|
|
7933
8200
|
{
|
|
7934
8201
|
document: state.document,
|
|
@@ -7938,7 +8205,7 @@ function WorkflowEditor({
|
|
|
7938
8205
|
onCancel: () => setPendingDelete(null)
|
|
7939
8206
|
}
|
|
7940
8207
|
),
|
|
7941
|
-
pendingConnect && pendingConnectState && /* @__PURE__ */ (0,
|
|
8208
|
+
pendingConnect && pendingConnectState && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7942
8209
|
DragConnectModal,
|
|
7943
8210
|
{
|
|
7944
8211
|
source: pendingConnectState,
|
|
@@ -7948,11 +8215,11 @@ function WorkflowEditor({
|
|
|
7948
8215
|
onCancel: () => setPendingConnect(null)
|
|
7949
8216
|
}
|
|
7950
8217
|
),
|
|
7951
|
-
helpOpen && /* @__PURE__ */ (0,
|
|
7952
|
-
pendingVersionSwitch && /* @__PURE__ */ (0,
|
|
8218
|
+
helpOpen && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(HelpModal, { onCancel: () => setHelpOpen(false) }),
|
|
8219
|
+
pendingVersionSwitch && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7953
8220
|
VersionSwitchModal,
|
|
7954
8221
|
{
|
|
7955
|
-
fromVersion: `v${state.document.meta.cyodaVersion ??
|
|
8222
|
+
fromVersion: `v${state.document.meta.cyodaVersion ?? import_workflow_core11.LATEST_CYODA_VERSION}`,
|
|
7956
8223
|
toVersion: `v${pendingVersionSwitch.targetVersion}`,
|
|
7957
8224
|
warnings: pendingVersionSwitch.warnings,
|
|
7958
8225
|
onConfirm: () => {
|
|
@@ -7962,8 +8229,8 @@ function WorkflowEditor({
|
|
|
7962
8229
|
onCancel: () => setPendingVersionSwitch(null)
|
|
7963
8230
|
}
|
|
7964
8231
|
),
|
|
7965
|
-
chrome?.toolbar !== false && /* @__PURE__ */ (0,
|
|
7966
|
-
/* @__PURE__ */ (0,
|
|
8232
|
+
chrome?.toolbar !== false && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { style: { position: "relative" }, children: [
|
|
8233
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7967
8234
|
Toolbar,
|
|
7968
8235
|
{
|
|
7969
8236
|
derived,
|
|
@@ -7978,7 +8245,7 @@ function WorkflowEditor({
|
|
|
7978
8245
|
toolbarEnd
|
|
7979
8246
|
}
|
|
7980
8247
|
),
|
|
7981
|
-
/* @__PURE__ */ (0,
|
|
8248
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7982
8249
|
IssuesDrawer,
|
|
7983
8250
|
{
|
|
7984
8251
|
open: openIssueSeverity !== null,
|
|
@@ -8061,7 +8328,7 @@ function buildReconnectTransaction(doc, edge, connection) {
|
|
|
8061
8328
|
toState,
|
|
8062
8329
|
transitionName: transition.name
|
|
8063
8330
|
};
|
|
8064
|
-
const afterMove = (0,
|
|
8331
|
+
const afterMove = (0, import_workflow_core11.applyPatch)(doc, movePatch);
|
|
8065
8332
|
const movedUuid = transitionUuidByName(afterMove, ptr.workflow, toState, transition.name);
|
|
8066
8333
|
if (!movedUuid) return { ok: false };
|
|
8067
8334
|
const patches = [movePatch];
|
|
@@ -8174,7 +8441,7 @@ function SurfaceTab({
|
|
|
8174
8441
|
onClick,
|
|
8175
8442
|
children
|
|
8176
8443
|
}) {
|
|
8177
|
-
return /* @__PURE__ */ (0,
|
|
8444
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
8178
8445
|
"button",
|
|
8179
8446
|
{
|
|
8180
8447
|
type: "button",
|
|
@@ -8229,16 +8496,16 @@ function snapToGrid(value, grid = 16) {
|
|
|
8229
8496
|
}
|
|
8230
8497
|
|
|
8231
8498
|
// src/save/useSaveFlow.ts
|
|
8232
|
-
var
|
|
8233
|
-
var
|
|
8499
|
+
var import_react25 = require("react");
|
|
8500
|
+
var import_workflow_core12 = require("@cyoda/workflow-core");
|
|
8234
8501
|
function useSaveFlow(args) {
|
|
8235
8502
|
const { api, document: doc, concurrencyToken, onSaved, onReload } = args;
|
|
8236
|
-
const [status, setStatus] = (0,
|
|
8237
|
-
const tokenRef = (0,
|
|
8503
|
+
const [status, setStatus] = (0, import_react25.useState)({ kind: "idle" });
|
|
8504
|
+
const tokenRef = (0, import_react25.useRef)(concurrencyToken);
|
|
8238
8505
|
tokenRef.current = concurrencyToken;
|
|
8239
|
-
const entityRef = (0,
|
|
8506
|
+
const entityRef = (0, import_react25.useRef)(doc.session.entity);
|
|
8240
8507
|
entityRef.current = doc.session.entity;
|
|
8241
|
-
const payloadRef = (0,
|
|
8508
|
+
const payloadRef = (0, import_react25.useRef)({
|
|
8242
8509
|
importMode: doc.session.importMode,
|
|
8243
8510
|
workflows: doc.session.workflows
|
|
8244
8511
|
});
|
|
@@ -8246,8 +8513,8 @@ function useSaveFlow(args) {
|
|
|
8246
8513
|
importMode: doc.session.importMode,
|
|
8247
8514
|
workflows: doc.session.workflows
|
|
8248
8515
|
};
|
|
8249
|
-
const savingRef = (0,
|
|
8250
|
-
const performImport = (0,
|
|
8516
|
+
const savingRef = (0, import_react25.useRef)(false);
|
|
8517
|
+
const performImport = (0, import_react25.useCallback)(
|
|
8251
8518
|
async (token) => {
|
|
8252
8519
|
if (savingRef.current) return;
|
|
8253
8520
|
const entity = entityRef.current;
|
|
@@ -8267,7 +8534,7 @@ function useSaveFlow(args) {
|
|
|
8267
8534
|
onSaved(result.concurrencyToken);
|
|
8268
8535
|
setStatus({ kind: "success", at: Date.now() });
|
|
8269
8536
|
} catch (err) {
|
|
8270
|
-
if (err instanceof
|
|
8537
|
+
if (err instanceof import_workflow_core12.WorkflowApiConflictError) {
|
|
8271
8538
|
setStatus({
|
|
8272
8539
|
kind: "conflict",
|
|
8273
8540
|
serverConcurrencyToken: err.serverConcurrencyToken
|
|
@@ -8284,28 +8551,28 @@ function useSaveFlow(args) {
|
|
|
8284
8551
|
},
|
|
8285
8552
|
[api, onSaved]
|
|
8286
8553
|
);
|
|
8287
|
-
const requestSave = (0,
|
|
8554
|
+
const requestSave = (0, import_react25.useCallback)(() => {
|
|
8288
8555
|
const mode = payloadRef.current.importMode;
|
|
8289
8556
|
const requiresExplicitConfirm = mode === "REPLACE" || mode === "ACTIVATE";
|
|
8290
8557
|
setStatus({ kind: "confirming", mode, requiresExplicitConfirm });
|
|
8291
8558
|
}, []);
|
|
8292
|
-
const confirmSave = (0,
|
|
8559
|
+
const confirmSave = (0, import_react25.useCallback)(
|
|
8293
8560
|
() => performImport(tokenRef.current),
|
|
8294
8561
|
[performImport]
|
|
8295
8562
|
);
|
|
8296
|
-
const cancel = (0,
|
|
8297
|
-
const forceOverwrite = (0,
|
|
8298
|
-
const reload = (0,
|
|
8563
|
+
const cancel = (0, import_react25.useCallback)(() => setStatus({ kind: "idle" }), []);
|
|
8564
|
+
const forceOverwrite = (0, import_react25.useCallback)(() => performImport(null), [performImport]);
|
|
8565
|
+
const reload = (0, import_react25.useCallback)(() => {
|
|
8299
8566
|
onReload?.();
|
|
8300
8567
|
setStatus({ kind: "idle" });
|
|
8301
8568
|
}, [onReload]);
|
|
8302
|
-
const clear = (0,
|
|
8569
|
+
const clear = (0, import_react25.useCallback)(() => setStatus({ kind: "idle" }), []);
|
|
8303
8570
|
return { status, requestSave, confirmSave, cancel, forceOverwrite, reload, clear };
|
|
8304
8571
|
}
|
|
8305
8572
|
|
|
8306
8573
|
// src/save/SaveConfirmModal.tsx
|
|
8307
|
-
var
|
|
8308
|
-
var
|
|
8574
|
+
var import_react26 = require("react");
|
|
8575
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
8309
8576
|
function SaveConfirmModal({
|
|
8310
8577
|
mode,
|
|
8311
8578
|
requiresExplicitConfirm,
|
|
@@ -8315,17 +8582,17 @@ function SaveConfirmModal({
|
|
|
8315
8582
|
onCancel
|
|
8316
8583
|
}) {
|
|
8317
8584
|
const messages = useMessages();
|
|
8318
|
-
const [ackMode, setAckMode] = (0,
|
|
8319
|
-
const [ackWarnings, setAckWarnings] = (0,
|
|
8585
|
+
const [ackMode, setAckMode] = (0, import_react26.useState)(!requiresExplicitConfirm);
|
|
8586
|
+
const [ackWarnings, setAckWarnings] = (0, import_react26.useState)(warningCount === 0);
|
|
8320
8587
|
const blocked = !ackMode || !ackWarnings;
|
|
8321
|
-
return /* @__PURE__ */ (0,
|
|
8322
|
-
/* @__PURE__ */ (0,
|
|
8323
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
8324
8591
|
messages.saveConfirm.modeLabel,
|
|
8325
8592
|
": ",
|
|
8326
|
-
/* @__PURE__ */ (0,
|
|
8593
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("strong", { children: mode })
|
|
8327
8594
|
] }),
|
|
8328
|
-
diffSummary2 && /* @__PURE__ */ (0,
|
|
8595
|
+
diffSummary2 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
8329
8596
|
"pre",
|
|
8330
8597
|
{
|
|
8331
8598
|
style: {
|
|
@@ -8344,8 +8611,8 @@ function SaveConfirmModal({
|
|
|
8344
8611
|
children: diffSummary2
|
|
8345
8612
|
}
|
|
8346
8613
|
),
|
|
8347
|
-
requiresExplicitConfirm && /* @__PURE__ */ (0,
|
|
8348
|
-
/* @__PURE__ */ (0,
|
|
8614
|
+
requiresExplicitConfirm && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { style: checkRow, "data-testid": "save-ack-mode", children: [
|
|
8615
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
8349
8616
|
"input",
|
|
8350
8617
|
{
|
|
8351
8618
|
type: "checkbox",
|
|
@@ -8353,10 +8620,10 @@ function SaveConfirmModal({
|
|
|
8353
8620
|
onChange: (e) => setAckMode(e.target.checked)
|
|
8354
8621
|
}
|
|
8355
8622
|
),
|
|
8356
|
-
/* @__PURE__ */ (0,
|
|
8623
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: mode === "REPLACE" ? messages.saveConfirm.ackReplace : messages.saveConfirm.ackActivate })
|
|
8357
8624
|
] }),
|
|
8358
|
-
warningCount > 0 && /* @__PURE__ */ (0,
|
|
8359
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
8360
8627
|
"input",
|
|
8361
8628
|
{
|
|
8362
8629
|
type: "checkbox",
|
|
@@ -8364,17 +8631,17 @@ function SaveConfirmModal({
|
|
|
8364
8631
|
onChange: (e) => setAckWarnings(e.target.checked)
|
|
8365
8632
|
}
|
|
8366
8633
|
),
|
|
8367
|
-
/* @__PURE__ */ (0,
|
|
8634
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: messages.saveConfirm.ackWarnings.replace("{count}", String(warningCount)) })
|
|
8368
8635
|
] }),
|
|
8369
|
-
/* @__PURE__ */ (0,
|
|
8370
|
-
/* @__PURE__ */ (0,
|
|
8371
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
8372
8639
|
"button",
|
|
8373
8640
|
{
|
|
8374
8641
|
type: "button",
|
|
8375
8642
|
disabled: blocked,
|
|
8376
8643
|
onClick: onConfirm,
|
|
8377
|
-
style:
|
|
8644
|
+
style: primaryBtn6,
|
|
8378
8645
|
"data-testid": "save-confirm",
|
|
8379
8646
|
children: messages.saveConfirm.confirm
|
|
8380
8647
|
}
|
|
@@ -8390,7 +8657,7 @@ var checkRow = {
|
|
|
8390
8657
|
color: colors.textPrimary,
|
|
8391
8658
|
margin: "8px 0"
|
|
8392
8659
|
};
|
|
8393
|
-
var
|
|
8660
|
+
var ghostBtn9 = {
|
|
8394
8661
|
padding: "6px 12px",
|
|
8395
8662
|
background: "white",
|
|
8396
8663
|
border: `1px solid ${colors.border}`,
|
|
@@ -8398,18 +8665,18 @@ var ghostBtn8 = {
|
|
|
8398
8665
|
fontSize: 13,
|
|
8399
8666
|
cursor: "pointer"
|
|
8400
8667
|
};
|
|
8401
|
-
var
|
|
8402
|
-
...
|
|
8668
|
+
var primaryBtn6 = {
|
|
8669
|
+
...ghostBtn9,
|
|
8403
8670
|
background: colors.primary,
|
|
8404
8671
|
color: "white",
|
|
8405
8672
|
borderColor: colors.primary
|
|
8406
8673
|
};
|
|
8407
8674
|
|
|
8408
8675
|
// src/save/ConflictBanner.tsx
|
|
8409
|
-
var
|
|
8676
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
8410
8677
|
function ConflictBanner({ onReload, onForceOverwrite }) {
|
|
8411
8678
|
const messages = useMessages();
|
|
8412
|
-
return /* @__PURE__ */ (0,
|
|
8679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
8413
8680
|
"div",
|
|
8414
8681
|
{
|
|
8415
8682
|
style: {
|
|
@@ -8425,8 +8692,8 @@ function ConflictBanner({ onReload, onForceOverwrite }) {
|
|
|
8425
8692
|
role: "alert",
|
|
8426
8693
|
"data-testid": "conflict-banner",
|
|
8427
8694
|
children: [
|
|
8428
|
-
/* @__PURE__ */ (0,
|
|
8429
|
-
/* @__PURE__ */ (0,
|
|
8695
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { style: { flex: 1 }, children: messages.conflict.message }),
|
|
8696
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
8430
8697
|
"button",
|
|
8431
8698
|
{
|
|
8432
8699
|
type: "button",
|
|
@@ -8436,7 +8703,7 @@ function ConflictBanner({ onReload, onForceOverwrite }) {
|
|
|
8436
8703
|
children: messages.conflict.reload
|
|
8437
8704
|
}
|
|
8438
8705
|
),
|
|
8439
|
-
/* @__PURE__ */ (0,
|
|
8706
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
8440
8707
|
"button",
|
|
8441
8708
|
{
|
|
8442
8709
|
type: "button",
|