@declarion/react 0.52.0 → 0.53.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 (37) hide show
  1. package/dist-lib/{DraggableChildrenTable-CJCjc_cd.js → DraggableChildrenTable-BQZTvZaU.js} +35 -35
  2. package/dist-lib/{Grid-DUjbQg3r.js → Grid-B9Tiytbd.js} +28 -28
  3. package/dist-lib/{LayoutRenderer-DbdxC-Bq.js → LayoutRenderer-D_v9OD_A.js} +920 -922
  4. package/dist-lib/{ListCardsBody-C8ofksQb.js → ListCardsBody-dRnXsQ7A.js} +14 -14
  5. package/dist-lib/{MarkdownRenderer-B9_5fwuE.js → MarkdownRenderer-BCyrsLrd.js} +10 -10
  6. package/dist-lib/{record-documents-key-8fdm7C10.js → RecordIdBadge-CGxPR-8q.js} +1 -4
  7. package/dist-lib/{RefreshControl-C-8UCyau.js → RefreshControl-CV8nGACW.js} +120 -122
  8. package/dist-lib/{SmartDetailPage.impl-DWjNQ052.js → SmartDetailPage.impl-DWprVNMb.js} +376 -377
  9. package/dist-lib/{SmartListPage.impl-yKBK7a8b.js → SmartListPage.impl-BwWURGwa.js} +1098 -1099
  10. package/dist-lib/{SmartRecordListPage.impl-DRpU_DOC.js → SmartRecordListPage.impl-BKKBShAg.js} +183 -183
  11. package/dist-lib/{SortHeaderMenu-CbihbEGd.js → SortHeaderMenu-pgi4sxMs.js} +1 -1
  12. package/dist-lib/{action-dispatch-C28UhXXA.js → action-dispatch-DlHTYag7.js} +382 -382
  13. package/dist-lib/api/events.d.ts +27 -5
  14. package/dist-lib/{cardProjection-Bp_ZPLUE.js → cardProjection-C7Orz841.js} +146 -204
  15. package/dist-lib/components/pages/DocumentsMenu.d.ts +1 -1
  16. package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +2 -2
  17. package/dist-lib/components/pages/list/useListQuery.d.ts +6 -1
  18. package/dist-lib/components/shared/RefreshControl.d.ts +7 -1
  19. package/dist-lib/components/shared/useOwnRefresh.d.ts +9 -0
  20. package/dist-lib/{field-classification-CeYJlsNq.js → field-classification-EY8CFF3P.js} +301 -320
  21. package/dist-lib/{format-count-C3N-WxEy.js → format-count-BHkaDr9V.js} +245 -245
  22. package/dist-lib/hooks/useMutations.d.ts +1 -1
  23. package/dist-lib/hooks/useSSE.d.ts +24 -4
  24. package/dist-lib/index.js +1541 -1832
  25. package/dist-lib/lib/document-templates.d.ts +1 -1
  26. package/dist-lib/lib/realtime-reconcile.d.ts +43 -0
  27. package/dist-lib/{peekDraftStore-D3sowXga.js → peekDraftStore-1pIajluX.js} +36 -36
  28. package/dist-lib/{registry-p6CejATt.js → registry-C5ug25M8.js} +507 -507
  29. package/dist-lib/stores/realtime.d.ts +20 -0
  30. package/dist-lib/testing.js +35 -35
  31. package/dist-lib/{useCurrentScreen-74x5yJNb.js → useCurrentScreen-BdnZq8vZ.js} +2504 -1557
  32. package/dist-lib/{useListQuery-D75bgLLz.js → useListQuery-BxgrPZIB.js} +13 -10
  33. package/dist-lib/{useProperties-C5fZp12D.js → useProperties-Bhi9Wn5O.js} +25 -25
  34. package/dist-lib/useTabSearchMirror-Dl5x0xKu.js +177 -0
  35. package/dist-lib/{value-DKekzcjz.js → value-Rp-5W3o8.js} +25 -25
  36. package/package.json +7 -7
  37. package/dist-lib/useTabSearchMirror-D_wzoYRz.js +0 -406
