@object-ui/plugin-designer 17.2.0 → 17.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +431 -0
- package/README.md +1 -12
- package/dist/DashboardEditor.d.ts.map +1 -1
- package/dist/hooks/useDesignerTranslation.d.ts +15 -0
- package/dist/hooks/useDesignerTranslation.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +369 -293
- package/dist/index.umd.cjs +2 -2
- package/dist/pages/DashboardDesignPage.d.ts.map +1 -1
- package/package.json +16 -16
package/dist/index.js
CHANGED
|
@@ -4,20 +4,20 @@ import { AlertTriangle as u, ArrowLeft as d, AtSign as f, BarChart3 as p, Calend
|
|
|
4
4
|
import { clsx as G } from "clsx";
|
|
5
5
|
import { twMerge as K } from "tailwind-merge";
|
|
6
6
|
import { Fragment as q, jsx as J, jsxs as Y } from "react/jsx-runtime";
|
|
7
|
-
import { DESIGNER_FIELD_TYPES as Ve, isValidAppName as He,
|
|
8
|
-
import {
|
|
9
|
-
import { createSafeTranslation as
|
|
10
|
-
import { ObjectGrid as
|
|
11
|
-
import { DrawerForm as
|
|
12
|
-
import { useNavigate as
|
|
13
|
-
import { toast as
|
|
14
|
-
import { MetadataClient as
|
|
7
|
+
import { DESIGNER_FIELD_TYPES as Ve, isValidAppName as He, liftLegacyDashboardFilterDefaults as Ue, wizardDraftToAppSchema as We } from "@object-ui/types";
|
|
8
|
+
import { resolveKeyedI18nLabel as Ge, useAdapter as Ke, useMetadata as qe } from "@object-ui/react";
|
|
9
|
+
import { createSafeTranslation as Je, pickLocalized as Ye } from "@object-ui/i18n";
|
|
10
|
+
import { ObjectGrid as Xe } from "@object-ui/plugin-grid";
|
|
11
|
+
import { DrawerForm as Ze, ModalForm as Qe } from "@object-ui/plugin-form";
|
|
12
|
+
import { useNavigate as $e, useParams as et } from "react-router-dom";
|
|
13
|
+
import { toast as tt } from "sonner";
|
|
14
|
+
import { MetadataClient as nt } from "@object-ui/data-objectstack";
|
|
15
15
|
//#region src/hooks/useUndoRedo.ts
|
|
16
|
-
function
|
|
16
|
+
function rt(e) {
|
|
17
17
|
return e || (typeof window < "u" && window.sessionStorage ? window.sessionStorage : null);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
let { maxHistory: n = 50, persistKey: r, storage: a } = t, s =
|
|
19
|
+
function it(e, t = {}) {
|
|
20
|
+
let { maxHistory: n = 50, persistKey: r, storage: a } = t, s = rt(a), u = (() => {
|
|
21
21
|
if (!r || !s) return null;
|
|
22
22
|
try {
|
|
23
23
|
let e = s.getItem(r);
|
|
@@ -93,7 +93,7 @@ function nt(e, t = {}) {
|
|
|
93
93
|
}
|
|
94
94
|
//#endregion
|
|
95
95
|
//#region src/hooks/useConfirmDialog.ts
|
|
96
|
-
function
|
|
96
|
+
function at() {
|
|
97
97
|
let [e, t] = l(!1), [n, r] = l(""), [a, o] = l(""), s = c(null);
|
|
98
98
|
return {
|
|
99
99
|
isOpen: e,
|
|
@@ -112,7 +112,7 @@ function rt() {
|
|
|
112
112
|
}
|
|
113
113
|
//#endregion
|
|
114
114
|
//#region src/hooks/useMultiSelect.ts
|
|
115
|
-
function
|
|
115
|
+
function ot() {
|
|
116
116
|
let [e, t] = l(/* @__PURE__ */ new Set());
|
|
117
117
|
return {
|
|
118
118
|
selectedIds: e,
|
|
@@ -137,7 +137,7 @@ function it() {
|
|
|
137
137
|
}
|
|
138
138
|
//#endregion
|
|
139
139
|
//#region src/hooks/useClipboard.ts
|
|
140
|
-
function
|
|
140
|
+
function st() {
|
|
141
141
|
let [e, t] = l(null);
|
|
142
142
|
return {
|
|
143
143
|
clipboard: e,
|
|
@@ -150,7 +150,7 @@ function at() {
|
|
|
150
150
|
}
|
|
151
151
|
//#endregion
|
|
152
152
|
//#region src/hooks/useCanvasPanZoom.ts
|
|
153
|
-
function
|
|
153
|
+
function ct(e = {}) {
|
|
154
154
|
let { minZoom: t = .25, maxZoom: n = 3, zoomStep: r = .1, initialZoom: a = 1 } = e, [o, s] = l(a), [u, d] = l({
|
|
155
155
|
x: 0,
|
|
156
156
|
y: 0
|
|
@@ -207,10 +207,10 @@ function ot(e = {}) {
|
|
|
207
207
|
}
|
|
208
208
|
//#endregion
|
|
209
209
|
//#region src/components/ConfirmDialog.tsx
|
|
210
|
-
function
|
|
210
|
+
function lt(...e) {
|
|
211
211
|
return K(G(e));
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function ut({ isOpen: e, title: t, message: n, confirmLabel: r = "Delete", cancelLabel: i = "Cancel", destructive: a = !0, onConfirm: s, onCancel: l }) {
|
|
214
214
|
let d = c(null);
|
|
215
215
|
return o(() => {
|
|
216
216
|
let t = d.current;
|
|
@@ -243,12 +243,14 @@ function ct({ isOpen: e, title: t, message: n, confirmLabel: r = "Delete", cance
|
|
|
243
243
|
/* @__PURE__ */ Y("div", {
|
|
244
244
|
className: "flex justify-end gap-2",
|
|
245
245
|
children: [/* @__PURE__ */ J("button", {
|
|
246
|
+
type: "button",
|
|
246
247
|
onClick: l,
|
|
247
248
|
className: "px-4 py-2 text-sm rounded-md border hover:bg-accent",
|
|
248
249
|
children: i
|
|
249
250
|
}), /* @__PURE__ */ J("button", {
|
|
251
|
+
type: "button",
|
|
250
252
|
onClick: s,
|
|
251
|
-
className:
|
|
253
|
+
className: lt("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"),
|
|
252
254
|
autoFocus: !0,
|
|
253
255
|
children: r
|
|
254
256
|
})]
|
|
@@ -259,10 +261,10 @@ function ct({ isOpen: e, title: t, message: n, confirmLabel: r = "Delete", cance
|
|
|
259
261
|
}
|
|
260
262
|
//#endregion
|
|
261
263
|
//#region src/components/PropertyEditor.tsx
|
|
262
|
-
function
|
|
264
|
+
function dt(...e) {
|
|
263
265
|
return K(G(e));
|
|
264
266
|
}
|
|
265
|
-
function
|
|
267
|
+
function ft({ title: e = "Properties", fields: t, onChange: n, className: r }) {
|
|
266
268
|
let [a, o] = l(/* @__PURE__ */ new Set()), s = i((e) => {
|
|
267
269
|
o((t) => {
|
|
268
270
|
let n = new Set(t);
|
|
@@ -273,7 +275,7 @@ function ut({ title: e = "Properties", fields: t, onChange: n, className: r }) {
|
|
|
273
275
|
return e[n] || (e[n] = []), e[n].push(t), e;
|
|
274
276
|
}, {});
|
|
275
277
|
return /* @__PURE__ */ Y("div", {
|
|
276
|
-
className:
|
|
278
|
+
className: dt("flex flex-col", r),
|
|
277
279
|
role: "region",
|
|
278
280
|
"aria-label": e,
|
|
279
281
|
children: [/* @__PURE__ */ J("div", {
|
|
@@ -284,12 +286,13 @@ function ut({ title: e = "Properties", fields: t, onChange: n, className: r }) {
|
|
|
284
286
|
children: [Object.entries(c).map(([e, t]) => /* @__PURE__ */ Y("div", {
|
|
285
287
|
className: "border-b last:border-b-0",
|
|
286
288
|
children: [/* @__PURE__ */ Y("button", {
|
|
289
|
+
type: "button",
|
|
287
290
|
onClick: () => s(e),
|
|
288
291
|
className: "w-full flex items-center gap-1 px-3 py-2 text-xs font-medium text-muted-foreground hover:bg-accent/50",
|
|
289
292
|
children: [a.has(e) ? /* @__PURE__ */ J(v, { className: "h-3 w-3" }) : /* @__PURE__ */ J(g, { className: "h-3 w-3" }), e]
|
|
290
293
|
}), !a.has(e) && /* @__PURE__ */ J("div", {
|
|
291
294
|
className: "px-3 pb-2 space-y-2",
|
|
292
|
-
children: t.map((e) => /* @__PURE__ */ J(
|
|
295
|
+
children: t.map((e) => /* @__PURE__ */ J(pt, {
|
|
293
296
|
field: e,
|
|
294
297
|
onChange: n
|
|
295
298
|
}, e.name))
|
|
@@ -301,7 +304,7 @@ function ut({ title: e = "Properties", fields: t, onChange: n, className: r }) {
|
|
|
301
304
|
})]
|
|
302
305
|
});
|
|
303
306
|
}
|
|
304
|
-
function
|
|
307
|
+
function pt({ field: e, onChange: t }) {
|
|
305
308
|
let n = (n) => {
|
|
306
309
|
t(e.name, n);
|
|
307
310
|
};
|
|
@@ -372,13 +375,13 @@ function dt({ field: e, onChange: t }) {
|
|
|
372
375
|
}
|
|
373
376
|
//#endregion
|
|
374
377
|
//#region src/components/Minimap.tsx
|
|
375
|
-
function
|
|
378
|
+
function mt(...e) {
|
|
376
379
|
return K(G(e));
|
|
377
380
|
}
|
|
378
|
-
function
|
|
381
|
+
function ht({ items: e, canvasWidth: t, canvasHeight: n, position: r = "bottom-right", size: i = 150, className: a }) {
|
|
379
382
|
let o = Math.min(i / t, i / n), s = t * o, c = n * o;
|
|
380
383
|
return /* @__PURE__ */ J("div", {
|
|
381
|
-
className:
|
|
384
|
+
className: mt("absolute border rounded bg-background/90 shadow-sm overflow-hidden", {
|
|
382
385
|
"top-left": "top-2 left-2",
|
|
383
386
|
"top-right": "top-2 right-2",
|
|
384
387
|
"bottom-left": "bottom-2 left-2",
|
|
@@ -408,12 +411,12 @@ function pt({ items: e, canvasWidth: t, canvasHeight: n, position: r = "bottom-r
|
|
|
408
411
|
}
|
|
409
412
|
//#endregion
|
|
410
413
|
//#region src/CollaborationProvider.tsx
|
|
411
|
-
function
|
|
414
|
+
function gt(...e) {
|
|
412
415
|
return K(G(e));
|
|
413
416
|
}
|
|
414
|
-
var
|
|
415
|
-
|
|
416
|
-
function
|
|
417
|
+
var _t = r(null);
|
|
418
|
+
_t.displayName = "CollaborationContext";
|
|
419
|
+
function vt({ config: e, user: t, onOperation: n, onPresenceChange: r, children: a }) {
|
|
417
420
|
let u = c(null), [d, f] = l([]), [p, m] = l("disconnected"), h = c(0), g = c(null);
|
|
418
421
|
o(() => {
|
|
419
422
|
if (!e.enabled || !t || !e.serverUrl || !(typeof WebSocket < "u")) return;
|
|
@@ -463,7 +466,7 @@ function gt({ config: e, user: t, onOperation: n, onPresenceChange: r, children:
|
|
|
463
466
|
userId: t.id,
|
|
464
467
|
userName: t.name,
|
|
465
468
|
avatar: t.avatar,
|
|
466
|
-
color:
|
|
469
|
+
color: xt(t.id),
|
|
467
470
|
status: "active",
|
|
468
471
|
lastActivity: (/* @__PURE__ */ new Date()).toISOString()
|
|
469
472
|
}, ...d], [
|
|
@@ -502,16 +505,16 @@ function gt({ config: e, user: t, onOperation: n, onPresenceChange: r, children:
|
|
|
502
505
|
t?.id,
|
|
503
506
|
p
|
|
504
507
|
]);
|
|
505
|
-
return /* @__PURE__ */ J(
|
|
508
|
+
return /* @__PURE__ */ J(_t.Provider, {
|
|
506
509
|
value: b,
|
|
507
510
|
children: a
|
|
508
511
|
});
|
|
509
512
|
}
|
|
510
|
-
function
|
|
511
|
-
return a(
|
|
513
|
+
function yt() {
|
|
514
|
+
return a(_t);
|
|
512
515
|
}
|
|
513
|
-
function
|
|
514
|
-
let t = a(
|
|
516
|
+
function bt({ className: e }) {
|
|
517
|
+
let t = a(_t);
|
|
515
518
|
if (!t) return null;
|
|
516
519
|
let { connectionState: n, users: r } = t, i = {
|
|
517
520
|
connected: {
|
|
@@ -532,7 +535,7 @@ function vt({ className: e }) {
|
|
|
532
535
|
}
|
|
533
536
|
}, { color: o, label: s } = i[n] ?? i.disconnected;
|
|
534
537
|
return /* @__PURE__ */ Y("div", {
|
|
535
|
-
className:
|
|
538
|
+
className: gt("flex items-center gap-2 text-xs", e),
|
|
536
539
|
role: "status",
|
|
537
540
|
"aria-live": "polite",
|
|
538
541
|
"aria-label": `Collaboration: ${s}`,
|
|
@@ -550,7 +553,7 @@ function vt({ className: e }) {
|
|
|
550
553
|
]
|
|
551
554
|
});
|
|
552
555
|
}
|
|
553
|
-
function
|
|
556
|
+
function xt(e) {
|
|
554
557
|
let t = [
|
|
555
558
|
"#3b82f6",
|
|
556
559
|
"#ef4444",
|
|
@@ -577,19 +580,19 @@ function yt(e) {
|
|
|
577
580
|
function X(...e) {
|
|
578
581
|
return K(G(e));
|
|
579
582
|
}
|
|
580
|
-
function
|
|
583
|
+
function St({ canvas: e = {
|
|
581
584
|
width: 1200,
|
|
582
585
|
height: 800,
|
|
583
586
|
gridSize: 8,
|
|
584
587
|
showGrid: !0,
|
|
585
588
|
snapToGrid: !0
|
|
586
|
-
}, components: t = [], palette: n =
|
|
587
|
-
let h =
|
|
589
|
+
}, components: t = [], palette: n = Ct, showComponentTree: r = !0, undoRedo: a = !0, propertyEditor: u = !0, readOnly: d = !1, showMinimap: f = !1, onChange: p, className: m }) {
|
|
590
|
+
let h = it(t), g = h.current, _ = i((e) => {
|
|
588
591
|
h.push(e), p?.(e);
|
|
589
|
-
}, [h, p]), v =
|
|
592
|
+
}, [h, p]), v = ct({ initialZoom: e.zoom ?? 1 }), { zoom: y } = v, x = ot(), S = s(() => {
|
|
590
593
|
let e = Array.from(x.selectedIds);
|
|
591
594
|
return e.length > 0 ? e[0] : null;
|
|
592
|
-
}, [x.selectedIds]), C = s(() => g.find((e) => e.id === S), [g, S]), T =
|
|
595
|
+
}, [x.selectedIds]), C = s(() => g.find((e) => e.id === S), [g, S]), T = st(), E = at(), D = yt(), k = i((e) => {
|
|
593
596
|
D && D.sendOperation({
|
|
594
597
|
...e,
|
|
595
598
|
userId: D.currentUserId ?? ""
|
|
@@ -880,6 +883,7 @@ function bt({ canvas: e = {
|
|
|
880
883
|
className: "text-xs font-medium text-muted-foreground px-2 py-1 uppercase",
|
|
881
884
|
children: e.label
|
|
882
885
|
}), e.items.map((e) => /* @__PURE__ */ Y("button", {
|
|
886
|
+
type: "button",
|
|
883
887
|
onClick: () => B(e.type, e.label),
|
|
884
888
|
className: "w-full flex items-center gap-2 px-2 py-1.5 text-sm rounded hover:bg-accent text-left",
|
|
885
889
|
children: [/* @__PURE__ */ J(be, { className: "h-3 w-3" }), e.label]
|
|
@@ -895,6 +899,7 @@ function bt({ canvas: e = {
|
|
|
895
899
|
"aria-label": "Designer toolbar",
|
|
896
900
|
children: [
|
|
897
901
|
!d && /* @__PURE__ */ J("button", {
|
|
902
|
+
type: "button",
|
|
898
903
|
className: "p-1.5 rounded hover:bg-accent",
|
|
899
904
|
title: A ? "Collapse palette" : "Expand palette",
|
|
900
905
|
"aria-label": A ? "Collapse palette" : "Expand palette",
|
|
@@ -904,6 +909,7 @@ function bt({ canvas: e = {
|
|
|
904
909
|
a && !d && /* @__PURE__ */ Y(q, { children: [
|
|
905
910
|
/* @__PURE__ */ J("div", { className: "w-px h-5 bg-border mx-1" }),
|
|
906
911
|
/* @__PURE__ */ J("button", {
|
|
912
|
+
type: "button",
|
|
907
913
|
className: X("p-1.5 rounded hover:bg-accent", !h.canUndo && "opacity-40 pointer-events-none"),
|
|
908
914
|
title: "Undo (Ctrl+Z)",
|
|
909
915
|
"aria-label": "Undo",
|
|
@@ -912,6 +918,7 @@ function bt({ canvas: e = {
|
|
|
912
918
|
children: /* @__PURE__ */ J(Pe, { className: "h-4 w-4" })
|
|
913
919
|
}),
|
|
914
920
|
/* @__PURE__ */ J("button", {
|
|
921
|
+
type: "button",
|
|
915
922
|
className: X("p-1.5 rounded hover:bg-accent", !h.canRedo && "opacity-40 pointer-events-none"),
|
|
916
923
|
title: "Redo (Ctrl+Shift+Z)",
|
|
917
924
|
"aria-label": "Redo",
|
|
@@ -923,6 +930,7 @@ function bt({ canvas: e = {
|
|
|
923
930
|
] }),
|
|
924
931
|
!d && /* @__PURE__ */ Y(q, { children: [
|
|
925
932
|
/* @__PURE__ */ J("button", {
|
|
933
|
+
type: "button",
|
|
926
934
|
className: X("p-1.5 rounded hover:bg-accent", x.count === 0 && "opacity-40 pointer-events-none"),
|
|
927
935
|
title: "Copy (Ctrl+C)",
|
|
928
936
|
"aria-label": "Copy",
|
|
@@ -931,6 +939,7 @@ function bt({ canvas: e = {
|
|
|
931
939
|
children: /* @__PURE__ */ J(w, { className: "h-4 w-4" })
|
|
932
940
|
}),
|
|
933
941
|
/* @__PURE__ */ J("button", {
|
|
942
|
+
type: "button",
|
|
934
943
|
className: X("p-1.5 rounded hover:bg-accent", !T.hasContent && "opacity-40 pointer-events-none"),
|
|
935
944
|
title: "Paste (Ctrl+V)",
|
|
936
945
|
"aria-label": "Paste",
|
|
@@ -941,6 +950,7 @@ function bt({ canvas: e = {
|
|
|
941
950
|
/* @__PURE__ */ J("div", { className: "w-px h-5 bg-border mx-1" })
|
|
942
951
|
] }),
|
|
943
952
|
!d && /* @__PURE__ */ J("button", {
|
|
953
|
+
type: "button",
|
|
944
954
|
className: X("p-1.5 rounded hover:bg-accent", x.count === 0 && "opacity-40 pointer-events-none"),
|
|
945
955
|
title: "Delete selected",
|
|
946
956
|
"aria-label": "Delete selected",
|
|
@@ -949,12 +959,14 @@ function bt({ canvas: e = {
|
|
|
949
959
|
children: /* @__PURE__ */ J(je, { className: "h-4 w-4" })
|
|
950
960
|
}),
|
|
951
961
|
/* @__PURE__ */ J("button", {
|
|
962
|
+
type: "button",
|
|
952
963
|
className: "p-1.5 rounded hover:bg-accent",
|
|
953
964
|
title: "Preview",
|
|
954
965
|
"aria-label": "Preview",
|
|
955
966
|
children: /* @__PURE__ */ J(O, { className: "h-4 w-4" })
|
|
956
967
|
}),
|
|
957
968
|
/* @__PURE__ */ J("button", {
|
|
969
|
+
type: "button",
|
|
958
970
|
className: X("p-1.5 rounded hover:bg-accent", P && "bg-accent"),
|
|
959
971
|
title: "Toggle minimap",
|
|
960
972
|
"aria-label": "Toggle minimap",
|
|
@@ -966,6 +978,7 @@ function bt({ canvas: e = {
|
|
|
966
978
|
className: "flex items-center gap-1",
|
|
967
979
|
children: [
|
|
968
980
|
/* @__PURE__ */ J("button", {
|
|
981
|
+
type: "button",
|
|
969
982
|
className: "p-1 rounded hover:bg-accent text-xs",
|
|
970
983
|
"aria-label": "Zoom out",
|
|
971
984
|
onClick: v.zoomOut,
|
|
@@ -976,12 +989,14 @@ function bt({ canvas: e = {
|
|
|
976
989
|
children: [Math.round(y * 100), "%"]
|
|
977
990
|
}),
|
|
978
991
|
/* @__PURE__ */ J("button", {
|
|
992
|
+
type: "button",
|
|
979
993
|
className: "p-1 rounded hover:bg-accent text-xs",
|
|
980
994
|
"aria-label": "Zoom in",
|
|
981
995
|
onClick: v.zoomIn,
|
|
982
996
|
children: /* @__PURE__ */ J(be, { className: "h-3 w-3" })
|
|
983
997
|
}),
|
|
984
998
|
/* @__PURE__ */ J("button", {
|
|
999
|
+
type: "button",
|
|
985
1000
|
className: "p-1 rounded hover:bg-accent text-xs",
|
|
986
1001
|
"aria-label": "Reset zoom",
|
|
987
1002
|
onClick: v.resetZoom,
|
|
@@ -990,6 +1005,7 @@ function bt({ canvas: e = {
|
|
|
990
1005
|
]
|
|
991
1006
|
}),
|
|
992
1007
|
r && /* @__PURE__ */ J("button", {
|
|
1008
|
+
type: "button",
|
|
993
1009
|
className: "p-1.5 rounded hover:bg-accent",
|
|
994
1010
|
title: M ? "Collapse panel" : "Expand panel",
|
|
995
1011
|
"aria-label": M ? "Collapse panel" : "Expand panel",
|
|
@@ -1036,6 +1052,7 @@ function bt({ canvas: e = {
|
|
|
1036
1052
|
children: e.label ?? e.type
|
|
1037
1053
|
}),
|
|
1038
1054
|
!d && /* @__PURE__ */ J("button", {
|
|
1055
|
+
type: "button",
|
|
1039
1056
|
onClick: (t) => {
|
|
1040
1057
|
t.stopPropagation(), te(e.id);
|
|
1041
1058
|
},
|
|
@@ -1049,7 +1066,7 @@ function bt({ canvas: e = {
|
|
|
1049
1066
|
children: e.type
|
|
1050
1067
|
})]
|
|
1051
1068
|
}, e.id);
|
|
1052
|
-
}), P && /* @__PURE__ */ J(
|
|
1069
|
+
}), P && /* @__PURE__ */ J(ht, {
|
|
1053
1070
|
items: de,
|
|
1054
1071
|
canvasWidth: e.width,
|
|
1055
1072
|
canvasHeight: e.height
|
|
@@ -1072,6 +1089,7 @@ function bt({ canvas: e = {
|
|
|
1072
1089
|
className: "text-xs text-muted-foreground text-center py-4",
|
|
1073
1090
|
children: "No components added yet. Click a component in the palette to add it to the canvas."
|
|
1074
1091
|
}) : g.map((e) => /* @__PURE__ */ J("button", {
|
|
1092
|
+
type: "button",
|
|
1075
1093
|
onClick: (t) => x.toggle(e.id, t.shiftKey),
|
|
1076
1094
|
className: X("w-full flex items-center gap-2 px-2 py-1.5 text-sm rounded text-left", x.isSelected(e.id) ? "bg-accent" : "hover:bg-accent/50"),
|
|
1077
1095
|
children: /* @__PURE__ */ J("span", {
|
|
@@ -1082,7 +1100,7 @@ function bt({ canvas: e = {
|
|
|
1082
1100
|
}),
|
|
1083
1101
|
u && C ? /* @__PURE__ */ J("div", {
|
|
1084
1102
|
className: "border-t",
|
|
1085
|
-
children: /* @__PURE__ */ J(
|
|
1103
|
+
children: /* @__PURE__ */ J(ft, {
|
|
1086
1104
|
title: `Properties – ${C.label ?? C.type}`,
|
|
1087
1105
|
fields: ce,
|
|
1088
1106
|
onChange: re
|
|
@@ -1116,7 +1134,7 @@ function bt({ canvas: e = {
|
|
|
1116
1134
|
})
|
|
1117
1135
|
] })
|
|
1118
1136
|
}),
|
|
1119
|
-
/* @__PURE__ */ J(
|
|
1137
|
+
/* @__PURE__ */ J(ut, {
|
|
1120
1138
|
isOpen: E.isOpen,
|
|
1121
1139
|
title: E.title,
|
|
1122
1140
|
message: E.message,
|
|
@@ -1126,7 +1144,7 @@ function bt({ canvas: e = {
|
|
|
1126
1144
|
]
|
|
1127
1145
|
});
|
|
1128
1146
|
}
|
|
1129
|
-
var
|
|
1147
|
+
var Ct = [
|
|
1130
1148
|
{
|
|
1131
1149
|
name: "layout",
|
|
1132
1150
|
label: "Layout",
|
|
@@ -1260,15 +1278,15 @@ var xt = [
|
|
|
1260
1278
|
];
|
|
1261
1279
|
//#endregion
|
|
1262
1280
|
//#region src/hooks/useDesignerHistory.ts
|
|
1263
|
-
function
|
|
1264
|
-
return
|
|
1281
|
+
function wt(e, t = {}) {
|
|
1282
|
+
return it(e, t);
|
|
1265
1283
|
}
|
|
1266
1284
|
//#endregion
|
|
1267
1285
|
//#region src/DataModelDesigner.tsx
|
|
1268
|
-
function
|
|
1286
|
+
function Tt(...e) {
|
|
1269
1287
|
return K(G(e));
|
|
1270
1288
|
}
|
|
1271
|
-
var
|
|
1289
|
+
var Et = [
|
|
1272
1290
|
"text",
|
|
1273
1291
|
"number",
|
|
1274
1292
|
"boolean",
|
|
@@ -1292,7 +1310,7 @@ var wt = [
|
|
|
1292
1310
|
"formula",
|
|
1293
1311
|
"autonumber"
|
|
1294
1312
|
];
|
|
1295
|
-
function
|
|
1313
|
+
function Dt(e, t = 4, n = 280, r = 250, i = 50, a = 50) {
|
|
1296
1314
|
return e.map((e, o) => ({
|
|
1297
1315
|
...e,
|
|
1298
1316
|
position: {
|
|
@@ -1301,12 +1319,12 @@ function Tt(e, t = 4, n = 280, r = 250, i = 50, a = 50) {
|
|
|
1301
1319
|
}
|
|
1302
1320
|
}));
|
|
1303
1321
|
}
|
|
1304
|
-
function
|
|
1322
|
+
function Ot({ entities: e = [], relationships: t = [], canvas: n = {
|
|
1305
1323
|
width: 1200,
|
|
1306
1324
|
height: 800,
|
|
1307
1325
|
showGrid: !0
|
|
1308
1326
|
}, showRelationshipLabels: r = !0, readOnly: a = !1, onEntitiesChange: s, onRelationshipsChange: u, className: d }) {
|
|
1309
|
-
let f = c(null), p =
|
|
1327
|
+
let f = c(null), p = wt({
|
|
1310
1328
|
entities: e,
|
|
1311
1329
|
relationships: t
|
|
1312
1330
|
}, { maxHistory: 50 }), { entities: m, relationships: h } = p.current, _ = i((e) => {
|
|
@@ -1315,11 +1333,11 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1315
1333
|
p,
|
|
1316
1334
|
s,
|
|
1317
1335
|
u
|
|
1318
|
-
]), y =
|
|
1336
|
+
]), y = at(), x = ot(), S = x.count > 0 ? Array.from(x.selectedIds)[0] : null, C = st(), E = ct({
|
|
1319
1337
|
minZoom: .25,
|
|
1320
1338
|
maxZoom: 3,
|
|
1321
1339
|
zoomStep: .1
|
|
1322
|
-
}), D =
|
|
1340
|
+
}), D = yt(), [O, k] = l(!0), [A, j] = l(!0), [M, N] = l(null), [F, I] = l(""), [L, R] = l(null), [z, ee] = l(""), B = c(null), te = i(() => {
|
|
1323
1341
|
if (a) return;
|
|
1324
1342
|
let e = p.current, t = {
|
|
1325
1343
|
id: `entity-${Date.now()}`,
|
|
@@ -1406,7 +1424,7 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1406
1424
|
]), ie = i(() => {
|
|
1407
1425
|
if (a) return;
|
|
1408
1426
|
let e = p.current, t = {
|
|
1409
|
-
entities:
|
|
1427
|
+
entities: Dt(e.entities),
|
|
1410
1428
|
relationships: e.relationships
|
|
1411
1429
|
};
|
|
1412
1430
|
_(t);
|
|
@@ -1673,7 +1691,7 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1673
1691
|
return /* @__PURE__ */ Y("div", {
|
|
1674
1692
|
ref: f,
|
|
1675
1693
|
tabIndex: 0,
|
|
1676
|
-
className:
|
|
1694
|
+
className: Tt("flex h-full w-full border rounded-lg overflow-hidden bg-background", d),
|
|
1677
1695
|
children: [
|
|
1678
1696
|
/* @__PURE__ */ Y("div", {
|
|
1679
1697
|
className: "flex flex-col flex-1 min-w-0",
|
|
@@ -1690,6 +1708,7 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1690
1708
|
/* @__PURE__ */ Y("div", {
|
|
1691
1709
|
className: "flex items-center gap-1 ml-2 border-l pl-2",
|
|
1692
1710
|
children: [/* @__PURE__ */ J("button", {
|
|
1711
|
+
type: "button",
|
|
1693
1712
|
onClick: () => p.undo(),
|
|
1694
1713
|
disabled: !p.canUndo,
|
|
1695
1714
|
"aria-label": "Undo",
|
|
@@ -1697,6 +1716,7 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1697
1716
|
className: "p-1 rounded hover:bg-accent disabled:opacity-40",
|
|
1698
1717
|
children: /* @__PURE__ */ J(Pe, { className: "h-3.5 w-3.5" })
|
|
1699
1718
|
}), /* @__PURE__ */ J("button", {
|
|
1719
|
+
type: "button",
|
|
1700
1720
|
onClick: () => p.redo(),
|
|
1701
1721
|
disabled: !p.canRedo,
|
|
1702
1722
|
"aria-label": "Redo",
|
|
@@ -1709,6 +1729,7 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1709
1729
|
className: "flex items-center gap-1 border-l pl-2",
|
|
1710
1730
|
children: [
|
|
1711
1731
|
/* @__PURE__ */ J("button", {
|
|
1732
|
+
type: "button",
|
|
1712
1733
|
onClick: E.zoomOut,
|
|
1713
1734
|
"aria-label": "Zoom Out",
|
|
1714
1735
|
title: "Zoom Out",
|
|
@@ -1720,6 +1741,7 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1720
1741
|
children: [Math.round(E.zoom * 100), "%"]
|
|
1721
1742
|
}),
|
|
1722
1743
|
/* @__PURE__ */ J("button", {
|
|
1744
|
+
type: "button",
|
|
1723
1745
|
onClick: E.zoomIn,
|
|
1724
1746
|
"aria-label": "Zoom In",
|
|
1725
1747
|
title: "Zoom In",
|
|
@@ -1727,6 +1749,7 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1727
1749
|
children: /* @__PURE__ */ J(ze, { className: "h-3.5 w-3.5" })
|
|
1728
1750
|
}),
|
|
1729
1751
|
/* @__PURE__ */ J("button", {
|
|
1752
|
+
type: "button",
|
|
1730
1753
|
onClick: E.resetZoom,
|
|
1731
1754
|
"aria-label": "Reset Zoom",
|
|
1732
1755
|
title: "Reset Zoom",
|
|
@@ -1738,6 +1761,7 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1738
1761
|
!a && /* @__PURE__ */ Y("div", {
|
|
1739
1762
|
className: "flex items-center gap-1 border-l pl-2",
|
|
1740
1763
|
children: [/* @__PURE__ */ J("button", {
|
|
1764
|
+
type: "button",
|
|
1741
1765
|
onClick: V,
|
|
1742
1766
|
disabled: x.count === 0,
|
|
1743
1767
|
"aria-label": "Copy",
|
|
@@ -1745,6 +1769,7 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1745
1769
|
className: "p-1 rounded hover:bg-accent disabled:opacity-40",
|
|
1746
1770
|
children: /* @__PURE__ */ J(w, { className: "h-3.5 w-3.5" })
|
|
1747
1771
|
}), /* @__PURE__ */ J("button", {
|
|
1772
|
+
type: "button",
|
|
1748
1773
|
onClick: H,
|
|
1749
1774
|
disabled: !C.hasContent,
|
|
1750
1775
|
"aria-label": "Paste",
|
|
@@ -1754,6 +1779,7 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1754
1779
|
})]
|
|
1755
1780
|
}),
|
|
1756
1781
|
!a && /* @__PURE__ */ Y("button", {
|
|
1782
|
+
type: "button",
|
|
1757
1783
|
onClick: ie,
|
|
1758
1784
|
"aria-label": "Auto Layout",
|
|
1759
1785
|
title: "Auto Layout",
|
|
@@ -1776,11 +1802,13 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1776
1802
|
children: [x.count, " selected"]
|
|
1777
1803
|
}),
|
|
1778
1804
|
!a && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ Y("button", {
|
|
1805
|
+
type: "button",
|
|
1779
1806
|
onClick: te,
|
|
1780
1807
|
"aria-label": "Add Entity",
|
|
1781
1808
|
className: "flex items-center gap-1 px-2 py-1 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90",
|
|
1782
1809
|
children: [/* @__PURE__ */ J(be, { className: "h-3 w-3" }), " Add Entity"]
|
|
1783
1810
|
}), /* @__PURE__ */ Y("button", {
|
|
1811
|
+
type: "button",
|
|
1784
1812
|
"aria-label": "Add Relationship",
|
|
1785
1813
|
title: "Add Relationship (coming soon)",
|
|
1786
1814
|
className: "flex items-center gap-1 px-2 py-1 text-xs rounded bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
@@ -1837,7 +1865,7 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1837
1865
|
"aria-label": e.label,
|
|
1838
1866
|
draggable: !a,
|
|
1839
1867
|
onDragStart: (t) => me(t, e.id),
|
|
1840
|
-
className:
|
|
1868
|
+
className: Tt("absolute rounded-lg border-2 bg-background shadow-sm w-60 select-none cursor-grab active:cursor-grabbing", x.isSelected(e.id) ? "border-primary ring-2 ring-primary/20" : "border-border hover:border-primary/50"),
|
|
1841
1869
|
style: {
|
|
1842
1870
|
left: e.position.x,
|
|
1843
1871
|
top: e.position.y
|
|
@@ -1871,6 +1899,7 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1871
1899
|
children: e.label
|
|
1872
1900
|
}),
|
|
1873
1901
|
!a && /* @__PURE__ */ J("button", {
|
|
1902
|
+
type: "button",
|
|
1874
1903
|
onClick: (t) => {
|
|
1875
1904
|
t.stopPropagation(), ne(e.id);
|
|
1876
1905
|
},
|
|
@@ -1897,7 +1926,7 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1897
1926
|
autoFocus: !0,
|
|
1898
1927
|
onClick: (e) => e.stopPropagation()
|
|
1899
1928
|
}) : /* @__PURE__ */ Y("span", {
|
|
1900
|
-
className:
|
|
1929
|
+
className: Tt("font-mono cursor-text", t.primaryKey && "font-bold text-primary"),
|
|
1901
1930
|
onClick: (r) => {
|
|
1902
1931
|
r.stopPropagation(), se(e.id, n, t.name);
|
|
1903
1932
|
},
|
|
@@ -1918,7 +1947,7 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1918
1947
|
onClick: (e) => e.stopPropagation(),
|
|
1919
1948
|
className: "text-xs text-muted-foreground ml-auto bg-transparent border-none focus:ring-1 focus:ring-primary rounded cursor-pointer p-0",
|
|
1920
1949
|
"data-testid": `field-type-${e.id}-${n}`,
|
|
1921
|
-
children:
|
|
1950
|
+
children: Et.map((e) => /* @__PURE__ */ J("option", {
|
|
1922
1951
|
value: e,
|
|
1923
1952
|
children: e
|
|
1924
1953
|
}, e))
|
|
@@ -1933,6 +1962,7 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1933
1962
|
!a && /* @__PURE__ */ J("div", {
|
|
1934
1963
|
className: "px-3 py-1 border-t",
|
|
1935
1964
|
children: /* @__PURE__ */ Y("button", {
|
|
1965
|
+
type: "button",
|
|
1936
1966
|
onClick: (t) => {
|
|
1937
1967
|
t.stopPropagation(), oe(e.id);
|
|
1938
1968
|
},
|
|
@@ -1944,7 +1974,7 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1944
1974
|
]
|
|
1945
1975
|
}, e.id))
|
|
1946
1976
|
]
|
|
1947
|
-
}), A && m.length > 0 && /* @__PURE__ */ J(
|
|
1977
|
+
}), A && m.length > 0 && /* @__PURE__ */ J(ht, {
|
|
1948
1978
|
items: ve,
|
|
1949
1979
|
canvasWidth: n.width,
|
|
1950
1980
|
canvasHeight: n.height,
|
|
@@ -1958,6 +1988,7 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1958
1988
|
children: [/* @__PURE__ */ Y("div", {
|
|
1959
1989
|
className: "flex flex-col flex-1 min-h-0",
|
|
1960
1990
|
children: [/* @__PURE__ */ Y("button", {
|
|
1991
|
+
type: "button",
|
|
1961
1992
|
onClick: () => k((e) => !e),
|
|
1962
1993
|
className: "flex items-center gap-1 px-3 py-2 text-xs font-medium text-muted-foreground hover:bg-accent/50 border-b",
|
|
1963
1994
|
"aria-expanded": O,
|
|
@@ -1966,7 +1997,7 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1966
1997
|
}), O && /* @__PURE__ */ J("div", {
|
|
1967
1998
|
id: "property-editor-panel",
|
|
1968
1999
|
className: "flex-1 overflow-y-auto",
|
|
1969
|
-
children: /* @__PURE__ */ J(
|
|
2000
|
+
children: /* @__PURE__ */ J(ft, {
|
|
1970
2001
|
title: U ? U.label : "Properties",
|
|
1971
2002
|
fields: W,
|
|
1972
2003
|
onChange: _e
|
|
@@ -1975,6 +2006,7 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1975
2006
|
}), /* @__PURE__ */ J("div", {
|
|
1976
2007
|
className: "border-t",
|
|
1977
2008
|
children: /* @__PURE__ */ Y("button", {
|
|
2009
|
+
type: "button",
|
|
1978
2010
|
onClick: () => j((e) => !e),
|
|
1979
2011
|
className: "flex items-center gap-1 px-3 py-2 text-xs font-medium text-muted-foreground hover:bg-accent/50 w-full",
|
|
1980
2012
|
"aria-expanded": A,
|
|
@@ -1982,7 +2014,7 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1982
2014
|
})
|
|
1983
2015
|
})]
|
|
1984
2016
|
}),
|
|
1985
|
-
/* @__PURE__ */ J(
|
|
2017
|
+
/* @__PURE__ */ J(ut, {
|
|
1986
2018
|
isOpen: y.isOpen,
|
|
1987
2019
|
title: y.title,
|
|
1988
2020
|
message: y.message,
|
|
@@ -1995,11 +2027,11 @@ function Et({ entities: e = [], relationships: t = [], canvas: n = {
|
|
|
1995
2027
|
}
|
|
1996
2028
|
//#endregion
|
|
1997
2029
|
//#region src/ProcessDesigner.tsx
|
|
1998
|
-
function
|
|
2030
|
+
function kt(...e) {
|
|
1999
2031
|
return K(G(e));
|
|
2000
2032
|
}
|
|
2001
|
-
var
|
|
2002
|
-
function
|
|
2033
|
+
var At = 120, jt = 50;
|
|
2034
|
+
function Mt(e, t) {
|
|
2003
2035
|
if (e.length === 0) return e;
|
|
2004
2036
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
2005
2037
|
for (let t of e) n.set(t.id, 0), r.set(t.id, []);
|
|
@@ -2027,12 +2059,12 @@ function At(e, t) {
|
|
|
2027
2059
|
position: c.get(e.id) ?? e.position
|
|
2028
2060
|
}));
|
|
2029
2061
|
}
|
|
2030
|
-
function
|
|
2062
|
+
function Nt({ processName: e = "New Process", nodes: t = [], edges: n = [], lanes: r, canvas: a = {
|
|
2031
2063
|
width: 1400,
|
|
2032
2064
|
height: 800,
|
|
2033
2065
|
showGrid: !0
|
|
2034
2066
|
}, showMinimap: u = !0, showToolbar: d = !0, readOnly: f = !1, onNodesChange: p, onEdgesChange: m, className: h }) {
|
|
2035
|
-
let g =
|
|
2067
|
+
let g = it({
|
|
2036
2068
|
nodes: t,
|
|
2037
2069
|
edges: n
|
|
2038
2070
|
}, { maxHistory: 50 }), _ = g.current.nodes, v = g.current.edges, y = i((e, t) => {
|
|
@@ -2044,7 +2076,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2044
2076
|
g,
|
|
2045
2077
|
p,
|
|
2046
2078
|
m
|
|
2047
|
-
]), x =
|
|
2079
|
+
]), x = at(), S = ot(), C = st(), T = ct({ initialZoom: 1 }), D = yt(), [O, k] = l(null), [A, j] = l(!1), [N, P] = l(null), [F, I] = l(null), [L, R] = l(!0), [z, ee] = l(null), [te, ne] = l({
|
|
2048
2080
|
x: 0,
|
|
2049
2081
|
y: 0
|
|
2050
2082
|
}), re = c(null), ie = c(p), ae = c(m);
|
|
@@ -2137,7 +2169,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2137
2169
|
y,
|
|
2138
2170
|
S
|
|
2139
2171
|
]), ue = i(() => {
|
|
2140
|
-
j((e) => e
|
|
2172
|
+
j((e) => !e || (P(null), !1));
|
|
2141
2173
|
}, []), de = i((e) => {
|
|
2142
2174
|
if (!A) return !1;
|
|
2143
2175
|
if (!N) return P(e), !0;
|
|
@@ -2165,7 +2197,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2165
2197
|
D
|
|
2166
2198
|
]), fe = i(() => {
|
|
2167
2199
|
if (f || _.length === 0) return;
|
|
2168
|
-
let e =
|
|
2200
|
+
let e = Mt(_, v);
|
|
2169
2201
|
y(e, v);
|
|
2170
2202
|
}, [
|
|
2171
2203
|
_,
|
|
@@ -2287,8 +2319,8 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2287
2319
|
id: e.id,
|
|
2288
2320
|
x: e.position.x,
|
|
2289
2321
|
y: e.position.y,
|
|
2290
|
-
width:
|
|
2291
|
-
height:
|
|
2322
|
+
width: At,
|
|
2323
|
+
height: jt,
|
|
2292
2324
|
selected: S.isSelected(e.id) || e.id === O
|
|
2293
2325
|
})), [
|
|
2294
2326
|
_,
|
|
@@ -2344,9 +2376,9 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2344
2376
|
return /* @__PURE__ */ Y("div", {
|
|
2345
2377
|
ref: re,
|
|
2346
2378
|
tabIndex: 0,
|
|
2347
|
-
className:
|
|
2379
|
+
className: kt("flex flex-col h-full w-full border rounded-lg overflow-hidden bg-background", h),
|
|
2348
2380
|
children: [
|
|
2349
|
-
/* @__PURE__ */ J(
|
|
2381
|
+
/* @__PURE__ */ J(ut, {
|
|
2350
2382
|
isOpen: x.isOpen,
|
|
2351
2383
|
title: x.title,
|
|
2352
2384
|
message: x.message,
|
|
@@ -2381,6 +2413,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2381
2413
|
className: "flex items-center gap-1",
|
|
2382
2414
|
children: [
|
|
2383
2415
|
/* @__PURE__ */ J("button", {
|
|
2416
|
+
type: "button",
|
|
2384
2417
|
onClick: () => g.undo(),
|
|
2385
2418
|
disabled: !g.canUndo,
|
|
2386
2419
|
className: "flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent disabled:opacity-40",
|
|
@@ -2389,6 +2422,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2389
2422
|
children: /* @__PURE__ */ J(Pe, { className: "h-3 w-3" })
|
|
2390
2423
|
}),
|
|
2391
2424
|
/* @__PURE__ */ J("button", {
|
|
2425
|
+
type: "button",
|
|
2392
2426
|
onClick: () => g.redo(),
|
|
2393
2427
|
disabled: !g.canRedo,
|
|
2394
2428
|
className: "flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent disabled:opacity-40",
|
|
@@ -2398,6 +2432,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2398
2432
|
}),
|
|
2399
2433
|
/* @__PURE__ */ J("div", { className: "w-px h-4 bg-border mx-1" }),
|
|
2400
2434
|
/* @__PURE__ */ J("button", {
|
|
2435
|
+
type: "button",
|
|
2401
2436
|
onClick: ce,
|
|
2402
2437
|
disabled: S.count === 0 && !O,
|
|
2403
2438
|
className: "flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent disabled:opacity-40",
|
|
@@ -2406,6 +2441,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2406
2441
|
children: /* @__PURE__ */ J(w, { className: "h-3 w-3" })
|
|
2407
2442
|
}),
|
|
2408
2443
|
/* @__PURE__ */ J("button", {
|
|
2444
|
+
type: "button",
|
|
2409
2445
|
onClick: le,
|
|
2410
2446
|
disabled: !C.hasContent,
|
|
2411
2447
|
className: "flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent disabled:opacity-40",
|
|
@@ -2415,14 +2451,16 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2415
2451
|
}),
|
|
2416
2452
|
/* @__PURE__ */ J("div", { className: "w-px h-4 bg-border mx-1" }),
|
|
2417
2453
|
/* @__PURE__ */ Y("button", {
|
|
2454
|
+
type: "button",
|
|
2418
2455
|
onClick: ue,
|
|
2419
|
-
className:
|
|
2456
|
+
className: kt("flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent", A && "bg-primary text-primary-foreground"),
|
|
2420
2457
|
title: "Connect nodes",
|
|
2421
2458
|
"aria-label": "Connect nodes",
|
|
2422
2459
|
"aria-pressed": A,
|
|
2423
2460
|
children: [/* @__PURE__ */ J(V, { className: "h-3 w-3" }), " Connect"]
|
|
2424
2461
|
}),
|
|
2425
2462
|
/* @__PURE__ */ Y("button", {
|
|
2463
|
+
type: "button",
|
|
2426
2464
|
onClick: fe,
|
|
2427
2465
|
className: "flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent",
|
|
2428
2466
|
title: "Auto layout",
|
|
@@ -2431,6 +2469,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2431
2469
|
}),
|
|
2432
2470
|
/* @__PURE__ */ J("div", { className: "w-px h-4 bg-border mx-1" }),
|
|
2433
2471
|
/* @__PURE__ */ J("button", {
|
|
2472
|
+
type: "button",
|
|
2434
2473
|
onClick: T.zoomIn,
|
|
2435
2474
|
className: "flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent",
|
|
2436
2475
|
title: "Zoom in",
|
|
@@ -2443,6 +2482,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2443
2482
|
children: [Math.round(T.zoom * 100), "%"]
|
|
2444
2483
|
}),
|
|
2445
2484
|
/* @__PURE__ */ J("button", {
|
|
2485
|
+
type: "button",
|
|
2446
2486
|
onClick: T.zoomOut,
|
|
2447
2487
|
className: "flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent",
|
|
2448
2488
|
title: "Zoom out",
|
|
@@ -2450,6 +2490,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2450
2490
|
children: /* @__PURE__ */ J(Be, { className: "h-3 w-3" })
|
|
2451
2491
|
}),
|
|
2452
2492
|
/* @__PURE__ */ J("button", {
|
|
2493
|
+
type: "button",
|
|
2453
2494
|
onClick: T.resetZoom,
|
|
2454
2495
|
className: "flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent",
|
|
2455
2496
|
title: "Reset zoom",
|
|
@@ -2458,6 +2499,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2458
2499
|
}),
|
|
2459
2500
|
/* @__PURE__ */ J("div", { className: "w-px h-4 bg-border mx-1" }),
|
|
2460
2501
|
/* @__PURE__ */ Y("button", {
|
|
2502
|
+
type: "button",
|
|
2461
2503
|
onClick: () => H("start-event", "Start"),
|
|
2462
2504
|
className: "flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent",
|
|
2463
2505
|
title: "Add Start Event",
|
|
@@ -2465,6 +2507,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2465
2507
|
children: [/* @__PURE__ */ J(ye, { className: "h-3 w-3 text-green-600" }), " Start"]
|
|
2466
2508
|
}),
|
|
2467
2509
|
/* @__PURE__ */ Y("button", {
|
|
2510
|
+
type: "button",
|
|
2468
2511
|
onClick: () => H("user-task", "User Task"),
|
|
2469
2512
|
className: "flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent",
|
|
2470
2513
|
title: "Add User Task",
|
|
@@ -2472,6 +2515,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2472
2515
|
children: [/* @__PURE__ */ J(Ee, { className: "h-3 w-3 text-blue-600" }), " Task"]
|
|
2473
2516
|
}),
|
|
2474
2517
|
/* @__PURE__ */ Y("button", {
|
|
2518
|
+
type: "button",
|
|
2475
2519
|
onClick: () => H("exclusive-gateway", "Decision"),
|
|
2476
2520
|
className: "flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent",
|
|
2477
2521
|
title: "Add Gateway",
|
|
@@ -2479,6 +2523,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2479
2523
|
children: [/* @__PURE__ */ J(E, { className: "h-3 w-3 text-yellow-600" }), " Gateway"]
|
|
2480
2524
|
}),
|
|
2481
2525
|
/* @__PURE__ */ Y("button", {
|
|
2526
|
+
type: "button",
|
|
2482
2527
|
onClick: () => H("end-event", "End"),
|
|
2483
2528
|
className: "flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent",
|
|
2484
2529
|
title: "Add End Event",
|
|
@@ -2487,6 +2532,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2487
2532
|
}),
|
|
2488
2533
|
/* @__PURE__ */ J("div", { className: "w-px h-4 bg-border mx-1" }),
|
|
2489
2534
|
/* @__PURE__ */ J("button", {
|
|
2535
|
+
type: "button",
|
|
2490
2536
|
onClick: () => R((e) => !e),
|
|
2491
2537
|
className: "flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent",
|
|
2492
2538
|
title: L ? "Hide properties" : "Show properties",
|
|
@@ -2537,12 +2583,12 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2537
2583
|
}) }), v.map((e) => {
|
|
2538
2584
|
let t = _.find((t) => t.id === e.source), n = _.find((t) => t.id === e.target);
|
|
2539
2585
|
if (!t || !n) return null;
|
|
2540
|
-
t.position.x +
|
|
2541
|
-
let r = t.position.y +
|
|
2542
|
-
n.position.x +
|
|
2543
|
-
let i = n.position.y +
|
|
2586
|
+
t.position.x + At / 2;
|
|
2587
|
+
let r = t.position.y + jt / 2;
|
|
2588
|
+
n.position.x + At / 2;
|
|
2589
|
+
let i = n.position.y + jt / 2, a = t.position.x + At, o = r, s = n.position.x, c = i, l = `M ${a} ${o} Q ${(a + s) / 2} ${o}, ${(a + s) / 2} ${(o + c) / 2} T ${s} ${c}`;
|
|
2544
2590
|
return /* @__PURE__ */ Y("g", { children: [/* @__PURE__ */ J("path", {
|
|
2545
|
-
d:
|
|
2591
|
+
d: l,
|
|
2546
2592
|
fill: "none",
|
|
2547
2593
|
stroke: "hsl(var(--foreground) / 0.5)",
|
|
2548
2594
|
strokeWidth: "2",
|
|
@@ -2579,9 +2625,9 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2579
2625
|
},
|
|
2580
2626
|
children: [
|
|
2581
2627
|
/* @__PURE__ */ J("div", {
|
|
2582
|
-
className:
|
|
2628
|
+
className: kt("flex items-center justify-center border-2 min-w-[120px] min-h-[50px] px-3 py-2 transition-shadow", be(e.type), t && "ring-2 ring-primary shadow-md", n && "ring-2 ring-blue-400 shadow-lg", A && !n && "cursor-crosshair"),
|
|
2583
2629
|
children: /* @__PURE__ */ J("span", {
|
|
2584
|
-
className:
|
|
2630
|
+
className: kt("text-xs font-medium", (e.type === "exclusive-gateway" || e.type === "parallel-gateway" || e.type === "inclusive-gateway" || e.type === "event-based-gateway") && "-rotate-45"),
|
|
2585
2631
|
children: e.label
|
|
2586
2632
|
})
|
|
2587
2633
|
}),
|
|
@@ -2590,7 +2636,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2590
2636
|
className: "absolute w-3 h-3 rounded-full bg-blue-500 border-2 border-white shadow cursor-crosshair",
|
|
2591
2637
|
style: {
|
|
2592
2638
|
left: -6,
|
|
2593
|
-
top:
|
|
2639
|
+
top: jt / 2 - 6
|
|
2594
2640
|
},
|
|
2595
2641
|
title: "Input port",
|
|
2596
2642
|
onClick: (t) => {
|
|
@@ -2601,7 +2647,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2601
2647
|
className: "absolute w-3 h-3 rounded-full bg-blue-500 border-2 border-white shadow cursor-crosshair",
|
|
2602
2648
|
style: {
|
|
2603
2649
|
right: -6,
|
|
2604
|
-
top:
|
|
2650
|
+
top: jt / 2 - 6
|
|
2605
2651
|
},
|
|
2606
2652
|
title: "Output port",
|
|
2607
2653
|
onClick: (t) => {
|
|
@@ -2611,7 +2657,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2611
2657
|
/* @__PURE__ */ J("div", {
|
|
2612
2658
|
className: "absolute w-3 h-3 rounded-full bg-blue-400 border-2 border-white shadow cursor-crosshair",
|
|
2613
2659
|
style: {
|
|
2614
|
-
left:
|
|
2660
|
+
left: At / 2 - 6,
|
|
2615
2661
|
top: -6
|
|
2616
2662
|
},
|
|
2617
2663
|
title: "Port",
|
|
@@ -2622,7 +2668,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2622
2668
|
/* @__PURE__ */ J("div", {
|
|
2623
2669
|
className: "absolute w-3 h-3 rounded-full bg-blue-400 border-2 border-white shadow cursor-crosshair",
|
|
2624
2670
|
style: {
|
|
2625
|
-
left:
|
|
2671
|
+
left: At / 2 - 6,
|
|
2626
2672
|
bottom: -6
|
|
2627
2673
|
},
|
|
2628
2674
|
title: "Port",
|
|
@@ -2632,6 +2678,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2632
2678
|
})
|
|
2633
2679
|
] }),
|
|
2634
2680
|
!f && t && !A && /* @__PURE__ */ J("button", {
|
|
2681
|
+
type: "button",
|
|
2635
2682
|
onClick: (t) => {
|
|
2636
2683
|
t.stopPropagation(), oe(e.id);
|
|
2637
2684
|
},
|
|
@@ -2642,7 +2689,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2642
2689
|
]
|
|
2643
2690
|
}, e.id);
|
|
2644
2691
|
}),
|
|
2645
|
-
u && _.length > 0 && /* @__PURE__ */ J(
|
|
2692
|
+
u && _.length > 0 && /* @__PURE__ */ J(ht, {
|
|
2646
2693
|
items: xe,
|
|
2647
2694
|
canvasWidth: a.width ?? 1400,
|
|
2648
2695
|
canvasHeight: a.height ?? 800,
|
|
@@ -2654,7 +2701,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2654
2701
|
className: "w-64 border-l bg-background overflow-y-auto shrink-0",
|
|
2655
2702
|
role: "complementary",
|
|
2656
2703
|
"aria-label": "Property panel",
|
|
2657
|
-
children: /* @__PURE__ */ J(
|
|
2704
|
+
children: /* @__PURE__ */ J(ft, {
|
|
2658
2705
|
title: W ? `Properties: ${W.label}` : "Properties",
|
|
2659
2706
|
fields: _e,
|
|
2660
2707
|
onChange: ve
|
|
@@ -2666,7 +2713,7 @@ function jt({ processName: e = "New Process", nodes: t = [], edges: n = [], lane
|
|
|
2666
2713
|
}
|
|
2667
2714
|
//#endregion
|
|
2668
2715
|
//#region src/ReportDesigner.tsx
|
|
2669
|
-
function
|
|
2716
|
+
function Pt(...e) {
|
|
2670
2717
|
return K(G(e));
|
|
2671
2718
|
}
|
|
2672
2719
|
var Z = {
|
|
@@ -2719,7 +2766,7 @@ var Z = {
|
|
|
2719
2766
|
groupSize: "Size",
|
|
2720
2767
|
groupContent: "Content",
|
|
2721
2768
|
groupGeneral: "General"
|
|
2722
|
-
},
|
|
2769
|
+
}, Ft = {
|
|
2723
2770
|
A4: {
|
|
2724
2771
|
width: 595,
|
|
2725
2772
|
height: 842
|
|
@@ -2740,7 +2787,7 @@ var Z = {
|
|
|
2740
2787
|
width: 792,
|
|
2741
2788
|
height: 1224
|
|
2742
2789
|
}
|
|
2743
|
-
},
|
|
2790
|
+
}, It = [
|
|
2744
2791
|
{
|
|
2745
2792
|
type: "header",
|
|
2746
2793
|
height: 80,
|
|
@@ -2758,23 +2805,23 @@ var Z = {
|
|
|
2758
2805
|
elements: []
|
|
2759
2806
|
}
|
|
2760
2807
|
];
|
|
2761
|
-
function
|
|
2808
|
+
function Lt({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4", orientation: r = "portrait", margins: a = {
|
|
2762
2809
|
top: 40,
|
|
2763
2810
|
right: 40,
|
|
2764
2811
|
bottom: 40,
|
|
2765
2812
|
left: 40
|
|
2766
2813
|
}, sections: u = [], showToolbar: d = !0, showPropertyPanel: f = !0, readOnly: m = !1, onSectionsChange: h, className: g }) {
|
|
2767
|
-
let _ =
|
|
2814
|
+
let _ = it(u.length > 0 ? u : It), v = _.current, y = i((e) => {
|
|
2768
2815
|
_.push(e), h?.(e);
|
|
2769
|
-
}, [_, h]), x =
|
|
2816
|
+
}, [_, h]), x = ot(), S = s(() => {
|
|
2770
2817
|
let e = Array.from(x.selectedIds);
|
|
2771
2818
|
return e.length > 0 ? e[0] : null;
|
|
2772
|
-
}, [x.selectedIds]), C =
|
|
2819
|
+
}, [x.selectedIds]), C = st(), T = at(), E = yt(), D = i((e) => {
|
|
2773
2820
|
E && E.sendOperation({
|
|
2774
2821
|
...e,
|
|
2775
2822
|
userId: E.currentUserId ?? ""
|
|
2776
2823
|
});
|
|
2777
|
-
}, [E]), [O, k] = l(!0), j = c(null), M = c(null), N =
|
|
2824
|
+
}, [E]), [O, k] = l(!0), j = c(null), M = c(null), N = Ft[n], P = r === "landscape" ? N.height : N.width, F = r === "landscape" ? N.width : N.height, I = (e) => {
|
|
2778
2825
|
switch (e) {
|
|
2779
2826
|
case "header": return Z.sectionHeader;
|
|
2780
2827
|
case "page-header": return Z.sectionPageHeader;
|
|
@@ -3100,7 +3147,7 @@ function Ft({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3100
3147
|
]), /* @__PURE__ */ Y("div", {
|
|
3101
3148
|
ref: M,
|
|
3102
3149
|
tabIndex: 0,
|
|
3103
|
-
className:
|
|
3150
|
+
className: Pt("flex h-full w-full border rounded-lg overflow-hidden bg-background", g),
|
|
3104
3151
|
children: [
|
|
3105
3152
|
/* @__PURE__ */ Y("div", {
|
|
3106
3153
|
className: "flex-1 flex flex-col min-w-0",
|
|
@@ -3125,7 +3172,8 @@ function Ft({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3125
3172
|
!m && /* @__PURE__ */ Y(q, { children: [
|
|
3126
3173
|
/* @__PURE__ */ J("div", { className: "w-px h-5 bg-border mx-1" }),
|
|
3127
3174
|
/* @__PURE__ */ J("button", {
|
|
3128
|
-
|
|
3175
|
+
type: "button",
|
|
3176
|
+
className: Pt("p-1.5 rounded hover:bg-accent", !_.canUndo && "opacity-40 pointer-events-none"),
|
|
3129
3177
|
title: Z.undoShortcut,
|
|
3130
3178
|
"aria-label": Z.undo,
|
|
3131
3179
|
disabled: !_.canUndo,
|
|
@@ -3133,7 +3181,8 @@ function Ft({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3133
3181
|
children: /* @__PURE__ */ J(Pe, { className: "h-4 w-4" })
|
|
3134
3182
|
}),
|
|
3135
3183
|
/* @__PURE__ */ J("button", {
|
|
3136
|
-
|
|
3184
|
+
type: "button",
|
|
3185
|
+
className: Pt("p-1.5 rounded hover:bg-accent", !_.canRedo && "opacity-40 pointer-events-none"),
|
|
3137
3186
|
title: Z.redoShortcut,
|
|
3138
3187
|
"aria-label": Z.redo,
|
|
3139
3188
|
disabled: !_.canRedo,
|
|
@@ -3144,7 +3193,8 @@ function Ft({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3144
3193
|
] }),
|
|
3145
3194
|
!m && /* @__PURE__ */ Y(q, { children: [
|
|
3146
3195
|
/* @__PURE__ */ J("button", {
|
|
3147
|
-
|
|
3196
|
+
type: "button",
|
|
3197
|
+
className: Pt("p-1.5 rounded hover:bg-accent", x.count === 0 && "opacity-40 pointer-events-none"),
|
|
3148
3198
|
title: Z.copyShortcut,
|
|
3149
3199
|
"aria-label": Z.copy,
|
|
3150
3200
|
disabled: x.count === 0,
|
|
@@ -3152,7 +3202,8 @@ function Ft({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3152
3202
|
children: /* @__PURE__ */ J(w, { className: "h-4 w-4" })
|
|
3153
3203
|
}),
|
|
3154
3204
|
/* @__PURE__ */ J("button", {
|
|
3155
|
-
|
|
3205
|
+
type: "button",
|
|
3206
|
+
className: Pt("p-1.5 rounded hover:bg-accent", !C.hasContent && "opacity-40 pointer-events-none"),
|
|
3156
3207
|
title: Z.pasteShortcut,
|
|
3157
3208
|
"aria-label": Z.paste,
|
|
3158
3209
|
disabled: !C.hasContent,
|
|
@@ -3162,7 +3213,8 @@ function Ft({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3162
3213
|
/* @__PURE__ */ J("div", { className: "w-px h-5 bg-border mx-1" })
|
|
3163
3214
|
] }),
|
|
3164
3215
|
!m && /* @__PURE__ */ J("button", {
|
|
3165
|
-
|
|
3216
|
+
type: "button",
|
|
3217
|
+
className: Pt("p-1.5 rounded hover:bg-accent", x.count === 0 && "opacity-40 pointer-events-none"),
|
|
3166
3218
|
title: Z.deleteSelected,
|
|
3167
3219
|
"aria-label": Z.deleteSelected,
|
|
3168
3220
|
disabled: x.count === 0,
|
|
@@ -3187,11 +3239,12 @@ function Ft({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3187
3239
|
]
|
|
3188
3240
|
}),
|
|
3189
3241
|
f && /* @__PURE__ */ J("button", {
|
|
3242
|
+
type: "button",
|
|
3190
3243
|
className: "p-1.5 rounded hover:bg-accent",
|
|
3191
3244
|
title: O ? Z.collapsePanel : Z.expandPanel,
|
|
3192
3245
|
"aria-label": O ? Z.collapsePanel : Z.expandPanel,
|
|
3193
3246
|
onClick: () => k((e) => !e),
|
|
3194
|
-
children: /* @__PURE__ */ J(ge, { className:
|
|
3247
|
+
children: /* @__PURE__ */ J(ge, { className: Pt("h-4 w-4", !O && "rotate-180") })
|
|
3195
3248
|
})
|
|
3196
3249
|
]
|
|
3197
3250
|
}), /* @__PURE__ */ J("div", {
|
|
@@ -3218,6 +3271,7 @@ function Ft({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3218
3271
|
className: "absolute right-1 top-0 flex items-center gap-0.5",
|
|
3219
3272
|
children: [
|
|
3220
3273
|
/* @__PURE__ */ J("button", {
|
|
3274
|
+
type: "button",
|
|
3221
3275
|
onClick: () => R(t, "text"),
|
|
3222
3276
|
className: "p-0.5 rounded hover:bg-accent",
|
|
3223
3277
|
title: Z.addText,
|
|
@@ -3225,6 +3279,7 @@ function Ft({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3225
3279
|
children: /* @__PURE__ */ J(Ne, { className: "h-3 w-3" })
|
|
3226
3280
|
}),
|
|
3227
3281
|
/* @__PURE__ */ J("button", {
|
|
3282
|
+
type: "button",
|
|
3228
3283
|
onClick: () => R(t, "field"),
|
|
3229
3284
|
className: "p-0.5 rounded hover:bg-accent",
|
|
3230
3285
|
title: Z.addField,
|
|
@@ -3232,6 +3287,7 @@ function Ft({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3232
3287
|
children: /* @__PURE__ */ J(be, { className: "h-3 w-3" })
|
|
3233
3288
|
}),
|
|
3234
3289
|
/* @__PURE__ */ J("button", {
|
|
3290
|
+
type: "button",
|
|
3235
3291
|
onClick: () => R(t, "image"),
|
|
3236
3292
|
className: "p-0.5 rounded hover:bg-accent",
|
|
3237
3293
|
title: Z.addImage,
|
|
@@ -3239,6 +3295,7 @@ function Ft({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3239
3295
|
children: /* @__PURE__ */ J(z, { className: "h-3 w-3" })
|
|
3240
3296
|
}),
|
|
3241
3297
|
/* @__PURE__ */ J("button", {
|
|
3298
|
+
type: "button",
|
|
3242
3299
|
onClick: () => R(t, "chart"),
|
|
3243
3300
|
className: "p-0.5 rounded hover:bg-accent",
|
|
3244
3301
|
title: Z.addChart,
|
|
@@ -3246,6 +3303,7 @@ function Ft({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3246
3303
|
children: /* @__PURE__ */ J(p, { className: "h-3 w-3" })
|
|
3247
3304
|
}),
|
|
3248
3305
|
/* @__PURE__ */ J("button", {
|
|
3306
|
+
type: "button",
|
|
3249
3307
|
onClick: () => R(t, "table"),
|
|
3250
3308
|
className: "p-0.5 rounded hover:bg-accent",
|
|
3251
3309
|
title: Z.addTable,
|
|
@@ -3268,7 +3326,7 @@ function Ft({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3268
3326
|
return /* @__PURE__ */ Y("div", {
|
|
3269
3327
|
draggable: !m,
|
|
3270
3328
|
onDragStart: (n) => ie(n, e, t),
|
|
3271
|
-
className:
|
|
3329
|
+
className: Pt("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"),
|
|
3272
3330
|
style: {
|
|
3273
3331
|
left: e.position.x,
|
|
3274
3332
|
top: (typeof e.position.y == "number" ? e.position.y : 0) + 24,
|
|
@@ -3286,6 +3344,7 @@ function Ft({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3286
3344
|
e.type === "table" && Z.elementTable
|
|
3287
3345
|
]
|
|
3288
3346
|
}), !m && n && /* @__PURE__ */ J("button", {
|
|
3347
|
+
type: "button",
|
|
3289
3348
|
onClick: (t) => {
|
|
3290
3349
|
t.stopPropagation(), ee(e.id);
|
|
3291
3350
|
},
|
|
@@ -3304,8 +3363,8 @@ function Ft({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3304
3363
|
f && /* @__PURE__ */ J("div", {
|
|
3305
3364
|
role: "region",
|
|
3306
3365
|
"aria-label": Z.propertiesPanel,
|
|
3307
|
-
className:
|
|
3308
|
-
children: O && (S && L ? /* @__PURE__ */ J(
|
|
3366
|
+
className: Pt("border-l bg-muted/30 flex flex-col transition-[width] duration-200", O ? "w-56" : "w-0 overflow-hidden"),
|
|
3367
|
+
children: O && (S && L ? /* @__PURE__ */ J(ft, {
|
|
3309
3368
|
title: `${Z.properties} – ${L.type}`,
|
|
3310
3369
|
fields: H,
|
|
3311
3370
|
onChange: te
|
|
@@ -3320,7 +3379,7 @@ function Ft({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3320
3379
|
})
|
|
3321
3380
|
})] }))
|
|
3322
3381
|
}),
|
|
3323
|
-
/* @__PURE__ */ J(
|
|
3382
|
+
/* @__PURE__ */ J(ut, {
|
|
3324
3383
|
isOpen: T.isOpen,
|
|
3325
3384
|
title: T.title,
|
|
3326
3385
|
message: T.message,
|
|
@@ -3330,7 +3389,9 @@ function Ft({ reportName: e = Z.untitledReport, objectName: t, pageSize: n = "A4
|
|
|
3330
3389
|
]
|
|
3331
3390
|
});
|
|
3332
3391
|
}
|
|
3333
|
-
|
|
3392
|
+
//#endregion
|
|
3393
|
+
//#region src/hooks/useDesignerTranslation.ts
|
|
3394
|
+
var Rt = {
|
|
3334
3395
|
"appDesigner.basicInfo": "Basic Info",
|
|
3335
3396
|
"appDesigner.objects": "Objects",
|
|
3336
3397
|
"appDesigner.navigation": "Navigation",
|
|
@@ -3415,6 +3476,9 @@ var It = qe({
|
|
|
3415
3476
|
"appDesigner.widgetHeight": "Height",
|
|
3416
3477
|
"appDesigner.dashboardPreview": "Dashboard Preview",
|
|
3417
3478
|
"appDesigner.noWidgetsPreview": "No widgets to preview",
|
|
3479
|
+
"appDesigner.widgetProperties": "Widget Properties",
|
|
3480
|
+
"appDesigner.addWidget": "Add Widget",
|
|
3481
|
+
"appDesigner.modeEdit": "Edit",
|
|
3418
3482
|
"appDesigner.pageCanvasEditor": "Page Canvas Editor",
|
|
3419
3483
|
"appDesigner.emptyPage": "Empty page. Click a button above to add a component.",
|
|
3420
3484
|
"appDesigner.pagePreview": "Page Preview",
|
|
@@ -3491,14 +3555,15 @@ var It = qe({
|
|
|
3491
3555
|
"appDesigner.fieldDesigner.typeCategory.choice": "Choice",
|
|
3492
3556
|
"appDesigner.fieldDesigner.typeCategory.relation": "Relation",
|
|
3493
3557
|
"appDesigner.fieldDesigner.typeCategory.advanced": "Advanced",
|
|
3494
|
-
"common.edit": "Edit"
|
|
3495
|
-
|
|
3558
|
+
"common.edit": "Edit",
|
|
3559
|
+
"common.delete": "Delete"
|
|
3560
|
+
}, zt = Je(Rt, "appDesigner.basicInfo");
|
|
3496
3561
|
//#endregion
|
|
3497
3562
|
//#region src/AppCreationWizard.tsx
|
|
3498
3563
|
function Q(...e) {
|
|
3499
3564
|
return K(G(e));
|
|
3500
3565
|
}
|
|
3501
|
-
var
|
|
3566
|
+
var Bt = {
|
|
3502
3567
|
name: "",
|
|
3503
3568
|
title: "",
|
|
3504
3569
|
description: "",
|
|
@@ -3513,7 +3578,7 @@ var Lt = {
|
|
|
3513
3578
|
favicon: ""
|
|
3514
3579
|
}
|
|
3515
3580
|
};
|
|
3516
|
-
function
|
|
3581
|
+
function Vt(e) {
|
|
3517
3582
|
return e.filter((e) => e.selected).map((e) => ({
|
|
3518
3583
|
id: e.name,
|
|
3519
3584
|
type: "object",
|
|
@@ -3522,11 +3587,11 @@ function Rt(e) {
|
|
|
3522
3587
|
objectName: e.name
|
|
3523
3588
|
}));
|
|
3524
3589
|
}
|
|
3525
|
-
var
|
|
3526
|
-
function
|
|
3527
|
-
return
|
|
3590
|
+
var Ht = 0;
|
|
3591
|
+
function Ut(e) {
|
|
3592
|
+
return Ht += 1, `${e}_${Date.now()}_${Ht}`;
|
|
3528
3593
|
}
|
|
3529
|
-
function
|
|
3594
|
+
function Wt({ steps: e, currentIndex: t, onStepClick: r }) {
|
|
3530
3595
|
return /* @__PURE__ */ J("nav", {
|
|
3531
3596
|
className: "flex items-center justify-center gap-0 px-4 py-6",
|
|
3532
3597
|
children: e.map((e, i) => {
|
|
@@ -3547,7 +3612,7 @@ function Vt({ steps: e, currentIndex: t, onStepClick: r }) {
|
|
|
3547
3612
|
})
|
|
3548
3613
|
});
|
|
3549
3614
|
}
|
|
3550
|
-
function
|
|
3615
|
+
function Gt({ draft: e, templates: t, readOnly: n, onChange: r, t: i }) {
|
|
3551
3616
|
let a = e.name.length > 0 && !He(e.name);
|
|
3552
3617
|
return /* @__PURE__ */ Y("div", {
|
|
3553
3618
|
"data-testid": "wizard-step-basic-content",
|
|
@@ -3709,7 +3774,7 @@ function Ht({ draft: e, templates: t, readOnly: n, onChange: r, t: i }) {
|
|
|
3709
3774
|
]
|
|
3710
3775
|
});
|
|
3711
3776
|
}
|
|
3712
|
-
function
|
|
3777
|
+
function Kt({ objects: e, readOnly: t, onToggle: n, onToggleAll: r, search: i, onSearchChange: a, t: o }) {
|
|
3713
3778
|
let c = s(() => {
|
|
3714
3779
|
if (!i) return e;
|
|
3715
3780
|
let t = i.toLowerCase();
|
|
@@ -3772,7 +3837,7 @@ function Ut({ objects: e, readOnly: t, onToggle: n, onToggleAll: r, search: i, o
|
|
|
3772
3837
|
})]
|
|
3773
3838
|
});
|
|
3774
3839
|
}
|
|
3775
|
-
var
|
|
3840
|
+
var qt = {
|
|
3776
3841
|
object: "bg-green-100 text-green-700",
|
|
3777
3842
|
group: "bg-purple-100 text-purple-700",
|
|
3778
3843
|
url: "bg-sky-100 text-sky-700",
|
|
@@ -3782,7 +3847,7 @@ var Wt = {
|
|
|
3782
3847
|
report: "bg-rose-100 text-rose-700",
|
|
3783
3848
|
action: "bg-orange-100 text-orange-700"
|
|
3784
3849
|
};
|
|
3785
|
-
function
|
|
3850
|
+
function Jt({ items: e, readOnly: t, onAdd: n, onRemove: r, onReorder: i, t: a }) {
|
|
3786
3851
|
return /* @__PURE__ */ Y("div", {
|
|
3787
3852
|
"data-testid": "wizard-step-navigation-content",
|
|
3788
3853
|
className: "mx-auto max-w-lg space-y-4",
|
|
@@ -3829,10 +3894,10 @@ function Gt({ items: e, readOnly: t, onAdd: n, onRemove: r, onReorder: i, t: a }
|
|
|
3829
3894
|
}),
|
|
3830
3895
|
/* @__PURE__ */ J("span", {
|
|
3831
3896
|
className: "flex-1 truncate text-sm text-gray-800",
|
|
3832
|
-
children: n.type === "separator" ? a("appDesigner.separatorLabel") :
|
|
3897
|
+
children: n.type === "separator" ? a("appDesigner.separatorLabel") : Ge(n.label)
|
|
3833
3898
|
}),
|
|
3834
3899
|
/* @__PURE__ */ J("span", {
|
|
3835
|
-
className: Q("rounded-full px-2 py-0.5 text-[10px] font-medium",
|
|
3900
|
+
className: Q("rounded-full px-2 py-0.5 text-[10px] font-medium", qt[n.type] ?? "bg-gray-100 text-gray-600"),
|
|
3836
3901
|
children: n.type
|
|
3837
3902
|
}),
|
|
3838
3903
|
/* @__PURE__ */ Y("div", {
|
|
@@ -3869,7 +3934,7 @@ function Gt({ items: e, readOnly: t, onAdd: n, onRemove: r, onReorder: i, t: a }
|
|
|
3869
3934
|
})]
|
|
3870
3935
|
});
|
|
3871
3936
|
}
|
|
3872
|
-
function
|
|
3937
|
+
function Yt({ branding: e, title: t, readOnly: n, onChange: r, t: i }) {
|
|
3873
3938
|
return /* @__PURE__ */ Y("div", {
|
|
3874
3939
|
"data-testid": "wizard-step-branding-content",
|
|
3875
3940
|
className: "mx-auto max-w-lg space-y-5",
|
|
@@ -3983,9 +4048,9 @@ function Kt({ branding: e, title: t, readOnly: n, onChange: r, t: i }) {
|
|
|
3983
4048
|
]
|
|
3984
4049
|
});
|
|
3985
4050
|
}
|
|
3986
|
-
function
|
|
3987
|
-
let { t: d } =
|
|
3988
|
-
...
|
|
4051
|
+
function Xt({ availableObjects: e = [], templates: t = [], initialDraft: n, onComplete: r, onCancel: a, onSaveDraft: o, readOnly: c = !1, className: u }) {
|
|
4052
|
+
let { t: d } = zt(), f = at(), [p, m] = l(0), [g, y] = l(""), [b, x] = l(() => ({
|
|
4053
|
+
...Bt,
|
|
3989
4054
|
objects: e.map((e) => ({ ...e })),
|
|
3990
4055
|
...n
|
|
3991
4056
|
})), S = s(() => [
|
|
@@ -4044,7 +4109,7 @@ function qt({ availableObjects: e = [], templates: t = [], initialDraft: n, onCo
|
|
|
4044
4109
|
}));
|
|
4045
4110
|
}, []), j = i((e) => {
|
|
4046
4111
|
let t = {
|
|
4047
|
-
id:
|
|
4112
|
+
id: Ut(e),
|
|
4048
4113
|
type: e,
|
|
4049
4114
|
label: e === "separator" ? "" : e === "group" ? "New Group" : "New Link",
|
|
4050
4115
|
...e === "group" ? { children: [] } : {},
|
|
@@ -4072,7 +4137,7 @@ function qt({ availableObjects: e = [], templates: t = [], initialDraft: n, onCo
|
|
|
4072
4137
|
}, []), P = i(() => {
|
|
4073
4138
|
w || (p === 1 && x((e) => ({
|
|
4074
4139
|
...e,
|
|
4075
|
-
navigation:
|
|
4140
|
+
navigation: Vt(e.objects)
|
|
4076
4141
|
})), m((e) => e + 1));
|
|
4077
4142
|
}, [p, w]), F = i(() => {
|
|
4078
4143
|
C || m((e) => e - 1);
|
|
@@ -4091,7 +4156,7 @@ function qt({ availableObjects: e = [], templates: t = [], initialDraft: n, onCo
|
|
|
4091
4156
|
}, [b, o]), z = i((e) => {
|
|
4092
4157
|
e <= p ? m(e) : e === p + 1 && E && (p === 1 && e === 2 && x((e) => ({
|
|
4093
4158
|
...e,
|
|
4094
|
-
navigation:
|
|
4159
|
+
navigation: Vt(e.objects)
|
|
4095
4160
|
})), m(e));
|
|
4096
4161
|
}, [p, E]);
|
|
4097
4162
|
return /* @__PURE__ */ Y("div", {
|
|
@@ -4143,7 +4208,7 @@ function qt({ availableObjects: e = [], templates: t = [], initialDraft: n, onCo
|
|
|
4143
4208
|
}),
|
|
4144
4209
|
/* @__PURE__ */ J("div", {
|
|
4145
4210
|
className: "border-b border-gray-100",
|
|
4146
|
-
children: /* @__PURE__ */ J(
|
|
4211
|
+
children: /* @__PURE__ */ J(Wt, {
|
|
4147
4212
|
steps: S,
|
|
4148
4213
|
currentIndex: p,
|
|
4149
4214
|
onStepClick: z
|
|
@@ -4152,14 +4217,14 @@ function qt({ availableObjects: e = [], templates: t = [], initialDraft: n, onCo
|
|
|
4152
4217
|
/* @__PURE__ */ Y("div", {
|
|
4153
4218
|
className: "flex-1 overflow-y-auto p-6",
|
|
4154
4219
|
children: [
|
|
4155
|
-
p === 0 && /* @__PURE__ */ J(
|
|
4220
|
+
p === 0 && /* @__PURE__ */ J(Gt, {
|
|
4156
4221
|
draft: b,
|
|
4157
4222
|
templates: t,
|
|
4158
4223
|
readOnly: c,
|
|
4159
4224
|
onChange: D,
|
|
4160
4225
|
t: d
|
|
4161
4226
|
}),
|
|
4162
|
-
p === 1 && /* @__PURE__ */ J(
|
|
4227
|
+
p === 1 && /* @__PURE__ */ J(Kt, {
|
|
4163
4228
|
objects: b.objects,
|
|
4164
4229
|
readOnly: c,
|
|
4165
4230
|
onToggle: k,
|
|
@@ -4168,7 +4233,7 @@ function qt({ availableObjects: e = [], templates: t = [], initialDraft: n, onCo
|
|
|
4168
4233
|
onSearchChange: y,
|
|
4169
4234
|
t: d
|
|
4170
4235
|
}),
|
|
4171
|
-
p === 2 && /* @__PURE__ */ J(
|
|
4236
|
+
p === 2 && /* @__PURE__ */ J(Jt, {
|
|
4172
4237
|
items: b.navigation,
|
|
4173
4238
|
readOnly: c,
|
|
4174
4239
|
onAdd: j,
|
|
@@ -4176,7 +4241,7 @@ function qt({ availableObjects: e = [], templates: t = [], initialDraft: n, onCo
|
|
|
4176
4241
|
onReorder: N,
|
|
4177
4242
|
t: d
|
|
4178
4243
|
}),
|
|
4179
|
-
p === 3 && /* @__PURE__ */ J(
|
|
4244
|
+
p === 3 && /* @__PURE__ */ J(Yt, {
|
|
4180
4245
|
branding: b.branding,
|
|
4181
4246
|
title: b.title,
|
|
4182
4247
|
readOnly: c,
|
|
@@ -4235,14 +4300,14 @@ function qt({ availableObjects: e = [], templates: t = [], initialDraft: n, onCo
|
|
|
4235
4300
|
}
|
|
4236
4301
|
//#endregion
|
|
4237
4302
|
//#region src/NavigationDesigner.tsx
|
|
4238
|
-
function
|
|
4303
|
+
function Zt(...e) {
|
|
4239
4304
|
return K(G(e));
|
|
4240
4305
|
}
|
|
4241
|
-
var
|
|
4242
|
-
function
|
|
4243
|
-
return
|
|
4306
|
+
var Qt = 0;
|
|
4307
|
+
function $t(e) {
|
|
4308
|
+
return Qt += 1, `${e}_${Date.now()}_${Qt}`;
|
|
4244
4309
|
}
|
|
4245
|
-
var
|
|
4310
|
+
var en = {
|
|
4246
4311
|
object: {
|
|
4247
4312
|
labelKey: "appDesigner.navTypeObject",
|
|
4248
4313
|
color: "bg-green-100 text-green-700",
|
|
@@ -4288,7 +4353,7 @@ var Zt = {
|
|
|
4288
4353
|
color: "bg-orange-100 text-orange-700",
|
|
4289
4354
|
Icon: fe
|
|
4290
4355
|
}
|
|
4291
|
-
},
|
|
4356
|
+
}, tn = [
|
|
4292
4357
|
{
|
|
4293
4358
|
type: "object",
|
|
4294
4359
|
labelKey: "appDesigner.navObjectPage"
|
|
@@ -4318,17 +4383,17 @@ var Zt = {
|
|
|
4318
4383
|
labelKey: "appDesigner.navSeparator"
|
|
4319
4384
|
}
|
|
4320
4385
|
];
|
|
4321
|
-
function
|
|
4322
|
-
let [_, b] = l(!1), [x, S] = l(
|
|
4386
|
+
function nn({ 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 }) {
|
|
4387
|
+
let [_, b] = l(!1), [x, S] = l(Ge(e.label) ?? ""), [C, w] = l(!1), [T, E] = l(e.icon || ""), D = en[e.type];
|
|
4323
4388
|
e.type === "group" && e.children && e.children.length;
|
|
4324
4389
|
let A = m.has(e.id), j = e.visible === !1, M = () => {
|
|
4325
|
-
x.trim() ? u(e.id, x.trim()) : S(
|
|
4390
|
+
x.trim() ? u(e.id, x.trim()) : S(Ge(e.label) ?? ""), b(!1);
|
|
4326
4391
|
}, N = () => {
|
|
4327
4392
|
d(e.id, T.trim()), w(!1);
|
|
4328
4393
|
};
|
|
4329
4394
|
return /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ Y("li", {
|
|
4330
4395
|
"data-testid": `nav-designer-item-${e.id}`,
|
|
4331
|
-
className:
|
|
4396
|
+
className: Zt("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"),
|
|
4332
4397
|
style: { marginLeft: t * 20 },
|
|
4333
4398
|
children: [
|
|
4334
4399
|
/* @__PURE__ */ J(F, { className: "h-3.5 w-3.5 shrink-0 cursor-grab text-gray-300" }),
|
|
@@ -4373,19 +4438,19 @@ function $t({ item: e, depth: t, index: n, total: r, readOnly: i, onRemove: a, o
|
|
|
4373
4438
|
onChange: (e) => S(e.target.value),
|
|
4374
4439
|
onBlur: M,
|
|
4375
4440
|
onKeyDown: (t) => {
|
|
4376
|
-
t.key === "Enter" && M(), t.key === "Escape" && (S(
|
|
4441
|
+
t.key === "Enter" && M(), t.key === "Escape" && (S(Ge(e.label) ?? ""), b(!1));
|
|
4377
4442
|
},
|
|
4378
4443
|
autoFocus: !0,
|
|
4379
4444
|
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"
|
|
4380
4445
|
}) : /* @__PURE__ */ J("span", {
|
|
4381
|
-
className:
|
|
4446
|
+
className: Zt("flex-1 truncate text-sm text-gray-800", !i && "cursor-text"),
|
|
4382
4447
|
onDoubleClick: () => {
|
|
4383
|
-
!i && e.type !== "separator" && (S(
|
|
4448
|
+
!i && e.type !== "separator" && (S(Ge(e.label) ?? ""), b(!0));
|
|
4384
4449
|
},
|
|
4385
|
-
children:
|
|
4450
|
+
children: Ge(e.label)
|
|
4386
4451
|
}),
|
|
4387
4452
|
/* @__PURE__ */ J("span", {
|
|
4388
|
-
className:
|
|
4453
|
+
className: Zt("rounded-full px-2 py-0.5 text-[10px] font-medium", D.color),
|
|
4389
4454
|
children: h(D.labelKey)
|
|
4390
4455
|
}),
|
|
4391
4456
|
j && /* @__PURE__ */ J("span", {
|
|
@@ -4435,7 +4500,7 @@ function $t({ item: e, depth: t, index: n, total: r, readOnly: i, onRemove: a, o
|
|
|
4435
4500
|
children: /* @__PURE__ */ J(je, { className: "h-3.5 w-3.5" })
|
|
4436
4501
|
})
|
|
4437
4502
|
]
|
|
4438
|
-
}), e.type === "group" && A && e.children && /* @__PURE__ */ J(q, { children: e.children.map((n, r) => /* @__PURE__ */ J(
|
|
4503
|
+
}), e.type === "group" && A && e.children && /* @__PURE__ */ J(q, { children: e.children.map((n, r) => /* @__PURE__ */ J(nn, {
|
|
4439
4504
|
item: n,
|
|
4440
4505
|
depth: t + 1,
|
|
4441
4506
|
index: r,
|
|
@@ -4453,7 +4518,7 @@ function $t({ item: e, depth: t, index: n, total: r, readOnly: i, onRemove: a, o
|
|
|
4453
4518
|
t: h
|
|
4454
4519
|
}, n.id)) })] });
|
|
4455
4520
|
}
|
|
4456
|
-
function
|
|
4521
|
+
function rn({ items: e, t }) {
|
|
4457
4522
|
return /* @__PURE__ */ Y("div", {
|
|
4458
4523
|
"data-testid": "nav-designer-preview",
|
|
4459
4524
|
className: "w-56 shrink-0 rounded-lg border border-gray-200 bg-gray-50 p-3",
|
|
@@ -4465,15 +4530,15 @@ function en({ items: e, t }) {
|
|
|
4465
4530
|
children: t("appDesigner.navNoPreviewItems")
|
|
4466
4531
|
}) : /* @__PURE__ */ J("ul", {
|
|
4467
4532
|
className: "space-y-0.5",
|
|
4468
|
-
children: e.map((e) => /* @__PURE__ */ J(
|
|
4533
|
+
children: e.map((e) => /* @__PURE__ */ J(an, {
|
|
4469
4534
|
item: e,
|
|
4470
4535
|
depth: 0
|
|
4471
4536
|
}, e.id))
|
|
4472
4537
|
})]
|
|
4473
4538
|
});
|
|
4474
4539
|
}
|
|
4475
|
-
function
|
|
4476
|
-
let n =
|
|
4540
|
+
function an({ item: e, depth: t }) {
|
|
4541
|
+
let n = en[e.type];
|
|
4477
4542
|
return e.type === "separator" ? /* @__PURE__ */ J("li", {
|
|
4478
4543
|
className: "my-1 border-t border-gray-200",
|
|
4479
4544
|
style: { marginLeft: t * 12 }
|
|
@@ -4482,15 +4547,15 @@ function tn({ item: e, depth: t }) {
|
|
|
4482
4547
|
style: { marginLeft: t * 12 },
|
|
4483
4548
|
children: [/* @__PURE__ */ J(n.Icon, { className: "h-3 w-3 text-gray-400" }), /* @__PURE__ */ J("span", {
|
|
4484
4549
|
className: "truncate",
|
|
4485
|
-
children:
|
|
4550
|
+
children: Ge(e.label)
|
|
4486
4551
|
})]
|
|
4487
|
-
}), e.type === "group" && e.children?.map((e) => /* @__PURE__ */ J(
|
|
4552
|
+
}), e.type === "group" && e.children?.map((e) => /* @__PURE__ */ J(an, {
|
|
4488
4553
|
item: e,
|
|
4489
4554
|
depth: t + 1
|
|
4490
4555
|
}, e.id))] });
|
|
4491
4556
|
}
|
|
4492
|
-
function
|
|
4493
|
-
let { t: u } =
|
|
4557
|
+
function on({ items: e, onChange: t, readOnly: n = !1, showPreview: r = !0, className: a, onExport: o, onImport: s }) {
|
|
4558
|
+
let { t: u } = zt(), d = c(null), [f, p] = l(() => new Set(e.filter((e) => e.type === "group").map((e) => e.id))), m = i((n) => {
|
|
4494
4559
|
function r(e) {
|
|
4495
4560
|
return e.filter((e) => e.id !== n).map((e) => e.children ? {
|
|
4496
4561
|
...e,
|
|
@@ -4550,9 +4615,9 @@ function nn({ items: e, onChange: t, readOnly: n = !1, showPreview: r = !0, clas
|
|
|
4550
4615
|
t(r(e));
|
|
4551
4616
|
}, [e, t]), y = i((n, r) => {
|
|
4552
4617
|
let i = {
|
|
4553
|
-
id:
|
|
4618
|
+
id: $t(r),
|
|
4554
4619
|
type: r,
|
|
4555
|
-
label: r === "separator" ? "" : `New ${u(
|
|
4620
|
+
label: r === "separator" ? "" : `New ${u(en[r].labelKey)}`,
|
|
4556
4621
|
...r === "group" ? { children: [] } : {},
|
|
4557
4622
|
...r === "url" ? { url: "" } : {}
|
|
4558
4623
|
};
|
|
@@ -4568,9 +4633,9 @@ function nn({ items: e, onChange: t, readOnly: n = !1, showPreview: r = !0, clas
|
|
|
4568
4633
|
t(a(e)), p((e) => new Set(e).add(n));
|
|
4569
4634
|
}, [e, t]), b = i((n) => {
|
|
4570
4635
|
let r = {
|
|
4571
|
-
id:
|
|
4636
|
+
id: $t(n),
|
|
4572
4637
|
type: n,
|
|
4573
|
-
label: n === "separator" ? "" : `New ${u(
|
|
4638
|
+
label: n === "separator" ? "" : `New ${u(en[n].labelKey)}`,
|
|
4574
4639
|
...n === "group" ? { children: [] } : {},
|
|
4575
4640
|
...n === "url" ? { url: "" } : {}
|
|
4576
4641
|
};
|
|
@@ -4603,20 +4668,20 @@ function nn({ items: e, onChange: t, readOnly: n = !1, showPreview: r = !0, clas
|
|
|
4603
4668
|
}, [t, s]);
|
|
4604
4669
|
return /* @__PURE__ */ Y("div", {
|
|
4605
4670
|
"data-testid": "navigation-designer",
|
|
4606
|
-
className:
|
|
4671
|
+
className: Zt("flex flex-col gap-4 sm:flex-row", a),
|
|
4607
4672
|
children: [/* @__PURE__ */ Y("div", {
|
|
4608
4673
|
className: "flex-1 space-y-3",
|
|
4609
4674
|
children: [/* @__PURE__ */ Y("div", {
|
|
4610
4675
|
className: "flex flex-wrap items-center gap-1.5",
|
|
4611
4676
|
children: [
|
|
4612
|
-
|
|
4613
|
-
let { Icon: r, color: i } =
|
|
4677
|
+
tn.map(({ type: e, labelKey: t }) => {
|
|
4678
|
+
let { Icon: r, color: i } = en[e];
|
|
4614
4679
|
return /* @__PURE__ */ Y("button", {
|
|
4615
4680
|
type: "button",
|
|
4616
4681
|
"data-testid": `nav-designer-add-${e}`,
|
|
4617
4682
|
onClick: () => b(e),
|
|
4618
4683
|
disabled: n,
|
|
4619
|
-
className:
|
|
4684
|
+
className: Zt("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"),
|
|
4620
4685
|
children: [/* @__PURE__ */ J(be, { className: "h-3 w-3" }), u(t)]
|
|
4621
4686
|
}, e);
|
|
4622
4687
|
}),
|
|
@@ -4630,7 +4695,7 @@ function nn({ items: e, onChange: t, readOnly: n = !1, showPreview: r = !0, clas
|
|
|
4630
4695
|
}),
|
|
4631
4696
|
/* @__PURE__ */ Y("label", {
|
|
4632
4697
|
"data-testid": "nav-designer-import",
|
|
4633
|
-
className:
|
|
4698
|
+
className: Zt("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"),
|
|
4634
4699
|
children: [
|
|
4635
4700
|
/* @__PURE__ */ J(Fe, { className: "h-3 w-3" }),
|
|
4636
4701
|
u("appDesigner.navImportSchema"),
|
|
@@ -4652,7 +4717,7 @@ function nn({ items: e, onChange: t, readOnly: n = !1, showPreview: r = !0, clas
|
|
|
4652
4717
|
}) : /* @__PURE__ */ J("ul", {
|
|
4653
4718
|
className: "space-y-1",
|
|
4654
4719
|
"data-testid": "nav-designer-tree",
|
|
4655
|
-
children: e.map((t, r) => /* @__PURE__ */ J(
|
|
4720
|
+
children: e.map((t, r) => /* @__PURE__ */ J(nn, {
|
|
4656
4721
|
item: t,
|
|
4657
4722
|
depth: 0,
|
|
4658
4723
|
index: r,
|
|
@@ -4670,7 +4735,7 @@ function nn({ items: e, onChange: t, readOnly: n = !1, showPreview: r = !0, clas
|
|
|
4670
4735
|
t: u
|
|
4671
4736
|
}, t.id))
|
|
4672
4737
|
})]
|
|
4673
|
-
}), r && /* @__PURE__ */ J(
|
|
4738
|
+
}), r && /* @__PURE__ */ J(rn, {
|
|
4674
4739
|
items: e,
|
|
4675
4740
|
t: u
|
|
4676
4741
|
})]
|
|
@@ -4678,10 +4743,10 @@ function nn({ items: e, onChange: t, readOnly: n = !1, showPreview: r = !0, clas
|
|
|
4678
4743
|
}
|
|
4679
4744
|
//#endregion
|
|
4680
4745
|
//#region src/EditorModeToggle.tsx
|
|
4681
|
-
function
|
|
4746
|
+
function sn(...e) {
|
|
4682
4747
|
return K(G(e));
|
|
4683
4748
|
}
|
|
4684
|
-
var
|
|
4749
|
+
var cn = [
|
|
4685
4750
|
{
|
|
4686
4751
|
value: "edit",
|
|
4687
4752
|
label: "Edit",
|
|
@@ -4698,30 +4763,30 @@ var an = [
|
|
|
4698
4763
|
Icon: S
|
|
4699
4764
|
}
|
|
4700
4765
|
];
|
|
4701
|
-
function
|
|
4766
|
+
function ln({ mode: e, onChange: t, disabled: n = !1, className: r }) {
|
|
4702
4767
|
return /* @__PURE__ */ J("div", {
|
|
4703
4768
|
"data-testid": "editor-mode-toggle",
|
|
4704
|
-
className:
|
|
4769
|
+
className: sn("inline-flex items-center rounded-lg border border-gray-200 bg-gray-50 p-0.5", r),
|
|
4705
4770
|
role: "radiogroup",
|
|
4706
4771
|
"aria-label": "Editor mode",
|
|
4707
|
-
children:
|
|
4772
|
+
children: cn.map(({ value: r, label: i, Icon: a }) => /* @__PURE__ */ Y("button", {
|
|
4708
4773
|
type: "button",
|
|
4709
4774
|
role: "radio",
|
|
4710
4775
|
"aria-checked": e === r,
|
|
4711
4776
|
"data-testid": `editor-mode-${r}`,
|
|
4712
4777
|
onClick: () => t(r),
|
|
4713
4778
|
disabled: n,
|
|
4714
|
-
className:
|
|
4779
|
+
className: sn("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"),
|
|
4715
4780
|
children: [/* @__PURE__ */ J(a, { className: "h-3.5 w-3.5" }), i]
|
|
4716
4781
|
}, r))
|
|
4717
4782
|
});
|
|
4718
4783
|
}
|
|
4719
4784
|
//#endregion
|
|
4720
4785
|
//#region src/DashboardEditor.tsx
|
|
4721
|
-
function
|
|
4786
|
+
function un(...e) {
|
|
4722
4787
|
return K(G(e));
|
|
4723
4788
|
}
|
|
4724
|
-
var
|
|
4789
|
+
var dn = [
|
|
4725
4790
|
{
|
|
4726
4791
|
type: "metric",
|
|
4727
4792
|
label: "KPI Metric",
|
|
@@ -4752,16 +4817,22 @@ var cn = [
|
|
|
4752
4817
|
label: "Grid",
|
|
4753
4818
|
Icon: ne
|
|
4754
4819
|
}
|
|
4755
|
-
],
|
|
4756
|
-
function
|
|
4757
|
-
return
|
|
4820
|
+
], fn = 0;
|
|
4821
|
+
function pn() {
|
|
4822
|
+
return fn += 1, `widget_${Date.now()}_${fn}`;
|
|
4758
4823
|
}
|
|
4759
|
-
function
|
|
4760
|
-
|
|
4824
|
+
function mn(e, t) {
|
|
4825
|
+
return Ye(e, t);
|
|
4826
|
+
}
|
|
4827
|
+
function hn(e) {
|
|
4828
|
+
return e == null || typeof e == "string";
|
|
4829
|
+
}
|
|
4830
|
+
function gn({ widget: e, index: t, total: n, selected: r, readOnly: i, onSelect: a, onRemove: o, onMoveUp: s, onMoveDown: c }) {
|
|
4831
|
+
let l = e.type || "metric", u = dn.find((e) => e.type === l) || dn[0], { language: d } = zt(), f = mn(e.title, d);
|
|
4761
4832
|
return /* @__PURE__ */ Y("div", {
|
|
4762
4833
|
"data-testid": `dashboard-widget-${e.id}`,
|
|
4763
4834
|
onClick: a,
|
|
4764
|
-
className:
|
|
4835
|
+
className: un("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"),
|
|
4765
4836
|
children: [/* @__PURE__ */ Y("div", {
|
|
4766
4837
|
className: "flex items-start justify-between",
|
|
4767
4838
|
children: [/* @__PURE__ */ Y("div", {
|
|
@@ -4771,7 +4842,7 @@ function dn({ widget: e, index: t, total: n, selected: r, readOnly: i, onSelect:
|
|
|
4771
4842
|
/* @__PURE__ */ J(u.Icon, { className: "h-4 w-4 text-gray-500" }),
|
|
4772
4843
|
/* @__PURE__ */ J("span", {
|
|
4773
4844
|
className: "text-sm font-medium text-gray-800",
|
|
4774
|
-
children:
|
|
4845
|
+
children: f || `Widget ${t + 1}`
|
|
4775
4846
|
})
|
|
4776
4847
|
]
|
|
4777
4848
|
}), !i && /* @__PURE__ */ Y("div", {
|
|
@@ -4818,8 +4889,8 @@ function dn({ widget: e, index: t, total: n, selected: r, readOnly: i, onSelect:
|
|
|
4818
4889
|
})]
|
|
4819
4890
|
});
|
|
4820
4891
|
}
|
|
4821
|
-
function
|
|
4822
|
-
let { t: i } =
|
|
4892
|
+
function _n({ widget: e, readOnly: t, onChange: n, onClose: r }) {
|
|
4893
|
+
let { t: i, language: a } = zt(), o = mn(e.title, a);
|
|
4823
4894
|
return /* @__PURE__ */ Y("div", {
|
|
4824
4895
|
"data-testid": "widget-property-panel",
|
|
4825
4896
|
className: "shrink-0 space-y-4 rounded-lg border border-gray-200 bg-white p-4",
|
|
@@ -4847,10 +4918,13 @@ function fn({ widget: e, readOnly: t, onChange: n, onClose: r }) {
|
|
|
4847
4918
|
id: "widget-title",
|
|
4848
4919
|
"data-testid": "widget-prop-title",
|
|
4849
4920
|
type: "text",
|
|
4850
|
-
value: e.title ?? "",
|
|
4851
|
-
onChange: (
|
|
4921
|
+
value: hn(e.title) ? e.title ?? "" : o,
|
|
4922
|
+
onChange: (t) => {
|
|
4923
|
+
hn(e.title) && n({ title: t.target.value });
|
|
4924
|
+
},
|
|
4925
|
+
readOnly: !hn(e.title),
|
|
4852
4926
|
disabled: t,
|
|
4853
|
-
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"
|
|
4927
|
+
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 read-only:bg-gray-50 read-only:text-gray-500"
|
|
4854
4928
|
})]
|
|
4855
4929
|
}),
|
|
4856
4930
|
/* @__PURE__ */ Y("div", {
|
|
@@ -4866,7 +4940,7 @@ function fn({ widget: e, readOnly: t, onChange: n, onClose: r }) {
|
|
|
4866
4940
|
onChange: (e) => n({ type: e.target.value }),
|
|
4867
4941
|
disabled: t,
|
|
4868
4942
|
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",
|
|
4869
|
-
children:
|
|
4943
|
+
children: dn.map((e) => /* @__PURE__ */ J("option", {
|
|
4870
4944
|
value: e.type,
|
|
4871
4945
|
children: e.label
|
|
4872
4946
|
}, e.type))
|
|
@@ -4972,29 +5046,29 @@ function fn({ widget: e, readOnly: t, onChange: n, onClose: r }) {
|
|
|
4972
5046
|
]
|
|
4973
5047
|
});
|
|
4974
5048
|
}
|
|
4975
|
-
function
|
|
4976
|
-
let { t } =
|
|
5049
|
+
function vn({ schema: e }) {
|
|
5050
|
+
let { t, language: n } = zt(), r = e.widgets || [];
|
|
4977
5051
|
return /* @__PURE__ */ Y("div", {
|
|
4978
5052
|
"data-testid": "dashboard-preview",
|
|
4979
5053
|
className: "rounded-lg border border-gray-200 bg-gray-50 p-4",
|
|
4980
5054
|
children: [/* @__PURE__ */ J("h4", {
|
|
4981
5055
|
className: "mb-3 text-sm font-semibold text-gray-700",
|
|
4982
5056
|
children: e.title || t("appDesigner.dashboardPreview")
|
|
4983
|
-
}),
|
|
5057
|
+
}), r.length === 0 ? /* @__PURE__ */ J("div", {
|
|
4984
5058
|
className: "text-xs text-gray-400",
|
|
4985
5059
|
children: t("appDesigner.noWidgetsPreview")
|
|
4986
5060
|
}) : /* @__PURE__ */ J("div", {
|
|
4987
5061
|
className: "grid gap-2",
|
|
4988
5062
|
style: { gridTemplateColumns: `repeat(${e.columns ?? 2}, 1fr)` },
|
|
4989
|
-
children:
|
|
4990
|
-
let t =
|
|
5063
|
+
children: r.map((e) => {
|
|
5064
|
+
let t = dn.find((t) => t.type === (e.type || "metric")) || dn[0];
|
|
4991
5065
|
return /* @__PURE__ */ Y("div", {
|
|
4992
5066
|
className: "rounded-md border border-gray-200 bg-white p-2",
|
|
4993
5067
|
children: [/* @__PURE__ */ Y("div", {
|
|
4994
5068
|
className: "flex items-center gap-1.5",
|
|
4995
5069
|
children: [/* @__PURE__ */ J(t.Icon, { className: "h-3 w-3 text-gray-400" }), /* @__PURE__ */ J("span", {
|
|
4996
5070
|
className: "text-xs font-medium text-gray-600",
|
|
4997
|
-
children: e.title || "Untitled"
|
|
5071
|
+
children: mn(e.title, n) || "Untitled"
|
|
4998
5072
|
})]
|
|
4999
5073
|
}), /* @__PURE__ */ J("div", {
|
|
5000
5074
|
className: "mt-1 text-[10px] text-gray-400",
|
|
@@ -5005,17 +5079,17 @@ function pn({ schema: e }) {
|
|
|
5005
5079
|
})]
|
|
5006
5080
|
});
|
|
5007
5081
|
}
|
|
5008
|
-
function
|
|
5009
|
-
let { t: f } =
|
|
5082
|
+
function yn({ schema: e, onChange: t, readOnly: n = !1, className: r, onExport: a, onImport: s, selectedWidgetId: u, onWidgetSelect: d }) {
|
|
5083
|
+
let { t: f } = zt(), [p, m] = l(null), [h, g] = l(!1), _ = c(null), v = c(null), y = u !== void 0, b = y ? u : p, x = i((e) => {
|
|
5010
5084
|
d && d(e), y || m(e);
|
|
5011
5085
|
}, [
|
|
5012
5086
|
y,
|
|
5013
5087
|
d,
|
|
5014
5088
|
m
|
|
5015
|
-
]), { current: S, canUndo: C, canRedo: w, push: T, undo: E, redo: A } =
|
|
5089
|
+
]), { current: S, canUndo: C, canRedo: w, push: T, undo: E, redo: A } = it(e), j = i((e) => {
|
|
5016
5090
|
T(e), t(e);
|
|
5017
5091
|
}, [T, t]), M = S.widgets || [], N = M.find((e) => e.id === b), P = i((e) => {
|
|
5018
|
-
let t =
|
|
5092
|
+
let t = pn(), n = {
|
|
5019
5093
|
id: t,
|
|
5020
5094
|
title: "",
|
|
5021
5095
|
type: e,
|
|
@@ -5121,7 +5195,7 @@ function mn({ schema: e, onChange: t, readOnly: n = !1, className: r, onExport:
|
|
|
5121
5195
|
ref: _,
|
|
5122
5196
|
tabIndex: 0,
|
|
5123
5197
|
"data-testid": "dashboard-editor",
|
|
5124
|
-
className:
|
|
5198
|
+
className: un("flex flex-col gap-4 outline-none", r),
|
|
5125
5199
|
children: [
|
|
5126
5200
|
/* @__PURE__ */ J("input", {
|
|
5127
5201
|
ref: v,
|
|
@@ -5131,7 +5205,7 @@ function mn({ schema: e, onChange: t, readOnly: n = !1, className: r, onExport:
|
|
|
5131
5205
|
"data-testid": "dashboard-import-input",
|
|
5132
5206
|
onChange: ee
|
|
5133
5207
|
}),
|
|
5134
|
-
N && !h && /* @__PURE__ */ J(
|
|
5208
|
+
N && !h && /* @__PURE__ */ J(_n, {
|
|
5135
5209
|
widget: N,
|
|
5136
5210
|
readOnly: n,
|
|
5137
5211
|
onChange: L,
|
|
@@ -5146,7 +5220,7 @@ function mn({ schema: e, onChange: t, readOnly: n = !1, className: r, onExport:
|
|
|
5146
5220
|
children: [/* @__PURE__ */ Y("span", {
|
|
5147
5221
|
className: "text-sm font-medium text-gray-700",
|
|
5148
5222
|
children: [f("appDesigner.addWidget"), ":"]
|
|
5149
|
-
}),
|
|
5223
|
+
}), dn.map(({ type: e, label: t, Icon: r }) => /* @__PURE__ */ Y("button", {
|
|
5150
5224
|
type: "button",
|
|
5151
5225
|
"data-testid": `dashboard-add-${e}`,
|
|
5152
5226
|
onClick: () => P(e),
|
|
@@ -5194,19 +5268,19 @@ function mn({ schema: e, onChange: t, readOnly: n = !1, className: r, onExport:
|
|
|
5194
5268
|
type: "button",
|
|
5195
5269
|
"data-testid": "dashboard-preview-toggle",
|
|
5196
5270
|
onClick: () => g((e) => !e),
|
|
5197
|
-
className:
|
|
5271
|
+
className: un("rounded p-1.5 transition-colors", h ? "bg-blue-100 text-blue-600" : "text-gray-400 hover:text-gray-700"),
|
|
5198
5272
|
"aria-label": f(h ? "appDesigner.modeEdit" : "appDesigner.preview"),
|
|
5199
5273
|
children: J(h ? k : O, { className: "h-4 w-4" })
|
|
5200
5274
|
})
|
|
5201
5275
|
]
|
|
5202
5276
|
})]
|
|
5203
|
-
}), h ? /* @__PURE__ */ J(
|
|
5277
|
+
}), h ? /* @__PURE__ */ J(vn, { schema: S }) : M.length === 0 ? /* @__PURE__ */ J("div", {
|
|
5204
5278
|
className: "flex h-48 items-center justify-center rounded-lg border-2 border-dashed border-gray-200 text-sm text-gray-400",
|
|
5205
5279
|
children: f("appDesigner.noWidgets")
|
|
5206
5280
|
}) : /* @__PURE__ */ J("div", {
|
|
5207
5281
|
className: "grid gap-3",
|
|
5208
5282
|
style: { gridTemplateColumns: `repeat(${S.columns ?? 2}, 1fr)` },
|
|
5209
|
-
children: M.map((e, t) => /* @__PURE__ */ J(
|
|
5283
|
+
children: M.map((e, t) => /* @__PURE__ */ J(gn, {
|
|
5210
5284
|
widget: e,
|
|
5211
5285
|
index: t,
|
|
5212
5286
|
total: M.length,
|
|
@@ -5227,7 +5301,7 @@ function mn({ schema: e, onChange: t, readOnly: n = !1, className: r, onExport:
|
|
|
5227
5301
|
function $(...e) {
|
|
5228
5302
|
return K(G(e));
|
|
5229
5303
|
}
|
|
5230
|
-
var
|
|
5304
|
+
var bn = [
|
|
5231
5305
|
{
|
|
5232
5306
|
hex: "#3b82f6",
|
|
5233
5307
|
name: "Blue"
|
|
@@ -5292,7 +5366,7 @@ var hn = [
|
|
|
5292
5366
|
hex: "#0f172a",
|
|
5293
5367
|
name: "Navy"
|
|
5294
5368
|
}
|
|
5295
|
-
],
|
|
5369
|
+
], xn = [
|
|
5296
5370
|
"Inter",
|
|
5297
5371
|
"Roboto",
|
|
5298
5372
|
"Open Sans",
|
|
@@ -5303,8 +5377,8 @@ var hn = [
|
|
|
5303
5377
|
"Noto Sans",
|
|
5304
5378
|
"system-ui"
|
|
5305
5379
|
];
|
|
5306
|
-
function
|
|
5307
|
-
let { t: d } =
|
|
5380
|
+
function Sn({ branding: e, onChange: t, appTitle: n = "My App", readOnly: r = !1, className: a, onExport: s, onImport: u }) {
|
|
5381
|
+
let { t: d } = zt(), [f, p] = l("light"), { current: m, push: h, canUndo: g, canRedo: _, undo: v, redo: y } = it(e), b = c(!0);
|
|
5308
5382
|
o(() => {
|
|
5309
5383
|
if (b.current) {
|
|
5310
5384
|
b.current = !1;
|
|
@@ -5477,7 +5551,7 @@ function _n({ branding: e, onChange: t, appTitle: n = "My App", readOnly: r = !1
|
|
|
5477
5551
|
}), /* @__PURE__ */ J("div", {
|
|
5478
5552
|
"data-testid": "branding-color-palette",
|
|
5479
5553
|
className: "flex flex-wrap gap-1.5",
|
|
5480
|
-
children:
|
|
5554
|
+
children: bn.map((e) => /* @__PURE__ */ J("button", {
|
|
5481
5555
|
"data-testid": `branding-swatch-${e.hex.slice(1)}`,
|
|
5482
5556
|
type: "button",
|
|
5483
5557
|
onClick: () => !r && x({ primaryColor: e.hex }),
|
|
@@ -5528,7 +5602,7 @@ function _n({ branding: e, onChange: t, appTitle: n = "My App", readOnly: r = !1
|
|
|
5528
5602
|
children: [/* @__PURE__ */ J("option", {
|
|
5529
5603
|
value: "",
|
|
5530
5604
|
children: d("appDesigner.fontDefault")
|
|
5531
|
-
}),
|
|
5605
|
+
}), xn.map((e) => /* @__PURE__ */ J("option", {
|
|
5532
5606
|
value: e,
|
|
5533
5607
|
children: e
|
|
5534
5608
|
}, e))]
|
|
@@ -5673,15 +5747,15 @@ function _n({ branding: e, onChange: t, appTitle: n = "My App", readOnly: r = !1
|
|
|
5673
5747
|
}
|
|
5674
5748
|
//#endregion
|
|
5675
5749
|
//#region src/ObjectManager.tsx
|
|
5676
|
-
function
|
|
5750
|
+
function Cn(...e) {
|
|
5677
5751
|
return K(G(e));
|
|
5678
5752
|
}
|
|
5679
|
-
var
|
|
5753
|
+
var wn = [
|
|
5680
5754
|
"Custom Objects",
|
|
5681
5755
|
"System Objects",
|
|
5682
5756
|
"Integration",
|
|
5683
5757
|
"Analytics"
|
|
5684
|
-
],
|
|
5758
|
+
], Tn = [
|
|
5685
5759
|
"Box",
|
|
5686
5760
|
"Database",
|
|
5687
5761
|
"Users",
|
|
@@ -5703,8 +5777,8 @@ var yn = [
|
|
|
5703
5777
|
"Truck",
|
|
5704
5778
|
"CreditCard"
|
|
5705
5779
|
];
|
|
5706
|
-
function
|
|
5707
|
-
let { t: u } =
|
|
5780
|
+
function En({ objects: e, onObjectsChange: n, onSelectObject: r, showSystemObjects: a = !0, readOnly: o = !1, className: c }) {
|
|
5781
|
+
let { t: u } = zt(), 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(() => [
|
|
5708
5782
|
{
|
|
5709
5783
|
field: "name",
|
|
5710
5784
|
label: u("appDesigner.objectManager.objectName"),
|
|
@@ -5834,7 +5908,7 @@ function xn({ objects: e, onObjectsChange: n, onSelectObject: r, showSystemObjec
|
|
|
5834
5908
|
name: "icon",
|
|
5835
5909
|
label: u("appDesigner.objectManager.icon"),
|
|
5836
5910
|
type: "select",
|
|
5837
|
-
options:
|
|
5911
|
+
options: Tn.map((e) => ({
|
|
5838
5912
|
label: e,
|
|
5839
5913
|
value: e
|
|
5840
5914
|
})),
|
|
@@ -5844,7 +5918,7 @@ function xn({ objects: e, onObjectsChange: n, onSelectObject: r, showSystemObjec
|
|
|
5844
5918
|
name: "group",
|
|
5845
5919
|
label: u("appDesigner.objectManager.group"),
|
|
5846
5920
|
type: "select",
|
|
5847
|
-
options:
|
|
5921
|
+
options: wn.map((e) => ({
|
|
5848
5922
|
label: e,
|
|
5849
5923
|
value: e
|
|
5850
5924
|
})),
|
|
@@ -5879,7 +5953,7 @@ function xn({ objects: e, onObjectsChange: n, onSelectObject: r, showSystemObjec
|
|
|
5879
5953
|
]);
|
|
5880
5954
|
return /* @__PURE__ */ Y("div", {
|
|
5881
5955
|
"data-testid": "object-manager",
|
|
5882
|
-
className:
|
|
5956
|
+
className: Cn("w-full space-y-3", c),
|
|
5883
5957
|
children: [
|
|
5884
5958
|
/* @__PURE__ */ J("div", {
|
|
5885
5959
|
className: "flex items-center justify-between",
|
|
@@ -5898,7 +5972,7 @@ function xn({ objects: e, onObjectsChange: n, onSelectObject: r, showSystemObjec
|
|
|
5898
5972
|
]
|
|
5899
5973
|
})
|
|
5900
5974
|
}),
|
|
5901
|
-
/* @__PURE__ */ J(
|
|
5975
|
+
/* @__PURE__ */ J(Xe, {
|
|
5902
5976
|
schema: y,
|
|
5903
5977
|
dataSource: _,
|
|
5904
5978
|
onRowClick: b,
|
|
@@ -5906,8 +5980,8 @@ function xn({ objects: e, onObjectsChange: n, onSelectObject: r, showSystemObjec
|
|
|
5906
5980
|
onDelete: o ? void 0 : S,
|
|
5907
5981
|
onAddRecord: o ? void 0 : C
|
|
5908
5982
|
}),
|
|
5909
|
-
f && /* @__PURE__ */ J(
|
|
5910
|
-
/* @__PURE__ */ J(
|
|
5983
|
+
f && /* @__PURE__ */ J(Qe, { schema: D }),
|
|
5984
|
+
/* @__PURE__ */ J(ut, {
|
|
5911
5985
|
isOpen: d.isOpen,
|
|
5912
5986
|
title: d.title,
|
|
5913
5987
|
message: d.message,
|
|
@@ -5922,10 +5996,10 @@ function xn({ objects: e, onObjectsChange: n, onSelectObject: r, showSystemObjec
|
|
|
5922
5996
|
}
|
|
5923
5997
|
//#endregion
|
|
5924
5998
|
//#region src/FieldDesigner.tsx
|
|
5925
|
-
function
|
|
5999
|
+
function Dn(...e) {
|
|
5926
6000
|
return K(G(e));
|
|
5927
6001
|
}
|
|
5928
|
-
var
|
|
6002
|
+
var On = {
|
|
5929
6003
|
text: {
|
|
5930
6004
|
label: "Text",
|
|
5931
6005
|
Icon: Ne
|
|
@@ -6034,7 +6108,7 @@ var Cn = {
|
|
|
6034
6108
|
label: "Slider",
|
|
6035
6109
|
Icon: Te
|
|
6036
6110
|
}
|
|
6037
|
-
},
|
|
6111
|
+
}, kn = {
|
|
6038
6112
|
text: [
|
|
6039
6113
|
"text",
|
|
6040
6114
|
"textarea",
|
|
@@ -6069,7 +6143,7 @@ var Cn = {
|
|
|
6069
6143
|
"location",
|
|
6070
6144
|
"address"
|
|
6071
6145
|
]
|
|
6072
|
-
},
|
|
6146
|
+
}, An = [
|
|
6073
6147
|
"text",
|
|
6074
6148
|
"number",
|
|
6075
6149
|
"date",
|
|
@@ -6077,8 +6151,8 @@ var Cn = {
|
|
|
6077
6151
|
"relation",
|
|
6078
6152
|
"advanced"
|
|
6079
6153
|
];
|
|
6080
|
-
function
|
|
6081
|
-
let { t: c } =
|
|
6154
|
+
function jn({ objectName: e, fields: n, onFieldsChange: r, readOnly: a = !1, className: o }) {
|
|
6155
|
+
let { t: c } = zt(), 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(() => [
|
|
6082
6156
|
{
|
|
6083
6157
|
field: "name",
|
|
6084
6158
|
label: c("appDesigner.fieldDesigner.fieldName"),
|
|
@@ -6189,11 +6263,11 @@ function En({ objectName: e, fields: n, onFieldsChange: r, readOnly: a = !1, cla
|
|
|
6189
6263
|
r
|
|
6190
6264
|
]), E = i((e) => {
|
|
6191
6265
|
e || (f(!1), m(null));
|
|
6192
|
-
}, []), D = s(() =>
|
|
6266
|
+
}, []), D = s(() => An.map((e) => ({
|
|
6193
6267
|
category: e,
|
|
6194
6268
|
label: c(`appDesigner.fieldDesigner.typeCategory.${e}`),
|
|
6195
|
-
options:
|
|
6196
|
-
label:
|
|
6269
|
+
options: kn[e].map((e) => ({
|
|
6270
|
+
label: On[e].label,
|
|
6197
6271
|
value: e
|
|
6198
6272
|
}))
|
|
6199
6273
|
})), [c]), O = s(() => D.flatMap((e) => e.options), [D]), k = s(() => ({
|
|
@@ -6373,7 +6447,7 @@ function En({ objectName: e, fields: n, onFieldsChange: r, readOnly: a = !1, cla
|
|
|
6373
6447
|
]);
|
|
6374
6448
|
return /* @__PURE__ */ Y("div", {
|
|
6375
6449
|
"data-testid": "field-designer",
|
|
6376
|
-
className:
|
|
6450
|
+
className: Dn("w-full space-y-3", o),
|
|
6377
6451
|
children: [
|
|
6378
6452
|
/* @__PURE__ */ Y("div", {
|
|
6379
6453
|
className: "flex items-center justify-between",
|
|
@@ -6411,15 +6485,15 @@ function En({ objectName: e, fields: n, onFieldsChange: r, readOnly: a = !1, cla
|
|
|
6411
6485
|
}, e.category))]
|
|
6412
6486
|
})]
|
|
6413
6487
|
}),
|
|
6414
|
-
/* @__PURE__ */ J(
|
|
6488
|
+
/* @__PURE__ */ J(Xe, {
|
|
6415
6489
|
schema: b,
|
|
6416
6490
|
dataSource: v,
|
|
6417
6491
|
onEdit: a ? void 0 : x,
|
|
6418
6492
|
onDelete: a ? void 0 : S,
|
|
6419
6493
|
onAddRecord: a ? void 0 : w
|
|
6420
6494
|
}),
|
|
6421
|
-
d && /* @__PURE__ */ J(
|
|
6422
|
-
/* @__PURE__ */ J(
|
|
6495
|
+
d && /* @__PURE__ */ J(Ze, { schema: k }),
|
|
6496
|
+
/* @__PURE__ */ J(ut, {
|
|
6423
6497
|
isOpen: u.isOpen,
|
|
6424
6498
|
title: u.title,
|
|
6425
6499
|
message: u.message,
|
|
@@ -6434,12 +6508,12 @@ function En({ objectName: e, fields: n, onFieldsChange: r, readOnly: a = !1, cla
|
|
|
6434
6508
|
}
|
|
6435
6509
|
//#endregion
|
|
6436
6510
|
//#region src/components/VersionHistory.tsx
|
|
6437
|
-
function
|
|
6511
|
+
function Mn(...e) {
|
|
6438
6512
|
return K(G(e));
|
|
6439
6513
|
}
|
|
6440
|
-
function
|
|
6514
|
+
function Nn({ versions: e, onRestore: t, className: n }) {
|
|
6441
6515
|
return /* @__PURE__ */ Y("div", {
|
|
6442
|
-
className:
|
|
6516
|
+
className: Mn("flex flex-col", n),
|
|
6443
6517
|
role: "region",
|
|
6444
6518
|
"aria-label": "Version history",
|
|
6445
6519
|
children: [/* @__PURE__ */ Y("div", {
|
|
@@ -6453,8 +6527,8 @@ function On({ versions: e, onRestore: t, className: n }) {
|
|
|
6453
6527
|
}) : /* @__PURE__ */ Y("div", {
|
|
6454
6528
|
className: "relative",
|
|
6455
6529
|
children: [/* @__PURE__ */ J("div", { className: "absolute left-5 top-0 bottom-0 w-px bg-border" }), e.map((e) => /* @__PURE__ */ Y("div", {
|
|
6456
|
-
className:
|
|
6457
|
-
children: [/* @__PURE__ */ J("div", { className:
|
|
6530
|
+
className: Mn("relative flex items-start gap-3 px-3 py-2 hover:bg-accent/50", e.isCurrent && "bg-accent/30"),
|
|
6531
|
+
children: [/* @__PURE__ */ J("div", { className: Mn("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__ */ Y("div", {
|
|
6458
6532
|
className: "flex-1 min-w-0",
|
|
6459
6533
|
children: [
|
|
6460
6534
|
/* @__PURE__ */ Y("div", {
|
|
@@ -6481,6 +6555,7 @@ function On({ versions: e, onRestore: t, className: n }) {
|
|
|
6481
6555
|
]
|
|
6482
6556
|
}),
|
|
6483
6557
|
!e.isCurrent && t && /* @__PURE__ */ J("button", {
|
|
6558
|
+
type: "button",
|
|
6484
6559
|
onClick: () => t(e.version),
|
|
6485
6560
|
className: "mt-1 text-[0.65rem] text-primary hover:underline",
|
|
6486
6561
|
children: "Restore this version"
|
|
@@ -6494,9 +6569,9 @@ function On({ versions: e, onRestore: t, className: n }) {
|
|
|
6494
6569
|
}
|
|
6495
6570
|
//#endregion
|
|
6496
6571
|
//#region src/pages/CreateAppPage.tsx
|
|
6497
|
-
var
|
|
6498
|
-
function
|
|
6499
|
-
let e =
|
|
6572
|
+
var Pn = "objectui-app-wizard-draft";
|
|
6573
|
+
function Fn() {
|
|
6574
|
+
let e = $e(), { appName: t } = et(), { objects: n, refresh: r } = qe(), a = Ke(), o = (n || []).map((e) => ({
|
|
6500
6575
|
name: e.name,
|
|
6501
6576
|
label: e.label || e.name,
|
|
6502
6577
|
pluralLabel: e.pluralLabel,
|
|
@@ -6504,15 +6579,15 @@ function An() {
|
|
|
6504
6579
|
selected: !1
|
|
6505
6580
|
})), s = i(() => {
|
|
6506
6581
|
try {
|
|
6507
|
-
let e = localStorage.getItem(
|
|
6582
|
+
let e = localStorage.getItem(Pn);
|
|
6508
6583
|
if (e) return JSON.parse(e);
|
|
6509
6584
|
} catch {}
|
|
6510
6585
|
}, []), c = i(async (t) => {
|
|
6511
6586
|
try {
|
|
6512
|
-
let n =
|
|
6513
|
-
i && await i.meta.saveItem("app", t.name, n), localStorage.removeItem(
|
|
6587
|
+
let n = We(t), i = a?.getClient();
|
|
6588
|
+
i && await i.meta.saveItem("app", t.name, n), localStorage.removeItem(Pn), tt.success(`Application "${t.title}" created successfully`), await r?.(), e(`/apps/${t.name}`);
|
|
6514
6589
|
} catch (e) {
|
|
6515
|
-
|
|
6590
|
+
tt.error(e?.message || "Failed to create application");
|
|
6516
6591
|
}
|
|
6517
6592
|
}, [
|
|
6518
6593
|
e,
|
|
@@ -6522,13 +6597,13 @@ function An() {
|
|
|
6522
6597
|
e(t ? `/apps/${t}` : "/");
|
|
6523
6598
|
}, [e, t]), u = i((e) => {
|
|
6524
6599
|
try {
|
|
6525
|
-
localStorage.setItem(
|
|
6600
|
+
localStorage.setItem(Pn, JSON.stringify(e)), tt.info("Draft saved");
|
|
6526
6601
|
} catch {}
|
|
6527
6602
|
}, []);
|
|
6528
6603
|
return /* @__PURE__ */ J("div", {
|
|
6529
6604
|
className: "mx-auto max-w-4xl py-8 px-4",
|
|
6530
6605
|
"data-testid": "create-app-page",
|
|
6531
|
-
children: /* @__PURE__ */ J(
|
|
6606
|
+
children: /* @__PURE__ */ J(Xt, {
|
|
6532
6607
|
availableObjects: o,
|
|
6533
6608
|
initialDraft: s(),
|
|
6534
6609
|
onComplete: c,
|
|
@@ -6539,8 +6614,8 @@ function An() {
|
|
|
6539
6614
|
}
|
|
6540
6615
|
//#endregion
|
|
6541
6616
|
//#region src/pages/EditAppPage.tsx
|
|
6542
|
-
function
|
|
6543
|
-
let e =
|
|
6617
|
+
function In() {
|
|
6618
|
+
let e = $e(), { appName: t, editAppName: n } = et(), { apps: r, objects: a, refresh: o } = qe(), c = Ke(), l = n || t, u = r.find((e) => e.name === l), d = (a || []).map((e) => ({
|
|
6544
6619
|
name: e.name,
|
|
6545
6620
|
label: e.label || e.name,
|
|
6546
6621
|
pluralLabel: e.pluralLabel,
|
|
@@ -6562,13 +6637,13 @@ function jn() {
|
|
|
6562
6637
|
};
|
|
6563
6638
|
}, [u]), p = i(async (t) => {
|
|
6564
6639
|
try {
|
|
6565
|
-
let n =
|
|
6640
|
+
let n = We(t), r = {
|
|
6566
6641
|
...u,
|
|
6567
6642
|
...n
|
|
6568
6643
|
}, i = c?.getClient();
|
|
6569
|
-
i && await i.meta.saveItem("app", t.name, r),
|
|
6644
|
+
i && await i.meta.saveItem("app", t.name, r), tt.success(`Application "${t.title}" updated successfully`), await o?.(), e(`/apps/${t.name}`);
|
|
6570
6645
|
} catch (e) {
|
|
6571
|
-
|
|
6646
|
+
tt.error(e?.message || "Failed to update application");
|
|
6572
6647
|
}
|
|
6573
6648
|
}, [
|
|
6574
6649
|
e,
|
|
@@ -6579,13 +6654,13 @@ function jn() {
|
|
|
6579
6654
|
e(t ? `/apps/${t}` : "/");
|
|
6580
6655
|
}, [e, t]), h = i((e) => {
|
|
6581
6656
|
try {
|
|
6582
|
-
localStorage.setItem(`objectui-edit-draft-${l}`, JSON.stringify(e)),
|
|
6657
|
+
localStorage.setItem(`objectui-edit-draft-${l}`, JSON.stringify(e)), tt.info("Draft saved");
|
|
6583
6658
|
} catch {}
|
|
6584
6659
|
}, [l]);
|
|
6585
6660
|
return u ? /* @__PURE__ */ J("div", {
|
|
6586
6661
|
className: "mx-auto max-w-4xl py-8 px-4",
|
|
6587
6662
|
"data-testid": "edit-app-page",
|
|
6588
|
-
children: /* @__PURE__ */ J(
|
|
6663
|
+
children: /* @__PURE__ */ J(Xt, {
|
|
6589
6664
|
availableObjects: d,
|
|
6590
6665
|
initialDraft: f,
|
|
6591
6666
|
onComplete: p,
|
|
@@ -6607,8 +6682,8 @@ function jn() {
|
|
|
6607
6682
|
}
|
|
6608
6683
|
//#endregion
|
|
6609
6684
|
//#region src/pages/DashboardDesignPage.tsx
|
|
6610
|
-
function
|
|
6611
|
-
let e =
|
|
6685
|
+
function Ln() {
|
|
6686
|
+
let e = $e(), { dashboardName: t } = et(), n = Ke(), { dashboards: r, refresh: a } = qe(), s = r?.find((e) => e.name === t), [u, f] = l(() => Ue(s) || {
|
|
6612
6687
|
type: "dashboard",
|
|
6613
6688
|
name: t ?? "",
|
|
6614
6689
|
title: t ?? "",
|
|
@@ -6626,21 +6701,22 @@ function Mn() {
|
|
|
6626
6701
|
t,
|
|
6627
6702
|
a
|
|
6628
6703
|
]), h = i(async (e) => {
|
|
6629
|
-
|
|
6704
|
+
let t = Ue(e);
|
|
6705
|
+
f(t), await m(t);
|
|
6630
6706
|
}, [m]);
|
|
6631
6707
|
o(() => {
|
|
6632
6708
|
let e = (e) => {
|
|
6633
6709
|
(e.ctrlKey || e.metaKey) && e.key === "s" && (e.preventDefault(), m(p.current).then((e) => {
|
|
6634
|
-
e &&
|
|
6710
|
+
e && tt.success("Dashboard saved");
|
|
6635
6711
|
}));
|
|
6636
6712
|
};
|
|
6637
6713
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
6638
6714
|
}, [m]);
|
|
6639
6715
|
let g = i((e) => {
|
|
6640
6716
|
let n = new Blob([JSON.stringify(e, null, 2)], { type: "application/json" }), r = URL.createObjectURL(n), i = document.createElement("a");
|
|
6641
|
-
i.href = r, i.download = `${t || "dashboard"}.json`, i.click(), URL.revokeObjectURL(r),
|
|
6717
|
+
i.href = r, i.download = `${t || "dashboard"}.json`, i.click(), URL.revokeObjectURL(r), tt.success("Dashboard schema exported");
|
|
6642
6718
|
}, [t]), _ = i((e) => {
|
|
6643
|
-
|
|
6719
|
+
tt.success("Dashboard schema imported"), h(e);
|
|
6644
6720
|
}, [h]);
|
|
6645
6721
|
return s ? /* @__PURE__ */ Y("div", {
|
|
6646
6722
|
className: "h-full flex flex-col",
|
|
@@ -6660,7 +6736,7 @@ function Mn() {
|
|
|
6660
6736
|
})]
|
|
6661
6737
|
}), /* @__PURE__ */ J("div", {
|
|
6662
6738
|
className: "flex-1 overflow-auto p-4 sm:p-6",
|
|
6663
|
-
children: /* @__PURE__ */ J(
|
|
6739
|
+
children: /* @__PURE__ */ J(yn, {
|
|
6664
6740
|
schema: u,
|
|
6665
6741
|
onChange: h,
|
|
6666
6742
|
onExport: g,
|
|
@@ -6678,7 +6754,7 @@ function Mn() {
|
|
|
6678
6754
|
}
|
|
6679
6755
|
//#endregion
|
|
6680
6756
|
//#region src/MetadataObjectsPage.tsx
|
|
6681
|
-
function
|
|
6757
|
+
function Rn(e) {
|
|
6682
6758
|
let t = e.fields && typeof e.fields == "object" ? Object.keys(e.fields).length : 0;
|
|
6683
6759
|
return {
|
|
6684
6760
|
id: e.name,
|
|
@@ -6692,11 +6768,11 @@ function Nn(e) {
|
|
|
6692
6768
|
fieldCount: t
|
|
6693
6769
|
};
|
|
6694
6770
|
}
|
|
6695
|
-
function
|
|
6771
|
+
function zn({ client: e, clientConfig: t, hideSystemObjects: n = !1, readOnly: r = !1, onSelectObject: a, className: c }) {
|
|
6696
6772
|
let u = s(() => {
|
|
6697
6773
|
if (e) return e;
|
|
6698
6774
|
if (!t) throw Error("MetadataObjectsPage: provide either `client` or `clientConfig`.");
|
|
6699
|
-
return new
|
|
6775
|
+
return new nt(t);
|
|
6700
6776
|
}, [e, t]), [d, f] = l({
|
|
6701
6777
|
loading: !0,
|
|
6702
6778
|
error: null,
|
|
@@ -6726,7 +6802,7 @@ function Pn({ client: e, clientConfig: t, hideSystemObjects: n = !1, readOnly: r
|
|
|
6726
6802
|
o(() => {
|
|
6727
6803
|
p();
|
|
6728
6804
|
}, [p]);
|
|
6729
|
-
let m = s(() => Object.values(d.byName).map(
|
|
6805
|
+
let m = s(() => Object.values(d.byName).map(Rn), [d.byName]), h = i(async (e) => {
|
|
6730
6806
|
let t = d.byName, n = {};
|
|
6731
6807
|
for (let t of e) n[t.name] = t;
|
|
6732
6808
|
let r = [];
|
|
@@ -6775,7 +6851,7 @@ function Pn({ client: e, clientConfig: t, hideSystemObjects: n = !1, readOnly: r
|
|
|
6775
6851
|
"data-testid": "metadata-objects-page-error",
|
|
6776
6852
|
className: "mb-2 whitespace-pre-wrap rounded bg-red-50 p-2 text-xs text-red-700",
|
|
6777
6853
|
children: d.error
|
|
6778
|
-
}), /* @__PURE__ */ J(
|
|
6854
|
+
}), /* @__PURE__ */ J(En, {
|
|
6779
6855
|
objects: m,
|
|
6780
6856
|
onObjectsChange: (e) => {
|
|
6781
6857
|
h(e);
|
|
@@ -6788,16 +6864,16 @@ function Pn({ client: e, clientConfig: t, hideSystemObjects: n = !1, readOnly: r
|
|
|
6788
6864
|
}
|
|
6789
6865
|
//#endregion
|
|
6790
6866
|
//#region src/MetadataFieldsPage.tsx
|
|
6791
|
-
var
|
|
6792
|
-
function
|
|
6793
|
-
return e &&
|
|
6867
|
+
var Bn = new Set(Ve);
|
|
6868
|
+
function Vn(e) {
|
|
6869
|
+
return e && Bn.has(e) ? e : "text";
|
|
6794
6870
|
}
|
|
6795
|
-
function
|
|
6871
|
+
function Hn(e, t) {
|
|
6796
6872
|
return {
|
|
6797
6873
|
id: e,
|
|
6798
6874
|
name: e,
|
|
6799
6875
|
label: t.label ?? e,
|
|
6800
|
-
type:
|
|
6876
|
+
type: Vn(t.type),
|
|
6801
6877
|
group: t.group,
|
|
6802
6878
|
description: t.description,
|
|
6803
6879
|
required: t.required,
|
|
@@ -6814,7 +6890,7 @@ function Ln(e, t) {
|
|
|
6814
6890
|
formula: t.formula
|
|
6815
6891
|
};
|
|
6816
6892
|
}
|
|
6817
|
-
function
|
|
6893
|
+
function Un(e, t) {
|
|
6818
6894
|
return {
|
|
6819
6895
|
...t ?? {},
|
|
6820
6896
|
type: e.type,
|
|
@@ -6834,11 +6910,11 @@ function Rn(e, t) {
|
|
|
6834
6910
|
formula: e.formula
|
|
6835
6911
|
};
|
|
6836
6912
|
}
|
|
6837
|
-
function
|
|
6913
|
+
function Wn({ objectName: e, client: t, clientConfig: n, readOnly: r = !1, className: a }) {
|
|
6838
6914
|
let c = s(() => {
|
|
6839
6915
|
if (t) return t;
|
|
6840
6916
|
if (!n) throw Error("MetadataFieldsPage: provide either `client` or `clientConfig`.");
|
|
6841
|
-
return new
|
|
6917
|
+
return new nt(n);
|
|
6842
6918
|
}, [t, n]), [u, d] = l({
|
|
6843
6919
|
loading: !0,
|
|
6844
6920
|
error: null,
|
|
@@ -6875,10 +6951,10 @@ function zn({ objectName: e, client: t, clientConfig: n, readOnly: r = !1, class
|
|
|
6875
6951
|
o(() => {
|
|
6876
6952
|
f();
|
|
6877
6953
|
}, [f]);
|
|
6878
|
-
let p = s(() => u.raw?.fields ? Object.entries(u.raw.fields).map(([e, t]) =>
|
|
6954
|
+
let p = s(() => u.raw?.fields ? Object.entries(u.raw.fields).map(([e, t]) => Hn(e, t)) : [], [u.raw]), m = i(async (t) => {
|
|
6879
6955
|
if (!u.raw) return;
|
|
6880
6956
|
let n = u.raw.fields ?? {}, r = {};
|
|
6881
|
-
for (let e of t) r[e.name] =
|
|
6957
|
+
for (let e of t) r[e.name] = Un(e, n[e.name]);
|
|
6882
6958
|
let i = {
|
|
6883
6959
|
...u.raw,
|
|
6884
6960
|
fields: r
|
|
@@ -6908,7 +6984,7 @@ function zn({ objectName: e, client: t, clientConfig: n, readOnly: r = !1, class
|
|
|
6908
6984
|
"data-testid": "metadata-fields-page-error",
|
|
6909
6985
|
className: "mb-2 whitespace-pre-wrap rounded bg-red-50 p-2 text-xs text-red-700",
|
|
6910
6986
|
children: u.error
|
|
6911
|
-
}), /* @__PURE__ */ J(
|
|
6987
|
+
}), /* @__PURE__ */ J(jn, {
|
|
6912
6988
|
objectName: e,
|
|
6913
6989
|
fields: p,
|
|
6914
6990
|
onFieldsChange: (e) => {
|
|
@@ -6918,7 +6994,7 @@ function zn({ objectName: e, client: t, clientConfig: n, readOnly: r = !1, class
|
|
|
6918
6994
|
})]
|
|
6919
6995
|
});
|
|
6920
6996
|
}
|
|
6921
|
-
e.register("page-designer",
|
|
6997
|
+
e.register("page-designer", St, {
|
|
6922
6998
|
namespace: "plugin-designer",
|
|
6923
6999
|
label: "Page Designer",
|
|
6924
7000
|
category: "Designer",
|
|
@@ -6952,7 +7028,7 @@ e.register("page-designer", bt, {
|
|
|
6952
7028
|
defaultValue: !1
|
|
6953
7029
|
}
|
|
6954
7030
|
]
|
|
6955
|
-
}), e.register("data-model-designer",
|
|
7031
|
+
}), e.register("data-model-designer", Ot, {
|
|
6956
7032
|
namespace: "plugin-designer",
|
|
6957
7033
|
label: "Data Model Designer",
|
|
6958
7034
|
category: "Designer",
|
|
@@ -6980,7 +7056,7 @@ e.register("page-designer", bt, {
|
|
|
6980
7056
|
defaultValue: !1
|
|
6981
7057
|
}
|
|
6982
7058
|
]
|
|
6983
|
-
}), e.register("process-designer",
|
|
7059
|
+
}), e.register("process-designer", Nt, {
|
|
6984
7060
|
namespace: "plugin-designer",
|
|
6985
7061
|
label: "Process Designer (BPMN)",
|
|
6986
7062
|
category: "Designer",
|
|
@@ -7019,7 +7095,7 @@ e.register("page-designer", bt, {
|
|
|
7019
7095
|
defaultValue: !1
|
|
7020
7096
|
}
|
|
7021
7097
|
]
|
|
7022
|
-
}), e.register("report-designer",
|
|
7098
|
+
}), e.register("report-designer", Lt, {
|
|
7023
7099
|
namespace: "plugin-designer",
|
|
7024
7100
|
label: "Report Designer",
|
|
7025
7101
|
category: "Designer",
|
|
@@ -7058,7 +7134,7 @@ e.register("page-designer", bt, {
|
|
|
7058
7134
|
defaultValue: !1
|
|
7059
7135
|
}
|
|
7060
7136
|
]
|
|
7061
|
-
}), e.register("app-creation-wizard",
|
|
7137
|
+
}), e.register("app-creation-wizard", Xt, {
|
|
7062
7138
|
namespace: "plugin-designer",
|
|
7063
7139
|
label: "App Creation Wizard",
|
|
7064
7140
|
category: "Designer",
|
|
@@ -7080,7 +7156,7 @@ e.register("page-designer", bt, {
|
|
|
7080
7156
|
defaultValue: !1
|
|
7081
7157
|
}
|
|
7082
7158
|
]
|
|
7083
|
-
}), e.register("navigation-designer",
|
|
7159
|
+
}), e.register("navigation-designer", on, {
|
|
7084
7160
|
namespace: "plugin-designer",
|
|
7085
7161
|
label: "Navigation Designer",
|
|
7086
7162
|
category: "Designer",
|
|
@@ -7103,7 +7179,7 @@ e.register("page-designer", bt, {
|
|
|
7103
7179
|
defaultValue: !1
|
|
7104
7180
|
}
|
|
7105
7181
|
]
|
|
7106
|
-
}), e.register("dashboard-editor",
|
|
7182
|
+
}), e.register("dashboard-editor", yn, {
|
|
7107
7183
|
namespace: "plugin-designer",
|
|
7108
7184
|
label: "Dashboard Editor",
|
|
7109
7185
|
category: "Designer",
|
|
@@ -7117,7 +7193,7 @@ e.register("page-designer", bt, {
|
|
|
7117
7193
|
label: "Read Only",
|
|
7118
7194
|
defaultValue: !1
|
|
7119
7195
|
}]
|
|
7120
|
-
}), e.register("branding-editor",
|
|
7196
|
+
}), e.register("branding-editor", Sn, {
|
|
7121
7197
|
namespace: "plugin-designer",
|
|
7122
7198
|
label: "Branding Editor",
|
|
7123
7199
|
category: "Designer",
|
|
@@ -7139,7 +7215,7 @@ e.register("page-designer", bt, {
|
|
|
7139
7215
|
defaultValue: !1
|
|
7140
7216
|
}
|
|
7141
7217
|
]
|
|
7142
|
-
}), e.register("object-manager",
|
|
7218
|
+
}), e.register("object-manager", En, {
|
|
7143
7219
|
namespace: "plugin-designer",
|
|
7144
7220
|
label: "Object Manager",
|
|
7145
7221
|
category: "Designer",
|
|
@@ -7162,7 +7238,7 @@ e.register("page-designer", bt, {
|
|
|
7162
7238
|
defaultValue: !1
|
|
7163
7239
|
}
|
|
7164
7240
|
]
|
|
7165
|
-
}), e.register("field-designer",
|
|
7241
|
+
}), e.register("field-designer", jn, {
|
|
7166
7242
|
namespace: "plugin-designer",
|
|
7167
7243
|
label: "Field Designer",
|
|
7168
7244
|
category: "Designer",
|
|
@@ -7186,4 +7262,4 @@ e.register("page-designer", bt, {
|
|
|
7186
7262
|
]
|
|
7187
7263
|
});
|
|
7188
7264
|
//#endregion
|
|
7189
|
-
export {
|
|
7265
|
+
export { Xt as AppCreationWizard, Sn as BrandingEditor, vt as CollaborationProvider, ut as ConfirmDialog, bt as ConnectionStatusIndicator, Fn as CreateAppPage, Rt as DESIGNER_DEFAULT_TRANSLATIONS, Ln as DashboardDesignPage, yn as DashboardEditor, Ot as DataModelDesigner, In as EditAppPage, ln as EditorModeToggle, jn as FieldDesigner, Wn as MetadataFieldsPage, zn as MetadataObjectsPage, ht as Minimap, on as NavigationDesigner, En as ObjectManager, St as PageDesigner, Nt as ProcessDesigner, ft as PropertyEditor, Lt as ReportDesigner, Nn as VersionHistory, ct as useCanvasPanZoom, st as useClipboard, at as useConfirmDialog, wt as useDesignerHistory, ot as useMultiSelect, it as useUndoRedo };
|