@declarion/react 0.59.2 → 0.60.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 (35) hide show
  1. package/dist-lib/{AgentChatPanel.impl-DBH1Ff4G.js → AgentChatPanel.impl-BY-Ir7Sh.js} +39 -39
  2. package/dist-lib/{DetailAuditStrip-9eJM2Fml.js → DetailAuditStrip-B9p1XhjC.js} +11 -11
  3. package/dist-lib/{DraggableChildrenTable-4RZC351U.js → DraggableChildrenTable-CtL7rdT6.js} +34 -34
  4. package/dist-lib/{Grid-CQabaBLx.js → Grid-CYERLdXO.js} +1 -1
  5. package/dist-lib/{LayoutRenderer-DGKWZKpW.js → LayoutRenderer-B08IJKsZ.js} +465 -465
  6. package/dist-lib/{ListCardsBody-DfGmyNIu.js → ListCardsBody-Dje_rays.js} +26 -26
  7. package/dist-lib/{MarkdownRenderer-BDbzDv_y.js → MarkdownRenderer-N0IWjTH5.js} +1 -1
  8. package/dist-lib/{RefreshControl-Bhoib0ZA.js → RefreshControl-BEWSHtAC.js} +26 -26
  9. package/dist-lib/{SmartDetailPage.impl-DFjz29Ff.js → SmartDetailPage.impl-CYiM-ITJ.js} +470 -470
  10. package/dist-lib/SmartListPage.impl-Db_Pv9Xc.js +3051 -0
  11. package/dist-lib/SmartRecordListPage.impl-hbbLglC1.js +780 -0
  12. package/dist-lib/{SortHeaderMenu-Cijxk4cX.js → SortHeaderMenu-DKKeCGTH.js} +1 -1
  13. package/dist-lib/{action-dispatch-DY0c8U81.js → action-dispatch-DbiOpvd6.js} +187 -187
  14. package/dist-lib/api/data.d.ts +5 -1
  15. package/dist-lib/{cardProjection-Bkl2SSYz.js → cardProjection-nveYLvHR.js} +1 -1
  16. package/dist-lib/components/pages/list/filter-meta.d.ts +1 -1
  17. package/dist-lib/components/pages/list/useActiveView.d.ts +9 -2
  18. package/dist-lib/components/pages/list/useListViews.d.ts +3 -2
  19. package/dist-lib/{failure-v-uGSpbX.js → failure-BT54OLHy.js} +5 -5
  20. package/dist-lib/{format-count-DA4wmmWR.js → format-count-DLFCdtME.js} +246 -246
  21. package/dist-lib/hooks/useObject.d.ts +3 -2
  22. package/dist-lib/index.js +613 -613
  23. package/dist-lib/lib/field-classification.d.ts +10 -1
  24. package/dist-lib/{peekDraftStore-D-cTbiIr.js → peekDraftStore-DSExeoAh.js} +6 -6
  25. package/dist-lib/{registry-Cb3W-czW.js → registry-CRPxNbkk.js} +444 -438
  26. package/dist-lib/testing.js +2 -2
  27. package/dist-lib/{useAgentConversation-D97IqE-J.js → useAgentConversation-BavrHfrU.js} +14 -14
  28. package/dist-lib/{useCurrentScreen-BL5NZFCw.js → useCurrentScreen-BPq7HMF1.js} +1083 -1017
  29. package/dist-lib/{useListQuery-BG1GyKtJ.js → useListQuery-CG1WM4cv.js} +5 -5
  30. package/dist-lib/{field-classification-C28XE-_P.js → useOwnRefresh-C18iWRgr.js} +132 -158
  31. package/dist-lib/{useProperties-4Lg3odrt.js → useProperties-C35JrjwQ.js} +2 -2
  32. package/dist-lib/{useTabSearchMirror-ZVLlINBX.js → useTabSearchMirror-DKktWWLB.js} +1 -1
  33. package/package.json +1 -1
  34. package/dist-lib/SmartListPage.impl-BrZLE_Gb.js +0 -3046
  35. package/dist-lib/SmartRecordListPage.impl-C1FJLr80.js +0 -780
@@ -1,9 +1,9 @@
1
- import { In as e, jn as t, vn as n } from "./useCurrentScreen-BL5NZFCw.js";
1
+ import { Kn as e, On as t, Vn as n } from "./useCurrentScreen-BPq7HMF1.js";
2
2
  import { t as r } from "./useText-BFDCTUSo.js";