@@ -6,7 +6,7 @@ import type { Schema } from "../types/schema";
6
6
  * `document_template` appears only when the caller can read it). Gates the
7
7
  * lazy `document.templates.available` tenant-template visibility probe
8
8
  * (Business Case 6, plan 2026-07-08-document-generation-hardening) so a
9
- * caller who cannot manage templates never fires it - the Haia default.
9
+ * caller who cannot manage templates never fires it, which is the default.
10
10
  * One shared predicate so SmartDetailPage and SmartListPage agree.
11
11
  */
12
12
  export declare function canManageDocumentTemplates(schema: Schema | undefined): boolean;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * What a change frame does to the list caches of one entity. The outcome table
3
+ * it applies, and why the client decides nothing itself, is docs/realtime.md
4
+ * "Frontend Invalidation".
5
+ */
6
+ import type { QueryClient } from "@tanstack/react-query";
7
+ import type { ListParams } from "../types/api";
8
+ /**
9
+ * Every list-shaped cache the SDK ships, stated once and read by the reconciler
10
+ * and its tests alike. The REFETCH-ONLY kind is the cursor list, whose cold
11
+ * tables a key does not prune. docs/realtime.md.
12
+ */
13
+ export declare const NARROWED_LIST_CACHE_KEYS: readonly ["entity-data", "entity-data-all"];
14
+ export declare const REFETCH_ONLY_LIST_CACHE_KEYS: readonly ["entity-data-cursor"];
15
+ export declare const LIST_CACHE_KEYS: readonly string[];
16
+ /** One row a frame named, plus whether every frame naming it said `created`. */
17
+ export interface ChangedRow {
18
+ pk: Record<string, string>;
19
+ /**
20
+ * True when nothing but a creation named this row in this window - the one
21
+ * absence the client may read as certain. docs/realtime.md.
22
+ */
23
+ createdOnly: boolean;
24
+ }
25
+ /**
26
+ * Reconciles every cached list of one entity, resolving once each query it
27
+ * touched claims no freshness it lacks - never waiting for a refetch to
28
+ * COMPLETE. Returns whether the entity's count must be re-read.
29
+ */
30
+ export declare function reconcileListCaches(queryClient: QueryClient, entity: string, rows: ChangedRow[], signal?: AbortSignal): Promise<boolean>;
31
+ /**
32
+ * The screen's own query with the changed keys added as a membership test and
33
+ * only the WINDOWING inputs removed. Every other input stays, including the
34
+ * ones that decide what the screen may show at all: dropping the fixed filters
35
+ * or the search returns rows the screen excludes, and dropping the projection
36
+ * gives the replaced row a different field set from its neighbours and strips
37
+ * the very sort fields the comparison reads.
38
+ *
39
+ * The read states the size it needs - the key count - so it is by construction
40
+ * inside the deployment's own page ceiling and cannot be clamped.
41
+ */
42
+ export declare function narrowedParams(params: ListParams, rows: ChangedRow[]): ListParams;
43
+ export declare function isListCacheKey(key: readonly unknown[]): boolean;
@@ -1,5 +1,5 @@
1
1
  import { s as e } from "./DynamicIcon-DW5krHuX.js";
2
- import { Bn as t, Dn as n, bt as r, cr as i, er as a, fr as o, i as s, rr as c } from "./useCurrentScreen-74x5yJNb.js";
2
+ import { Dr as t, Ir as n, Mr as r, Yt as i, Zn as a, i as o, ur as s, wr as c } from "./useCurrentScreen-BdnZq8vZ.js";
3
3
  import { useMemo as l, useRef as u, useState as d } from "react";
4
4
  import { useQuery as f } from "@tanstack/react-query";
