@declarion/react 0.31.2 → 0.34.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.
Files changed (55) hide show
  1. package/dist-lib/{ActionRunner-BzaZQtiI.js → ActionRunner-UGGvGypS.js} +925 -788
  2. package/dist-lib/{DraggableChildrenTable-DILqStHQ.js → DraggableChildrenTable-CljdYXd_.js} +30 -30
  3. package/dist-lib/DynamicIcon-BWO6QtNF.js +261 -0
  4. package/dist-lib/{Grid-BIsiUwPh.js → Grid-5Y_iPqNW.js} +2 -2
  5. package/dist-lib/{LayoutRenderer-3RvIsC9M.js → LayoutRenderer-CoTMmvNW.js} +670 -670
  6. package/dist-lib/{MarkdownRenderer-CaHhWrfm.js → MarkdownRenderer-unbncYEV.js} +1 -1
  7. package/dist-lib/RefreshControl-oeKhCjEC.js +837 -0
  8. package/dist-lib/SmartDetailPage.impl-Caxd97q6.js +1771 -0
  9. package/dist-lib/{SmartRecordListPage.impl-B1iws8yf.js → SmartRecordListPage.impl-BF_ieDc2.js} +253 -253
  10. package/dist-lib/api/data.d.ts +4 -4
  11. package/dist-lib/api/params.d.ts +1 -1
  12. package/dist-lib/components/layout/Rail.d.ts +5 -5
  13. package/dist-lib/components/layout/TopBar.d.ts +3 -1
  14. package/dist-lib/components/pages/DocumentsMenu.d.ts +22 -0
  15. package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +42 -0
  16. package/dist-lib/components/pages/auth/AuthShell.d.ts +1 -1
  17. package/dist-lib/components/pages/list/ListHeader.d.ts +1 -11
  18. package/dist-lib/components/primitives/BrandLogo.d.ts +1 -1
  19. package/dist-lib/components/primitives/Icons.d.ts +1 -0
  20. package/dist-lib/components/primitives/Tooltip.d.ts +30 -0
  21. package/dist-lib/components/primitives/index.d.ts +2 -0
  22. package/dist-lib/components/shared/ActionResultDialog.d.ts +4 -0
  23. package/dist-lib/components/shared/ActionRunner.d.ts +1 -0
  24. package/dist-lib/components/shared/ObjectActionBar.d.ts +29 -0
  25. package/dist-lib/components/shared/PageHeader.d.ts +1 -1
  26. package/dist-lib/components/shared/RecordHeader.d.ts +3 -1
  27. package/dist-lib/components/shared/RefreshControl.d.ts +6 -0
  28. package/dist-lib/components/shared/ResponsiveActionBar.d.ts +9 -1
  29. package/dist-lib/hooks/useBranding.d.ts +8 -0
  30. package/dist-lib/hooks/useBrandingChrome.d.ts +6 -0
  31. package/dist-lib/hooks/useLiveObject.d.ts +9 -0
  32. package/dist-lib/hooks/useMutations.d.ts +3 -3
  33. package/dist-lib/hooks/useObject.d.ts +10 -0
  34. package/dist-lib/hooks/usePageStateRuntime.d.ts +1 -1
  35. package/dist-lib/hooks/useParams.d.ts +10 -1
  36. package/dist-lib/icons.js +1 -1
  37. package/dist-lib/index.d.ts +11 -5
  38. package/dist-lib/index.js +2457 -2335
  39. package/dist-lib/lib/actions.d.ts +6 -2
  40. package/dist-lib/lib/branding.d.ts +10 -1
  41. package/dist-lib/lib/document-templates.d.ts +12 -0
  42. package/dist-lib/lib/download.d.ts +20 -0
  43. package/dist-lib/lib/record-documents-key.d.ts +1 -0
  44. package/dist-lib/{registry-2KliNTHB.js → registry-DnPK3Msj.js} +1658 -1607
  45. package/dist-lib/testing.d.ts +5 -3
  46. package/dist-lib/testing.js +37 -33
  47. package/dist-lib/types/api.d.ts +62 -3
  48. package/dist-lib/types/schema.d.ts +18 -16
  49. package/dist-lib/{useProperties-Co3RdtuT.js → useProperties-CgRhBh0k.js} +70 -70
  50. package/dist-lib/{value-BooGwUik.js → value-GmL5BVFm.js} +29 -29
  51. package/package.json +1 -1
  52. package/dist-lib/DynamicIcon-DCRdxxZ7.js +0 -260
  53. package/dist-lib/SmartDetailPage.impl--EO-9fos.js +0 -1494
  54. package/dist-lib/hooks/useEntityItem.d.ts +0 -10
  55. package/dist-lib/peekDraftStore-yyzMbaiI.js +0 -468
@@ -1,4 +1,4 @@
1
- import { Ft as e, It as t, zt as n } from "./ActionRunner-BzaZQtiI.js";
1
+ import { Ht as e, Rt as t, zt as n } from "./ActionRunner-UGGvGypS.js";
2
2
  import { useCallback as r, useEffect as i, useRef as a, useState as o } from "react";
3
3
  //#region src/components/file-widgets/helpers.ts
4
4
  var s = ["thumb_200", "thumb_300"];
