@object-ui/layout 17.3.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/dist/index.js CHANGED
@@ -2,31 +2,32 @@ import { ComponentRegistry as e } from "@object-ui/core";
2
2
  import t, { useEffect as n, useMemo as r, useState as i } from "react";
3
3
  import { Badge as a, Button as o, Collapsible as s, CollapsibleContent as c, CollapsibleTrigger as l, Input as u, LazyIcon as d, Separator as f, Sidebar as p, SidebarContent as m, SidebarFooter as h, SidebarGroup as g, SidebarGroupContent as _, SidebarGroupLabel as v, SidebarHeader as y, SidebarInput as b, SidebarInset as x, SidebarMenu as S, SidebarMenuAction as C, SidebarMenuButton as w, SidebarMenuItem as T, SidebarMenuSub as E, SidebarMenuSubButton as D, SidebarMenuSubItem as O, SidebarProvider as k, cn as A, getLazyIcon as j, useIsMobile as M } from "@object-ui/components";
4
4
  import { ArrowLeft as N, ChevronRight as P, FileText as F, GripVertical as ee, Layers as te, Pin as ne, PinOff as re, Search as ie, Star as I } from "lucide-react";
5
- import { SchemaRenderer as L, useRecordContext as R } from "@object-ui/react";
6
- import { Fragment as ae, jsx as z, jsxs as B } from "react/jsx-runtime";
7
- import { Link as oe, NavLink as V, useLocation as H } from "react-router-dom";
8
- import { DndContext as U, KeyboardSensor as se, PointerSensor as W, closestCenter as ce, useSensor as G, useSensors as K } from "@dnd-kit/core";
9
- import { SortableContext as q, arrayMove as le, useSortable as ue, verticalListSortingStrategy as de } from "@dnd-kit/sortable";
10
- import { CSS as fe } from "@dnd-kit/utilities";
11
- import { menuItemToNavigationItem as pe } from "@object-ui/types";
5
+ import { SchemaRenderer as L, useRecordContext as ae } from "@object-ui/react";
6
+ import { Fragment as oe, jsx as R, jsxs as z } from "react/jsx-runtime";
7
+ import { Link as se, NavLink as B, useLocation as V } from "react-router-dom";
8
+ import { DndContext as H, KeyboardSensor as ce, PointerSensor as U, closestCenter as le, useSensor as W, useSensors as G } from "@dnd-kit/core";
9
+ import { SortableContext as K, arrayMove as ue, useSortable as de, verticalListSortingStrategy as fe } from "@dnd-kit/sortable";
10
+ import { CSS as pe } from "@dnd-kit/utilities";
11
+ import { menuItemToNavigationItem as me } from "@object-ui/types";
12
+ import { resolveI18nLabel as he } from "@objectstack/spec/ui";
12
13
  //#region src/PageHeader.tsx