5
5
  import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
@@ -21,10 +21,10 @@ function v(e, t) {
21
21
  //#endregion
22
22
  //#region src/components/pages/DocumentsMenu.tsx
23
23
  var y = "document-templates-available";
24
- function b({ entityCode: t, scope: g, objectIds: v = [], viewState: b, selectedIds: w = [], capability: T, canManageTemplates: E = !1 }) {
25
- let { run: D } = s(), O = u(null), [k, A] = d(!1), j = g === "detail" ? !!T?.generate_one : !!T?.generate_many, M = E && !j, { data: N, isLoading: P, error: F } = f({
26
- queryKey: [y, t],
27
- queryFn: async () => (await r("document.templates.available", { entity: t })).result?.templates ?? [],
24
+ function b({ entityCode: s, scope: g, objectIds: v = [], viewState: b, selectedIds: w = [], capability: T, canManageTemplates: E = !1 }) {
25
+ let { run: D } = o(), O = u(null), [k, A] = d(!1), j = g === "detail" ? !!T?.generate_one : !!T?.generate_many, M = E && !j, { data: N, isLoading: P, error: F } = f({
26
+ queryKey: [y, s],
27
+ queryFn: async () => (await i("document.templates.available", { entity: s })).result?.templates ?? [],
28
28
  enabled: k || M,
29
29
  staleTime: 6e4
30
30
  }), I = P, L = l(() => (N ?? []).filter((e) => g === "detail" ? e.input_mode === "one" || e.input_mode === "global" : e.input_mode === "many" || e.input_mode === "global"), [g, N]), R = M && L.length > 0, z = j || R;
@@ -49,26 +49,26 @@ function b({ entityCode: t, scope: g, objectIds: v = [], viewState: b, selectedI
49
49
  }
50
50
  return [];
51
51
  }
52
- function H(e, t, i) {
53
- let a = x(e), o = n(e.name) || e.code;
52
+ function H(e, t, n) {
53
+ let r = x(e), o = a(e.name) || e.code;
54
54
  A(!1), D({
55
- action: a,
55
+ action: r,
56
56
  title: o,
57
- execute: (n) => {
57
+ execute: (r) => {
58
58
  let a = {
59
59
  template_code: e.code,
60
60
  template_source: e.source,
61
- output_format: i
61
+ output_format: n
62
62
  };
63
- return Object.keys(n).length > 0 && (a.params = n), "objectIds" in t && (a.object_ids = t.objectIds), "query" in t && (a.query = {
63
+ return Object.keys(r).length > 0 && (a.params = r), "objectIds" in t && (a.object_ids = t.objectIds), "query" in t && (a.query = {
64
64
  scope: "current_view",
65
65
  query: t.query
66
- }), r("document.generate", a);
66
+ }), i("document.generate", a);
67
67
  }
68
68
  });
69
69
  }
70
- let { isPhone: U } = c();
71
- return z ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(o, {
70
+ let { isPhone: U } = t();
71
+ return z ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(n, {
72
72
  ref: O,
73
73
  kind: "ghost",
74
74
  size: "sm",
@@ -78,51 +78,51 @@ function b({ entityCode: t, scope: g, objectIds: v = [], viewState: b, selectedI
78
78
  "aria-label": "Generate",
79
79
  title: "Generate",
80
80
  children: U ? null : "Generate"
81
- }), /* @__PURE__ */ h(i, {
81
+ }), /* @__PURE__ */ h(r, {
82
82
  open: k,
83
83
  anchor: O.current,
84
84
  onClose: () => A(!1),
85
85
  align: "end",
86
86
  width: 300,
87
87
  children: [
88
- I && /* @__PURE__ */ m(a, {
88
+ I && /* @__PURE__ */ m(c, {
89
89
  disabled: !0,
90
90
  icon: /* @__PURE__ */ m(e.loader, { size: 12 }),
91
91
  children: "Loading templates..."
92
92
  }),
93
- F && /* @__PURE__ */ m(a, {
93
+ F && /* @__PURE__ */ m(c, {
94
94
  disabled: !0,
95
95
  icon: /* @__PURE__ */ m(e.warning, { size: 12 }),
96
96
  children: F instanceof Error ? F.message : String(F)
97
97
  }),
98
- !I && !F && L.length === 0 && /* @__PURE__ */ m(a, {
98
+ !I && !F && L.length === 0 && /* @__PURE__ */ m(c, {
99
99
  disabled: !0,
100
100
  icon: /* @__PURE__ */ m(e.file, { size: 12 }),
101
101
  children: "No document templates"
102
102
  }),
103
103
  !I && !F && L.map((t) => {
104
- let r = V(t);
105
- return r.length === 0 ? null : S(t).flatMap((i) => r.map((r) => i.available ? /* @__PURE__ */ m(a, {
104
+ let n = V(t);
105
+ return n.length === 0 ? null : S(t).flatMap((r) => n.map((n) => r.available ? /* @__PURE__ */ m(c, {
106
106
  icon: /* @__PURE__ */ m(e.file, { size: 12 }),
107
- onClick: () => H(t, r, i.format),
108
- title: n(t.description),
109
- children: C(t, r, i.format)
110
- }, `${t.source}:${t.code}:${r.kind}:${i.format}`) : /* @__PURE__ */ h(a, {
107
+ onClick: () => H(t, n, r.format),
108
+ title: a(t.description),
109
+ children: C(t, n, r.format)
110
+ }, `${t.source}:${t.code}:${n.kind}:${r.format}`) : /* @__PURE__ */ h(c, {
111
111
  disabled: !0,
112
112
  icon: /* @__PURE__ */ m(e.file, { size: 12 }),
113
- title: i.disabled_reason,
113
+ title: r.disabled_reason,
114
114
  children: [
115
- C(t, r, i.format),
115
+ C(t, n, r.format),
116
116
  " - ",
117
- i.disabled_reason || "Unavailable"
117
+ r.disabled_reason || "Unavailable"
118
118
  ]
119
- }, `${t.source}:${t.code}:${r.kind}:${i.format}:disabled`)));
119
+ }, `${t.source}:${t.code}:${n.kind}:${r.format}:disabled`)));
120
120
  })
121
121
  ]
122
122
  })] }) : null;
123
123
  }
124
124
  function x(e) {
125
- let n = new t((e.params ?? []).map((e) => ({
125
+ let t = new s((e.params ?? []).map((e) => ({
126
126
  ...e,
127
127
  name: e.name ?? ""
128
128
  })));
@@ -133,7 +133,7 @@ function x(e) {
133
133
  icon: "file",
134
134
  description: e.description
135
135
  },
136
- resolved_params: n
136
+ resolved_params: t
137
137
  };
138
138
  }
139
139
  function S(e) {
@@ -142,13 +142,13 @@ function S(e) {
142
142
  available: !0
143
143
  }));
144
144
  }
145
- function C(e, t, r) {
146
- let i = n(e.name) || e.code, a = r ? ` (${r.toUpperCase()})` : "";
145
+ function C(e, t, n) {
146
+ let r = a(e.name) || e.code, i = n ? ` (${n.toUpperCase()})` : "";
147
147
  switch (t.kind) {
148
- case "one": return `${i}${a}`;
149
- case "selected": return `${i}${a} - selected rows`;
150
- case "current_view": return `${i}${a} - current view`;
151
- case "global": return `${i}${a}`;
148
+ case "one": return `${r}${i}`;
149
+ case "selected": return `${r}${i} - selected rows`;
150
+ case "current_view": return `${r}${i} - current view`;
151
+ case "global": return `${r}${i}`;
152
152
  }
153
153
  }
154
154
  //#endregion