@declarion/react 0.54.0 → 0.54.1

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/{DraggableChildrenTable-CPoUY99R.js → DraggableChildrenTable-Djc7QDzR.js} +32 -32
  2. package/dist-lib/{Grid--QAEby8k.js → Grid-Bd2r0_4J.js} +45 -45
  3. package/dist-lib/{LayoutRenderer-BxZ7Nd9b.js → LayoutRenderer-V6nf9aa_.js} +716 -714
  4. package/dist-lib/{ListCardsBody-BPV4GPrv.js → ListCardsBody-Cdsvu0Vs.js} +29 -29
  5. package/dist-lib/{MarkdownRenderer-CIKuh_0i.js → MarkdownRenderer-CZo5ZgM7.js} +1 -1
  6. package/dist-lib/{RefreshControl-DMLkZP3R.js → RefreshControl-CJm3vz9p.js} +40 -40
  7. package/dist-lib/{SmartDetailPage.impl-SnNu6Ug-.js → SmartDetailPage.impl-DoIjCzjQ.js} +492 -492
  8. package/dist-lib/{SmartListPage.impl-C73pR7Iw.js → SmartListPage.impl-DnM8e14t.js} +743 -742
  9. package/dist-lib/{SmartRecordListPage.impl-rJjQZe1V.js → SmartRecordListPage.impl-BmHGYbD9.js} +128 -128
  10. package/dist-lib/{SortHeaderMenu-DQ_KrkWk.js → SortHeaderMenu-CA53NerB.js} +1 -1
  11. package/dist-lib/{action-dispatch-DsuUS7ae.js → action-dispatch-JcUrLFaW.js} +177 -177
  12. package/dist-lib/api/events.d.ts +13 -4
  13. package/dist-lib/{cardProjection-BadzqyeQ.js → cardProjection-Q2kwqv8V.js} +19 -19
  14. package/dist-lib/components/pages/list/ListToolbar.d.ts +5 -3
  15. package/dist-lib/components/pages/list/useListQuery.d.ts +1 -5
  16. package/dist-lib/{field-classification-sMkkAEg9.js → field-classification-ssZvtr8J.js} +268 -397
  17. package/dist-lib/{format-count-B5SLlNOb.js → format-count-DHuivNT7.js} +236 -236
  18. package/dist-lib/hooks/useEntityData.d.ts +7 -0
  19. package/dist-lib/hooks/useRealtimeThresholds.d.ts +1 -0
  20. package/dist-lib/hooks/useSSE.d.ts +0 -1
  21. package/dist-lib/index.js +806 -806
  22. package/dist-lib/lib/realtime-query-keys.d.ts +22 -0
  23. package/dist-lib/lib/realtime-reconcile.d.ts +0 -9
  24. package/dist-lib/lib/realtime-resync.d.ts +23 -0
  25. package/dist-lib/{peekDraftStore-CbHFwz_F.js → peekDraftStore-lm9ViVLA.js} +17 -17
  26. package/dist-lib/{registry-D0RhCnEL.js → registry-DsQFhEAD.js} +511 -511
  27. package/dist-lib/stores/realtime.d.ts +86 -19
  28. package/dist-lib/testing.js +40 -40
  29. package/dist-lib/{useCurrentScreen-DVTXCj_K.js → useCurrentScreen-aHx9HH1m.js} +2472 -1963
  30. package/dist-lib/useListQuery-DZn2BAxY.js +96 -0
  31. package/dist-lib/{useProperties-BcIz-MyO.js → useProperties-CAqKmUKg.js} +25 -25
  32. package/dist-lib/{useTabSearchMirror-UYCsopxP.js → useTabSearchMirror-DYW9WoK7.js} +10 -10
  33. package/dist-lib/{value-CQzGOI0F.js → value-CzKQPJOp.js} +4 -4
  34. package/package.json +4 -4
  35. package/dist-lib/useListQuery-C2nq58YV.js +0 -90