@@ -113,17 +113,17 @@ function T(e, t) {
113
113
  function E(e) {
114
114
  return `${e}${e.includes("?") ? "&" : "?"}disposition=attachment`;
115
115
  }
116
- async function D(n, r) {
117
- let i = await e(), a = await fetch(n, T(i, r));
116
+ async function D(e, r) {
117
+ let i = await t(), a = await fetch(e, T(i, r));
118
118
  if (a.status !== 401) return a;
119
- t();
120
- let o = await e();
121
- return fetch(n, T(o, r));
122
- }
123
- async function O(e, t, r) {
124
- if (!n()) throw Error("resolveEmbedFileSrc called outside embed token mode");
125
- let i = await D(C(e, t), r);
126
- if (i.status === 202 && typeof t == "object") throw new w(e, t.derivation);
119
+ n();
120
+ let o = await t();
121
+ return fetch(e, T(o, r));
122
+ }
123
+ async function O(t, n, r) {
124
+ if (!e()) throw Error("resolveEmbedFileSrc called outside embed token mode");
125
+ let i = await D(C(t, n), r);
126
+ if (i.status === 202 && typeof n == "object") throw new w(t, n.derivation);
127
127
  if (!i.ok) throw Error(`embed file url request failed: ${i.status} ${i.statusText}`);
128
128
  let a = await i.json();
129
129
  if (!S(a)) throw Error("embed file url response is malformed");
@@ -132,7 +132,7 @@ async function O(e, t, r) {
132
132
  kind: "direct"
133
133
  };
134
134
  if (!a.url.startsWith("/api/files/")) throw Error(`embed file proxy: refusing non-files-route URL ${JSON.stringify(a.url)}`);
135
- let o = await D(t === "download" ? E(a.url) : a.url, r);
135
+ let o = await D(n === "download" ? E(a.url) : a.url, r);
136
136
  if (!o.ok) throw Error(`embed file proxy fetch failed: ${o.status} ${o.statusText}`);
137
137
  let s = await o.blob();
138
138
  return {
@@ -148,23 +148,23 @@ function k(e) {
148
148
  function A(e) {
149
149
  return e.startsWith("derivation:") ? { derivation: e.slice(11) } : e === "download" ? "download" : "preview";
150
150
  }
151
- function j(e, t, r) {
152
- let a = k(t), [s, c] = o(() => n() ? void 0 : r);
151
+ function j(t, n, r) {
152
+ let a = k(n), [s, c] = o(() => e() ? void 0 : r);
153
153
  return i(() => {
154
- n() || c(r);
154
+ e() || c(r);
155
155
  }, [r]), i(() => {
156
- if (!n()) return;
157
- if (!e) {
156
+ if (!e()) return;
157
+ if (!t) {
158
158
  c(void 0);
159
159
  return;
160
160
  }
161
- let t = null, r = !1, i = new AbortController();
162
- return c(void 0), O(e, A(a), i.signal).then((e) => {
161
+ let n = null, r = !1, i = new AbortController();
162
+ return c(void 0), O(t, A(a), i.signal).then((e) => {
163
163
  if (r) {
164
164
  e.kind === "blob" && URL.revokeObjectURL(e.url);
165
165
  return;
166
166
  }
167
- e.kind === "blob" && (t = e.url), c(e.url);
167
+ e.kind === "blob" && (n = e.url), c(e.url);
168
168
  }).catch((e) => {
169
169
  if (!r) {
170
170
  if (e instanceof w) {
@@ -174,22 +174,22 @@ function j(e, t, r) {
174
174
  e instanceof DOMException && e.name === "AbortError" || (console.error("[declarion-embed] file src resolution failed:", e), c(void 0));
175
175
  }
176
176
  }), () => {
177
- r = !0, i.abort(), t && URL.revokeObjectURL(t);
177
+ r = !0, i.abort(), n && URL.revokeObjectURL(n);
178
178
  };
179
- }, [e, a]), s;
179
+ }, [t, a]), s;
180
180
  }
181
181
  function M() {
182
- let e = a([]);
182
+ let t = a([]);
183
183
  return i(() => () => {
184
- for (let t of e.current) URL.revokeObjectURL(t);
185
- e.current = [];
186
- }, []), { open: r((t, r, i) => {
187
- if (!n()) {
184
+ for (let e of t.current) URL.revokeObjectURL(e);
185
+ t.current = [];
186
+ }, []), { open: r((n, r, i) => {
187
+ if (!e()) {
188
188
  i && window.open(i, "_blank", "noopener");
189
189
  return;
190
190
  }
191
- t && O(t, r).then((t) => {
192
- t.kind === "blob" && e.current.push(t.url), window.open(t.url, "_blank", "noopener");
191
+ n && O(n, r).then((e) => {
192
+ e.kind === "blob" && t.current.push(e.url), window.open(e.url, "_blank", "noopener");
193
193
  }).catch((e) => {
194
194
  e instanceof w || console.error("[declarion-embed] file open failed:", e);
195
195
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@declarion/react",
3
- "version": "0.31.2",
3
+ "version": "0.34.0",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "description": "React SDK for Declarion, the schema-driven business apps platform.",
@@ -1,260 +0,0 @@
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 };