@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.
- package/dist-lib/{DraggableChildrenTable-CJCjc_cd.js → DraggableChildrenTable-BQZTvZaU.js} +35 -35
- package/dist-lib/{Grid-DUjbQg3r.js → Grid-B9Tiytbd.js} +28 -28
- package/dist-lib/{LayoutRenderer-DbdxC-Bq.js → LayoutRenderer-D_v9OD_A.js} +920 -922
- package/dist-lib/{ListCardsBody-C8ofksQb.js → ListCardsBody-dRnXsQ7A.js} +14 -14
- package/dist-lib/{MarkdownRenderer-B9_5fwuE.js → MarkdownRenderer-BCyrsLrd.js} +10 -10
- package/dist-lib/{record-documents-key-8fdm7C10.js → RecordIdBadge-CGxPR-8q.js} +1 -4
- package/dist-lib/{RefreshControl-C-8UCyau.js → RefreshControl-CV8nGACW.js} +120 -122
- package/dist-lib/{SmartDetailPage.impl-DWjNQ052.js → SmartDetailPage.impl-DWprVNMb.js} +376 -377
- package/dist-lib/{SmartListPage.impl-yKBK7a8b.js → SmartListPage.impl-BwWURGwa.js} +1098 -1099
- package/dist-lib/{SmartRecordListPage.impl-DRpU_DOC.js → SmartRecordListPage.impl-BKKBShAg.js} +183 -183
- package/dist-lib/{SortHeaderMenu-CbihbEGd.js → SortHeaderMenu-pgi4sxMs.js} +1 -1
- package/dist-lib/{action-dispatch-C28UhXXA.js → action-dispatch-DlHTYag7.js} +382 -382
- package/dist-lib/api/events.d.ts +27 -5
- package/dist-lib/{cardProjection-Bp_ZPLUE.js → cardProjection-C7Orz841.js} +146 -204
- package/dist-lib/components/pages/DocumentsMenu.d.ts +1 -1
- package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +2 -2
- package/dist-lib/components/pages/list/useListQuery.d.ts +6 -1
- package/dist-lib/components/shared/RefreshControl.d.ts +7 -1
- package/dist-lib/components/shared/useOwnRefresh.d.ts +9 -0
- package/dist-lib/{field-classification-CeYJlsNq.js → field-classification-EY8CFF3P.js} +301 -320
- package/dist-lib/{format-count-C3N-WxEy.js → format-count-BHkaDr9V.js} +245 -245
- package/dist-lib/hooks/useMutations.d.ts +1 -1
- package/dist-lib/hooks/useSSE.d.ts +24 -4
- package/dist-lib/index.js +1541 -1832
- package/dist-lib/lib/document-templates.d.ts +1 -1
- package/dist-lib/lib/realtime-reconcile.d.ts +43 -0
- package/dist-lib/{peekDraftStore-D3sowXga.js → peekDraftStore-1pIajluX.js} +36 -36
- package/dist-lib/{registry-p6CejATt.js → registry-C5ug25M8.js} +507 -507
- package/dist-lib/stores/realtime.d.ts +20 -0
- package/dist-lib/testing.js +35 -35
- package/dist-lib/{useCurrentScreen-74x5yJNb.js → useCurrentScreen-BdnZq8vZ.js} +2504 -1557
- package/dist-lib/{useListQuery-D75bgLLz.js → useListQuery-BxgrPZIB.js} +13 -10
- package/dist-lib/{useProperties-C5fZp12D.js → useProperties-Bhi9Wn5O.js} +25 -25
- package/dist-lib/useTabSearchMirror-Dl5x0xKu.js +177 -0
- package/dist-lib/{value-DKekzcjz.js → value-Rp-5W3o8.js} +25 -25
- package/package.json +7 -7
- 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
|
|
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 {
|
|
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:
|
|
25
|
-
let { run: D } =
|
|
26
|
-
queryKey: [y,
|
|
27
|
-
queryFn: async () => (await
|
|
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,
|
|
53
|
-
let
|
|
52
|
+
function H(e, t, n) {
|
|
53
|
+
let r = x(e), o = a(e.name) || e.code;
|
|
54
54
|
A(!1), D({
|
|
55
|
-
action:
|
|
55
|
+
action: r,
|
|
56
56
|
title: o,
|
|
57
|
-
execute: (
|
|
57
|
+
execute: (r) => {
|
|
58
58
|
let a = {
|
|
59
59
|
template_code: e.code,
|
|
60
60
|
template_source: e.source,
|
|
61
|
-
output_format:
|
|
61
|
+
output_format: n
|
|
62
62
|
};
|
|
63
|
-
return Object.keys(
|
|
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
|
-
}),
|
|
66
|
+
}), i("document.generate", a);
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
-
let { isPhone: U } =
|
|
71
|
-
return z ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
|
105
|
-
return
|
|
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,
|
|
108
|
-
title:
|
|
109
|
-
children: C(t,
|
|
110
|
-
}, `${t.source}:${t.code}:${
|
|
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:
|
|
113
|
+
title: r.disabled_reason,
|
|
114
114
|
children: [
|
|
115
|
-
C(t,
|
|
115
|
+
C(t, n, r.format),
|
|
116
116
|
" - ",
|
|
117
|
-
|
|
117
|
+
r.disabled_reason || "Unavailable"
|
|
118
118
|
]
|
|
119
|
-
}, `${t.source}:${t.code}:${
|
|
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
|
|
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:
|
|
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,
|
|
146
|
-
let
|
|
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 `${
|
|
149
|
-
case "selected": return `${
|
|
150
|
-
case "current_view": return `${
|
|
151
|
-
case "global": return `${
|
|
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
|