@waypointjs/builder 0.1.2 → 0.1.4
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 +189 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +189 -55
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/dist/index.cjs
CHANGED
|
@@ -5,6 +5,7 @@ var react = require('react');
|
|
|
5
5
|
var zustand = require('zustand');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var react$1 = require('@waypointjs/react');
|
|
8
|
+
var devtools = require('@waypointjs/devtools');
|
|
8
9
|
|
|
9
10
|
// src/components/WaypointBuilder.tsx
|
|
10
11
|
|
|
@@ -346,9 +347,19 @@ var useBuilderStore = zustand.create((set, _get) => ({
|
|
|
346
347
|
isDirty: true
|
|
347
348
|
}))
|
|
348
349
|
}));
|
|
349
|
-
var BLANK_FORM = {
|
|
350
|
+
var BLANK_FORM = {
|
|
351
|
+
id: "",
|
|
352
|
+
label: "",
|
|
353
|
+
type: "string",
|
|
354
|
+
blocking: false
|
|
355
|
+
};
|
|
350
356
|
function ExternalVariablePanel() {
|
|
351
|
-
const {
|
|
357
|
+
const {
|
|
358
|
+
schema,
|
|
359
|
+
addExternalVariable,
|
|
360
|
+
updateExternalVariable,
|
|
361
|
+
removeExternalVariable
|
|
362
|
+
} = useBuilderStore();
|
|
352
363
|
const variables = schema.externalVariables ?? [];
|
|
353
364
|
const [isAdding, setIsAdding] = react.useState(false);
|
|
354
365
|
const [editingId, setEditingId] = react.useState(null);
|
|
@@ -374,9 +385,11 @@ function ExternalVariablePanel() {
|
|
|
374
385
|
}
|
|
375
386
|
function validateForm() {
|
|
376
387
|
if (!form.id.trim()) return "ID is required";
|
|
377
|
-
if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(form.id.trim()))
|
|
388
|
+
if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(form.id.trim()))
|
|
389
|
+
return "ID must be alphanumeric (no spaces)";
|
|
378
390
|
if (!form.label.trim()) return "Label is required";
|
|
379
|
-
if (isAdding && variables.some((v) => v.id === form.id.trim()))
|
|
391
|
+
if (isAdding && variables.some((v) => v.id === form.id.trim()))
|
|
392
|
+
return `ID "${form.id}" already exists`;
|
|
380
393
|
return null;
|
|
381
394
|
}
|
|
382
395
|
function submitAdd() {
|
|
@@ -385,7 +398,12 @@ function ExternalVariablePanel() {
|
|
|
385
398
|
setError(err);
|
|
386
399
|
return;
|
|
387
400
|
}
|
|
388
|
-
addExternalVariable({
|
|
401
|
+
addExternalVariable({
|
|
402
|
+
id: form.id.trim(),
|
|
403
|
+
label: form.label.trim(),
|
|
404
|
+
type: form.type,
|
|
405
|
+
blocking: form.blocking
|
|
406
|
+
});
|
|
389
407
|
setIsAdding(false);
|
|
390
408
|
setForm(BLANK_FORM);
|
|
391
409
|
setError(null);
|
|
@@ -397,7 +415,11 @@ function ExternalVariablePanel() {
|
|
|
397
415
|
return;
|
|
398
416
|
}
|
|
399
417
|
if (!editingId) return;
|
|
400
|
-
updateExternalVariable(editingId, {
|
|
418
|
+
updateExternalVariable(editingId, {
|
|
419
|
+
label: form.label.trim(),
|
|
420
|
+
type: form.type,
|
|
421
|
+
blocking: form.blocking
|
|
422
|
+
});
|
|
401
423
|
setEditingId(null);
|
|
402
424
|
setError(null);
|
|
403
425
|
}
|
|
@@ -411,7 +433,15 @@ function ExternalVariablePanel() {
|
|
|
411
433
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: panelStyle, children: [
|
|
412
434
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: headerStyle, children: [
|
|
413
435
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: titleStyle, children: "External Variables" }),
|
|
414
|
-
!isAdding && /* @__PURE__ */ jsxRuntime.jsx(
|
|
436
|
+
!isAdding && /* @__PURE__ */ jsxRuntime.jsx(
|
|
437
|
+
"button",
|
|
438
|
+
{
|
|
439
|
+
style: addBtnStyle,
|
|
440
|
+
onClick: startAdd,
|
|
441
|
+
title: "Add external variable",
|
|
442
|
+
children: "+ Add"
|
|
443
|
+
}
|
|
444
|
+
)
|
|
415
445
|
] }),
|
|
416
446
|
variables.length === 0 && !isAdding && /* @__PURE__ */ jsxRuntime.jsxs("p", { style: emptyStyle, children: [
|
|
417
447
|
"No external variables declared.",
|
|
@@ -425,37 +455,55 @@ function ExternalVariablePanel() {
|
|
|
425
455
|
variables.map((v) => {
|
|
426
456
|
const refs = usageMap.get(v.id) ?? [];
|
|
427
457
|
const isBeingEdited = editingId === v.id;
|
|
428
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
429
|
-
|
|
458
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
459
|
+
"div",
|
|
430
460
|
{
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
"
|
|
444
|
-
|
|
461
|
+
style: {
|
|
462
|
+
...varRowStyle,
|
|
463
|
+
...isBeingEdited ? varRowActiveStyle : {}
|
|
464
|
+
},
|
|
465
|
+
children: isBeingEdited ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
466
|
+
VarForm,
|
|
467
|
+
{
|
|
468
|
+
form,
|
|
469
|
+
onChange: setForm,
|
|
470
|
+
error,
|
|
471
|
+
onSubmit: submitEdit,
|
|
472
|
+
onCancel: cancelForm,
|
|
473
|
+
submitLabel: "Save",
|
|
474
|
+
idReadOnly: true
|
|
475
|
+
}
|
|
476
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
477
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: varMainStyle, children: [
|
|
478
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: varTopRowStyle, children: [
|
|
479
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: varIdStyle, children: [
|
|
480
|
+
"$",
|
|
481
|
+
`ext.${v.id}`
|
|
482
|
+
] }),
|
|
483
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: badgeRowStyle, children: [
|
|
484
|
+
/* @__PURE__ */ jsxRuntime.jsx(TypeBadge, { type: v.type }),
|
|
485
|
+
v.blocking && /* @__PURE__ */ jsxRuntime.jsx("span", { style: blockingBadgeStyle, children: "blocking" })
|
|
486
|
+
] })
|
|
487
|
+
] }),
|
|
488
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: varLabelStyle, children: v.label }),
|
|
489
|
+
refs.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { style: refsStyle, children: refs.map((ref, i) => /* @__PURE__ */ jsxRuntime.jsx("span", { style: refChipStyle, children: ref }, i)) })
|
|
445
490
|
] }),
|
|
446
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style:
|
|
447
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
448
|
-
|
|
491
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: varActionsStyle, children: [
|
|
492
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { style: actionBtnStyle, onClick: () => startEdit(v), children: "Edit" }),
|
|
493
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
494
|
+
"button",
|
|
495
|
+
{
|
|
496
|
+
style: { ...actionBtnStyle, color: "#ef4444" },
|
|
497
|
+
title: "Remove variable",
|
|
498
|
+
onClick: () => remove(v.id),
|
|
499
|
+
children: "\u2715"
|
|
500
|
+
}
|
|
501
|
+
)
|
|
449
502
|
] })
|
|
450
|
-
] })
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: varActionsStyle, children: [
|
|
455
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { style: actionBtnStyle, onClick: () => startEdit(v), children: "Edit" }),
|
|
456
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { style: { ...actionBtnStyle, color: "#ef4444" }, title: "Remove variable", onClick: () => remove(v.id), children: "\u2715" })
|
|
457
|
-
] })
|
|
458
|
-
] }) }, v.id);
|
|
503
|
+
] })
|
|
504
|
+
},
|
|
505
|
+
v.id
|
|
506
|
+
);
|
|
459
507
|
}),
|
|
460
508
|
isAdding && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { ...varRowStyle, ...varRowActiveStyle }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
461
509
|
VarForm,
|
|
@@ -470,7 +518,15 @@ function ExternalVariablePanel() {
|
|
|
470
518
|
) })
|
|
471
519
|
] });
|
|
472
520
|
}
|
|
473
|
-
function VarForm({
|
|
521
|
+
function VarForm({
|
|
522
|
+
form,
|
|
523
|
+
onChange,
|
|
524
|
+
error,
|
|
525
|
+
onSubmit,
|
|
526
|
+
onCancel,
|
|
527
|
+
submitLabel,
|
|
528
|
+
idReadOnly
|
|
529
|
+
}) {
|
|
474
530
|
function set(key, value) {
|
|
475
531
|
onChange({ ...form, [key]: value });
|
|
476
532
|
}
|
|
@@ -479,7 +535,10 @@ function VarForm({ form, onChange, error, onSubmit, onCancel, submitLabel, idRea
|
|
|
479
535
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
480
536
|
"input",
|
|
481
537
|
{
|
|
482
|
-
style: {
|
|
538
|
+
style: {
|
|
539
|
+
...inputStyle,
|
|
540
|
+
...idReadOnly ? { background: "#f9fafb", color: "#6b7280" } : {}
|
|
541
|
+
},
|
|
483
542
|
value: form.id,
|
|
484
543
|
onChange: (e) => set("id", e.target.value),
|
|
485
544
|
placeholder: "e.g. userId",
|
|
@@ -497,12 +556,20 @@ function VarForm({ form, onChange, error, onSubmit, onCancel, submitLabel, idRea
|
|
|
497
556
|
}
|
|
498
557
|
),
|
|
499
558
|
/* @__PURE__ */ jsxRuntime.jsx("label", { style: formLabelStyle, children: "Type" }),
|
|
500
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
559
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
560
|
+
"select",
|
|
561
|
+
{
|
|
562
|
+
style: selectStyle,
|
|
563
|
+
value: form.type,
|
|
564
|
+
onChange: (e) => set("type", e.target.value),
|
|
565
|
+
children: [
|
|
566
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "string", children: "string" }),
|
|
567
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "number", children: "number" }),
|
|
568
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "boolean", children: "boolean" }),
|
|
569
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "object", children: "object" })
|
|
570
|
+
]
|
|
571
|
+
}
|
|
572
|
+
),
|
|
506
573
|
/* @__PURE__ */ jsxRuntime.jsxs("label", { style: checkboxRowStyle, children: [
|
|
507
574
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
508
575
|
"input",
|
|
@@ -596,7 +663,8 @@ var emptyStyle = {
|
|
|
596
663
|
};
|
|
597
664
|
var codeStyle = {
|
|
598
665
|
fontFamily: "monospace",
|
|
599
|
-
background: "#
|
|
666
|
+
background: "#f97316",
|
|
667
|
+
color: "#070714",
|
|
600
668
|
borderRadius: 3,
|
|
601
669
|
padding: "1px 3px"
|
|
602
670
|
};
|
|
@@ -2027,6 +2095,7 @@ function PreviewPanel({ store, schema }) {
|
|
|
2027
2095
|
] });
|
|
2028
2096
|
}
|
|
2029
2097
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: styles6.panel, children: [
|
|
2098
|
+
/* @__PURE__ */ jsxRuntime.jsx(devtools.DevPanel, { store }),
|
|
2030
2099
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: styles6.leftCol, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2031
2100
|
StepList,
|
|
2032
2101
|
{
|
|
@@ -2843,7 +2912,7 @@ var styles8 = {
|
|
|
2843
2912
|
borderRadius: 4
|
|
2844
2913
|
}
|
|
2845
2914
|
};
|
|
2846
|
-
function Toolbar({ onSave, previewMode, onTest }) {
|
|
2915
|
+
function Toolbar({ onSave, previewMode, onTest, isMobile }) {
|
|
2847
2916
|
const { schema, isDirty, resetSchema } = useBuilderStore();
|
|
2848
2917
|
const handleExport = () => {
|
|
2849
2918
|
const json = JSON.stringify(schema, null, 2);
|
|
@@ -2901,12 +2970,15 @@ ${result.errors.map((e2) => `\u2022 ${e2}`).join("\n")}`);
|
|
|
2901
2970
|
}
|
|
2902
2971
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: styles9.toolbar, children: [
|
|
2903
2972
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: styles9.left, children: [
|
|
2904
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: styles9.logo, children: "\u25C8 waypoint" }),
|
|
2905
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: styles9.separator, children: "/" }),
|
|
2973
|
+
!isMobile && /* @__PURE__ */ jsxRuntime.jsx("span", { style: styles9.logo, children: "\u25C8 waypoint" }),
|
|
2974
|
+
!isMobile && /* @__PURE__ */ jsxRuntime.jsx("span", { style: styles9.separator, children: "/" }),
|
|
2906
2975
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2907
2976
|
"input",
|
|
2908
2977
|
{
|
|
2909
|
-
style:
|
|
2978
|
+
style: {
|
|
2979
|
+
...styles9.journeyName,
|
|
2980
|
+
...isMobile ? { maxWidth: 120, fontSize: 12 } : {}
|
|
2981
|
+
},
|
|
2910
2982
|
value: schema.name,
|
|
2911
2983
|
placeholder: "Journey name",
|
|
2912
2984
|
onChange: (e) => useBuilderStore.setState((s) => ({
|
|
@@ -2918,25 +2990,27 @@ ${result.errors.map((e2) => `\u2022 ${e2}`).join("\n")}`);
|
|
|
2918
2990
|
isDirty && /* @__PURE__ */ jsxRuntime.jsx("span", { style: styles9.dirtyDot, title: "Unsaved changes" })
|
|
2919
2991
|
] }),
|
|
2920
2992
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: styles9.right, children: [
|
|
2921
|
-
onTest && /* @__PURE__ */ jsxRuntime.jsx("button", { style: { ...styles9.btn, ...styles9.testBtn }, onClick: onTest, children: "\u25B6 Tester" }),
|
|
2922
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { style: styles9.btn, onClick: handleImport, children: "Import" }),
|
|
2923
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { style: styles9.btn, onClick: handleExport, children: "Export JSON" }),
|
|
2993
|
+
onTest && /* @__PURE__ */ jsxRuntime.jsx("button", { style: { ...styles9.btn, ...styles9.testBtn }, onClick: onTest, title: "Tester", children: isMobile ? "\u25B6" : "\u25B6 Tester" }),
|
|
2994
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { style: styles9.btn, onClick: handleImport, title: "Import", children: isMobile ? "\u2193" : "Import" }),
|
|
2995
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { style: styles9.btn, onClick: handleExport, title: "Export JSON", children: isMobile ? "\u2191" : "Export JSON" }),
|
|
2924
2996
|
onSave && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2925
2997
|
"button",
|
|
2926
2998
|
{
|
|
2927
2999
|
style: { ...styles9.btn, ...styles9.saveBtn },
|
|
2928
3000
|
onClick: () => onSave(schema),
|
|
2929
|
-
|
|
3001
|
+
title: "Save",
|
|
3002
|
+
children: isMobile ? "\u2713" : "Save"
|
|
2930
3003
|
}
|
|
2931
3004
|
),
|
|
2932
3005
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2933
3006
|
"button",
|
|
2934
3007
|
{
|
|
2935
3008
|
style: { ...styles9.btn, color: "var(--wp-danger)" },
|
|
3009
|
+
title: "Reset",
|
|
2936
3010
|
onClick: () => {
|
|
2937
3011
|
if (confirm("Reset the journey? All changes will be lost.")) resetSchema();
|
|
2938
3012
|
},
|
|
2939
|
-
children: "Reset"
|
|
3013
|
+
children: isMobile ? "\u27F3" : "Reset"
|
|
2940
3014
|
}
|
|
2941
3015
|
)
|
|
2942
3016
|
] })
|
|
@@ -2995,18 +3069,32 @@ function WaypointBuilder({
|
|
|
2995
3069
|
className,
|
|
2996
3070
|
style
|
|
2997
3071
|
}) {
|
|
2998
|
-
const { loadSchema, schema } = useBuilderStore();
|
|
3072
|
+
const { loadSchema, schema, selectedStepId, selectedFieldId } = useBuilderStore();
|
|
2999
3073
|
const [previewMode, setPreviewMode] = react.useState(false);
|
|
3074
|
+
const [isMobile, setIsMobile] = react.useState(false);
|
|
3075
|
+
const [activeTab, setActiveTab] = react.useState("steps");
|
|
3000
3076
|
const previewStoreRef = react.useRef(null);
|
|
3001
3077
|
if (previewStoreRef.current === null) {
|
|
3002
3078
|
previewStoreRef.current = core.createRuntimeStore();
|
|
3003
3079
|
}
|
|
3080
|
+
react.useEffect(() => {
|
|
3081
|
+
const check = () => setIsMobile(window.innerWidth < 640);
|
|
3082
|
+
check();
|
|
3083
|
+
window.addEventListener("resize", check);
|
|
3084
|
+
return () => window.removeEventListener("resize", check);
|
|
3085
|
+
}, []);
|
|
3004
3086
|
react.useEffect(() => {
|
|
3005
3087
|
if (defaultValue) loadSchema(defaultValue);
|
|
3006
3088
|
}, []);
|
|
3007
3089
|
react.useEffect(() => {
|
|
3008
3090
|
onChange?.(schema);
|
|
3009
3091
|
}, [schema, onChange]);
|
|
3092
|
+
react.useEffect(() => {
|
|
3093
|
+
if (isMobile && selectedStepId) setActiveTab("fields");
|
|
3094
|
+
}, [selectedStepId]);
|
|
3095
|
+
react.useEffect(() => {
|
|
3096
|
+
if (isMobile && selectedFieldId) setActiveTab("config");
|
|
3097
|
+
}, [selectedFieldId]);
|
|
3010
3098
|
function handleTest() {
|
|
3011
3099
|
previewStoreRef.current.getState().init(schema);
|
|
3012
3100
|
setPreviewMode(true);
|
|
@@ -3016,6 +3104,7 @@ function WaypointBuilder({
|
|
|
3016
3104
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3017
3105
|
Toolbar,
|
|
3018
3106
|
{
|
|
3107
|
+
isMobile,
|
|
3019
3108
|
onSave: !previewMode && onSave ? () => onSave(schema) : void 0,
|
|
3020
3109
|
previewMode,
|
|
3021
3110
|
onTest: previewMode ? () => setPreviewMode(false) : handleTest
|
|
@@ -3028,7 +3117,29 @@ function WaypointBuilder({
|
|
|
3028
3117
|
schema,
|
|
3029
3118
|
onEdit: () => setPreviewMode(false)
|
|
3030
3119
|
}
|
|
3031
|
-
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3120
|
+
) : isMobile ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3121
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { ...colStyle, display: activeTab === "steps" ? "flex" : "none" }, children: [
|
|
3122
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, overflow: "hidden", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ jsxRuntime.jsx(StepList2, {}) }),
|
|
3123
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { borderTop: "1px solid var(--wp-border)", flexShrink: 0, overflow: "auto", maxHeight: 200 }, children: /* @__PURE__ */ jsxRuntime.jsx(ExternalVariablePanel, {}) })
|
|
3124
|
+
] }),
|
|
3125
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { ...colStyle, display: activeTab === "fields" ? "flex" : "none" }, children: /* @__PURE__ */ jsxRuntime.jsx(FieldList, {}) }),
|
|
3126
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { ...colStyle, display: activeTab === "config" ? "flex" : "none" }, children: [
|
|
3127
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, borderBottom: "1px solid var(--wp-border)", overflow: "hidden" }, children: /* @__PURE__ */ jsxRuntime.jsx(StepEditor, {}) }),
|
|
3128
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, overflow: "hidden" }, children: /* @__PURE__ */ jsxRuntime.jsx(FieldEditor, {}) })
|
|
3129
|
+
] }),
|
|
3130
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: tabBarStyle, children: ["steps", "fields", "config"].map((tab) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3131
|
+
"button",
|
|
3132
|
+
{
|
|
3133
|
+
style: { ...tabBtnStyle, ...activeTab === tab ? tabBtnActiveStyle : {} },
|
|
3134
|
+
onClick: () => setActiveTab(tab),
|
|
3135
|
+
children: [
|
|
3136
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 14 }, children: tab === "steps" ? "\u26A1" : tab === "fields" ? "\u229E" : "\u2699" }),
|
|
3137
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 11, fontWeight: 600, textTransform: "capitalize" }, children: tab })
|
|
3138
|
+
]
|
|
3139
|
+
},
|
|
3140
|
+
tab
|
|
3141
|
+
)) })
|
|
3142
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { style: layoutStyle, children: [
|
|
3032
3143
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: colStyle, children: [
|
|
3033
3144
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, overflow: "hidden", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ jsxRuntime.jsx(StepList2, {}) }),
|
|
3034
3145
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { borderTop: "1px solid var(--wp-border)", flexShrink: 0, overflow: "auto", maxHeight: 280 }, children: /* @__PURE__ */ jsxRuntime.jsx(ExternalVariablePanel, {}) })
|
|
@@ -3070,6 +3181,29 @@ var dividerStyle = {
|
|
|
3070
3181
|
background: "var(--wp-border)",
|
|
3071
3182
|
flexShrink: 0
|
|
3072
3183
|
};
|
|
3184
|
+
var tabBarStyle = {
|
|
3185
|
+
display: "flex",
|
|
3186
|
+
borderTop: "1px solid var(--wp-border)",
|
|
3187
|
+
background: "var(--wp-toolbar-bg)",
|
|
3188
|
+
flexShrink: 0
|
|
3189
|
+
};
|
|
3190
|
+
var tabBtnStyle = {
|
|
3191
|
+
flex: 1,
|
|
3192
|
+
display: "flex",
|
|
3193
|
+
flexDirection: "column",
|
|
3194
|
+
alignItems: "center",
|
|
3195
|
+
justifyContent: "center",
|
|
3196
|
+
gap: 3,
|
|
3197
|
+
padding: "8px 4px",
|
|
3198
|
+
border: "none",
|
|
3199
|
+
background: "transparent",
|
|
3200
|
+
color: "var(--wp-text-subtle)",
|
|
3201
|
+
cursor: "pointer"
|
|
3202
|
+
};
|
|
3203
|
+
var tabBtnActiveStyle = {
|
|
3204
|
+
color: "var(--wp-primary)",
|
|
3205
|
+
borderTop: "2px solid var(--wp-primary)"
|
|
3206
|
+
};
|
|
3073
3207
|
|
|
3074
3208
|
exports.DARK_THEME = DARK_THEME;
|
|
3075
3209
|
exports.DEFAULT_THEME = DEFAULT_THEME;
|