@@ -1,8 +1,8 @@
1
- import { Pr as e, Yn as t, Zn as n, lr as r } from "./useCurrentScreen-DVTXCj_K.js";
1
+ import { er as e, mr as t, nr as n, zr as r } from "./useCurrentScreen-aHx9HH1m.js";
2
2
  import { t as i } from "./Check-DAfMbQIw.js";
3
- import { f as a, m as o, p as s, r as c } from "./action-dispatch-DsuUS7ae.js";
4
- import { t as l } from "./cardProjection-BadzqyeQ.js";
5
- import { t as u } from "./SmartListPage.impl-C73pR7Iw.js";
3
+ import { f as a, m as o, p as s, r as c } from "./action-dispatch-JcUrLFaW.js";
4
+ import { t as l } from "./cardProjection-Q2kwqv8V.js";
5
+ import { t as u } from "./SmartListPage.impl-DnM8e14t.js";
6
6
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
7
7
  //#region src/components/pages/list/ListCardRow.tsx
8
8
  function p(e, t, r) {
@@ -16,72 +16,72 @@ function p(e, t, r) {
16
16
  }
17
17
  return o(t, e, r);
18
18
  }
19
- function m(e, t, n) {
19
+ function m(e, n, r) {
20
20
  if (e.startsWith("$status.")) {
21
- let n = e.slice(8), r = t.$statuses;
22
- return Array.isArray(r) && r.some((e) => e.group_code === n);
21
+ let t = e.slice(8), r = n.$statuses;
22
+ return Array.isArray(r) && r.some((e) => e.group_code === t);
23
23
  }
24
24
  if (e.startsWith("$property.")) {
25
- let n = e.slice(10), i = t.$properties, a = Array.isArray(i) ? i.find((e) => e.property_code === n) : void 0;
26
- return a?.value != null && r(a.value) !== "";
25
+ let r = e.slice(10), i = n.$properties, a = Array.isArray(i) ? i.find((e) => e.property_code === r) : void 0;
26
+ return a?.value != null && t(a.value) !== "";
27
27
  }
28
- let i = a(n, t, e);
29
- return i != null && r(i) !== "";
28
+ let i = a(r, n, e);
29
+ return i != null && t(i) !== "";
30
30
  }
31
- function h(t, i, a) {
31
+ function h(e, i, a) {
32
32
  let { entity: o, entityCode: c, refs: l, locale: u, renderers: f } = a;
33
- if (t.startsWith("$status.")) {
34
- let r = t.slice(8), a = o.status_groups?.[r], s = i.$statuses, c = Array.isArray(s) ? s.find((e) => e.group_code === r) : void 0;
33
+ if (e.startsWith("$status.")) {
34
+ let t = e.slice(8), a = o.status_groups?.[t], s = i.$statuses, c = Array.isArray(s) ? s.find((e) => e.group_code === t) : void 0;
35
35
  if (!a || !c) return /* @__PURE__ */ d("span", {
36
36
  style: { color: "var(--text-3)" },
37
37
  children: "-"
38
38
  });
39
39
  let l = a.statuses.find((e) => e.code === c.status_code);
40
- return /* @__PURE__ */ d(e, {
40
+ return /* @__PURE__ */ d(r, {
41
41
  tone: l?.color ?? "slate",
42
42
  size: "xs",
43
43
  children: n(l?.name) || c.status_code
44
44
  });
45
45
  }
46
- if (t.startsWith("$property.")) {
47
- let e = t.slice(10), n = i.$properties, a = Array.isArray(n) ? n.find((t) => t.property_code === e) : void 0;
46
+ if (e.startsWith("$property.")) {
47
+ let n = e.slice(10), r = i.$properties, a = Array.isArray(r) ? r.find((e) => e.property_code === n) : void 0;
48
48
  return !a || a.value == null ? /* @__PURE__ */ d("span", {
49
49
  style: { color: "var(--text-3)" },
50
50
  children: "-"
51
- }) : /* @__PURE__ */ d("span", { children: r(a.value) });
51
+ }) : /* @__PURE__ */ d("span", { children: t(a.value) });
52
52
  }
53
- if (o.files?.get(t)) return s({
53
+ if (o.files?.get(e)) return s({
54
54
  entity: o,
55
55
  entityCode: c,
56
- fieldName: t,
56
+ fieldName: e,
57
57
  record: i,
58
58
  mode: "display",
59
59
  surface: "list",
60
60
  refs: l,
61
61
  locale: u
62
62
  });
63
- let p = f.get(t);
63
+ let p = f.get(e);
64
64
  if (!p) {
65
- let e = i[t];
66
- return r(e) || /* @__PURE__ */ d("span", {
65
+ let n = i[e];
66
+ return t(n) || /* @__PURE__ */ d("span", {
67
67
  style: { color: "var(--text-3)" },
68
68
  children: "-"
69
69
  });
70
70
  }
71
- return p(i[t], i);
71
+ return p(i[e], i);
72
72
  }
73
- function g({ row: e, rowIndex: n, entity: r, screen: a, entityCode: o, entities: s, savedViewColumns: g, refs: _, locale: v, renderers: y, rowActions: b, tabNavigate: x, interaction: S, hasSoftDelete: C, zebra: w, hasBatchActions: T, hasDetailTarget: E, rowKey: D, measureElement: O }) {
73
+ function g({ row: t, rowIndex: n, entity: r, screen: a, entityCode: o, entities: s, savedViewColumns: g, refs: _, locale: v, renderers: y, rowActions: b, tabNavigate: x, interaction: S, hasSoftDelete: C, zebra: w, hasBatchActions: T, hasDetailTarget: E, rowKey: D, measureElement: O }) {
74
74
  let k = {
75
75
  entity: r,
76
76
  entityCode: o,
77
77
  refs: _,
78
78
  locale: v,
79
79
  renderers: y
80
- }, A = e.original, j = c(r, a, A), M = l({
80
+ }, A = t.original, j = c(r, a, A), M = l({
81
81
  entity: r,
82
82
  screen: j,
83
83
  savedViewColumns: g
84
- }), N = C && A[r.soft_delete] != null, P = e.getIsSelected(), F = w && n % 2 == 1, I = E || S.peekAllowed, L = (M.titleUsesDisplay ? t(A, r) ?? (M.titleField ? null : D(A)) : null) || (M.titleField ? h(M.titleField, A, k) : D(A)), R = M.badgeFields.filter((e) => !M.hideEmptyFields || m(e, A, r)), z = M.bodyFields.filter((e) => !M.hideEmptyFields || m(e, A, r)), B = M.metaFields.filter((e) => !M.hideEmptyFields || m(e, A, r));
84
+ }), N = C && A[r.soft_delete] != null, P = t.getIsSelected(), F = w && n % 2 == 1, I = E || S.peekAllowed, L = (M.titleUsesDisplay ? e(A, r) ?? (M.titleField ? null : D(A)) : null) || (M.titleField ? h(M.titleField, A, k) : D(A)), R = M.badgeFields.filter((e) => !M.hideEmptyFields || m(e, A, r)), z = M.bodyFields.filter((e) => !M.hideEmptyFields || m(e, A, r)), B = M.metaFields.filter((e) => !M.hideEmptyFields || m(e, A, r));
85
85
  return /* @__PURE__ */ d("div", {
86
86
  "data-index": n,
87
87
  "data-testid": "list-card",
@@ -135,7 +135,7 @@ function g({ row: e, rowIndex: n, entity: r, screen: a, entityCode: o, entities:
135
135
  style: { paddingTop: 2 },
136
136
  children: /* @__PURE__ */ d(i, {
137
137
  checked: P,
138
- onChange: () => e.toggleSelected()
138
+ onChange: () => t.toggleSelected()
139
139
  })
140
140
  }),
141
141
  /* @__PURE__ */ f("div", {
@@ -253,7 +253,7 @@ function g({ row: e, rowIndex: n, entity: r, screen: a, entityCode: o, entities:
253
253
  })
254
254
  ]
255
255
  })
256
- }, e.id);
256
+ }, t.id);
257
257
  }
258
258
  //#endregion
259
259
  //#region src/components/pages/list/ListCardsBody.tsx
@@ -1,4 +1,4 @@
1
- import { Et as e, mt as t } from "./useCurrentScreen-DVTXCj_K.js";
1
+ import { Tt as e, ft as t } from "./useCurrentScreen-aHx9HH1m.js";
2
2
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
3
3
  import i, { defaultUrlTransform as a } from "react-markdown";
4
4
  import o from "remark-breaks";
@@ -1,6 +1,6 @@
1
1
  import { s as e } from "./DynamicIcon-DW5krHuX.js";
2
- import { Cr as t, Dr as n, Fr as r, Ht as i, Or as a, Pr as o } from "./useCurrentScreen-DVTXCj_K.js";
3
- import { D as s, L as c, b as l, c as u } from "./field-classification-sMkkAEg9.js";
2
+ import { Br as t, Gt as n, Mr as r, Nr as i, Or as a, Vt as o, zr as s } from "./useCurrentScreen-aHx9HH1m.js";
3
+ import { D as c, b as l, c as u } from "./field-classification-ssZvtr8J.js";
4
4
  import { useCallback as d, useEffect as f, useId as p, useMemo as m, useRef as h, useState as g } from "react";
5
5
  import { useLocation as _ } from "react-router";
6
6
  import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
@@ -171,7 +171,7 @@ function I(e) {
171
171
  //#endregion
172
172
  //#region src/hooks/useBranding.ts
173
173
  function L() {
174
- let e = c(A);
174
+ let e = n(A);
175
175
  return {
176
176
  branding: N(e.value),
177
177
  isLoading: e.loading
@@ -186,34 +186,34 @@ function z() {
186
186
  //#endregion
187
187
  //#region src/hooks/useBrandingChrome.ts
188
188
  function B() {
189
- let e = i(), t = z();
189
+ let e = o(), t = z();
190
190
  return (e.enabled ? t?.embed?.viewport : t?.full?.viewport) ?? "auto";
191
191
  }
192
192
  function V(e, t) {
193
193
  return typeof e == "number" && Number.isFinite(e) && e > 0 ? e : t;
194
194
  }
195
195
  function H() {
196
- let e = i(), t = z(), n = e.enabled ? t?.embed?.breakpoints : t?.full?.breakpoints, r = n?.phone_max, a = n?.tablet_max, o = n?.landscape_phone_max_height;
196
+ let e = o(), t = z(), n = e.enabled ? t?.embed?.breakpoints : t?.full?.breakpoints, r = n?.phone_max, i = n?.tablet_max, a = n?.landscape_phone_max_height;
197
197
  return m(() => U({
198
198
  phone_max: r,
199
- tablet_max: a,
200
- landscape_phone_max_height: o
199
+ tablet_max: i,
200
+ landscape_phone_max_height: a
201
201
  }), [
202
202
  r,
203
- a,
204
- o
203
+ i,
204
+ a
205
205
  ]);
206
206
  }
207
207
  function U(e) {
208
- let t = V(e?.phone_max, a.phoneMax), n = V(e?.tablet_max, a.tabletMax), r = t < n;
208
+ let t = V(e?.phone_max, i.phoneMax), n = V(e?.tablet_max, i.tabletMax), r = t < n;
209
209
  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.`), {
210
- phoneMax: r ? t : a.phoneMax,
211
- tabletMax: r ? n : a.tabletMax,
212
- landscapePhoneMaxHeight: V(e?.landscape_phone_max_height, a.landscapePhoneMaxHeight)
210
+ phoneMax: r ? t : i.phoneMax,
211
+ tabletMax: r ? n : i.tabletMax,
212
+ landscapePhoneMaxHeight: V(e?.landscape_phone_max_height, i.landscapePhoneMaxHeight)
213
213
  };
214
214
  }
215
215
  function W(e) {
216
- let t = i(), n = z();
216
+ let t = o(), n = z();
217
217
  return m(() => {
218
218
  let r = { ...t.enabled ? n?.embed?.surfaces?.[e] : n?.full?.surfaces?.[e] };
219
219
  return {
@@ -272,7 +272,7 @@ function Q(e, t, n, r) {
272
272
  function te(e = K) {
273
273
  let t = _(), n = h(null);
274
274
  if (n.current === null) {
275
- let r = l(t), i = s.getState().read(r, e);
275
+ let r = l(t), i = c.getState().read(r, e);
276
276
  n.current = i && Number.isFinite(i.offset) ? Math.max(0, i.offset) : 0;
277
277
  }
278
278
  return n.current;
@@ -295,19 +295,19 @@ function ne(e) {
295
295
  };
296
296
  }
297
297
  function re(e) {
298
- let { virtualizer: t, scrollElementRef: n, rowKeys: r } = e, i = e.stateKey ?? "scroll", a = e.enabled ?? !0, o = _(), c = l(o), u = h(t);
298
+ let { virtualizer: t, scrollElementRef: n, rowKeys: r } = e, i = e.stateKey ?? "scroll", a = e.enabled ?? !0, o = _(), s = l(o), u = h(t);
299
299
  u.current = t;
300
300
  let d = h(r);
301
301
  d.current = r;
302
302
  let p = h(null);
303
303
  f(() => {
304
- p.current !== c && (p.current = null);
305
- }, [c]), f(() => {
304
+ p.current !== s && (p.current = null);
305
+ }, [s]), f(() => {
306
306
  if (!a) return;
307
307
  let e = u.current;
308
308
  if (!e || r.length === 0) return;
309
- let t = s.getState().read(c, i), n = p.current !== c;
310
- if (p.current = c, !t) {
309
+ let t = c.getState().read(s, i), n = p.current !== s;
310
+ if (p.current = s, !t) {
311
311
  n && e.scrollToOffset(0, {
312
312
  align: "start",
313
313
  behavior: "auto"
@@ -328,10 +328,10 @@ function re(e) {
328
328
  };
329
329
  }, [
330
330
  a,
331
- c,
331
+ s,
332
332
  r,
333
333
  i
334
- ]), $(n, a, c, i, (e) => {
334
+ ]), $(n, a, s, i, (e) => {
335
335
  let t = u.current;
336
336
  if (!t) return null;
337
337
  let n = e.scrollTop, r = n > 0 ? n : t.scrollOffset ?? 0;
@@ -342,19 +342,19 @@ function $(e, t, n, r, i) {
342
342
  let a = h(i);
343
343
  a.current = i, f(() => {
344
344
  if (!t) return;
345
- let i = 0, o = Y, c = null, l = null, u = (e) => {
345
+ let i = 0, o = Y, s = null, l = null, u = (e) => {
346
346
  let t = a.current(e);
347
- t && s.getState().set(n, r, t);
347
+ t && c.getState().set(n, r, t);
348
348
  }, d = () => l?.trigger(), f = () => {
349
349
  let t = e.current;
350
350
  if (!t) {
351
351
  o-- > 0 && (i = requestAnimationFrame(f));
352
352
  return;
353
353
  }
354
- c = t, l = ne(() => u(t)), t.addEventListener("scroll", d, { passive: !0 });
354
+ s = t, l = ne(() => u(t)), t.addEventListener("scroll", d, { passive: !0 });
355
355
  };
356
356
  return f(), () => {
357
- i && cancelAnimationFrame(i), c && c.removeEventListener("scroll", d), l?.flush();
357
+ i && cancelAnimationFrame(i), s && s.removeEventListener("scroll", d), l?.flush();
358
358
  };
359
359
  }, [
360
360
  t,
@@ -367,17 +367,17 @@ function ie(e) {
367
367
  let { scrollElementRef: t } = e, n = e.stateKey ?? "scroll", r = e.enabled ?? !0, i = _(), a = l(i), o = h(null);
368
368
  f(() => {
369
369
  if (!r || o.current === a) return;
370
- let e = 0, i = Y, c = () => {
370
+ let e = 0, i = Y, s = () => {
371
371
  let r = t.current;
372
372
  if (!r) {
373
- i-- > 0 && (e = requestAnimationFrame(c));
373
+ i-- > 0 && (e = requestAnimationFrame(s));
374
374
  return;
375
375
  }
376
376
  o.current = a;
377
- let l = s.getState().read(a, n);
377
+ let l = c.getState().read(a, n);
378
378
  l && (r.scrollTop = Number.isFinite(l.offset) ? Math.max(0, l.offset) : 0);
379
379
  };
380
- return c(), () => {
380
+ return s(), () => {
381
381
  e && cancelAnimationFrame(e);
382
382
  };
383
383
  }, [
@@ -393,30 +393,30 @@ function ie(e) {
393
393
  }
394
394
  //#endregion
395
395
  //#region src/components/shared/RefreshControl.tsx
396
- function ae({ liveObject: i, realtime: a = !0 }) {
397
- let { isPhone: s } = n(), { refreshing: c, refresh: l } = u(i.refetch), d = i.isLive ? s ? void 0 : "Live" : "Updates paused";
396
+ function ae({ liveObject: n, realtime: i = !0 }) {
397
+ let { isPhone: o } = r(), { refreshing: c, refresh: l } = u(n.refetch), d = n.isLive ? o ? void 0 : "Live" : "Updates paused";
398
398
  return /* @__PURE__ */ b("span", {
399
399
  style: {
400
400
  display: "inline-flex",
401
401
  alignItems: "center",
402
402
  gap: 8
403
403
  },
404
- children: [/* @__PURE__ */ y(r, {
404
+ children: [/* @__PURE__ */ y(t, {
405
405
  icon: c ? /* @__PURE__ */ y("span", {
406
406
  "data-testid": "refresh-spinner",
407
407
  style: { display: "inline-flex" },
408
- children: /* @__PURE__ */ y(t, { size: 14 })
408
+ children: /* @__PURE__ */ y(a, { size: 14 })
409
409
  }) : /* @__PURE__ */ y(e.refresh, { size: 14 }),
410
410
  title: "Refresh",
411
- disabled: i.isLoading || c,
411
+ disabled: n.isLoading || c,
412
412
  onClick: l
413
- }), a && /* @__PURE__ */ y("span", {
413
+ }), i && /* @__PURE__ */ y("span", {
414
414
  "data-testid": "live-indicator",
415
415
  role: "status",
416
- "aria-label": i.isLive ? "Live" : "Updates paused",
417
- title: i.isLive ? "This view updates automatically in realtime." : "Realtime updates are paused. Refresh manually to load the latest data.",
418
- children: /* @__PURE__ */ y(o, {
419
- tone: i.isLive ? "emerald" : "amber",
416
+ "aria-label": n.isLive ? "Live" : "Updates paused",
417
+ title: n.isLive ? "This view updates automatically in realtime." : "Realtime updates are paused. Refresh manually to load the latest data.",
418
+ children: /* @__PURE__ */ y(s, {
419
+ tone: n.isLive ? "emerald" : "amber",
420
420
  size: "xs",
421
421
  dot: !0,
422
422
  children: d