3
3
  import { t as i } from "./Check-DAfMbQIw.js";
4
- import { f as a, m as o, p as s, r as c } from "./action-dispatch-DY0c8U81.js";
5
- import { t as l } from "./cardProjection-Bkl2SSYz.js";
6
- import { t as u } from "./SmartListPage.impl-BrZLE_Gb.js";
4
+ import { f as a, m as o, p as s, r as c } from "./action-dispatch-DbiOpvd6.js";
5
+ import { t as l } from "./cardProjection-nveYLvHR.js";
6
+ import { t as u } from "./SmartListPage.impl-Db_Pv9Xc.js";
7
7
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
8
8
  //#region src/components/pages/list/ListCardRow.tsx
9
9
  function p(e, t, n, r) {
@@ -17,22 +17,22 @@ function p(e, t, n, r) {
17
17
  }
18
18
  return o(e, n, t, r);
19
19
  }
20
- function m(e, n, r) {
20
+ function m(e, t, r) {
21
21
  if (e.startsWith("$status.")) {
22
- let t = e.slice(8), r = n.$statuses;
23
- return Array.isArray(r) && r.some((e) => e.group_code === t);
22
+ let n = e.slice(8), r = t.$statuses;
23
+ return Array.isArray(r) && r.some((e) => e.group_code === n);
24
24
  }
25
25
  if (e.startsWith("$property.")) {
26
- let r = e.slice(10), i = n.$properties, a = Array.isArray(i) ? i.find((e) => e.property_code === r) : void 0;
27
- return a?.value != null && t(a.value) !== "";
26
+ let r = e.slice(10), i = t.$properties, a = Array.isArray(i) ? i.find((e) => e.property_code === r) : void 0;
27
+ return a?.value != null && n(a.value) !== "";
28
28
  }
29
- let i = a(r, n, e);
30
- return i != null && t(i) !== "";
29
+ let i = a(r, t, e);
30
+ return i != null && n(i) !== "";
31
31
  }
32
- function h(n, r, i) {
32
+ function h(t, r, i) {
33
33
  let { entity: a, entityCode: o, refs: c, t: l, renderers: u } = i;
34
- if (n.startsWith("$status.")) {
35
- let t = n.slice(8), i = a.status_groups?.[t], o = r.$statuses, s = Array.isArray(o) ? o.find((e) => e.group_code === t) : void 0;
34
+ if (t.startsWith("$status.")) {
35
+ let n = t.slice(8), i = a.status_groups?.[n], o = r.$statuses, s = Array.isArray(o) ? o.find((e) => e.group_code === n) : void 0;
36
36
  if (!i || !s) return /* @__PURE__ */ d("span", {
37
37
  style: { color: "var(--text-3)" },
38
38
  children: "-"
@@ -44,34 +44,34 @@ function h(n, r, i) {
44
44
  children: l(c?.name) || s.status_code
45
45
  });
46
46
  }
47
- if (n.startsWith("$property.")) {
48
- let e = n.slice(10), i = r.$properties, a = Array.isArray(i) ? i.find((t) => t.property_code === e) : void 0;
47
+ if (t.startsWith("$property.")) {
48
+ let e = t.slice(10), i = r.$properties, a = Array.isArray(i) ? i.find((t) => t.property_code === e) : void 0;
49
49
  return !a || a.value == null ? /* @__PURE__ */ d("span", {
50
50
  style: { color: "var(--text-3)" },
51
51
  children: "-"
52
- }) : /* @__PURE__ */ d("span", { children: t(a.value) });
52
+ }) : /* @__PURE__ */ d("span", { children: n(a.value) });
53
53
  }
54
- if (a.files?.get(n)) return s({
54
+ if (a.files?.get(t)) return s({
55
55
  entity: a,
56
56
  entityCode: o,
57
- fieldName: n,
57
+ fieldName: t,
58
58
  record: r,
59
59
  mode: "display",
60
60
  surface: "list",
61
61
  refs: c,
62
62
  t: l
63
63
  });
64
- let f = u.get(n);
64
+ let f = u.get(t);
65
65
  if (!f) {
66
- let e = r[n];
67
- return t(e) || /* @__PURE__ */ d("span", {
66
+ let e = r[t];
67
+ return n(e) || /* @__PURE__ */ d("span", {
68
68
  style: { color: "var(--text-3)" },
69
69
  children: "-"
70
70
  });
71
71
  }
72
- return f(r[n], r);
72
+ return f(r[t], r);
73
73
  }
74
- function g({ row: e, rowIndex: t, entity: a, screen: o, entityCode: s, entities: g, savedViewColumns: _, refs: v, renderers: y, rowActions: b, tabNavigate: x, interaction: S, hasSoftDelete: C, zebra: w, hasBatchActions: T, hasDetailTarget: E, rowKey: D, measureElement: O }) {
74
+ function g({ row: e, rowIndex: n, entity: a, screen: o, entityCode: s, entities: g, savedViewColumns: _, refs: v, renderers: y, rowActions: b, tabNavigate: x, interaction: S, hasSoftDelete: C, zebra: w, hasBatchActions: T, hasDetailTarget: E, rowKey: D, measureElement: O }) {
75
75
  let k = r(), A = {
76
76
  entity: a,
77
77
  entityCode: s,
@@ -82,9 +82,9 @@ function g({ row: e, rowIndex: t, entity: a, screen: o, entityCode: s, entities:
82
82
  entity: a,
83
83
  screen: M,
84
84
  savedViewColumns: _
85
- }), P = C && j[a.soft_delete] != null, F = e.getIsSelected(), I = w && t % 2 == 1, L = E || S.peekAllowed, R = (N.titleUsesDisplay ? n(k, j, a) ?? (N.titleField ? null : D(j)) : null) || (N.titleField ? h(N.titleField, j, A) : D(j)), z = N.badgeFields.filter((e) => !N.hideEmptyFields || m(e, j, a)), B = N.bodyFields.filter((e) => !N.hideEmptyFields || m(e, j, a)), V = N.metaFields.filter((e) => !N.hideEmptyFields || m(e, j, a));
85
+ }), P = C && j[a.soft_delete] != null, F = e.getIsSelected(), I = w && n % 2 == 1, L = E || S.peekAllowed, R = (N.titleUsesDisplay ? t(k, j, a) ?? (N.titleField ? null : D(j)) : null) || (N.titleField ? h(N.titleField, j, A) : D(j)), z = N.badgeFields.filter((e) => !N.hideEmptyFields || m(e, j, a)), B = N.bodyFields.filter((e) => !N.hideEmptyFields || m(e, j, a)), V = N.metaFields.filter((e) => !N.hideEmptyFields || m(e, j, a));
86
86
  return /* @__PURE__ */ d("div", {
87
- "data-index": t,
87
+ "data-index": n,
88
88
  "data-testid": "list-card",
89
89
  ref: (e) => O(e),
90
90
  style: {
@@ -1,4 +1,4 @@
1
- import { _t as e } from "./useCurrentScreen-BL5NZFCw.js";
1
+ import { _t as e } from "./useCurrentScreen-BPq7HMF1.js";
2
2
  import { t } from "./useText-BFDCTUSo.js";
3
3
  import { t as n } from "./safe-url-oSJw5pzO.js";
4
4
  import { jsx as r } from "react/jsx-runtime";
@@ -1,7 +1,7 @@
1
1
  import { s as e } from "./DynamicIcon-DW5krHuX.js";
2
- import { Bt as t, In as n, Ln as r, nn as i, on as a, sn as o } from "./useCurrentScreen-BL5NZFCw.js";
2
+ import { Kn as t, Xt as n, _n as r, fn as i, gn as a, qn as o } from "./useCurrentScreen-BPq7HMF1.js";
3
3
  import { D as s, t as c } from "./useText-BFDCTUSo.js";
4
- import { C as l, M as u, c as d } from "./field-classification-C28XE-_P.js";
4
+ import { T as l, g as u, t as d } from "./useOwnRefresh-C18iWRgr.js";
5
5
  import { useCallback as f, useEffect as p, useId as m, useMemo as h, useRef as g, useState as _ } from "react";
6
6
  import { useLocation as v } from "react-router";
7
7
  import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
@@ -142,7 +142,7 @@ function L(e) {
142
142
  //#endregion
143
143
  //#region src/hooks/useBranding.ts
144
144
  function R() {
145
- let e = t(j);
145
+ let e = n(j);
146
146
  return {
147
147
  branding: P(e.value),
148
148
  isLoading: e.loading
@@ -176,11 +176,11 @@ function U() {
176
176
  ]);
177
177
  }
178
178
  function W(e) {
179
- let t = H(e?.phone_max, o.phoneMax), n = H(e?.tablet_max, o.tabletMax), r = t < n;
180
- return r || console.error(`branding.chrome breakpoints: phone_max (${t}) must be below tablet_max (${n}), or no viewport can ever resolve to the tablet class. Both bounds fall back to the SDK defaults.`), {
181
- phoneMax: r ? t : o.phoneMax,
182
- tabletMax: r ? n : o.tabletMax,
183
- landscapePhoneMaxHeight: H(e?.landscape_phone_max_height, o.landscapePhoneMaxHeight)
179
+ let t = H(e?.phone_max, r.phoneMax), n = H(e?.tablet_max, r.tabletMax), i = t < n;
180
+ return i || console.error(`branding.chrome breakpoints: phone_max (${t}) must be below tablet_max (${n}), or no viewport can ever resolve to the tablet class. Both bounds fall back to the SDK defaults.`), {
181
+ phoneMax: i ? t : r.phoneMax,
182
+ tabletMax: i ? n : r.tabletMax,
183
+ landscapePhoneMaxHeight: H(e?.landscape_phone_max_height, r.landscapePhoneMaxHeight)
184
184
  };
185
185
  }
186
186
  function G(e) {
@@ -243,7 +243,7 @@ function ee(e, t, n, r) {
243
243
  function te(e = q) {
244
244
  let t = v(), n = g(null);
245
245
  if (n.current === null) {
246
- let r = l(t), i = u.getState().read(r, e);
246
+ let r = u(t), i = l.getState().read(r, e);
247
247
  n.current = i && Number.isFinite(i.offset) ? Math.max(0, i.offset) : 0;
248
248
  }
249
249
  return n.current;
@@ -266,7 +266,7 @@ function ne(e) {
266
266
  };
267
267
  }
268
268
  function re(e) {
269
- let { virtualizer: t, scrollElementRef: n, rowKeys: r } = e, i = e.stateKey ?? "scroll", a = e.enabled ?? !0, o = v(), s = l(o), c = g(t);
269
+ let { virtualizer: t, scrollElementRef: n, rowKeys: r } = e, i = e.stateKey ?? "scroll", a = e.enabled ?? !0, o = v(), s = u(o), c = g(t);
270
270
  c.current = t;
271
271
  let d = g(r);
272
272
  d.current = r;
@@ -277,7 +277,7 @@ function re(e) {
277
277
  if (!a) return;
278
278
  let e = c.current;
279
279
  if (!e || r.length === 0) return;
280
- let t = u.getState().read(s, i), n = f.current !== s;
280
+ let t = l.getState().read(s, i), n = f.current !== s;
281
281
  if (f.current = s, !t) {
282
282
  n && e.scrollToOffset(0, {
283
283
  align: "start",
@@ -285,14 +285,14 @@ function re(e) {
285
285
  });
286
286
  return;
287
287
  }
288
- let o = 0, l = 0, p = NaN, m = () => {
288
+ let o = 0, u = 0, p = NaN, m = () => {
289
289
  let e = c.current;
290
290
  if (!e) return;
291
291
  let n = ee(t, d.current, (t) => e.getOffsetForIndex(t, "start")?.[0], e.getTotalSize());
292
292
  n !== null && (Number.isNaN(p) || Math.abs(n - p) > 1) && (e.scrollToOffset(n, {
293
293
  align: "start",
294
294
  behavior: "auto"
295
- }), p = n, l++ < Y && (o = requestAnimationFrame(m)));
295
+ }), p = n, u++ < Y && (o = requestAnimationFrame(m)));
296
296
  };
297
297
  return m(), () => {
298
298
  o && cancelAnimationFrame(o);
@@ -313,16 +313,16 @@ function $(e, t, n, r, i) {
313
313
  let a = g(i);
314
314
  a.current = i, p(() => {
315
315
  if (!t) return;
316
- let i = 0, o = X, s = null, c = null, l = (e) => {
316
+ let i = 0, o = X, s = null, c = null, u = (e) => {
317
317
  let t = a.current(e);
318
- t && u.getState().set(n, r, t);
318
+ t && l.getState().set(n, r, t);
319
319
  }, d = () => c?.trigger(), f = () => {
320
320
  let t = e.current;
321
321
  if (!t) {
322
322
  o-- > 0 && (i = requestAnimationFrame(f));
323
323
  return;
324
324
  }
325
- s = t, c = ne(() => l(t)), t.addEventListener("scroll", d, { passive: !0 });
325
+ s = t, c = ne(() => u(t)), t.addEventListener("scroll", d, { passive: !0 });
326
326
  };
327
327
  return f(), () => {
328
328
  i && cancelAnimationFrame(i), s && s.removeEventListener("scroll", d), c?.flush();
@@ -335,7 +335,7 @@ function $(e, t, n, r, i) {
335
335
  ]);
336
336
  }
337
337
  function ie(e) {
338
- let { scrollElementRef: t } = e, n = e.stateKey ?? "scroll", r = e.enabled ?? !0, i = v(), a = l(i), o = g(null);
338
+ let { scrollElementRef: t } = e, n = e.stateKey ?? "scroll", r = e.enabled ?? !0, i = v(), a = u(i), o = g(null);
339
339
  p(() => {
340
340
  if (!r || o.current === a) return;
341
341
  let e = 0, i = X, s = () => {
@@ -345,7 +345,7 @@ function ie(e) {
345
345
  return;
346
346
  }
347
347
  o.current = a;
348
- let c = u.getState().read(a, n);
348
+ let c = l.getState().read(a, n);
349
349
  c && (r.scrollTop = Number.isFinite(c.offset) ? Math.max(0, c.offset) : 0);
350
350
  };
351
351
  return s(), () => {
@@ -364,30 +364,30 @@ function ie(e) {
364
364
  }
365
365
  //#endregion
366
366
  //#region src/components/shared/RefreshControl.tsx
367
- function ae({ liveObject: t, realtime: o = !0 }) {
368
- let s = c(), { isPhone: l } = a(), { refreshing: u, refresh: f } = d(t.refetch), p = t.isLive ? s("control.refresh.live", "Live") : s("control.refresh.paused", "Updates paused"), m = t.isLive && l ? void 0 : p;
367
+ function ae({ liveObject: n, realtime: r = !0 }) {
368
+ let s = c(), { isPhone: l } = a(), { refreshing: u, refresh: f } = d(n.refetch), p = n.isLive ? s("control.refresh.live", "Live") : s("control.refresh.paused", "Updates paused"), m = n.isLive && l ? void 0 : p;
369
369
  return /* @__PURE__ */ x("span", {
370
370
  style: {
371
371
  display: "inline-flex",
372
372
  alignItems: "center",
373
373
  gap: 8
374
374
  },
375
- children: [/* @__PURE__ */ b(r, {
375
+ children: [/* @__PURE__ */ b(o, {
376
376
  icon: u ? /* @__PURE__ */ b("span", {
377
377
  "data-testid": "refresh-spinner",
378
378
  style: { display: "inline-flex" },
379
379
  children: /* @__PURE__ */ b(i, { size: 14 })
380
380
  }) : /* @__PURE__ */ b(e.refresh, { size: 14 }),
381
381
  title: s("control.refresh.title", "Refresh"),
382
- disabled: t.isLoading || u,
382
+ disabled: n.isLoading || u,
383
383
  onClick: f
384
- }), o && /* @__PURE__ */ b("span", {
384
+ }), r && /* @__PURE__ */ b("span", {
385
385
  "data-testid": "live-indicator",
386
386
  role: "status",
387
387
  "aria-label": p,
388
- title: t.isLive ? s("control.refresh.live_hint", "This view updates automatically in realtime.") : s("control.refresh.paused_hint", "Realtime updates are paused. Refresh manually to load the latest data."),
389
- children: /* @__PURE__ */ b(n, {
390
- tone: t.isLive ? "emerald" : "amber",
388
+ title: n.isLive ? s("control.refresh.live_hint", "This view updates automatically in realtime.") : s("control.refresh.paused_hint", "Realtime updates are paused. Refresh manually to load the latest data."),
389
+ children: /* @__PURE__ */ b(t, {
390
+ tone: n.isLive ? "emerald" : "amber",
391
391
  size: "xs",
392
392
  dot: !0,
393
393
  children: m