13
- var me = (e) => {
14
+ var ge = (e) => {
14
15
  let t = e?.name ?? e?.full_name ?? e?.display_name ?? e?.label ?? e?.title ?? e?.subject;
15
16
  return t != null && String(t).trim() ? String(t) : [
16
17
  e?.salutation,
17
18
  e?.first_name,
18
19
  e?.last_name
19
20
  ].filter((e) => typeof e == "string" && e.trim()).map((e) => e.trim()).join(" ") || (typeof e?.email == "string" && e.email.trim() ? e.email.trim() : null);
20
- }, he = (e, t) => !e || typeof e != "string" ? e ?? "" : e.includes("{") ? e.replace(/\{([a-zA-Z0-9_.]+)\}/g, (e, n) => {
21
+ }, _e = (e, t) => !e || typeof e != "string" ? e ?? "" : e.includes("{") ? e.replace(/\{([a-zA-Z0-9_.]+)\}/g, (e, n) => {
21
22
  let r = n.split(".").reduce((e, t) => e == null ? e : e[t], t);
22
- return r == null ? "" : typeof r == "object" ? me(r) ?? "" : String(r);
23
+ return r == null ? "" : typeof r == "object" ? ge(r) ?? "" : String(r);
23
24
  }).replace(/\s*[-–—|/·,:]\s*(?=\s*[-–—|/·,:]|$)/g, "").replace(/^\s*[-–—|/·,:]\s*/, "").replace(/\s+/g, " ").trim() : e;
24
- function ge({ title: e, subtitle: n, description: r, icon: i, action: a, actions: s, showBack: c, schema: l, className: u, children: f, ...p }) {
25
- let m = R(), h = typeof e == "string" && /\{[a-zA-Z0-9_.]+\}/.test(e), g = he(e, m?.data) || (h ? "" : e), _ = n ?? r, v = typeof _ == "string" && /\{[a-zA-Z0-9_.]+\}/.test(_), y = he(_, m?.data) || (v ? "" : _), b = !!m?.recordId, x = !!m?.embedded, S = c ?? (b && !x), C = t.useCallback(() => {
25
+ function ve({ title: e, subtitle: n, description: r, icon: i, action: a, actions: s, showBack: c, schema: l, className: u, children: f, ...p }) {
26
+ let m = ae(), h = typeof e == "string" && /\{[a-zA-Z0-9_.]+\}/.test(e), g = _e(e, m?.data) || (h ? "" : e), _ = n ?? r, v = typeof _ == "string" && /\{[a-zA-Z0-9_.]+\}/.test(_), y = _e(_, m?.data) || (v ? "" : _), b = !!m?.recordId, x = !!m?.embedded, S = c ?? (b && !x), C = t.useCallback(() => {
26
27
  if (typeof window > "u") return;
27
28
  let e = window.location.pathname, t = e.replace(/\/record\/[^/]+\/?$/, "");
28
29
  t === e ? window.history.length > 1 && window.history.back() : (window.history.pushState({}, "", t + window.location.search), window.dispatchEvent(new PopStateEvent("popstate")));
29
- }, []), w = Array.isArray(l?.children) ? l.children.filter(Boolean).map((e, t) => /* @__PURE__ */ z(L, { schema: e }, e?.id || `pgh-child-${t}`)) : null, T = Array.isArray(s) && s.length > 0 && s || Array.isArray(l?.actions) && l.actions.length > 0 && l.actions || Array.isArray(l?.properties?.actions) && l.properties.actions.length > 0 && l.properties.actions || null, E = a || f || (T ? /* @__PURE__ */ z(L, { schema: {
30
+ }, []), w = Array.isArray(l?.children) ? l.children.filter(Boolean).map((e, t) => /* @__PURE__ */ R(L, { schema: e }, e?.id || `pgh-child-${t}`)) : null, T = Array.isArray(s) && s.length > 0 && s || Array.isArray(l?.actions) && l.actions.length > 0 && l.actions || Array.isArray(l?.properties?.actions) && l.properties.actions.length > 0 && l.properties.actions || null, E = a || f || (T ? /* @__PURE__ */ R(L, { schema: {
30
31
  type: "record:quick_actions",
31
32
  properties: {
32
33
  actions: T,
@@ -35,39 +36,39 @@ function ge({ title: e, subtitle: n, description: r, icon: i, action: a, actions
35
36
  inline: !0
36
37
  }
37
38
  } }) : null) || w;
38
- return /* @__PURE__ */ z("div", {
39
+ return /* @__PURE__ */ R("div", {
39
40
  className: A("flex flex-col gap-3 pb-4 border-b", u),
40
41
  ...p,
41
- children: /* @__PURE__ */ B("div", {
42
+ children: /* @__PURE__ */ z("div", {
42
43
  className: "flex flex-wrap items-center gap-x-4 gap-y-2",
43
44
  children: [
44
- S && /* @__PURE__ */ z(o, {
45
+ S && /* @__PURE__ */ R(o, {
45
46
  type: "button",
46
47
  variant: "ghost",
47
48
  size: "icon",
48
49
  onClick: C,
49
50
  "aria-label": "Back to list",
50
51
  className: "flex-shrink-0 -ml-2",
51
- children: /* @__PURE__ */ z(N, { className: "size-4" })
52
+ children: /* @__PURE__ */ R(N, { className: "size-4" })
52
53
  }),
53
- i && (g || y) && /* @__PURE__ */ z("div", {
54
+ i && (g || y) && /* @__PURE__ */ R("div", {
54
55
  className: "flex-shrink-0 grid place-items-center size-10 rounded-md bg-primary/10 text-primary",
55
- children: typeof i == "string" ? /* @__PURE__ */ z(d, {
56
+ children: typeof i == "string" ? /* @__PURE__ */ R(d, {
56
57
  name: i,
57
58
  className: "size-5"
58
59
  }) : i
59
60
  }),
60
- /* @__PURE__ */ B("div", {
61
+ /* @__PURE__ */ z("div", {
61
62
  className: "flex flex-col min-w-0 flex-1",
62
- children: [g ? /* @__PURE__ */ z("h1", {
63
+ children: [g ? /* @__PURE__ */ R("h1", {
63
64
  className: "text-2xl font-bold tracking-tight md:text-3xl truncate",
64
65
  children: g
65
- }) : null, y && /* @__PURE__ */ z("p", {
66
+ }) : null, y && /* @__PURE__ */ R("p", {
66
67
  className: "text-sm text-muted-foreground truncate",
67
68
  children: y
68
69
  })]
69
70
  }),
70
- E && /* @__PURE__ */ z("div", {
71
+ E && /* @__PURE__ */ R("div", {
71
72
  className: "flex items-center gap-2 ml-auto",
72
73
  children: E
73
74
  })
@@ -77,7 +78,7 @@ function ge({ title: e, subtitle: n, description: r, icon: i, action: a, actions
77
78
  }
78
79
  //#endregion
79
80
  //#region src/AppShell.tsx
80
- function _e(e) {
81
+ function ye(e) {
81
82
  let t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
82
83
  if (!t) return null;
83
84
  let n = parseInt(t[1], 16) / 255, r = parseInt(t[2], 16) / 255, i = parseInt(t[3], 16) / 255, a = Math.max(n, r, i), o = Math.min(n, r, i), s = 0, c = 0, l = (a + o) / 2;
@@ -99,17 +100,17 @@ function _e(e) {
99
100
  l: l * 100
100
101
  };
101
102
  }
102
- function ve(e) {
103
- let t = _e(e);
103
+ function be(e) {
104
+ let t = ye(e);
104
105
  return t ? `${Math.round(t.h)} ${Math.round(t.s)}% ${Math.round(t.l)}%` : null;
105
106
  }
106
- function ye(e) {
107
- let t = _e(e);
107
+ function xe(e) {
108
+ let t = ye(e);
108
109
  if (!t) return null;
109
110
  let n = Math.max(t.l, 65), r = t.s > 80 ? Math.max(t.s - 10, 70) : t.s;
110
111
  return `${Math.round(t.h)} ${Math.round(r)}% ${Math.round(n)}%`;
111
112
  }
112
- function be(e) {
113
+ function Se(e) {
113
114
  let t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
114
115
  if (!t) return "0 0% 100%";
115
116
  let n = (e) => {
@@ -118,16 +119,16 @@ function be(e) {
118
119
  }, r = n(parseInt(t[1], 16)), i = n(parseInt(t[2], 16)), a = n(parseInt(t[3], 16));
119
120
  return .2126 * r + .7152 * i + .0722 * a > .6 ? "222 47% 11%" : "0 0% 100%";
120
121
  }
121
- function xe(e, t) {
122
+ function Ce(e, t) {
122
123
  n(() => {
123
124
  let n = document.documentElement, r = () => n.classList.contains("dark"), i = () => {
124
125
  if (e?.primaryColor) {
125
- let t = ve(e.primaryColor), i = ye(e.primaryColor), a = r() && i || t;
126
- a && (n.style.setProperty("--brand-primary", e.primaryColor), n.style.setProperty("--brand-primary-hsl", t || a), n.style.setProperty("--primary", a), n.style.setProperty("--primary-foreground", r() ? "222 47% 11%" : be(e.primaryColor)), n.style.setProperty("--ring", a), n.style.setProperty("--sidebar-primary", a), n.style.setProperty("--sidebar-ring", a));
126
+ let t = be(e.primaryColor), i = xe(e.primaryColor), a = r() && i || t;
127
+ a && (n.style.setProperty("--brand-primary", e.primaryColor), n.style.setProperty("--brand-primary-hsl", t || a), n.style.setProperty("--primary", a), n.style.setProperty("--primary-foreground", r() ? "222 47% 11%" : Se(e.primaryColor)), n.style.setProperty("--ring", a), n.style.setProperty("--sidebar-primary", a), n.style.setProperty("--sidebar-ring", a));
127
128
  } else n.style.removeProperty("--brand-primary"), n.style.removeProperty("--brand-primary-hsl"), n.style.removeProperty("--primary"), n.style.removeProperty("--primary-foreground"), n.style.removeProperty("--ring"), n.style.removeProperty("--sidebar-primary"), n.style.removeProperty("--sidebar-ring");
128
129
  if (e?.accentColor) {
129
- let t = ve(e.accentColor), i = ye(e.accentColor), a = r() && i || t;
130
- a && (n.style.setProperty("--brand-accent", e.accentColor), n.style.setProperty("--brand-accent-hsl", t || a), n.style.setProperty("--accent", a), n.style.setProperty("--accent-foreground", r() ? "222 47% 11%" : be(e.accentColor)));
130
+ let t = be(e.accentColor), i = xe(e.accentColor), a = r() && i || t;
131
+ a && (n.style.setProperty("--brand-accent", e.accentColor), n.style.setProperty("--brand-accent-hsl", t || a), n.style.setProperty("--accent", a), n.style.setProperty("--accent-foreground", r() ? "222 47% 11%" : Se(e.accentColor)));
131
132
  } else n.style.removeProperty("--brand-accent"), n.style.removeProperty("--brand-accent-hsl"), n.style.removeProperty("--accent"), n.style.removeProperty("--accent-foreground");
132
133
  };
133
134
  i();
@@ -154,20 +155,20 @@ function xe(e, t) {
154
155
  t
155
156
  ]);
156
157
  }
157
- function J({ sidebar: e, navbar: t, children: n, className: r, defaultOpen: i = !0, branding: a, rightRail: o }) {
158
- return xe(a, a?.title), /* @__PURE__ */ B(k, {
158
+ function q({ sidebar: e, navbar: t, children: n, className: r, defaultOpen: i = !0, branding: a, rightRail: o }) {
159
+ return Ce(a, a?.title), /* @__PURE__ */ z(k, {
159
160
  defaultOpen: i,
160
161
  className: "!flex-col h-svh overflow-hidden",
161
- children: [/* @__PURE__ */ z("header", {
162
+ children: [/* @__PURE__ */ R("header", {
162
163
  className: "sticky top-0 z-30 flex h-14 w-full shrink-0 items-center gap-2 border-b bg-background px-2 sm:px-4",
163
164
  children: t
164
- }), /* @__PURE__ */ B("div", {
165
+ }), /* @__PURE__ */ z("div", {
165
166
  className: "flex flex-1 min-h-0 w-full",
166
167
  children: [
167
168
  e,
168
- /* @__PURE__ */ z(x, {
169
+ /* @__PURE__ */ R(x, {
169
170
  className: "min-w-0",
170
- children: /* @__PURE__ */ z("main", {
171
+ children: /* @__PURE__ */ R("main", {
171
172
  className: A("flex-1 min-w-0 overflow-auto p-3 sm:p-4 md:p-6 pb-20 sm:pb-4 md:pb-6", r),
172
173
  children: n
173
174
  })
@@ -179,11 +180,11 @@ function J({ sidebar: e, navbar: t, children: n, className: r, defaultOpen: i =
179
180
  }
180
181
  //#endregion
181
182
  //#region src/PageCard.tsx
182
- function Se({ className: e, children: t, ...n }) {
183
- return /* @__PURE__ */ z("div", {
183
+ function we({ className: e, children: t, ...n }) {
184
+ return /* @__PURE__ */ R("div", {
184
185
  className: A("rounded-xl border bg-card text-card-foreground shadow", e),
185
186
  ...n,
186
- children: /* @__PURE__ */ z("div", {
187
+ children: /* @__PURE__ */ R("div", {
187
188
  className: "p-6",
188
189
  children: t
189
190
  })
@@ -191,7 +192,7 @@ function Se({ className: e, children: t, ...n }) {
191
192
  }
192
193
  //#endregion
193
194
  //#region src/ResponsiveGrid.tsx
194
- var Ce = {
195
+ var Te = {
195
196
  xs: {
196
197
  1: "grid-cols-1",
197
198
  2: "grid-cols-2",
@@ -241,11 +242,11 @@ var Ce = {
241
242
  12: "2xl:grid-cols-12"
242
243
  }
243
244
  };
244
- function we(e) {
245
+ function Ee(e) {
245
246
  if (!e) return "grid-cols-1";
246
247
  let t = [];
247
248
  for (let [n, r] of Object.entries(e)) {
248
- let e = Ce[n];
249
+ let e = Te[n];
249
250
  if (e && r) {
250
251
  let n = Object.keys(e).map(Number).reduce((e, t) => Math.abs(t - r) < Math.abs(e - r) ? t : e);
251
252
  t.push(e[n]);
@@ -253,7 +254,7 @@ function we(e) {
253
254
  }
254
255
  return t.join(" ") || "grid-cols-1";
255
256
  }
256
- var Te = {
257
+ var De = {
257
258
  0: "gap-0",
258
259
  1: "gap-1",
259
260
  2: "gap-2",
@@ -262,19 +263,19 @@ var Te = {
262
263
  5: "gap-5",
263
264
  6: "gap-6",
264
265
  8: "gap-8"
265
- }, Ee = ({ columns: e, gap: t = 4, className: n, children: r }) => {
266
- let i = we(e), a = typeof t == "number" ? Te[t] || `gap-${t}` : "";
267
- return /* @__PURE__ */ z("div", {
266
+ }, Oe = ({ columns: e, gap: t = 4, className: n, children: r }) => {
267
+ let i = Ee(e), a = typeof t == "number" ? De[t] || `gap-${t}` : "";
268
+ return /* @__PURE__ */ R("div", {
268
269
  className: A("grid", i, a, n),
269
270
  children: r
270
271
  });
271
272
  };
272
273
  //#endregion
273
274
  //#region src/NavigationRenderer.tsx
274
- function Y(e) {
275
+ function J(e) {
275
276
  return e ? j(e) : F;
276
277
  }
277
- function X(e, t) {
278
+ function Y(e, t) {
278
279
  if (typeof e == "string") return e;
279
280
  if (t) {
280
281
  let n = t(e.key, {
@@ -285,8 +286,8 @@ function X(e, t) {
285
286
  }
286
287
  return e.defaultValue || e.key;
287
288
  }
288
- function De(e, t, n, r, i, a, o) {
289
- let s = X(e.label, n);
289
+ function ke(e, t, n, r, i, a, o) {
290
+ let s = Y(e.label, n);
290
291
  if (typeof e.label != "string") return s;
291
292
  let c = (e) => !!e && s.trim().toLowerCase() !== e.trim().toLowerCase();
292
293
  if (e.type === "object" && e.objectName) {
@@ -304,33 +305,33 @@ function De(e, t, n, r, i, a, o) {
304
305
  }
305
306
  return o && e.id && !c(e.id) ? o(e.id, s) : s;
306
307
  }
307
- var Oe = (e) => e !== !1 && e !== "false", ke = () => !0, Ae = () => !0;
308
- function je(e, t = {}) {
309
- let { evaluateVisibility: n = Oe, checkPermission: r = ke, checkCapability: i = Ae, hasActionHandler: a = !1 } = t;
308
+ var Ae = (e) => e !== !1 && e !== "false", je = () => !0, Me = () => !0;
309
+ function Ne(e, t = {}) {
310
+ let { evaluateVisibility: n = Ae, checkPermission: r = je, checkCapability: i = Me, hasActionHandler: a = !1 } = t;
310
311
  for (let o of e) if (n(o.visible) && !(o.requiredPermissions?.length && !r(o.requiredPermissions)) && !(o.requiresObject && !i("object", o.requiresObject)) && !(o.requiresService && !i("service", o.requiresService)) && o.type !== "separator") {
311
312
  if (o.type === "group") {
312
- if (je(o.children ?? [], t)) return !0;
313
+ if (Ne(o.children ?? [], t)) return !0;
313
314
  continue;
314
315
  }
315
316
  if (!(o.type === "action" && !a)) return !0;
316
317
  }
317
318
  return !1;
318
319
  }
319
- var Me = /\{(current_user_id|current_org_id|[a-z][a-z0-9_]*)\}/g;
320
- function Z(e, t) {
320
+ var Pe = /\{(current_user_id|current_org_id|[a-z][a-z0-9_]*)\}/g;
321
+ function X(e, t) {
321
322
  if (!e.includes("{")) return e;
322
- let n = !1, r = e.replace(Me, (e, r) => {
323
+ let n = !1, r = e.replace(Pe, (e, r) => {
323
324
  let i;
324
325
  return i = r === "current_user_id" ? t?.currentUserId : r === "current_org_id" ? t?.currentOrgId : t?.contextValues?.[r], i || (n = !0, "");
325
326
  });
326
327
  return n ? null : r;
327
328
  }
328
- function Ne(e, t, n) {
329
+ function Fe(e, t, n) {
329
330
  switch (e.type) {
330
331
  case "object": {
331
332
  let r = `${t}/${e.objectName ?? ""}`, i = e.recordId;
332
333
  if (i) {
333
- let t = Z(i, n);
334
+ let t = X(i, n);
334
335
  if (t) {
335
336
  let n = `${r}/record/${encodeURIComponent(t)}`;
336
337
  return {
@@ -344,7 +345,7 @@ function Ne(e, t, n) {
344
345
  let e = new URLSearchParams();
345
346
  for (let [t, r] of Object.entries(a)) {
346
347
  if (r == null || t === "") continue;
347
- let i = Z(String(r), n);
348
+ let i = X(String(r), n);
348
349
  i !== null && e.set(`filter[${t}]`, i);
349
350
  }
350
351
  let t = e.toString();
@@ -370,10 +371,12 @@ function Ne(e, t, n) {
370
371
  let r = e.params, i = `${t}/page/${e.pageName}`;
371
372
  if (r && typeof r == "object") {
372
373
  let e = new URLSearchParams();
373
- for (let [t, i] of Object.entries(r)) if (i != null) if (typeof i == "string") {
374
- let r = Z(i, n);
375
- r !== null && e.set(t, r);
376
- } else e.set(t, JSON.stringify(i));
374
+ for (let [t, i] of Object.entries(r)) if (i != null) {
375
+ if (typeof i == "string") {
376
+ let r = X(i, n);
377
+ r !== null && e.set(t, r);
378
+ } else e.set(t, JSON.stringify(i));
379
+ }
377
380
  let t = e.toString();
378
381
  t && (i += `?${t}`);
379
382
  }
@@ -406,10 +409,12 @@ function Ne(e, t, n) {
406
409
  let e = i[1], r = a && typeof a.type == "string" ? a.type : void 0, o = a && typeof a.name == "string" ? a.name : void 0, s = "";
407
410
  if (a && typeof a == "object") {
408
411
  let e = new URLSearchParams();
409
- for (let [t, r] of Object.entries(a)) if (t !== "type" && t !== "name" && r != null) if (typeof r == "string") {
410
- let i = Z(r, n);
411
- i && e.set(t, i);
412
- } else e.set(t, JSON.stringify(r));
412
+ for (let [t, r] of Object.entries(a)) if (t !== "type" && t !== "name" && r != null) {
413
+ if (typeof r == "string") {
414
+ let i = X(r, n);
415
+ i && e.set(t, i);
416
+ } else e.set(t, JSON.stringify(r));
417
+ }
413
418
  let t = e.toString();
414
419
  t && (s = `?${t}`);
415
420
  }
@@ -442,27 +447,27 @@ function Ne(e, t, n) {
442
447
  };
443
448
  }
444
449
  }
445
- var Pe = 50, Fe = 40, Ie = 30, Le = 25, Re = 10, ze = 5;
446
- function Be(e) {
450
+ var Ie = 50, Le = 40, Re = 30, ze = 25, Be = 10, Ve = 5;
451
+ function He(e) {
447
452
  let t = /* @__PURE__ */ new Map();
448
453
  return new URLSearchParams(e).forEach((e, n) => {
449
454
  let r = /^filter\[(.+)\]$/.exec(n);
450
455
  r && r[1] && e !== "" && t.set(r[1], e);
451
456
  }), t;
452
457
  }
453
- function Ve(e, t) {
458
+ function Ue(e, t) {
454
459
  return t.startsWith(`${e}.`) ? t.slice(e.length + 1) : t;
455
460
  }
456
- function He(e, t, n, r, i) {
457
- let { href: a, external: o } = Ne(e, r, i);
461
+ function We(e, t, n, r, i) {
462
+ let { href: a, external: o } = Fe(e, r, i);
458
463
  if (o || a === "#") return 0;
459
464
  if (e.type === "object" && e.objectName) {
460
465
  let a = `${r}/${e.objectName}`;
461
466
  if (t !== a && !t.startsWith(`${a}/`)) return 0;
462
467
  let o = t === a ? [] : t.slice(a.length + 1).split("/"), s = e.recordId;
463
468
  if (s) {
464
- let e = Z(s, i);
465
- if (e) return o[0] === "record" && decodeURIComponent(o[1] ?? "") === e ? Pe : 0;
469
+ let e = X(s, i);
470
+ if (e) return o[0] === "record" && decodeURIComponent(o[1] ?? "") === e ? Ie : 0;
466
471
  }
467
472
  let c = e.filters;
468
473
  if (c && typeof c == "object" && !Array.isArray(c)) {
@@ -470,65 +475,65 @@ function He(e, t, n, r, i) {
470
475
  let e = /* @__PURE__ */ new Map();
471
476
  for (let [t, n] of Object.entries(c)) {
472
477
  if (n == null || t === "") continue;
473
- let r = Z(String(n), i);
478
+ let r = X(String(n), i);
474
479
  r !== null && e.set(t, r);
475
480
  }
476
481
  if (e.size !== n.size) return 0;
477
482
  for (let [t, r] of e) if (n.get(t) !== r) return 0;
478
- return Fe;
483
+ return Le;
479
484
  }
480
- return e.viewName ? o[0] !== "view" || !o[1] ? 0 : Ve(e.objectName, decodeURIComponent(o[1])) === Ve(e.objectName, e.viewName) ? Ie : 0 : o.length === 0 ? Le : Re;
485
+ return e.viewName ? o[0] !== "view" || !o[1] ? 0 : Ue(e.objectName, decodeURIComponent(o[1])) === Ue(e.objectName, e.viewName) ? Re : 0 : o.length === 0 ? ze : Be;
481
486
  }
482
487
  let s = a.split("?")[0];
483
- if (t === s) return Le;
488
+ if (t === s) return ze;
484
489
  let c = e.componentRef;
485
- return c && c.split(":")[1] === "directory" ? 0 : t.startsWith(`${s}/`) ? ze : 0;
490
+ return c && c.split(":")[1] === "directory" ? 0 : t.startsWith(`${s}/`) ? Ve : 0;
486
491
  }
487
- function Ue(e, t, n, r, i) {
488
- let a = Be(n), o = null, s = 0, c = (e) => {
492
+ function Ge(e, t, n, r, i) {
493
+ let a = He(n), o = null, s = 0, c = (e) => {
489
494
  if (e) for (let n of e) {
490
495
  if (n.type === "group") {
491
496
  c(n.children);
492
497
  continue;
493
498
  }
494
- let e = He(n, t, a, r, i);
499
+ let e = We(n, t, a, r, i);
495
500
  e > s && (o = n, s = e);
496
501
  }
497
502
  };
498
503
  return c(e), o;
499
504
  }
500
- var We = t.createContext(null);
501
- function Ge(e, t) {
505
+ var Ke = t.createContext(null);
506
+ function Z(e, t) {
502
507
  if (!t.trim()) return e;
503
508
  let n = t.toLowerCase().trim();
504
509
  return e.reduce((e, r) => {
505
510
  if (r.type === "separator") return e;
506
511
  if (r.type === "group" && r.children?.length) {
507
- let n = Ge(r.children, t);
512
+ let n = Z(r.children, t);
508
513
  return n.length > 0 && e.push({
509
514
  ...r,
510
515
  children: n
511
516
  }), e;
512
517
  }
513
- return X(r.label).toLowerCase().includes(n) && e.push(r), e;
518
+ return Y(r.label).toLowerCase().includes(n) && e.push(r), e;
514
519
  }, []);
515
520
  }
516
- var Ke = 5;
517
- function qe({ item: e, basePath: t, evalVis: n, checkPerm: r, checkCap: i, onAction: a, enablePinning: o, onPinToggle: s, enableReorder: c, resolveObjectLabel: l, resolveDashboardLabel: u, resolveGroupLabel: d, resolveViewLabel: f, resolveItemLabel: p, t: m, templateContext: h }) {
518
- let { attributes: g, listeners: _, setNodeRef: v, transform: y, transition: b, isDragging: x } = ue({
521
+ var qe = 5;
522
+ function Je({ item: e, basePath: t, evalVis: n, checkPerm: r, checkCap: i, onAction: a, enablePinning: o, onPinToggle: s, enableReorder: c, resolveObjectLabel: l, resolveDashboardLabel: u, resolveGroupLabel: d, resolveViewLabel: f, resolveItemLabel: p, t: m, templateContext: h }) {
523
+ let { attributes: g, listeners: _, setNodeRef: v, transform: y, transition: b, isDragging: x } = de({
519
524
  id: e.id,
520
525
  disabled: !c
521
526
  }), S = {
522
- transform: fe.Transform.toString(y),
527
+ transform: pe.Transform.toString(y),
523
528
  transition: b,
524
529
  opacity: x ? .5 : void 0,
525
530
  zIndex: x ? 10 : void 0
526
531
  };
527
- return /* @__PURE__ */ z("div", {
532
+ return /* @__PURE__ */ R("div", {
528
533
  ref: v,
529
534
  style: S,
530
535
  ...g,
531
- children: /* @__PURE__ */ z(Q, {
536
+ children: /* @__PURE__ */ R(Q, {
532
537
  item: e,
533
538
  basePath: t,
534
539
  evalVis: n,
@@ -552,27 +557,27 @@ function Q({ item: e, basePath: n, evalVis: r, checkPerm: o, checkCap: u, onActi
552
557
  let j = M(), N = j ? "min-h-[44px] text-[15px] gap-3 rounded-xl" : void 0, F = A("shrink-0", j ? "h-5 w-5" : "h-4 w-4"), te = (() => {
553
558
  if (typeof e.expanded == "boolean") return e.expanded;
554
559
  if (typeof e.defaultOpen == "boolean") return e.defaultOpen;
555
- })(), ie = e.type === "group" ? e.children?.length ?? 0 : 0, I = t.useContext(We), L = t.useMemo(() => {
560
+ })(), ie = e.type === "group" ? e.children?.length ?? 0 : 0, I = t.useContext(Ke), L = t.useMemo(() => {
556
561
  if (e.type !== "group" || !I) return !1;
557
562
  let t = (e) => !!e?.some((e) => e.id === I || e.type === "group" && t(e.children));
558
563
  return t(e.children);
559
- }, [e, I]) ? !0 : te ?? !(ie >= 8), [R, V] = i(L);
564
+ }, [e, I]) ? !0 : te ?? !(ie >= 8), [ae, B] = i(L);
560
565
  if (!r(e.visible) || e.requiredPermissions?.length && !o(e.requiredPermissions)) return null;
561
- let H = e.requiresObject, U = e.requiresService;
562
- if (H && !u("object", H) || U && !u("service", U)) return null;
563
- if (e.type === "separator") return /* @__PURE__ */ z(f, { className: "my-2" });
566
+ let V = e.requiresObject, H = e.requiresService;
567
+ if (V && !u("object", V) || H && !u("service", H)) return null;
568
+ if (e.type === "separator") return /* @__PURE__ */ R(f, { className: "my-2" });
564
569
  if (e.type === "group") {
565
- let t = (e.children ?? []).slice().sort((e, t) => (e.order ?? 0) - (t.order ?? 0)), i = De(e, y, O, b, x, E, D);
566
- return /* @__PURE__ */ z(s, {
567
- open: R,
568
- onOpenChange: V,
569
- children: /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, {
570
+ let t = (e.children ?? []).slice().sort((e, t) => (e.order ?? 0) - (t.order ?? 0)), i = ke(e, y, O, b, x, E, D);
571
+ return /* @__PURE__ */ R(s, {
572
+ open: ae,
573
+ onOpenChange: B,
574
+ children: /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, {
570
575
  asChild: !0,
571
- children: /* @__PURE__ */ B(l, {
576
+ children: /* @__PURE__ */ z(l, {
572
577
  className: A("flex w-full items-center justify-between", j && "min-h-[44px] text-[15px] rounded-xl"),
573
- children: [i, /* @__PURE__ */ z(P, { className: A("ml-auto transition-transform", j ? "h-5 w-5" : "h-4 w-4", R && "rotate-90") })]
578
+ children: [i, /* @__PURE__ */ R(P, { className: A("ml-auto transition-transform", j ? "h-5 w-5" : "h-4 w-4", ae && "rotate-90") })]
574
579
  })
575
- }), /* @__PURE__ */ z(c, { children: /* @__PURE__ */ z(_, { children: /* @__PURE__ */ z(S, { children: t.map((e) => /* @__PURE__ */ z(Q, {
580
+ }), /* @__PURE__ */ R(c, { children: /* @__PURE__ */ R(_, { children: /* @__PURE__ */ R(S, { children: t.map((e) => /* @__PURE__ */ R(Q, {
576
581
  item: e,
577
582
  basePath: n,
578
583
  evalVis: r,
@@ -593,93 +598,93 @@ function Q({ item: e, basePath: n, evalVis: r, checkPerm: o, checkCap: u, onActi
593
598
  }
594
599
  if (e.type === "action") {
595
600
  if (!d) return null;
596
- let t = Y(e.icon), r = X(e.label, O);
597
- return /* @__PURE__ */ B(T, { children: [
598
- h && /* @__PURE__ */ z("span", {
601
+ let t = J(e.icon), r = Y(e.label, O);
602
+ return /* @__PURE__ */ z(T, { children: [
603
+ h && /* @__PURE__ */ R("span", {
599
604
  className: "absolute left-0.5 top-1/2 -translate-y-1/2 cursor-grab text-muted-foreground",
600
605
  "aria-label": O ? O("console.nav.dragToReorder", { defaultValue: "Drag to reorder" }) : "Drag to reorder",
601
606
  ...h,
602
- children: /* @__PURE__ */ z(ee, { className: "h-3.5 w-3.5" })
607
+ children: /* @__PURE__ */ R(ee, { className: "h-3.5 w-3.5" })
603
608
  }),
604
- /* @__PURE__ */ B(w, {
609
+ /* @__PURE__ */ z(w, {
605
610
  tooltip: r,
606
611
  onClick: () => d?.(e),
607
612
  className: N,
608
613
  children: [
609
- /* @__PURE__ */ z(t, { className: F }),
610
- /* @__PURE__ */ z("span", { children: r }),
611
- e.badge != null && /* @__PURE__ */ z(a, {
614
+ /* @__PURE__ */ R(t, { className: F }),
615
+ /* @__PURE__ */ R("span", { children: r }),
616
+ e.badge != null && /* @__PURE__ */ R(a, {
612
617
  variant: e.badgeVariant ?? "default",
613
618
  className: "ml-auto text-[10px] px-1.5 py-0",
614
619
  children: e.badge
615
620
  })
616
621
  ]
617
622
  }),
618
- p && m && /* @__PURE__ */ z(C, {
623
+ p && m && /* @__PURE__ */ R(C, {
619
624
  showOnHover: !0,
620
625
  onClick: () => m(e.id, !e.pinned, e, n),
621
626
  "aria-label": O ? O(e.pinned ? "console.nav.unpinItem" : "console.nav.pinItem", {
622
627
  defaultValue: e.pinned ? `Unpin ${r}` : `Pin ${r}`,
623
628
  name: r
624
629
  }) : e.pinned ? `Unpin ${r}` : `Pin ${r}`,
625
- children: e.pinned ? /* @__PURE__ */ z(re, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ z(ne, { className: "h-3.5 w-3.5" })
630
+ children: e.pinned ? /* @__PURE__ */ R(re, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ R(ne, { className: "h-3.5 w-3.5" })
626
631
  })
627
632
  ] });
628
633
  }
629
- let se = Y(e.icon), { href: W, external: ce } = Ne(e, n, k), G = I !== null && e.id === I, K = De(e, y, O, b, x, E, D), q = /* @__PURE__ */ B(ae, { children: [
630
- /* @__PURE__ */ z(se, { className: F }),
631
- /* @__PURE__ */ z("span", { children: K }),
632
- e.badge != null && /* @__PURE__ */ z(a, {
634
+ let ce = J(e.icon), { href: U, external: le } = Fe(e, n, k), W = I !== null && e.id === I, G = ke(e, y, O, b, x, E, D), K = /* @__PURE__ */ z(oe, { children: [
635
+ /* @__PURE__ */ R(ce, { className: F }),
636
+ /* @__PURE__ */ R("span", { children: G }),
637
+ e.badge != null && /* @__PURE__ */ R(a, {
633
638
  variant: e.badgeVariant ?? "default",
634
639
  className: "ml-auto text-[10px] px-1.5 py-0",
635
640
  children: e.badge
636
641
  })
637
642
  ] });
638
- return /* @__PURE__ */ B(T, { children: [
639
- h && /* @__PURE__ */ z("span", {
643
+ return /* @__PURE__ */ z(T, { children: [
644
+ h && /* @__PURE__ */ R("span", {
640
645
  className: "absolute left-0.5 top-1/2 -translate-y-1/2 cursor-grab text-muted-foreground",
641
646
  "aria-label": O ? O("console.nav.dragToReorder", { defaultValue: "Drag to reorder" }) : "Drag to reorder",
642
647
  ...h,
643
- children: /* @__PURE__ */ z(ee, { className: "h-3.5 w-3.5" })
648
+ children: /* @__PURE__ */ R(ee, { className: "h-3.5 w-3.5" })
644
649
  }),
645
- /* @__PURE__ */ z(w, {
650
+ /* @__PURE__ */ R(w, {
646
651
  asChild: !0,
647
- isActive: G,
648
- tooltip: K,
652
+ isActive: W,
653
+ tooltip: G,
649
654
  className: N,
650
- children: ce ? /* @__PURE__ */ z("a", {
651
- href: W,
655
+ children: le ? /* @__PURE__ */ R("a", {
656
+ href: U,
652
657
  target: "_blank",
653
658
  rel: "noopener noreferrer",
654
- children: q
655
- }) : /* @__PURE__ */ z(oe, {
656
- to: W,
657
- children: q
659
+ children: K
660
+ }) : /* @__PURE__ */ R(se, {
661
+ to: U,
662
+ children: K
658
663
  })
659
664
  }),
660
- p && m && /* @__PURE__ */ z(C, {
665
+ p && m && /* @__PURE__ */ R(C, {
661
666
  showOnHover: !0,
662
667
  onClick: () => m(e.id, !e.pinned, e, n),
663
668
  "aria-label": O ? O(e.pinned ? "console.nav.unpinItem" : "console.nav.pinItem", {
664
- defaultValue: e.pinned ? `Unpin ${K}` : `Pin ${K}`,
665
- name: K
666
- }) : e.pinned ? `Unpin ${K}` : `Pin ${K}`,
667
- children: e.pinned ? /* @__PURE__ */ z(re, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ z(ne, { className: "h-3.5 w-3.5" })
669
+ defaultValue: e.pinned ? `Unpin ${G}` : `Pin ${G}`,
670
+ name: G
671
+ }) : e.pinned ? `Unpin ${G}` : `Pin ${G}`,
672
+ children: e.pinned ? /* @__PURE__ */ R(re, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ R(ne, { className: "h-3.5 w-3.5" })
668
673
  })
669
674
  ] });
670
675
  }
671
- function $({ items: e, basePath: t = "", evaluateVisibility: n = Oe, checkPermission: i = ke, checkCapability: a = Ae, onAction: o, searchQuery: s, enablePinning: c, onPinToggle: l, enableReorder: u, onReorder: d, resolveObjectLabel: f, resolveDashboardLabel: p, resolveGroupLabel: m, resolveViewLabel: h, resolveItemLabel: y, t: b, templateContext: x }) {
672
- let C = H(), w = r(() => Ue(e, C.pathname, C.search, t, x)?.id ?? null, [
676
+ function $({ items: e, basePath: t = "", evaluateVisibility: n = Ae, checkPermission: i = je, checkCapability: a = Me, onAction: o, searchQuery: s, enablePinning: c, onPinToggle: l, enableReorder: u, onReorder: d, resolveObjectLabel: f, resolveDashboardLabel: p, resolveGroupLabel: m, resolveViewLabel: h, resolveItemLabel: y, t: b, templateContext: x }) {
677
+ let C = V(), w = r(() => Ge(e, C.pathname, C.search, t, x)?.id ?? null, [
673
678
  e,
674
679
  C.pathname,
675
680
  C.search,
676
681
  t,
677
682
  x
678
- ]), T = r(() => s ? Ge(e, s) : e, [e, s]), E = r(() => Je(T), [T]), D = T.slice().sort((e, t) => (e.order ?? 0) - (t.order ?? 0)), O = K(G(W, { activationConstraint: { distance: Ke } }), G(se)), k = (e) => {
683
+ ]), T = r(() => s ? Z(e, s) : e, [e, s]), E = r(() => Ye(T), [T]), D = T.slice().sort((e, t) => (e.order ?? 0) - (t.order ?? 0)), O = G(W(U, { activationConstraint: { distance: qe } }), W(ce)), k = (e) => {
679
684
  let { active: t, over: n } = e;
680
685
  if (!n || t.id === n.id || !d) return;
681
686
  let r = D.findIndex((e) => e.id === t.id), i = D.findIndex((e) => e.id === n.id);
682
- r !== -1 && i !== -1 && d(le(D, r, i).map((e, t) => ({
687
+ r !== -1 && i !== -1 && d(ue(D, r, i).map((e, t) => ({
683
688
  ...e,
684
689
  order: t
685
690
  })));
@@ -698,87 +703,90 @@ function $({ items: e, basePath: t = "", evaluateVisibility: n = Oe, checkPermis
698
703
  resolveItemLabel: y,
699
704
  t: b,
700
705
  templateContext: x
701
- }, j = D.some((e) => e.type === "group"), M = E.length > 0 && c ? /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ B(v, {
706
+ }, j = D.some((e) => e.type === "group"), M = E.length > 0 && c ? /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ z(v, {
702
707
  className: "flex items-center gap-1.5",
703
- children: [/* @__PURE__ */ z(I, { className: "h-3.5 w-3.5" }), b ? b("console.nav.favorites", { defaultValue: "Favorites" }) : "Favorites"]
704
- }), /* @__PURE__ */ z(_, { children: /* @__PURE__ */ z(S, { children: E.map((e) => /* @__PURE__ */ z(Q, {
708
+ children: [/* @__PURE__ */ R(I, { className: "h-3.5 w-3.5" }), b ? b("console.nav.favorites", { defaultValue: "Favorites" }) : "Favorites"]
709
+ }), /* @__PURE__ */ R(_, { children: /* @__PURE__ */ R(S, { children: E.map((e) => /* @__PURE__ */ R(Q, {
705
710
  item: e,
706
711
  ...A
707
712
  }, `fav-${e.id}`)) }) })] }) : null;
708
713
  if (!j) {
709
- let e = D.filter((e) => e.type !== "group").map((e) => e.id), t = u ? /* @__PURE__ */ z(U, {
714
+ let e = D.filter((e) => e.type !== "group").map((e) => e.id), t = u ? /* @__PURE__ */ R(H, {
710
715
  sensors: O,
711
- collisionDetection: ce,
716
+ collisionDetection: le,
712
717
  onDragEnd: k,
713
- children: /* @__PURE__ */ z(q, {
718
+ children: /* @__PURE__ */ R(K, {
714
719
  items: e,
715
- strategy: de,
716
- children: /* @__PURE__ */ z(S, { children: D.map((e) => /* @__PURE__ */ z(qe, {
720
+ strategy: fe,
721
+ children: /* @__PURE__ */ R(S, { children: D.map((e) => /* @__PURE__ */ R(Je, {
717
722
  item: e,
718
723
  enableReorder: u,
719
724
  ...A
720
725
  }, e.id)) })
721
726
  })
722
- }) : /* @__PURE__ */ z(S, { children: D.map((e) => /* @__PURE__ */ z(Q, {
727
+ }) : /* @__PURE__ */ R(S, { children: D.map((e) => /* @__PURE__ */ R(Q, {
723
728
  item: e,
724
729
  ...A
725
730
  }, e.id)) });
726
- return /* @__PURE__ */ B(We.Provider, {
731
+ return /* @__PURE__ */ z(Ke.Provider, {
727
732
  value: w,
728
- children: [M, /* @__PURE__ */ z(g, { children: /* @__PURE__ */ z(_, { children: t }) })]
733
+ children: [M, /* @__PURE__ */ R(g, { children: /* @__PURE__ */ R(_, { children: t }) })]
729
734
  });
730
735
  }
731
736
  let N = [], P = [], F = (e) => {
732
737
  if (P.length === 0) return;
733
738
  let t = P;
734
- P = [], N.push(/* @__PURE__ */ z(g, { children: /* @__PURE__ */ z(_, { children: /* @__PURE__ */ z(S, { children: t.map((e) => /* @__PURE__ */ z(Q, {
739
+ P = [], N.push(/* @__PURE__ */ R(g, { children: /* @__PURE__ */ R(_, { children: /* @__PURE__ */ R(S, { children: t.map((e) => /* @__PURE__ */ R(Q, {
735
740
  item: e,
736
741
  ...A
737
742
  }, e.id)) }) }) }, e));
738
743
  };
739
744
  return D.forEach((e, t) => {
740
- e.type === "group" ? (F(`leaf-${t}`), N.push(/* @__PURE__ */ z(Q, {
745
+ e.type === "group" ? (F(`leaf-${t}`), N.push(/* @__PURE__ */ R(Q, {
741
746
  item: e,
742
747
  ...A
743
748
  }, e.id))) : P.push(e);
744
- }), F("leaf-end"), /* @__PURE__ */ B(We.Provider, {
749
+ }), F("leaf-end"), /* @__PURE__ */ z(Ke.Provider, {
745
750
  value: w,
746
751
  children: [M, N]
747
752
  });
748
753
  }
749
- function Je(e) {
754
+ function Ye(e) {
750
755
  let t = [];
751
- for (let n of e) n.pinned && n.type !== "group" && n.type !== "separator" && t.push(n), n.children?.length && t.push(...Je(n.children));
756
+ for (let n of e) n.pinned && n.type !== "group" && n.type !== "separator" && t.push(n), n.children?.length && t.push(...Ye(n.children));
752
757
  return t;
753
758
  }
754
759
  //#endregion
755
760
  //#region src/AppSchemaRenderer.tsx
756
- function Ye({ areas: e, activeAreaId: t, onAreaChange: n }) {
757
- return e.length <= 1 ? null : /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ B(v, {
761
+ function Xe(e) {
762
+ return he(e, void 0) ?? "";
763
+ }
764
+ function Ze({ areas: e, activeAreaId: t, onAreaChange: n }) {
765
+ return e.length <= 1 ? null : /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ z(v, {
758
766
  className: "flex items-center gap-1.5",
759
- children: [/* @__PURE__ */ z(te, { className: "h-3.5 w-3.5" }), "Area"]
760
- }), /* @__PURE__ */ z(_, { children: /* @__PURE__ */ z(S, { children: e.map((e) => {
761
- let r = Y(e.icon);
762
- return /* @__PURE__ */ z(T, { children: /* @__PURE__ */ B(w, {
767
+ children: [/* @__PURE__ */ R(te, { className: "h-3.5 w-3.5" }), "Area"]
768
+ }), /* @__PURE__ */ R(_, { children: /* @__PURE__ */ R(S, { children: e.map((e) => {
769
+ let r = J(e.icon), i = Xe(e.label);
770
+ return /* @__PURE__ */ R(T, { children: /* @__PURE__ */ z(w, {
763
771
  isActive: e.id === t,
764
- tooltip: X(e.label),
772
+ tooltip: i,
765
773
  onClick: () => n(e.id),
766
- children: [/* @__PURE__ */ z(r, { className: "h-4 w-4" }), /* @__PURE__ */ z("span", { children: X(e.label) })]
774
+ children: [/* @__PURE__ */ R(r, { className: "h-4 w-4" }), /* @__PURE__ */ R("span", { children: i })]
767
775
  }) }, e.id);
768
776
  }) }) })] });
769
777
  }
770
- function Xe({ items: e, basePath: t }) {
771
- let n = H(), r = (e) => {
778
+ function Qe({ items: e, basePath: t }) {
779
+ let n = V(), r = (e) => {
772
780
  let t = [];
773
781
  for (let n of e) n.type !== "separator" && (n.type === "group" ? t.push(...r(n.children || [])) : t.push(n));
774
782
  return t;
775
783
  }, i = r(e).slice(0, 5);
776
- return i.length === 0 ? null : /* @__PURE__ */ z("div", {
784
+ return i.length === 0 ? null : /* @__PURE__ */ R("div", {
777
785
  className: "fixed bottom-0 left-0 right-0 z-50 flex items-center justify-around border-t bg-background/95 backdrop-blur-sm px-2 py-1 sm:hidden safe-area-bottom",
778
786
  role: "navigation",
779
787
  "aria-label": "Mobile navigation",
780
788
  children: i.map((e) => {
781
- let r = Y(e.icon), i = "#";
789
+ let r = J(e.icon), i = "#";
782
790
  if (e.type === "object") i = `${t}/${e.objectName}`, e.viewName && (i += `/view/${e.viewName}`);
783
791
  else if (e.type === "dashboard") i = e.dashboardName ? `${t}/dashboard/${e.dashboardName}` : "#";
784
792
  else if (e.type === "page") i = e.pageName ? `${t}/page/${e.pageName}` : "#";
@@ -798,55 +806,55 @@ function Xe({ items: e, basePath: t }) {
798
806
  }
799
807
  }
800
808
  let a = i !== "#" && n.pathname.startsWith(i);
801
- return /* @__PURE__ */ B(oe, {
809
+ return /* @__PURE__ */ z(se, {
802
810
  to: i,
803
811
  className: `flex flex-col items-center gap-0.5 px-2 py-1.5 transition-colors min-w-[44px] min-h-[44px] justify-center ${a ? "text-primary" : "text-muted-foreground hover:text-foreground"}`,
804
- children: [/* @__PURE__ */ z(r, { className: "h-5 w-5" }), /* @__PURE__ */ z("span", {
812
+ children: [/* @__PURE__ */ R(r, { className: "h-5 w-5" }), /* @__PURE__ */ R("span", {
805
813
  className: "text-[10px] truncate max-w-[60px]",
806
- children: X(e.label)
814
+ children: Y(e.label)
807
815
  })]
808
816
  }, e.id);
809
817
  })
810
818
  });
811
819
  }
812
- function Ze({ schema: e, basePath: t, evalVis: n, checkPerm: r, checkCap: a, onAction: o, sidebarHeader: s, sidebarFooter: c, sidebarExtra: l, visibleAreas: u, activeAreaId: d, setActiveAreaId: f, resolvedNavigation: g, enableSearch: _, enablePinning: v, onPinToggle: x, enableReorder: C, onReorder: E }) {
813
- let D = Y(e.logo), [O, k] = i("");
814
- return /* @__PURE__ */ B(p, {
820
+ function $e({ schema: e, basePath: t, evalVis: n, checkPerm: r, checkCap: a, onAction: o, sidebarHeader: s, sidebarFooter: c, sidebarExtra: l, visibleAreas: u, activeAreaId: d, setActiveAreaId: f, resolvedNavigation: g, enableSearch: _, enablePinning: v, onPinToggle: x, enableReorder: C, onReorder: E }) {
821
+ let D = J(e.logo), [O, k] = i("");
822
+ return /* @__PURE__ */ z(p, {
815
823
  collapsible: "icon",
816
824
  children: [
817
- /* @__PURE__ */ B(y, { children: [s ?? /* @__PURE__ */ z(S, { children: /* @__PURE__ */ z(T, { children: /* @__PURE__ */ B(w, {
825
+ /* @__PURE__ */ z(y, { children: [s ?? /* @__PURE__ */ R(S, { children: /* @__PURE__ */ R(T, { children: /* @__PURE__ */ z(w, {
818
826
  size: "lg",
819
827
  tooltip: e.title ?? e.name,
820
- children: [/* @__PURE__ */ z("div", {
828
+ children: [/* @__PURE__ */ R("div", {
821
829
  className: "flex aspect-square size-8 items-center justify-center rounded-lg bg-primary text-primary-foreground",
822
- children: e.logo && e.logo.startsWith("http") ? /* @__PURE__ */ z("img", {
830
+ children: e.logo && e.logo.startsWith("http") ? /* @__PURE__ */ R("img", {
823
831
  src: e.logo,
824
832
  alt: e.title ?? "",
825
833
  className: "size-6 object-contain"
826
- }) : /* @__PURE__ */ z(D, { className: "size-4" })
827
- }), /* @__PURE__ */ B("div", {
834
+ }) : /* @__PURE__ */ R(D, { className: "size-4" })
835
+ }), /* @__PURE__ */ z("div", {
828
836
  className: "grid flex-1 text-left text-sm leading-tight",
829
- children: [/* @__PURE__ */ z("span", {
837
+ children: [/* @__PURE__ */ R("span", {
830
838
  className: "truncate font-semibold",
831
839
  children: e.title ?? e.name ?? "App"
832
- }), e.description && /* @__PURE__ */ z("span", {
840
+ }), e.description && /* @__PURE__ */ R("span", {
833
841
  className: "truncate text-xs text-muted-foreground",
834
842
  children: e.description
835
843
  })]
836
844
  })]
837
- }) }) }), _ && /* @__PURE__ */ z(b, {
845
+ }) }) }), _ && /* @__PURE__ */ R(b, {
838
846
  placeholder: "Search navigation…",
839
847
  value: O,
840
848
  onChange: (e) => k(e.target.value),
841
849
  "aria-label": "Search navigation"
842
850
  })] }),
843
- /* @__PURE__ */ B(m, { children: [
844
- u.length > 1 && d && /* @__PURE__ */ z(Ye, {
851
+ /* @__PURE__ */ z(m, { children: [
852
+ u.length > 1 && d && /* @__PURE__ */ R(Ze, {
845
853
  areas: u,
846
854
  activeAreaId: d,
847
855
  onAreaChange: f
848
856
  }),
849
- /* @__PURE__ */ z($, {
857
+ /* @__PURE__ */ R($, {
850
858
  items: g,
851
859
  basePath: t,
852
860
  evaluateVisibility: n,
@@ -861,12 +869,12 @@ function Ze({ schema: e, basePath: t, evalVis: n, checkPerm: r, checkCap: a, onA
861
869
  }),
862
870
  l
863
871
  ] }),
864
- c && /* @__PURE__ */ z(h, { children: c })
872
+ c && /* @__PURE__ */ R(h, { children: c })
865
873
  ]
866
874
  });
867
875
  }
868
- function Qe({ schema: e, basePath: t = "", mobileNavMode: a = "drawer", evaluateVisibility: o, checkPermission: s, checkCapability: c, onAction: l, navbar: u, sidebarHeader: d, sidebarFooter: f, sidebarExtra: p, children: m, className: h, defaultOpen: g = !0, enableSearch: _, enablePinning: v, onPinToggle: y, enableReorder: b, onReorder: x }) {
869
- let S = o ?? ((e) => e !== !1 && e !== "false"), C = s ?? (() => !0), w = c ?? (() => !0), T = r(() => (e.menu ?? []).map((e, t) => pe(e, t)), [e.menu]), E = e.navigation ?? T, D = (e.areas ?? []).filter((e) => je(e.navigation, {
876
+ function et({ schema: e, basePath: t = "", mobileNavMode: a = "drawer", evaluateVisibility: o, checkPermission: s, checkCapability: c, onAction: l, navbar: u, sidebarHeader: d, sidebarFooter: f, sidebarExtra: p, children: m, className: h, defaultOpen: g = !0, enableSearch: _, enablePinning: v, onPinToggle: y, enableReorder: b, onReorder: x }) {
877
+ let S = o ?? ((e) => e !== !1 && e !== "false"), C = s ?? (() => !0), w = c ?? (() => !0), T = r(() => (e.menu ?? []).map((e, t) => me(e, t)), [e.menu]), E = e.navigation ?? T, D = (e.areas ?? []).filter((e) => Ne(e.navigation, {
870
878
  evaluateVisibility: S,
871
879
  checkPermission: C,
872
880
  checkCapability: w,
@@ -879,7 +887,7 @@ function Qe({ schema: e, basePath: t = "", mobileNavMode: a = "drawer", evaluate
879
887
  title: e.title,
880
888
  favicon: e.favicon,
881
889
  logo: e.logo
882
- }, P = /* @__PURE__ */ z(Ze, {
890
+ }, P = /* @__PURE__ */ R($e, {
883
891
  schema: e,
884
892
  basePath: t,
885
893
  evalVis: S,
@@ -899,56 +907,56 @@ function Qe({ schema: e, basePath: t = "", mobileNavMode: a = "drawer", evaluate
899
907
  enableReorder: b,
900
908
  onReorder: x
901
909
  });
902
- return /* @__PURE__ */ B(ae, { children: [/* @__PURE__ */ z(J, {
910
+ return /* @__PURE__ */ z(oe, { children: [/* @__PURE__ */ R(q, {
903
911
  sidebar: P,
904
912
  navbar: u,
905
913
  className: h,
906
914
  defaultOpen: g,
907
915
  branding: N,
908
916
  children: m
909
- }), a === "bottom_nav" && /* @__PURE__ */ z(Xe, {
917
+ }), a === "bottom_nav" && /* @__PURE__ */ R(Qe, {
910
918
  items: M,
911
919
  basePath: t
912
920
  })] });
913
921
  }
914
922
  //#endregion
915
923
  //#region src/SidebarNav.tsx
916
- function $e(e) {
924
+ function tt(e) {
917
925
  return "items" in e && !("href" in e);
918
926
  }
919
- function et({ item: e, pathname: t }) {
920
- return e.children && e.children.length > 0 ? /* @__PURE__ */ z(s, {
927
+ function nt({ item: e, pathname: t }) {
928
+ return e.children && e.children.length > 0 ? /* @__PURE__ */ R(s, {
921
929
  asChild: !0,
922
930
  defaultOpen: !0,
923
931
  className: "group/collapsible",
924
- children: /* @__PURE__ */ B(T, { children: [/* @__PURE__ */ z(l, {
932
+ children: /* @__PURE__ */ z(T, { children: [/* @__PURE__ */ R(l, {
925
933
  asChild: !0,
926
- children: /* @__PURE__ */ B(w, {
934
+ children: /* @__PURE__ */ z(w, {
927
935
  tooltip: e.title,
928
936
  className: "motion-safe:transition-colors motion-safe:duration-150",
929
937
  children: [
930
- e.icon && /* @__PURE__ */ z(e.icon, {}),
931
- /* @__PURE__ */ z("span", { children: e.title }),
932
- e.badge != null && /* @__PURE__ */ z(a, {
938
+ e.icon && /* @__PURE__ */ R(e.icon, {}),
939
+ /* @__PURE__ */ R("span", { children: e.title }),
940
+ e.badge != null && /* @__PURE__ */ R(a, {
933
941
  variant: e.badgeVariant || "default",
934
942
  className: "ml-auto mr-1 h-5 min-w-5 px-1 text-xs",
935
943
  children: e.badge
936
944
  }),
937
- /* @__PURE__ */ z(P, { className: "ml-auto h-4 w-4 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })
945
+ /* @__PURE__ */ R(P, { className: "ml-auto h-4 w-4 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })
938
946
  ]
939
947
  })
940
- }), /* @__PURE__ */ z(c, {
948
+ }), /* @__PURE__ */ R(c, {
941
949
  className: "motion-safe:data-[state=open]:animate-in motion-safe:data-[state=closed]:animate-out motion-safe:data-[state=closed]:fade-out-0 motion-safe:data-[state=open]:fade-in-0 motion-safe:data-[state=closed]:slide-out-to-top-1 motion-safe:data-[state=open]:slide-in-from-top-1 motion-safe:duration-150",
942
- children: /* @__PURE__ */ z(E, { children: e.children.map((e) => /* @__PURE__ */ z(O, { children: /* @__PURE__ */ z(D, {
950
+ children: /* @__PURE__ */ R(E, { children: e.children.map((e) => /* @__PURE__ */ R(O, { children: /* @__PURE__ */ R(D, {
943
951
  asChild: !0,
944
952
  isActive: t === e.href,
945
953
  className: "motion-safe:transition-colors motion-safe:duration-150",
946
- children: /* @__PURE__ */ B(V, {
954
+ children: /* @__PURE__ */ z(B, {
947
955
  to: e.href,
948
956
  children: [
949
- e.icon && /* @__PURE__ */ z(e.icon, {}),
950
- /* @__PURE__ */ z("span", { children: e.title }),
951
- e.badge != null && /* @__PURE__ */ z(a, {
957
+ e.icon && /* @__PURE__ */ R(e.icon, {}),
958
+ /* @__PURE__ */ R("span", { children: e.title }),
959
+ e.badge != null && /* @__PURE__ */ R(a, {
952
960
  variant: e.badgeVariant || "default",
953
961
  className: "ml-auto h-5 min-w-5 px-1 text-xs",
954
962
  children: e.badge
@@ -957,17 +965,17 @@ function et({ item: e, pathname: t }) {
957
965
  })
958
966
  }) }, e.href)) })
959
967
  })] })
960
- }) : /* @__PURE__ */ z(T, { children: /* @__PURE__ */ z(w, {
968
+ }) : /* @__PURE__ */ R(T, { children: /* @__PURE__ */ R(w, {
961
969
  asChild: !0,
962
970
  isActive: t === e.href,
963
971
  tooltip: e.title,
964
972
  className: "motion-safe:transition-colors motion-safe:duration-150",
965
- children: /* @__PURE__ */ B(V, {
973
+ children: /* @__PURE__ */ z(B, {
966
974
  to: e.href,
967
975
  children: [
968
- e.icon && /* @__PURE__ */ z(e.icon, {}),
969
- /* @__PURE__ */ z("span", { children: e.title }),
970
- e.badge != null && /* @__PURE__ */ z(a, {
976
+ e.icon && /* @__PURE__ */ R(e.icon, {}),
977
+ /* @__PURE__ */ R("span", { children: e.title }),
978
+ e.badge != null && /* @__PURE__ */ R(a, {
971
979
  variant: e.badgeVariant || "default",
972
980
  className: "ml-auto h-5 min-w-5 px-1 text-xs",
973
981
  children: e.badge
@@ -976,8 +984,8 @@ function et({ item: e, pathname: t }) {
976
984
  })
977
985
  }) });
978
986
  }
979
- function tt({ items: e, title: n = "Application", className: r, collapsible: i = "icon", searchEnabled: a = !1, searchPlaceholder: o = "Search…" }) {
980
- let s = H(), [c, l] = t.useState(""), d = t.useMemo(() => e.length === 0 ? [] : $e(e[0]) ? e.map((e) => ({
987
+ function rt({ items: e, title: n = "Application", className: r, collapsible: i = "icon", searchEnabled: a = !1, searchPlaceholder: o = "Search…" }) {
988
+ let s = V(), [c, l] = t.useState(""), d = t.useMemo(() => e.length === 0 ? [] : tt(e[0]) ? e.map((e) => ({
981
989
  groupLabel: e.label,
982
990
  items: e.items
983
991
  })) : [{ items: e }], [e]), f = t.useMemo(() => {
@@ -988,14 +996,14 @@ function tt({ items: e, title: n = "Application", className: r, collapsible: i =
988
996
  items: t.items.filter((t) => t.title.toLowerCase().includes(e) || t.children?.some((t) => t.title.toLowerCase().includes(e)))
989
997
  })).filter((e) => e.items.length > 0);
990
998
  }, [d, c]);
991
- return /* @__PURE__ */ z(p, {
999
+ return /* @__PURE__ */ R(p, {
992
1000
  className: r,
993
1001
  collapsible: i,
994
- children: /* @__PURE__ */ B(m, { children: [a && /* @__PURE__ */ z("div", {
1002
+ children: /* @__PURE__ */ z(m, { children: [a && /* @__PURE__ */ R("div", {
995
1003
  className: "px-3 py-2",
996
- children: /* @__PURE__ */ B("div", {
1004
+ children: /* @__PURE__ */ z("div", {
997
1005
  className: "relative",
998
- children: [/* @__PURE__ */ z(ie, { className: "absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ z(u, {
1006
+ children: [/* @__PURE__ */ R(ie, { className: "absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ R(u, {
999
1007
  type: "search",
1000
1008
  placeholder: o,
1001
1009
  value: c,
@@ -1003,16 +1011,16 @@ function tt({ items: e, title: n = "Application", className: r, collapsible: i =
1003
1011
  className: "pl-8 h-9"
1004
1012
  })]
1005
1013
  })
1006
- }), f.map((e, t) => /* @__PURE__ */ B(g, { children: [
1007
- t > 0 && /* @__PURE__ */ z("div", {
1014
+ }), f.map((e, t) => /* @__PURE__ */ z(g, { children: [
1015
+ t > 0 && /* @__PURE__ */ R("div", {
1008
1016
  className: "mx-3 mb-1 h-px bg-sidebar-border/60",
1009
1017
  "aria-hidden": !0
1010
1018
  }),
1011
- /* @__PURE__ */ z(v, {
1019
+ /* @__PURE__ */ R(v, {
1012
1020
  className: "text-[10px] font-semibold uppercase tracking-wider text-sidebar-foreground/60",
1013
1021
  children: e.groupLabel || n
1014
1022
  }),
1015
- /* @__PURE__ */ z(_, { children: /* @__PURE__ */ z(S, { children: e.items.map((e) => /* @__PURE__ */ z(et, {
1023
+ /* @__PURE__ */ R(_, { children: /* @__PURE__ */ R(S, { children: e.items.map((e) => /* @__PURE__ */ R(nt, {
1016
1024
  item: e,
1017
1025
  pathname: s.pathname
1018
1026
  }, e.href)) }) })
@@ -1021,31 +1029,47 @@ function tt({ items: e, title: n = "Application", className: r, collapsible: i =
1021
1029
  }
1022
1030
  //#endregion
1023
1031
  //#region src/index.ts
1024
- function nt() {
1025
- e.register("page-header", ge, {
1032
+ function it() {
1033
+ e.register("page-header", ve, {
1026
1034
  namespace: "layout",
1027
1035
  label: "Page Header",
1028
1036
  category: "Layout",
1029
- inputs: [{
1030
- name: "title",
1031
- type: "string",
1032
- label: "Title"
1033
- }, {
1034
- name: "subtitle",
1035
- type: "string",
1036
- label: "Subtitle"
1037
- }]
1038
- }), e.register("page:card", Se, {
1037
+ isContainer: !0,
1038
+ inputs: [
1039
+ {
1040
+ name: "title",
1041
+ type: "string",
1042
+ label: "Title"
1043
+ },
1044
+ {
1045
+ name: "subtitle",
1046
+ type: "string",
1047
+ label: "Subtitle"
1048
+ },
1049
+ {
1050
+ name: "icon",
1051
+ type: "string",
1052
+ label: "Icon",
1053
+ description: "Lucide icon name"
1054
+ },
1055
+ {
1056
+ name: "actions",
1057
+ type: "array",
1058
+ label: "Actions",
1059
+ description: "ActionDef list (or action ids) rendered through record:quick_actions"
1060
+ }
1061
+ ]
1062
+ }), e.register("page:card", we, {
1039
1063
  namespace: "layout",
1040
1064
  skipFallback: !0,
1041
1065
  label: "Page Card",
1042
1066
  category: "Layout",
1043
1067
  isContainer: !0
1044
- }), e.register("app-shell", J, {
1068
+ }), e.register("app-shell", q, {
1045
1069
  namespace: "layout",
1046
1070
  label: "App Shell",
1047
1071
  category: "Layout"
1048
- }), e.register("responsive-grid", Ee, {
1072
+ }), e.register("responsive-grid", Oe, {
1049
1073
  namespace: "layout",
1050
1074
  label: "Responsive Grid",
1051
1075
  category: "Layout",
@@ -1063,12 +1087,13 @@ function nt() {
1063
1087
  category: "Layout",
1064
1088
  inputs: [{
1065
1089
  name: "items",
1066
- type: "object"
1090
+ type: "array",
1091
+ required: !0
1067
1092
  }, {
1068
1093
  name: "basePath",
1069
1094
  type: "string"
1070
1095
  }]
1071
- }), e.register("app-schema-renderer", Qe, {
1096
+ }), e.register("app-schema-renderer", et, {
1072
1097
  namespace: "layout",
1073
1098
  label: "App Schema Renderer",
1074
1099
  category: "Layout",
@@ -1090,7 +1115,7 @@ function nt() {
1090
1115
  });
1091
1116
  }
1092
1117
  try {
1093
- nt();
1118
+ it();
1094
1119
  } catch {}
1095
1120
  //#endregion
1096
- export { Qe as AppSchemaRenderer, J as AppShell, $ as NavigationRenderer, Se as PageCard, ge as PageHeader, Ee as ResponsiveGrid, tt as SidebarNav, Ge as filterNavigationItems, je as hasVisibleNavigationItems, nt as registerLayout, Ue as resolveActiveNavItem, Ne as resolveHref, Y as resolveIcon, X as resolveLabel, xe as useAppShellBranding };
1121
+ export { et as AppSchemaRenderer, q as AppShell, $ as NavigationRenderer, we as PageCard, ve as PageHeader, Oe as ResponsiveGrid, rt as SidebarNav, Z as filterNavigationItems, Ne as hasVisibleNavigationItems, it as registerLayout, Ge as resolveActiveNavItem, Fe as resolveHref, J as resolveIcon, Y as resolveLabel, Ce as useAppShellBranding };