@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.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/components/WorkflowEditor.tsx
|
|
2
|
-
import { useCallback as useCallback3, useEffect as
|
|
2
|
+
import { useCallback as useCallback3, useEffect as useEffect12, useMemo as useMemo7, useRef as useRef15, useState as useState18 } from "react";
|
|
3
3
|
import {
|
|
4
4
|
applyPatch as applyPatch2,
|
|
5
5
|
invertPatch as invertPatch2,
|
|
@@ -96,6 +96,12 @@ var defaultMessages = {
|
|
|
96
96
|
processes: "Processes",
|
|
97
97
|
criterion: "Criterion",
|
|
98
98
|
criteria: "Criteria",
|
|
99
|
+
annotations: "Annotations",
|
|
100
|
+
annotationsAdd: "Add annotations",
|
|
101
|
+
annotationsApply: "Apply",
|
|
102
|
+
annotationsRevert: "Revert",
|
|
103
|
+
annotationsRemove: "Remove",
|
|
104
|
+
annotationsDocChanged: "Document changed underneath \u2014 Revert to reload.",
|
|
99
105
|
executionMode: "Execution mode",
|
|
100
106
|
addProcessor: "Add processor",
|
|
101
107
|
removeProcessor: "Remove",
|
|
@@ -243,6 +249,8 @@ function summarize(patch) {
|
|
|
243
249
|
return `Reorder processor`;
|
|
244
250
|
case "setCriterion":
|
|
245
251
|
return patch.criterion ? `Set criterion` : `Clear criterion`;
|
|
252
|
+
case "setAnnotations":
|
|
253
|
+
return patch.annotations ? `Set annotations` : `Clear annotations`;
|
|
246
254
|
case "setImportMode":
|
|
247
255
|
return `Set import mode to "${patch.mode}"`;
|
|
248
256
|
case "setEntity":
|
|
@@ -2726,7 +2734,17 @@ function CanvasInner({
|
|
|
2726
2734
|
onHelp && /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
2727
2735
|
/* @__PURE__ */ jsx5("div", { style: { height: 1, background: "#E2E8F0" } }),
|
|
2728
2736
|
/* @__PURE__ */ jsx5(CtrlBtn, { onClick: onHelp, title: helpLabel ?? "Help", testId: "canvas-help", children: /* @__PURE__ */ jsx5(HelpIcon, {}) })
|
|
2729
|
-
] })
|
|
2737
|
+
] }),
|
|
2738
|
+
/* @__PURE__ */ jsx5("div", { style: { height: 1, background: "#E2E8F0" } }),
|
|
2739
|
+
/* @__PURE__ */ jsx5(
|
|
2740
|
+
CtrlBtn,
|
|
2741
|
+
{
|
|
2742
|
+
onClick: () => onSelectionChange(activeWorkflow ? { kind: "workflow", workflow: activeWorkflow } : null),
|
|
2743
|
+
title: "Workflow settings",
|
|
2744
|
+
testId: "canvas-workflow-settings",
|
|
2745
|
+
children: /* @__PURE__ */ jsx5(WorkflowSettingsIcon, {})
|
|
2746
|
+
}
|
|
2747
|
+
)
|
|
2730
2748
|
]
|
|
2731
2749
|
}
|
|
2732
2750
|
),
|
|
@@ -2846,6 +2864,16 @@ function HelpIcon() {
|
|
|
2846
2864
|
/* @__PURE__ */ jsx5("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
2847
2865
|
] });
|
|
2848
2866
|
}
|
|
2867
|
+
function WorkflowSettingsIcon() {
|
|
2868
|
+
return /* @__PURE__ */ jsxs4("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2869
|
+
/* @__PURE__ */ jsx5("line", { x1: "4", y1: "6", x2: "20", y2: "6" }),
|
|
2870
|
+
/* @__PURE__ */ jsx5("line", { x1: "4", y1: "12", x2: "20", y2: "12" }),
|
|
2871
|
+
/* @__PURE__ */ jsx5("line", { x1: "4", y1: "18", x2: "20", y2: "18" }),
|
|
2872
|
+
/* @__PURE__ */ jsx5("circle", { cx: "9", cy: "6", r: "2", fill: "white" }),
|
|
2873
|
+
/* @__PURE__ */ jsx5("circle", { cx: "15", cy: "12", r: "2", fill: "white" }),
|
|
2874
|
+
/* @__PURE__ */ jsx5("circle", { cx: "8", cy: "18", r: "2", fill: "white" })
|
|
2875
|
+
] });
|
|
2876
|
+
}
|
|
2849
2877
|
function Canvas(props) {
|
|
2850
2878
|
return /* @__PURE__ */ jsx5(ReactFlowProvider, { children: /* @__PURE__ */ jsx5(CanvasInner, { ...props }) });
|
|
2851
2879
|
}
|
|
@@ -2866,7 +2894,7 @@ function resolveConnection(doc, connection) {
|
|
|
2866
2894
|
}
|
|
2867
2895
|
|
|
2868
2896
|
// src/inspector/Inspector.tsx
|
|
2869
|
-
import { useMemo as useMemo4, useState as
|
|
2897
|
+
import { useMemo as useMemo4, useState as useState11 } from "react";
|
|
2870
2898
|
import { serializeEditorDocument } from "@cyoda/workflow-core";
|
|
2871
2899
|
|
|
2872
2900
|
// src/style/tokens.ts
|
|
@@ -3331,16 +3359,247 @@ var smallSelectStyle = {
|
|
|
3331
3359
|
userSelect: "none"
|
|
3332
3360
|
};
|
|
3333
3361
|
|
|
3334
|
-
// src/inspector/
|
|
3362
|
+
// src/inspector/AnnotationsField.tsx
|
|
3363
|
+
import { useEffect as useEffect3, useRef as useRef5, useState as useState6 } from "react";
|
|
3364
|
+
|
|
3365
|
+
// src/inspector/CriterionMonacoContext.tsx
|
|
3366
|
+
import { createContext as createContext3, useContext as useContext4 } from "react";
|
|
3367
|
+
var CriterionMonacoContext = createContext3(null);
|
|
3368
|
+
var CriterionMonacoProvider = CriterionMonacoContext.Provider;
|
|
3369
|
+
function useCriterionMonaco() {
|
|
3370
|
+
return useContext4(CriterionMonacoContext);
|
|
3371
|
+
}
|
|
3372
|
+
|
|
3373
|
+
// src/components/monacoDisposal.ts
|
|
3374
|
+
var installed = false;
|
|
3375
|
+
function isMonacoCanceled(reason) {
|
|
3376
|
+
if (reason == null || typeof reason !== "object") return false;
|
|
3377
|
+
return reason.name === "Canceled";
|
|
3378
|
+
}
|
|
3379
|
+
function installMonacoCancellationFilter() {
|
|
3380
|
+
if (installed || typeof window === "undefined") return;
|
|
3381
|
+
installed = true;
|
|
3382
|
+
window.addEventListener("unhandledrejection", (e) => {
|
|
3383
|
+
if (isMonacoCanceled(e.reason)) e.preventDefault();
|
|
3384
|
+
});
|
|
3385
|
+
}
|
|
3386
|
+
installMonacoCancellationFilter();
|
|
3387
|
+
|
|
3388
|
+
// src/inspector/annotationsJson.ts
|
|
3389
|
+
import { ANNOTATIONS_MAX_BYTES } from "@cyoda/workflow-core";
|
|
3390
|
+
function annotationsModelUri(key) {
|
|
3391
|
+
return `cyoda://annotations/${key}.json`;
|
|
3392
|
+
}
|
|
3393
|
+
function annotationBytes(value) {
|
|
3394
|
+
return new TextEncoder().encode(JSON.stringify(value)).length;
|
|
3395
|
+
}
|
|
3396
|
+
function sameJson(a, b) {
|
|
3397
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
3398
|
+
}
|
|
3399
|
+
function parseAnnotationsJson(text) {
|
|
3400
|
+
let raw;
|
|
3401
|
+
try {
|
|
3402
|
+
raw = JSON.parse(text);
|
|
3403
|
+
} catch {
|
|
3404
|
+
return { annotations: null, error: "Invalid JSON." };
|
|
3405
|
+
}
|
|
3406
|
+
if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
|
|
3407
|
+
return { annotations: null, error: "Annotations must be a JSON object." };
|
|
3408
|
+
}
|
|
3409
|
+
const bytes = annotationBytes(raw);
|
|
3410
|
+
if (bytes > ANNOTATIONS_MAX_BYTES) {
|
|
3411
|
+
return {
|
|
3412
|
+
annotations: null,
|
|
3413
|
+
error: `Annotations are ${bytes} bytes, over the ${ANNOTATIONS_MAX_BYTES}-byte limit.`
|
|
3414
|
+
};
|
|
3415
|
+
}
|
|
3416
|
+
return { annotations: raw, error: null };
|
|
3417
|
+
}
|
|
3418
|
+
|
|
3419
|
+
// src/inspector/AnnotationsField.tsx
|
|
3335
3420
|
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
3421
|
+
var pretty = (v) => JSON.stringify(v, null, 2);
|
|
3422
|
+
function AnnotationsField(props) {
|
|
3423
|
+
const messages = useMessages();
|
|
3424
|
+
if (props.value === void 0) {
|
|
3425
|
+
return /* @__PURE__ */ jsxs6("div", { style: sectionStyle, children: [
|
|
3426
|
+
props.showLabel !== false && /* @__PURE__ */ jsx7(SectionLabel, {}),
|
|
3427
|
+
!props.disabled && /* @__PURE__ */ jsx7(
|
|
3428
|
+
"button",
|
|
3429
|
+
{
|
|
3430
|
+
type: "button",
|
|
3431
|
+
style: primaryBtn,
|
|
3432
|
+
"data-testid": "inspector-annotations-add",
|
|
3433
|
+
onClick: () => props.onCommit({}),
|
|
3434
|
+
children: messages.inspector.annotationsAdd
|
|
3435
|
+
}
|
|
3436
|
+
)
|
|
3437
|
+
] });
|
|
3438
|
+
}
|
|
3439
|
+
return /* @__PURE__ */ jsx7(AnnotationsEditor, { ...props, value: props.value }, props.modelKey);
|
|
3440
|
+
}
|
|
3441
|
+
function AnnotationsEditor({
|
|
3442
|
+
value,
|
|
3443
|
+
disabled,
|
|
3444
|
+
modelKey,
|
|
3445
|
+
onCommit,
|
|
3446
|
+
onRemove,
|
|
3447
|
+
showLabel
|
|
3448
|
+
}) {
|
|
3449
|
+
const messages = useMessages();
|
|
3450
|
+
const monaco = useCriterionMonaco();
|
|
3451
|
+
const [buffer, setBuffer] = useState6(() => pretty(value));
|
|
3452
|
+
const [docChanged, setDocChanged] = useState6(false);
|
|
3453
|
+
const prevValueRef = useRef5(value);
|
|
3454
|
+
useEffect3(() => {
|
|
3455
|
+
if (sameJson(prevValueRef.current, value)) return;
|
|
3456
|
+
const parsed = parseAnnotationsJson(buffer).annotations;
|
|
3457
|
+
if (parsed !== null && sameJson(parsed, value)) {
|
|
3458
|
+
setDocChanged(false);
|
|
3459
|
+
} else if (parsed !== null && sameJson(parsed, prevValueRef.current)) {
|
|
3460
|
+
setBuffer(pretty(value));
|
|
3461
|
+
setDocChanged(false);
|
|
3462
|
+
} else {
|
|
3463
|
+
setDocChanged(true);
|
|
3464
|
+
}
|
|
3465
|
+
prevValueRef.current = value;
|
|
3466
|
+
}, [value, buffer]);
|
|
3467
|
+
const result = parseAnnotationsJson(buffer);
|
|
3468
|
+
const dirty = result.annotations !== null && !sameJson(result.annotations, value);
|
|
3469
|
+
const applyEnabled = !disabled && result.annotations !== null && dirty;
|
|
3470
|
+
const apply = () => {
|
|
3471
|
+
if (!applyEnabled || result.annotations === null) return;
|
|
3472
|
+
onCommit(result.annotations);
|
|
3473
|
+
setDocChanged(false);
|
|
3474
|
+
};
|
|
3475
|
+
const revert = () => {
|
|
3476
|
+
setBuffer(pretty(value));
|
|
3477
|
+
setDocChanged(false);
|
|
3478
|
+
};
|
|
3479
|
+
return /* @__PURE__ */ jsxs6("div", { style: sectionStyle, children: [
|
|
3480
|
+
showLabel !== false && /* @__PURE__ */ jsx7(SectionLabel, {}),
|
|
3481
|
+
monaco ? /* @__PURE__ */ jsx7(
|
|
3482
|
+
MonacoJsonPane,
|
|
3483
|
+
{
|
|
3484
|
+
monaco,
|
|
3485
|
+
buffer,
|
|
3486
|
+
disabled,
|
|
3487
|
+
modelUri: annotationsModelUri(modelKey),
|
|
3488
|
+
onChange: setBuffer
|
|
3489
|
+
}
|
|
3490
|
+
) : /* @__PURE__ */ jsx7(
|
|
3491
|
+
"textarea",
|
|
3492
|
+
{
|
|
3493
|
+
value: buffer,
|
|
3494
|
+
disabled,
|
|
3495
|
+
rows: 12,
|
|
3496
|
+
"data-testid": "annotations-json-editor",
|
|
3497
|
+
style: textareaStyle,
|
|
3498
|
+
onChange: (e) => setBuffer(e.target.value)
|
|
3499
|
+
}
|
|
3500
|
+
),
|
|
3501
|
+
result.error && /* @__PURE__ */ jsx7("div", { role: "alert", "data-testid": "annotations-error", style: errorStyle, children: result.error }),
|
|
3502
|
+
docChanged && /* @__PURE__ */ jsx7("div", { role: "alert", "data-testid": "annotations-doc-changed", style: warnStyle, children: messages.inspector.annotationsDocChanged }),
|
|
3503
|
+
!disabled && /* @__PURE__ */ jsxs6("div", { style: { display: "flex", gap: 6, flexWrap: "wrap" }, children: [
|
|
3504
|
+
/* @__PURE__ */ jsx7(
|
|
3505
|
+
"button",
|
|
3506
|
+
{
|
|
3507
|
+
type: "button",
|
|
3508
|
+
onClick: apply,
|
|
3509
|
+
disabled: !applyEnabled,
|
|
3510
|
+
style: applyEnabled ? primaryBtn : disabledBtn,
|
|
3511
|
+
"data-testid": "inspector-annotations-apply",
|
|
3512
|
+
children: messages.inspector.annotationsApply
|
|
3513
|
+
}
|
|
3514
|
+
),
|
|
3515
|
+
/* @__PURE__ */ jsx7("button", { type: "button", onClick: revert, disabled: !dirty, style: ghostBtn, "data-testid": "inspector-annotations-revert", children: messages.inspector.annotationsRevert }),
|
|
3516
|
+
/* @__PURE__ */ jsx7("button", { type: "button", onClick: onRemove, style: dangerBtn, "data-testid": "inspector-annotations-remove", children: messages.inspector.annotationsRemove })
|
|
3517
|
+
] })
|
|
3518
|
+
] });
|
|
3519
|
+
}
|
|
3520
|
+
function MonacoJsonPane({
|
|
3521
|
+
monaco,
|
|
3522
|
+
buffer,
|
|
3523
|
+
disabled,
|
|
3524
|
+
modelUri,
|
|
3525
|
+
onChange
|
|
3526
|
+
}) {
|
|
3527
|
+
const containerRef = useRef5(null);
|
|
3528
|
+
const editorRef = useRef5(null);
|
|
3529
|
+
const modelRef = useRef5(null);
|
|
3530
|
+
useEffect3(() => {
|
|
3531
|
+
if (!containerRef.current || editorRef.current) return;
|
|
3532
|
+
const model = monaco.editor.createModel(buffer, "json", monaco.Uri.parse(modelUri));
|
|
3533
|
+
modelRef.current = model;
|
|
3534
|
+
const editor = monaco.editor.create(containerRef.current, {
|
|
3535
|
+
model,
|
|
3536
|
+
automaticLayout: true,
|
|
3537
|
+
minimap: { enabled: false },
|
|
3538
|
+
fontSize: 13,
|
|
3539
|
+
tabSize: 2,
|
|
3540
|
+
scrollBeyondLastLine: false,
|
|
3541
|
+
theme: "vs",
|
|
3542
|
+
readOnly: disabled
|
|
3543
|
+
});
|
|
3544
|
+
editorRef.current = editor;
|
|
3545
|
+
installMonacoCancellationFilter();
|
|
3546
|
+
const sub = model.onDidChangeContent(() => onChange(model.getValue()));
|
|
3547
|
+
return () => {
|
|
3548
|
+
sub.dispose();
|
|
3549
|
+
editor.dispose();
|
|
3550
|
+
editorRef.current = null;
|
|
3551
|
+
model.dispose();
|
|
3552
|
+
modelRef.current = null;
|
|
3553
|
+
};
|
|
3554
|
+
}, [monaco, modelUri]);
|
|
3555
|
+
useEffect3(() => {
|
|
3556
|
+
const model = modelRef.current;
|
|
3557
|
+
if (model && model.getValue() !== buffer) model.setValue(buffer);
|
|
3558
|
+
}, [buffer]);
|
|
3559
|
+
useEffect3(() => {
|
|
3560
|
+
editorRef.current?.updateOptions?.({ readOnly: disabled });
|
|
3561
|
+
}, [disabled]);
|
|
3562
|
+
return /* @__PURE__ */ jsx7(
|
|
3563
|
+
"div",
|
|
3564
|
+
{
|
|
3565
|
+
ref: containerRef,
|
|
3566
|
+
"data-testid": "annotations-json-editor",
|
|
3567
|
+
style: { height: 220, border: `1px solid ${colors.border}`, borderRadius: radii.sm }
|
|
3568
|
+
}
|
|
3569
|
+
);
|
|
3570
|
+
}
|
|
3571
|
+
function SectionLabel() {
|
|
3572
|
+
const messages = useMessages();
|
|
3573
|
+
return /* @__PURE__ */ jsx7("span", { style: { fontSize: 11, fontWeight: 600, letterSpacing: "0.08em", textTransform: "uppercase", color: colors.textSecondary }, children: messages.inspector.annotations });
|
|
3574
|
+
}
|
|
3575
|
+
var sectionStyle = { display: "flex", flexDirection: "column", gap: 8 };
|
|
3576
|
+
var textareaStyle = {
|
|
3577
|
+
fontFamily: fonts.mono,
|
|
3578
|
+
fontSize: 12,
|
|
3579
|
+
padding: 8,
|
|
3580
|
+
minHeight: 180,
|
|
3581
|
+
border: `1px solid ${colors.border}`,
|
|
3582
|
+
borderRadius: radii.sm,
|
|
3583
|
+
background: "white",
|
|
3584
|
+
resize: "vertical"
|
|
3585
|
+
};
|
|
3586
|
+
var ghostBtn = { padding: "6px 10px", background: "white", border: `1px solid ${colors.border}`, borderRadius: radii.sm, fontSize: 12, cursor: "pointer" };
|
|
3587
|
+
var primaryBtn = { ...ghostBtn, background: colors.primary, color: "white", borderColor: colors.primary };
|
|
3588
|
+
var disabledBtn = { ...primaryBtn, opacity: 0.5, cursor: "not-allowed" };
|
|
3589
|
+
var dangerBtn = { ...ghostBtn, background: colors.dangerBg, borderColor: colors.dangerBorder, color: colors.danger };
|
|
3590
|
+
var errorStyle = { color: colors.danger, fontSize: 11 };
|
|
3591
|
+
var warnStyle = { color: colors.warning, fontSize: 11 };
|
|
3592
|
+
|
|
3593
|
+
// src/inspector/WorkflowForm.tsx
|
|
3594
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
3336
3595
|
function WorkflowForm({
|
|
3337
3596
|
workflow,
|
|
3338
3597
|
disabled,
|
|
3339
3598
|
onDispatch
|
|
3340
3599
|
}) {
|
|
3341
3600
|
const messages = useMessages();
|
|
3342
|
-
return /* @__PURE__ */
|
|
3343
|
-
/* @__PURE__ */
|
|
3601
|
+
return /* @__PURE__ */ jsxs7(FieldGroup, { title: messages.inspector.properties, children: [
|
|
3602
|
+
/* @__PURE__ */ jsx8(
|
|
3344
3603
|
TextField,
|
|
3345
3604
|
{
|
|
3346
3605
|
label: messages.inspector.name,
|
|
@@ -3350,7 +3609,7 @@ function WorkflowForm({
|
|
|
3350
3609
|
testId: "inspector-workflow-name"
|
|
3351
3610
|
}
|
|
3352
3611
|
),
|
|
3353
|
-
/* @__PURE__ */
|
|
3612
|
+
/* @__PURE__ */ jsx8(
|
|
3354
3613
|
TextField,
|
|
3355
3614
|
{
|
|
3356
3615
|
label: messages.inspector.version,
|
|
@@ -3365,7 +3624,7 @@ function WorkflowForm({
|
|
|
3365
3624
|
testId: "inspector-workflow-version"
|
|
3366
3625
|
}
|
|
3367
3626
|
),
|
|
3368
|
-
/* @__PURE__ */
|
|
3627
|
+
/* @__PURE__ */ jsx8(
|
|
3369
3628
|
TextField,
|
|
3370
3629
|
{
|
|
3371
3630
|
label: messages.inspector.description,
|
|
@@ -3381,7 +3640,7 @@ function WorkflowForm({
|
|
|
3381
3640
|
testId: "inspector-workflow-desc"
|
|
3382
3641
|
}
|
|
3383
3642
|
),
|
|
3384
|
-
/* @__PURE__ */
|
|
3643
|
+
/* @__PURE__ */ jsx8(
|
|
3385
3644
|
CheckboxField,
|
|
3386
3645
|
{
|
|
3387
3646
|
label: messages.inspector.active,
|
|
@@ -3395,7 +3654,7 @@ function WorkflowForm({
|
|
|
3395
3654
|
testId: "inspector-workflow-active"
|
|
3396
3655
|
}
|
|
3397
3656
|
),
|
|
3398
|
-
/* @__PURE__ */
|
|
3657
|
+
/* @__PURE__ */ jsx8(
|
|
3399
3658
|
TextField,
|
|
3400
3659
|
{
|
|
3401
3660
|
label: messages.inspector.initialState,
|
|
@@ -3409,14 +3668,24 @@ function WorkflowForm({
|
|
|
3409
3668
|
}),
|
|
3410
3669
|
testId: "inspector-workflow-initial"
|
|
3411
3670
|
}
|
|
3671
|
+
),
|
|
3672
|
+
/* @__PURE__ */ jsx8(
|
|
3673
|
+
AnnotationsField,
|
|
3674
|
+
{
|
|
3675
|
+
value: workflow.annotations,
|
|
3676
|
+
disabled,
|
|
3677
|
+
modelKey: `workflow-${workflow.name}`,
|
|
3678
|
+
onCommit: (annotations) => onDispatch({ op: "setAnnotations", target: { kind: "workflow", workflow: workflow.name }, annotations }),
|
|
3679
|
+
onRemove: () => onDispatch({ op: "setAnnotations", target: { kind: "workflow", workflow: workflow.name } })
|
|
3680
|
+
}
|
|
3412
3681
|
)
|
|
3413
3682
|
] });
|
|
3414
3683
|
}
|
|
3415
3684
|
|
|
3416
3685
|
// src/inspector/StateForm.tsx
|
|
3417
|
-
import { useState as
|
|
3686
|
+
import { useState as useState7 } from "react";
|
|
3418
3687
|
import { NAME_REGEX } from "@cyoda/workflow-core";
|
|
3419
|
-
import { jsx as
|
|
3688
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3420
3689
|
function StateForm({
|
|
3421
3690
|
workflow,
|
|
3422
3691
|
stateCode,
|
|
@@ -3427,7 +3696,7 @@ function StateForm({
|
|
|
3427
3696
|
onRequestDelete
|
|
3428
3697
|
}) {
|
|
3429
3698
|
const messages = useMessages();
|
|
3430
|
-
const [renameError, setRenameError] =
|
|
3699
|
+
const [renameError, setRenameError] = useState7(null);
|
|
3431
3700
|
const outgoing = state.transitions.length;
|
|
3432
3701
|
const incoming = Object.values(workflow.states).reduce(
|
|
3433
3702
|
(n, s) => n + s.transitions.filter((t) => t.next === stateCode).length,
|
|
@@ -3450,8 +3719,8 @@ function StateForm({
|
|
|
3450
3719
|
}
|
|
3451
3720
|
onDispatch({ op: "renameState", workflow: workflow.name, from: stateCode, to: next });
|
|
3452
3721
|
};
|
|
3453
|
-
return /* @__PURE__ */
|
|
3454
|
-
/* @__PURE__ */
|
|
3722
|
+
return /* @__PURE__ */ jsxs8(FieldGroup, { title: messages.inspector.properties, children: [
|
|
3723
|
+
/* @__PURE__ */ jsx9(
|
|
3455
3724
|
TextField,
|
|
3456
3725
|
{
|
|
3457
3726
|
label: messages.inspector.name,
|
|
@@ -3462,29 +3731,29 @@ function StateForm({
|
|
|
3462
3731
|
testId: "inspector-state-name"
|
|
3463
3732
|
}
|
|
3464
3733
|
),
|
|
3465
|
-
renameError && /* @__PURE__ */
|
|
3466
|
-
(isInitial || isTerminal || isUnreachable) && /* @__PURE__ */
|
|
3467
|
-
isInitial && /* @__PURE__ */
|
|
3468
|
-
isTerminal && /* @__PURE__ */
|
|
3469
|
-
isUnreachable && /* @__PURE__ */
|
|
3734
|
+
renameError && /* @__PURE__ */ jsx9("div", { role: "alert", style: { color: colors.danger, fontSize: 12 }, children: renameError }),
|
|
3735
|
+
(isInitial || isTerminal || isUnreachable) && /* @__PURE__ */ jsxs8("div", { style: { display: "flex", gap: 6, flexWrap: "wrap" }, children: [
|
|
3736
|
+
isInitial && /* @__PURE__ */ jsx9(StateBadge, { color: "#15803d", bg: "#f0fdf4", label: "Initial" }),
|
|
3737
|
+
isTerminal && /* @__PURE__ */ jsx9(StateBadge, { color: "#0369a1", bg: "#eff6ff", label: "Terminal" }),
|
|
3738
|
+
isUnreachable && /* @__PURE__ */ jsx9(StateBadge, { color: colors.warning, bg: colors.warningBg, label: "Unreachable" })
|
|
3470
3739
|
] }),
|
|
3471
|
-
/* @__PURE__ */
|
|
3740
|
+
/* @__PURE__ */ jsxs8("div", { style: { fontSize: 12, color: colors.textSecondary }, children: [
|
|
3472
3741
|
outgoing,
|
|
3473
3742
|
" outgoing \xB7 ",
|
|
3474
3743
|
incoming,
|
|
3475
3744
|
" incoming"
|
|
3476
3745
|
] }),
|
|
3477
|
-
!isInitial && !disabled && /* @__PURE__ */
|
|
3746
|
+
!isInitial && !disabled && /* @__PURE__ */ jsx9(
|
|
3478
3747
|
"button",
|
|
3479
3748
|
{
|
|
3480
3749
|
type: "button",
|
|
3481
3750
|
onClick: () => onDispatch({ op: "setInitialState", workflow: workflow.name, stateCode }),
|
|
3482
|
-
style:
|
|
3751
|
+
style: ghostBtn2,
|
|
3483
3752
|
"data-testid": "inspector-state-set-initial",
|
|
3484
3753
|
children: "Set as Initial State"
|
|
3485
3754
|
}
|
|
3486
3755
|
),
|
|
3487
|
-
issues && issues.length > 0 && /* @__PURE__ */
|
|
3756
|
+
issues && issues.length > 0 && /* @__PURE__ */ jsx9("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: issues.map((issue, i) => /* @__PURE__ */ jsx9(
|
|
3488
3757
|
"div",
|
|
3489
3758
|
{
|
|
3490
3759
|
role: "alert",
|
|
@@ -3500,21 +3769,31 @@ function StateForm({
|
|
|
3500
3769
|
},
|
|
3501
3770
|
`${issue.code}-${i}`
|
|
3502
3771
|
)) }),
|
|
3503
|
-
/* @__PURE__ */
|
|
3772
|
+
/* @__PURE__ */ jsx9(
|
|
3773
|
+
AnnotationsField,
|
|
3774
|
+
{
|
|
3775
|
+
value: state.annotations,
|
|
3776
|
+
disabled,
|
|
3777
|
+
modelKey: `state-${workflow.name}-${stateCode}`,
|
|
3778
|
+
onCommit: (annotations) => onDispatch({ op: "setAnnotations", target: { kind: "state", workflow: workflow.name, stateCode }, annotations }),
|
|
3779
|
+
onRemove: () => onDispatch({ op: "setAnnotations", target: { kind: "state", workflow: workflow.name, stateCode } })
|
|
3780
|
+
}
|
|
3781
|
+
),
|
|
3782
|
+
/* @__PURE__ */ jsx9(
|
|
3504
3783
|
"button",
|
|
3505
3784
|
{
|
|
3506
3785
|
type: "button",
|
|
3507
3786
|
onClick: onRequestDelete,
|
|
3508
3787
|
disabled,
|
|
3509
3788
|
"data-testid": "inspector-state-delete",
|
|
3510
|
-
style:
|
|
3789
|
+
style: dangerBtn2,
|
|
3511
3790
|
children: "Delete state\u2026"
|
|
3512
3791
|
}
|
|
3513
3792
|
)
|
|
3514
3793
|
] });
|
|
3515
3794
|
}
|
|
3516
3795
|
function StateBadge({ color, bg, label }) {
|
|
3517
|
-
return /* @__PURE__ */
|
|
3796
|
+
return /* @__PURE__ */ jsx9(
|
|
3518
3797
|
"span",
|
|
3519
3798
|
{
|
|
3520
3799
|
style: {
|
|
@@ -3546,7 +3825,7 @@ function reachableStates(wf) {
|
|
|
3546
3825
|
}
|
|
3547
3826
|
return visited;
|
|
3548
3827
|
}
|
|
3549
|
-
var
|
|
3828
|
+
var ghostBtn2 = {
|
|
3550
3829
|
alignSelf: "flex-start",
|
|
3551
3830
|
padding: "5px 10px",
|
|
3552
3831
|
background: "white",
|
|
@@ -3555,7 +3834,7 @@ var ghostBtn = {
|
|
|
3555
3834
|
fontSize: 13,
|
|
3556
3835
|
cursor: "pointer"
|
|
3557
3836
|
};
|
|
3558
|
-
var
|
|
3837
|
+
var dangerBtn2 = {
|
|
3559
3838
|
alignSelf: "flex-start",
|
|
3560
3839
|
padding: "6px 10px",
|
|
3561
3840
|
background: colors.dangerBg,
|
|
@@ -3567,15 +3846,15 @@ var dangerBtn = {
|
|
|
3567
3846
|
};
|
|
3568
3847
|
|
|
3569
3848
|
// src/inspector/TransitionForm.tsx
|
|
3570
|
-
import { useRef as
|
|
3849
|
+
import { useRef as useRef8, useState as useState10 } from "react";
|
|
3571
3850
|
import { NAME_REGEX as NAME_REGEX3 } from "@cyoda/workflow-core";
|
|
3572
3851
|
|
|
3573
3852
|
// src/inspector/CriterionForm.tsx
|
|
3574
|
-
import { useState as
|
|
3853
|
+
import { useState as useState8 } from "react";
|
|
3575
3854
|
|
|
3576
3855
|
// src/modals/DeleteStateModal.tsx
|
|
3577
|
-
import { useEffect as
|
|
3578
|
-
import { jsx as
|
|
3856
|
+
import { useEffect as useEffect4, useMemo as useMemo3, useRef as useRef6 } from "react";
|
|
3857
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3579
3858
|
function countAffected(doc, workflow, stateCode) {
|
|
3580
3859
|
let outgoing = 0;
|
|
3581
3860
|
let incoming = 0;
|
|
@@ -3601,20 +3880,20 @@ function DeleteStateModal({
|
|
|
3601
3880
|
() => countAffected(doc, workflow, stateCode),
|
|
3602
3881
|
[doc, workflow, stateCode]
|
|
3603
3882
|
);
|
|
3604
|
-
return /* @__PURE__ */
|
|
3605
|
-
/* @__PURE__ */
|
|
3606
|
-
/* @__PURE__ */
|
|
3607
|
-
/* @__PURE__ */
|
|
3608
|
-
/* @__PURE__ */
|
|
3609
|
-
/* @__PURE__ */
|
|
3883
|
+
return /* @__PURE__ */ jsxs9(ModalFrame, { onCancel, children: [
|
|
3884
|
+
/* @__PURE__ */ jsx10("h2", { style: { margin: 0, fontSize: 16 }, children: messages.confirmDelete.title }),
|
|
3885
|
+
/* @__PURE__ */ jsx10("p", { style: { margin: "12px 0", fontSize: 13, color: colors.textSecondary }, children: messages.confirmDelete.message }),
|
|
3886
|
+
/* @__PURE__ */ jsxs9("div", { style: { padding: 8, background: colors.surfaceMuted, border: `1px solid ${colors.borderSubtle}`, borderRadius: radii.sm, fontSize: 13 }, children: [
|
|
3887
|
+
/* @__PURE__ */ jsx10("strong", { children: stateCode }),
|
|
3888
|
+
/* @__PURE__ */ jsxs9("div", { style: { color: colors.textSecondary }, children: [
|
|
3610
3889
|
messages.confirmDelete.transitionsAffected,
|
|
3611
3890
|
": ",
|
|
3612
3891
|
counts.outgoing + counts.incoming
|
|
3613
3892
|
] })
|
|
3614
3893
|
] }),
|
|
3615
|
-
/* @__PURE__ */
|
|
3616
|
-
/* @__PURE__ */
|
|
3617
|
-
/* @__PURE__ */
|
|
3894
|
+
/* @__PURE__ */ jsxs9("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, marginTop: 16 }, children: [
|
|
3895
|
+
/* @__PURE__ */ jsx10("button", { type: "button", onClick: onCancel, style: ghostBtn3, "data-testid": "modal-delete-cancel", children: messages.confirmDelete.cancel }),
|
|
3896
|
+
/* @__PURE__ */ jsx10("button", { type: "button", onClick: onConfirm, style: dangerBtn3, "data-testid": "modal-delete-confirm", children: messages.confirmDelete.confirm })
|
|
3618
3897
|
] })
|
|
3619
3898
|
] });
|
|
3620
3899
|
}
|
|
@@ -3623,9 +3902,9 @@ function ModalFrame({
|
|
|
3623
3902
|
onCancel,
|
|
3624
3903
|
labelledBy
|
|
3625
3904
|
}) {
|
|
3626
|
-
const frameRef =
|
|
3627
|
-
const previousFocusRef =
|
|
3628
|
-
|
|
3905
|
+
const frameRef = useRef6(null);
|
|
3906
|
+
const previousFocusRef = useRef6(null);
|
|
3907
|
+
useEffect4(() => {
|
|
3629
3908
|
previousFocusRef.current = document.activeElement ?? null;
|
|
3630
3909
|
const node = frameRef.current;
|
|
3631
3910
|
if (node) {
|
|
@@ -3638,7 +3917,7 @@ function ModalFrame({
|
|
|
3638
3917
|
previousFocusRef.current?.focus?.();
|
|
3639
3918
|
};
|
|
3640
3919
|
}, []);
|
|
3641
|
-
return /* @__PURE__ */
|
|
3920
|
+
return /* @__PURE__ */ jsx10(
|
|
3642
3921
|
"div",
|
|
3643
3922
|
{
|
|
3644
3923
|
onClick: onCancel,
|
|
@@ -3658,7 +3937,7 @@ function ModalFrame({
|
|
|
3658
3937
|
zIndex: 1e3
|
|
3659
3938
|
},
|
|
3660
3939
|
"data-testid": "modal-backdrop",
|
|
3661
|
-
children: /* @__PURE__ */
|
|
3940
|
+
children: /* @__PURE__ */ jsx10(
|
|
3662
3941
|
"div",
|
|
3663
3942
|
{
|
|
3664
3943
|
ref: frameRef,
|
|
@@ -3684,7 +3963,7 @@ function ModalFrame({
|
|
|
3684
3963
|
}
|
|
3685
3964
|
);
|
|
3686
3965
|
}
|
|
3687
|
-
var
|
|
3966
|
+
var ghostBtn3 = {
|
|
3688
3967
|
padding: "6px 12px",
|
|
3689
3968
|
background: "white",
|
|
3690
3969
|
border: `1px solid ${colors.border}`,
|
|
@@ -3692,42 +3971,19 @@ var ghostBtn2 = {
|
|
|
3692
3971
|
fontSize: 13,
|
|
3693
3972
|
cursor: "pointer"
|
|
3694
3973
|
};
|
|
3695
|
-
var
|
|
3696
|
-
...
|
|
3974
|
+
var dangerBtn3 = {
|
|
3975
|
+
...ghostBtn3,
|
|
3697
3976
|
background: colors.danger,
|
|
3698
3977
|
color: "white",
|
|
3699
3978
|
borderColor: colors.danger
|
|
3700
3979
|
};
|
|
3701
3980
|
|
|
3702
3981
|
// src/inspector/CriterionJsonEditor.tsx
|
|
3703
|
-
import { useEffect as
|
|
3982
|
+
import { useEffect as useEffect5, useRef as useRef7 } from "react";
|
|
3704
3983
|
import {
|
|
3705
3984
|
registerCriterionSchema
|
|
3706
3985
|
} from "@cyoda/workflow-monaco";
|
|
3707
3986
|
|
|
3708
|
-
// src/inspector/CriterionMonacoContext.tsx
|
|
3709
|
-
import { createContext as createContext3, useContext as useContext4 } from "react";
|
|
3710
|
-
var CriterionMonacoContext = createContext3(null);
|
|
3711
|
-
var CriterionMonacoProvider = CriterionMonacoContext.Provider;
|
|
3712
|
-
function useCriterionMonaco() {
|
|
3713
|
-
return useContext4(CriterionMonacoContext);
|
|
3714
|
-
}
|
|
3715
|
-
|
|
3716
|
-
// src/components/monacoDisposal.ts
|
|
3717
|
-
var installed = false;
|
|
3718
|
-
function isMonacoCanceled(reason) {
|
|
3719
|
-
if (reason == null || typeof reason !== "object") return false;
|
|
3720
|
-
return reason.name === "Canceled";
|
|
3721
|
-
}
|
|
3722
|
-
function installMonacoCancellationFilter() {
|
|
3723
|
-
if (installed || typeof window === "undefined") return;
|
|
3724
|
-
installed = true;
|
|
3725
|
-
window.addEventListener("unhandledrejection", (e) => {
|
|
3726
|
-
if (isMonacoCanceled(e.reason)) e.preventDefault();
|
|
3727
|
-
});
|
|
3728
|
-
}
|
|
3729
|
-
installMonacoCancellationFilter();
|
|
3730
|
-
|
|
3731
3987
|
// src/inspector/criterionJson.ts
|
|
3732
3988
|
import { CriterionSchema, criterionBlockingError } from "@cyoda/workflow-core";
|
|
3733
3989
|
function criterionModelUri(key) {
|
|
@@ -3764,14 +4020,14 @@ function parseCriterionJson(text) {
|
|
|
3764
4020
|
}
|
|
3765
4021
|
|
|
3766
4022
|
// src/inspector/CriterionJsonEditor.tsx
|
|
3767
|
-
import { jsx as
|
|
4023
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
3768
4024
|
function CriterionJsonEditor({ value, disabled, modelKey, onChange }) {
|
|
3769
4025
|
const monaco = useCriterionMonaco();
|
|
3770
|
-
const onChangeRef =
|
|
4026
|
+
const onChangeRef = useRef7(onChange);
|
|
3771
4027
|
onChangeRef.current = onChange;
|
|
3772
|
-
const initialText =
|
|
4028
|
+
const initialText = useRef7(JSON.stringify(value, null, 2)).current;
|
|
3773
4029
|
if (monaco) {
|
|
3774
|
-
return /* @__PURE__ */
|
|
4030
|
+
return /* @__PURE__ */ jsx11(
|
|
3775
4031
|
MonacoCriterionEditor,
|
|
3776
4032
|
{
|
|
3777
4033
|
monaco,
|
|
@@ -3782,7 +4038,7 @@ function CriterionJsonEditor({ value, disabled, modelKey, onChange }) {
|
|
|
3782
4038
|
}
|
|
3783
4039
|
);
|
|
3784
4040
|
}
|
|
3785
|
-
return /* @__PURE__ */
|
|
4041
|
+
return /* @__PURE__ */ jsx11(
|
|
3786
4042
|
TextareaCriterionEditor,
|
|
3787
4043
|
{
|
|
3788
4044
|
initialText,
|
|
@@ -3796,10 +4052,10 @@ function TextareaCriterionEditor({
|
|
|
3796
4052
|
disabled,
|
|
3797
4053
|
onChangeRef
|
|
3798
4054
|
}) {
|
|
3799
|
-
|
|
4055
|
+
useEffect5(() => {
|
|
3800
4056
|
onChangeRef.current(parseCriterionJson(initialText));
|
|
3801
4057
|
}, [initialText, onChangeRef]);
|
|
3802
|
-
return /* @__PURE__ */
|
|
4058
|
+
return /* @__PURE__ */ jsx11(
|
|
3803
4059
|
"textarea",
|
|
3804
4060
|
{
|
|
3805
4061
|
defaultValue: initialText,
|
|
@@ -3818,9 +4074,9 @@ function MonacoCriterionEditor({
|
|
|
3818
4074
|
modelKey,
|
|
3819
4075
|
onChangeRef
|
|
3820
4076
|
}) {
|
|
3821
|
-
const containerRef =
|
|
3822
|
-
const editorRef =
|
|
3823
|
-
|
|
4077
|
+
const containerRef = useRef7(null);
|
|
4078
|
+
const editorRef = useRef7(null);
|
|
4079
|
+
useEffect5(() => {
|
|
3824
4080
|
if (!containerRef.current || editorRef.current) return;
|
|
3825
4081
|
const model = monaco.editor.createModel(
|
|
3826
4082
|
initialText,
|
|
@@ -3851,10 +4107,10 @@ function MonacoCriterionEditor({
|
|
|
3851
4107
|
model.dispose();
|
|
3852
4108
|
};
|
|
3853
4109
|
}, [monaco, modelKey]);
|
|
3854
|
-
|
|
4110
|
+
useEffect5(() => {
|
|
3855
4111
|
editorRef.current?.updateOptions?.({ readOnly: disabled });
|
|
3856
4112
|
}, [disabled]);
|
|
3857
|
-
return /* @__PURE__ */
|
|
4113
|
+
return /* @__PURE__ */ jsx11(
|
|
3858
4114
|
"div",
|
|
3859
4115
|
{
|
|
3860
4116
|
ref: containerRef,
|
|
@@ -3876,7 +4132,7 @@ var jsonTextAreaStyle = {
|
|
|
3876
4132
|
};
|
|
3877
4133
|
|
|
3878
4134
|
// src/inspector/CriterionForm.tsx
|
|
3879
|
-
import { Fragment as Fragment4, jsx as
|
|
4135
|
+
import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3880
4136
|
function defaultCriterion(type) {
|
|
3881
4137
|
switch (type) {
|
|
3882
4138
|
case "simple":
|
|
@@ -3903,7 +4159,7 @@ function CriterionSection({
|
|
|
3903
4159
|
onSelectionChange
|
|
3904
4160
|
}) {
|
|
3905
4161
|
const messages = useMessages();
|
|
3906
|
-
const [modalOpen, setModalOpen] =
|
|
4162
|
+
const [modalOpen, setModalOpen] = useState8(false);
|
|
3907
4163
|
const path = ["criterion"];
|
|
3908
4164
|
const removeCriterion = () => {
|
|
3909
4165
|
onDispatch({ op: "setCriterion", host, path, criterion: void 0 });
|
|
@@ -3911,8 +4167,8 @@ function CriterionSection({
|
|
|
3911
4167
|
onSelectionChange?.({ kind: "transition", transitionUuid: host.transitionUuid });
|
|
3912
4168
|
}
|
|
3913
4169
|
};
|
|
3914
|
-
return /* @__PURE__ */
|
|
3915
|
-
/* @__PURE__ */
|
|
4170
|
+
return /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
4171
|
+
/* @__PURE__ */ jsx12(
|
|
3916
4172
|
CriterionSummaryCard,
|
|
3917
4173
|
{
|
|
3918
4174
|
criterion,
|
|
@@ -3923,7 +4179,7 @@ function CriterionSection({
|
|
|
3923
4179
|
onRemove: removeCriterion
|
|
3924
4180
|
}
|
|
3925
4181
|
),
|
|
3926
|
-
modalOpen && /* @__PURE__ */
|
|
4182
|
+
modalOpen && /* @__PURE__ */ jsx12(
|
|
3927
4183
|
CriterionEditorModal,
|
|
3928
4184
|
{
|
|
3929
4185
|
title: criterion ? messages.criterion.editTitle : messages.criterion.addTitle,
|
|
@@ -3960,42 +4216,42 @@ function CriterionSummaryCard({
|
|
|
3960
4216
|
const messages = useMessages();
|
|
3961
4217
|
const m = messages.criterion;
|
|
3962
4218
|
if (!criterion) {
|
|
3963
|
-
return /* @__PURE__ */
|
|
3964
|
-
/* @__PURE__ */
|
|
3965
|
-
/* @__PURE__ */
|
|
3966
|
-
!manual && /* @__PURE__ */
|
|
3967
|
-
!disabled && /* @__PURE__ */
|
|
4219
|
+
return /* @__PURE__ */ jsxs10("div", { style: cardStyle, "data-testid": "criterion-summary-card", children: [
|
|
4220
|
+
/* @__PURE__ */ jsx12(SectionHeader, { label: m.heading, badge: "none" }),
|
|
4221
|
+
/* @__PURE__ */ jsx12("p", { style: summaryTextStyle, children: manual ? m.noneManual : m.noneAutomated }),
|
|
4222
|
+
!manual && /* @__PURE__ */ jsx12("p", { style: warningCardStyle, "data-testid": "criterion-automated-warning", children: m.noneAutomatedWarning }),
|
|
4223
|
+
!disabled && /* @__PURE__ */ jsx12(
|
|
3968
4224
|
"button",
|
|
3969
4225
|
{
|
|
3970
4226
|
type: "button",
|
|
3971
4227
|
onClick: onAdd,
|
|
3972
|
-
style:
|
|
4228
|
+
style: primaryBtn2,
|
|
3973
4229
|
"data-testid": "inspector-criterion-add",
|
|
3974
4230
|
children: m.add
|
|
3975
4231
|
}
|
|
3976
4232
|
)
|
|
3977
4233
|
] });
|
|
3978
4234
|
}
|
|
3979
|
-
return /* @__PURE__ */
|
|
3980
|
-
/* @__PURE__ */
|
|
3981
|
-
/* @__PURE__ */
|
|
3982
|
-
!disabled && /* @__PURE__ */
|
|
3983
|
-
/* @__PURE__ */
|
|
4235
|
+
return /* @__PURE__ */ jsxs10("div", { style: cardStyle, "data-testid": "criterion-summary-card", children: [
|
|
4236
|
+
/* @__PURE__ */ jsx12(SectionHeader, { label: m.heading, badge: criterion.type }),
|
|
4237
|
+
/* @__PURE__ */ jsx12(CriterionCompactJson, { criterion }),
|
|
4238
|
+
!disabled && /* @__PURE__ */ jsxs10("div", { style: { display: "flex", flexWrap: "wrap", gap: 6 }, children: [
|
|
4239
|
+
/* @__PURE__ */ jsx12(
|
|
3984
4240
|
"button",
|
|
3985
4241
|
{
|
|
3986
4242
|
type: "button",
|
|
3987
4243
|
onClick: onEdit,
|
|
3988
|
-
style:
|
|
4244
|
+
style: ghostBtn4,
|
|
3989
4245
|
"data-testid": "inspector-criterion-edit",
|
|
3990
4246
|
children: m.edit
|
|
3991
4247
|
}
|
|
3992
4248
|
),
|
|
3993
|
-
/* @__PURE__ */
|
|
4249
|
+
/* @__PURE__ */ jsx12(
|
|
3994
4250
|
"button",
|
|
3995
4251
|
{
|
|
3996
4252
|
type: "button",
|
|
3997
4253
|
onClick: onRemove,
|
|
3998
|
-
style:
|
|
4254
|
+
style: dangerBtn4,
|
|
3999
4255
|
"data-testid": "inspector-criterion-remove",
|
|
4000
4256
|
children: m.remove
|
|
4001
4257
|
}
|
|
@@ -4006,7 +4262,7 @@ function CriterionSummaryCard({
|
|
|
4006
4262
|
function CriterionCompactJson({ criterion }) {
|
|
4007
4263
|
const text = JSON.stringify(criterion);
|
|
4008
4264
|
const display = text.length > 140 ? `${text.slice(0, 137)}\u2026` : text;
|
|
4009
|
-
return /* @__PURE__ */
|
|
4265
|
+
return /* @__PURE__ */ jsx12(
|
|
4010
4266
|
"code",
|
|
4011
4267
|
{
|
|
4012
4268
|
"data-testid": "criterion-compact-json",
|
|
@@ -4043,7 +4299,7 @@ function CriterionEditorModal({
|
|
|
4043
4299
|
}) {
|
|
4044
4300
|
const messages = useMessages();
|
|
4045
4301
|
const seed = initialCriterion ?? defaultCriterion("simple");
|
|
4046
|
-
const [result, setResult] =
|
|
4302
|
+
const [result, setResult] = useState8(
|
|
4047
4303
|
() => parseCriterionJson(JSON.stringify(seed))
|
|
4048
4304
|
);
|
|
4049
4305
|
const modelKey = criterionModelKey(host);
|
|
@@ -4053,12 +4309,12 @@ function CriterionEditorModal({
|
|
|
4053
4309
|
onDispatch({ op: "setCriterion", host, path, criterion: result.criterion });
|
|
4054
4310
|
onApplied();
|
|
4055
4311
|
};
|
|
4056
|
-
return /* @__PURE__ */
|
|
4057
|
-
/* @__PURE__ */
|
|
4058
|
-
/* @__PURE__ */
|
|
4059
|
-
/* @__PURE__ */
|
|
4312
|
+
return /* @__PURE__ */ jsx12(ModalFrame, { onCancel, labelledBy: "criterion-modal-title", children: /* @__PURE__ */ jsxs10("div", { style: modalStyle, "data-testid": "criterion-editor-modal", children: [
|
|
4313
|
+
/* @__PURE__ */ jsxs10("header", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
|
|
4314
|
+
/* @__PURE__ */ jsx12("h2", { id: "criterion-modal-title", style: { margin: 0, fontSize: 18 }, children: title }),
|
|
4315
|
+
/* @__PURE__ */ jsx12("p", { style: { margin: 0, fontSize: 12, color: colors.textTertiary }, children: context })
|
|
4060
4316
|
] }),
|
|
4061
|
-
/* @__PURE__ */
|
|
4317
|
+
/* @__PURE__ */ jsx12("div", { style: modalBodyStyle, children: /* @__PURE__ */ jsx12(
|
|
4062
4318
|
CriterionJsonEditor,
|
|
4063
4319
|
{
|
|
4064
4320
|
value: seed,
|
|
@@ -4067,17 +4323,17 @@ function CriterionEditorModal({
|
|
|
4067
4323
|
onChange: setResult
|
|
4068
4324
|
}
|
|
4069
4325
|
) }),
|
|
4070
|
-
result.error && /* @__PURE__ */
|
|
4071
|
-
/* @__PURE__ */
|
|
4072
|
-
/* @__PURE__ */
|
|
4073
|
-
/* @__PURE__ */
|
|
4074
|
-
/* @__PURE__ */
|
|
4326
|
+
result.error && /* @__PURE__ */ jsx12("div", { role: "alert", style: errorStyle2, "data-testid": "criterion-modal-blocking-error", children: result.error }),
|
|
4327
|
+
/* @__PURE__ */ jsxs10("footer", { style: modalFooterStyle, children: [
|
|
4328
|
+
/* @__PURE__ */ jsx12("div", { style: { flex: 1 } }),
|
|
4329
|
+
/* @__PURE__ */ jsx12("button", { type: "button", onClick: onCancel, style: ghostBtn4, "data-testid": "criterion-modal-cancel", children: messages.criterion.cancel }),
|
|
4330
|
+
/* @__PURE__ */ jsx12(
|
|
4075
4331
|
"button",
|
|
4076
4332
|
{
|
|
4077
4333
|
type: "button",
|
|
4078
4334
|
onClick: apply,
|
|
4079
4335
|
disabled: applyDisabled,
|
|
4080
|
-
style: applyDisabled ? disabledPrimaryBtn :
|
|
4336
|
+
style: applyDisabled ? disabledPrimaryBtn : primaryBtn2,
|
|
4081
4337
|
"data-testid": "criterion-modal-apply",
|
|
4082
4338
|
children: messages.criterion.applyModal
|
|
4083
4339
|
}
|
|
@@ -4086,9 +4342,9 @@ function CriterionEditorModal({
|
|
|
4086
4342
|
] }) });
|
|
4087
4343
|
}
|
|
4088
4344
|
function SectionHeader({ label, badge }) {
|
|
4089
|
-
return /* @__PURE__ */
|
|
4090
|
-
/* @__PURE__ */
|
|
4091
|
-
/* @__PURE__ */
|
|
4345
|
+
return /* @__PURE__ */ jsxs10("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
4346
|
+
/* @__PURE__ */ jsx12("span", { style: { fontSize: 11, fontWeight: 600, letterSpacing: "0.08em", textTransform: "uppercase", color: colors.textSecondary }, children: label }),
|
|
4347
|
+
/* @__PURE__ */ jsx12("span", { style: { fontSize: 11, padding: "1px 6px", background: colors.surfaceMuted, borderRadius: radii.pill, color: colors.textTertiary }, children: badge })
|
|
4092
4348
|
] });
|
|
4093
4349
|
}
|
|
4094
4350
|
var cardStyle = {
|
|
@@ -4134,18 +4390,18 @@ var modalFooterStyle = {
|
|
|
4134
4390
|
borderTop: `1px solid ${colors.borderSubtle}`,
|
|
4135
4391
|
background: "white"
|
|
4136
4392
|
};
|
|
4137
|
-
var
|
|
4138
|
-
var
|
|
4139
|
-
var disabledPrimaryBtn = { ...
|
|
4140
|
-
var
|
|
4141
|
-
var
|
|
4393
|
+
var ghostBtn4 = { padding: "6px 10px", background: "white", border: `1px solid ${colors.border}`, borderRadius: radii.sm, fontSize: 12, cursor: "pointer" };
|
|
4394
|
+
var primaryBtn2 = { ...ghostBtn4, background: colors.primary, color: "white", borderColor: colors.primary };
|
|
4395
|
+
var disabledPrimaryBtn = { ...primaryBtn2, opacity: 0.5, cursor: "not-allowed" };
|
|
4396
|
+
var dangerBtn4 = { ...ghostBtn4, background: colors.dangerBg, borderColor: colors.dangerBorder, color: colors.danger };
|
|
4397
|
+
var errorStyle2 = { color: colors.danger, fontSize: 11 };
|
|
4142
4398
|
|
|
4143
4399
|
// src/inspector/ProcessorForm.tsx
|
|
4144
|
-
import { useEffect as
|
|
4400
|
+
import { useEffect as useEffect6, useState as useState9 } from "react";
|
|
4145
4401
|
import {
|
|
4146
4402
|
NAME_REGEX as NAME_REGEX2
|
|
4147
4403
|
} from "@cyoda/workflow-core";
|
|
4148
|
-
import { jsx as
|
|
4404
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
4149
4405
|
var EXECUTION_MODES = [
|
|
4150
4406
|
"ASYNC_NEW_TX",
|
|
4151
4407
|
"ASYNC_SAME_TX",
|
|
@@ -4242,8 +4498,8 @@ function ProcessorEditorModal({
|
|
|
4242
4498
|
onCancel,
|
|
4243
4499
|
onApply
|
|
4244
4500
|
}) {
|
|
4245
|
-
const [draft, setDraft] =
|
|
4246
|
-
|
|
4501
|
+
const [draft, setDraft] = useState9(() => toDraft(initialProcessor));
|
|
4502
|
+
useEffect6(() => {
|
|
4247
4503
|
setDraft(toDraft(initialProcessor));
|
|
4248
4504
|
}, [initialProcessor]);
|
|
4249
4505
|
const error = validateDraft(draft, existingNames, initialProcessor?.name);
|
|
@@ -4251,13 +4507,13 @@ function ProcessorEditorModal({
|
|
|
4251
4507
|
if (disabled || error) return;
|
|
4252
4508
|
onApply(toProcessor(draft));
|
|
4253
4509
|
};
|
|
4254
|
-
return /* @__PURE__ */
|
|
4255
|
-
/* @__PURE__ */
|
|
4256
|
-
/* @__PURE__ */
|
|
4257
|
-
/* @__PURE__ */
|
|
4510
|
+
return /* @__PURE__ */ jsx13(ModalFrame, { onCancel, labelledBy: "processor-modal-title", children: /* @__PURE__ */ jsxs11("div", { style: modalStyle2, "data-testid": "processor-editor-modal", children: [
|
|
4511
|
+
/* @__PURE__ */ jsxs11("header", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
|
|
4512
|
+
/* @__PURE__ */ jsx13("h2", { id: "processor-modal-title", style: { margin: 0, fontSize: 18 }, children: title }),
|
|
4513
|
+
/* @__PURE__ */ jsx13("p", { style: { margin: 0, fontSize: 12, color: colors.textTertiary }, children: "Processor changes stay local until Apply." })
|
|
4258
4514
|
] }),
|
|
4259
|
-
/* @__PURE__ */
|
|
4260
|
-
/* @__PURE__ */
|
|
4515
|
+
/* @__PURE__ */ jsxs11("div", { style: modalBodyStyle2, children: [
|
|
4516
|
+
/* @__PURE__ */ jsx13(FormField, { label: "Name", children: /* @__PURE__ */ jsx13(
|
|
4261
4517
|
"input",
|
|
4262
4518
|
{
|
|
4263
4519
|
type: "text",
|
|
@@ -4267,7 +4523,7 @@ function ProcessorEditorModal({
|
|
|
4267
4523
|
style: inputStyle2
|
|
4268
4524
|
}
|
|
4269
4525
|
) }),
|
|
4270
|
-
/* @__PURE__ */
|
|
4526
|
+
/* @__PURE__ */ jsx13(FormField, { label: "Execution mode", children: /* @__PURE__ */ jsx13(
|
|
4271
4527
|
CustomSelectInput,
|
|
4272
4528
|
{
|
|
4273
4529
|
value: draft.executionMode,
|
|
@@ -4276,8 +4532,8 @@ function ProcessorEditorModal({
|
|
|
4276
4532
|
testId: "processor-execution-mode"
|
|
4277
4533
|
}
|
|
4278
4534
|
) }),
|
|
4279
|
-
/* @__PURE__ */
|
|
4280
|
-
/* @__PURE__ */
|
|
4535
|
+
/* @__PURE__ */ jsxs11("label", { style: checkboxRowStyle, children: [
|
|
4536
|
+
/* @__PURE__ */ jsx13(
|
|
4281
4537
|
"input",
|
|
4282
4538
|
{
|
|
4283
4539
|
type: "checkbox",
|
|
@@ -4285,9 +4541,9 @@ function ProcessorEditorModal({
|
|
|
4285
4541
|
onChange: (event) => setDraft((current) => ({ ...current, attachEntity: event.target.checked }))
|
|
4286
4542
|
}
|
|
4287
4543
|
),
|
|
4288
|
-
/* @__PURE__ */
|
|
4544
|
+
/* @__PURE__ */ jsx13("span", { children: "Attach entity" })
|
|
4289
4545
|
] }),
|
|
4290
|
-
/* @__PURE__ */
|
|
4546
|
+
/* @__PURE__ */ jsx13(FormField, { label: "Calculation node tags", children: /* @__PURE__ */ jsx13(
|
|
4291
4547
|
"input",
|
|
4292
4548
|
{
|
|
4293
4549
|
type: "text",
|
|
@@ -4300,7 +4556,7 @@ function ProcessorEditorModal({
|
|
|
4300
4556
|
style: inputStyle2
|
|
4301
4557
|
}
|
|
4302
4558
|
) }),
|
|
4303
|
-
/* @__PURE__ */
|
|
4559
|
+
/* @__PURE__ */ jsx13(FormField, { label: "Response timeout ms", children: /* @__PURE__ */ jsx13(
|
|
4304
4560
|
"input",
|
|
4305
4561
|
{
|
|
4306
4562
|
type: "text",
|
|
@@ -4312,7 +4568,7 @@ function ProcessorEditorModal({
|
|
|
4312
4568
|
style: inputStyle2
|
|
4313
4569
|
}
|
|
4314
4570
|
) }),
|
|
4315
|
-
/* @__PURE__ */
|
|
4571
|
+
/* @__PURE__ */ jsx13(FormField, { label: "Retry policy", children: /* @__PURE__ */ jsx13(
|
|
4316
4572
|
"input",
|
|
4317
4573
|
{
|
|
4318
4574
|
type: "text",
|
|
@@ -4321,8 +4577,8 @@ function ProcessorEditorModal({
|
|
|
4321
4577
|
style: inputStyle2
|
|
4322
4578
|
}
|
|
4323
4579
|
) }),
|
|
4324
|
-
/* @__PURE__ */
|
|
4325
|
-
/* @__PURE__ */
|
|
4580
|
+
/* @__PURE__ */ jsxs11("label", { style: checkboxRowStyle, children: [
|
|
4581
|
+
/* @__PURE__ */ jsx13(
|
|
4326
4582
|
"input",
|
|
4327
4583
|
{
|
|
4328
4584
|
type: "checkbox",
|
|
@@ -4335,9 +4591,9 @@ function ProcessorEditorModal({
|
|
|
4335
4591
|
"data-testid": "processor-async-result"
|
|
4336
4592
|
}
|
|
4337
4593
|
),
|
|
4338
|
-
/* @__PURE__ */
|
|
4594
|
+
/* @__PURE__ */ jsx13("span", { children: "Async result" })
|
|
4339
4595
|
] }),
|
|
4340
|
-
/* @__PURE__ */
|
|
4596
|
+
/* @__PURE__ */ jsx13(FormField, { label: "Crossover to async ms", children: /* @__PURE__ */ jsx13(
|
|
4341
4597
|
"input",
|
|
4342
4598
|
{
|
|
4343
4599
|
type: "text",
|
|
@@ -4352,16 +4608,16 @@ function ProcessorEditorModal({
|
|
|
4352
4608
|
}
|
|
4353
4609
|
) })
|
|
4354
4610
|
] }),
|
|
4355
|
-
error && /* @__PURE__ */
|
|
4356
|
-
/* @__PURE__ */
|
|
4357
|
-
/* @__PURE__ */
|
|
4358
|
-
/* @__PURE__ */
|
|
4611
|
+
error && /* @__PURE__ */ jsx13("div", { role: "alert", style: errorStyle3, "data-testid": "processor-modal-error", children: error }),
|
|
4612
|
+
/* @__PURE__ */ jsxs11("footer", { style: modalFooterStyle2, children: [
|
|
4613
|
+
/* @__PURE__ */ jsx13("button", { type: "button", onClick: onCancel, style: ghostBtn5, "data-testid": "processor-modal-cancel", children: "Cancel" }),
|
|
4614
|
+
/* @__PURE__ */ jsx13(
|
|
4359
4615
|
"button",
|
|
4360
4616
|
{
|
|
4361
4617
|
type: "button",
|
|
4362
4618
|
onClick: apply,
|
|
4363
4619
|
disabled: disabled || !!error,
|
|
4364
|
-
style: disabled || error ? disabledPrimaryBtn2 :
|
|
4620
|
+
style: disabled || error ? disabledPrimaryBtn2 : primaryBtn3,
|
|
4365
4621
|
"data-testid": "processor-modal-apply",
|
|
4366
4622
|
children: "Apply processor"
|
|
4367
4623
|
}
|
|
@@ -4373,8 +4629,8 @@ function FormField({
|
|
|
4373
4629
|
label,
|
|
4374
4630
|
children
|
|
4375
4631
|
}) {
|
|
4376
|
-
return /* @__PURE__ */
|
|
4377
|
-
/* @__PURE__ */
|
|
4632
|
+
return /* @__PURE__ */ jsxs11("label", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
|
|
4633
|
+
/* @__PURE__ */ jsx13("span", { style: labelStyle2, children: label }),
|
|
4378
4634
|
children
|
|
4379
4635
|
] });
|
|
4380
4636
|
}
|
|
@@ -4388,18 +4644,18 @@ function ProcessorForm({
|
|
|
4388
4644
|
onDispatch
|
|
4389
4645
|
}) {
|
|
4390
4646
|
const messages = useMessages();
|
|
4391
|
-
const [modalOpen, setModalOpen] =
|
|
4392
|
-
return /* @__PURE__ */
|
|
4393
|
-
/* @__PURE__ */
|
|
4394
|
-
/* @__PURE__ */
|
|
4395
|
-
/* @__PURE__ */
|
|
4396
|
-
/* @__PURE__ */
|
|
4647
|
+
const [modalOpen, setModalOpen] = useState9(false);
|
|
4648
|
+
return /* @__PURE__ */ jsxs11("div", { style: summaryCardStyle, children: [
|
|
4649
|
+
/* @__PURE__ */ jsxs11("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", gap: 8 }, children: [
|
|
4650
|
+
/* @__PURE__ */ jsxs11("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
|
|
4651
|
+
/* @__PURE__ */ jsx13("strong", { style: { fontSize: 13 }, children: processor.name }),
|
|
4652
|
+
/* @__PURE__ */ jsx13("span", { style: { fontSize: 12, color: colors.textSecondary }, children: summarizeProcessor(processor) })
|
|
4397
4653
|
] }),
|
|
4398
|
-
/* @__PURE__ */
|
|
4654
|
+
/* @__PURE__ */ jsx13("span", { style: chipStyle, children: processor.type })
|
|
4399
4655
|
] }),
|
|
4400
|
-
/* @__PURE__ */
|
|
4401
|
-
/* @__PURE__ */
|
|
4402
|
-
/* @__PURE__ */
|
|
4656
|
+
/* @__PURE__ */ jsxs11("div", { style: { display: "flex", gap: 6, flexWrap: "wrap" }, children: [
|
|
4657
|
+
/* @__PURE__ */ jsx13("button", { type: "button", onClick: () => setModalOpen(true), style: ghostBtn5, children: "Edit" }),
|
|
4658
|
+
/* @__PURE__ */ jsx13(
|
|
4403
4659
|
"button",
|
|
4404
4660
|
{
|
|
4405
4661
|
type: "button",
|
|
@@ -4410,11 +4666,11 @@ function ProcessorForm({
|
|
|
4410
4666
|
processorUuid,
|
|
4411
4667
|
toIndex: processorIndex - 1
|
|
4412
4668
|
}),
|
|
4413
|
-
style:
|
|
4669
|
+
style: ghostBtn5,
|
|
4414
4670
|
children: messages.inspector.moveUp
|
|
4415
4671
|
}
|
|
4416
4672
|
),
|
|
4417
|
-
/* @__PURE__ */
|
|
4673
|
+
/* @__PURE__ */ jsx13(
|
|
4418
4674
|
"button",
|
|
4419
4675
|
{
|
|
4420
4676
|
type: "button",
|
|
@@ -4425,23 +4681,23 @@ function ProcessorForm({
|
|
|
4425
4681
|
processorUuid,
|
|
4426
4682
|
toIndex: processorIndex + 1
|
|
4427
4683
|
}),
|
|
4428
|
-
style:
|
|
4684
|
+
style: ghostBtn5,
|
|
4429
4685
|
children: messages.inspector.moveDown
|
|
4430
4686
|
}
|
|
4431
4687
|
),
|
|
4432
|
-
/* @__PURE__ */
|
|
4688
|
+
/* @__PURE__ */ jsx13(
|
|
4433
4689
|
"button",
|
|
4434
4690
|
{
|
|
4435
4691
|
type: "button",
|
|
4436
4692
|
disabled,
|
|
4437
4693
|
onClick: () => onDispatch({ op: "removeProcessor", processorUuid }),
|
|
4438
|
-
style:
|
|
4694
|
+
style: dangerBtn5,
|
|
4439
4695
|
"data-testid": "inspector-processor-delete",
|
|
4440
4696
|
children: messages.inspector.removeProcessor
|
|
4441
4697
|
}
|
|
4442
4698
|
)
|
|
4443
4699
|
] }),
|
|
4444
|
-
modalOpen && /* @__PURE__ */
|
|
4700
|
+
modalOpen && /* @__PURE__ */ jsx13(
|
|
4445
4701
|
ProcessorEditorModal,
|
|
4446
4702
|
{
|
|
4447
4703
|
title: `Edit ${processor.name}`,
|
|
@@ -4503,7 +4759,7 @@ var checkboxRowStyle = {
|
|
|
4503
4759
|
color: colors.textSecondary,
|
|
4504
4760
|
cursor: "pointer"
|
|
4505
4761
|
};
|
|
4506
|
-
var
|
|
4762
|
+
var errorStyle3 = {
|
|
4507
4763
|
padding: "8px 10px",
|
|
4508
4764
|
border: `1px solid ${colors.dangerBorder}`,
|
|
4509
4765
|
background: colors.dangerBg,
|
|
@@ -4511,7 +4767,7 @@ var errorStyle2 = {
|
|
|
4511
4767
|
color: colors.danger,
|
|
4512
4768
|
fontSize: 12
|
|
4513
4769
|
};
|
|
4514
|
-
var
|
|
4770
|
+
var ghostBtn5 = {
|
|
4515
4771
|
padding: "6px 10px",
|
|
4516
4772
|
background: "white",
|
|
4517
4773
|
border: `1px solid ${colors.border}`,
|
|
@@ -4519,19 +4775,19 @@ var ghostBtn4 = {
|
|
|
4519
4775
|
fontSize: 12,
|
|
4520
4776
|
cursor: "pointer"
|
|
4521
4777
|
};
|
|
4522
|
-
var
|
|
4523
|
-
...
|
|
4778
|
+
var primaryBtn3 = {
|
|
4779
|
+
...ghostBtn5,
|
|
4524
4780
|
background: colors.primary,
|
|
4525
4781
|
color: "white",
|
|
4526
4782
|
borderColor: colors.primary
|
|
4527
4783
|
};
|
|
4528
4784
|
var disabledPrimaryBtn2 = {
|
|
4529
|
-
...
|
|
4785
|
+
...primaryBtn3,
|
|
4530
4786
|
opacity: 0.5,
|
|
4531
4787
|
cursor: "not-allowed"
|
|
4532
4788
|
};
|
|
4533
|
-
var
|
|
4534
|
-
...
|
|
4789
|
+
var dangerBtn5 = {
|
|
4790
|
+
...ghostBtn5,
|
|
4535
4791
|
background: colors.dangerBg,
|
|
4536
4792
|
borderColor: colors.dangerBorder,
|
|
4537
4793
|
color: colors.danger
|
|
@@ -4555,7 +4811,7 @@ var summaryCardStyle = {
|
|
|
4555
4811
|
};
|
|
4556
4812
|
|
|
4557
4813
|
// src/inspector/TransitionForm.tsx
|
|
4558
|
-
import { Fragment as Fragment5, jsx as
|
|
4814
|
+
import { Fragment as Fragment5, jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
4559
4815
|
function TransitionForm({
|
|
4560
4816
|
workflow,
|
|
4561
4817
|
stateCode,
|
|
@@ -4570,15 +4826,15 @@ function TransitionForm({
|
|
|
4570
4826
|
onSelectionChange
|
|
4571
4827
|
}) {
|
|
4572
4828
|
const messages = useMessages();
|
|
4573
|
-
const [renameError, setRenameError] =
|
|
4574
|
-
const [processorModal, setProcessorModal] =
|
|
4575
|
-
const [scheduleDelayDraft, setScheduleDelayDraft] =
|
|
4829
|
+
const [renameError, setRenameError] = useState10(null);
|
|
4830
|
+
const [processorModal, setProcessorModal] = useState10(null);
|
|
4831
|
+
const [scheduleDelayDraft, setScheduleDelayDraft] = useState10(
|
|
4576
4832
|
transition.schedule?.delayMs !== void 0 ? String(transition.schedule.delayMs) : ""
|
|
4577
4833
|
);
|
|
4578
|
-
const [scheduleTimeoutDraft, setScheduleTimeoutDraft] =
|
|
4834
|
+
const [scheduleTimeoutDraft, setScheduleTimeoutDraft] = useState10(
|
|
4579
4835
|
transition.schedule?.timeoutMs !== void 0 ? String(transition.schedule.timeoutMs) : ""
|
|
4580
4836
|
);
|
|
4581
|
-
const prevTransitionUuidRef =
|
|
4837
|
+
const prevTransitionUuidRef = useRef8(transitionUuid);
|
|
4582
4838
|
if (prevTransitionUuidRef.current !== transitionUuid) {
|
|
4583
4839
|
prevTransitionUuidRef.current = transitionUuid;
|
|
4584
4840
|
setScheduleDelayDraft(
|
|
@@ -4676,9 +4932,9 @@ function TransitionForm({
|
|
|
4676
4932
|
index: index + 1
|
|
4677
4933
|
});
|
|
4678
4934
|
};
|
|
4679
|
-
return /* @__PURE__ */
|
|
4680
|
-
/* @__PURE__ */
|
|
4681
|
-
/* @__PURE__ */
|
|
4935
|
+
return /* @__PURE__ */ jsxs12("div", { style: transitionFormStyle, children: [
|
|
4936
|
+
/* @__PURE__ */ jsxs12(FieldGroup, { title: messages.inspector.properties, children: [
|
|
4937
|
+
/* @__PURE__ */ jsx14(
|
|
4682
4938
|
TextField,
|
|
4683
4939
|
{
|
|
4684
4940
|
label: messages.inspector.name,
|
|
@@ -4689,8 +4945,8 @@ function TransitionForm({
|
|
|
4689
4945
|
testId: "inspector-transition-name"
|
|
4690
4946
|
}
|
|
4691
4947
|
),
|
|
4692
|
-
renameError && /* @__PURE__ */
|
|
4693
|
-
!disabled && /* @__PURE__ */
|
|
4948
|
+
renameError && /* @__PURE__ */ jsx14("div", { role: "alert", style: { color: colors.danger, fontSize: 12 }, children: renameError }),
|
|
4949
|
+
!disabled && /* @__PURE__ */ jsx14(
|
|
4694
4950
|
SelectField,
|
|
4695
4951
|
{
|
|
4696
4952
|
label: "Source state",
|
|
@@ -4710,7 +4966,7 @@ function TransitionForm({
|
|
|
4710
4966
|
testId: "inspector-transition-source-state"
|
|
4711
4967
|
}
|
|
4712
4968
|
),
|
|
4713
|
-
/* @__PURE__ */
|
|
4969
|
+
/* @__PURE__ */ jsx14(
|
|
4714
4970
|
SelectField,
|
|
4715
4971
|
{
|
|
4716
4972
|
label: "Target state",
|
|
@@ -4721,7 +4977,7 @@ function TransitionForm({
|
|
|
4721
4977
|
testId: "inspector-transition-next"
|
|
4722
4978
|
}
|
|
4723
4979
|
),
|
|
4724
|
-
/* @__PURE__ */
|
|
4980
|
+
/* @__PURE__ */ jsx14(
|
|
4725
4981
|
SelectField,
|
|
4726
4982
|
{
|
|
4727
4983
|
label: messages.inspector.transitionType,
|
|
@@ -4735,7 +4991,7 @@ function TransitionForm({
|
|
|
4735
4991
|
testId: "inspector-transition-manual"
|
|
4736
4992
|
}
|
|
4737
4993
|
),
|
|
4738
|
-
/* @__PURE__ */
|
|
4994
|
+
/* @__PURE__ */ jsx14(
|
|
4739
4995
|
CheckboxField,
|
|
4740
4996
|
{
|
|
4741
4997
|
label: messages.inspector.disabled,
|
|
@@ -4745,7 +5001,7 @@ function TransitionForm({
|
|
|
4745
5001
|
testId: "inspector-transition-disabled"
|
|
4746
5002
|
}
|
|
4747
5003
|
),
|
|
4748
|
-
/* @__PURE__ */
|
|
5004
|
+
/* @__PURE__ */ jsx14(
|
|
4749
5005
|
AnchorSelect,
|
|
4750
5006
|
{
|
|
4751
5007
|
label: messages.inspector.sourceAnchor,
|
|
@@ -4756,7 +5012,7 @@ function TransitionForm({
|
|
|
4756
5012
|
testId: "inspector-transition-source-anchor"
|
|
4757
5013
|
}
|
|
4758
5014
|
),
|
|
4759
|
-
/* @__PURE__ */
|
|
5015
|
+
/* @__PURE__ */ jsx14(
|
|
4760
5016
|
AnchorSelect,
|
|
4761
5017
|
{
|
|
4762
5018
|
label: messages.inspector.targetAnchor,
|
|
@@ -4767,12 +5023,12 @@ function TransitionForm({
|
|
|
4767
5023
|
testId: "inspector-transition-target-anchor"
|
|
4768
5024
|
}
|
|
4769
5025
|
),
|
|
4770
|
-
/* @__PURE__ */
|
|
4771
|
-
/* @__PURE__ */
|
|
4772
|
-
/* @__PURE__ */
|
|
4773
|
-
/* @__PURE__ */
|
|
5026
|
+
/* @__PURE__ */ jsxs12("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
|
|
5027
|
+
/* @__PURE__ */ jsxs12("div", { style: { display: "flex", gap: 6 }, children: [
|
|
5028
|
+
/* @__PURE__ */ jsx14("button", { type: "button", disabled, onClick: () => reorder(-1), style: ghostBtn6, children: messages.inspector.moveUp }),
|
|
5029
|
+
/* @__PURE__ */ jsx14("button", { type: "button", disabled, onClick: () => reorder(1), style: ghostBtn6, children: messages.inspector.moveDown })
|
|
4774
5030
|
] }),
|
|
4775
|
-
/* @__PURE__ */
|
|
5031
|
+
/* @__PURE__ */ jsx14(
|
|
4776
5032
|
"p",
|
|
4777
5033
|
{
|
|
4778
5034
|
style: {
|
|
@@ -4786,20 +5042,20 @@ function TransitionForm({
|
|
|
4786
5042
|
}
|
|
4787
5043
|
)
|
|
4788
5044
|
] }),
|
|
4789
|
-
/* @__PURE__ */
|
|
4790
|
-
/* @__PURE__ */
|
|
5045
|
+
/* @__PURE__ */ jsx14("hr", { style: { border: "none", borderTop: `1px solid ${colors.borderSubtle}`, margin: 0 } }),
|
|
5046
|
+
/* @__PURE__ */ jsx14(
|
|
4791
5047
|
"button",
|
|
4792
5048
|
{
|
|
4793
5049
|
type: "button",
|
|
4794
5050
|
disabled,
|
|
4795
5051
|
onClick: removeTransition,
|
|
4796
|
-
style:
|
|
5052
|
+
style: dangerBtn6,
|
|
4797
5053
|
"data-testid": "inspector-transition-delete",
|
|
4798
5054
|
children: "Delete transition"
|
|
4799
5055
|
}
|
|
4800
5056
|
),
|
|
4801
|
-
/* @__PURE__ */
|
|
4802
|
-
issues && issues.length > 0 && /* @__PURE__ */
|
|
5057
|
+
/* @__PURE__ */ jsx14("hr", { style: { border: "none", borderTop: `1px solid ${colors.borderSubtle}`, margin: 0 } }),
|
|
5058
|
+
issues && issues.length > 0 && /* @__PURE__ */ jsx14("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: issues.map((issue, i) => /* @__PURE__ */ jsx14(
|
|
4803
5059
|
"div",
|
|
4804
5060
|
{
|
|
4805
5061
|
role: "alert",
|
|
@@ -4816,12 +5072,12 @@ function TransitionForm({
|
|
|
4816
5072
|
`${issue.code}-${i}`
|
|
4817
5073
|
)) })
|
|
4818
5074
|
] }),
|
|
4819
|
-
/* @__PURE__ */
|
|
5075
|
+
/* @__PURE__ */ jsx14(
|
|
4820
5076
|
TransitionSection,
|
|
4821
5077
|
{
|
|
4822
5078
|
title: messages.inspector.criteria,
|
|
4823
5079
|
testId: "inspector-transition-criteria-section",
|
|
4824
|
-
children: /* @__PURE__ */
|
|
5080
|
+
children: /* @__PURE__ */ jsx14(
|
|
4825
5081
|
CriterionSection,
|
|
4826
5082
|
{
|
|
4827
5083
|
host,
|
|
@@ -4837,18 +5093,18 @@ function TransitionForm({
|
|
|
4837
5093
|
)
|
|
4838
5094
|
}
|
|
4839
5095
|
),
|
|
4840
|
-
/* @__PURE__ */
|
|
5096
|
+
/* @__PURE__ */ jsxs12(
|
|
4841
5097
|
TransitionSection,
|
|
4842
5098
|
{
|
|
4843
5099
|
title: "Scheduled transition",
|
|
4844
5100
|
testId: "inspector-transition-schedule-section",
|
|
4845
5101
|
children: [
|
|
4846
|
-
/* @__PURE__ */
|
|
5102
|
+
/* @__PURE__ */ jsxs12(
|
|
4847
5103
|
"label",
|
|
4848
5104
|
{
|
|
4849
5105
|
style: { display: "flex", flexDirection: "row", alignItems: "center", gap: 8, fontSize: 12, color: colors.textSecondary, cursor: "pointer" },
|
|
4850
5106
|
children: [
|
|
4851
|
-
/* @__PURE__ */
|
|
5107
|
+
/* @__PURE__ */ jsx14(
|
|
4852
5108
|
"input",
|
|
4853
5109
|
{
|
|
4854
5110
|
type: "checkbox",
|
|
@@ -4868,14 +5124,14 @@ function TransitionForm({
|
|
|
4868
5124
|
}
|
|
4869
5125
|
}
|
|
4870
5126
|
),
|
|
4871
|
-
/* @__PURE__ */
|
|
5127
|
+
/* @__PURE__ */ jsx14("span", { children: "Enable schedule" })
|
|
4872
5128
|
]
|
|
4873
5129
|
}
|
|
4874
5130
|
),
|
|
4875
|
-
transition.schedule !== void 0 && /* @__PURE__ */
|
|
4876
|
-
/* @__PURE__ */
|
|
4877
|
-
/* @__PURE__ */
|
|
4878
|
-
/* @__PURE__ */
|
|
5131
|
+
transition.schedule !== void 0 && /* @__PURE__ */ jsxs12(Fragment5, { children: [
|
|
5132
|
+
/* @__PURE__ */ jsxs12("label", { style: { display: "flex", flexDirection: "column", gap: 4, fontSize: 12, color: colors.textSecondary }, children: [
|
|
5133
|
+
/* @__PURE__ */ jsx14("span", { style: { fontWeight: 500 }, children: "Delay (ms)" }),
|
|
5134
|
+
/* @__PURE__ */ jsx14(
|
|
4879
5135
|
"input",
|
|
4880
5136
|
{
|
|
4881
5137
|
type: "text",
|
|
@@ -4891,9 +5147,9 @@ function TransitionForm({
|
|
|
4891
5147
|
}
|
|
4892
5148
|
)
|
|
4893
5149
|
] }),
|
|
4894
|
-
/* @__PURE__ */
|
|
4895
|
-
/* @__PURE__ */
|
|
4896
|
-
/* @__PURE__ */
|
|
5150
|
+
/* @__PURE__ */ jsxs12("label", { style: { display: "flex", flexDirection: "column", gap: 4, fontSize: 12, color: colors.textSecondary }, children: [
|
|
5151
|
+
/* @__PURE__ */ jsx14("span", { style: { fontWeight: 500 }, children: "Timeout (ms)" }),
|
|
5152
|
+
/* @__PURE__ */ jsx14(
|
|
4897
5153
|
"input",
|
|
4898
5154
|
{
|
|
4899
5155
|
type: "text",
|
|
@@ -4910,7 +5166,7 @@ function TransitionForm({
|
|
|
4910
5166
|
)
|
|
4911
5167
|
] })
|
|
4912
5168
|
] }),
|
|
4913
|
-
/* @__PURE__ */
|
|
5169
|
+
/* @__PURE__ */ jsx14(
|
|
4914
5170
|
"p",
|
|
4915
5171
|
{
|
|
4916
5172
|
style: {
|
|
@@ -4930,28 +5186,28 @@ function TransitionForm({
|
|
|
4930
5186
|
]
|
|
4931
5187
|
}
|
|
4932
5188
|
),
|
|
4933
|
-
/* @__PURE__ */
|
|
5189
|
+
/* @__PURE__ */ jsxs12(
|
|
4934
5190
|
TransitionSection,
|
|
4935
5191
|
{
|
|
4936
5192
|
title: messages.inspector.processors,
|
|
4937
5193
|
testId: "inspector-transition-processes-section",
|
|
4938
5194
|
children: [
|
|
4939
|
-
processorCount === 0 ? /* @__PURE__ */
|
|
4940
|
-
/* @__PURE__ */
|
|
4941
|
-
processors.map((processor, index) => /* @__PURE__ */
|
|
4942
|
-
/* @__PURE__ */
|
|
4943
|
-
/* @__PURE__ */
|
|
5195
|
+
processorCount === 0 ? /* @__PURE__ */ jsx14("div", { style: emptyProcessorStateStyle, children: /* @__PURE__ */ jsx14("p", { style: summaryTextStyle2, children: "No processors run on this transition." }) }) : /* @__PURE__ */ jsxs12(Fragment5, { children: [
|
|
5196
|
+
/* @__PURE__ */ jsx14("p", { style: processorHelperStyle, children: "Processors run sequentially in the order shown." }),
|
|
5197
|
+
processors.map((processor, index) => /* @__PURE__ */ jsxs12("div", { style: processorRowStyle, children: [
|
|
5198
|
+
/* @__PURE__ */ jsxs12("div", { style: { display: "flex", gap: 10, alignItems: "center" }, children: [
|
|
5199
|
+
/* @__PURE__ */ jsxs12("span", { style: processorOrderStyle, children: [
|
|
4944
5200
|
index + 1,
|
|
4945
5201
|
"."
|
|
4946
5202
|
] }),
|
|
4947
|
-
/* @__PURE__ */
|
|
4948
|
-
/* @__PURE__ */
|
|
4949
|
-
/* @__PURE__ */
|
|
4950
|
-
/* @__PURE__ */
|
|
5203
|
+
/* @__PURE__ */ jsx14("span", { style: processorTypeChipStyle, children: processor.type }),
|
|
5204
|
+
/* @__PURE__ */ jsxs12("div", { style: { display: "flex", flexDirection: "column", gap: 2, minWidth: 0 }, children: [
|
|
5205
|
+
/* @__PURE__ */ jsx14("strong", { style: { fontSize: 13 }, children: processor.name }),
|
|
5206
|
+
/* @__PURE__ */ jsx14("span", { style: summaryTextStyle2, children: summarizeProcessor(processor) })
|
|
4951
5207
|
] })
|
|
4952
5208
|
] }),
|
|
4953
|
-
/* @__PURE__ */
|
|
4954
|
-
/* @__PURE__ */
|
|
5209
|
+
/* @__PURE__ */ jsxs12("div", { style: { display: "flex", gap: 6, flexWrap: "wrap" }, children: [
|
|
5210
|
+
/* @__PURE__ */ jsx14(
|
|
4955
5211
|
"button",
|
|
4956
5212
|
{
|
|
4957
5213
|
type: "button",
|
|
@@ -4961,23 +5217,23 @@ function TransitionForm({
|
|
|
4961
5217
|
processorUuid: processorUuids[index],
|
|
4962
5218
|
processorIndex: index
|
|
4963
5219
|
}),
|
|
4964
|
-
style:
|
|
5220
|
+
style: ghostBtn6,
|
|
4965
5221
|
"data-testid": `processor-edit-${index}`,
|
|
4966
5222
|
children: "Edit"
|
|
4967
5223
|
}
|
|
4968
5224
|
),
|
|
4969
|
-
/* @__PURE__ */
|
|
5225
|
+
/* @__PURE__ */ jsx14(
|
|
4970
5226
|
"button",
|
|
4971
5227
|
{
|
|
4972
5228
|
type: "button",
|
|
4973
5229
|
disabled,
|
|
4974
5230
|
onClick: () => duplicateProcessor(processor, index),
|
|
4975
|
-
style:
|
|
5231
|
+
style: ghostBtn6,
|
|
4976
5232
|
"data-testid": `processor-duplicate-${index}`,
|
|
4977
5233
|
children: "Duplicate"
|
|
4978
5234
|
}
|
|
4979
5235
|
),
|
|
4980
|
-
/* @__PURE__ */
|
|
5236
|
+
/* @__PURE__ */ jsx14(
|
|
4981
5237
|
"button",
|
|
4982
5238
|
{
|
|
4983
5239
|
type: "button",
|
|
@@ -4988,12 +5244,12 @@ function TransitionForm({
|
|
|
4988
5244
|
processorUuid: processorUuids[index],
|
|
4989
5245
|
toIndex: index - 1
|
|
4990
5246
|
}),
|
|
4991
|
-
style:
|
|
5247
|
+
style: ghostBtn6,
|
|
4992
5248
|
"data-testid": `processor-move-up-${index}`,
|
|
4993
5249
|
children: "Move up"
|
|
4994
5250
|
}
|
|
4995
5251
|
),
|
|
4996
|
-
/* @__PURE__ */
|
|
5252
|
+
/* @__PURE__ */ jsx14(
|
|
4997
5253
|
"button",
|
|
4998
5254
|
{
|
|
4999
5255
|
type: "button",
|
|
@@ -5004,18 +5260,18 @@ function TransitionForm({
|
|
|
5004
5260
|
processorUuid: processorUuids[index],
|
|
5005
5261
|
toIndex: index + 1
|
|
5006
5262
|
}),
|
|
5007
|
-
style:
|
|
5263
|
+
style: ghostBtn6,
|
|
5008
5264
|
"data-testid": `processor-move-down-${index}`,
|
|
5009
5265
|
children: "Move down"
|
|
5010
5266
|
}
|
|
5011
5267
|
),
|
|
5012
|
-
/* @__PURE__ */
|
|
5268
|
+
/* @__PURE__ */ jsx14(
|
|
5013
5269
|
"button",
|
|
5014
5270
|
{
|
|
5015
5271
|
type: "button",
|
|
5016
5272
|
disabled: disabled || !processorUuids[index],
|
|
5017
5273
|
onClick: () => processorUuids[index] && onDispatch({ op: "removeProcessor", processorUuid: processorUuids[index] }),
|
|
5018
|
-
style:
|
|
5274
|
+
style: dangerBtn6,
|
|
5019
5275
|
"data-testid": `processor-delete-${index}`,
|
|
5020
5276
|
children: "Delete"
|
|
5021
5277
|
}
|
|
@@ -5023,13 +5279,13 @@ function TransitionForm({
|
|
|
5023
5279
|
] })
|
|
5024
5280
|
] }, processorUuids[index] ?? `${processor.name}-${index}`))
|
|
5025
5281
|
] }),
|
|
5026
|
-
/* @__PURE__ */
|
|
5282
|
+
/* @__PURE__ */ jsx14(
|
|
5027
5283
|
"button",
|
|
5028
5284
|
{
|
|
5029
5285
|
type: "button",
|
|
5030
5286
|
disabled,
|
|
5031
5287
|
onClick: () => setProcessorModal({ mode: "add" }),
|
|
5032
|
-
style:
|
|
5288
|
+
style: ghostBtn6,
|
|
5033
5289
|
"data-testid": "inspector-add-processor",
|
|
5034
5290
|
children: messages.inspector.addProcessor
|
|
5035
5291
|
}
|
|
@@ -5037,7 +5293,18 @@ function TransitionForm({
|
|
|
5037
5293
|
]
|
|
5038
5294
|
}
|
|
5039
5295
|
),
|
|
5040
|
-
|
|
5296
|
+
/* @__PURE__ */ jsx14(TransitionSection, { title: "Annotations", testId: "inspector-transition-annotations-section", children: /* @__PURE__ */ jsx14(
|
|
5297
|
+
AnnotationsField,
|
|
5298
|
+
{
|
|
5299
|
+
value: transition.annotations,
|
|
5300
|
+
disabled,
|
|
5301
|
+
showLabel: false,
|
|
5302
|
+
modelKey: `transition-${transitionUuid}`,
|
|
5303
|
+
onCommit: (annotations) => onDispatch({ op: "setAnnotations", target: { kind: "transition", transitionUuid }, annotations }),
|
|
5304
|
+
onRemove: () => onDispatch({ op: "setAnnotations", target: { kind: "transition", transitionUuid } })
|
|
5305
|
+
}
|
|
5306
|
+
) }),
|
|
5307
|
+
processorModal && /* @__PURE__ */ jsx14(
|
|
5041
5308
|
ProcessorEditorModal,
|
|
5042
5309
|
{
|
|
5043
5310
|
title: processorModal.mode === "add" ? "Add processor" : "Edit processor",
|
|
@@ -5057,8 +5324,8 @@ function TransitionSection({
|
|
|
5057
5324
|
testId,
|
|
5058
5325
|
children
|
|
5059
5326
|
}) {
|
|
5060
|
-
return /* @__PURE__ */
|
|
5061
|
-
/* @__PURE__ */
|
|
5327
|
+
return /* @__PURE__ */ jsxs12("section", { style: transitionSectionStyle, "data-testid": testId, children: [
|
|
5328
|
+
/* @__PURE__ */ jsx14("header", { style: sectionHeaderStyle, children: title }),
|
|
5062
5329
|
children
|
|
5063
5330
|
] });
|
|
5064
5331
|
}
|
|
@@ -5081,7 +5348,7 @@ var sectionHeaderStyle = {
|
|
|
5081
5348
|
textTransform: "uppercase",
|
|
5082
5349
|
color: colors.textSecondary
|
|
5083
5350
|
};
|
|
5084
|
-
var
|
|
5351
|
+
var ghostBtn6 = {
|
|
5085
5352
|
padding: "4px 8px",
|
|
5086
5353
|
background: "white",
|
|
5087
5354
|
border: `1px solid ${colors.border}`,
|
|
@@ -5089,8 +5356,8 @@ var ghostBtn5 = {
|
|
|
5089
5356
|
fontSize: 12,
|
|
5090
5357
|
cursor: "pointer"
|
|
5091
5358
|
};
|
|
5092
|
-
var
|
|
5093
|
-
...
|
|
5359
|
+
var dangerBtn6 = {
|
|
5360
|
+
...ghostBtn6,
|
|
5094
5361
|
background: colors.dangerBg,
|
|
5095
5362
|
borderColor: colors.dangerBorder,
|
|
5096
5363
|
color: colors.danger
|
|
@@ -5165,9 +5432,9 @@ function AnchorSelect({
|
|
|
5165
5432
|
{ value: "left", label: messages.inspector.anchorLeft },
|
|
5166
5433
|
{ value: "left-bottom", label: messages.inspector.anchorLeftBottom }
|
|
5167
5434
|
];
|
|
5168
|
-
return /* @__PURE__ */
|
|
5169
|
-
/* @__PURE__ */
|
|
5170
|
-
/* @__PURE__ */
|
|
5435
|
+
return /* @__PURE__ */ jsxs12("label", { style: { display: "flex", flexDirection: "column", gap: 4, fontSize: 12, color: colors.textSecondary }, children: [
|
|
5436
|
+
/* @__PURE__ */ jsx14("span", { style: { fontWeight: 500 }, children: label }),
|
|
5437
|
+
/* @__PURE__ */ jsx14(
|
|
5171
5438
|
CustomSelectInput,
|
|
5172
5439
|
{
|
|
5173
5440
|
value: value ?? "",
|
|
@@ -5182,7 +5449,7 @@ function AnchorSelect({
|
|
|
5182
5449
|
}
|
|
5183
5450
|
|
|
5184
5451
|
// src/inspector/Inspector.tsx
|
|
5185
|
-
import { Fragment as Fragment6, jsx as
|
|
5452
|
+
import { Fragment as Fragment6, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
5186
5453
|
function issueKeyForSelection(selection) {
|
|
5187
5454
|
if (!selection) return null;
|
|
5188
5455
|
switch (selection.kind) {
|
|
@@ -5211,7 +5478,7 @@ function Inspector({
|
|
|
5211
5478
|
}) {
|
|
5212
5479
|
const messages = useMessages();
|
|
5213
5480
|
const { developerMode } = useEditorConfig();
|
|
5214
|
-
const [tab, setTab] =
|
|
5481
|
+
const [tab, setTab] = useState11("properties");
|
|
5215
5482
|
const effectiveTab = developerMode ? tab : "properties";
|
|
5216
5483
|
const resolved = useMemo4(() => resolveSelection(doc, selection), [doc, selection]);
|
|
5217
5484
|
const selectionIssueKey = issueKeyForSelection(selection);
|
|
@@ -5220,7 +5487,7 @@ function Inspector({
|
|
|
5220
5487
|
return issues.filter((i) => i.targetId === selectionIssueKey);
|
|
5221
5488
|
}, [issues, selectionIssueKey]);
|
|
5222
5489
|
const breadcrumb = renderBreadcrumb(resolved);
|
|
5223
|
-
return /* @__PURE__ */
|
|
5490
|
+
return /* @__PURE__ */ jsxs13(
|
|
5224
5491
|
"aside",
|
|
5225
5492
|
{
|
|
5226
5493
|
style: {
|
|
@@ -5236,7 +5503,7 @@ function Inspector({
|
|
|
5236
5503
|
},
|
|
5237
5504
|
"data-testid": "inspector",
|
|
5238
5505
|
children: [
|
|
5239
|
-
/* @__PURE__ */
|
|
5506
|
+
/* @__PURE__ */ jsxs13(
|
|
5240
5507
|
"header",
|
|
5241
5508
|
{
|
|
5242
5509
|
style: {
|
|
@@ -5249,8 +5516,8 @@ function Inspector({
|
|
|
5249
5516
|
gap: 8
|
|
5250
5517
|
},
|
|
5251
5518
|
children: [
|
|
5252
|
-
/* @__PURE__ */
|
|
5253
|
-
onClose && /* @__PURE__ */
|
|
5519
|
+
/* @__PURE__ */ jsx15("span", { style: { flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: breadcrumb }),
|
|
5520
|
+
onClose && /* @__PURE__ */ jsx15(
|
|
5254
5521
|
"button",
|
|
5255
5522
|
{
|
|
5256
5523
|
type: "button",
|
|
@@ -5278,8 +5545,8 @@ function Inspector({
|
|
|
5278
5545
|
]
|
|
5279
5546
|
}
|
|
5280
5547
|
),
|
|
5281
|
-
developerMode && /* @__PURE__ */
|
|
5282
|
-
/* @__PURE__ */
|
|
5548
|
+
developerMode && /* @__PURE__ */ jsxs13("div", { style: { display: "flex", borderBottom: `1px solid ${colors.borderSubtle}` }, children: [
|
|
5549
|
+
/* @__PURE__ */ jsx15(
|
|
5283
5550
|
TabButton,
|
|
5284
5551
|
{
|
|
5285
5552
|
active: effectiveTab === "properties",
|
|
@@ -5288,7 +5555,7 @@ function Inspector({
|
|
|
5288
5555
|
children: messages.inspector.properties
|
|
5289
5556
|
}
|
|
5290
5557
|
),
|
|
5291
|
-
/* @__PURE__ */
|
|
5558
|
+
/* @__PURE__ */ jsx15(
|
|
5292
5559
|
TabButton,
|
|
5293
5560
|
{
|
|
5294
5561
|
active: effectiveTab === "json",
|
|
@@ -5298,11 +5565,11 @@ function Inspector({
|
|
|
5298
5565
|
}
|
|
5299
5566
|
)
|
|
5300
5567
|
] }),
|
|
5301
|
-
/* @__PURE__ */
|
|
5302
|
-
effectiveTab === "properties" && /* @__PURE__ */
|
|
5303
|
-
!resolved && /* @__PURE__ */
|
|
5304
|
-
resolved?.kind === "workflow" && /* @__PURE__ */
|
|
5305
|
-
resolved?.kind === "state" && /* @__PURE__ */
|
|
5568
|
+
/* @__PURE__ */ jsxs13("div", { style: { padding: 12, overflowY: "auto", flex: 1, display: "flex", flexDirection: "column", gap: 16 }, children: [
|
|
5569
|
+
effectiveTab === "properties" && /* @__PURE__ */ jsxs13(Fragment6, { children: [
|
|
5570
|
+
!resolved && /* @__PURE__ */ jsx15(EmptyState, { message: messages.inspector.empty }),
|
|
5571
|
+
resolved?.kind === "workflow" && /* @__PURE__ */ jsx15(WorkflowForm, { workflow: resolved.workflow, disabled: readOnly, onDispatch }, resolved.workflow.name),
|
|
5572
|
+
resolved?.kind === "state" && /* @__PURE__ */ jsx15(
|
|
5306
5573
|
StateForm,
|
|
5307
5574
|
{
|
|
5308
5575
|
workflow: resolved.workflow,
|
|
@@ -5315,7 +5582,7 @@ function Inspector({
|
|
|
5315
5582
|
},
|
|
5316
5583
|
`${resolved.workflow.name}:${resolved.stateCode}`
|
|
5317
5584
|
),
|
|
5318
|
-
resolved?.kind === "transition" && /* @__PURE__ */
|
|
5585
|
+
resolved?.kind === "transition" && /* @__PURE__ */ jsx15(
|
|
5319
5586
|
TransitionForm,
|
|
5320
5587
|
{
|
|
5321
5588
|
workflow: resolved.workflow,
|
|
@@ -5332,7 +5599,7 @@ function Inspector({
|
|
|
5332
5599
|
},
|
|
5333
5600
|
resolved.transitionUuid
|
|
5334
5601
|
),
|
|
5335
|
-
resolved?.kind === "processor" && /* @__PURE__ */
|
|
5602
|
+
resolved?.kind === "processor" && /* @__PURE__ */ jsx15(
|
|
5336
5603
|
ProcessorForm,
|
|
5337
5604
|
{
|
|
5338
5605
|
processor: resolved.processor,
|
|
@@ -5346,8 +5613,8 @@ function Inspector({
|
|
|
5346
5613
|
resolved.processorUuid
|
|
5347
5614
|
)
|
|
5348
5615
|
] }),
|
|
5349
|
-
developerMode && effectiveTab === "json" && /* @__PURE__ */
|
|
5350
|
-
selectionIssues.length > 0 && /* @__PURE__ */
|
|
5616
|
+
developerMode && effectiveTab === "json" && /* @__PURE__ */ jsx15(JsonPreview, { document: doc, resolved }),
|
|
5617
|
+
selectionIssues.length > 0 && /* @__PURE__ */ jsx15(IssuesList, { issues: selectionIssues, title: messages.inspector.issues })
|
|
5351
5618
|
] })
|
|
5352
5619
|
]
|
|
5353
5620
|
}
|
|
@@ -5370,7 +5637,7 @@ function TabButton({
|
|
|
5370
5637
|
children,
|
|
5371
5638
|
testId
|
|
5372
5639
|
}) {
|
|
5373
|
-
return /* @__PURE__ */
|
|
5640
|
+
return /* @__PURE__ */ jsx15(
|
|
5374
5641
|
"button",
|
|
5375
5642
|
{
|
|
5376
5643
|
type: "button",
|
|
@@ -5391,17 +5658,17 @@ function TabButton({
|
|
|
5391
5658
|
);
|
|
5392
5659
|
}
|
|
5393
5660
|
function EmptyState({ message }) {
|
|
5394
|
-
return /* @__PURE__ */
|
|
5661
|
+
return /* @__PURE__ */ jsx15("p", { style: { color: colors.textTertiary, fontSize: 13 }, children: message });
|
|
5395
5662
|
}
|
|
5396
5663
|
function IssuesList({
|
|
5397
5664
|
issues,
|
|
5398
5665
|
title
|
|
5399
5666
|
}) {
|
|
5400
|
-
return /* @__PURE__ */
|
|
5401
|
-
/* @__PURE__ */
|
|
5667
|
+
return /* @__PURE__ */ jsxs13("section", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
5668
|
+
/* @__PURE__ */ jsx15("header", { style: { fontSize: 11, fontWeight: 600, letterSpacing: "0.08em", textTransform: "uppercase", color: colors.textSecondary }, children: title }),
|
|
5402
5669
|
issues.map((issue, i) => {
|
|
5403
5670
|
const tone = severityTone(issue.severity);
|
|
5404
|
-
return /* @__PURE__ */
|
|
5671
|
+
return /* @__PURE__ */ jsxs13(
|
|
5405
5672
|
"div",
|
|
5406
5673
|
{
|
|
5407
5674
|
style: {
|
|
@@ -5412,8 +5679,8 @@ function IssuesList({
|
|
|
5412
5679
|
fontSize: 12
|
|
5413
5680
|
},
|
|
5414
5681
|
children: [
|
|
5415
|
-
/* @__PURE__ */
|
|
5416
|
-
/* @__PURE__ */
|
|
5682
|
+
/* @__PURE__ */ jsx15("strong", { children: issue.code }),
|
|
5683
|
+
/* @__PURE__ */ jsx15("div", { children: issue.message })
|
|
5417
5684
|
]
|
|
5418
5685
|
},
|
|
5419
5686
|
`${issue.code}-${i}`
|
|
@@ -5433,7 +5700,7 @@ function JsonPreview({
|
|
|
5433
5700
|
if (resolved.kind === "processor") return JSON.stringify(resolved.processor, null, 2);
|
|
5434
5701
|
return "";
|
|
5435
5702
|
}, [doc, resolved]);
|
|
5436
|
-
return /* @__PURE__ */
|
|
5703
|
+
return /* @__PURE__ */ jsx15(
|
|
5437
5704
|
"pre",
|
|
5438
5705
|
{
|
|
5439
5706
|
style: {
|
|
@@ -5456,7 +5723,7 @@ function JsonPreview({
|
|
|
5456
5723
|
}
|
|
5457
5724
|
|
|
5458
5725
|
// src/toolbar/Toolbar.tsx
|
|
5459
|
-
import { jsx as
|
|
5726
|
+
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
5460
5727
|
function Toolbar({
|
|
5461
5728
|
derived,
|
|
5462
5729
|
readOnly,
|
|
@@ -5470,7 +5737,7 @@ function Toolbar({
|
|
|
5470
5737
|
toolbarEnd
|
|
5471
5738
|
}) {
|
|
5472
5739
|
const messages = useMessages();
|
|
5473
|
-
return /* @__PURE__ */
|
|
5740
|
+
return /* @__PURE__ */ jsxs14(
|
|
5474
5741
|
"footer",
|
|
5475
5742
|
{
|
|
5476
5743
|
style: {
|
|
@@ -5485,11 +5752,11 @@ function Toolbar({
|
|
|
5485
5752
|
},
|
|
5486
5753
|
"data-testid": "toolbar",
|
|
5487
5754
|
children: [
|
|
5488
|
-
toolbarStart && /* @__PURE__ */
|
|
5489
|
-
toolbarCenter && /* @__PURE__ */
|
|
5490
|
-
!toolbarCenter && /* @__PURE__ */
|
|
5491
|
-
/* @__PURE__ */
|
|
5492
|
-
/* @__PURE__ */
|
|
5755
|
+
toolbarStart && /* @__PURE__ */ jsx16("div", { style: slotStyle, "data-testid": "toolbar-start", children: toolbarStart }),
|
|
5756
|
+
toolbarCenter && /* @__PURE__ */ jsx16("div", { style: { ...slotStyle, flex: 1, justifyContent: "center" }, "data-testid": "toolbar-center", children: toolbarCenter }),
|
|
5757
|
+
!toolbarCenter && /* @__PURE__ */ jsx16("div", { style: { flex: 1 } }),
|
|
5758
|
+
/* @__PURE__ */ jsxs14("span", { role: "status", "aria-live": "polite", style: { display: "inline-flex", gap: 6 }, children: [
|
|
5759
|
+
/* @__PURE__ */ jsx16(
|
|
5493
5760
|
ValidationPill,
|
|
5494
5761
|
{
|
|
5495
5762
|
severity: "error",
|
|
@@ -5501,7 +5768,7 @@ function Toolbar({
|
|
|
5501
5768
|
testId: "toolbar-errors"
|
|
5502
5769
|
}
|
|
5503
5770
|
),
|
|
5504
|
-
/* @__PURE__ */
|
|
5771
|
+
/* @__PURE__ */ jsx16(
|
|
5505
5772
|
ValidationPill,
|
|
5506
5773
|
{
|
|
5507
5774
|
severity: "warning",
|
|
@@ -5513,7 +5780,7 @@ function Toolbar({
|
|
|
5513
5780
|
testId: "toolbar-warnings"
|
|
5514
5781
|
}
|
|
5515
5782
|
),
|
|
5516
|
-
/* @__PURE__ */
|
|
5783
|
+
/* @__PURE__ */ jsx16(
|
|
5517
5784
|
ValidationPill,
|
|
5518
5785
|
{
|
|
5519
5786
|
severity: "info",
|
|
@@ -5526,7 +5793,7 @@ function Toolbar({
|
|
|
5526
5793
|
}
|
|
5527
5794
|
)
|
|
5528
5795
|
] }),
|
|
5529
|
-
onSave && showSaveButton && /* @__PURE__ */
|
|
5796
|
+
onSave && showSaveButton && /* @__PURE__ */ jsx16(
|
|
5530
5797
|
"button",
|
|
5531
5798
|
{
|
|
5532
5799
|
type: "button",
|
|
@@ -5537,7 +5804,7 @@ function Toolbar({
|
|
|
5537
5804
|
children: messages.toolbar.save
|
|
5538
5805
|
}
|
|
5539
5806
|
),
|
|
5540
|
-
toolbarEnd && /* @__PURE__ */
|
|
5807
|
+
toolbarEnd && /* @__PURE__ */ jsx16("div", { style: slotStyle, "data-testid": "toolbar-end", children: toolbarEnd })
|
|
5541
5808
|
]
|
|
5542
5809
|
}
|
|
5543
5810
|
);
|
|
@@ -5559,7 +5826,7 @@ function ValidationPill({
|
|
|
5559
5826
|
const tone = severityTone(severity);
|
|
5560
5827
|
const interactive = count > 0 && !!onClick;
|
|
5561
5828
|
const hasIssues = count > 0;
|
|
5562
|
-
return /* @__PURE__ */
|
|
5829
|
+
return /* @__PURE__ */ jsxs14(
|
|
5563
5830
|
"button",
|
|
5564
5831
|
{
|
|
5565
5832
|
type: "button",
|
|
@@ -5586,7 +5853,7 @@ function ValidationPill({
|
|
|
5586
5853
|
height: 20
|
|
5587
5854
|
},
|
|
5588
5855
|
children: [
|
|
5589
|
-
/* @__PURE__ */
|
|
5856
|
+
/* @__PURE__ */ jsx16("span", { style: { fontSize: severity === "info" ? 14 : 10, lineHeight: 1 }, children: SEVERITY_ICON[severity] }),
|
|
5590
5857
|
count
|
|
5591
5858
|
]
|
|
5592
5859
|
}
|
|
@@ -5610,8 +5877,8 @@ var slotStyle = {
|
|
|
5610
5877
|
};
|
|
5611
5878
|
|
|
5612
5879
|
// src/toolbar/IssuesDrawer.tsx
|
|
5613
|
-
import { useEffect as
|
|
5614
|
-
import { jsx as
|
|
5880
|
+
import { useEffect as useEffect7, useMemo as useMemo5, useRef as useRef9 } from "react";
|
|
5881
|
+
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
5615
5882
|
function resolveTarget(doc, targetId) {
|
|
5616
5883
|
if (!targetId) return null;
|
|
5617
5884
|
const ids = doc.meta.ids;
|
|
@@ -5664,8 +5931,8 @@ function IssuesDrawer({
|
|
|
5664
5931
|
onJumpTo
|
|
5665
5932
|
}) {
|
|
5666
5933
|
const messages = useMessages();
|
|
5667
|
-
const ref =
|
|
5668
|
-
|
|
5934
|
+
const ref = useRef9(null);
|
|
5935
|
+
useEffect7(() => {
|
|
5669
5936
|
if (!open) return;
|
|
5670
5937
|
function onKey(e) {
|
|
5671
5938
|
if (e.key === "Escape") {
|
|
@@ -5700,7 +5967,7 @@ function IssuesDrawer({
|
|
|
5700
5967
|
}, [severity, messages]);
|
|
5701
5968
|
const tone = severityTone(severity);
|
|
5702
5969
|
if (!open) return null;
|
|
5703
|
-
return /* @__PURE__ */
|
|
5970
|
+
return /* @__PURE__ */ jsxs15(
|
|
5704
5971
|
"div",
|
|
5705
5972
|
{
|
|
5706
5973
|
ref,
|
|
@@ -5724,7 +5991,7 @@ function IssuesDrawer({
|
|
|
5724
5991
|
flexDirection: "column"
|
|
5725
5992
|
},
|
|
5726
5993
|
children: [
|
|
5727
|
-
/* @__PURE__ */
|
|
5994
|
+
/* @__PURE__ */ jsxs15(
|
|
5728
5995
|
"header",
|
|
5729
5996
|
{
|
|
5730
5997
|
style: {
|
|
@@ -5735,7 +6002,7 @@ function IssuesDrawer({
|
|
|
5735
6002
|
gap: 8
|
|
5736
6003
|
},
|
|
5737
6004
|
children: [
|
|
5738
|
-
/* @__PURE__ */
|
|
6005
|
+
/* @__PURE__ */ jsx17(
|
|
5739
6006
|
"span",
|
|
5740
6007
|
{
|
|
5741
6008
|
style: {
|
|
@@ -5748,12 +6015,12 @@ function IssuesDrawer({
|
|
|
5748
6015
|
"aria-hidden": true
|
|
5749
6016
|
}
|
|
5750
6017
|
),
|
|
5751
|
-
/* @__PURE__ */
|
|
6018
|
+
/* @__PURE__ */ jsxs15("strong", { style: { flex: 1, fontSize: 13, color: colors.textPrimary }, children: [
|
|
5752
6019
|
title,
|
|
5753
6020
|
" \xB7 ",
|
|
5754
6021
|
filtered.length
|
|
5755
6022
|
] }),
|
|
5756
|
-
/* @__PURE__ */
|
|
6023
|
+
/* @__PURE__ */ jsx17(
|
|
5757
6024
|
"button",
|
|
5758
6025
|
{
|
|
5759
6026
|
type: "button",
|
|
@@ -5776,14 +6043,14 @@ function IssuesDrawer({
|
|
|
5776
6043
|
]
|
|
5777
6044
|
}
|
|
5778
6045
|
),
|
|
5779
|
-
filtered.length === 0 ? /* @__PURE__ */
|
|
6046
|
+
filtered.length === 0 ? /* @__PURE__ */ jsx17(
|
|
5780
6047
|
"p",
|
|
5781
6048
|
{
|
|
5782
6049
|
style: { padding: 12, color: colors.textTertiary, fontSize: 12, margin: 0 },
|
|
5783
6050
|
"data-testid": "issues-drawer-empty",
|
|
5784
6051
|
children: messages.issues.none
|
|
5785
6052
|
}
|
|
5786
|
-
) : /* @__PURE__ */
|
|
6053
|
+
) : /* @__PURE__ */ jsx17(
|
|
5787
6054
|
"ul",
|
|
5788
6055
|
{
|
|
5789
6056
|
style: {
|
|
@@ -5797,7 +6064,7 @@ function IssuesDrawer({
|
|
|
5797
6064
|
children: filtered.map((issue, idx) => {
|
|
5798
6065
|
const target = resolveTarget(doc, issue.targetId);
|
|
5799
6066
|
const targetLabel = target ? target.kind === "transition" ? `${messages.issues.relatedTransition}: ${target.label}` : target.kind === "state" ? `${messages.issues.relatedState}: ${target.label}` : target.label : null;
|
|
5800
|
-
return /* @__PURE__ */
|
|
6067
|
+
return /* @__PURE__ */ jsxs15(
|
|
5801
6068
|
"li",
|
|
5802
6069
|
{
|
|
5803
6070
|
style: {
|
|
@@ -5811,10 +6078,10 @@ function IssuesDrawer({
|
|
|
5811
6078
|
},
|
|
5812
6079
|
"data-testid": `issues-drawer-item-${idx}`,
|
|
5813
6080
|
children: [
|
|
5814
|
-
/* @__PURE__ */
|
|
5815
|
-
/* @__PURE__ */
|
|
5816
|
-
targetLabel && /* @__PURE__ */
|
|
5817
|
-
target && /* @__PURE__ */
|
|
6081
|
+
/* @__PURE__ */ jsx17("div", { style: { fontSize: 11, fontWeight: 700, color: tone.fg }, children: issue.code }),
|
|
6082
|
+
/* @__PURE__ */ jsx17("div", { style: { fontSize: 12, color: colors.textPrimary }, children: issue.message }),
|
|
6083
|
+
targetLabel && /* @__PURE__ */ jsx17("div", { style: { fontSize: 11, color: colors.textSecondary }, children: targetLabel }),
|
|
6084
|
+
target && /* @__PURE__ */ jsx17("div", { children: /* @__PURE__ */ jsx17(
|
|
5818
6085
|
"button",
|
|
5819
6086
|
{
|
|
5820
6087
|
type: "button",
|
|
@@ -5849,23 +6116,23 @@ function IssuesDrawer({
|
|
|
5849
6116
|
}
|
|
5850
6117
|
|
|
5851
6118
|
// src/toolbar/WorkflowTabs.tsx
|
|
5852
|
-
import { useEffect as
|
|
6119
|
+
import { useEffect as useEffect9, useRef as useRef11, useState as useState13 } from "react";
|
|
5853
6120
|
|
|
5854
6121
|
// src/toolbar/VersionBadge.tsx
|
|
5855
|
-
import { useEffect as
|
|
6122
|
+
import { useEffect as useEffect8, useRef as useRef10, useState as useState12 } from "react";
|
|
5856
6123
|
import { createPortal as createPortal2 } from "react-dom";
|
|
5857
|
-
import { Fragment as Fragment7, jsx as
|
|
6124
|
+
import { Fragment as Fragment7, jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
5858
6125
|
function VersionBadge({
|
|
5859
6126
|
version,
|
|
5860
6127
|
supportedVersions,
|
|
5861
6128
|
readOnly = false,
|
|
5862
6129
|
onVersionChange
|
|
5863
6130
|
}) {
|
|
5864
|
-
const [open, setOpen] =
|
|
5865
|
-
const [dropdownPos, setDropdownPos] =
|
|
5866
|
-
const buttonRef =
|
|
5867
|
-
const dropdownRef =
|
|
5868
|
-
|
|
6131
|
+
const [open, setOpen] = useState12(false);
|
|
6132
|
+
const [dropdownPos, setDropdownPos] = useState12(null);
|
|
6133
|
+
const buttonRef = useRef10(null);
|
|
6134
|
+
const dropdownRef = useRef10(null);
|
|
6135
|
+
useEffect8(() => {
|
|
5869
6136
|
if (!open) return;
|
|
5870
6137
|
const handler = (e) => {
|
|
5871
6138
|
const target = e.target;
|
|
@@ -5887,7 +6154,7 @@ function VersionBadge({
|
|
|
5887
6154
|
setOpen((o) => !o);
|
|
5888
6155
|
};
|
|
5889
6156
|
if (readOnly) {
|
|
5890
|
-
return /* @__PURE__ */
|
|
6157
|
+
return /* @__PURE__ */ jsx18(
|
|
5891
6158
|
"div",
|
|
5892
6159
|
{
|
|
5893
6160
|
"data-testid": "version-badge",
|
|
@@ -5906,7 +6173,7 @@ function VersionBadge({
|
|
|
5906
6173
|
);
|
|
5907
6174
|
}
|
|
5908
6175
|
const dropdown = open && dropdownPos ? createPortal2(
|
|
5909
|
-
/* @__PURE__ */
|
|
6176
|
+
/* @__PURE__ */ jsxs16(
|
|
5910
6177
|
"div",
|
|
5911
6178
|
{
|
|
5912
6179
|
ref: dropdownRef,
|
|
@@ -5925,7 +6192,7 @@ function VersionBadge({
|
|
|
5925
6192
|
zIndex: 9999
|
|
5926
6193
|
},
|
|
5927
6194
|
children: [
|
|
5928
|
-
/* @__PURE__ */
|
|
6195
|
+
/* @__PURE__ */ jsx18(
|
|
5929
6196
|
"div",
|
|
5930
6197
|
{
|
|
5931
6198
|
style: {
|
|
@@ -5942,7 +6209,7 @@ function VersionBadge({
|
|
|
5942
6209
|
),
|
|
5943
6210
|
[...supportedVersions].reverse().map((v) => {
|
|
5944
6211
|
const isCurrent = v === version.replace(/^v/, "");
|
|
5945
|
-
return /* @__PURE__ */
|
|
6212
|
+
return /* @__PURE__ */ jsxs16(
|
|
5946
6213
|
"button",
|
|
5947
6214
|
{
|
|
5948
6215
|
type: "button",
|
|
@@ -5965,16 +6232,16 @@ function VersionBadge({
|
|
|
5965
6232
|
textAlign: "left"
|
|
5966
6233
|
},
|
|
5967
6234
|
children: [
|
|
5968
|
-
/* @__PURE__ */
|
|
6235
|
+
/* @__PURE__ */ jsxs16("span", { children: [
|
|
5969
6236
|
v,
|
|
5970
6237
|
" ",
|
|
5971
|
-
/* @__PURE__ */
|
|
6238
|
+
/* @__PURE__ */ jsxs16("span", { style: { fontSize: 11, color: isCurrent ? "#93C5FD" : "#94A3B8" }, children: [
|
|
5972
6239
|
"cyoda-go ",
|
|
5973
6240
|
v,
|
|
5974
6241
|
".x"
|
|
5975
6242
|
] })
|
|
5976
6243
|
] }),
|
|
5977
|
-
isCurrent && /* @__PURE__ */
|
|
6244
|
+
isCurrent && /* @__PURE__ */ jsx18(
|
|
5978
6245
|
"span",
|
|
5979
6246
|
{
|
|
5980
6247
|
style: {
|
|
@@ -5998,8 +6265,8 @@ function VersionBadge({
|
|
|
5998
6265
|
),
|
|
5999
6266
|
document.body
|
|
6000
6267
|
) : null;
|
|
6001
|
-
return /* @__PURE__ */
|
|
6002
|
-
/* @__PURE__ */
|
|
6268
|
+
return /* @__PURE__ */ jsxs16(Fragment7, { children: [
|
|
6269
|
+
/* @__PURE__ */ jsxs16(
|
|
6003
6270
|
"button",
|
|
6004
6271
|
{
|
|
6005
6272
|
ref: buttonRef,
|
|
@@ -6022,7 +6289,7 @@ function VersionBadge({
|
|
|
6022
6289
|
},
|
|
6023
6290
|
children: [
|
|
6024
6291
|
version,
|
|
6025
|
-
/* @__PURE__ */
|
|
6292
|
+
/* @__PURE__ */ jsx18("span", { style: { fontSize: 10, opacity: 0.7 }, children: open ? "\u25B4" : "\u25BE" })
|
|
6026
6293
|
]
|
|
6027
6294
|
}
|
|
6028
6295
|
),
|
|
@@ -6031,7 +6298,7 @@ function VersionBadge({
|
|
|
6031
6298
|
}
|
|
6032
6299
|
|
|
6033
6300
|
// src/toolbar/WorkflowTabs.tsx
|
|
6034
|
-
import { Fragment as Fragment8, jsx as
|
|
6301
|
+
import { Fragment as Fragment8, jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
6035
6302
|
function WorkflowTabs({
|
|
6036
6303
|
workflows,
|
|
6037
6304
|
activeWorkflow,
|
|
@@ -6045,10 +6312,10 @@ function WorkflowTabs({
|
|
|
6045
6312
|
onVersionChange
|
|
6046
6313
|
}) {
|
|
6047
6314
|
const messages = useMessages();
|
|
6048
|
-
const [editingTab, setEditingTab] =
|
|
6049
|
-
const [draftName, setDraftName] =
|
|
6050
|
-
const inputRef =
|
|
6051
|
-
|
|
6315
|
+
const [editingTab, setEditingTab] = useState13(null);
|
|
6316
|
+
const [draftName, setDraftName] = useState13("");
|
|
6317
|
+
const inputRef = useRef11(null);
|
|
6318
|
+
useEffect9(() => {
|
|
6052
6319
|
if (editingTab !== null) inputRef.current?.select();
|
|
6053
6320
|
}, [editingTab]);
|
|
6054
6321
|
const startEditing = (name) => {
|
|
@@ -6068,7 +6335,7 @@ function WorkflowTabs({
|
|
|
6068
6335
|
setEditingTab(null);
|
|
6069
6336
|
};
|
|
6070
6337
|
const cancelEdit = () => setEditingTab(null);
|
|
6071
|
-
return /* @__PURE__ */
|
|
6338
|
+
return /* @__PURE__ */ jsxs17(
|
|
6072
6339
|
"nav",
|
|
6073
6340
|
{
|
|
6074
6341
|
style: {
|
|
@@ -6086,7 +6353,7 @@ function WorkflowTabs({
|
|
|
6086
6353
|
workflows.map((w) => {
|
|
6087
6354
|
const active = w.name === activeWorkflow;
|
|
6088
6355
|
const isEditing = editingTab === w.name;
|
|
6089
|
-
return /* @__PURE__ */
|
|
6356
|
+
return /* @__PURE__ */ jsxs17(
|
|
6090
6357
|
"div",
|
|
6091
6358
|
{
|
|
6092
6359
|
style: {
|
|
@@ -6097,7 +6364,7 @@ function WorkflowTabs({
|
|
|
6097
6364
|
background: active ? "white" : "transparent"
|
|
6098
6365
|
},
|
|
6099
6366
|
children: [
|
|
6100
|
-
isEditing ? /* @__PURE__ */
|
|
6367
|
+
isEditing ? /* @__PURE__ */ jsx19(
|
|
6101
6368
|
"input",
|
|
6102
6369
|
{
|
|
6103
6370
|
ref: inputRef,
|
|
@@ -6128,7 +6395,7 @@ function WorkflowTabs({
|
|
|
6128
6395
|
width: Math.max(60, draftName.length * 8)
|
|
6129
6396
|
}
|
|
6130
6397
|
}
|
|
6131
|
-
) : /* @__PURE__ */
|
|
6398
|
+
) : /* @__PURE__ */ jsx19(
|
|
6132
6399
|
"button",
|
|
6133
6400
|
{
|
|
6134
6401
|
type: "button",
|
|
@@ -6147,7 +6414,7 @@ function WorkflowTabs({
|
|
|
6147
6414
|
children: w.name || messages.tabs.untitled
|
|
6148
6415
|
}
|
|
6149
6416
|
),
|
|
6150
|
-
onClose && !readOnly && workflows.length > 1 && !isEditing && /* @__PURE__ */
|
|
6417
|
+
onClose && !readOnly && workflows.length > 1 && !isEditing && /* @__PURE__ */ jsx19(
|
|
6151
6418
|
"button",
|
|
6152
6419
|
{
|
|
6153
6420
|
type: "button",
|
|
@@ -6170,7 +6437,7 @@ function WorkflowTabs({
|
|
|
6170
6437
|
w.name
|
|
6171
6438
|
);
|
|
6172
6439
|
}),
|
|
6173
|
-
onAdd && !readOnly && /* @__PURE__ */
|
|
6440
|
+
onAdd && !readOnly && /* @__PURE__ */ jsxs17(
|
|
6174
6441
|
"button",
|
|
6175
6442
|
{
|
|
6176
6443
|
type: "button",
|
|
@@ -6195,9 +6462,9 @@ function WorkflowTabs({
|
|
|
6195
6462
|
]
|
|
6196
6463
|
}
|
|
6197
6464
|
),
|
|
6198
|
-
dialectVersion && /* @__PURE__ */
|
|
6199
|
-
/* @__PURE__ */
|
|
6200
|
-
/* @__PURE__ */
|
|
6465
|
+
dialectVersion && /* @__PURE__ */ jsxs17(Fragment8, { children: [
|
|
6466
|
+
/* @__PURE__ */ jsx19("div", { style: { flex: 1 } }),
|
|
6467
|
+
/* @__PURE__ */ jsx19(
|
|
6201
6468
|
VersionBadge,
|
|
6202
6469
|
{
|
|
6203
6470
|
version: dialectVersion,
|
|
@@ -6213,9 +6480,9 @@ function WorkflowTabs({
|
|
|
6213
6480
|
}
|
|
6214
6481
|
|
|
6215
6482
|
// src/modals/DragConnectModal.tsx
|
|
6216
|
-
import { useState as
|
|
6483
|
+
import { useState as useState14 } from "react";
|
|
6217
6484
|
import { NAME_REGEX as NAME_REGEX4 } from "@cyoda/workflow-core";
|
|
6218
|
-
import { jsx as
|
|
6485
|
+
import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
6219
6486
|
function generateDefault(toState, existing) {
|
|
6220
6487
|
const base = `to_${toState}`;
|
|
6221
6488
|
if (!existing.has(base)) return base;
|
|
@@ -6232,20 +6499,20 @@ function DragConnectModal({
|
|
|
6232
6499
|
}) {
|
|
6233
6500
|
const messages = useMessages();
|
|
6234
6501
|
const existing = new Set(source.transitions.map((t) => t.name));
|
|
6235
|
-
const [name, setName] =
|
|
6502
|
+
const [name, setName] = useState14(() => generateDefault(toState, existing));
|
|
6236
6503
|
const invalidFormat = !!name && !NAME_REGEX4.test(name);
|
|
6237
6504
|
const duplicate = existing.has(name);
|
|
6238
6505
|
const blocked = name.length === 0 || invalidFormat || duplicate;
|
|
6239
|
-
return /* @__PURE__ */
|
|
6240
|
-
/* @__PURE__ */
|
|
6241
|
-
/* @__PURE__ */
|
|
6506
|
+
return /* @__PURE__ */ jsxs18(ModalFrame, { onCancel, children: [
|
|
6507
|
+
/* @__PURE__ */ jsx20("h2", { style: { margin: 0, fontSize: 16 }, children: messages.dragConnect.title }),
|
|
6508
|
+
/* @__PURE__ */ jsxs18("p", { style: { margin: "6px 0 14px", fontSize: 12, color: colors.textSecondary }, children: [
|
|
6242
6509
|
fromState,
|
|
6243
6510
|
" \u2192 ",
|
|
6244
6511
|
toState
|
|
6245
6512
|
] }),
|
|
6246
|
-
/* @__PURE__ */
|
|
6247
|
-
/* @__PURE__ */
|
|
6248
|
-
/* @__PURE__ */
|
|
6513
|
+
/* @__PURE__ */ jsxs18("label", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
|
|
6514
|
+
/* @__PURE__ */ jsx20("span", { style: { fontSize: 12, color: colors.textSecondary }, children: messages.dragConnect.transitionName }),
|
|
6515
|
+
/* @__PURE__ */ jsx20(
|
|
6249
6516
|
"input",
|
|
6250
6517
|
{
|
|
6251
6518
|
type: "text",
|
|
@@ -6265,17 +6532,17 @@ function DragConnectModal({
|
|
|
6265
6532
|
}
|
|
6266
6533
|
)
|
|
6267
6534
|
] }),
|
|
6268
|
-
invalidFormat && /* @__PURE__ */
|
|
6269
|
-
duplicate && /* @__PURE__ */
|
|
6270
|
-
/* @__PURE__ */
|
|
6271
|
-
/* @__PURE__ */
|
|
6272
|
-
/* @__PURE__ */
|
|
6535
|
+
invalidFormat && /* @__PURE__ */ jsx20("div", { style: errorMsg, "data-testid": "dragconnect-error-format", children: messages.dragConnect.invalidName }),
|
|
6536
|
+
duplicate && /* @__PURE__ */ jsx20("div", { style: errorMsg, "data-testid": "dragconnect-error-duplicate", children: messages.dragConnect.duplicateName }),
|
|
6537
|
+
/* @__PURE__ */ jsxs18("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, marginTop: 16 }, children: [
|
|
6538
|
+
/* @__PURE__ */ jsx20("button", { type: "button", onClick: onCancel, style: ghostBtn7, "data-testid": "dragconnect-cancel", children: messages.dragConnect.cancel }),
|
|
6539
|
+
/* @__PURE__ */ jsx20(
|
|
6273
6540
|
"button",
|
|
6274
6541
|
{
|
|
6275
6542
|
type: "button",
|
|
6276
6543
|
onClick: () => !blocked && onCreate(name),
|
|
6277
6544
|
disabled: blocked,
|
|
6278
|
-
style:
|
|
6545
|
+
style: primaryBtn4,
|
|
6279
6546
|
"data-testid": "dragconnect-create",
|
|
6280
6547
|
children: messages.dragConnect.create
|
|
6281
6548
|
}
|
|
@@ -6288,7 +6555,7 @@ var errorMsg = {
|
|
|
6288
6555
|
fontSize: 12,
|
|
6289
6556
|
color: colors.danger
|
|
6290
6557
|
};
|
|
6291
|
-
var
|
|
6558
|
+
var ghostBtn7 = {
|
|
6292
6559
|
padding: "6px 12px",
|
|
6293
6560
|
background: "white",
|
|
6294
6561
|
border: `1px solid ${colors.border}`,
|
|
@@ -6296,27 +6563,27 @@ var ghostBtn6 = {
|
|
|
6296
6563
|
fontSize: 13,
|
|
6297
6564
|
cursor: "pointer"
|
|
6298
6565
|
};
|
|
6299
|
-
var
|
|
6300
|
-
...
|
|
6566
|
+
var primaryBtn4 = {
|
|
6567
|
+
...ghostBtn7,
|
|
6301
6568
|
background: colors.primary,
|
|
6302
6569
|
color: "white",
|
|
6303
6570
|
borderColor: colors.primary
|
|
6304
6571
|
};
|
|
6305
6572
|
|
|
6306
6573
|
// src/modals/AddStateModal.tsx
|
|
6307
|
-
import { useEffect as
|
|
6574
|
+
import { useEffect as useEffect10, useRef as useRef12, useState as useState15 } from "react";
|
|
6308
6575
|
import { NAME_REGEX as NAME_REGEX5 } from "@cyoda/workflow-core";
|
|
6309
|
-
import { jsx as
|
|
6576
|
+
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
6310
6577
|
function generateName(existing) {
|
|
6311
6578
|
let n = 1;
|
|
6312
6579
|
while (existing.includes(`state${n}`)) n++;
|
|
6313
6580
|
return `state${n}`;
|
|
6314
6581
|
}
|
|
6315
6582
|
function AddStateModal({ existingNames, onCreate, onCancel }) {
|
|
6316
|
-
const [name, setName] =
|
|
6317
|
-
const [error, setError] =
|
|
6318
|
-
const inputRef =
|
|
6319
|
-
|
|
6583
|
+
const [name, setName] = useState15(() => generateName(existingNames));
|
|
6584
|
+
const [error, setError] = useState15(null);
|
|
6585
|
+
const inputRef = useRef12(null);
|
|
6586
|
+
useEffect10(() => {
|
|
6320
6587
|
inputRef.current?.select();
|
|
6321
6588
|
}, []);
|
|
6322
6589
|
const validate = (v) => {
|
|
@@ -6334,11 +6601,11 @@ function AddStateModal({ existingNames, onCreate, onCancel }) {
|
|
|
6334
6601
|
}
|
|
6335
6602
|
onCreate(name.trim());
|
|
6336
6603
|
};
|
|
6337
|
-
return /* @__PURE__ */
|
|
6338
|
-
/* @__PURE__ */
|
|
6339
|
-
/* @__PURE__ */
|
|
6340
|
-
/* @__PURE__ */
|
|
6341
|
-
/* @__PURE__ */
|
|
6604
|
+
return /* @__PURE__ */ jsxs19(ModalFrame, { onCancel, labelledBy: "add-state-title", children: [
|
|
6605
|
+
/* @__PURE__ */ jsx21("h2", { id: "add-state-title", style: { margin: 0, fontSize: 16 }, children: "Add State" }),
|
|
6606
|
+
/* @__PURE__ */ jsxs19("div", { style: { marginTop: 16, display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
6607
|
+
/* @__PURE__ */ jsx21("label", { htmlFor: "add-state-name-input", style: { fontSize: 12, color: colors.textSecondary }, children: "State name" }),
|
|
6608
|
+
/* @__PURE__ */ jsx21(
|
|
6342
6609
|
"input",
|
|
6343
6610
|
{
|
|
6344
6611
|
ref: inputRef,
|
|
@@ -6364,7 +6631,7 @@ function AddStateModal({ existingNames, onCreate, onCancel }) {
|
|
|
6364
6631
|
}
|
|
6365
6632
|
}
|
|
6366
6633
|
),
|
|
6367
|
-
error && /* @__PURE__ */
|
|
6634
|
+
error && /* @__PURE__ */ jsx21(
|
|
6368
6635
|
"div",
|
|
6369
6636
|
{
|
|
6370
6637
|
id: "add-state-error",
|
|
@@ -6374,23 +6641,23 @@ function AddStateModal({ existingNames, onCreate, onCancel }) {
|
|
|
6374
6641
|
}
|
|
6375
6642
|
)
|
|
6376
6643
|
] }),
|
|
6377
|
-
/* @__PURE__ */
|
|
6378
|
-
/* @__PURE__ */
|
|
6644
|
+
/* @__PURE__ */ jsxs19("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, marginTop: 20 }, children: [
|
|
6645
|
+
/* @__PURE__ */ jsx21(
|
|
6379
6646
|
"button",
|
|
6380
6647
|
{
|
|
6381
6648
|
type: "button",
|
|
6382
6649
|
onClick: onCancel,
|
|
6383
|
-
style:
|
|
6650
|
+
style: ghostBtn8,
|
|
6384
6651
|
"data-testid": "add-state-cancel",
|
|
6385
6652
|
children: "Cancel"
|
|
6386
6653
|
}
|
|
6387
6654
|
),
|
|
6388
|
-
/* @__PURE__ */
|
|
6655
|
+
/* @__PURE__ */ jsx21(
|
|
6389
6656
|
"button",
|
|
6390
6657
|
{
|
|
6391
6658
|
type: "button",
|
|
6392
6659
|
onClick: handleSubmit,
|
|
6393
|
-
style:
|
|
6660
|
+
style: primaryBtn5,
|
|
6394
6661
|
"data-testid": "add-state-confirm",
|
|
6395
6662
|
children: "Add State"
|
|
6396
6663
|
}
|
|
@@ -6398,7 +6665,7 @@ function AddStateModal({ existingNames, onCreate, onCancel }) {
|
|
|
6398
6665
|
] })
|
|
6399
6666
|
] });
|
|
6400
6667
|
}
|
|
6401
|
-
var
|
|
6668
|
+
var ghostBtn8 = {
|
|
6402
6669
|
padding: "6px 12px",
|
|
6403
6670
|
background: "white",
|
|
6404
6671
|
border: `1px solid ${colors.border}`,
|
|
@@ -6406,8 +6673,8 @@ var ghostBtn7 = {
|
|
|
6406
6673
|
fontSize: 13,
|
|
6407
6674
|
cursor: "pointer"
|
|
6408
6675
|
};
|
|
6409
|
-
var
|
|
6410
|
-
...
|
|
6676
|
+
var primaryBtn5 = {
|
|
6677
|
+
...ghostBtn8,
|
|
6411
6678
|
background: colors.primary,
|
|
6412
6679
|
color: "white",
|
|
6413
6680
|
borderColor: colors.primary
|
|
@@ -6415,15 +6682,15 @@ var primaryBtn4 = {
|
|
|
6415
6682
|
|
|
6416
6683
|
// src/modals/HelpModal.tsx
|
|
6417
6684
|
import { workflowPalette as workflowPalette5 } from "@cyoda/workflow-viewer/theme";
|
|
6418
|
-
import { jsx as
|
|
6685
|
+
import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
6419
6686
|
function HelpModal({ onCancel }) {
|
|
6420
6687
|
const messages = useMessages();
|
|
6421
6688
|
const h = messages.help;
|
|
6422
6689
|
const node = workflowPalette5.node;
|
|
6423
6690
|
const edge = workflowPalette5.edge;
|
|
6424
|
-
return /* @__PURE__ */
|
|
6425
|
-
/* @__PURE__ */
|
|
6426
|
-
/* @__PURE__ */
|
|
6691
|
+
return /* @__PURE__ */ jsx22(ModalFrame, { onCancel, labelledBy: "workflow-help-title", children: /* @__PURE__ */ jsxs20("div", { style: { width: 480, maxWidth: "85vw" }, children: [
|
|
6692
|
+
/* @__PURE__ */ jsx22("h2", { id: "workflow-help-title", style: { margin: 0, fontSize: 16 }, children: h.title }),
|
|
6693
|
+
/* @__PURE__ */ jsxs20(
|
|
6427
6694
|
"div",
|
|
6428
6695
|
{
|
|
6429
6696
|
style: {
|
|
@@ -6436,48 +6703,48 @@ function HelpModal({ onCancel }) {
|
|
|
6436
6703
|
gap: 16
|
|
6437
6704
|
},
|
|
6438
6705
|
children: [
|
|
6439
|
-
/* @__PURE__ */
|
|
6440
|
-
/* @__PURE__ */
|
|
6441
|
-
/* @__PURE__ */
|
|
6442
|
-
/* @__PURE__ */
|
|
6443
|
-
/* @__PURE__ */
|
|
6444
|
-
/* @__PURE__ */
|
|
6445
|
-
/* @__PURE__ */
|
|
6446
|
-
/* @__PURE__ */
|
|
6706
|
+
/* @__PURE__ */ jsxs20(Section, { title: h.statesTitle, children: [
|
|
6707
|
+
/* @__PURE__ */ jsx22(ColorRow, { fill: node.initial.fill, border: node.initial.border, label: h.stateInitial }),
|
|
6708
|
+
/* @__PURE__ */ jsx22(ColorRow, { fill: node.default.fill, border: node.default.border, label: h.stateDefault }),
|
|
6709
|
+
/* @__PURE__ */ jsx22(ColorRow, { fill: node.processing.fill, border: node.processing.border, label: h.stateProcessing }),
|
|
6710
|
+
/* @__PURE__ */ jsx22(ColorRow, { fill: node.manualReview.fill, border: node.manualReview.border, label: h.stateManualReview }),
|
|
6711
|
+
/* @__PURE__ */ jsx22(ColorRow, { fill: node.terminal.fill, border: node.terminal.border, label: h.stateTerminal }),
|
|
6712
|
+
/* @__PURE__ */ jsx22(ColorRow, { fill: "#FFFFFF", border: colors.danger, label: h.stateError }),
|
|
6713
|
+
/* @__PURE__ */ jsx22(ColorRow, { fill: "#FFFFFF", border: colors.warning, label: h.stateWarning })
|
|
6447
6714
|
] }),
|
|
6448
|
-
/* @__PURE__ */
|
|
6449
|
-
/* @__PURE__ */
|
|
6450
|
-
/* @__PURE__ */
|
|
6451
|
-
/* @__PURE__ */
|
|
6452
|
-
/* @__PURE__ */
|
|
6453
|
-
/* @__PURE__ */
|
|
6454
|
-
/* @__PURE__ */
|
|
6455
|
-
/* @__PURE__ */
|
|
6715
|
+
/* @__PURE__ */ jsxs20(Section, { title: h.transitionsTitle, children: [
|
|
6716
|
+
/* @__PURE__ */ jsx22(LineRow, { color: edge.automated, label: h.transitionAutomated }),
|
|
6717
|
+
/* @__PURE__ */ jsx22(LineRow, { color: edge.manual, dashed: true, label: h.transitionManual }),
|
|
6718
|
+
/* @__PURE__ */ jsx22(LineRow, { color: edge.conditional, label: h.transitionConditional }),
|
|
6719
|
+
/* @__PURE__ */ jsx22(LineRow, { color: edge.processing, label: h.transitionProcessing }),
|
|
6720
|
+
/* @__PURE__ */ jsx22(LineRow, { color: edge.terminal, label: h.transitionTerminal }),
|
|
6721
|
+
/* @__PURE__ */ jsx22(LineRow, { color: edge.loop, label: h.transitionLoop }),
|
|
6722
|
+
/* @__PURE__ */ jsx22(LineRow, { color: edge.disabled, label: h.transitionDisabled })
|
|
6456
6723
|
] }),
|
|
6457
|
-
/* @__PURE__ */
|
|
6458
|
-
/* @__PURE__ */
|
|
6459
|
-
/* @__PURE__ */
|
|
6460
|
-
/* @__PURE__ */
|
|
6461
|
-
/* @__PURE__ */
|
|
6462
|
-
/* @__PURE__ */
|
|
6463
|
-
/* @__PURE__ */
|
|
6464
|
-
/* @__PURE__ */
|
|
6724
|
+
/* @__PURE__ */ jsxs20(Section, { title: h.controlsTitle, children: [
|
|
6725
|
+
/* @__PURE__ */ jsx22(ShortcutRow, { keys: "A", label: h.shortcutAddState }),
|
|
6726
|
+
/* @__PURE__ */ jsx22(ShortcutRow, { keys: "L", label: h.shortcutAutoLayout }),
|
|
6727
|
+
/* @__PURE__ */ jsx22(ShortcutRow, { keys: "Ctrl/\u2318 Z", label: h.shortcutUndo }),
|
|
6728
|
+
/* @__PURE__ */ jsx22(ShortcutRow, { keys: "Ctrl/\u2318 \u21E7 Z", label: h.shortcutRedo }),
|
|
6729
|
+
/* @__PURE__ */ jsx22(ShortcutRow, { keys: "Ctrl/\u2318 S", label: h.shortcutSave }),
|
|
6730
|
+
/* @__PURE__ */ jsx22(ShortcutRow, { keys: "Delete", label: h.shortcutDelete }),
|
|
6731
|
+
/* @__PURE__ */ jsx22(ShortcutRow, { keys: "Esc", label: h.shortcutEscape })
|
|
6465
6732
|
] }),
|
|
6466
|
-
/* @__PURE__ */
|
|
6467
|
-
/* @__PURE__ */
|
|
6468
|
-
/* @__PURE__ */
|
|
6469
|
-
/* @__PURE__ */
|
|
6470
|
-
/* @__PURE__ */
|
|
6733
|
+
/* @__PURE__ */ jsx22(Section, { title: h.tipsTitle, children: /* @__PURE__ */ jsxs20("ul", { style: { margin: 0, paddingLeft: 18, fontSize: 13, color: colors.textSecondary, display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
6734
|
+
/* @__PURE__ */ jsx22("li", { children: h.tipDoubleClick }),
|
|
6735
|
+
/* @__PURE__ */ jsx22("li", { children: h.tipConnect }),
|
|
6736
|
+
/* @__PURE__ */ jsx22("li", { children: h.tipSelect }),
|
|
6737
|
+
/* @__PURE__ */ jsx22("li", { children: h.tipMove })
|
|
6471
6738
|
] }) })
|
|
6472
6739
|
]
|
|
6473
6740
|
}
|
|
6474
6741
|
),
|
|
6475
|
-
/* @__PURE__ */
|
|
6742
|
+
/* @__PURE__ */ jsx22("div", { style: { display: "flex", justifyContent: "flex-end", marginTop: 16 }, children: /* @__PURE__ */ jsx22("button", { type: "button", onClick: onCancel, style: ghostBtnStyle, "data-testid": "help-modal-close", children: h.close }) })
|
|
6476
6743
|
] }) });
|
|
6477
6744
|
}
|
|
6478
6745
|
function Section({ title, children }) {
|
|
6479
|
-
return /* @__PURE__ */
|
|
6480
|
-
/* @__PURE__ */
|
|
6746
|
+
return /* @__PURE__ */ jsxs20("div", { children: [
|
|
6747
|
+
/* @__PURE__ */ jsx22(
|
|
6481
6748
|
"h3",
|
|
6482
6749
|
{
|
|
6483
6750
|
style: {
|
|
@@ -6491,12 +6758,12 @@ function Section({ title, children }) {
|
|
|
6491
6758
|
children: title
|
|
6492
6759
|
}
|
|
6493
6760
|
),
|
|
6494
|
-
/* @__PURE__ */
|
|
6761
|
+
/* @__PURE__ */ jsx22("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children })
|
|
6495
6762
|
] });
|
|
6496
6763
|
}
|
|
6497
6764
|
function ColorRow({ fill, border, label }) {
|
|
6498
|
-
return /* @__PURE__ */
|
|
6499
|
-
/* @__PURE__ */
|
|
6765
|
+
return /* @__PURE__ */ jsxs20("div", { style: { display: "flex", alignItems: "center", gap: 10, fontSize: 13, color: colors.textPrimary }, children: [
|
|
6766
|
+
/* @__PURE__ */ jsx22(
|
|
6500
6767
|
"span",
|
|
6501
6768
|
{
|
|
6502
6769
|
style: {
|
|
@@ -6509,12 +6776,12 @@ function ColorRow({ fill, border, label }) {
|
|
|
6509
6776
|
}
|
|
6510
6777
|
}
|
|
6511
6778
|
),
|
|
6512
|
-
/* @__PURE__ */
|
|
6779
|
+
/* @__PURE__ */ jsx22("span", { children: label })
|
|
6513
6780
|
] });
|
|
6514
6781
|
}
|
|
6515
6782
|
function LineRow({ color, label, dashed }) {
|
|
6516
|
-
return /* @__PURE__ */
|
|
6517
|
-
/* @__PURE__ */
|
|
6783
|
+
return /* @__PURE__ */ jsxs20("div", { style: { display: "flex", alignItems: "center", gap: 10, fontSize: 13, color: colors.textPrimary }, children: [
|
|
6784
|
+
/* @__PURE__ */ jsx22("svg", { width: "28", height: "14", style: { flexShrink: 0 }, "aria-hidden": "true", children: /* @__PURE__ */ jsx22(
|
|
6518
6785
|
"line",
|
|
6519
6786
|
{
|
|
6520
6787
|
x1: "2",
|
|
@@ -6527,12 +6794,12 @@ function LineRow({ color, label, dashed }) {
|
|
|
6527
6794
|
...dashed ? { strokeDasharray: "3 3" } : {}
|
|
6528
6795
|
}
|
|
6529
6796
|
) }),
|
|
6530
|
-
/* @__PURE__ */
|
|
6797
|
+
/* @__PURE__ */ jsx22("span", { children: label })
|
|
6531
6798
|
] });
|
|
6532
6799
|
}
|
|
6533
6800
|
function ShortcutRow({ keys, label }) {
|
|
6534
|
-
return /* @__PURE__ */
|
|
6535
|
-
/* @__PURE__ */
|
|
6801
|
+
return /* @__PURE__ */ jsxs20("div", { style: { display: "flex", alignItems: "center", gap: 10, fontSize: 13, color: colors.textPrimary }, children: [
|
|
6802
|
+
/* @__PURE__ */ jsx22(
|
|
6536
6803
|
"kbd",
|
|
6537
6804
|
{
|
|
6538
6805
|
style: {
|
|
@@ -6552,12 +6819,12 @@ function ShortcutRow({ keys, label }) {
|
|
|
6552
6819
|
children: keys
|
|
6553
6820
|
}
|
|
6554
6821
|
),
|
|
6555
|
-
/* @__PURE__ */
|
|
6822
|
+
/* @__PURE__ */ jsx22("span", { children: label })
|
|
6556
6823
|
] });
|
|
6557
6824
|
}
|
|
6558
6825
|
|
|
6559
6826
|
// src/modals/VersionSwitchModal.tsx
|
|
6560
|
-
import { jsx as
|
|
6827
|
+
import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
6561
6828
|
function VersionSwitchModal({
|
|
6562
6829
|
fromVersion,
|
|
6563
6830
|
toVersion,
|
|
@@ -6565,7 +6832,7 @@ function VersionSwitchModal({
|
|
|
6565
6832
|
onConfirm,
|
|
6566
6833
|
onCancel
|
|
6567
6834
|
}) {
|
|
6568
|
-
return /* @__PURE__ */
|
|
6835
|
+
return /* @__PURE__ */ jsx23(
|
|
6569
6836
|
"div",
|
|
6570
6837
|
{
|
|
6571
6838
|
style: {
|
|
@@ -6577,7 +6844,7 @@ function VersionSwitchModal({
|
|
|
6577
6844
|
justifyContent: "center",
|
|
6578
6845
|
zIndex: 1e3
|
|
6579
6846
|
},
|
|
6580
|
-
children: /* @__PURE__ */
|
|
6847
|
+
children: /* @__PURE__ */ jsxs21(
|
|
6581
6848
|
"div",
|
|
6582
6849
|
{
|
|
6583
6850
|
"data-testid": "version-switch-modal",
|
|
@@ -6591,8 +6858,8 @@ function VersionSwitchModal({
|
|
|
6591
6858
|
fontFamily: "inherit"
|
|
6592
6859
|
},
|
|
6593
6860
|
children: [
|
|
6594
|
-
/* @__PURE__ */
|
|
6595
|
-
/* @__PURE__ */
|
|
6861
|
+
/* @__PURE__ */ jsxs21("div", { style: { padding: "16px 20px 0", display: "flex", alignItems: "flex-start", gap: 12 }, children: [
|
|
6862
|
+
/* @__PURE__ */ jsx23(
|
|
6596
6863
|
"div",
|
|
6597
6864
|
{
|
|
6598
6865
|
style: {
|
|
@@ -6609,20 +6876,20 @@ function VersionSwitchModal({
|
|
|
6609
6876
|
children: "\u26A0\uFE0F"
|
|
6610
6877
|
}
|
|
6611
6878
|
),
|
|
6612
|
-
/* @__PURE__ */
|
|
6613
|
-
/* @__PURE__ */
|
|
6879
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
6880
|
+
/* @__PURE__ */ jsxs21("div", { style: { fontWeight: 600, fontSize: 14, color: "#0F172A", marginBottom: 4 }, children: [
|
|
6614
6881
|
"Switch to ",
|
|
6615
6882
|
toVersion,
|
|
6616
6883
|
"?"
|
|
6617
6884
|
] }),
|
|
6618
|
-
/* @__PURE__ */
|
|
6885
|
+
/* @__PURE__ */ jsxs21("div", { style: { color: "#475569", lineHeight: 1.5, fontSize: 13 }, children: [
|
|
6619
6886
|
"Switching to ",
|
|
6620
6887
|
toVersion,
|
|
6621
6888
|
" will remove data not supported in that dialect:"
|
|
6622
6889
|
] })
|
|
6623
6890
|
] })
|
|
6624
6891
|
] }),
|
|
6625
|
-
/* @__PURE__ */
|
|
6892
|
+
/* @__PURE__ */ jsxs21(
|
|
6626
6893
|
"div",
|
|
6627
6894
|
{
|
|
6628
6895
|
style: {
|
|
@@ -6635,17 +6902,17 @@ function VersionSwitchModal({
|
|
|
6635
6902
|
fontSize: 12
|
|
6636
6903
|
},
|
|
6637
6904
|
children: [
|
|
6638
|
-
/* @__PURE__ */
|
|
6639
|
-
/* @__PURE__ */
|
|
6905
|
+
/* @__PURE__ */ jsx23("div", { style: { fontWeight: 600, marginBottom: 6 }, children: "Will be removed:" }),
|
|
6906
|
+
/* @__PURE__ */ jsx23("ul", { style: { margin: 0, paddingLeft: 16, lineHeight: 1.8 }, children: warnings.map((w, i) => /* @__PURE__ */ jsx23("li", { children: w }, i)) })
|
|
6640
6907
|
]
|
|
6641
6908
|
}
|
|
6642
6909
|
),
|
|
6643
|
-
/* @__PURE__ */
|
|
6910
|
+
/* @__PURE__ */ jsxs21("div", { style: { padding: "10px 20px 0 64px", color: "#64748B", fontSize: 12, lineHeight: 1.5 }, children: [
|
|
6644
6911
|
"This cannot be undone. You can switch back to ",
|
|
6645
6912
|
fromVersion,
|
|
6646
6913
|
" any time, but the removed data will not be restored."
|
|
6647
6914
|
] }),
|
|
6648
|
-
/* @__PURE__ */
|
|
6915
|
+
/* @__PURE__ */ jsxs21(
|
|
6649
6916
|
"div",
|
|
6650
6917
|
{
|
|
6651
6918
|
style: {
|
|
@@ -6657,7 +6924,7 @@ function VersionSwitchModal({
|
|
|
6657
6924
|
marginTop: 16
|
|
6658
6925
|
},
|
|
6659
6926
|
children: [
|
|
6660
|
-
/* @__PURE__ */
|
|
6927
|
+
/* @__PURE__ */ jsx23(
|
|
6661
6928
|
"button",
|
|
6662
6929
|
{
|
|
6663
6930
|
type: "button",
|
|
@@ -6675,7 +6942,7 @@ function VersionSwitchModal({
|
|
|
6675
6942
|
children: "Cancel"
|
|
6676
6943
|
}
|
|
6677
6944
|
),
|
|
6678
|
-
/* @__PURE__ */
|
|
6945
|
+
/* @__PURE__ */ jsxs21(
|
|
6679
6946
|
"button",
|
|
6680
6947
|
{
|
|
6681
6948
|
type: "button",
|
|
@@ -6709,17 +6976,17 @@ function VersionSwitchModal({
|
|
|
6709
6976
|
}
|
|
6710
6977
|
|
|
6711
6978
|
// src/components/CommentNode.tsx
|
|
6712
|
-
import { useRef as
|
|
6713
|
-
import { jsx as
|
|
6979
|
+
import { useRef as useRef13, useState as useState16 } from "react";
|
|
6980
|
+
import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
6714
6981
|
function CommentNode({ comment, disabled, onUpdate, onRemove }) {
|
|
6715
|
-
const [editing, setEditing] =
|
|
6716
|
-
const [draft, setDraft] =
|
|
6717
|
-
const textareaRef =
|
|
6982
|
+
const [editing, setEditing] = useState16(false);
|
|
6983
|
+
const [draft, setDraft] = useState16(comment.text);
|
|
6984
|
+
const textareaRef = useRef13(null);
|
|
6718
6985
|
const commitEdit = () => {
|
|
6719
6986
|
setEditing(false);
|
|
6720
6987
|
if (draft !== comment.text) onUpdate({ text: draft });
|
|
6721
6988
|
};
|
|
6722
|
-
return /* @__PURE__ */
|
|
6989
|
+
return /* @__PURE__ */ jsxs22(
|
|
6723
6990
|
"div",
|
|
6724
6991
|
{
|
|
6725
6992
|
"data-testid": `comment-${comment.id}`,
|
|
@@ -6740,8 +7007,8 @@ function CommentNode({ comment, disabled, onUpdate, onRemove }) {
|
|
|
6740
7007
|
userSelect: "none"
|
|
6741
7008
|
},
|
|
6742
7009
|
children: [
|
|
6743
|
-
/* @__PURE__ */
|
|
6744
|
-
!disabled && !editing && /* @__PURE__ */
|
|
7010
|
+
/* @__PURE__ */ jsxs22("div", { style: { display: "flex", justifyContent: "flex-end", gap: 4, marginBottom: 4 }, children: [
|
|
7011
|
+
!disabled && !editing && /* @__PURE__ */ jsx24(
|
|
6745
7012
|
"button",
|
|
6746
7013
|
{
|
|
6747
7014
|
type: "button",
|
|
@@ -6756,7 +7023,7 @@ function CommentNode({ comment, disabled, onUpdate, onRemove }) {
|
|
|
6756
7023
|
children: "\u270F\uFE0F"
|
|
6757
7024
|
}
|
|
6758
7025
|
),
|
|
6759
|
-
!disabled && /* @__PURE__ */
|
|
7026
|
+
!disabled && /* @__PURE__ */ jsx24(
|
|
6760
7027
|
"button",
|
|
6761
7028
|
{
|
|
6762
7029
|
type: "button",
|
|
@@ -6768,7 +7035,7 @@ function CommentNode({ comment, disabled, onUpdate, onRemove }) {
|
|
|
6768
7035
|
}
|
|
6769
7036
|
)
|
|
6770
7037
|
] }),
|
|
6771
|
-
editing ? /* @__PURE__ */
|
|
7038
|
+
editing ? /* @__PURE__ */ jsx24(
|
|
6772
7039
|
"textarea",
|
|
6773
7040
|
{
|
|
6774
7041
|
ref: textareaRef,
|
|
@@ -6794,7 +7061,7 @@ function CommentNode({ comment, disabled, onUpdate, onRemove }) {
|
|
|
6794
7061
|
},
|
|
6795
7062
|
"data-testid": `comment-textarea-${comment.id}`
|
|
6796
7063
|
}
|
|
6797
|
-
) : /* @__PURE__ */
|
|
7064
|
+
) : /* @__PURE__ */ jsx24(
|
|
6798
7065
|
"div",
|
|
6799
7066
|
{
|
|
6800
7067
|
onDoubleClick: () => {
|
|
@@ -6804,7 +7071,7 @@ function CommentNode({ comment, disabled, onUpdate, onRemove }) {
|
|
|
6804
7071
|
}
|
|
6805
7072
|
},
|
|
6806
7073
|
style: { whiteSpace: "pre-wrap", wordBreak: "break-word", minHeight: 20 },
|
|
6807
|
-
children: comment.text || /* @__PURE__ */
|
|
7074
|
+
children: comment.text || /* @__PURE__ */ jsx24("em", { style: { color: "#94a3b8" }, children: "empty note" })
|
|
6808
7075
|
}
|
|
6809
7076
|
)
|
|
6810
7077
|
]
|
|
@@ -6822,14 +7089,14 @@ var iconBtn = {
|
|
|
6822
7089
|
};
|
|
6823
7090
|
|
|
6824
7091
|
// src/components/WorkflowJsonEditor.tsx
|
|
6825
|
-
import { useEffect as
|
|
7092
|
+
import { useEffect as useEffect11, useMemo as useMemo6, useRef as useRef14, useState as useState17 } from "react";
|
|
6826
7093
|
import {
|
|
6827
7094
|
attachCursorSelectionBridge,
|
|
6828
7095
|
attachWorkflowJsonController,
|
|
6829
7096
|
registerWorkflowSchema,
|
|
6830
7097
|
revealIdInEditor
|
|
6831
7098
|
} from "@cyoda/workflow-monaco";
|
|
6832
|
-
import { Fragment as Fragment9, jsx as
|
|
7099
|
+
import { Fragment as Fragment9, jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
6833
7100
|
function WorkflowJsonEditor({
|
|
6834
7101
|
document: document2,
|
|
6835
7102
|
issues,
|
|
@@ -6841,20 +7108,20 @@ function WorkflowJsonEditor({
|
|
|
6841
7108
|
onSelectionChange,
|
|
6842
7109
|
onStatusChange
|
|
6843
7110
|
}) {
|
|
6844
|
-
const containerRef =
|
|
6845
|
-
const documentRef =
|
|
6846
|
-
const issuesRef =
|
|
6847
|
-
const readOnlyRef =
|
|
6848
|
-
const onPatchRef =
|
|
6849
|
-
const onSelectionChangeRef =
|
|
6850
|
-
const onStatusChangeRef =
|
|
6851
|
-
const editorRef =
|
|
6852
|
-
const controllerRef =
|
|
6853
|
-
const schemaHandleRef =
|
|
6854
|
-
const cursorBridgeRef =
|
|
6855
|
-
const applyingGraphSelectionRef =
|
|
6856
|
-
const visibleRef =
|
|
6857
|
-
const [status, setStatus] =
|
|
7111
|
+
const containerRef = useRef14(null);
|
|
7112
|
+
const documentRef = useRef14(document2);
|
|
7113
|
+
const issuesRef = useRef14(issues);
|
|
7114
|
+
const readOnlyRef = useRef14(readOnly);
|
|
7115
|
+
const onPatchRef = useRef14(onPatch);
|
|
7116
|
+
const onSelectionChangeRef = useRef14(onSelectionChange);
|
|
7117
|
+
const onStatusChangeRef = useRef14(onStatusChange);
|
|
7118
|
+
const editorRef = useRef14(null);
|
|
7119
|
+
const controllerRef = useRef14(null);
|
|
7120
|
+
const schemaHandleRef = useRef14(null);
|
|
7121
|
+
const cursorBridgeRef = useRef14(null);
|
|
7122
|
+
const applyingGraphSelectionRef = useRef14(false);
|
|
7123
|
+
const visibleRef = useRef14(visible);
|
|
7124
|
+
const [status, setStatus] = useState17({ status: "idle" });
|
|
6858
7125
|
documentRef.current = document2;
|
|
6859
7126
|
issuesRef.current = issues;
|
|
6860
7127
|
readOnlyRef.current = readOnly;
|
|
@@ -6870,7 +7137,7 @@ function WorkflowJsonEditor({
|
|
|
6870
7137
|
const modelUri = config?.modelUri;
|
|
6871
7138
|
const editorOptions = config?.editorOptions;
|
|
6872
7139
|
const debounceMs = config?.debounceMs;
|
|
6873
|
-
|
|
7140
|
+
useEffect11(() => {
|
|
6874
7141
|
if (!monaco || !containerRef.current || editorRef.current) return;
|
|
6875
7142
|
const model = monaco.editor.createModel(
|
|
6876
7143
|
"",
|
|
@@ -6925,7 +7192,7 @@ function WorkflowJsonEditor({
|
|
|
6925
7192
|
model.dispose();
|
|
6926
7193
|
};
|
|
6927
7194
|
}, [monaco, modelUri]);
|
|
6928
|
-
|
|
7195
|
+
useEffect11(() => {
|
|
6929
7196
|
const editor = editorRef.current;
|
|
6930
7197
|
const controller = controllerRef.current;
|
|
6931
7198
|
if (!editor || !controller || !config) return;
|
|
@@ -6933,17 +7200,17 @@ function WorkflowJsonEditor({
|
|
|
6933
7200
|
controller.syncFromDocument(document2);
|
|
6934
7201
|
controller.renderIssues(issues, document2);
|
|
6935
7202
|
}, [config, document2, issues, readOnly]);
|
|
6936
|
-
|
|
7203
|
+
useEffect11(() => {
|
|
6937
7204
|
if (!visible) return;
|
|
6938
7205
|
editorRef.current?.layout?.();
|
|
6939
7206
|
}, [visible]);
|
|
6940
|
-
|
|
7207
|
+
useEffect11(() => {
|
|
6941
7208
|
if (!config) {
|
|
6942
7209
|
setStatus({ status: "idle" });
|
|
6943
7210
|
onStatusChangeRef.current?.({ status: "idle" });
|
|
6944
7211
|
}
|
|
6945
7212
|
}, [config]);
|
|
6946
|
-
|
|
7213
|
+
useEffect11(() => {
|
|
6947
7214
|
const editor = editorRef.current;
|
|
6948
7215
|
if (!editor || !visible || !selectedId) return;
|
|
6949
7216
|
applyingGraphSelectionRef.current = true;
|
|
@@ -6954,7 +7221,7 @@ function WorkflowJsonEditor({
|
|
|
6954
7221
|
return () => window.clearTimeout(timeout);
|
|
6955
7222
|
}, [document2, selectedId, visible]);
|
|
6956
7223
|
if (!config) {
|
|
6957
|
-
return /* @__PURE__ */
|
|
7224
|
+
return /* @__PURE__ */ jsx25(
|
|
6958
7225
|
"div",
|
|
6959
7226
|
{
|
|
6960
7227
|
"data-testid": "workflow-json-unavailable",
|
|
@@ -6969,11 +7236,11 @@ function WorkflowJsonEditor({
|
|
|
6969
7236
|
textAlign: "center",
|
|
6970
7237
|
background: "#F8FAFC"
|
|
6971
7238
|
},
|
|
6972
|
-
children: /* @__PURE__ */
|
|
7239
|
+
children: /* @__PURE__ */ jsx25(UnavailableMessage, {})
|
|
6973
7240
|
}
|
|
6974
7241
|
);
|
|
6975
7242
|
}
|
|
6976
|
-
return /* @__PURE__ */
|
|
7243
|
+
return /* @__PURE__ */ jsxs23(
|
|
6977
7244
|
"div",
|
|
6978
7245
|
{
|
|
6979
7246
|
"data-testid": "workflow-json-editor",
|
|
@@ -6985,8 +7252,8 @@ function WorkflowJsonEditor({
|
|
|
6985
7252
|
minHeight: 0
|
|
6986
7253
|
},
|
|
6987
7254
|
children: [
|
|
6988
|
-
/* @__PURE__ */
|
|
6989
|
-
/* @__PURE__ */
|
|
7255
|
+
/* @__PURE__ */ jsx25(JsonStatusBanner, { status }),
|
|
7256
|
+
/* @__PURE__ */ jsx25(
|
|
6990
7257
|
"div",
|
|
6991
7258
|
{
|
|
6992
7259
|
ref: containerRef,
|
|
@@ -6999,7 +7266,7 @@ function WorkflowJsonEditor({
|
|
|
6999
7266
|
}
|
|
7000
7267
|
function UnavailableMessage() {
|
|
7001
7268
|
const messages = useMessages();
|
|
7002
|
-
return /* @__PURE__ */
|
|
7269
|
+
return /* @__PURE__ */ jsx25(Fragment9, { children: messages.editorView.unavailable });
|
|
7003
7270
|
}
|
|
7004
7271
|
function JsonStatusBanner({ status }) {
|
|
7005
7272
|
const messages = useMessages();
|
|
@@ -7008,7 +7275,7 @@ function JsonStatusBanner({ status }) {
|
|
|
7008
7275
|
}
|
|
7009
7276
|
const tone = status.status === "semantic-errors" ? { border: "#FCD34D", bg: "#FFFBEB", text: "#92400E" } : { border: "#FCA5A5", bg: "#FEF2F2", text: "#991B1B" };
|
|
7010
7277
|
const body = status.status === "semantic-errors" ? messages.editorView.semanticErrors : status.status === "invalid-schema" ? messages.editorView.invalidSchema : `${messages.editorView.invalidJson}${status.message ? ` ${status.message}` : ""}`;
|
|
7011
|
-
return /* @__PURE__ */
|
|
7278
|
+
return /* @__PURE__ */ jsx25(
|
|
7012
7279
|
"div",
|
|
7013
7280
|
{
|
|
7014
7281
|
role: "status",
|
|
@@ -7052,7 +7319,7 @@ function selectionFromJsonId(doc, id) {
|
|
|
7052
7319
|
}
|
|
7053
7320
|
|
|
7054
7321
|
// src/components/WorkflowEditor.tsx
|
|
7055
|
-
import { Fragment as Fragment10, jsx as
|
|
7322
|
+
import { Fragment as Fragment10, jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
7056
7323
|
function hasPersistedWorkflowUi(meta) {
|
|
7057
7324
|
return !!meta && Object.values(meta).some((value) => value !== void 0);
|
|
7058
7325
|
}
|
|
@@ -7119,36 +7386,36 @@ function WorkflowEditor({
|
|
|
7119
7386
|
}
|
|
7120
7387
|
}, []);
|
|
7121
7388
|
const [state, actions] = useEditorStore(initialDocumentWithLayout, mode);
|
|
7122
|
-
const [isFullscreen, setIsFullscreen] =
|
|
7123
|
-
const [inspectorWidth, setInspectorWidth] =
|
|
7124
|
-
const editorContainerRef =
|
|
7125
|
-
const [pendingDelete, setPendingDelete] =
|
|
7126
|
-
const [pendingConnect, setPendingConnect] =
|
|
7127
|
-
const [pendingAddState, setPendingAddState] =
|
|
7128
|
-
const [helpOpen, setHelpOpen] =
|
|
7129
|
-
const [reconnectError, setReconnectError] =
|
|
7130
|
-
const [layoutKey, setLayoutKey] =
|
|
7131
|
-
const [activeSurface, setActiveSurface] =
|
|
7132
|
-
const [jsonStatus, setJsonStatus] =
|
|
7133
|
-
const [openIssueSeverity, setOpenIssueSeverity] =
|
|
7134
|
-
const [inspectorOpen, setInspectorOpen] =
|
|
7135
|
-
const [pendingVersionSwitch, setPendingVersionSwitch] =
|
|
7136
|
-
const selectionRef =
|
|
7137
|
-
const documentStateRef =
|
|
7138
|
-
const activeWorkflowRef =
|
|
7139
|
-
const pendingSelectionRestoreRef =
|
|
7140
|
-
const newStatePositionRef =
|
|
7141
|
-
|
|
7389
|
+
const [isFullscreen, setIsFullscreen] = useState18(false);
|
|
7390
|
+
const [inspectorWidth, setInspectorWidth] = useState18(384);
|
|
7391
|
+
const editorContainerRef = useRef15(null);
|
|
7392
|
+
const [pendingDelete, setPendingDelete] = useState18(null);
|
|
7393
|
+
const [pendingConnect, setPendingConnect] = useState18(null);
|
|
7394
|
+
const [pendingAddState, setPendingAddState] = useState18(null);
|
|
7395
|
+
const [helpOpen, setHelpOpen] = useState18(false);
|
|
7396
|
+
const [reconnectError, setReconnectError] = useState18(null);
|
|
7397
|
+
const [layoutKey, setLayoutKey] = useState18(0);
|
|
7398
|
+
const [activeSurface, setActiveSurface] = useState18("graph");
|
|
7399
|
+
const [jsonStatus, setJsonStatus] = useState18({ status: "idle" });
|
|
7400
|
+
const [openIssueSeverity, setOpenIssueSeverity] = useState18(null);
|
|
7401
|
+
const [inspectorOpen, setInspectorOpen] = useState18(false);
|
|
7402
|
+
const [pendingVersionSwitch, setPendingVersionSwitch] = useState18(null);
|
|
7403
|
+
const selectionRef = useRef15(state.selection);
|
|
7404
|
+
const documentStateRef = useRef15(state.document);
|
|
7405
|
+
const activeWorkflowRef = useRef15(state.activeWorkflow);
|
|
7406
|
+
const pendingSelectionRestoreRef = useRef15(null);
|
|
7407
|
+
const newStatePositionRef = useRef15(null);
|
|
7408
|
+
useEffect12(() => {
|
|
7142
7409
|
selectionRef.current = state.selection;
|
|
7143
7410
|
}, [state.selection]);
|
|
7144
|
-
|
|
7411
|
+
useEffect12(() => {
|
|
7145
7412
|
documentStateRef.current = state.document;
|
|
7146
7413
|
activeWorkflowRef.current = state.activeWorkflow;
|
|
7147
7414
|
}, [state.document, state.activeWorkflow]);
|
|
7148
|
-
|
|
7415
|
+
useEffect12(() => {
|
|
7149
7416
|
onChange?.(state.document);
|
|
7150
7417
|
}, [state.document, onChange]);
|
|
7151
|
-
|
|
7418
|
+
useEffect12(() => {
|
|
7152
7419
|
try {
|
|
7153
7420
|
const toStore = {};
|
|
7154
7421
|
for (const [wfName, ui] of Object.entries(state.document.meta.workflowUi)) {
|
|
@@ -7167,7 +7434,7 @@ function WorkflowEditor({
|
|
|
7167
7434
|
} catch {
|
|
7168
7435
|
}
|
|
7169
7436
|
}, [state.document.meta.workflowUi, localStorageKey, onWorkflowUiChange]);
|
|
7170
|
-
|
|
7437
|
+
useEffect12(() => {
|
|
7171
7438
|
if (!onLayoutMetadataChange || !state.activeWorkflow) return;
|
|
7172
7439
|
const ui = state.document.meta.workflowUi[state.activeWorkflow];
|
|
7173
7440
|
if (ui) onLayoutMetadataChange(ui);
|
|
@@ -7545,7 +7812,7 @@ function WorkflowEditor({
|
|
|
7545
7812
|
},
|
|
7546
7813
|
[anyModalOpen, readOnly, state.selection]
|
|
7547
7814
|
);
|
|
7548
|
-
|
|
7815
|
+
useEffect12(() => {
|
|
7549
7816
|
const handleDocumentDeleteKeyDown = (event) => {
|
|
7550
7817
|
if (anyModalOpen || readOnly || isTypingTarget(event.target)) return;
|
|
7551
7818
|
if (event.ctrlKey || event.metaKey || event.altKey) return;
|
|
@@ -7582,7 +7849,7 @@ function WorkflowEditor({
|
|
|
7582
7849
|
[layoutOptions, pinnedNodes]
|
|
7583
7850
|
);
|
|
7584
7851
|
const savedViewport = state.activeWorkflow ? state.document.meta.workflowUi[state.activeWorkflow]?.viewports?.[orientation] : void 0;
|
|
7585
|
-
|
|
7852
|
+
useEffect12(() => {
|
|
7586
7853
|
if (enableJsonEditor) return;
|
|
7587
7854
|
setJsonStatus({ status: "idle" });
|
|
7588
7855
|
onJsonStatusChange?.({ status: "idle" });
|
|
@@ -7621,13 +7888,13 @@ function WorkflowEditor({
|
|
|
7621
7888
|
if (readOnly || anyModalOpen) return;
|
|
7622
7889
|
openAddStateModal({ x, y });
|
|
7623
7890
|
}, [anyModalOpen, openAddStateModal, readOnly]);
|
|
7624
|
-
const graphPane = /* @__PURE__ */
|
|
7891
|
+
const graphPane = /* @__PURE__ */ jsxs24(
|
|
7625
7892
|
"div",
|
|
7626
7893
|
{
|
|
7627
7894
|
"data-testid": "workflow-editor-graph-pane",
|
|
7628
7895
|
style: { flex: 1, minWidth: 0, minHeight: 0, height: "100%", position: "relative" },
|
|
7629
7896
|
children: [
|
|
7630
|
-
/* @__PURE__ */
|
|
7897
|
+
/* @__PURE__ */ jsx26(
|
|
7631
7898
|
Canvas,
|
|
7632
7899
|
{
|
|
7633
7900
|
graph: derived.graph,
|
|
@@ -7672,7 +7939,7 @@ function WorkflowEditor({
|
|
|
7672
7939
|
helpLabel: mergedMessages.toolbar.help
|
|
7673
7940
|
}
|
|
7674
7941
|
),
|
|
7675
|
-
reconnectError && /* @__PURE__ */
|
|
7942
|
+
reconnectError && /* @__PURE__ */ jsx26(
|
|
7676
7943
|
"div",
|
|
7677
7944
|
{
|
|
7678
7945
|
role: "alert",
|
|
@@ -7697,7 +7964,7 @@ function WorkflowEditor({
|
|
|
7697
7964
|
state.activeWorkflow && (() => {
|
|
7698
7965
|
const comments = state.document.meta.workflowUi[state.activeWorkflow]?.comments;
|
|
7699
7966
|
if (!comments) return null;
|
|
7700
|
-
return Object.values(comments).map((c) => /* @__PURE__ */
|
|
7967
|
+
return Object.values(comments).map((c) => /* @__PURE__ */ jsx26(
|
|
7701
7968
|
CommentNode,
|
|
7702
7969
|
{
|
|
7703
7970
|
comment: c,
|
|
@@ -7720,12 +7987,12 @@ function WorkflowEditor({
|
|
|
7720
7987
|
]
|
|
7721
7988
|
}
|
|
7722
7989
|
);
|
|
7723
|
-
const jsonPane = enableJsonEditor ? /* @__PURE__ */
|
|
7990
|
+
const jsonPane = enableJsonEditor ? /* @__PURE__ */ jsx26(
|
|
7724
7991
|
"div",
|
|
7725
7992
|
{
|
|
7726
7993
|
"data-testid": "workflow-editor-json-pane",
|
|
7727
7994
|
style: { flex: 1, minWidth: 0, minHeight: 0, height: "100%" },
|
|
7728
|
-
children: /* @__PURE__ */
|
|
7995
|
+
children: /* @__PURE__ */ jsx26(
|
|
7729
7996
|
WorkflowJsonEditor,
|
|
7730
7997
|
{
|
|
7731
7998
|
document: state.document,
|
|
@@ -7741,7 +8008,7 @@ function WorkflowEditor({
|
|
|
7741
8008
|
)
|
|
7742
8009
|
}
|
|
7743
8010
|
) : null;
|
|
7744
|
-
return /* @__PURE__ */
|
|
8011
|
+
return /* @__PURE__ */ jsx26(CriterionMonacoProvider, { value: jsonEditor?.monaco ?? null, children: /* @__PURE__ */ jsx26(I18nContext.Provider, { value: mergedMessages, children: /* @__PURE__ */ jsx26(EditorConfigContext.Provider, { value: editorConfig, children: /* @__PURE__ */ jsxs24(
|
|
7745
8012
|
"div",
|
|
7746
8013
|
{
|
|
7747
8014
|
ref: editorContainerRef,
|
|
@@ -7762,7 +8029,7 @@ function WorkflowEditor({
|
|
|
7762
8029
|
onKeyDown: handleKeyDown,
|
|
7763
8030
|
tabIndex: -1,
|
|
7764
8031
|
children: [
|
|
7765
|
-
chrome?.tabs !== false && showTabs && /* @__PURE__ */
|
|
8032
|
+
chrome?.tabs !== false && showTabs && /* @__PURE__ */ jsx26(
|
|
7766
8033
|
WorkflowTabs,
|
|
7767
8034
|
{
|
|
7768
8035
|
workflows,
|
|
@@ -7789,9 +8056,9 @@ function WorkflowEditor({
|
|
|
7789
8056
|
onVersionChange: handleVersionChange
|
|
7790
8057
|
}
|
|
7791
8058
|
),
|
|
7792
|
-
/* @__PURE__ */
|
|
7793
|
-
/* @__PURE__ */
|
|
7794
|
-
(enableJsonEditor && jsonEditorPlacement === "tab" || !readOnly && graphVisible) && /* @__PURE__ */
|
|
8059
|
+
/* @__PURE__ */ jsxs24("div", { style: { flex: 1, display: "flex", minHeight: 0 }, children: [
|
|
8060
|
+
/* @__PURE__ */ jsxs24("div", { style: { flex: 1, minWidth: 0, minHeight: 0, display: "flex", flexDirection: "column" }, children: [
|
|
8061
|
+
(enableJsonEditor && jsonEditorPlacement === "tab" || !readOnly && graphVisible) && /* @__PURE__ */ jsxs24(
|
|
7795
8062
|
"div",
|
|
7796
8063
|
{
|
|
7797
8064
|
style: {
|
|
@@ -7805,8 +8072,8 @@ function WorkflowEditor({
|
|
|
7805
8072
|
},
|
|
7806
8073
|
"data-testid": "workflow-editor-surface-tabs",
|
|
7807
8074
|
children: [
|
|
7808
|
-
enableJsonEditor && jsonEditorPlacement === "tab" && /* @__PURE__ */
|
|
7809
|
-
/* @__PURE__ */
|
|
8075
|
+
enableJsonEditor && jsonEditorPlacement === "tab" && /* @__PURE__ */ jsxs24(Fragment10, { children: [
|
|
8076
|
+
/* @__PURE__ */ jsx26(
|
|
7810
8077
|
SurfaceTab,
|
|
7811
8078
|
{
|
|
7812
8079
|
active: activeSurface === "graph",
|
|
@@ -7814,7 +8081,7 @@ function WorkflowEditor({
|
|
|
7814
8081
|
children: mergedMessages.editorView.graph
|
|
7815
8082
|
}
|
|
7816
8083
|
),
|
|
7817
|
-
/* @__PURE__ */
|
|
8084
|
+
/* @__PURE__ */ jsx26(
|
|
7818
8085
|
SurfaceTab,
|
|
7819
8086
|
{
|
|
7820
8087
|
active: activeSurface === "json",
|
|
@@ -7823,8 +8090,8 @@ function WorkflowEditor({
|
|
|
7823
8090
|
}
|
|
7824
8091
|
)
|
|
7825
8092
|
] }),
|
|
7826
|
-
/* @__PURE__ */
|
|
7827
|
-
!readOnly && activeSurface === "graph" && /* @__PURE__ */
|
|
8093
|
+
/* @__PURE__ */ jsx26("div", { style: { flex: 1 } }),
|
|
8094
|
+
!readOnly && activeSurface === "graph" && /* @__PURE__ */ jsxs24(
|
|
7828
8095
|
"button",
|
|
7829
8096
|
{
|
|
7830
8097
|
type: "button",
|
|
@@ -7845,7 +8112,7 @@ function WorkflowEditor({
|
|
|
7845
8112
|
cursor: "pointer"
|
|
7846
8113
|
},
|
|
7847
8114
|
children: [
|
|
7848
|
-
/* @__PURE__ */
|
|
8115
|
+
/* @__PURE__ */ jsx26("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", children: /* @__PURE__ */ jsx26("path", { d: "M12 5v14M5 12h14" }) }),
|
|
7849
8116
|
mergedMessages.toolbar.addStateButton
|
|
7850
8117
|
]
|
|
7851
8118
|
}
|
|
@@ -7853,7 +8120,7 @@ function WorkflowEditor({
|
|
|
7853
8120
|
]
|
|
7854
8121
|
}
|
|
7855
8122
|
),
|
|
7856
|
-
enableJsonEditor && jsonEditorPlacement === "split" ? /* @__PURE__ */
|
|
8123
|
+
enableJsonEditor && jsonEditorPlacement === "split" ? /* @__PURE__ */ jsxs24(
|
|
7857
8124
|
"div",
|
|
7858
8125
|
{
|
|
7859
8126
|
style: {
|
|
@@ -7866,10 +8133,10 @@ function WorkflowEditor({
|
|
|
7866
8133
|
"data-testid": "workflow-editor-split-view",
|
|
7867
8134
|
children: [
|
|
7868
8135
|
graphPane,
|
|
7869
|
-
/* @__PURE__ */
|
|
8136
|
+
/* @__PURE__ */ jsx26("div", { style: { borderLeft: "1px solid #E2E8F0", minWidth: 0 }, children: jsonPane })
|
|
7870
8137
|
]
|
|
7871
8138
|
}
|
|
7872
|
-
) : /* @__PURE__ */
|
|
8139
|
+
) : /* @__PURE__ */ jsxs24(
|
|
7873
8140
|
"div",
|
|
7874
8141
|
{
|
|
7875
8142
|
style: {
|
|
@@ -7881,8 +8148,8 @@ function WorkflowEditor({
|
|
|
7881
8148
|
flexDirection: "column"
|
|
7882
8149
|
},
|
|
7883
8150
|
children: [
|
|
7884
|
-
graphVisible ? /* @__PURE__ */
|
|
7885
|
-
enableJsonEditor ? /* @__PURE__ */
|
|
8151
|
+
graphVisible ? /* @__PURE__ */ jsx26("div", { style: { flex: 1, minHeight: 0, minWidth: 0 }, children: graphPane }) : null,
|
|
8152
|
+
enableJsonEditor ? /* @__PURE__ */ jsx26(
|
|
7886
8153
|
"div",
|
|
7887
8154
|
{
|
|
7888
8155
|
style: {
|
|
@@ -7899,8 +8166,8 @@ function WorkflowEditor({
|
|
|
7899
8166
|
}
|
|
7900
8167
|
)
|
|
7901
8168
|
] }),
|
|
7902
|
-
inspectorVisible && /* @__PURE__ */
|
|
7903
|
-
/* @__PURE__ */
|
|
8169
|
+
inspectorVisible && /* @__PURE__ */ jsxs24(Fragment10, { children: [
|
|
8170
|
+
/* @__PURE__ */ jsx26(
|
|
7904
8171
|
"div",
|
|
7905
8172
|
{
|
|
7906
8173
|
onMouseDown: handleInspectorResizeStart,
|
|
@@ -7917,7 +8184,7 @@ function WorkflowEditor({
|
|
|
7917
8184
|
onMouseLeave: (e) => e.currentTarget.style.background = "transparent"
|
|
7918
8185
|
}
|
|
7919
8186
|
),
|
|
7920
|
-
/* @__PURE__ */
|
|
8187
|
+
/* @__PURE__ */ jsx26(
|
|
7921
8188
|
Inspector,
|
|
7922
8189
|
{
|
|
7923
8190
|
document: state.document,
|
|
@@ -7933,7 +8200,7 @@ function WorkflowEditor({
|
|
|
7933
8200
|
)
|
|
7934
8201
|
] })
|
|
7935
8202
|
] }),
|
|
7936
|
-
pendingAddState !== null && state.activeWorkflow && /* @__PURE__ */
|
|
8203
|
+
pendingAddState !== null && state.activeWorkflow && /* @__PURE__ */ jsx26(
|
|
7937
8204
|
AddStateModal,
|
|
7938
8205
|
{
|
|
7939
8206
|
existingNames: Object.keys(
|
|
@@ -7945,7 +8212,7 @@ function WorkflowEditor({
|
|
|
7945
8212
|
onCancel: () => setPendingAddState(null)
|
|
7946
8213
|
}
|
|
7947
8214
|
),
|
|
7948
|
-
pendingDelete && /* @__PURE__ */
|
|
8215
|
+
pendingDelete && /* @__PURE__ */ jsx26(
|
|
7949
8216
|
DeleteStateModal,
|
|
7950
8217
|
{
|
|
7951
8218
|
document: state.document,
|
|
@@ -7955,7 +8222,7 @@ function WorkflowEditor({
|
|
|
7955
8222
|
onCancel: () => setPendingDelete(null)
|
|
7956
8223
|
}
|
|
7957
8224
|
),
|
|
7958
|
-
pendingConnect && pendingConnectState && /* @__PURE__ */
|
|
8225
|
+
pendingConnect && pendingConnectState && /* @__PURE__ */ jsx26(
|
|
7959
8226
|
DragConnectModal,
|
|
7960
8227
|
{
|
|
7961
8228
|
source: pendingConnectState,
|
|
@@ -7965,8 +8232,8 @@ function WorkflowEditor({
|
|
|
7965
8232
|
onCancel: () => setPendingConnect(null)
|
|
7966
8233
|
}
|
|
7967
8234
|
),
|
|
7968
|
-
helpOpen && /* @__PURE__ */
|
|
7969
|
-
pendingVersionSwitch && /* @__PURE__ */
|
|
8235
|
+
helpOpen && /* @__PURE__ */ jsx26(HelpModal, { onCancel: () => setHelpOpen(false) }),
|
|
8236
|
+
pendingVersionSwitch && /* @__PURE__ */ jsx26(
|
|
7970
8237
|
VersionSwitchModal,
|
|
7971
8238
|
{
|
|
7972
8239
|
fromVersion: `v${state.document.meta.cyodaVersion ?? LATEST_CYODA_VERSION}`,
|
|
@@ -7979,8 +8246,8 @@ function WorkflowEditor({
|
|
|
7979
8246
|
onCancel: () => setPendingVersionSwitch(null)
|
|
7980
8247
|
}
|
|
7981
8248
|
),
|
|
7982
|
-
chrome?.toolbar !== false && /* @__PURE__ */
|
|
7983
|
-
/* @__PURE__ */
|
|
8249
|
+
chrome?.toolbar !== false && /* @__PURE__ */ jsxs24("div", { style: { position: "relative" }, children: [
|
|
8250
|
+
/* @__PURE__ */ jsx26(
|
|
7984
8251
|
Toolbar,
|
|
7985
8252
|
{
|
|
7986
8253
|
derived,
|
|
@@ -7995,7 +8262,7 @@ function WorkflowEditor({
|
|
|
7995
8262
|
toolbarEnd
|
|
7996
8263
|
}
|
|
7997
8264
|
),
|
|
7998
|
-
/* @__PURE__ */
|
|
8265
|
+
/* @__PURE__ */ jsx26(
|
|
7999
8266
|
IssuesDrawer,
|
|
8000
8267
|
{
|
|
8001
8268
|
open: openIssueSeverity !== null,
|
|
@@ -8191,7 +8458,7 @@ function SurfaceTab({
|
|
|
8191
8458
|
onClick,
|
|
8192
8459
|
children
|
|
8193
8460
|
}) {
|
|
8194
|
-
return /* @__PURE__ */
|
|
8461
|
+
return /* @__PURE__ */ jsx26(
|
|
8195
8462
|
"button",
|
|
8196
8463
|
{
|
|
8197
8464
|
type: "button",
|
|
@@ -8246,18 +8513,18 @@ function snapToGrid(value, grid = 16) {
|
|
|
8246
8513
|
}
|
|
8247
8514
|
|
|
8248
8515
|
// src/save/useSaveFlow.ts
|
|
8249
|
-
import { useCallback as useCallback4, useRef as
|
|
8516
|
+
import { useCallback as useCallback4, useRef as useRef16, useState as useState19 } from "react";
|
|
8250
8517
|
import {
|
|
8251
8518
|
WorkflowApiConflictError
|
|
8252
8519
|
} from "@cyoda/workflow-core";
|
|
8253
8520
|
function useSaveFlow(args) {
|
|
8254
8521
|
const { api, document: doc, concurrencyToken, onSaved, onReload } = args;
|
|
8255
|
-
const [status, setStatus] =
|
|
8256
|
-
const tokenRef =
|
|
8522
|
+
const [status, setStatus] = useState19({ kind: "idle" });
|
|
8523
|
+
const tokenRef = useRef16(concurrencyToken);
|
|
8257
8524
|
tokenRef.current = concurrencyToken;
|
|
8258
|
-
const entityRef =
|
|
8525
|
+
const entityRef = useRef16(doc.session.entity);
|
|
8259
8526
|
entityRef.current = doc.session.entity;
|
|
8260
|
-
const payloadRef =
|
|
8527
|
+
const payloadRef = useRef16({
|
|
8261
8528
|
importMode: doc.session.importMode,
|
|
8262
8529
|
workflows: doc.session.workflows
|
|
8263
8530
|
});
|
|
@@ -8265,7 +8532,7 @@ function useSaveFlow(args) {
|
|
|
8265
8532
|
importMode: doc.session.importMode,
|
|
8266
8533
|
workflows: doc.session.workflows
|
|
8267
8534
|
};
|
|
8268
|
-
const savingRef =
|
|
8535
|
+
const savingRef = useRef16(false);
|
|
8269
8536
|
const performImport = useCallback4(
|
|
8270
8537
|
async (token) => {
|
|
8271
8538
|
if (savingRef.current) return;
|
|
@@ -8323,8 +8590,8 @@ function useSaveFlow(args) {
|
|
|
8323
8590
|
}
|
|
8324
8591
|
|
|
8325
8592
|
// src/save/SaveConfirmModal.tsx
|
|
8326
|
-
import { useState as
|
|
8327
|
-
import { jsx as
|
|
8593
|
+
import { useState as useState20 } from "react";
|
|
8594
|
+
import { jsx as jsx27, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
8328
8595
|
function SaveConfirmModal({
|
|
8329
8596
|
mode,
|
|
8330
8597
|
requiresExplicitConfirm,
|
|
@@ -8334,17 +8601,17 @@ function SaveConfirmModal({
|
|
|
8334
8601
|
onCancel
|
|
8335
8602
|
}) {
|
|
8336
8603
|
const messages = useMessages();
|
|
8337
|
-
const [ackMode, setAckMode] =
|
|
8338
|
-
const [ackWarnings, setAckWarnings] =
|
|
8604
|
+
const [ackMode, setAckMode] = useState20(!requiresExplicitConfirm);
|
|
8605
|
+
const [ackWarnings, setAckWarnings] = useState20(warningCount === 0);
|
|
8339
8606
|
const blocked = !ackMode || !ackWarnings;
|
|
8340
|
-
return /* @__PURE__ */
|
|
8341
|
-
/* @__PURE__ */
|
|
8342
|
-
/* @__PURE__ */
|
|
8607
|
+
return /* @__PURE__ */ jsxs25(ModalFrame, { onCancel, children: [
|
|
8608
|
+
/* @__PURE__ */ jsx27("h2", { style: { margin: 0, fontSize: 16 }, children: messages.saveConfirm.title }),
|
|
8609
|
+
/* @__PURE__ */ jsxs25("p", { style: { margin: "12px 0", fontSize: 13, color: colors.textSecondary }, children: [
|
|
8343
8610
|
messages.saveConfirm.modeLabel,
|
|
8344
8611
|
": ",
|
|
8345
|
-
/* @__PURE__ */
|
|
8612
|
+
/* @__PURE__ */ jsx27("strong", { children: mode })
|
|
8346
8613
|
] }),
|
|
8347
|
-
diffSummary2 && /* @__PURE__ */
|
|
8614
|
+
diffSummary2 && /* @__PURE__ */ jsx27(
|
|
8348
8615
|
"pre",
|
|
8349
8616
|
{
|
|
8350
8617
|
style: {
|
|
@@ -8363,8 +8630,8 @@ function SaveConfirmModal({
|
|
|
8363
8630
|
children: diffSummary2
|
|
8364
8631
|
}
|
|
8365
8632
|
),
|
|
8366
|
-
requiresExplicitConfirm && /* @__PURE__ */
|
|
8367
|
-
/* @__PURE__ */
|
|
8633
|
+
requiresExplicitConfirm && /* @__PURE__ */ jsxs25("label", { style: checkRow, "data-testid": "save-ack-mode", children: [
|
|
8634
|
+
/* @__PURE__ */ jsx27(
|
|
8368
8635
|
"input",
|
|
8369
8636
|
{
|
|
8370
8637
|
type: "checkbox",
|
|
@@ -8372,10 +8639,10 @@ function SaveConfirmModal({
|
|
|
8372
8639
|
onChange: (e) => setAckMode(e.target.checked)
|
|
8373
8640
|
}
|
|
8374
8641
|
),
|
|
8375
|
-
/* @__PURE__ */
|
|
8642
|
+
/* @__PURE__ */ jsx27("span", { children: mode === "REPLACE" ? messages.saveConfirm.ackReplace : messages.saveConfirm.ackActivate })
|
|
8376
8643
|
] }),
|
|
8377
|
-
warningCount > 0 && /* @__PURE__ */
|
|
8378
|
-
/* @__PURE__ */
|
|
8644
|
+
warningCount > 0 && /* @__PURE__ */ jsxs25("label", { style: checkRow, "data-testid": "save-ack-warnings", children: [
|
|
8645
|
+
/* @__PURE__ */ jsx27(
|
|
8379
8646
|
"input",
|
|
8380
8647
|
{
|
|
8381
8648
|
type: "checkbox",
|
|
@@ -8383,17 +8650,17 @@ function SaveConfirmModal({
|
|
|
8383
8650
|
onChange: (e) => setAckWarnings(e.target.checked)
|
|
8384
8651
|
}
|
|
8385
8652
|
),
|
|
8386
|
-
/* @__PURE__ */
|
|
8653
|
+
/* @__PURE__ */ jsx27("span", { children: messages.saveConfirm.ackWarnings.replace("{count}", String(warningCount)) })
|
|
8387
8654
|
] }),
|
|
8388
|
-
/* @__PURE__ */
|
|
8389
|
-
/* @__PURE__ */
|
|
8390
|
-
/* @__PURE__ */
|
|
8655
|
+
/* @__PURE__ */ jsxs25("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, marginTop: 16 }, children: [
|
|
8656
|
+
/* @__PURE__ */ jsx27("button", { type: "button", onClick: onCancel, style: ghostBtn9, "data-testid": "save-cancel", children: messages.saveConfirm.cancel }),
|
|
8657
|
+
/* @__PURE__ */ jsx27(
|
|
8391
8658
|
"button",
|
|
8392
8659
|
{
|
|
8393
8660
|
type: "button",
|
|
8394
8661
|
disabled: blocked,
|
|
8395
8662
|
onClick: onConfirm,
|
|
8396
|
-
style:
|
|
8663
|
+
style: primaryBtn6,
|
|
8397
8664
|
"data-testid": "save-confirm",
|
|
8398
8665
|
children: messages.saveConfirm.confirm
|
|
8399
8666
|
}
|
|
@@ -8409,7 +8676,7 @@ var checkRow = {
|
|
|
8409
8676
|
color: colors.textPrimary,
|
|
8410
8677
|
margin: "8px 0"
|
|
8411
8678
|
};
|
|
8412
|
-
var
|
|
8679
|
+
var ghostBtn9 = {
|
|
8413
8680
|
padding: "6px 12px",
|
|
8414
8681
|
background: "white",
|
|
8415
8682
|
border: `1px solid ${colors.border}`,
|
|
@@ -8417,18 +8684,18 @@ var ghostBtn8 = {
|
|
|
8417
8684
|
fontSize: 13,
|
|
8418
8685
|
cursor: "pointer"
|
|
8419
8686
|
};
|
|
8420
|
-
var
|
|
8421
|
-
...
|
|
8687
|
+
var primaryBtn6 = {
|
|
8688
|
+
...ghostBtn9,
|
|
8422
8689
|
background: colors.primary,
|
|
8423
8690
|
color: "white",
|
|
8424
8691
|
borderColor: colors.primary
|
|
8425
8692
|
};
|
|
8426
8693
|
|
|
8427
8694
|
// src/save/ConflictBanner.tsx
|
|
8428
|
-
import { jsx as
|
|
8695
|
+
import { jsx as jsx28, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
8429
8696
|
function ConflictBanner({ onReload, onForceOverwrite }) {
|
|
8430
8697
|
const messages = useMessages();
|
|
8431
|
-
return /* @__PURE__ */
|
|
8698
|
+
return /* @__PURE__ */ jsxs26(
|
|
8432
8699
|
"div",
|
|
8433
8700
|
{
|
|
8434
8701
|
style: {
|
|
@@ -8444,8 +8711,8 @@ function ConflictBanner({ onReload, onForceOverwrite }) {
|
|
|
8444
8711
|
role: "alert",
|
|
8445
8712
|
"data-testid": "conflict-banner",
|
|
8446
8713
|
children: [
|
|
8447
|
-
/* @__PURE__ */
|
|
8448
|
-
/* @__PURE__ */
|
|
8714
|
+
/* @__PURE__ */ jsx28("span", { style: { flex: 1 }, children: messages.conflict.message }),
|
|
8715
|
+
/* @__PURE__ */ jsx28(
|
|
8449
8716
|
"button",
|
|
8450
8717
|
{
|
|
8451
8718
|
type: "button",
|
|
@@ -8455,7 +8722,7 @@ function ConflictBanner({ onReload, onForceOverwrite }) {
|
|
|
8455
8722
|
children: messages.conflict.reload
|
|
8456
8723
|
}
|
|
8457
8724
|
),
|
|
8458
|
-
/* @__PURE__ */
|
|
8725
|
+
/* @__PURE__ */ jsx28(
|
|
8459
8726
|
"button",
|
|
8460
8727
|
{
|
|
8461
8728
|
type: "button",
|