@declarion/react 0.6.12 → 0.6.13
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/README.md +31 -0
- package/dist-lib/{DraggableChildrenTable-CdzxxoTe.js → DraggableChildrenTable-rb6uaMOV.js} +52 -51
- package/dist-lib/DynamicIcon-DCRdxxZ7.js +260 -0
- package/dist-lib/components/layout/Rail.d.ts +1 -2
- package/dist-lib/components/primitives/Icons.d.ts +119 -119
- package/dist-lib/components/shared/DynamicIcon.d.ts +12 -1
- package/dist-lib/components/shared/LucideIcon.d.ts +16 -0
- package/dist-lib/{dataTableStyles-zH3M7xdm.js → dataTableStyles-EMyLDQRB.js} +1291 -1986
- package/dist-lib/icons.d.ts +4 -0
- package/dist-lib/icons.js +2 -0
- package/dist-lib/index.d.ts +2 -0
- package/dist-lib/index.js +4987 -4971
- package/dist-lib/stores/icon-registry.d.ts +40 -0
- package/dist-lib/types/schema.d.ts +11 -0
- package/package.json +7 -1
package/README.md
CHANGED
|
@@ -17,9 +17,40 @@ pnpm add react react-dom
|
|
|
17
17
|
| Import | Purpose |
|
|
18
18
|
|---|---|
|
|
19
19
|
| `@declarion/react` | Main React entry — components, hooks, types |
|
|
20
|
+
| `@declarion/react/icons` | Lightweight icon rendering — `DynamicIcon` + `setIconRegistry` + built-in glyphs + lazy Lucide, WITHOUT the eager UI bundle (~5 kB gzip). For host/embed apps that render nav from `/api/schema`. |
|
|
20
21
|
| `@declarion/react/styles.css` | Pre-compiled Tailwind output; import once at the SPA root |
|
|
21
22
|
| `@declarion/react/vite` | Node-only Vite plugin — opt into client staleness handling at build time |
|
|
22
23
|
|
|
24
|
+
## Icons
|
|
25
|
+
|
|
26
|
+
A DSL `icon:` value is a NAME resolved against **Lucide** (the default icon
|
|
27
|
+
library, ~1500 glyphs) by name. Resolution order: a consumer-declared `icons:`
|
|
28
|
+
entry served on `/api/schema` (svg / url / lucide-alias) → the curated built-in
|
|
29
|
+
set (`src/components/primitives/Icons.tsx`, thin wrappers over Lucide, bundled
|
|
30
|
+
eagerly for instant render) → Lucide by name (lazy) → `folder`. A host renders
|
|
31
|
+
any icon with one component:
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
import { setIconRegistry, DynamicIcon } from "@declarion/react/icons";
|
|
35
|
+
|
|
36
|
+
// once, after the /api/schema fetch (it carries any custom icons):
|
|
37
|
+
setIconRegistry(schema.icons ?? {});
|
|
38
|
+
// anywhere, any depth - the registry is a module singleton:
|
|
39
|
+
<DynamicIcon name={navItem.icon} size={16} />
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`setIconRegistry` is a module-level store (mirrors `registerScreen`); `DynamicIcon`
|
|
43
|
+
subscribes via `useSyncExternalStore`, so replacing the registry (identity switch)
|
|
44
|
+
re-renders every icon. Bare names resolve from Lucide - no registry entry needed.
|
|
45
|
+
Lucide's per-icon `dynamicIconImports` map is loaded only via `import()` and stays
|
|
46
|
+
out of the eager bundle (the curated `Icons.tsx` set is tree-shaken named imports).
|
|
47
|
+
See [`examples/embed-host`](https://github.com/disciplinedware/declarion/blob/main/typescript/examples/embed-host) for a working host.
|
|
48
|
+
|
|
49
|
+
The curated built-in set is just a name→Lucide-component map with the SDK's
|
|
50
|
+
`{ size, cls, style }` prop adapter; there is no hand-drawn SVG and no codegen.
|
|
51
|
+
To add a name to the eager set, add an entry to `Icons.tsx`; anything not in it
|
|
52
|
+
resolves lazily from Lucide regardless.
|
|
53
|
+
|
|
23
54
|
## Vite plugin: build identity for client staleness handling
|
|
24
55
|
|
|
25
56
|
The SDK ships with a tiny Vite plugin that emits `bundle-fingerprint.txt` next to `index.html` after every production build. The Declarion server reads it at boot and folds it into the build identity stamped on every `/api/*` response (`X-Declarion-Version`). The SDK's built-in version watcher detects drift on every API response, on focus/online/60s probe, and either silently invalidates the schema query (schema-only changes) or prompts the user to reload (asset/binary changes). Cross-tab coordination via `BroadcastChannel`.
|
|
@@ -1,70 +1,71 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as e } from "./DynamicIcon-DCRdxxZ7.js";
|
|
2
|
+
import { Xt as t, Yt as n, a as r, i, lt as a, n as o, r as s, t as c, xt as l } from "./dataTableStyles-EMyLDQRB.js";
|
|
2
3
|
import { useCallback as u, useMemo as d, useRef as f } from "react";
|
|
3
4
|
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
4
5
|
import { DndContext as h, PointerSensor as g, closestCenter as _, useSensor as v, useSensors as y } from "@dnd-kit/core";
|
|
5
6
|
import { SortableContext as b, useSortable as x, verticalListSortingStrategy as S } from "@dnd-kit/sortable";
|
|
6
7
|
import { CSS as C } from "@dnd-kit/utilities";
|
|
7
8
|
//#region src/components/detail-layout/DraggableChildrenTable.tsx
|
|
8
|
-
function w({ config:
|
|
9
|
-
let w = f(null), E =
|
|
9
|
+
function w({ config: n, childEntity: r, schema: i, rows: c, onChange: l, validationErrors: x, refs: C }) {
|
|
10
|
+
let w = f(null), E = n.position_field, D = n.columns, O = y(v(g, { activationConstraint: { distance: 5 } })), k = new Set(Array.isArray(n.foreign_key) ? n.foreign_key : [n.foreign_key]), A = D.filter((e) => {
|
|
10
11
|
if (k.has(e) || e === E) return !1;
|
|
11
|
-
let t =
|
|
12
|
+
let t = r.fields.get(e);
|
|
12
13
|
return !(!t || t.auto || t.primary);
|
|
13
14
|
}), j = new Set(D.filter((e) => {
|
|
14
15
|
if (e === E) return !0;
|
|
15
|
-
let t =
|
|
16
|
+
let t = r.fields.get(e);
|
|
16
17
|
return t && (t.auto || t.primary);
|
|
17
|
-
})), M = D.filter((e) => e !== E), N = d(() =>
|
|
18
|
-
c
|
|
18
|
+
})), M = D.filter((e) => e !== E), N = d(() => c.filter((e) => !e._deleted).map((e) => e._key), [c]), P = u((e, t, n) => {
|
|
19
|
+
l(c.map((r) => r._key === e ? {
|
|
19
20
|
...r,
|
|
20
21
|
[t]: n,
|
|
21
22
|
_dirty: !0
|
|
22
23
|
} : r));
|
|
23
|
-
}, [
|
|
24
|
-
let e =
|
|
24
|
+
}, [c, l]), F = u(() => {
|
|
25
|
+
let e = c.filter((e) => !e._deleted).reduce((e, t) => {
|
|
25
26
|
let n = typeof t[E] == "number" ? t[E] : -1;
|
|
26
27
|
return Math.max(e, n);
|
|
27
|
-
}, -1),
|
|
28
|
+
}, -1), t = {
|
|
28
29
|
_key: crypto.randomUUID(),
|
|
29
30
|
_dirty: !0,
|
|
30
31
|
[E]: e + 1
|
|
31
|
-
}, i =
|
|
32
|
+
}, i = n.quick_add?.defaults ?? {};
|
|
32
33
|
for (let e of A) {
|
|
33
|
-
let
|
|
34
|
-
|
|
34
|
+
let n = r.fields.get(e);
|
|
35
|
+
n && (i[e] === void 0 ? n.default === void 0 ? n.type === "bool" && (t[e] = !1) : t[e] = n.default : t[e] = i[e]);
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
+
l([...c, t]);
|
|
37
38
|
}, [
|
|
38
|
-
a,
|
|
39
39
|
c,
|
|
40
|
+
l,
|
|
40
41
|
A,
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
r,
|
|
43
|
+
n.quick_add?.defaults,
|
|
43
44
|
E
|
|
44
45
|
]), I = u((e) => {
|
|
45
|
-
c
|
|
46
|
+
l(c.map((t) => t._key === e ? {
|
|
46
47
|
...t,
|
|
47
48
|
_deleted: !0
|
|
48
49
|
} : t));
|
|
49
|
-
}, [
|
|
50
|
-
c
|
|
50
|
+
}, [c, l]), L = u((e) => {
|
|
51
|
+
l(c.map((t) => t._key === e ? {
|
|
51
52
|
...t,
|
|
52
53
|
_deleted: !1
|
|
53
54
|
} : t));
|
|
54
|
-
}, [
|
|
55
|
+
}, [c, l]), R = u((e) => {
|
|
55
56
|
let { active: t, over: n } = e;
|
|
56
57
|
if (!n || t.id === n.id) return;
|
|
57
|
-
let r =
|
|
58
|
-
if (
|
|
59
|
-
let
|
|
60
|
-
|
|
58
|
+
let r = c.filter((e) => !e._deleted), i = c.filter((e) => e._deleted), a = r.findIndex((e) => e._key === String(t.id)), o = r.findIndex((e) => e._key === String(n.id));
|
|
59
|
+
if (a === -1 || o === -1) return;
|
|
60
|
+
let s = [...r], [u] = s.splice(a, 1);
|
|
61
|
+
s.splice(o, 0, u), l([...s.map((e, t) => ({
|
|
61
62
|
...e,
|
|
62
63
|
[E]: t,
|
|
63
64
|
_dirty: e[E] === t ? e._dirty : !0
|
|
64
65
|
})), ...i]);
|
|
65
66
|
}, [
|
|
66
|
-
a,
|
|
67
67
|
c,
|
|
68
|
+
l,
|
|
68
69
|
E
|
|
69
70
|
]), z = u((e) => {
|
|
70
71
|
let t = e.target, n = t.closest("td");
|
|
@@ -116,10 +117,10 @@ function w({ config: t, childEntity: n, schema: i, rows: a, onChange: c, validat
|
|
|
116
117
|
padding: "0 4px"
|
|
117
118
|
} }),
|
|
118
119
|
M.map((e) => {
|
|
119
|
-
let t =
|
|
120
|
+
let t = r.fields.get(e);
|
|
120
121
|
return /* @__PURE__ */ p("th", {
|
|
121
122
|
style: B,
|
|
122
|
-
children: t ?
|
|
123
|
+
children: t ? a(t, e, i.entities) : e
|
|
123
124
|
}, e);
|
|
124
125
|
}),
|
|
125
126
|
/* @__PURE__ */ p("th", { style: {
|
|
@@ -129,12 +130,12 @@ function w({ config: t, childEntity: n, schema: i, rows: a, onChange: c, validat
|
|
|
129
130
|
] }) }), /* @__PURE__ */ p(b, {
|
|
130
131
|
items: N,
|
|
131
132
|
strategy: S,
|
|
132
|
-
children: /* @__PURE__ */ p("tbody", { children:
|
|
133
|
+
children: /* @__PURE__ */ p("tbody", { children: c.map((e) => /* @__PURE__ */ p(T, {
|
|
133
134
|
row: e,
|
|
134
135
|
columns: M,
|
|
135
136
|
editableColumns: A,
|
|
136
137
|
displayOnlyColumns: j,
|
|
137
|
-
childEntity:
|
|
138
|
+
childEntity: r,
|
|
138
139
|
validationErrors: x,
|
|
139
140
|
refs: C,
|
|
140
141
|
onCellChange: P,
|
|
@@ -146,7 +147,7 @@ function w({ config: t, childEntity: n, schema: i, rows: a, onChange: c, validat
|
|
|
146
147
|
})
|
|
147
148
|
}), /* @__PURE__ */ p("div", {
|
|
148
149
|
style: { marginTop: 8 },
|
|
149
|
-
children: /* @__PURE__ */ p(
|
|
150
|
+
children: /* @__PURE__ */ p(t, {
|
|
150
151
|
kind: "ghost",
|
|
151
152
|
size: "xs",
|
|
152
153
|
icon: /* @__PURE__ */ p(e.plus, { size: 12 }),
|
|
@@ -155,9 +156,9 @@ function w({ config: t, childEntity: n, schema: i, rows: a, onChange: c, validat
|
|
|
155
156
|
})
|
|
156
157
|
})] });
|
|
157
158
|
}
|
|
158
|
-
function T({ row:
|
|
159
|
-
let v =
|
|
160
|
-
id:
|
|
159
|
+
function T({ row: t, columns: a, editableColumns: o, displayOnlyColumns: s, childEntity: u, validationErrors: d, refs: f, onCellChange: h, onDelete: g, onUndoDelete: _ }) {
|
|
160
|
+
let v = i(), y = !!t._deleted, b = d?.[t._key], { attributes: S, listeners: w, setNodeRef: T, transform: E, transition: D, isDragging: O } = x({
|
|
161
|
+
id: t._key,
|
|
161
162
|
disabled: y
|
|
162
163
|
}), k = {
|
|
163
164
|
transform: C.Translate.toString(E),
|
|
@@ -198,40 +199,40 @@ function T({ row: r, columns: o, editableColumns: s, displayOnlyColumns: l, chil
|
|
|
198
199
|
children: /* @__PURE__ */ p(e.grid, { size: 14 })
|
|
199
200
|
})
|
|
200
201
|
}),
|
|
201
|
-
|
|
202
|
-
let n = u.fields.get(e),
|
|
203
|
-
return y ||
|
|
202
|
+
a.map((e) => {
|
|
203
|
+
let n = u.fields.get(e), i = b?.includes(e), a = s.has(e), c = o.includes(e);
|
|
204
|
+
return y || a || !c ? /* @__PURE__ */ p("td", {
|
|
204
205
|
style: {
|
|
205
206
|
...A,
|
|
206
207
|
textDecoration: y ? "line-through" : "none"
|
|
207
208
|
},
|
|
208
|
-
children: n ?
|
|
209
|
+
children: n ? r({
|
|
209
210
|
field: n,
|
|
210
211
|
fieldName: e,
|
|
211
|
-
value:
|
|
212
|
+
value: t[e],
|
|
212
213
|
mode: "display",
|
|
213
|
-
record:
|
|
214
|
+
record: t,
|
|
214
215
|
refs: f,
|
|
215
216
|
locale: v
|
|
216
|
-
}) : t
|
|
217
|
+
}) : l(t[e])
|
|
217
218
|
}, e) : /* @__PURE__ */ p("td", {
|
|
218
219
|
style: {
|
|
219
220
|
...j,
|
|
220
|
-
outline:
|
|
221
|
+
outline: i ? "1px solid var(--danger)" : "none",
|
|
221
222
|
outlineOffset: -1,
|
|
222
|
-
borderRadius:
|
|
223
|
+
borderRadius: i ? 4 : 0
|
|
223
224
|
},
|
|
224
|
-
title:
|
|
225
|
-
children: n ?
|
|
225
|
+
title: i ? `${e} is required` : void 0,
|
|
226
|
+
children: n ? r({
|
|
226
227
|
field: n,
|
|
227
228
|
fieldName: e,
|
|
228
|
-
value:
|
|
229
|
+
value: t[e],
|
|
229
230
|
mode: "edit",
|
|
230
|
-
onChange: (
|
|
231
|
-
record:
|
|
231
|
+
onChange: (n) => h(t._key, e, n),
|
|
232
|
+
record: t,
|
|
232
233
|
refs: f,
|
|
233
234
|
locale: v
|
|
234
|
-
}) : t
|
|
235
|
+
}) : l(t[e])
|
|
235
236
|
}, e);
|
|
236
237
|
}),
|
|
237
238
|
/* @__PURE__ */ p("td", {
|
|
@@ -243,12 +244,12 @@ function T({ row: r, columns: o, editableColumns: s, displayOnlyColumns: l, chil
|
|
|
243
244
|
children: y ? /* @__PURE__ */ p(n, {
|
|
244
245
|
size: 24,
|
|
245
246
|
icon: /* @__PURE__ */ p(e.refresh, { size: 12 }),
|
|
246
|
-
onClick: () => _(
|
|
247
|
+
onClick: () => _(t._key),
|
|
247
248
|
title: "Undo delete"
|
|
248
249
|
}) : /* @__PURE__ */ p(n, {
|
|
249
250
|
size: 24,
|
|
250
251
|
icon: /* @__PURE__ */ p(e.trash, { size: 12 }),
|
|
251
|
-
onClick: () => g(
|
|
252
|
+
onClick: () => g(t._key),
|
|
252
253
|
title: "Delete row"
|
|
253
254
|
})
|
|
254
255
|
})
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { useEffect as e, useState as t, useSyncExternalStore as n } from "react";
|
|
2
|
+
import { Activity as r, ArrowDown as i, ArrowLeft as a, ArrowUp as o, ArrowUpDown as s, BadgeDollarSign as c, Ban as l, Bell as ee, Bolt as te, Box as u, Boxes as d, Briefcase as ne, Building as f, Building2 as re, Calendar as ie, CalendarClock as ae, Check as oe, ChevronDown as p, ChevronLeft as se, ChevronRight as ce, ChevronUp as le, CircleDot as ue, ClipboardCheck as de, Clock as fe, Code as pe, Columns as me, Columns3 as he, Command as ge, Copy as m, Cpu as h, CreditCard as g, Database as _, Dot as v, Download as y, Edit as b, ExternalLink as x, Eye as S, EyeOff as C, File as w, FileDiff as T, Filter as E, Folder as D, FormInput as O, GitBranch as k, Globe as A, Grid as j, Group as M, Hash as N, Home as P, Inbox as F, Info as I, Key as L, KeyRound as R, Layers as _e, Layout as ve, LayoutDashboard as ye, Link as be, List as xe, ListChecks as Se, Loader as Ce, Lock as we, LogIn as Te, LogOut as Ee, Mail as De, Menu as Oe, Minus as ke, Moon as Ae, MoreHorizontal as je, Package as Me, Paperclip as Ne, Play as Pe, PlayCircle as Fe, Plus as Ie, PlusCircle as Le, ReceiptText as Re, RefreshCw as ze, Repeat as Be, Save as Ve, ScrollText as He, Search as Ue, Settings as We, Settings2 as Ge, Shield as Ke, ShieldCheck as qe, ShieldPlus as Je, ShoppingCart as Ye, Sliders as Xe, SlidersHorizontal as Ze, Smartphone as Qe, Sparkle as $e, Sparkles as et, Star as tt, Sun as nt, Table2 as rt, Tag as it, Tags as at, ToggleRight as ot, Trash as st, Trash2 as ct, TriangleAlert as lt, Undo2 as ut, Upload as dt, User as ft, UserPlus as pt, Users as z, UsersRound as mt, WalletCards as ht, Webhook as gt, Workflow as _t, X as vt, Zap as B } from "lucide-react";
|
|
3
|
+
import { jsx as V } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/primitives/Icons.tsx
|
|
5
|
+
var H = (e) => function({ size: t = 14, cls: n = "", style: r = {} }) {
|
|
6
|
+
return /* @__PURE__ */ V(e, {
|
|
7
|
+
size: t,
|
|
8
|
+
className: n,
|
|
9
|
+
style: r
|
|
10
|
+
});
|
|
11
|
+
}, U = {
|
|
12
|
+
action: H(B),
|
|
13
|
+
activity: H(r),
|
|
14
|
+
ai: H(et),
|
|
15
|
+
arrowDown: H(i),
|
|
16
|
+
arrowUp: H(o),
|
|
17
|
+
audit: H(de),
|
|
18
|
+
back: H(a),
|
|
19
|
+
"badge-dollar-sign": H(c),
|
|
20
|
+
ban: H(l),
|
|
21
|
+
bell: H(ee),
|
|
22
|
+
bolt: H(te),
|
|
23
|
+
box: H(u),
|
|
24
|
+
boxes: H(d),
|
|
25
|
+
branch: H(k),
|
|
26
|
+
building: H(f),
|
|
27
|
+
calendar: H(ie),
|
|
28
|
+
check: H(oe),
|
|
29
|
+
cheveron: H(p),
|
|
30
|
+
"circle-dot": H(ue),
|
|
31
|
+
clock: H(fe),
|
|
32
|
+
code: H(pe),
|
|
33
|
+
columns: H(me),
|
|
34
|
+
"columns-3": H(he),
|
|
35
|
+
command: H(ge),
|
|
36
|
+
company: H(re),
|
|
37
|
+
copy: H(m),
|
|
38
|
+
cpu: H(h),
|
|
39
|
+
"credit-card": H(g),
|
|
40
|
+
database: H(_),
|
|
41
|
+
dbtable: H(rt),
|
|
42
|
+
device: H(Qe),
|
|
43
|
+
dot: H(v),
|
|
44
|
+
down: H(p),
|
|
45
|
+
download: H(y),
|
|
46
|
+
edit: H(b),
|
|
47
|
+
email: H(De),
|
|
48
|
+
entity: H(u),
|
|
49
|
+
external: H(x),
|
|
50
|
+
eye: H(S),
|
|
51
|
+
eyeOff: H(C),
|
|
52
|
+
field: H(O),
|
|
53
|
+
file: H(w),
|
|
54
|
+
"file-diff": H(T),
|
|
55
|
+
filter: H(E),
|
|
56
|
+
flow: H(_t),
|
|
57
|
+
folder: H(D),
|
|
58
|
+
"git-branch": H(k),
|
|
59
|
+
globe: H(A),
|
|
60
|
+
grid: H(j),
|
|
61
|
+
group: H(M),
|
|
62
|
+
handlers: H(gt),
|
|
63
|
+
hash: H(N),
|
|
64
|
+
home: H(P),
|
|
65
|
+
idp: H(R),
|
|
66
|
+
inbox: H(F),
|
|
67
|
+
info: H(I),
|
|
68
|
+
jobs: H(ne),
|
|
69
|
+
key: H(L),
|
|
70
|
+
"key-round": H(R),
|
|
71
|
+
layers: H(_e),
|
|
72
|
+
layout: H(ve),
|
|
73
|
+
"layout-dashboard": H(ye),
|
|
74
|
+
leads: H(z),
|
|
75
|
+
left: H(se),
|
|
76
|
+
link: H(be),
|
|
77
|
+
list: H(xe),
|
|
78
|
+
"list-checks": H(Se),
|
|
79
|
+
loader: H(Ce),
|
|
80
|
+
lock: H(we),
|
|
81
|
+
log: H(He),
|
|
82
|
+
"log-in": H(Te),
|
|
83
|
+
logout: H(Ee),
|
|
84
|
+
menu: H(Oe),
|
|
85
|
+
minus: H(ke),
|
|
86
|
+
moon: H(Ae),
|
|
87
|
+
more: H(je),
|
|
88
|
+
package: H(Me),
|
|
89
|
+
paperclip: H(Ne),
|
|
90
|
+
pipeline: H(k),
|
|
91
|
+
play: H(Pe),
|
|
92
|
+
"play-circle": H(Fe),
|
|
93
|
+
plus: H(Ie),
|
|
94
|
+
"plus-circle": H(Le),
|
|
95
|
+
"receipt-text": H(Re),
|
|
96
|
+
refresh: H(ze),
|
|
97
|
+
repeat: H(Be),
|
|
98
|
+
right: H(ce),
|
|
99
|
+
save: H(Ve),
|
|
100
|
+
sched: H(ae),
|
|
101
|
+
search: H(Ue),
|
|
102
|
+
settings: H(We),
|
|
103
|
+
"settings-2": H(Ge),
|
|
104
|
+
shield: H(Ke),
|
|
105
|
+
"shield-check": H(qe),
|
|
106
|
+
"shield-plus": H(Je),
|
|
107
|
+
"shopping-cart": H(Ye),
|
|
108
|
+
sliders: H(Xe),
|
|
109
|
+
"sliders-horizontal": H(Ze),
|
|
110
|
+
sort: H(s),
|
|
111
|
+
sparkle: H($e),
|
|
112
|
+
star: H(tt),
|
|
113
|
+
sun: H(nt),
|
|
114
|
+
tag: H(it),
|
|
115
|
+
tags: H(at),
|
|
116
|
+
tenant: H(f),
|
|
117
|
+
"toggle-right": H(ot),
|
|
118
|
+
trash: H(st),
|
|
119
|
+
"trash-2": H(ct),
|
|
120
|
+
"undo-2": H(ut),
|
|
121
|
+
up: H(le),
|
|
122
|
+
upload: H(dt),
|
|
123
|
+
user: H(ft),
|
|
124
|
+
"user-plus": H(pt),
|
|
125
|
+
users: H(z),
|
|
126
|
+
"users-round": H(mt),
|
|
127
|
+
"wallet-cards": H(ht),
|
|
128
|
+
warning: H(lt),
|
|
129
|
+
x: H(vt),
|
|
130
|
+
zap: H(B)
|
|
131
|
+
}, W = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Set(), K = 0;
|
|
132
|
+
function q() {
|
|
133
|
+
K += 1;
|
|
134
|
+
for (let e of G) e();
|
|
135
|
+
}
|
|
136
|
+
function yt(e) {
|
|
137
|
+
W.clear();
|
|
138
|
+
for (let [t, n] of Object.entries(e)) W.set(t, n);
|
|
139
|
+
q();
|
|
140
|
+
}
|
|
141
|
+
function J(e) {
|
|
142
|
+
return W.get(e);
|
|
143
|
+
}
|
|
144
|
+
function Y(e) {
|
|
145
|
+
return G.add(e), () => {
|
|
146
|
+
G.delete(e);
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
function X() {
|
|
150
|
+
return K;
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/components/shared/LucideIcon.tsx
|
|
154
|
+
var Z = /* @__PURE__ */ new Map(), Q = null;
|
|
155
|
+
function bt() {
|
|
156
|
+
return Q ||= import("lucide-react/dynamicIconImports").then((e) => e.default ?? e), Q;
|
|
157
|
+
}
|
|
158
|
+
function $({ name: n, size: r = 14, className: i, style: a }) {
|
|
159
|
+
let [o, s] = t(() => Z.get(n)), [c, l] = t(!1);
|
|
160
|
+
if (e(() => {
|
|
161
|
+
let e = Z.get(n);
|
|
162
|
+
if (e) {
|
|
163
|
+
s(() => e), l(!1);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
s(void 0), l(!1);
|
|
167
|
+
let t = !0;
|
|
168
|
+
return bt().then((e) => {
|
|
169
|
+
let r = e[n];
|
|
170
|
+
if (!r) {
|
|
171
|
+
t && l(!0);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
return r().then((e) => {
|
|
175
|
+
Z.set(n, e.default), t && (s(() => e.default), l(!1));
|
|
176
|
+
});
|
|
177
|
+
}), () => {
|
|
178
|
+
t = !1;
|
|
179
|
+
};
|
|
180
|
+
}, [n]), c) {
|
|
181
|
+
let e = U.folder;
|
|
182
|
+
return /* @__PURE__ */ V(e, {
|
|
183
|
+
size: r,
|
|
184
|
+
cls: i,
|
|
185
|
+
style: a
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
return o ? /* @__PURE__ */ V(o, {
|
|
189
|
+
size: r,
|
|
190
|
+
className: i,
|
|
191
|
+
style: a
|
|
192
|
+
}) : null;
|
|
193
|
+
}
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region src/components/shared/DynamicIcon.tsx
|
|
196
|
+
var xt = "lucide:";
|
|
197
|
+
function St({ name: e, size: t, className: r, style: i }) {
|
|
198
|
+
n(Y, X, X);
|
|
199
|
+
let a = typeof t == "number" ? t : typeof t == "string" ? parseFloat(t) : 14, o = J(e);
|
|
200
|
+
if (o) return /* @__PURE__ */ V(Ct, {
|
|
201
|
+
def: o,
|
|
202
|
+
size: a,
|
|
203
|
+
className: r,
|
|
204
|
+
style: i
|
|
205
|
+
});
|
|
206
|
+
let s = U[e];
|
|
207
|
+
return s ? /* @__PURE__ */ V(s, {
|
|
208
|
+
size: a,
|
|
209
|
+
cls: r,
|
|
210
|
+
style: i
|
|
211
|
+
}) : /* @__PURE__ */ V($, {
|
|
212
|
+
name: e.startsWith(xt) ? e.slice(7) : e,
|
|
213
|
+
size: a,
|
|
214
|
+
className: r,
|
|
215
|
+
style: i
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
function Ct({ def: e, size: t, className: n, style: r }) {
|
|
219
|
+
switch (e.kind) {
|
|
220
|
+
case "svg": return /* @__PURE__ */ V(wt, {
|
|
221
|
+
paths: e.paths,
|
|
222
|
+
size: t,
|
|
223
|
+
className: n,
|
|
224
|
+
style: r
|
|
225
|
+
});
|
|
226
|
+
case "url": return /* @__PURE__ */ V("img", {
|
|
227
|
+
src: e.src,
|
|
228
|
+
alt: "",
|
|
229
|
+
"aria-hidden": "true",
|
|
230
|
+
width: t,
|
|
231
|
+
height: t,
|
|
232
|
+
className: n,
|
|
233
|
+
style: r
|
|
234
|
+
});
|
|
235
|
+
case "lucide": return /* @__PURE__ */ V($, {
|
|
236
|
+
name: e.name,
|
|
237
|
+
size: t,
|
|
238
|
+
className: n,
|
|
239
|
+
style: r
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
function wt({ paths: e, size: t, className: n, style: r }) {
|
|
244
|
+
return /* @__PURE__ */ V("svg", {
|
|
245
|
+
width: t,
|
|
246
|
+
height: t,
|
|
247
|
+
viewBox: "0 0 24 24",
|
|
248
|
+
fill: "none",
|
|
249
|
+
stroke: "currentColor",
|
|
250
|
+
strokeWidth: 1.5,
|
|
251
|
+
strokeLinecap: "round",
|
|
252
|
+
strokeLinejoin: "round",
|
|
253
|
+
className: n,
|
|
254
|
+
style: r,
|
|
255
|
+
"aria-hidden": "true",
|
|
256
|
+
children: e.map((e, t) => /* @__PURE__ */ V("path", { d: e }, t))
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
//#endregion
|
|
260
|
+
export { yt as a, X as i, $ as n, Y as o, J as r, U as s, St as t };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { type IconName } from "../../components/primitives";
|
|
2
1
|
import type { AreaDef } from "../../types/schema";
|
|
3
2
|
import type { PublicBranding } from "../../types/api";
|
|
4
3
|
export interface RailAreaItem {
|
|
5
4
|
id: string;
|
|
6
|
-
icon:
|
|
5
|
+
icon: string | undefined;
|
|
7
6
|
label: string;
|
|
8
7
|
}
|
|
9
8
|
export interface RailProps {
|