@object-ui/plugin-designer 3.3.2 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +69 -0
- package/dist/index.js +401 -351
- package/dist/index.umd.cjs +2 -2
- package/dist/packages/plugin-designer/src/components/HistoryPanel.d.ts +42 -0
- package/dist/packages/plugin-designer/src/components/index.d.ts +2 -0
- package/dist/packages/plugin-designer/src/hooks/useUndoRedo.d.ts +38 -0
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -16,37 +16,87 @@ var tt = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null),
|
|
|
16
16
|
});
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region src/hooks/useUndoRedo.ts
|
|
19
|
-
function rt(e
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}, []), p = i((e) =>
|
|
33
|
-
|
|
34
|
-
|
|
19
|
+
function rt(e) {
|
|
20
|
+
return e || (typeof window < "u" && window.sessionStorage ? window.sessionStorage : null);
|
|
21
|
+
}
|
|
22
|
+
function it(e, t = {}) {
|
|
23
|
+
let { maxHistory: n = 50, persistKey: r, storage: a } = t, s = rt(a), u = (() => {
|
|
24
|
+
if (!r || !s) return null;
|
|
25
|
+
try {
|
|
26
|
+
let e = s.getItem(r);
|
|
27
|
+
if (!e) return null;
|
|
28
|
+
let t = JSON.parse(e);
|
|
29
|
+
if (t && t.v === 1 && Array.isArray(t.past) && Array.isArray(t.future)) return t;
|
|
30
|
+
} catch {}
|
|
31
|
+
return null;
|
|
32
|
+
})(), [d, f] = l(u?.current ?? e), p = c(u?.past ?? []), m = c(u?.future ?? []), [, h] = l(0), g = i(() => h((e) => e + 1), []);
|
|
33
|
+
o(() => {
|
|
34
|
+
if (!(!r || !s)) try {
|
|
35
|
+
let e = {
|
|
36
|
+
v: 1,
|
|
37
|
+
past: p.current,
|
|
38
|
+
current: d,
|
|
39
|
+
future: m.current
|
|
40
|
+
};
|
|
41
|
+
s.setItem(r, JSON.stringify(e));
|
|
42
|
+
} catch {}
|
|
43
|
+
}, [
|
|
44
|
+
d,
|
|
45
|
+
r,
|
|
46
|
+
s
|
|
47
|
+
]);
|
|
48
|
+
let _ = i((e) => {
|
|
49
|
+
f((t) => (p.current = [...p.current.slice(-(n - 1)), t], m.current = [], e)), g();
|
|
50
|
+
}, [n, g]), v = i(() => {
|
|
51
|
+
p.current.length !== 0 && (f((e) => {
|
|
52
|
+
let t = [...p.current], n = t.pop();
|
|
53
|
+
return p.current = t, m.current = [e, ...m.current], n;
|
|
54
|
+
}), g());
|
|
55
|
+
}, [g]), y = i(() => {
|
|
56
|
+
m.current.length !== 0 && (f((e) => {
|
|
57
|
+
let t = [...m.current], n = t.shift();
|
|
58
|
+
return m.current = t, p.current = [...p.current, e], n;
|
|
59
|
+
}), g());
|
|
60
|
+
}, [g]), b = i((e) => {
|
|
61
|
+
p.current = [], m.current = [], f(e), g();
|
|
62
|
+
}, [g]), x = i(() => {
|
|
63
|
+
if (!(!r || !s)) try {
|
|
64
|
+
s.removeItem(r);
|
|
65
|
+
} catch {}
|
|
66
|
+
}, [r, s]), S = i((e) => {
|
|
67
|
+
let t = p.current.length + 1 + m.current.length;
|
|
68
|
+
e < 0 || e >= t || e !== p.current.length && (f((t) => {
|
|
69
|
+
let n = [
|
|
70
|
+
...p.current,
|
|
71
|
+
t,
|
|
72
|
+
...m.current
|
|
73
|
+
], r = n[e];
|
|
74
|
+
return p.current = n.slice(0, e), m.current = n.slice(e + 1), r;
|
|
75
|
+
}), g());
|
|
76
|
+
}, [g]);
|
|
35
77
|
return {
|
|
36
|
-
current:
|
|
37
|
-
canUndo:
|
|
38
|
-
canRedo:
|
|
39
|
-
undoCount:
|
|
40
|
-
redoCount:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
78
|
+
current: d,
|
|
79
|
+
canUndo: p.current.length > 0,
|
|
80
|
+
canRedo: m.current.length > 0,
|
|
81
|
+
undoCount: p.current.length,
|
|
82
|
+
redoCount: m.current.length,
|
|
83
|
+
timeline: [
|
|
84
|
+
...p.current,
|
|
85
|
+
d,
|
|
86
|
+
...m.current
|
|
87
|
+
],
|
|
88
|
+
currentIndex: p.current.length,
|
|
89
|
+
push: _,
|
|
90
|
+
undo: v,
|
|
91
|
+
redo: y,
|
|
92
|
+
reset: b,
|
|
93
|
+
jumpTo: S,
|
|
94
|
+
clearPersisted: x
|
|
45
95
|
};
|
|
46
96
|
}
|
|
47
97
|
//#endregion
|
|
48
98
|
//#region src/hooks/useConfirmDialog.ts
|
|
49
|
-
function
|
|
99
|
+
function at() {
|
|
50
100
|
let [e, t] = l(!1), [n, r] = l(""), [a, o] = l(""), s = c(null);
|
|
51
101
|
return {
|
|
52
102
|
isOpen: e,
|
|
@@ -65,7 +115,7 @@ function it() {
|
|
|
65
115
|
}
|
|
66
116
|
//#endregion
|
|
67
117
|
//#region src/hooks/useMultiSelect.ts
|
|
68
|
-
function
|
|
118
|
+
function ot() {
|
|
69
119
|
let [e, t] = l(/* @__PURE__ */ new Set());
|
|
70
120
|
return {
|
|
71
121
|
selectedIds: e,
|
|
@@ -90,7 +140,7 @@ function at() {
|
|
|
90
140
|
}
|
|
91
141
|
//#endregion
|
|
92
142
|
//#region src/hooks/useClipboard.ts
|
|
93
|
-
function
|
|
143
|
+
function st() {
|
|
94
144
|
let [e, t] = l(null);
|
|
95
145
|
return {
|
|
96
146
|
clipboard: e,
|
|
@@ -103,7 +153,7 @@ function ot() {
|
|
|
103
153
|
}
|
|
104
154
|
//#endregion
|
|
105
155
|
//#region src/hooks/useCanvasPanZoom.ts
|
|
106
|
-
function
|
|
156
|
+
function ct(e = {}) {
|
|
107
157
|
let { minZoom: t = .25, maxZoom: n = 3, zoomStep: r = .1, initialZoom: a = 1 } = e, [o, s] = l(a), [u, d] = l({
|
|
108
158
|
x: 0,
|
|
109
159
|
y: 0
|
|
@@ -160,7 +210,7 @@ function st(e = {}) {
|
|
|
160
210
|
}
|
|
161
211
|
//#endregion
|
|
162
212
|
//#region ../../node_modules/.pnpm/react@19.2.5/node_modules/react/cjs/react-jsx-runtime.production.js
|
|
163
|
-
var
|
|
213
|
+
var lt = /* @__PURE__ */ tt(((e) => {
|
|
164
214
|
var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
165
215
|
function r(e, n, r) {
|
|
166
216
|
var i = null;
|
|
@@ -175,7 +225,7 @@ var ct = /* @__PURE__ */ tt(((e) => {
|
|
|
175
225
|
};
|
|
176
226
|
}
|
|
177
227
|
e.Fragment = n, e.jsx = r, e.jsxs = r;
|
|
178
|
-
})),
|
|
228
|
+
})), ut = /* @__PURE__ */ tt(((e) => {
|
|
179
229
|
process.env.NODE_ENV !== "production" && (function() {
|
|
180
230
|
function t(e) {
|
|
181
231
|
if (e == null) return null;
|
|
@@ -334,12 +384,12 @@ var ct = /* @__PURE__ */ tt(((e) => {
|
|
|
334
384
|
};
|
|
335
385
|
})();
|
|
336
386
|
})), Y = (/* @__PURE__ */ tt(((e, t) => {
|
|
337
|
-
process.env.NODE_ENV === "production" ? t.exports =
|
|
387
|
+
process.env.NODE_ENV === "production" ? t.exports = lt() : t.exports = ut();
|
|
338
388
|
})))();
|
|
339
|
-
function
|
|
389
|
+
function dt(...e) {
|
|
340
390
|
return q(K(e));
|
|
341
391
|
}
|
|
342
|
-
function
|
|
392
|
+
function ft({ isOpen: e, title: t, message: n, confirmLabel: r = "Delete", cancelLabel: i = "Cancel", destructive: a = !0, onConfirm: s, onCancel: l }) {
|
|
343
393
|
let d = c(null);
|
|
344
394
|
return o(() => {
|
|
345
395
|
let t = d.current;
|
|
@@ -377,7 +427,7 @@ function dt({ isOpen: e, title: t, message: n, confirmLabel: r = "Delete", cance
|
|
|
377
427
|
children: i
|
|
378
428
|
}), /* @__PURE__ */ (0, Y.jsx)("button", {
|
|
379
429
|
onClick: s,
|
|
380
|
-
className:
|
|
430
|
+
className: dt("px-4 py-2 text-sm rounded-md font-medium", a ? "bg-destructive text-destructive-foreground hover:bg-destructive/90" : "bg-primary text-primary-foreground hover:bg-primary/90"),
|
|
381
431
|
autoFocus: !0,
|
|
382
432
|
children: r
|
|
383
433
|
})]
|
|
@@ -388,10 +438,10 @@ function dt({ isOpen: e, title: t, message: n, confirmLabel: r = "Delete", cance
|
|
|
388
438
|
}
|
|
389
439
|
//#endregion
|
|
390
440
|
//#region src/components/PropertyEditor.tsx
|
|
391
|
-
function
|
|
441
|
+
function pt(...e) {
|
|
392
442
|
return q(K(e));
|
|
393
443
|
}
|
|
394
|
-
function
|
|
444
|
+
function mt({ title: e = "Properties", fields: t, onChange: n, className: r }) {
|
|
395
445
|
let [a, o] = l(/* @__PURE__ */ new Set()), s = i((e) => {
|
|
396
446
|
o((t) => {
|
|
397
447
|
let n = new Set(t);
|
|
@@ -402,7 +452,7 @@ function pt({ title: e = "Properties", fields: t, onChange: n, className: r }) {
|
|
|
402
452
|
return e[n] || (e[n] = []), e[n].push(t), e;
|
|
403
453
|
}, {});
|
|
404
454
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
405
|
-
className:
|
|
455
|
+
className: pt("flex flex-col", r),
|
|
406
456
|
role: "region",
|
|
407
457
|
"aria-label": e,
|
|
408
458
|
children: [/* @__PURE__ */ (0, Y.jsx)("div", {
|
|
@@ -418,7 +468,7 @@ function pt({ title: e = "Properties", fields: t, onChange: n, className: r }) {
|
|
|
418
468
|
children: [a.has(e) ? /* @__PURE__ */ (0, Y.jsx)(y, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, Y.jsx)(_, { className: "h-3 w-3" }), e]
|
|
419
469
|
}), !a.has(e) && /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
420
470
|
className: "px-3 pb-2 space-y-2",
|
|
421
|
-
children: t.map((e) => /* @__PURE__ */ (0, Y.jsx)(
|
|
471
|
+
children: t.map((e) => /* @__PURE__ */ (0, Y.jsx)(ht, {
|
|
422
472
|
field: e,
|
|
423
473
|
onChange: n
|
|
424
474
|
}, e.name))
|
|
@@ -430,7 +480,7 @@ function pt({ title: e = "Properties", fields: t, onChange: n, className: r }) {
|
|
|
430
480
|
})]
|
|
431
481
|
});
|
|
432
482
|
}
|
|
433
|
-
function
|
|
483
|
+
function ht({ field: e, onChange: t }) {
|
|
434
484
|
let n = (n) => {
|
|
435
485
|
t(e.name, n);
|
|
436
486
|
};
|
|
@@ -501,13 +551,13 @@ function mt({ field: e, onChange: t }) {
|
|
|
501
551
|
}
|
|
502
552
|
//#endregion
|
|
503
553
|
//#region src/components/Minimap.tsx
|
|
504
|
-
function
|
|
554
|
+
function gt(...e) {
|
|
505
555
|
return q(K(e));
|
|
506
556
|
}
|
|
507
|
-
function
|
|
557
|
+
function _t({ items: e, canvasWidth: t, canvasHeight: n, position: r = "bottom-right", size: i = 150, className: a }) {
|
|
508
558
|
let o = Math.min(i / t, i / n), s = t * o, c = n * o;
|
|
509
559
|
return /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
510
|
-
className:
|
|
560
|
+
className: gt("absolute border rounded bg-background/90 shadow-sm overflow-hidden", {
|
|
511
561
|
"top-left": "top-2 left-2",
|
|
512
562
|
"top-right": "top-2 right-2",
|
|
513
563
|
"bottom-left": "bottom-2 left-2",
|
|
@@ -537,12 +587,12 @@ function gt({ items: e, canvasWidth: t, canvasHeight: n, position: r = "bottom-r
|
|
|
537
587
|
}
|
|
538
588
|
//#endregion
|
|
539
589
|
//#region src/CollaborationProvider.tsx
|
|
540
|
-
function
|
|
590
|
+
function vt(...e) {
|
|
541
591
|
return q(K(e));
|
|
542
592
|
}
|
|
543
|
-
var
|
|
544
|
-
|
|
545
|
-
function
|
|
593
|
+
var yt = r(null);
|
|
594
|
+
yt.displayName = "CollaborationContext";
|
|
595
|
+
function bt({ config: e, user: t, onOperation: n, onPresenceChange: r, children: a }) {
|
|
546
596
|
let u = c(null), [d, f] = l([]), [p, m] = l("disconnected"), h = c(0), g = c(null);
|
|
547
597
|
o(() => {
|
|
548
598
|
if (!e.enabled || !t || !e.serverUrl || !(typeof WebSocket < "u")) return;
|
|
@@ -592,7 +642,7 @@ function yt({ config: e, user: t, onOperation: n, onPresenceChange: r, children:
|
|
|
592
642
|
userId: t.id,
|
|
593
643
|
userName: t.name,
|
|
594
644
|
avatar: t.avatar,
|
|
595
|
-
color:
|
|
645
|
+
color: Ct(t.id),
|
|
596
646
|
status: "active",
|
|
597
647
|
lastActivity: (/* @__PURE__ */ new Date()).toISOString()
|
|
598
648
|
}, ...d], [
|
|
@@ -631,16 +681,16 @@ function yt({ config: e, user: t, onOperation: n, onPresenceChange: r, children:
|
|
|
631
681
|
t?.id,
|
|
632
682
|
p
|
|
633
683
|
]);
|
|
634
|
-
return /* @__PURE__ */ (0, Y.jsx)(
|
|
684
|
+
return /* @__PURE__ */ (0, Y.jsx)(yt.Provider, {
|
|
635
685
|
value: b,
|
|
636
686
|
children: a
|
|
637
687
|
});
|
|
638
688
|
}
|
|
639
|
-
function
|
|
640
|
-
return a(
|
|
689
|
+
function xt() {
|
|
690
|
+
return a(yt);
|
|
641
691
|
}
|
|
642
|
-
function
|
|
643
|
-
let t = a(
|
|
692
|
+
function St({ className: e }) {
|
|
693
|
+
let t = a(yt);
|
|
644
694
|
if (!t) return null;
|
|
645
695
|
let { connectionState: n, users: r } = t, i = {
|
|
646
696
|
connected: {
|
|
@@ -661,7 +711,7 @@ function xt({ className: e }) {
|
|
|
661
711
|
}
|
|
662
712
|
}, { color: o, label: s } = i[n] ?? i.disconnected;
|
|
663
713
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
664
|
-
className:
|
|
714
|
+
className: vt("flex items-center gap-2 text-xs", e),
|
|
665
715
|
role: "status",
|
|
666
716
|
"aria-live": "polite",
|
|
667
717
|
"aria-label": `Collaboration: ${s}`,
|
|
@@ -679,7 +729,7 @@ function xt({ className: e }) {
|
|
|
679
729
|
]
|
|
680
730
|
});
|
|
681
731
|
}
|
|
682
|
-
function
|
|
732
|
+
function Ct(e) {
|
|
683
733
|
let t = [
|
|
684
734
|
"#3b82f6",
|
|
685
735
|
"#ef4444",
|
|
@@ -706,19 +756,19 @@ function St(e) {
|
|
|
706
756
|
function X(...e) {
|
|
707
757
|
return q(K(e));
|
|
708
758
|
}
|
|
709
|
-
function
|
|
759
|
+
function wt({ canvas: e = {
|
|
710
760
|
width: 1200,
|
|
711
761
|
height: 800,
|
|
712
762
|
gridSize: 8,
|
|
713
763
|
showGrid: !0,
|
|
714
764
|
snapToGrid: !0
|
|
715
|
-
}, components: t = [], palette: n =
|
|
716
|
-
let h =
|
|
765
|
+
}, components: t = [], palette: n = Tt, showComponentTree: r = !0, undoRedo: a = !0, propertyEditor: u = !0, readOnly: d = !1, showMinimap: f = !1, onChange: p, className: m }) {
|
|
766
|
+
let h = it(t), g = h.current, _ = i((e) => {
|
|
717
767
|
h.push(e), p?.(e);
|
|
718
|
-
}, [h, p]), v =
|
|
768
|
+
}, [h, p]), v = ct({ initialZoom: e.zoom ?? 1 }), { zoom: y } = v, b = ot(), S = s(() => {
|
|
719
769
|
let e = Array.from(b.selectedIds);
|
|
720
770
|
return e.length > 0 ? e[0] : null;
|
|
721
|
-
}, [b.selectedIds]), C = s(() => g.find((e) => e.id === S), [g, S]), w =
|
|
771
|
+
}, [b.selectedIds]), C = s(() => g.find((e) => e.id === S), [g, S]), w = st(), E = at(), D = xt(), O = i((e) => {
|
|
722
772
|
D && D.sendOperation({
|
|
723
773
|
...e,
|
|
724
774
|
userId: D.currentUserId ?? ""
|
|
@@ -1174,7 +1224,7 @@ function Ct({ canvas: e = {
|
|
|
1174
1224
|
children: e.type
|
|
1175
1225
|
})]
|
|
1176
1226
|
}, e.id);
|
|
1177
|
-
}), P && /* @__PURE__ */ (0, Y.jsx)(
|
|
1227
|
+
}), P && /* @__PURE__ */ (0, Y.jsx)(_t, {
|
|
1178
1228
|
items: oe,
|
|
1179
1229
|
canvasWidth: e.width,
|
|
1180
1230
|
canvasHeight: e.height
|
|
@@ -1207,7 +1257,7 @@ function Ct({ canvas: e = {
|
|
|
1207
1257
|
}),
|
|
1208
1258
|
u && C ? /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
1209
1259
|
className: "border-t",
|
|
1210
|
-
children: /* @__PURE__ */ (0, Y.jsx)(
|
|
1260
|
+
children: /* @__PURE__ */ (0, Y.jsx)(mt, {
|
|
1211
1261
|
title: `Properties – ${C.label ?? C.type}`,
|
|
1212
1262
|
fields: ae,
|
|
1213
1263
|
onChange: ee
|
|
@@ -1241,7 +1291,7 @@ function Ct({ canvas: e = {
|
|
|
1241
1291
|
})
|
|
1242
1292
|
] })
|
|
1243
1293
|
}),
|
|
1244
|
-
/* @__PURE__ */ (0, Y.jsx)(
|
|
1294
|
+
/* @__PURE__ */ (0, Y.jsx)(ft, {
|
|
1245
1295
|
isOpen: E.isOpen,
|
|
1246
1296
|
title: E.title,
|
|
1247
1297
|
message: E.message,
|
|
@@ -1251,7 +1301,7 @@ function Ct({ canvas: e = {
|
|
|
1251
1301
|
]
|
|
1252
1302
|
});
|
|
1253
1303
|
}
|
|
1254
|
-
var
|
|
1304
|
+
var Tt = [
|
|
1255
1305
|
{
|
|
1256
1306
|
name: "layout",
|
|
1257
1307
|
label: "Layout",
|
|
@@ -1385,15 +1435,15 @@ var wt = [
|
|
|
1385
1435
|
];
|
|
1386
1436
|
//#endregion
|
|
1387
1437
|
//#region src/hooks/useDesignerHistory.ts
|
|
1388
|
-
function
|
|
1389
|
-
return
|
|
1438
|
+
function Et(e, t = {}) {
|
|
1439
|
+
return it(e, t);
|
|
1390
1440
|
}
|
|
1391
1441
|
//#endregion
|
|
1392
1442
|
//#region src/DataModelDesigner.tsx
|
|
1393
|
-
function
|
|
1443
|
+
function Dt(...e) {
|
|
1394
1444
|
return q(K(e));
|
|
1395
1445
|
}
|
|
1396
|
-
var
|
|
1446
|
+
var Ot = [
|
|
1397
1447
|
"text",
|
|
1398
1448
|
"number",
|
|
1399
1449
|
"boolean",
|
|
@@ -1417,7 +1467,7 @@ var Dt = [
|
|
|
1417
1467
|
"formula",
|
|
1418
1468
|
"autonumber"
|
|
1419
1469
|
];
|
|
1420
|
-
function
|
|
1470
|
+
function kt(e, t = 4, n = 280, r = 250, i = 50, a = 50) {
|
|
1421
1471
|
return e.map((e, o) => ({
|
|
1422
1472
|
...e,
|
|
1423
1473
|
position: {
|
|
@@ -1426,12 +1476,12 @@ function Ot(e, t = 4, n = 280, r = 250, i = 50, a = 50) {
|
|
|
1426
1476
|
}
|
|
1427
1477
|
}));
|
|
1428
1478
|
}
|
|
1429
|
-
function
|
|
1479
|
+
function At({ entities: e = [], relationships: t = [], canvas: n = {
|
|
1430
1480
|
width: 1200,
|
|
1431
1481
|
height: 800,
|
|
1432
1482
|
showGrid: !0
|
|
1433
1483
|
}, showRelationshipLabels: r = !0, readOnly: a = !1, onEntitiesChange: s, onRelationshipsChange: u, className: d }) {
|
|
1434
|
-
let f = c(null), p =
|
|
1484
|
+
let f = c(null), p = Et({
|
|
1435
1485
|
entities: e,
|
|
1436
1486
|
relationships: t
|
|
1437
1487
|
}, { maxHistory: 50 }), { entities: m, relationships: h } = p.current, g = i((e) => {
|
|
@@ -1440,11 +1490,11 @@ function kt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1440
1490
|
p,
|
|
1441
1491
|
s,
|
|
1442
1492
|
u
|
|
1443
|
-
]), v =
|
|
1493
|
+
]), v = at(), b = ot(), S = b.count > 0 ? Array.from(b.selectedIds)[0] : null, C = st(), w = ct({
|
|
1444
1494
|
minZoom: .25,
|
|
1445
1495
|
maxZoom: 3,
|
|
1446
1496
|
zoomStep: .1
|
|
1447
|
-
}), D =
|
|
1497
|
+
}), D = xt(), [O, k] = l(!0), [A, j] = l(!0), [M, N] = l(null), [P, F] = l(""), [I, L] = l(null), [z, B] = l(""), V = c(null), H = i(() => {
|
|
1448
1498
|
if (a) return;
|
|
1449
1499
|
let e = p.current, t = {
|
|
1450
1500
|
id: `entity-${Date.now()}`,
|
|
@@ -1532,7 +1582,7 @@ function kt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1532
1582
|
if (a) return;
|
|
1533
1583
|
let e = p.current;
|
|
1534
1584
|
g({
|
|
1535
|
-
entities:
|
|
1585
|
+
entities: kt(e.entities),
|
|
1536
1586
|
relationships: e.relationships
|
|
1537
1587
|
});
|
|
1538
1588
|
}, [
|
|
@@ -1798,7 +1848,7 @@ function kt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1798
1848
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
1799
1849
|
ref: f,
|
|
1800
1850
|
tabIndex: 0,
|
|
1801
|
-
className:
|
|
1851
|
+
className: Dt("flex h-full w-full border rounded-lg overflow-hidden bg-background", d),
|
|
1802
1852
|
children: [
|
|
1803
1853
|
/* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
1804
1854
|
className: "flex flex-col flex-1 min-w-0",
|
|
@@ -1962,7 +2012,7 @@ function kt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1962
2012
|
"aria-label": e.label,
|
|
1963
2013
|
draggable: !a,
|
|
1964
2014
|
onDragStart: (t) => fe(t, e.id),
|
|
1965
|
-
className:
|
|
2015
|
+
className: Dt("absolute rounded-lg border-2 bg-background shadow-sm w-60 select-none cursor-grab active:cursor-grabbing", b.isSelected(e.id) ? "border-primary ring-2 ring-primary/20" : "border-border hover:border-primary/50"),
|
|
1966
2016
|
style: {
|
|
1967
2017
|
left: e.position.x,
|
|
1968
2018
|
top: e.position.y
|
|
@@ -2022,7 +2072,7 @@ function kt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
2022
2072
|
autoFocus: !0,
|
|
2023
2073
|
onClick: (e) => e.stopPropagation()
|
|
2024
2074
|
}) : /* @__PURE__ */ (0, Y.jsxs)("span", {
|
|
2025
|
-
className:
|
|
2075
|
+
className: Dt("font-mono cursor-text", t.primaryKey && "font-bold text-primary"),
|
|
2026
2076
|
onClick: (r) => {
|
|
2027
2077
|
r.stopPropagation(), ie(e.id, n, t.name);
|
|
2028
2078
|
},
|
|
@@ -2043,7 +2093,7 @@ function kt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
2043
2093
|
onClick: (e) => e.stopPropagation(),
|
|
2044
2094
|
className: "text-xs text-muted-foreground ml-auto bg-transparent border-none focus:ring-1 focus:ring-primary rounded cursor-pointer p-0",
|
|
2045
2095
|
"data-testid": `field-type-${e.id}-${n}`,
|
|
2046
|
-
children:
|
|
2096
|
+
children: Ot.map((e) => /* @__PURE__ */ (0, Y.jsx)("option", {
|
|
2047
2097
|
value: e,
|
|
2048
2098
|
children: e
|
|
2049
2099
|
}, e))
|
|
@@ -2069,7 +2119,7 @@ function kt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
2069
2119
|
]
|
|
2070
2120
|
}, e.id))
|
|
2071
2121
|
]
|
|
2072
|
-
}), A && m.length > 0 && /* @__PURE__ */ (0, Y.jsx)(
|
|
2122
|
+
}), A && m.length > 0 && /* @__PURE__ */ (0, Y.jsx)(_t, {
|
|
2073
2123
|
items: _e,
|
|
2074
2124
|
canvasWidth: n.width,
|
|
2075
2125
|
canvasHeight: n.height,
|
|
@@ -2091,7 +2141,7 @@ function kt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
2091
2141
|
}), O && /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
2092
2142
|
id: "property-editor-panel",
|
|
2093
2143
|
className: "flex-1 overflow-y-auto",
|
|
2094
|
-
children: /* @__PURE__ */ (0, Y.jsx)(
|
|
2144
|
+
children: /* @__PURE__ */ (0, Y.jsx)(mt, {
|
|
2095
2145
|
title: G ? G.label : "Properties",
|
|
2096
2146
|
fields: he,
|
|
2097
2147
|
onChange: ge
|
|
@@ -2107,7 +2157,7 @@ function kt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
2107
2157
|
})
|
|
2108
2158
|
})]
|
|
2109
2159
|
}),
|
|
2110
|
-
/* @__PURE__ */ (0, Y.jsx)(
|
|
2160
|
+
/* @__PURE__ */ (0, Y.jsx)(ft, {
|
|
2111
2161
|
isOpen: v.isOpen,
|
|
2112
2162
|
title: v.title,
|
|
2113
2163
|
message: v.message,
|
|
@@ -2120,11 +2170,11 @@ function kt({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
2120
2170
|
}
|
|
2121
2171
|
//#endregion
|
|
2122
2172
|
//#region src/ProcessDesigner.tsx
|
|
2123
|
-
function
|
|
2173
|
+
function jt(...e) {
|
|
2124
2174
|
return q(K(e));
|
|
2125
2175
|
}
|
|
2126
|
-
var
|
|
2127
|
-
function
|
|
2176
|
+
var Mt = 120, Nt = 50;
|
|
2177
|
+
function Pt(e, t) {
|
|
2128
2178
|
if (e.length === 0) return e;
|
|
2129
2179
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
2130
2180
|
for (let t of e) n.set(t.id, 0), r.set(t.id, []);
|
|
@@ -2152,12 +2202,12 @@ function Nt(e, t) {
|
|
|
2152
2202
|
position: c.get(e.id) ?? e.position
|
|
2153
2203
|
}));
|
|
2154
2204
|
}
|
|
2155
|
-
function
|
|
2205
|
+
function Ft({ processName: e = "New Process", nodes: t = [], edges: n = [], lanes: r, canvas: a = {
|
|
2156
2206
|
width: 1400,
|
|
2157
2207
|
height: 800,
|
|
2158
2208
|
showGrid: !0
|
|
2159
2209
|
}, showMinimap: u = !0, showToolbar: d = !0, readOnly: f = !1, onNodesChange: p, onEdgesChange: m, className: h }) {
|
|
2160
|
-
let g =
|
|
2210
|
+
let g = it({
|
|
2161
2211
|
nodes: t,
|
|
2162
2212
|
edges: n
|
|
2163
2213
|
}, { maxHistory: 50 }), _ = g.current.nodes, v = g.current.edges, y = i((e, t) => {
|
|
@@ -2169,7 +2219,7 @@ function Pt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2169
2219
|
g,
|
|
2170
2220
|
p,
|
|
2171
2221
|
m
|
|
2172
|
-
]), b =
|
|
2222
|
+
]), b = at(), S = ot(), C = st(), w = ct({ initialZoom: 1 }), E = xt(), [O, k] = l(null), [A, j] = l(!1), [M, N] = l(null), [P, F] = l(null), [L, R] = l(!0), [z, B] = l(null), [V, H] = l({
|
|
2173
2223
|
x: 0,
|
|
2174
2224
|
y: 0
|
|
2175
2225
|
}), ee = c(null), U = c(p), te = c(m);
|
|
@@ -2287,7 +2337,7 @@ function Pt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2287
2337
|
y,
|
|
2288
2338
|
E
|
|
2289
2339
|
]), ue = i(() => {
|
|
2290
|
-
f || _.length === 0 || y(
|
|
2340
|
+
f || _.length === 0 || y(Pt(_, v), v);
|
|
2291
2341
|
}, [
|
|
2292
2342
|
_,
|
|
2293
2343
|
v,
|
|
@@ -2406,8 +2456,8 @@ function Pt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2406
2456
|
id: e.id,
|
|
2407
2457
|
x: e.position.x,
|
|
2408
2458
|
y: e.position.y,
|
|
2409
|
-
width:
|
|
2410
|
-
height:
|
|
2459
|
+
width: Mt,
|
|
2460
|
+
height: Nt,
|
|
2411
2461
|
selected: S.isSelected(e.id) || e.id === O
|
|
2412
2462
|
})), [
|
|
2413
2463
|
_,
|
|
@@ -2463,9 +2513,9 @@ function Pt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2463
2513
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
2464
2514
|
ref: ee,
|
|
2465
2515
|
tabIndex: 0,
|
|
2466
|
-
className:
|
|
2516
|
+
className: jt("flex flex-col h-full w-full border rounded-lg overflow-hidden bg-background", h),
|
|
2467
2517
|
children: [
|
|
2468
|
-
/* @__PURE__ */ (0, Y.jsx)(
|
|
2518
|
+
/* @__PURE__ */ (0, Y.jsx)(ft, {
|
|
2469
2519
|
isOpen: b.isOpen,
|
|
2470
2520
|
title: b.title,
|
|
2471
2521
|
message: b.message,
|
|
@@ -2535,7 +2585,7 @@ function Pt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2535
2585
|
/* @__PURE__ */ (0, Y.jsx)("div", { className: "w-px h-4 bg-border mx-1" }),
|
|
2536
2586
|
/* @__PURE__ */ (0, Y.jsxs)("button", {
|
|
2537
2587
|
onClick: ce,
|
|
2538
|
-
className:
|
|
2588
|
+
className: jt("flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent", A && "bg-primary text-primary-foreground"),
|
|
2539
2589
|
title: "Connect nodes",
|
|
2540
2590
|
"aria-label": "Connect nodes",
|
|
2541
2591
|
"aria-pressed": A,
|
|
@@ -2656,10 +2706,10 @@ function Pt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2656
2706
|
}) }), v.map((e) => {
|
|
2657
2707
|
let t = _.find((t) => t.id === e.source), n = _.find((t) => t.id === e.target);
|
|
2658
2708
|
if (!t || !n) return null;
|
|
2659
|
-
t.position.x +
|
|
2660
|
-
let r = t.position.y +
|
|
2661
|
-
n.position.x +
|
|
2662
|
-
let i = n.position.y +
|
|
2709
|
+
t.position.x + Mt / 2;
|
|
2710
|
+
let r = t.position.y + Nt / 2;
|
|
2711
|
+
n.position.x + Mt / 2;
|
|
2712
|
+
let i = n.position.y + Nt / 2, a = t.position.x + Mt, o = r, s = n.position.x, c = i;
|
|
2663
2713
|
return /* @__PURE__ */ (0, Y.jsxs)("g", { children: [/* @__PURE__ */ (0, Y.jsx)("path", {
|
|
2664
2714
|
d: `M ${a} ${o} Q ${(a + s) / 2} ${o}, ${(a + s) / 2} ${(o + c) / 2} T ${s} ${c}`,
|
|
2665
2715
|
fill: "none",
|
|
@@ -2698,9 +2748,9 @@ function Pt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2698
2748
|
},
|
|
2699
2749
|
children: [
|
|
2700
2750
|
/* @__PURE__ */ (0, Y.jsx)("div", {
|
|
2701
|
-
className:
|
|
2751
|
+
className: jt("flex items-center justify-center border-2 min-w-[120px] min-h-[50px] px-3 py-2 transition-shadow", ge(e.type), t && "ring-2 ring-primary shadow-md", n && "ring-2 ring-blue-400 shadow-lg", A && !n && "cursor-crosshair"),
|
|
2702
2752
|
children: /* @__PURE__ */ (0, Y.jsx)("span", {
|
|
2703
|
-
className:
|
|
2753
|
+
className: jt("text-xs font-medium", (e.type === "exclusive-gateway" || e.type === "parallel-gateway" || e.type === "inclusive-gateway" || e.type === "event-based-gateway") && "-rotate-45"),
|
|
2704
2754
|
children: e.label
|
|
2705
2755
|
})
|
|
2706
2756
|
}),
|
|
@@ -2709,7 +2759,7 @@ function Pt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2709
2759
|
className: "absolute w-3 h-3 rounded-full bg-blue-500 border-2 border-white shadow cursor-crosshair",
|
|
2710
2760
|
style: {
|
|
2711
2761
|
left: -6,
|
|
2712
|
-
top:
|
|
2762
|
+
top: Nt / 2 - 6
|
|
2713
2763
|
},
|
|
2714
2764
|
title: "Input port",
|
|
2715
2765
|
onClick: (t) => {
|
|
@@ -2720,7 +2770,7 @@ function Pt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2720
2770
|
className: "absolute w-3 h-3 rounded-full bg-blue-500 border-2 border-white shadow cursor-crosshair",
|
|
2721
2771
|
style: {
|
|
2722
2772
|
right: -6,
|
|
2723
|
-
top:
|
|
2773
|
+
top: Nt / 2 - 6
|
|
2724
2774
|
},
|
|
2725
2775
|
title: "Output port",
|
|
2726
2776
|
onClick: (t) => {
|
|
@@ -2730,7 +2780,7 @@ function Pt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2730
2780
|
/* @__PURE__ */ (0, Y.jsx)("div", {
|
|
2731
2781
|
className: "absolute w-3 h-3 rounded-full bg-blue-400 border-2 border-white shadow cursor-crosshair",
|
|
2732
2782
|
style: {
|
|
2733
|
-
left:
|
|
2783
|
+
left: Mt / 2 - 6,
|
|
2734
2784
|
top: -6
|
|
2735
2785
|
},
|
|
2736
2786
|
title: "Port",
|
|
@@ -2741,7 +2791,7 @@ function Pt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2741
2791
|
/* @__PURE__ */ (0, Y.jsx)("div", {
|
|
2742
2792
|
className: "absolute w-3 h-3 rounded-full bg-blue-400 border-2 border-white shadow cursor-crosshair",
|
|
2743
2793
|
style: {
|
|
2744
|
-
left:
|
|
2794
|
+
left: Mt / 2 - 6,
|
|
2745
2795
|
bottom: -6
|
|
2746
2796
|
},
|
|
2747
2797
|
title: "Port",
|
|
@@ -2761,7 +2811,7 @@ function Pt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2761
2811
|
]
|
|
2762
2812
|
}, e.id);
|
|
2763
2813
|
}),
|
|
2764
|
-
u && _.length > 0 && /* @__PURE__ */ (0, Y.jsx)(
|
|
2814
|
+
u && _.length > 0 && /* @__PURE__ */ (0, Y.jsx)(_t, {
|
|
2765
2815
|
items: _e,
|
|
2766
2816
|
canvasWidth: a.width ?? 1400,
|
|
2767
2817
|
canvasHeight: a.height ?? 800,
|
|
@@ -2773,7 +2823,7 @@ function Pt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2773
2823
|
className: "w-64 border-l bg-background overflow-y-auto flex-shrink-0",
|
|
2774
2824
|
role: "complementary",
|
|
2775
2825
|
"aria-label": "Property panel",
|
|
2776
|
-
children: /* @__PURE__ */ (0, Y.jsx)(
|
|
2826
|
+
children: /* @__PURE__ */ (0, Y.jsx)(mt, {
|
|
2777
2827
|
title: me ? `Properties: ${me.label}` : "Properties",
|
|
2778
2828
|
fields: G,
|
|
2779
2829
|
onChange: he
|
|
@@ -2785,7 +2835,7 @@ function Pt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2785
2835
|
}
|
|
2786
2836
|
//#endregion
|
|
2787
2837
|
//#region src/ReportDesigner.tsx
|
|
2788
|
-
function
|
|
2838
|
+
function It(...e) {
|
|
2789
2839
|
return q(K(e));
|
|
2790
2840
|
}
|
|
2791
2841
|
var Z = {
|
|
@@ -2838,7 +2888,7 @@ var Z = {
|
|
|
2838
2888
|
groupSize: "Size",
|
|
2839
2889
|
groupContent: "Content",
|
|
2840
2890
|
groupGeneral: "General"
|
|
2841
|
-
},
|
|
2891
|
+
}, Lt = {
|
|
2842
2892
|
A4: {
|
|
2843
2893
|
width: 595,
|
|
2844
2894
|
height: 842
|
|
@@ -2859,7 +2909,7 @@ var Z = {
|
|
|
2859
2909
|
width: 792,
|
|
2860
2910
|
height: 1224
|
|
2861
2911
|
}
|
|
2862
|
-
},
|
|
2912
|
+
}, Rt = [
|
|
2863
2913
|
{
|
|
2864
2914
|
type: "header",
|
|
2865
2915
|
height: 80,
|
|
@@ -2877,23 +2927,23 @@ var Z = {
|
|
|
2877
2927
|
elements: []
|
|
2878
2928
|
}
|
|
2879
2929
|
];
|
|
2880
|
-
function
|
|
2930
|
+
function zt({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4", orientation: r = "portrait", margins: a = {
|
|
2881
2931
|
top: 40,
|
|
2882
2932
|
right: 40,
|
|
2883
2933
|
bottom: 40,
|
|
2884
2934
|
left: 40
|
|
2885
2935
|
}, sections: u = [], showToolbar: d = !0, showPropertyPanel: f = !0, readOnly: m = !1, onSectionsChange: h, className: g }) {
|
|
2886
|
-
let _ =
|
|
2936
|
+
let _ = it(u.length > 0 ? u : Rt), v = _.current, y = i((e) => {
|
|
2887
2937
|
_.push(e), h?.(e);
|
|
2888
|
-
}, [_, h]), b =
|
|
2938
|
+
}, [_, h]), b = ot(), S = s(() => {
|
|
2889
2939
|
let e = Array.from(b.selectedIds);
|
|
2890
2940
|
return e.length > 0 ? e[0] : null;
|
|
2891
|
-
}, [b.selectedIds]), C =
|
|
2941
|
+
}, [b.selectedIds]), C = st(), w = at(), E = xt(), D = i((e) => {
|
|
2892
2942
|
E && E.sendOperation({
|
|
2893
2943
|
...e,
|
|
2894
2944
|
userId: E.currentUserId ?? ""
|
|
2895
2945
|
});
|
|
2896
|
-
}, [E]), [O, k] = l(!0), A = c(null), M = c(null), N =
|
|
2946
|
+
}, [E]), [O, k] = l(!0), A = c(null), M = c(null), N = Lt[n], P = r === "landscape" ? N.height : N.width, F = r === "landscape" ? N.width : N.height, I = (e) => {
|
|
2897
2947
|
switch (e) {
|
|
2898
2948
|
case "header": return Z.sectionHeader;
|
|
2899
2949
|
case "page-header": return Z.sectionPageHeader;
|
|
@@ -3210,7 +3260,7 @@ function Rt({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3210
3260
|
]), /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
3211
3261
|
ref: M,
|
|
3212
3262
|
tabIndex: 0,
|
|
3213
|
-
className:
|
|
3263
|
+
className: It("flex h-full w-full border rounded-lg overflow-hidden bg-background", g),
|
|
3214
3264
|
children: [
|
|
3215
3265
|
/* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
3216
3266
|
className: "flex-1 flex flex-col min-w-0",
|
|
@@ -3235,7 +3285,7 @@ function Rt({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3235
3285
|
!m && /* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [
|
|
3236
3286
|
/* @__PURE__ */ (0, Y.jsx)("div", { className: "w-px h-5 bg-border mx-1" }),
|
|
3237
3287
|
/* @__PURE__ */ (0, Y.jsx)("button", {
|
|
3238
|
-
className:
|
|
3288
|
+
className: It("p-1.5 rounded hover:bg-accent", !_.canUndo && "opacity-40 pointer-events-none"),
|
|
3239
3289
|
title: Z.undoShortcut,
|
|
3240
3290
|
"aria-label": Z.undo,
|
|
3241
3291
|
disabled: !_.canUndo,
|
|
@@ -3243,7 +3293,7 @@ function Rt({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3243
3293
|
children: /* @__PURE__ */ (0, Y.jsx)(Re, { className: "h-4 w-4" })
|
|
3244
3294
|
}),
|
|
3245
3295
|
/* @__PURE__ */ (0, Y.jsx)("button", {
|
|
3246
|
-
className:
|
|
3296
|
+
className: It("p-1.5 rounded hover:bg-accent", !_.canRedo && "opacity-40 pointer-events-none"),
|
|
3247
3297
|
title: Z.redoShortcut,
|
|
3248
3298
|
"aria-label": Z.redo,
|
|
3249
3299
|
disabled: !_.canRedo,
|
|
@@ -3254,7 +3304,7 @@ function Rt({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3254
3304
|
] }),
|
|
3255
3305
|
!m && /* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [
|
|
3256
3306
|
/* @__PURE__ */ (0, Y.jsx)("button", {
|
|
3257
|
-
className:
|
|
3307
|
+
className: It("p-1.5 rounded hover:bg-accent", b.count === 0 && "opacity-40 pointer-events-none"),
|
|
3258
3308
|
title: Z.copyShortcut,
|
|
3259
3309
|
"aria-label": Z.copy,
|
|
3260
3310
|
disabled: b.count === 0,
|
|
@@ -3262,7 +3312,7 @@ function Rt({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3262
3312
|
children: /* @__PURE__ */ (0, Y.jsx)(T, { className: "h-4 w-4" })
|
|
3263
3313
|
}),
|
|
3264
3314
|
/* @__PURE__ */ (0, Y.jsx)("button", {
|
|
3265
|
-
className:
|
|
3315
|
+
className: It("p-1.5 rounded hover:bg-accent", !C.hasContent && "opacity-40 pointer-events-none"),
|
|
3266
3316
|
title: Z.pasteShortcut,
|
|
3267
3317
|
"aria-label": Z.paste,
|
|
3268
3318
|
disabled: !C.hasContent,
|
|
@@ -3272,7 +3322,7 @@ function Rt({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3272
3322
|
/* @__PURE__ */ (0, Y.jsx)("div", { className: "w-px h-5 bg-border mx-1" })
|
|
3273
3323
|
] }),
|
|
3274
3324
|
!m && /* @__PURE__ */ (0, Y.jsx)("button", {
|
|
3275
|
-
className:
|
|
3325
|
+
className: It("p-1.5 rounded hover:bg-accent", b.count === 0 && "opacity-40 pointer-events-none"),
|
|
3276
3326
|
title: Z.deleteSelected,
|
|
3277
3327
|
"aria-label": Z.deleteSelected,
|
|
3278
3328
|
disabled: b.count === 0,
|
|
@@ -3301,7 +3351,7 @@ function Rt({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3301
3351
|
title: O ? Z.collapsePanel : Z.expandPanel,
|
|
3302
3352
|
"aria-label": O ? Z.collapsePanel : Z.expandPanel,
|
|
3303
3353
|
onClick: () => k((e) => !e),
|
|
3304
|
-
children: /* @__PURE__ */ (0, Y.jsx)(ve, { className:
|
|
3354
|
+
children: /* @__PURE__ */ (0, Y.jsx)(ve, { className: It("h-4 w-4", !O && "rotate-180") })
|
|
3305
3355
|
})
|
|
3306
3356
|
]
|
|
3307
3357
|
}), /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
@@ -3378,7 +3428,7 @@ function Rt({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3378
3428
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
3379
3429
|
draggable: !m,
|
|
3380
3430
|
onDragStart: (n) => te(n, e, t),
|
|
3381
|
-
className:
|
|
3431
|
+
className: It("absolute border rounded px-2 py-1 text-xs cursor-pointer", n ? "border-primary ring-1 ring-primary/30 bg-primary/5" : "border-dashed border-gray-400 hover:border-primary/50"),
|
|
3382
3432
|
style: {
|
|
3383
3433
|
left: e.position.x,
|
|
3384
3434
|
top: (typeof e.position.y == "number" ? e.position.y : 0) + 24,
|
|
@@ -3414,8 +3464,8 @@ function Rt({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3414
3464
|
f && /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
3415
3465
|
role: "region",
|
|
3416
3466
|
"aria-label": Z.propertiesPanel,
|
|
3417
|
-
className:
|
|
3418
|
-
children: O && (S && L ? /* @__PURE__ */ (0, Y.jsx)(
|
|
3467
|
+
className: It("border-l bg-muted/30 flex flex-col transition-[width] duration-200", O ? "w-56" : "w-0 overflow-hidden"),
|
|
3468
|
+
children: O && (S && L ? /* @__PURE__ */ (0, Y.jsx)(mt, {
|
|
3419
3469
|
title: `${Z.properties} – ${L.type}`,
|
|
3420
3470
|
fields: re,
|
|
3421
3471
|
onChange: V
|
|
@@ -3430,7 +3480,7 @@ function Rt({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3430
3480
|
})
|
|
3431
3481
|
})] }))
|
|
3432
3482
|
}),
|
|
3433
|
-
/* @__PURE__ */ (0, Y.jsx)(
|
|
3483
|
+
/* @__PURE__ */ (0, Y.jsx)(ft, {
|
|
3434
3484
|
isOpen: w.isOpen,
|
|
3435
3485
|
title: w.title,
|
|
3436
3486
|
message: w.message,
|
|
@@ -3442,16 +3492,16 @@ function Rt({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3442
3492
|
}
|
|
3443
3493
|
//#endregion
|
|
3444
3494
|
//#region ../../node_modules/.pnpm/react-i18next@17.0.6_i18next@26.0.8_typescript@6.0.3__react-dom@19.2.5_react@19.2.5__react@19.2.5_typescript@6.0.3/node_modules/react-i18next/dist/es/utils.js
|
|
3445
|
-
var
|
|
3495
|
+
var Bt = (e, t, n, r) => {
|
|
3446
3496
|
let i = [n, {
|
|
3447
3497
|
code: t,
|
|
3448
3498
|
...r || {}
|
|
3449
3499
|
}];
|
|
3450
3500
|
if (e?.services?.logger?.forward) return e.services.logger.forward(i, "warn", "react-i18next::", !0);
|
|
3451
|
-
|
|
3452
|
-
},
|
|
3453
|
-
|
|
3454
|
-
},
|
|
3501
|
+
qt(i[0]) && (i[0] = `react-i18next:: ${i[0]}`), e?.services?.logger?.warn ? e.services.logger.warn(...i) : console?.warn && console.warn(...i);
|
|
3502
|
+
}, Vt = {}, Ht = (e, t, n, r) => {
|
|
3503
|
+
qt(n) && Vt[n] || (qt(n) && (Vt[n] = /* @__PURE__ */ new Date()), Bt(e, t, n, r));
|
|
3504
|
+
}, Ut = (e, t) => () => {
|
|
3455
3505
|
if (e.isInitialized) t();
|
|
3456
3506
|
else {
|
|
3457
3507
|
let n = () => {
|
|
@@ -3461,19 +3511,19 @@ var zt = (e, t, n, r) => {
|
|
|
3461
3511
|
};
|
|
3462
3512
|
e.on("initialized", n);
|
|
3463
3513
|
}
|
|
3464
|
-
},
|
|
3465
|
-
e.loadNamespaces(t,
|
|
3466
|
-
},
|
|
3467
|
-
if (
|
|
3514
|
+
}, Wt = (e, t, n) => {
|
|
3515
|
+
e.loadNamespaces(t, Ut(e, n));
|
|
3516
|
+
}, Gt = (e, t, n, r) => {
|
|
3517
|
+
if (qt(n) && (n = [n]), e.options.preload && e.options.preload.indexOf(t) > -1) return Wt(e, n, r);
|
|
3468
3518
|
n.forEach((t) => {
|
|
3469
3519
|
e.options.ns.indexOf(t) < 0 && e.options.ns.push(t);
|
|
3470
|
-
}), e.loadLanguages(t,
|
|
3471
|
-
},
|
|
3520
|
+
}), e.loadLanguages(t, Ut(e, r));
|
|
3521
|
+
}, Kt = (e, t, n = {}) => !t.languages || !t.languages.length ? (Ht(t, "NO_LANGUAGES", "i18n.languages were undefined or empty", { languages: t.languages }), !0) : t.hasLoadedNamespace(e, {
|
|
3472
3522
|
lng: n.lng,
|
|
3473
3523
|
precheck: (t, r) => {
|
|
3474
3524
|
if (n.bindI18n && n.bindI18n.indexOf("languageChanging") > -1 && t.services.backendConnector.backend && t.isLanguageChangingTo && !r(t.isLanguageChangingTo, e)) return !1;
|
|
3475
3525
|
}
|
|
3476
|
-
}),
|
|
3526
|
+
}), qt = (e) => typeof e == "string", Jt = (e) => typeof e == "object" && !!e, Yt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, Xt = {
|
|
3477
3527
|
"&": "&",
|
|
3478
3528
|
"&": "&",
|
|
3479
3529
|
"<": "<",
|
|
@@ -3494,7 +3544,7 @@ var zt = (e, t, n, r) => {
|
|
|
3494
3544
|
"…": "…",
|
|
3495
3545
|
"/": "/",
|
|
3496
3546
|
"/": "/"
|
|
3497
|
-
},
|
|
3547
|
+
}, Zt = (e) => Xt[e], Qt = {
|
|
3498
3548
|
bindI18n: "languageChanged",
|
|
3499
3549
|
bindI18nStore: "",
|
|
3500
3550
|
transEmptyNodeValue: "",
|
|
@@ -3507,9 +3557,9 @@ var zt = (e, t, n, r) => {
|
|
|
3507
3557
|
"p"
|
|
3508
3558
|
],
|
|
3509
3559
|
useSuspense: !0,
|
|
3510
|
-
unescape: (e) => e.replace(
|
|
3560
|
+
unescape: (e) => e.replace(Yt, Zt),
|
|
3511
3561
|
transDefaultProps: void 0
|
|
3512
|
-
},
|
|
3562
|
+
}, $t = () => Qt, en, tn = () => en, nn = r(), rn = class {
|
|
3513
3563
|
constructor() {
|
|
3514
3564
|
this.usedNamespaces = {};
|
|
3515
3565
|
}
|
|
@@ -3521,7 +3571,7 @@ var zt = (e, t, n, r) => {
|
|
|
3521
3571
|
getUsedNamespaces() {
|
|
3522
3572
|
return Object.keys(this.usedNamespaces);
|
|
3523
3573
|
}
|
|
3524
|
-
},
|
|
3574
|
+
}, an = /* @__PURE__ */ tt(((e) => {
|
|
3525
3575
|
var t = nt("react");
|
|
3526
3576
|
function n(e, t) {
|
|
3527
3577
|
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
@@ -3559,7 +3609,7 @@ var zt = (e, t, n, r) => {
|
|
|
3559
3609
|
}
|
|
3560
3610
|
var d = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? u : c;
|
|
3561
3611
|
e.useSyncExternalStore = t.useSyncExternalStore === void 0 ? d : t.useSyncExternalStore;
|
|
3562
|
-
})),
|
|
3612
|
+
})), on = /* @__PURE__ */ tt(((e) => {
|
|
3563
3613
|
process.env.NODE_ENV !== "production" && (function() {
|
|
3564
3614
|
function t(e, t) {
|
|
3565
3615
|
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
@@ -3605,12 +3655,12 @@ var zt = (e, t, n, r) => {
|
|
|
3605
3655
|
var a = nt("react"), o = typeof Object.is == "function" ? Object.is : t, s = a.useState, c = a.useEffect, l = a.useLayoutEffect, u = a.useDebugValue, d = !1, f = !1, p = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? i : n;
|
|
3606
3656
|
e.useSyncExternalStore = a.useSyncExternalStore === void 0 ? p : a.useSyncExternalStore, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
3607
3657
|
})();
|
|
3608
|
-
})),
|
|
3609
|
-
process.env.NODE_ENV === "production" ? t.exports =
|
|
3610
|
-
})))(),
|
|
3658
|
+
})), sn = (/* @__PURE__ */ tt(((e, t) => {
|
|
3659
|
+
process.env.NODE_ENV === "production" ? t.exports = an() : t.exports = on();
|
|
3660
|
+
})))(), cn = {
|
|
3611
3661
|
t: (e, t) => {
|
|
3612
|
-
if (
|
|
3613
|
-
if (
|
|
3662
|
+
if (qt(t)) return t;
|
|
3663
|
+
if (Jt(t) && qt(t.defaultValue)) return t.defaultValue;
|
|
3614
3664
|
if (typeof e == "function") return "";
|
|
3615
3665
|
if (Array.isArray(e)) {
|
|
3616
3666
|
let t = e[e.length - 1];
|
|
@@ -3619,17 +3669,17 @@ var zt = (e, t, n, r) => {
|
|
|
3619
3669
|
return e;
|
|
3620
3670
|
},
|
|
3621
3671
|
ready: !1
|
|
3622
|
-
},
|
|
3623
|
-
let { i18n: n } = t, { i18n: r, defaultNS: u } = a(
|
|
3624
|
-
d && !d.reportNamespaces && (d.reportNamespaces = new
|
|
3672
|
+
}, ln = () => () => {}, un = (e, t = {}) => {
|
|
3673
|
+
let { i18n: n } = t, { i18n: r, defaultNS: u } = a(nn) || {}, d = n || r || tn();
|
|
3674
|
+
d && !d.reportNamespaces && (d.reportNamespaces = new rn()), d || Ht(d, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
|
|
3625
3675
|
let f = s(() => ({
|
|
3626
|
-
|
|
3676
|
+
...$t(),
|
|
3627
3677
|
...d?.options?.react,
|
|
3628
3678
|
...t
|
|
3629
|
-
}), [d, t]), { useSuspense: p, keyPrefix: m } = f, h = e || u || d?.options?.defaultNS, g =
|
|
3679
|
+
}), [d, t]), { useSuspense: p, keyPrefix: m } = f, h = e || u || d?.options?.defaultNS, g = qt(h) ? [h] : h || ["translation"], _ = s(() => g, g);
|
|
3630
3680
|
d?.reportNamespaces?.addUsedNamespaces?.(_);
|
|
3631
3681
|
let v = c(0), y = i((e) => {
|
|
3632
|
-
if (!d) return
|
|
3682
|
+
if (!d) return ln;
|
|
3633
3683
|
let { bindI18n: t, bindI18nStore: n } = f, r = () => {
|
|
3634
3684
|
v.current += 1, e();
|
|
3635
3685
|
};
|
|
@@ -3637,8 +3687,8 @@ var zt = (e, t, n, r) => {
|
|
|
3637
3687
|
t && t.split(" ").forEach((e) => d.off(e, r)), n && n.split(" ").forEach((e) => d.store.off(e, r));
|
|
3638
3688
|
};
|
|
3639
3689
|
}, [d, f]), b = c(), x = i(() => {
|
|
3640
|
-
if (!d) return
|
|
3641
|
-
let e = !!(d.isInitialized || d.initializedStoreOnce) && _.every((e) =>
|
|
3690
|
+
if (!d) return cn;
|
|
3691
|
+
let e = !!(d.isInitialized || d.initializedStoreOnce) && _.every((e) => Kt(e, d, f)), n = t.lng || d.language, r = v.current, i = b.current;
|
|
3642
3692
|
if (i && i.ready === e && i.lng === n && i.keyPrefix === m && i.revision === r) return i;
|
|
3643
3693
|
let a = {
|
|
3644
3694
|
t: d.getFixedT(n, f.nsMode === "fallback" ? _ : _[0], m),
|
|
@@ -3654,11 +3704,11 @@ var zt = (e, t, n, r) => {
|
|
|
3654
3704
|
m,
|
|
3655
3705
|
f,
|
|
3656
3706
|
t.lng
|
|
3657
|
-
]), [S, C] = l(0), { t: w, ready: T } = (0,
|
|
3707
|
+
]), [S, C] = l(0), { t: w, ready: T } = (0, sn.useSyncExternalStore)(y, x, x);
|
|
3658
3708
|
o(() => {
|
|
3659
3709
|
if (d && !T && !p) {
|
|
3660
3710
|
let e = () => C((e) => e + 1);
|
|
3661
|
-
t.lng ?
|
|
3711
|
+
t.lng ? Gt(d, t.lng, _, e) : Wt(d, _, e);
|
|
3662
3712
|
}
|
|
3663
3713
|
}, [
|
|
3664
3714
|
d,
|
|
@@ -3684,7 +3734,7 @@ var zt = (e, t, n, r) => {
|
|
|
3684
3734
|
}, A = s(() => {
|
|
3685
3735
|
let e = E, t = e?.language, n = e;
|
|
3686
3736
|
e && (D.current && D.current.__original === e && O.current === t ? n = D.current : (n = k(e), D.current = n, O.current = t));
|
|
3687
|
-
let r = !T && !p ? (...e) => (
|
|
3737
|
+
let r = !T && !p ? (...e) => (Ht(d, "USE_T_BEFORE_READY", "useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."), w(...e)) : w, i = [
|
|
3688
3738
|
r,
|
|
3689
3739
|
n,
|
|
3690
3740
|
T
|
|
@@ -3700,12 +3750,12 @@ var zt = (e, t, n, r) => {
|
|
|
3700
3750
|
]);
|
|
3701
3751
|
if (d && p && !T) throw new Promise((e) => {
|
|
3702
3752
|
let n = () => e();
|
|
3703
|
-
t.lng ?
|
|
3753
|
+
t.lng ? Gt(d, t.lng, _, n) : Wt(d, _, n);
|
|
3704
3754
|
});
|
|
3705
3755
|
return A;
|
|
3706
|
-
},
|
|
3707
|
-
function
|
|
3708
|
-
let t = a(
|
|
3756
|
+
}, dn = r(null);
|
|
3757
|
+
function fn(e) {
|
|
3758
|
+
let t = a(dn), { t: n, i18n: r } = un(e);
|
|
3709
3759
|
return {
|
|
3710
3760
|
t: n,
|
|
3711
3761
|
language: t?.language || r.language || "en",
|
|
@@ -3718,7 +3768,7 @@ function dn(e) {
|
|
|
3718
3768
|
}
|
|
3719
3769
|
//#endregion
|
|
3720
3770
|
//#region src/hooks/useDesignerTranslation.ts
|
|
3721
|
-
var
|
|
3771
|
+
var pn = {
|
|
3722
3772
|
"appDesigner.basicInfo": "Basic Info",
|
|
3723
3773
|
"appDesigner.objects": "Objects",
|
|
3724
3774
|
"appDesigner.navigation": "Navigation",
|
|
@@ -3881,7 +3931,7 @@ var fn = {
|
|
|
3881
3931
|
"appDesigner.fieldDesigner.typeCategory.advanced": "Advanced",
|
|
3882
3932
|
"common.edit": "Edit"
|
|
3883
3933
|
};
|
|
3884
|
-
function
|
|
3934
|
+
function mn(e) {
|
|
3885
3935
|
return (t, n) => {
|
|
3886
3936
|
let r = e[t] || t;
|
|
3887
3937
|
if (n) for (let [e, t] of Object.entries(n)) r = r.replace(`{{${e}}}`, String(t));
|
|
@@ -3890,18 +3940,18 @@ function pn(e) {
|
|
|
3890
3940
|
}
|
|
3891
3941
|
function Q() {
|
|
3892
3942
|
try {
|
|
3893
|
-
let e =
|
|
3894
|
-
return e.t("appDesigner.basicInfo") === "appDesigner.basicInfo" ? { t: pn
|
|
3943
|
+
let e = fn();
|
|
3944
|
+
return e.t("appDesigner.basicInfo") === "appDesigner.basicInfo" ? { t: mn(pn) } : { t: e.t };
|
|
3895
3945
|
} catch {
|
|
3896
|
-
return { t: pn
|
|
3946
|
+
return { t: mn(pn) };
|
|
3897
3947
|
}
|
|
3898
3948
|
}
|
|
3899
3949
|
//#endregion
|
|
3900
3950
|
//#region src/AppCreationWizard.tsx
|
|
3901
|
-
function
|
|
3951
|
+
function hn(...e) {
|
|
3902
3952
|
return q(K(e));
|
|
3903
3953
|
}
|
|
3904
|
-
var
|
|
3954
|
+
var gn = {
|
|
3905
3955
|
name: "",
|
|
3906
3956
|
title: "",
|
|
3907
3957
|
description: "",
|
|
@@ -3916,7 +3966,7 @@ var hn = {
|
|
|
3916
3966
|
favicon: ""
|
|
3917
3967
|
}
|
|
3918
3968
|
};
|
|
3919
|
-
function
|
|
3969
|
+
function _n(e) {
|
|
3920
3970
|
return e.filter((e) => e.selected).map((e) => ({
|
|
3921
3971
|
id: e.name,
|
|
3922
3972
|
type: "object",
|
|
@@ -3925,32 +3975,32 @@ function gn(e) {
|
|
|
3925
3975
|
objectName: e.name
|
|
3926
3976
|
}));
|
|
3927
3977
|
}
|
|
3928
|
-
var
|
|
3929
|
-
function
|
|
3930
|
-
return
|
|
3978
|
+
var vn = 0;
|
|
3979
|
+
function yn(e) {
|
|
3980
|
+
return vn += 1, `${e}_${Date.now()}_${vn}`;
|
|
3931
3981
|
}
|
|
3932
|
-
function
|
|
3982
|
+
function bn({ steps: e, currentIndex: t, onStepClick: r }) {
|
|
3933
3983
|
return /* @__PURE__ */ (0, Y.jsx)("nav", {
|
|
3934
3984
|
className: "flex items-center justify-center gap-0 px-4 py-6",
|
|
3935
3985
|
children: e.map((e, i) => {
|
|
3936
3986
|
let a = i < t, o = i === t;
|
|
3937
|
-
return /* @__PURE__ */ (0, Y.jsxs)(n.Fragment, { children: [i > 0 && /* @__PURE__ */ (0, Y.jsx)("div", { className:
|
|
3987
|
+
return /* @__PURE__ */ (0, Y.jsxs)(n.Fragment, { children: [i > 0 && /* @__PURE__ */ (0, Y.jsx)("div", { className: hn("h-0.5 w-12 sm:w-20", a ? "bg-blue-500" : "bg-gray-200") }), /* @__PURE__ */ (0, Y.jsxs)("button", {
|
|
3938
3988
|
type: "button",
|
|
3939
3989
|
"data-testid": `wizard-step-${e.id}`,
|
|
3940
3990
|
onClick: () => r(i),
|
|
3941
|
-
className:
|
|
3991
|
+
className: hn("flex flex-col items-center gap-1 outline-none focus-visible:ring-2 focus-visible:ring-blue-400 rounded-lg px-2 py-1", o && "cursor-default", !o && "cursor-pointer"),
|
|
3942
3992
|
children: [/* @__PURE__ */ (0, Y.jsx)("div", {
|
|
3943
|
-
className:
|
|
3993
|
+
className: hn("flex h-8 w-8 items-center justify-center rounded-full text-sm font-semibold transition-colors", a && "bg-blue-500 text-white", o && "bg-blue-600 text-white ring-2 ring-blue-300", !a && !o && "bg-gray-200 text-gray-500"),
|
|
3944
3994
|
children: a ? /* @__PURE__ */ (0, Y.jsx)(g, { className: "h-4 w-4" }) : i + 1
|
|
3945
3995
|
}), /* @__PURE__ */ (0, Y.jsx)("span", {
|
|
3946
|
-
className:
|
|
3996
|
+
className: hn("text-xs font-medium", o ? "text-blue-600" : "text-gray-500"),
|
|
3947
3997
|
children: e.label
|
|
3948
3998
|
})]
|
|
3949
3999
|
})] }, e.id);
|
|
3950
4000
|
})
|
|
3951
4001
|
});
|
|
3952
4002
|
}
|
|
3953
|
-
function
|
|
4003
|
+
function xn({ draft: e, templates: t, readOnly: n, onChange: r, t: i }) {
|
|
3954
4004
|
let a = e.name.length > 0 && !Ge(e.name);
|
|
3955
4005
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
3956
4006
|
"data-testid": "wizard-step-basic-content",
|
|
@@ -3979,7 +4029,7 @@ function bn({ draft: e, templates: t, readOnly: n, onChange: r, t: i }) {
|
|
|
3979
4029
|
onChange: (e) => r({ name: e.target.value }),
|
|
3980
4030
|
placeholder: "my_app",
|
|
3981
4031
|
disabled: n,
|
|
3982
|
-
className:
|
|
4032
|
+
className: hn("block w-full rounded-md border px-3 py-2 text-sm shadow-sm outline-none transition-colors", "focus:border-blue-500 focus:ring-1 focus:ring-blue-500", "disabled:cursor-not-allowed disabled:bg-gray-50", a ? "border-red-400" : "border-gray-300")
|
|
3983
4033
|
}),
|
|
3984
4034
|
a && /* @__PURE__ */ (0, Y.jsx)("p", {
|
|
3985
4035
|
className: "text-xs text-red-500",
|
|
@@ -4089,7 +4139,7 @@ function bn({ draft: e, templates: t, readOnly: n, onChange: r, t: i }) {
|
|
|
4089
4139
|
}
|
|
4090
4140
|
].map(({ value: t, labelKey: a, Icon: o }) => /* @__PURE__ */ (0, Y.jsxs)("label", {
|
|
4091
4141
|
"data-testid": `app-layout-${t}`,
|
|
4092
|
-
className:
|
|
4142
|
+
className: hn("flex flex-1 cursor-pointer flex-col items-center gap-1.5 rounded-lg border-2 p-3 transition-colors", e.layout === t ? "border-blue-500 bg-blue-50" : "border-gray-200 hover:border-gray-300", n && "pointer-events-none opacity-60"),
|
|
4093
4143
|
children: [
|
|
4094
4144
|
/* @__PURE__ */ (0, Y.jsx)(o, { className: "h-5 w-5 text-gray-600" }),
|
|
4095
4145
|
/* @__PURE__ */ (0, Y.jsx)("span", {
|
|
@@ -4112,7 +4162,7 @@ function bn({ draft: e, templates: t, readOnly: n, onChange: r, t: i }) {
|
|
|
4112
4162
|
]
|
|
4113
4163
|
});
|
|
4114
4164
|
}
|
|
4115
|
-
function
|
|
4165
|
+
function Sn({ objects: e, readOnly: t, onToggle: n, onToggleAll: r, search: i, onSearchChange: a, t: o }) {
|
|
4116
4166
|
let c = s(() => {
|
|
4117
4167
|
if (!i) return e;
|
|
4118
4168
|
let t = i.toLowerCase();
|
|
@@ -4150,7 +4200,7 @@ function xn({ objects: e, readOnly: t, onToggle: n, onToggleAll: r, search: i, o
|
|
|
4150
4200
|
"data-testid": `object-card-${e.name}`,
|
|
4151
4201
|
disabled: t,
|
|
4152
4202
|
onClick: () => n(e.name),
|
|
4153
|
-
className:
|
|
4203
|
+
className: hn("flex flex-col items-start gap-1 rounded-lg border-2 p-3 text-left transition-colors", e.selected ? "border-blue-500 bg-blue-50" : "border-gray-200 hover:border-gray-300", t && "pointer-events-none opacity-60"),
|
|
4154
4204
|
children: [
|
|
4155
4205
|
/* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
4156
4206
|
className: "flex w-full items-center justify-between",
|
|
@@ -4158,7 +4208,7 @@ function xn({ objects: e, readOnly: t, onToggle: n, onToggleAll: r, search: i, o
|
|
|
4158
4208
|
className: "text-sm font-medium text-gray-800",
|
|
4159
4209
|
children: e.label
|
|
4160
4210
|
}), /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
4161
|
-
className:
|
|
4211
|
+
className: hn("flex h-5 w-5 items-center justify-center rounded border transition-colors", e.selected ? "border-blue-500 bg-blue-500 text-white" : "border-gray-300"),
|
|
4162
4212
|
children: e.selected && /* @__PURE__ */ (0, Y.jsx)(g, { className: "h-3 w-3" })
|
|
4163
4213
|
})]
|
|
4164
4214
|
}),
|
|
@@ -4175,7 +4225,7 @@ function xn({ objects: e, readOnly: t, onToggle: n, onToggleAll: r, search: i, o
|
|
|
4175
4225
|
})]
|
|
4176
4226
|
});
|
|
4177
4227
|
}
|
|
4178
|
-
var
|
|
4228
|
+
var Cn = {
|
|
4179
4229
|
object: "bg-green-100 text-green-700",
|
|
4180
4230
|
group: "bg-purple-100 text-purple-700",
|
|
4181
4231
|
url: "bg-sky-100 text-sky-700",
|
|
@@ -4185,7 +4235,7 @@ var Sn = {
|
|
|
4185
4235
|
report: "bg-rose-100 text-rose-700",
|
|
4186
4236
|
action: "bg-orange-100 text-orange-700"
|
|
4187
4237
|
};
|
|
4188
|
-
function
|
|
4238
|
+
function wn({ items: e, readOnly: t, onAdd: n, onRemove: r, onReorder: i, t: a }) {
|
|
4189
4239
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
4190
4240
|
"data-testid": "wizard-step-navigation-content",
|
|
4191
4241
|
className: "mx-auto max-w-lg space-y-4",
|
|
@@ -4235,7 +4285,7 @@ function Cn({ items: e, readOnly: t, onAdd: n, onRemove: r, onReorder: i, t: a }
|
|
|
4235
4285
|
children: n.type === "separator" ? a("appDesigner.separatorLabel") : qe(n.label)
|
|
4236
4286
|
}),
|
|
4237
4287
|
/* @__PURE__ */ (0, Y.jsx)("span", {
|
|
4238
|
-
className:
|
|
4288
|
+
className: hn("rounded-full px-2 py-0.5 text-[10px] font-medium", Cn[n.type] ?? "bg-gray-100 text-gray-600"),
|
|
4239
4289
|
children: n.type
|
|
4240
4290
|
}),
|
|
4241
4291
|
/* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
@@ -4272,7 +4322,7 @@ function Cn({ items: e, readOnly: t, onAdd: n, onRemove: r, onReorder: i, t: a }
|
|
|
4272
4322
|
})]
|
|
4273
4323
|
});
|
|
4274
4324
|
}
|
|
4275
|
-
function
|
|
4325
|
+
function Tn({ branding: e, title: t, readOnly: n, onChange: r, t: i }) {
|
|
4276
4326
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
4277
4327
|
"data-testid": "wizard-step-branding-content",
|
|
4278
4328
|
className: "mx-auto max-w-lg space-y-5",
|
|
@@ -4386,9 +4436,9 @@ function wn({ branding: e, title: t, readOnly: n, onChange: r, t: i }) {
|
|
|
4386
4436
|
]
|
|
4387
4437
|
});
|
|
4388
4438
|
}
|
|
4389
|
-
function
|
|
4390
|
-
let { t: d } = Q(), f =
|
|
4391
|
-
...
|
|
4439
|
+
function En({ availableObjects: e = [], templates: t = [], initialDraft: n, onComplete: r, onCancel: a, onSaveDraft: o, readOnly: c = !1, className: u }) {
|
|
4440
|
+
let { t: d } = Q(), f = at(), [p, m] = l(0), [h, _] = l(""), [b, x] = l(() => ({
|
|
4441
|
+
...gn,
|
|
4392
4442
|
objects: e.map((e) => ({ ...e })),
|
|
4393
4443
|
...n
|
|
4394
4444
|
})), S = s(() => [
|
|
@@ -4447,7 +4497,7 @@ function Tn({ availableObjects: e = [], templates: t = [], initialDraft: n, onCo
|
|
|
4447
4497
|
}));
|
|
4448
4498
|
}, []), j = i((e) => {
|
|
4449
4499
|
let t = {
|
|
4450
|
-
id:
|
|
4500
|
+
id: yn(e),
|
|
4451
4501
|
type: e,
|
|
4452
4502
|
label: e === "separator" ? "" : e === "group" ? "New Group" : "New Link",
|
|
4453
4503
|
...e === "group" ? { children: [] } : {},
|
|
@@ -4475,7 +4525,7 @@ function Tn({ availableObjects: e = [], templates: t = [], initialDraft: n, onCo
|
|
|
4475
4525
|
}, []), P = i(() => {
|
|
4476
4526
|
w || (p === 1 && x((e) => ({
|
|
4477
4527
|
...e,
|
|
4478
|
-
navigation:
|
|
4528
|
+
navigation: _n(e.objects)
|
|
4479
4529
|
})), m((e) => e + 1));
|
|
4480
4530
|
}, [p, w]), F = i(() => {
|
|
4481
4531
|
C || m((e) => e - 1);
|
|
@@ -4494,11 +4544,11 @@ function Tn({ availableObjects: e = [], templates: t = [], initialDraft: n, onCo
|
|
|
4494
4544
|
}, [b, o]), z = i((e) => {
|
|
4495
4545
|
e <= p ? m(e) : e === p + 1 && E && (p === 1 && e === 2 && x((e) => ({
|
|
4496
4546
|
...e,
|
|
4497
|
-
navigation:
|
|
4547
|
+
navigation: _n(e.objects)
|
|
4498
4548
|
})), m(e));
|
|
4499
4549
|
}, [p, E]);
|
|
4500
4550
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
4501
|
-
className:
|
|
4551
|
+
className: hn("flex h-full flex-col rounded-xl border border-gray-200 bg-white shadow-sm", u),
|
|
4502
4552
|
children: [
|
|
4503
4553
|
f.isOpen && /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
4504
4554
|
"data-testid": "cancel-confirm-dialog",
|
|
@@ -4546,7 +4596,7 @@ function Tn({ availableObjects: e = [], templates: t = [], initialDraft: n, onCo
|
|
|
4546
4596
|
}),
|
|
4547
4597
|
/* @__PURE__ */ (0, Y.jsx)("div", {
|
|
4548
4598
|
className: "border-b border-gray-100",
|
|
4549
|
-
children: /* @__PURE__ */ (0, Y.jsx)(
|
|
4599
|
+
children: /* @__PURE__ */ (0, Y.jsx)(bn, {
|
|
4550
4600
|
steps: S,
|
|
4551
4601
|
currentIndex: p,
|
|
4552
4602
|
onStepClick: z
|
|
@@ -4555,14 +4605,14 @@ function Tn({ availableObjects: e = [], templates: t = [], initialDraft: n, onCo
|
|
|
4555
4605
|
/* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
4556
4606
|
className: "flex-1 overflow-y-auto p-6",
|
|
4557
4607
|
children: [
|
|
4558
|
-
p === 0 && /* @__PURE__ */ (0, Y.jsx)(
|
|
4608
|
+
p === 0 && /* @__PURE__ */ (0, Y.jsx)(xn, {
|
|
4559
4609
|
draft: b,
|
|
4560
4610
|
templates: t,
|
|
4561
4611
|
readOnly: c,
|
|
4562
4612
|
onChange: D,
|
|
4563
4613
|
t: d
|
|
4564
4614
|
}),
|
|
4565
|
-
p === 1 && /* @__PURE__ */ (0, Y.jsx)(
|
|
4615
|
+
p === 1 && /* @__PURE__ */ (0, Y.jsx)(Sn, {
|
|
4566
4616
|
objects: b.objects,
|
|
4567
4617
|
readOnly: c,
|
|
4568
4618
|
onToggle: k,
|
|
@@ -4571,7 +4621,7 @@ function Tn({ availableObjects: e = [], templates: t = [], initialDraft: n, onCo
|
|
|
4571
4621
|
onSearchChange: _,
|
|
4572
4622
|
t: d
|
|
4573
4623
|
}),
|
|
4574
|
-
p === 2 && /* @__PURE__ */ (0, Y.jsx)(
|
|
4624
|
+
p === 2 && /* @__PURE__ */ (0, Y.jsx)(wn, {
|
|
4575
4625
|
items: b.navigation,
|
|
4576
4626
|
readOnly: c,
|
|
4577
4627
|
onAdd: j,
|
|
@@ -4579,7 +4629,7 @@ function Tn({ availableObjects: e = [], templates: t = [], initialDraft: n, onCo
|
|
|
4579
4629
|
onReorder: N,
|
|
4580
4630
|
t: d
|
|
4581
4631
|
}),
|
|
4582
|
-
p === 3 && /* @__PURE__ */ (0, Y.jsx)(
|
|
4632
|
+
p === 3 && /* @__PURE__ */ (0, Y.jsx)(Tn, {
|
|
4583
4633
|
branding: b.branding,
|
|
4584
4634
|
title: b.title,
|
|
4585
4635
|
readOnly: c,
|
|
@@ -4638,14 +4688,14 @@ function Tn({ availableObjects: e = [], templates: t = [], initialDraft: n, onCo
|
|
|
4638
4688
|
}
|
|
4639
4689
|
//#endregion
|
|
4640
4690
|
//#region src/NavigationDesigner.tsx
|
|
4641
|
-
function
|
|
4691
|
+
function Dn(...e) {
|
|
4642
4692
|
return q(K(e));
|
|
4643
4693
|
}
|
|
4644
|
-
var
|
|
4645
|
-
function
|
|
4646
|
-
return
|
|
4694
|
+
var On = 0;
|
|
4695
|
+
function kn(e) {
|
|
4696
|
+
return On += 1, `${e}_${Date.now()}_${On}`;
|
|
4647
4697
|
}
|
|
4648
|
-
var
|
|
4698
|
+
var An = {
|
|
4649
4699
|
object: {
|
|
4650
4700
|
labelKey: "appDesigner.navTypeObject",
|
|
4651
4701
|
color: "bg-green-100 text-green-700",
|
|
@@ -4686,7 +4736,7 @@ var kn = {
|
|
|
4686
4736
|
color: "bg-orange-100 text-orange-700",
|
|
4687
4737
|
Icon: G
|
|
4688
4738
|
}
|
|
4689
|
-
},
|
|
4739
|
+
}, jn = [
|
|
4690
4740
|
{
|
|
4691
4741
|
type: "object",
|
|
4692
4742
|
labelKey: "appDesigner.navObjectPage"
|
|
@@ -4716,8 +4766,8 @@ var kn = {
|
|
|
4716
4766
|
labelKey: "appDesigner.navSeparator"
|
|
4717
4767
|
}
|
|
4718
4768
|
];
|
|
4719
|
-
function
|
|
4720
|
-
let [g, v] = l(!1), [x, S] = l(qe(e.label) ?? ""), [C, w] = l(!1), [T, E] = l(e.icon || ""), D =
|
|
4769
|
+
function Mn({ item: e, depth: t, index: n, total: r, readOnly: i, onRemove: a, onMoveUp: o, onMoveDown: s, onToggleExpand: c, onUpdateLabel: u, onUpdateIcon: d, onToggleVisible: f, onAddChild: p, expandedIds: m, t: h }) {
|
|
4770
|
+
let [g, v] = l(!1), [x, S] = l(qe(e.label) ?? ""), [C, w] = l(!1), [T, E] = l(e.icon || ""), D = An[e.type];
|
|
4721
4771
|
e.type === "group" && e.children && e.children.length;
|
|
4722
4772
|
let O = m.has(e.id), j = e.visible === !1, M = () => {
|
|
4723
4773
|
x.trim() ? u(e.id, x.trim()) : S(qe(e.label) ?? ""), v(!1);
|
|
@@ -4726,7 +4776,7 @@ function jn({ item: e, depth: t, index: n, total: r, readOnly: i, onRemove: a, o
|
|
|
4726
4776
|
};
|
|
4727
4777
|
return /* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [/* @__PURE__ */ (0, Y.jsxs)("li", {
|
|
4728
4778
|
"data-testid": `nav-designer-item-${e.id}`,
|
|
4729
|
-
className:
|
|
4779
|
+
className: Dn("flex items-center gap-2 rounded-md border border-gray-200 bg-white px-2 py-1.5 transition-colors hover:bg-gray-50", j && "opacity-50"),
|
|
4730
4780
|
style: { marginLeft: t * 20 },
|
|
4731
4781
|
children: [
|
|
4732
4782
|
/* @__PURE__ */ (0, Y.jsx)(z, { className: "h-3.5 w-3.5 shrink-0 cursor-grab text-gray-300" }),
|
|
@@ -4776,14 +4826,14 @@ function jn({ item: e, depth: t, index: n, total: r, readOnly: i, onRemove: a, o
|
|
|
4776
4826
|
autoFocus: !0,
|
|
4777
4827
|
className: "flex-1 rounded border border-blue-300 px-1.5 py-0.5 text-sm outline-none focus:ring-1 focus:ring-blue-400"
|
|
4778
4828
|
}) : /* @__PURE__ */ (0, Y.jsx)("span", {
|
|
4779
|
-
className:
|
|
4829
|
+
className: Dn("flex-1 truncate text-sm text-gray-800", !i && "cursor-text"),
|
|
4780
4830
|
onDoubleClick: () => {
|
|
4781
4831
|
!i && e.type !== "separator" && (S(qe(e.label) ?? ""), v(!0));
|
|
4782
4832
|
},
|
|
4783
4833
|
children: qe(e.label)
|
|
4784
4834
|
}),
|
|
4785
4835
|
/* @__PURE__ */ (0, Y.jsx)("span", {
|
|
4786
|
-
className:
|
|
4836
|
+
className: Dn("rounded-full px-2 py-0.5 text-[10px] font-medium", D.color),
|
|
4787
4837
|
children: h(D.labelKey)
|
|
4788
4838
|
}),
|
|
4789
4839
|
j && /* @__PURE__ */ (0, Y.jsx)("span", {
|
|
@@ -4833,7 +4883,7 @@ function jn({ item: e, depth: t, index: n, total: r, readOnly: i, onRemove: a, o
|
|
|
4833
4883
|
children: /* @__PURE__ */ (0, Y.jsx)(Fe, { className: "h-3.5 w-3.5" })
|
|
4834
4884
|
})
|
|
4835
4885
|
]
|
|
4836
|
-
}), e.type === "group" && O && e.children && /* @__PURE__ */ (0, Y.jsx)(Y.Fragment, { children: e.children.map((n, r) => /* @__PURE__ */ (0, Y.jsx)(
|
|
4886
|
+
}), e.type === "group" && O && e.children && /* @__PURE__ */ (0, Y.jsx)(Y.Fragment, { children: e.children.map((n, r) => /* @__PURE__ */ (0, Y.jsx)(Mn, {
|
|
4837
4887
|
item: n,
|
|
4838
4888
|
depth: t + 1,
|
|
4839
4889
|
index: r,
|
|
@@ -4851,7 +4901,7 @@ function jn({ item: e, depth: t, index: n, total: r, readOnly: i, onRemove: a, o
|
|
|
4851
4901
|
t: h
|
|
4852
4902
|
}, n.id)) })] });
|
|
4853
4903
|
}
|
|
4854
|
-
function
|
|
4904
|
+
function Nn({ items: e, t }) {
|
|
4855
4905
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
4856
4906
|
"data-testid": "nav-designer-preview",
|
|
4857
4907
|
className: "w-56 shrink-0 rounded-lg border border-gray-200 bg-gray-50 p-3",
|
|
@@ -4863,15 +4913,15 @@ function Mn({ items: e, t }) {
|
|
|
4863
4913
|
children: t("appDesigner.navNoPreviewItems")
|
|
4864
4914
|
}) : /* @__PURE__ */ (0, Y.jsx)("ul", {
|
|
4865
4915
|
className: "space-y-0.5",
|
|
4866
|
-
children: e.map((e) => /* @__PURE__ */ (0, Y.jsx)(
|
|
4916
|
+
children: e.map((e) => /* @__PURE__ */ (0, Y.jsx)(Pn, {
|
|
4867
4917
|
item: e,
|
|
4868
4918
|
depth: 0
|
|
4869
4919
|
}, e.id))
|
|
4870
4920
|
})]
|
|
4871
4921
|
});
|
|
4872
4922
|
}
|
|
4873
|
-
function
|
|
4874
|
-
let n =
|
|
4923
|
+
function Pn({ item: e, depth: t }) {
|
|
4924
|
+
let n = An[e.type];
|
|
4875
4925
|
return e.type === "separator" ? /* @__PURE__ */ (0, Y.jsx)("li", {
|
|
4876
4926
|
className: "my-1 border-t border-gray-200",
|
|
4877
4927
|
style: { marginLeft: t * 12 }
|
|
@@ -4882,12 +4932,12 @@ function Nn({ item: e, depth: t }) {
|
|
|
4882
4932
|
className: "truncate",
|
|
4883
4933
|
children: qe(e.label)
|
|
4884
4934
|
})]
|
|
4885
|
-
}), e.type === "group" && e.children?.map((e) => /* @__PURE__ */ (0, Y.jsx)(
|
|
4935
|
+
}), e.type === "group" && e.children?.map((e) => /* @__PURE__ */ (0, Y.jsx)(Pn, {
|
|
4886
4936
|
item: e,
|
|
4887
4937
|
depth: t + 1
|
|
4888
4938
|
}, e.id))] });
|
|
4889
4939
|
}
|
|
4890
|
-
function
|
|
4940
|
+
function Fn({ items: e, onChange: t, readOnly: n = !1, showPreview: r = !0, className: a, onExport: o, onImport: s }) {
|
|
4891
4941
|
let { t: u } = Q(), d = c(null), [f, p] = l(() => new Set(e.filter((e) => e.type === "group").map((e) => e.id))), m = i((n) => {
|
|
4892
4942
|
function r(e) {
|
|
4893
4943
|
return e.filter((e) => e.id !== n).map((e) => e.children ? {
|
|
@@ -4948,9 +4998,9 @@ function Pn({ items: e, onChange: t, readOnly: n = !1, showPreview: r = !0, clas
|
|
|
4948
4998
|
t(r(e));
|
|
4949
4999
|
}, [e, t]), y = i((n, r) => {
|
|
4950
5000
|
let i = {
|
|
4951
|
-
id:
|
|
5001
|
+
id: kn(r),
|
|
4952
5002
|
type: r,
|
|
4953
|
-
label: r === "separator" ? "" : `New ${u(
|
|
5003
|
+
label: r === "separator" ? "" : `New ${u(An[r].labelKey)}`,
|
|
4954
5004
|
...r === "group" ? { children: [] } : {},
|
|
4955
5005
|
...r === "url" ? { url: "" } : {}
|
|
4956
5006
|
};
|
|
@@ -4966,9 +5016,9 @@ function Pn({ items: e, onChange: t, readOnly: n = !1, showPreview: r = !0, clas
|
|
|
4966
5016
|
t(a(e)), p((e) => new Set(e).add(n));
|
|
4967
5017
|
}, [e, t]), b = i((n) => {
|
|
4968
5018
|
let r = {
|
|
4969
|
-
id:
|
|
5019
|
+
id: kn(n),
|
|
4970
5020
|
type: n,
|
|
4971
|
-
label: n === "separator" ? "" : `New ${u(
|
|
5021
|
+
label: n === "separator" ? "" : `New ${u(An[n].labelKey)}`,
|
|
4972
5022
|
...n === "group" ? { children: [] } : {},
|
|
4973
5023
|
...n === "url" ? { url: "" } : {}
|
|
4974
5024
|
};
|
|
@@ -5001,20 +5051,20 @@ function Pn({ items: e, onChange: t, readOnly: n = !1, showPreview: r = !0, clas
|
|
|
5001
5051
|
}, [t, s]);
|
|
5002
5052
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
5003
5053
|
"data-testid": "navigation-designer",
|
|
5004
|
-
className:
|
|
5054
|
+
className: Dn("flex flex-col gap-4 sm:flex-row", a),
|
|
5005
5055
|
children: [/* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
5006
5056
|
className: "flex-1 space-y-3",
|
|
5007
5057
|
children: [/* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
5008
5058
|
className: "flex flex-wrap items-center gap-1.5",
|
|
5009
5059
|
children: [
|
|
5010
|
-
|
|
5011
|
-
let { Icon: r, color: i } =
|
|
5060
|
+
jn.map(({ type: e, labelKey: t }) => {
|
|
5061
|
+
let { Icon: r, color: i } = An[e];
|
|
5012
5062
|
return /* @__PURE__ */ (0, Y.jsxs)("button", {
|
|
5013
5063
|
type: "button",
|
|
5014
5064
|
"data-testid": `nav-designer-add-${e}`,
|
|
5015
5065
|
onClick: () => b(e),
|
|
5016
5066
|
disabled: n,
|
|
5017
|
-
className:
|
|
5067
|
+
className: Dn("inline-flex items-center gap-1 rounded-md border border-gray-200 px-2.5 py-1 text-xs font-medium transition-colors hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50"),
|
|
5018
5068
|
children: [/* @__PURE__ */ (0, Y.jsx)(we, { className: "h-3 w-3" }), u(t)]
|
|
5019
5069
|
}, e);
|
|
5020
5070
|
}),
|
|
@@ -5028,7 +5078,7 @@ function Pn({ items: e, onChange: t, readOnly: n = !1, showPreview: r = !0, clas
|
|
|
5028
5078
|
}),
|
|
5029
5079
|
/* @__PURE__ */ (0, Y.jsxs)("label", {
|
|
5030
5080
|
"data-testid": "nav-designer-import",
|
|
5031
|
-
className:
|
|
5081
|
+
className: Dn("inline-flex cursor-pointer items-center gap-1 rounded-md border border-gray-200 px-2.5 py-1 text-xs font-medium transition-colors hover:bg-gray-50", n && "cursor-not-allowed opacity-50"),
|
|
5032
5082
|
children: [
|
|
5033
5083
|
/* @__PURE__ */ (0, Y.jsx)(ze, { className: "h-3 w-3" }),
|
|
5034
5084
|
u("appDesigner.navImportSchema"),
|
|
@@ -5050,7 +5100,7 @@ function Pn({ items: e, onChange: t, readOnly: n = !1, showPreview: r = !0, clas
|
|
|
5050
5100
|
}) : /* @__PURE__ */ (0, Y.jsx)("ul", {
|
|
5051
5101
|
className: "space-y-1",
|
|
5052
5102
|
"data-testid": "nav-designer-tree",
|
|
5053
|
-
children: e.map((t, r) => /* @__PURE__ */ (0, Y.jsx)(
|
|
5103
|
+
children: e.map((t, r) => /* @__PURE__ */ (0, Y.jsx)(Mn, {
|
|
5054
5104
|
item: t,
|
|
5055
5105
|
depth: 0,
|
|
5056
5106
|
index: r,
|
|
@@ -5068,7 +5118,7 @@ function Pn({ items: e, onChange: t, readOnly: n = !1, showPreview: r = !0, clas
|
|
|
5068
5118
|
t: u
|
|
5069
5119
|
}, t.id))
|
|
5070
5120
|
})]
|
|
5071
|
-
}), r && /* @__PURE__ */ (0, Y.jsx)(
|
|
5121
|
+
}), r && /* @__PURE__ */ (0, Y.jsx)(Nn, {
|
|
5072
5122
|
items: e,
|
|
5073
5123
|
t: u
|
|
5074
5124
|
})]
|
|
@@ -5076,10 +5126,10 @@ function Pn({ items: e, onChange: t, readOnly: n = !1, showPreview: r = !0, clas
|
|
|
5076
5126
|
}
|
|
5077
5127
|
//#endregion
|
|
5078
5128
|
//#region src/EditorModeToggle.tsx
|
|
5079
|
-
function
|
|
5129
|
+
function In(...e) {
|
|
5080
5130
|
return q(K(e));
|
|
5081
5131
|
}
|
|
5082
|
-
var
|
|
5132
|
+
var Ln = [
|
|
5083
5133
|
{
|
|
5084
5134
|
value: "edit",
|
|
5085
5135
|
label: "Edit",
|
|
@@ -5096,30 +5146,30 @@ var In = [
|
|
|
5096
5146
|
Icon: C
|
|
5097
5147
|
}
|
|
5098
5148
|
];
|
|
5099
|
-
function
|
|
5149
|
+
function Rn({ mode: e, onChange: t, disabled: n = !1, className: r }) {
|
|
5100
5150
|
return /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
5101
5151
|
"data-testid": "editor-mode-toggle",
|
|
5102
|
-
className:
|
|
5152
|
+
className: In("inline-flex items-center rounded-lg border border-gray-200 bg-gray-50 p-0.5", r),
|
|
5103
5153
|
role: "radiogroup",
|
|
5104
5154
|
"aria-label": "Editor mode",
|
|
5105
|
-
children:
|
|
5155
|
+
children: Ln.map(({ value: r, label: i, Icon: a }) => /* @__PURE__ */ (0, Y.jsxs)("button", {
|
|
5106
5156
|
type: "button",
|
|
5107
5157
|
role: "radio",
|
|
5108
5158
|
"aria-checked": e === r,
|
|
5109
5159
|
"data-testid": `editor-mode-${r}`,
|
|
5110
5160
|
onClick: () => t(r),
|
|
5111
5161
|
disabled: n,
|
|
5112
|
-
className:
|
|
5162
|
+
className: In("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors", e === r ? "bg-white text-gray-900 shadow-sm" : "text-gray-500 hover:text-gray-700", n && "cursor-not-allowed opacity-50"),
|
|
5113
5163
|
children: [/* @__PURE__ */ (0, Y.jsx)(a, { className: "h-3.5 w-3.5" }), i]
|
|
5114
5164
|
}, r))
|
|
5115
5165
|
});
|
|
5116
5166
|
}
|
|
5117
5167
|
//#endregion
|
|
5118
5168
|
//#region src/DashboardEditor.tsx
|
|
5119
|
-
function
|
|
5169
|
+
function zn(...e) {
|
|
5120
5170
|
return q(K(e));
|
|
5121
5171
|
}
|
|
5122
|
-
var
|
|
5172
|
+
var Bn = [
|
|
5123
5173
|
{
|
|
5124
5174
|
type: "metric",
|
|
5125
5175
|
label: "KPI Metric",
|
|
@@ -5150,16 +5200,16 @@ var zn = [
|
|
|
5150
5200
|
label: "Grid",
|
|
5151
5201
|
Icon: re
|
|
5152
5202
|
}
|
|
5153
|
-
],
|
|
5154
|
-
function
|
|
5155
|
-
return
|
|
5203
|
+
], Vn = 0;
|
|
5204
|
+
function Hn() {
|
|
5205
|
+
return Vn += 1, `widget_${Date.now()}_${Vn}`;
|
|
5156
5206
|
}
|
|
5157
|
-
function
|
|
5158
|
-
let l = e.type || "metric", u =
|
|
5207
|
+
function Un({ widget: e, index: t, total: n, selected: r, readOnly: i, onSelect: a, onRemove: o, onMoveUp: s, onMoveDown: c }) {
|
|
5208
|
+
let l = e.type || "metric", u = Bn.find((e) => e.type === l) || Bn[0];
|
|
5159
5209
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
5160
5210
|
"data-testid": `dashboard-widget-${e.id}`,
|
|
5161
5211
|
onClick: a,
|
|
5162
|
-
className:
|
|
5212
|
+
className: zn("group cursor-pointer rounded-lg border-2 p-3 transition-colors", r ? "border-blue-500 bg-blue-50" : "border-gray-200 hover:border-gray-300"),
|
|
5163
5213
|
children: [/* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
5164
5214
|
className: "flex items-start justify-between",
|
|
5165
5215
|
children: [/* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
@@ -5219,7 +5269,7 @@ function Hn({ widget: e, index: t, total: n, selected: r, readOnly: i, onSelect:
|
|
|
5219
5269
|
})]
|
|
5220
5270
|
});
|
|
5221
5271
|
}
|
|
5222
|
-
function
|
|
5272
|
+
function Wn({ widget: e, readOnly: t, onChange: n, onClose: r }) {
|
|
5223
5273
|
let { t: i } = Q();
|
|
5224
5274
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
5225
5275
|
"data-testid": "widget-property-panel",
|
|
@@ -5267,7 +5317,7 @@ function Un({ widget: e, readOnly: t, onChange: n, onClose: r }) {
|
|
|
5267
5317
|
onChange: (e) => n({ type: e.target.value }),
|
|
5268
5318
|
disabled: t,
|
|
5269
5319
|
className: "block w-full rounded-md border border-gray-300 px-2.5 py-1.5 text-sm outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500 disabled:bg-gray-50",
|
|
5270
|
-
children:
|
|
5320
|
+
children: Bn.map((e) => /* @__PURE__ */ (0, Y.jsx)("option", {
|
|
5271
5321
|
value: e.type,
|
|
5272
5322
|
children: e.label
|
|
5273
5323
|
}, e.type))
|
|
@@ -5444,7 +5494,7 @@ function Un({ widget: e, readOnly: t, onChange: n, onClose: r }) {
|
|
|
5444
5494
|
]
|
|
5445
5495
|
});
|
|
5446
5496
|
}
|
|
5447
|
-
function
|
|
5497
|
+
function Gn({ schema: e }) {
|
|
5448
5498
|
let { t } = Q(), n = e.widgets || [];
|
|
5449
5499
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
5450
5500
|
"data-testid": "dashboard-preview",
|
|
@@ -5459,7 +5509,7 @@ function Wn({ schema: e }) {
|
|
|
5459
5509
|
className: "grid gap-2",
|
|
5460
5510
|
style: { gridTemplateColumns: `repeat(${e.columns ?? 2}, 1fr)` },
|
|
5461
5511
|
children: n.map((e) => {
|
|
5462
|
-
let t =
|
|
5512
|
+
let t = Bn.find((t) => t.type === (e.type || "metric")) || Bn[0];
|
|
5463
5513
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
5464
5514
|
className: "rounded-md border border-gray-200 bg-white p-2",
|
|
5465
5515
|
children: [/* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
@@ -5477,17 +5527,17 @@ function Wn({ schema: e }) {
|
|
|
5477
5527
|
})]
|
|
5478
5528
|
});
|
|
5479
5529
|
}
|
|
5480
|
-
function
|
|
5530
|
+
function Kn({ schema: e, onChange: t, readOnly: n = !1, className: r, onExport: a, onImport: s, selectedWidgetId: u, onWidgetSelect: d }) {
|
|
5481
5531
|
let { t: f } = Q(), [p, m] = l(null), [h, g] = l(!1), _ = c(null), v = c(null), y = u !== void 0, b = y ? u : p, x = i((e) => {
|
|
5482
5532
|
d && d(e), y || m(e);
|
|
5483
5533
|
}, [
|
|
5484
5534
|
y,
|
|
5485
5535
|
d,
|
|
5486
5536
|
m
|
|
5487
|
-
]), { current: S, canUndo: C, canRedo: w, push: T, undo: E, redo: D } =
|
|
5537
|
+
]), { current: S, canUndo: C, canRedo: w, push: T, undo: E, redo: D } = it(e), j = i((e) => {
|
|
5488
5538
|
T(e), t(e);
|
|
5489
5539
|
}, [T, t]), M = S.widgets || [], N = M.find((e) => e.id === b), P = i((e) => {
|
|
5490
|
-
let t =
|
|
5540
|
+
let t = Hn(), n = {
|
|
5491
5541
|
id: t,
|
|
5492
5542
|
title: "",
|
|
5493
5543
|
type: e,
|
|
@@ -5593,7 +5643,7 @@ function Gn({ schema: e, onChange: t, readOnly: n = !1, className: r, onExport:
|
|
|
5593
5643
|
ref: _,
|
|
5594
5644
|
tabIndex: 0,
|
|
5595
5645
|
"data-testid": "dashboard-editor",
|
|
5596
|
-
className:
|
|
5646
|
+
className: zn("flex flex-col gap-4 outline-none", r),
|
|
5597
5647
|
children: [
|
|
5598
5648
|
/* @__PURE__ */ (0, Y.jsx)("input", {
|
|
5599
5649
|
ref: v,
|
|
@@ -5603,7 +5653,7 @@ function Gn({ schema: e, onChange: t, readOnly: n = !1, className: r, onExport:
|
|
|
5603
5653
|
"data-testid": "dashboard-import-input",
|
|
5604
5654
|
onChange: B
|
|
5605
5655
|
}),
|
|
5606
|
-
N && !h && /* @__PURE__ */ (0, Y.jsx)(
|
|
5656
|
+
N && !h && /* @__PURE__ */ (0, Y.jsx)(Wn, {
|
|
5607
5657
|
widget: N,
|
|
5608
5658
|
readOnly: n,
|
|
5609
5659
|
onChange: L,
|
|
@@ -5618,7 +5668,7 @@ function Gn({ schema: e, onChange: t, readOnly: n = !1, className: r, onExport:
|
|
|
5618
5668
|
children: [/* @__PURE__ */ (0, Y.jsxs)("span", {
|
|
5619
5669
|
className: "text-sm font-medium text-gray-700",
|
|
5620
5670
|
children: [f("appDesigner.addWidget"), ":"]
|
|
5621
|
-
}),
|
|
5671
|
+
}), Bn.map(({ type: e, label: t, Icon: r }) => /* @__PURE__ */ (0, Y.jsxs)("button", {
|
|
5622
5672
|
type: "button",
|
|
5623
5673
|
"data-testid": `dashboard-add-${e}`,
|
|
5624
5674
|
onClick: () => P(e),
|
|
@@ -5666,19 +5716,19 @@ function Gn({ schema: e, onChange: t, readOnly: n = !1, className: r, onExport:
|
|
|
5666
5716
|
type: "button",
|
|
5667
5717
|
"data-testid": "dashboard-preview-toggle",
|
|
5668
5718
|
onClick: () => g((e) => !e),
|
|
5669
|
-
className:
|
|
5719
|
+
className: zn("rounded p-1.5 transition-colors", h ? "bg-blue-100 text-blue-600" : "text-gray-400 hover:text-gray-700"),
|
|
5670
5720
|
"aria-label": f(h ? "appDesigner.modeEdit" : "appDesigner.preview"),
|
|
5671
5721
|
children: h ? /* @__PURE__ */ (0, Y.jsx)(A, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, Y.jsx)(k, { className: "h-4 w-4" })
|
|
5672
5722
|
})
|
|
5673
5723
|
]
|
|
5674
5724
|
})]
|
|
5675
|
-
}), h ? /* @__PURE__ */ (0, Y.jsx)(
|
|
5725
|
+
}), h ? /* @__PURE__ */ (0, Y.jsx)(Gn, { schema: S }) : M.length === 0 ? /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
5676
5726
|
className: "flex h-48 items-center justify-center rounded-lg border-2 border-dashed border-gray-200 text-sm text-gray-400",
|
|
5677
5727
|
children: f("appDesigner.noWidgets")
|
|
5678
5728
|
}) : /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
5679
5729
|
className: "grid gap-3",
|
|
5680
5730
|
style: { gridTemplateColumns: `repeat(${S.columns ?? 2}, 1fr)` },
|
|
5681
|
-
children: M.map((e, t) => /* @__PURE__ */ (0, Y.jsx)(
|
|
5731
|
+
children: M.map((e, t) => /* @__PURE__ */ (0, Y.jsx)(Un, {
|
|
5682
5732
|
widget: e,
|
|
5683
5733
|
index: t,
|
|
5684
5734
|
total: M.length,
|
|
@@ -5696,10 +5746,10 @@ function Gn({ schema: e, onChange: t, readOnly: n = !1, className: r, onExport:
|
|
|
5696
5746
|
}
|
|
5697
5747
|
//#endregion
|
|
5698
5748
|
//#region src/PageCanvasEditor.tsx
|
|
5699
|
-
function
|
|
5749
|
+
function qn(...e) {
|
|
5700
5750
|
return q(K(e));
|
|
5701
5751
|
}
|
|
5702
|
-
var
|
|
5752
|
+
var Jn = [
|
|
5703
5753
|
{
|
|
5704
5754
|
type: "grid",
|
|
5705
5755
|
label: "Data Grid",
|
|
@@ -5735,22 +5785,22 @@ var qn = [
|
|
|
5735
5785
|
label: "Grid Layout",
|
|
5736
5786
|
Icon: re
|
|
5737
5787
|
}
|
|
5738
|
-
],
|
|
5788
|
+
], Yn = [{
|
|
5739
5789
|
value: "page",
|
|
5740
5790
|
labelKey: "appDesigner.modePage"
|
|
5741
5791
|
}, {
|
|
5742
5792
|
value: "dashboard",
|
|
5743
5793
|
labelKey: "appDesigner.modeDashboard"
|
|
5744
|
-
}],
|
|
5745
|
-
function
|
|
5746
|
-
return
|
|
5794
|
+
}], Xn = 0;
|
|
5795
|
+
function Zn() {
|
|
5796
|
+
return Xn += 1, `component_${Date.now()}_${Xn}`;
|
|
5747
5797
|
}
|
|
5748
|
-
function
|
|
5749
|
-
let l =
|
|
5798
|
+
function Qn({ component: e, index: t, total: n, selected: r, readOnly: i, onSelect: a, onRemove: o, onMoveUp: s, onMoveDown: c }) {
|
|
5799
|
+
let l = Jn.find((t) => t.type === e.type) || Jn[0];
|
|
5750
5800
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
5751
5801
|
"data-testid": `canvas-component-${e.id}`,
|
|
5752
5802
|
onClick: a,
|
|
5753
|
-
className:
|
|
5803
|
+
className: qn("group flex cursor-pointer items-center gap-3 rounded-lg border-2 px-3 py-3 transition-colors", r ? "border-blue-500 bg-blue-50" : "border-gray-200 hover:border-gray-300"),
|
|
5754
5804
|
children: [
|
|
5755
5805
|
/* @__PURE__ */ (0, Y.jsx)(z, { className: "h-4 w-4 shrink-0 cursor-grab text-gray-300" }),
|
|
5756
5806
|
/* @__PURE__ */ (0, Y.jsx)(l.Icon, { className: "h-5 w-5 shrink-0 text-gray-500" }),
|
|
@@ -5802,7 +5852,7 @@ function Zn({ component: e, index: t, total: n, selected: r, readOnly: i, onSele
|
|
|
5802
5852
|
]
|
|
5803
5853
|
});
|
|
5804
5854
|
}
|
|
5805
|
-
function
|
|
5855
|
+
function $n({ component: e, readOnly: t, onChange: n, onClose: r }) {
|
|
5806
5856
|
let { t: i } = Q();
|
|
5807
5857
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
5808
5858
|
"data-testid": "component-property-panel",
|
|
@@ -5844,7 +5894,7 @@ function Qn({ component: e, readOnly: t, onChange: n, onClose: r }) {
|
|
|
5844
5894
|
children: "Type"
|
|
5845
5895
|
}), /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
5846
5896
|
className: "rounded-md bg-gray-50 px-2.5 py-1.5 text-sm text-gray-600",
|
|
5847
|
-
children:
|
|
5897
|
+
children: Jn.find((t) => t.type === e.type)?.label ?? e.type
|
|
5848
5898
|
})]
|
|
5849
5899
|
}),
|
|
5850
5900
|
/* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
@@ -5860,7 +5910,7 @@ function Qn({ component: e, readOnly: t, onChange: n, onClose: r }) {
|
|
|
5860
5910
|
]
|
|
5861
5911
|
});
|
|
5862
5912
|
}
|
|
5863
|
-
function
|
|
5913
|
+
function er({ schema: e, components: t }) {
|
|
5864
5914
|
let { t: n } = Q();
|
|
5865
5915
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
5866
5916
|
"data-testid": "page-preview",
|
|
@@ -5874,7 +5924,7 @@ function $n({ schema: e, components: t }) {
|
|
|
5874
5924
|
}) : /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
5875
5925
|
className: "space-y-2",
|
|
5876
5926
|
children: t.map((e) => {
|
|
5877
|
-
let t =
|
|
5927
|
+
let t = Jn.find((t) => t.type === e.type) || Jn[0];
|
|
5878
5928
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
5879
5929
|
className: "flex items-center gap-2 rounded-md border border-gray-200 bg-white p-2",
|
|
5880
5930
|
children: [
|
|
@@ -5893,13 +5943,13 @@ function $n({ schema: e, components: t }) {
|
|
|
5893
5943
|
})]
|
|
5894
5944
|
});
|
|
5895
5945
|
}
|
|
5896
|
-
function
|
|
5946
|
+
function tr({ schema: e, onChange: t, readOnly: n = !1, className: r, onExport: a, onImport: s }) {
|
|
5897
5947
|
let { t: u } = Q(), d = c(null), f = c(null), [p, m] = l(() => (e.children ? Array.isArray(e.children) ? e.children : [e.children] : []).map((e, t) => ({
|
|
5898
5948
|
id: e.id || `existing_${t}`,
|
|
5899
5949
|
type: e.type || "grid",
|
|
5900
5950
|
label: e.title || e.label || `Component ${t + 1}`,
|
|
5901
5951
|
props: e
|
|
5902
|
-
}))), [h, g] = l(null), [_, v] = l(!1), [y, b] = l("page"), x = p.find((e) => e.id === h), { canUndo: S, canRedo: C, push: w, undo: T, redo: E } =
|
|
5952
|
+
}))), [h, g] = l(null), [_, v] = l(!1), [y, b] = l("page"), x = p.find((e) => e.id === h), { canUndo: S, canRedo: C, push: w, undo: T, redo: E } = it(p), D = i((n) => {
|
|
5903
5953
|
m(n), w(n), t({
|
|
5904
5954
|
...e,
|
|
5905
5955
|
children: n.map((e) => ({
|
|
@@ -5914,10 +5964,10 @@ function er({ schema: e, onChange: t, readOnly: n = !1, className: r, onExport:
|
|
|
5914
5964
|
t,
|
|
5915
5965
|
w
|
|
5916
5966
|
]), j = i((e) => {
|
|
5917
|
-
let t =
|
|
5967
|
+
let t = Zn(), n = {
|
|
5918
5968
|
id: t,
|
|
5919
5969
|
type: e,
|
|
5920
|
-
label:
|
|
5970
|
+
label: Jn.find((t) => t.type === e)?.label || e
|
|
5921
5971
|
};
|
|
5922
5972
|
D([...p, n]), g(t);
|
|
5923
5973
|
}, [p, D]), M = i((e) => {
|
|
@@ -6002,7 +6052,7 @@ function er({ schema: e, onChange: t, readOnly: n = !1, className: r, onExport:
|
|
|
6002
6052
|
ref: d,
|
|
6003
6053
|
tabIndex: 0,
|
|
6004
6054
|
"data-testid": "page-canvas-editor",
|
|
6005
|
-
className:
|
|
6055
|
+
className: qn("flex flex-col gap-4 outline-none sm:flex-row", r),
|
|
6006
6056
|
children: [
|
|
6007
6057
|
/* @__PURE__ */ (0, Y.jsx)("input", {
|
|
6008
6058
|
ref: f,
|
|
@@ -6018,13 +6068,13 @@ function er({ schema: e, onChange: t, readOnly: n = !1, className: r, onExport:
|
|
|
6018
6068
|
/* @__PURE__ */ (0, Y.jsx)("div", {
|
|
6019
6069
|
className: "flex items-center gap-2 border-b border-gray-200 pb-2",
|
|
6020
6070
|
role: "tablist",
|
|
6021
|
-
children:
|
|
6071
|
+
children: Yn.map((e) => /* @__PURE__ */ (0, Y.jsx)("button", {
|
|
6022
6072
|
type: "button",
|
|
6023
6073
|
role: "tab",
|
|
6024
6074
|
"data-testid": `canvas-mode-${e.value}`,
|
|
6025
6075
|
"aria-selected": y === e.value,
|
|
6026
6076
|
onClick: () => b(e.value),
|
|
6027
|
-
className:
|
|
6077
|
+
className: qn("rounded-t-md px-3 py-1.5 text-xs font-medium transition-colors", y === e.value ? "border-b-2 border-blue-500 text-blue-600" : "text-gray-500 hover:text-gray-700"),
|
|
6028
6078
|
children: u(e.labelKey)
|
|
6029
6079
|
}, e.value))
|
|
6030
6080
|
}),
|
|
@@ -6035,7 +6085,7 @@ function er({ schema: e, onChange: t, readOnly: n = !1, className: r, onExport:
|
|
|
6035
6085
|
children: [/* @__PURE__ */ (0, Y.jsxs)("span", {
|
|
6036
6086
|
className: "text-sm font-medium text-gray-700",
|
|
6037
6087
|
children: [u("appDesigner.addComponent"), ":"]
|
|
6038
|
-
}),
|
|
6088
|
+
}), Jn.map(({ type: e, label: t, Icon: r }) => /* @__PURE__ */ (0, Y.jsxs)("button", {
|
|
6039
6089
|
type: "button",
|
|
6040
6090
|
"data-testid": `canvas-add-${e}`,
|
|
6041
6091
|
onClick: () => j(e),
|
|
@@ -6083,14 +6133,14 @@ function er({ schema: e, onChange: t, readOnly: n = !1, className: r, onExport:
|
|
|
6083
6133
|
type: "button",
|
|
6084
6134
|
"data-testid": "canvas-preview-toggle",
|
|
6085
6135
|
onClick: () => v((e) => !e),
|
|
6086
|
-
className:
|
|
6136
|
+
className: qn("rounded p-1.5 transition-colors", _ ? "bg-blue-100 text-blue-600" : "text-gray-400 hover:text-gray-700"),
|
|
6087
6137
|
"aria-label": u(_ ? "appDesigner.modeEdit" : "appDesigner.preview"),
|
|
6088
6138
|
children: _ ? /* @__PURE__ */ (0, Y.jsx)(A, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, Y.jsx)(k, { className: "h-4 w-4" })
|
|
6089
6139
|
})
|
|
6090
6140
|
]
|
|
6091
6141
|
})]
|
|
6092
6142
|
}),
|
|
6093
|
-
_ ? /* @__PURE__ */ (0, Y.jsx)(
|
|
6143
|
+
_ ? /* @__PURE__ */ (0, Y.jsx)(er, {
|
|
6094
6144
|
schema: e,
|
|
6095
6145
|
components: p
|
|
6096
6146
|
}) : p.length === 0 ? /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
@@ -6098,7 +6148,7 @@ function er({ schema: e, onChange: t, readOnly: n = !1, className: r, onExport:
|
|
|
6098
6148
|
children: u("appDesigner.emptyPage")
|
|
6099
6149
|
}) : /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
6100
6150
|
className: "space-y-2",
|
|
6101
|
-
children: p.map((e, t) => /* @__PURE__ */ (0, Y.jsx)(
|
|
6151
|
+
children: p.map((e, t) => /* @__PURE__ */ (0, Y.jsx)(Qn, {
|
|
6102
6152
|
component: e,
|
|
6103
6153
|
index: t,
|
|
6104
6154
|
total: p.length,
|
|
@@ -6112,7 +6162,7 @@ function er({ schema: e, onChange: t, readOnly: n = !1, className: r, onExport:
|
|
|
6112
6162
|
})
|
|
6113
6163
|
]
|
|
6114
6164
|
}),
|
|
6115
|
-
x && !_ && /* @__PURE__ */ (0, Y.jsx)(
|
|
6165
|
+
x && !_ && /* @__PURE__ */ (0, Y.jsx)($n, {
|
|
6116
6166
|
component: x,
|
|
6117
6167
|
readOnly: n,
|
|
6118
6168
|
onChange: P,
|
|
@@ -6123,10 +6173,10 @@ function er({ schema: e, onChange: t, readOnly: n = !1, className: r, onExport:
|
|
|
6123
6173
|
}
|
|
6124
6174
|
//#endregion
|
|
6125
6175
|
//#region src/ObjectViewConfigurator.tsx
|
|
6126
|
-
function
|
|
6176
|
+
function nr(...e) {
|
|
6127
6177
|
return q(K(e));
|
|
6128
6178
|
}
|
|
6129
|
-
var
|
|
6179
|
+
var rr = {
|
|
6130
6180
|
grid: {
|
|
6131
6181
|
label: "Grid",
|
|
6132
6182
|
Icon: re
|
|
@@ -6155,7 +6205,7 @@ var nr = {
|
|
|
6155
6205
|
label: "Gantt",
|
|
6156
6206
|
Icon: F
|
|
6157
6207
|
}
|
|
6158
|
-
},
|
|
6208
|
+
}, ir = [
|
|
6159
6209
|
{
|
|
6160
6210
|
value: "compact",
|
|
6161
6211
|
label: "Compact"
|
|
@@ -6169,7 +6219,7 @@ var nr = {
|
|
|
6169
6219
|
label: "Tall"
|
|
6170
6220
|
}
|
|
6171
6221
|
];
|
|
6172
|
-
function
|
|
6222
|
+
function ar({ title: e, icon: t, defaultOpen: n = !0, children: r }) {
|
|
6173
6223
|
let [i, a] = l(n);
|
|
6174
6224
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
6175
6225
|
className: "border-b border-gray-100 pb-3",
|
|
@@ -6191,7 +6241,7 @@ function ir({ title: e, icon: t, defaultOpen: n = !0, children: r }) {
|
|
|
6191
6241
|
})]
|
|
6192
6242
|
});
|
|
6193
6243
|
}
|
|
6194
|
-
function
|
|
6244
|
+
function or({ config: e, onChange: t, availableViewTypes: n = [
|
|
6195
6245
|
"grid",
|
|
6196
6246
|
"kanban",
|
|
6197
6247
|
"calendar",
|
|
@@ -6218,27 +6268,27 @@ function ar({ config: e, onChange: t, availableViewTypes: n = [
|
|
|
6218
6268
|
}, [e, o]), u = s(() => e.columns.filter((e) => e.visible).length, [e.columns]);
|
|
6219
6269
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
6220
6270
|
"data-testid": "object-view-configurator",
|
|
6221
|
-
className:
|
|
6271
|
+
className: nr("w-72 space-y-3 rounded-lg border border-gray-200 bg-white p-4", a),
|
|
6222
6272
|
children: [
|
|
6223
|
-
/* @__PURE__ */ (0, Y.jsx)(
|
|
6273
|
+
/* @__PURE__ */ (0, Y.jsx)(ar, {
|
|
6224
6274
|
title: "View Type",
|
|
6225
6275
|
icon: /* @__PURE__ */ (0, Y.jsx)(re, { className: "h-3.5 w-3.5 text-gray-500" }),
|
|
6226
6276
|
children: /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
6227
6277
|
className: "flex flex-wrap gap-1.5",
|
|
6228
6278
|
children: n.map((t) => {
|
|
6229
|
-
let { label: n, Icon: i } =
|
|
6279
|
+
let { label: n, Icon: i } = rr[t];
|
|
6230
6280
|
return /* @__PURE__ */ (0, Y.jsxs)("button", {
|
|
6231
6281
|
type: "button",
|
|
6232
6282
|
"data-testid": `view-type-${t}`,
|
|
6233
6283
|
onClick: () => o({ viewType: t }),
|
|
6234
6284
|
disabled: r,
|
|
6235
|
-
className:
|
|
6285
|
+
className: nr("inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors", e.viewType === t ? "bg-blue-100 text-blue-700" : "text-gray-600 hover:bg-gray-100", r && "cursor-not-allowed opacity-50"),
|
|
6236
6286
|
children: [/* @__PURE__ */ (0, Y.jsx)(i, { className: "h-3 w-3" }), n]
|
|
6237
6287
|
}, t);
|
|
6238
6288
|
})
|
|
6239
6289
|
})
|
|
6240
6290
|
}),
|
|
6241
|
-
/* @__PURE__ */ (0, Y.jsx)(
|
|
6291
|
+
/* @__PURE__ */ (0, Y.jsx)(ar, {
|
|
6242
6292
|
title: `Fields (${u}/${e.columns.length})`,
|
|
6243
6293
|
icon: /* @__PURE__ */ (0, Y.jsx)(w, { className: "h-3.5 w-3.5 text-gray-500" }),
|
|
6244
6294
|
children: e.columns.length === 0 ? /* @__PURE__ */ (0, Y.jsx)("p", {
|
|
@@ -6254,7 +6304,7 @@ function ar({ config: e, onChange: t, availableViewTypes: n = [
|
|
|
6254
6304
|
type: "button",
|
|
6255
6305
|
onClick: () => c(t.name),
|
|
6256
6306
|
disabled: r,
|
|
6257
|
-
className:
|
|
6307
|
+
className: nr("rounded p-0.5 transition-colors", t.visible ? "text-blue-500" : "text-gray-300"),
|
|
6258
6308
|
"aria-label": t.visible ? "Hide field" : "Show field",
|
|
6259
6309
|
children: t.visible ? /* @__PURE__ */ (0, Y.jsx)(k, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, Y.jsx)(A, { className: "h-3 w-3" })
|
|
6260
6310
|
}),
|
|
@@ -6282,7 +6332,7 @@ function ar({ config: e, onChange: t, availableViewTypes: n = [
|
|
|
6282
6332
|
}, t.name))
|
|
6283
6333
|
})
|
|
6284
6334
|
}),
|
|
6285
|
-
/* @__PURE__ */ (0, Y.jsx)(
|
|
6335
|
+
/* @__PURE__ */ (0, Y.jsx)(ar, {
|
|
6286
6336
|
title: "Toolbar",
|
|
6287
6337
|
icon: /* @__PURE__ */ (0, Y.jsx)(M, { className: "h-3.5 w-3.5 text-gray-500" }),
|
|
6288
6338
|
children: /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
@@ -6333,7 +6383,7 @@ function ar({ config: e, onChange: t, availableViewTypes: n = [
|
|
|
6333
6383
|
]
|
|
6334
6384
|
})
|
|
6335
6385
|
}),
|
|
6336
|
-
/* @__PURE__ */ (0, Y.jsx)(
|
|
6386
|
+
/* @__PURE__ */ (0, Y.jsx)(ar, {
|
|
6337
6387
|
title: "Appearance",
|
|
6338
6388
|
icon: /* @__PURE__ */ (0, Y.jsx)(Oe, { className: "h-3.5 w-3.5 text-gray-500" }),
|
|
6339
6389
|
defaultOpen: !1,
|
|
@@ -6347,12 +6397,12 @@ function ar({ config: e, onChange: t, availableViewTypes: n = [
|
|
|
6347
6397
|
children: "Row Height"
|
|
6348
6398
|
}), /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
6349
6399
|
className: "flex gap-1",
|
|
6350
|
-
children:
|
|
6400
|
+
children: ir.map(({ value: t, label: n }) => /* @__PURE__ */ (0, Y.jsx)("button", {
|
|
6351
6401
|
type: "button",
|
|
6352
6402
|
"data-testid": `view-row-height-${t}`,
|
|
6353
6403
|
onClick: () => o({ rowHeight: t }),
|
|
6354
6404
|
disabled: r,
|
|
6355
|
-
className:
|
|
6405
|
+
className: nr("flex-1 rounded px-2 py-1 text-[10px] font-medium transition-colors", e.rowHeight === t ? "bg-blue-100 text-blue-700" : "bg-gray-50 text-gray-500 hover:bg-gray-100"),
|
|
6356
6406
|
children: n
|
|
6357
6407
|
}, t))
|
|
6358
6408
|
})]
|
|
@@ -6396,7 +6446,7 @@ function ar({ config: e, onChange: t, availableViewTypes: n = [
|
|
|
6396
6446
|
function $(...e) {
|
|
6397
6447
|
return q(K(e));
|
|
6398
6448
|
}
|
|
6399
|
-
var
|
|
6449
|
+
var sr = [
|
|
6400
6450
|
{
|
|
6401
6451
|
hex: "#3b82f6",
|
|
6402
6452
|
name: "Blue"
|
|
@@ -6461,7 +6511,7 @@ var or = [
|
|
|
6461
6511
|
hex: "#0f172a",
|
|
6462
6512
|
name: "Navy"
|
|
6463
6513
|
}
|
|
6464
|
-
],
|
|
6514
|
+
], cr = [
|
|
6465
6515
|
"Inter",
|
|
6466
6516
|
"Roboto",
|
|
6467
6517
|
"Open Sans",
|
|
@@ -6472,8 +6522,8 @@ var or = [
|
|
|
6472
6522
|
"Noto Sans",
|
|
6473
6523
|
"system-ui"
|
|
6474
6524
|
];
|
|
6475
|
-
function
|
|
6476
|
-
let { t: d } = Q(), [f, p] = l("light"), { current: m, push: h, canUndo: g, canRedo: _, undo: v, redo: y } =
|
|
6525
|
+
function lr({ branding: e, onChange: t, appTitle: n = "My App", readOnly: r = !1, className: a, onExport: s, onImport: u }) {
|
|
6526
|
+
let { t: d } = Q(), [f, p] = l("light"), { current: m, push: h, canUndo: g, canRedo: _, undo: v, redo: y } = it(e), b = c(!0);
|
|
6477
6527
|
o(() => {
|
|
6478
6528
|
if (b.current) {
|
|
6479
6529
|
b.current = !1;
|
|
@@ -6646,7 +6696,7 @@ function cr({ branding: e, onChange: t, appTitle: n = "My App", readOnly: r = !1
|
|
|
6646
6696
|
}), /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
6647
6697
|
"data-testid": "branding-color-palette",
|
|
6648
6698
|
className: "flex flex-wrap gap-1.5",
|
|
6649
|
-
children:
|
|
6699
|
+
children: sr.map((e) => /* @__PURE__ */ (0, Y.jsx)("button", {
|
|
6650
6700
|
"data-testid": `branding-swatch-${e.hex.slice(1)}`,
|
|
6651
6701
|
type: "button",
|
|
6652
6702
|
onClick: () => !r && x({ primaryColor: e.hex }),
|
|
@@ -6697,7 +6747,7 @@ function cr({ branding: e, onChange: t, appTitle: n = "My App", readOnly: r = !1
|
|
|
6697
6747
|
children: [/* @__PURE__ */ (0, Y.jsx)("option", {
|
|
6698
6748
|
value: "",
|
|
6699
6749
|
children: d("appDesigner.fontDefault")
|
|
6700
|
-
}),
|
|
6750
|
+
}), cr.map((e) => /* @__PURE__ */ (0, Y.jsx)("option", {
|
|
6701
6751
|
value: e,
|
|
6702
6752
|
children: e
|
|
6703
6753
|
}, e))]
|
|
@@ -6842,15 +6892,15 @@ function cr({ branding: e, onChange: t, appTitle: n = "My App", readOnly: r = !1
|
|
|
6842
6892
|
}
|
|
6843
6893
|
//#endregion
|
|
6844
6894
|
//#region src/ObjectManager.tsx
|
|
6845
|
-
function
|
|
6895
|
+
function ur(...e) {
|
|
6846
6896
|
return q(K(e));
|
|
6847
6897
|
}
|
|
6848
|
-
var
|
|
6898
|
+
var dr = [
|
|
6849
6899
|
"Custom Objects",
|
|
6850
6900
|
"System Objects",
|
|
6851
6901
|
"Integration",
|
|
6852
6902
|
"Analytics"
|
|
6853
|
-
],
|
|
6903
|
+
], fr = [
|
|
6854
6904
|
"Box",
|
|
6855
6905
|
"Database",
|
|
6856
6906
|
"Users",
|
|
@@ -6872,8 +6922,8 @@ var ur = [
|
|
|
6872
6922
|
"Truck",
|
|
6873
6923
|
"CreditCard"
|
|
6874
6924
|
];
|
|
6875
|
-
function
|
|
6876
|
-
let { t: u } = Q(), d =
|
|
6925
|
+
function pr({ objects: e, onObjectsChange: n, onSelectObject: r, showSystemObjects: a = !0, readOnly: o = !1, className: c }) {
|
|
6926
|
+
let { t: u } = Q(), d = at(), [f, p] = l(!1), [m, h] = l(null), g = s(() => a ? e : e.filter((e) => !e.isSystem), [e, a]), _ = s(() => new t({ items: g }), [g]), v = s(() => [
|
|
6877
6927
|
{
|
|
6878
6928
|
field: "name",
|
|
6879
6929
|
label: u("appDesigner.objectManager.objectName"),
|
|
@@ -7010,7 +7060,7 @@ function fr({ objects: e, onObjectsChange: n, onSelectObject: r, showSystemObjec
|
|
|
7010
7060
|
name: "icon",
|
|
7011
7061
|
label: u("appDesigner.objectManager.icon"),
|
|
7012
7062
|
type: "select",
|
|
7013
|
-
options:
|
|
7063
|
+
options: fr.map((e) => ({
|
|
7014
7064
|
label: e,
|
|
7015
7065
|
value: e
|
|
7016
7066
|
})),
|
|
@@ -7020,7 +7070,7 @@ function fr({ objects: e, onObjectsChange: n, onSelectObject: r, showSystemObjec
|
|
|
7020
7070
|
name: "group",
|
|
7021
7071
|
label: u("appDesigner.objectManager.group"),
|
|
7022
7072
|
type: "select",
|
|
7023
|
-
options:
|
|
7073
|
+
options: dr.map((e) => ({
|
|
7024
7074
|
label: e,
|
|
7025
7075
|
value: e
|
|
7026
7076
|
})),
|
|
@@ -7062,7 +7112,7 @@ function fr({ objects: e, onObjectsChange: n, onSelectObject: r, showSystemObjec
|
|
|
7062
7112
|
]);
|
|
7063
7113
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
7064
7114
|
"data-testid": "object-manager",
|
|
7065
|
-
className:
|
|
7115
|
+
className: ur("w-full space-y-3", c),
|
|
7066
7116
|
children: [
|
|
7067
7117
|
/* @__PURE__ */ (0, Y.jsx)("div", {
|
|
7068
7118
|
className: "flex items-center justify-between",
|
|
@@ -7090,7 +7140,7 @@ function fr({ objects: e, onObjectsChange: n, onSelectObject: r, showSystemObjec
|
|
|
7090
7140
|
onAddRecord: o ? void 0 : C
|
|
7091
7141
|
}),
|
|
7092
7142
|
f && /* @__PURE__ */ (0, Y.jsx)(Qe, { schema: D }),
|
|
7093
|
-
/* @__PURE__ */ (0, Y.jsx)(
|
|
7143
|
+
/* @__PURE__ */ (0, Y.jsx)(ft, {
|
|
7094
7144
|
isOpen: d.isOpen,
|
|
7095
7145
|
title: d.title,
|
|
7096
7146
|
message: d.message,
|
|
@@ -7105,10 +7155,10 @@ function fr({ objects: e, onObjectsChange: n, onSelectObject: r, showSystemObjec
|
|
|
7105
7155
|
}
|
|
7106
7156
|
//#endregion
|
|
7107
7157
|
//#region src/FieldDesigner.tsx
|
|
7108
|
-
function
|
|
7158
|
+
function mr(...e) {
|
|
7109
7159
|
return q(K(e));
|
|
7110
7160
|
}
|
|
7111
|
-
var
|
|
7161
|
+
var hr = {
|
|
7112
7162
|
text: {
|
|
7113
7163
|
label: "Text",
|
|
7114
7164
|
Icon: Le
|
|
@@ -7217,7 +7267,7 @@ var mr = {
|
|
|
7217
7267
|
label: "Slider",
|
|
7218
7268
|
Icon: ke
|
|
7219
7269
|
}
|
|
7220
|
-
},
|
|
7270
|
+
}, gr = {
|
|
7221
7271
|
text: [
|
|
7222
7272
|
"text",
|
|
7223
7273
|
"textarea",
|
|
@@ -7252,7 +7302,7 @@ var mr = {
|
|
|
7252
7302
|
"location",
|
|
7253
7303
|
"address"
|
|
7254
7304
|
]
|
|
7255
|
-
},
|
|
7305
|
+
}, _r = [
|
|
7256
7306
|
"text",
|
|
7257
7307
|
"number",
|
|
7258
7308
|
"date",
|
|
@@ -7260,8 +7310,8 @@ var mr = {
|
|
|
7260
7310
|
"relation",
|
|
7261
7311
|
"advanced"
|
|
7262
7312
|
];
|
|
7263
|
-
function
|
|
7264
|
-
let { t: c } = Q(), u =
|
|
7313
|
+
function vr({ objectName: e, fields: n, onFieldsChange: r, readOnly: a = !1, className: o }) {
|
|
7314
|
+
let { t: c } = Q(), u = at(), [d, f] = l(!1), [p, m] = l(null), [h, g] = l(""), _ = s(() => h ? n.filter((e) => e.type === h) : n, [n, h]), v = s(() => new t({ items: _ }), [_]), y = s(() => [
|
|
7265
7315
|
{
|
|
7266
7316
|
field: "name",
|
|
7267
7317
|
label: c("appDesigner.fieldDesigner.fieldName"),
|
|
@@ -7372,11 +7422,11 @@ function _r({ objectName: e, fields: n, onFieldsChange: r, readOnly: a = !1, cla
|
|
|
7372
7422
|
r
|
|
7373
7423
|
]), E = i((e) => {
|
|
7374
7424
|
e || (f(!1), m(null));
|
|
7375
|
-
}, []), D = s(() =>
|
|
7425
|
+
}, []), D = s(() => _r.map((e) => ({
|
|
7376
7426
|
category: e,
|
|
7377
7427
|
label: c(`appDesigner.fieldDesigner.typeCategory.${e}`),
|
|
7378
|
-
options:
|
|
7379
|
-
label:
|
|
7428
|
+
options: gr[e].map((e) => ({
|
|
7429
|
+
label: hr[e].label,
|
|
7380
7430
|
value: e
|
|
7381
7431
|
}))
|
|
7382
7432
|
})), [c]), O = s(() => D.flatMap((e) => e.options), [D]), k = s(() => ({
|
|
@@ -7562,7 +7612,7 @@ function _r({ objectName: e, fields: n, onFieldsChange: r, readOnly: a = !1, cla
|
|
|
7562
7612
|
]);
|
|
7563
7613
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
7564
7614
|
"data-testid": "field-designer",
|
|
7565
|
-
className:
|
|
7615
|
+
className: mr("w-full space-y-3", o),
|
|
7566
7616
|
children: [
|
|
7567
7617
|
/* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
7568
7618
|
className: "flex items-center justify-between",
|
|
@@ -7608,7 +7658,7 @@ function _r({ objectName: e, fields: n, onFieldsChange: r, readOnly: a = !1, cla
|
|
|
7608
7658
|
onAddRecord: a ? void 0 : C
|
|
7609
7659
|
}),
|
|
7610
7660
|
d && /* @__PURE__ */ (0, Y.jsx)(Ze, { schema: k }),
|
|
7611
|
-
/* @__PURE__ */ (0, Y.jsx)(
|
|
7661
|
+
/* @__PURE__ */ (0, Y.jsx)(ft, {
|
|
7612
7662
|
isOpen: u.isOpen,
|
|
7613
7663
|
title: u.title,
|
|
7614
7664
|
message: u.message,
|
|
@@ -7623,12 +7673,12 @@ function _r({ objectName: e, fields: n, onFieldsChange: r, readOnly: a = !1, cla
|
|
|
7623
7673
|
}
|
|
7624
7674
|
//#endregion
|
|
7625
7675
|
//#region src/components/VersionHistory.tsx
|
|
7626
|
-
function
|
|
7676
|
+
function yr(...e) {
|
|
7627
7677
|
return q(K(e));
|
|
7628
7678
|
}
|
|
7629
|
-
function
|
|
7679
|
+
function br({ versions: e, onRestore: t, className: n }) {
|
|
7630
7680
|
return /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
7631
|
-
className:
|
|
7681
|
+
className: yr("flex flex-col", n),
|
|
7632
7682
|
role: "region",
|
|
7633
7683
|
"aria-label": "Version history",
|
|
7634
7684
|
children: [/* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
@@ -7642,8 +7692,8 @@ function yr({ versions: e, onRestore: t, className: n }) {
|
|
|
7642
7692
|
}) : /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
7643
7693
|
className: "relative",
|
|
7644
7694
|
children: [/* @__PURE__ */ (0, Y.jsx)("div", { className: "absolute left-5 top-0 bottom-0 w-px bg-border" }), e.map((e) => /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
7645
|
-
className:
|
|
7646
|
-
children: [/* @__PURE__ */ (0, Y.jsx)("div", { className:
|
|
7695
|
+
className: yr("relative flex items-start gap-3 px-3 py-2 hover:bg-accent/50", e.isCurrent && "bg-accent/30"),
|
|
7696
|
+
children: [/* @__PURE__ */ (0, Y.jsx)("div", { className: yr("relative z-10 mt-1 h-2.5 w-2.5 rounded-full border-2 bg-background", e.isCurrent ? "border-primary" : "border-muted-foreground") }), /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
7647
7697
|
className: "flex-1 min-w-0",
|
|
7648
7698
|
children: [
|
|
7649
7699
|
/* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
@@ -7683,8 +7733,8 @@ function yr({ versions: e, onRestore: t, className: n }) {
|
|
|
7683
7733
|
}
|
|
7684
7734
|
//#endregion
|
|
7685
7735
|
//#region src/pages/CreateAppPage.tsx
|
|
7686
|
-
var
|
|
7687
|
-
function
|
|
7736
|
+
var xr = "objectui-app-wizard-draft";
|
|
7737
|
+
function Sr() {
|
|
7688
7738
|
let e = $e(), { appName: t } = et(), { objects: n, refresh: r } = Ye(), a = Je(), o = (n || []).map((e) => ({
|
|
7689
7739
|
name: e.name,
|
|
7690
7740
|
label: e.label || e.name,
|
|
@@ -7692,13 +7742,13 @@ function xr() {
|
|
|
7692
7742
|
selected: !1
|
|
7693
7743
|
})), s = i(() => {
|
|
7694
7744
|
try {
|
|
7695
|
-
let e = localStorage.getItem(
|
|
7745
|
+
let e = localStorage.getItem(xr);
|
|
7696
7746
|
if (e) return JSON.parse(e);
|
|
7697
7747
|
} catch {}
|
|
7698
7748
|
}, []), c = i(async (t) => {
|
|
7699
7749
|
try {
|
|
7700
7750
|
let n = Ke(t), i = a?.getClient();
|
|
7701
|
-
i && await i.meta.saveItem("app", t.name, n), localStorage.removeItem(
|
|
7751
|
+
i && await i.meta.saveItem("app", t.name, n), localStorage.removeItem(xr), J.success(`Application "${t.title}" created successfully`), await r?.(), e(`/apps/${t.name}`);
|
|
7702
7752
|
} catch (e) {
|
|
7703
7753
|
J.error(e?.message || "Failed to create application");
|
|
7704
7754
|
}
|
|
@@ -7710,13 +7760,13 @@ function xr() {
|
|
|
7710
7760
|
e(t ? `/apps/${t}` : "/");
|
|
7711
7761
|
}, [e, t]), u = i((e) => {
|
|
7712
7762
|
try {
|
|
7713
|
-
localStorage.setItem(
|
|
7763
|
+
localStorage.setItem(xr, JSON.stringify(e)), J.info("Draft saved");
|
|
7714
7764
|
} catch {}
|
|
7715
7765
|
}, []);
|
|
7716
7766
|
return /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
7717
7767
|
className: "mx-auto max-w-4xl py-8 px-4",
|
|
7718
7768
|
"data-testid": "create-app-page",
|
|
7719
|
-
children: /* @__PURE__ */ (0, Y.jsx)(
|
|
7769
|
+
children: /* @__PURE__ */ (0, Y.jsx)(En, {
|
|
7720
7770
|
availableObjects: o,
|
|
7721
7771
|
initialDraft: s(),
|
|
7722
7772
|
onComplete: c,
|
|
@@ -7727,7 +7777,7 @@ function xr() {
|
|
|
7727
7777
|
}
|
|
7728
7778
|
//#endregion
|
|
7729
7779
|
//#region src/pages/EditAppPage.tsx
|
|
7730
|
-
function
|
|
7780
|
+
function Cr() {
|
|
7731
7781
|
let e = $e(), { appName: t, editAppName: n } = et(), { apps: r, objects: a, refresh: o } = Ye(), c = Je(), l = n || t, u = r.find((e) => e.name === l), d = (a || []).map((e) => ({
|
|
7732
7782
|
name: e.name,
|
|
7733
7783
|
label: e.label || e.name,
|
|
@@ -7772,7 +7822,7 @@ function Sr() {
|
|
|
7772
7822
|
return u ? /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
7773
7823
|
className: "mx-auto max-w-4xl py-8 px-4",
|
|
7774
7824
|
"data-testid": "edit-app-page",
|
|
7775
|
-
children: /* @__PURE__ */ (0, Y.jsx)(
|
|
7825
|
+
children: /* @__PURE__ */ (0, Y.jsx)(En, {
|
|
7776
7826
|
availableObjects: d,
|
|
7777
7827
|
initialDraft: f,
|
|
7778
7828
|
onComplete: p,
|
|
@@ -7794,7 +7844,7 @@ function Sr() {
|
|
|
7794
7844
|
}
|
|
7795
7845
|
//#endregion
|
|
7796
7846
|
//#region src/pages/PageDesignPage.tsx
|
|
7797
|
-
function
|
|
7847
|
+
function wr() {
|
|
7798
7848
|
let e = $e(), { pageName: t } = et(), n = Je(), { pages: r } = Ye(), a = r?.find((e) => e.name === t), [s, u] = l(() => a || {
|
|
7799
7849
|
type: "page",
|
|
7800
7850
|
name: t ?? "",
|
|
@@ -7842,7 +7892,7 @@ function Cr() {
|
|
|
7842
7892
|
})]
|
|
7843
7893
|
}), /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
7844
7894
|
className: "flex-1 overflow-auto p-4 sm:p-6",
|
|
7845
|
-
children: /* @__PURE__ */ (0, Y.jsx)(
|
|
7895
|
+
children: /* @__PURE__ */ (0, Y.jsx)(tr, {
|
|
7846
7896
|
schema: s,
|
|
7847
7897
|
onChange: m,
|
|
7848
7898
|
onExport: h,
|
|
@@ -7860,7 +7910,7 @@ function Cr() {
|
|
|
7860
7910
|
}
|
|
7861
7911
|
//#endregion
|
|
7862
7912
|
//#region src/pages/DashboardDesignPage.tsx
|
|
7863
|
-
function
|
|
7913
|
+
function Tr() {
|
|
7864
7914
|
let e = $e(), { dashboardName: t } = et(), n = Je(), { dashboards: r, refresh: a } = Ye(), s = r?.find((e) => e.name === t), [u, f] = l(() => s || {
|
|
7865
7915
|
type: "dashboard",
|
|
7866
7916
|
name: t ?? "",
|
|
@@ -7913,7 +7963,7 @@ function wr() {
|
|
|
7913
7963
|
})]
|
|
7914
7964
|
}), /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
7915
7965
|
className: "flex-1 overflow-auto p-4 sm:p-6",
|
|
7916
|
-
children: /* @__PURE__ */ (0, Y.jsx)(
|
|
7966
|
+
children: /* @__PURE__ */ (0, Y.jsx)(Kn, {
|
|
7917
7967
|
schema: u,
|
|
7918
7968
|
onChange: h,
|
|
7919
7969
|
onExport: g,
|
|
@@ -7929,7 +7979,7 @@ function wr() {
|
|
|
7929
7979
|
]
|
|
7930
7980
|
});
|
|
7931
7981
|
}
|
|
7932
|
-
e.register("page-designer",
|
|
7982
|
+
e.register("page-designer", wt, {
|
|
7933
7983
|
label: "Page Designer",
|
|
7934
7984
|
category: "Designer",
|
|
7935
7985
|
inputs: [
|
|
@@ -7962,7 +8012,7 @@ e.register("page-designer", Ct, {
|
|
|
7962
8012
|
defaultValue: !1
|
|
7963
8013
|
}
|
|
7964
8014
|
]
|
|
7965
|
-
}), e.register("data-model-designer",
|
|
8015
|
+
}), e.register("data-model-designer", At, {
|
|
7966
8016
|
label: "Data Model Designer",
|
|
7967
8017
|
category: "Designer",
|
|
7968
8018
|
inputs: [
|
|
@@ -7989,7 +8039,7 @@ e.register("page-designer", Ct, {
|
|
|
7989
8039
|
defaultValue: !1
|
|
7990
8040
|
}
|
|
7991
8041
|
]
|
|
7992
|
-
}), e.register("process-designer",
|
|
8042
|
+
}), e.register("process-designer", Ft, {
|
|
7993
8043
|
label: "Process Designer (BPMN)",
|
|
7994
8044
|
category: "Designer",
|
|
7995
8045
|
inputs: [
|
|
@@ -8027,7 +8077,7 @@ e.register("page-designer", Ct, {
|
|
|
8027
8077
|
defaultValue: !1
|
|
8028
8078
|
}
|
|
8029
8079
|
]
|
|
8030
|
-
}), e.register("report-designer",
|
|
8080
|
+
}), e.register("report-designer", zt, {
|
|
8031
8081
|
label: "Report Designer",
|
|
8032
8082
|
category: "Designer",
|
|
8033
8083
|
inputs: [
|
|
@@ -8065,7 +8115,7 @@ e.register("page-designer", Ct, {
|
|
|
8065
8115
|
defaultValue: !1
|
|
8066
8116
|
}
|
|
8067
8117
|
]
|
|
8068
|
-
}), e.register("app-creation-wizard",
|
|
8118
|
+
}), e.register("app-creation-wizard", En, {
|
|
8069
8119
|
label: "App Creation Wizard",
|
|
8070
8120
|
category: "Designer",
|
|
8071
8121
|
inputs: [
|
|
@@ -8086,7 +8136,7 @@ e.register("page-designer", Ct, {
|
|
|
8086
8136
|
defaultValue: !1
|
|
8087
8137
|
}
|
|
8088
8138
|
]
|
|
8089
|
-
}), e.register("navigation-designer",
|
|
8139
|
+
}), e.register("navigation-designer", Fn, {
|
|
8090
8140
|
label: "Navigation Designer",
|
|
8091
8141
|
category: "Designer",
|
|
8092
8142
|
inputs: [
|
|
@@ -8108,7 +8158,7 @@ e.register("page-designer", Ct, {
|
|
|
8108
8158
|
defaultValue: !1
|
|
8109
8159
|
}
|
|
8110
8160
|
]
|
|
8111
|
-
}), e.register("dashboard-editor",
|
|
8161
|
+
}), e.register("dashboard-editor", Kn, {
|
|
8112
8162
|
label: "Dashboard Editor",
|
|
8113
8163
|
category: "Designer",
|
|
8114
8164
|
inputs: [{
|
|
@@ -8121,7 +8171,7 @@ e.register("page-designer", Ct, {
|
|
|
8121
8171
|
label: "Read Only",
|
|
8122
8172
|
defaultValue: !1
|
|
8123
8173
|
}]
|
|
8124
|
-
}), e.register("page-canvas-editor",
|
|
8174
|
+
}), e.register("page-canvas-editor", tr, {
|
|
8125
8175
|
label: "Page Canvas Editor",
|
|
8126
8176
|
category: "Designer",
|
|
8127
8177
|
inputs: [{
|
|
@@ -8134,7 +8184,7 @@ e.register("page-designer", Ct, {
|
|
|
8134
8184
|
label: "Read Only",
|
|
8135
8185
|
defaultValue: !1
|
|
8136
8186
|
}]
|
|
8137
|
-
}), e.register("object-view-configurator",
|
|
8187
|
+
}), e.register("object-view-configurator", or, {
|
|
8138
8188
|
label: "Object View Configurator",
|
|
8139
8189
|
category: "Designer",
|
|
8140
8190
|
inputs: [{
|
|
@@ -8147,7 +8197,7 @@ e.register("page-designer", Ct, {
|
|
|
8147
8197
|
label: "Read Only",
|
|
8148
8198
|
defaultValue: !1
|
|
8149
8199
|
}]
|
|
8150
|
-
}), e.register("branding-editor",
|
|
8200
|
+
}), e.register("branding-editor", lr, {
|
|
8151
8201
|
label: "Branding Editor",
|
|
8152
8202
|
category: "Designer",
|
|
8153
8203
|
inputs: [
|
|
@@ -8168,7 +8218,7 @@ e.register("page-designer", Ct, {
|
|
|
8168
8218
|
defaultValue: !1
|
|
8169
8219
|
}
|
|
8170
8220
|
]
|
|
8171
|
-
}), e.register("object-manager",
|
|
8221
|
+
}), e.register("object-manager", pr, {
|
|
8172
8222
|
label: "Object Manager",
|
|
8173
8223
|
category: "Designer",
|
|
8174
8224
|
inputs: [
|
|
@@ -8190,7 +8240,7 @@ e.register("page-designer", Ct, {
|
|
|
8190
8240
|
defaultValue: !1
|
|
8191
8241
|
}
|
|
8192
8242
|
]
|
|
8193
|
-
}), e.register("field-designer",
|
|
8243
|
+
}), e.register("field-designer", vr, {
|
|
8194
8244
|
label: "Field Designer",
|
|
8195
8245
|
category: "Designer",
|
|
8196
8246
|
inputs: [
|
|
@@ -8213,4 +8263,4 @@ e.register("page-designer", Ct, {
|
|
|
8213
8263
|
]
|
|
8214
8264
|
});
|
|
8215
8265
|
//#endregion
|
|
8216
|
-
export {
|
|
8266
|
+
export { En as AppCreationWizard, lr as BrandingEditor, bt as CollaborationProvider, ft as ConfirmDialog, St as ConnectionStatusIndicator, Sr as CreateAppPage, Tr as DashboardDesignPage, Kn as DashboardEditor, At as DataModelDesigner, Cr as EditAppPage, Rn as EditorModeToggle, vr as FieldDesigner, _t as Minimap, Fn as NavigationDesigner, pr as ObjectManager, or as ObjectViewConfigurator, tr as PageCanvasEditor, wr as PageDesignPage, wt as PageDesigner, Ft as ProcessDesigner, mt as PropertyEditor, zt as ReportDesigner, br as VersionHistory, ct as useCanvasPanZoom, st as useClipboard, at as useConfirmDialog, Et as useDesignerHistory, ot as useMultiSelect, it as useUndoRedo };
|