@declarion/react 0.446.0 → 0.516.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/components/agents/AgentChatPanel.impl.js +349 -332
- package/dist-lib/components/detail-layout/DetailAuditStrip.js +1 -1
- package/dist-lib/components/detail-layout/EvidenceBlock.js +36 -24
- package/dist-lib/components/detail-layout/FieldRow.js +56 -60
- package/dist-lib/components/detail-layout/FieldsBlock.js +48 -47
- package/dist-lib/components/detail-layout/PropertiesBlock.js +42 -41
- package/dist-lib/components/detail-layout/labelLayout.js +35 -0
- package/dist-lib/components/fields/JsonField.js +128 -125
- package/dist-lib/components/fields/StringField.js +10 -25
- package/dist-lib/components/fields/StructureField.js +125 -167
- package/dist-lib/components/fields/ValueRows.js +114 -0
- package/dist-lib/components/fields/cells/factories/id.js +10 -0
- package/dist-lib/components/fields/cells/factories/nextRun.js +18 -27
- package/dist-lib/components/fields/cells/factories/refLink.js +15 -41
- package/dist-lib/components/fields/cells/registry.js +25 -23
- package/dist-lib/components/file-widgets/DocumentCard.js +142 -142
- package/dist-lib/components/file-widgets/helpers.js +32 -19
- package/dist-lib/components/file-widgets/host.js +4 -1
- package/dist-lib/components/list/PeekFieldCell.js +57 -55
- package/dist-lib/components/list/QuickPeek.js +109 -121
- package/dist-lib/components/pages/SmartDetailPage.impl.js +403 -400
- package/dist-lib/components/pages/SmartListPage.impl.js +260 -260
- package/dist-lib/components/pages/list/ListCardRow.js +101 -100
- package/dist-lib/components/pages/list/cardProjection.js +117 -112
- package/dist-lib/components/pages/list/useListQuery.js +1 -1
- package/dist-lib/components/pages/list/useListRowInteraction.js +68 -65
- package/dist-lib/components/primitives/IdBadge.js +27 -0
- package/dist-lib/components/primitives/RowField.js +11 -43
- package/dist-lib/components/shared/CopyButton.js +13 -18
- package/dist-lib/components/shared/RefChip.js +33 -0
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/hooks/useAgentConversation.js +134 -110
- package/dist-lib/hooks/useCopy.js +18 -0
- package/dist-lib/index.d.ts +55 -20
- package/dist-lib/index.js +116 -111
- package/dist-lib/lib/realtime-reconcile.js +70 -59
- package/dist-lib/lib/reference.js +52 -34
- package/dist-lib/lib/short-id.js +12 -0
- package/dist-lib/testing.d.ts +1 -1
- package/dist-lib/types/schema.js +84 -80
- package/dist-lib/{useResponsiveMode-3hOLBkey.d.ts → useResponsiveMode-BObVfNyN.d.ts} +7 -2
- package/package.json +1 -1
- package/dist-lib/components/primitives/RecordIdBadge.js +0 -25
package/dist-lib/testing.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as Refs, M as ListMeta, Mt as TextFn, P as ListResponse, ct as LocalizedString, d as ActionExecuteResponse, k as DataResponse, mt as Schema, o as ResponsiveViewport, u as ActionExecuteRequest } from "./useResponsiveMode-
|
|
1
|
+
import { B as Refs, M as ListMeta, Mt as TextFn, P as ListResponse, ct as LocalizedString, d as ActionExecuteResponse, k as DataResponse, mt as Schema, o as ResponsiveViewport, u as ActionExecuteRequest } from "./useResponsiveMode-BObVfNyN.js";
|
|
2
2
|
import { ReactElement, ReactNode } from "react";
|
|
3
3
|
import { QueryClient } from "@tanstack/react-query";
|
|
4
4
|
import { RenderResult } from "@testing-library/react";
|
package/dist-lib/types/schema.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { OrderedMap as e } from "./ordmap.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { shortId as t } from "../lib/short-id.js";
|
|
3
|
+
import { coerceDisplayString as n } from "../lib/display-value.js";
|
|
4
|
+
import { formatOffsetTimestamp as r } from "../lib/timestamp.js";
|
|
4
5
|
// src/types/schema.ts
|
|
5
|
-
var
|
|
6
|
-
function
|
|
7
|
-
if (!
|
|
8
|
-
let o =
|
|
6
|
+
var i = "none", a = "$display";
|
|
7
|
+
function o(e, t, i) {
|
|
8
|
+
if (!t) return;
|
|
9
|
+
let o = t[a];
|
|
9
10
|
if (typeof o == "string" && o !== "") return o;
|
|
10
|
-
let s =
|
|
11
|
+
let s = i?.display?.display_field;
|
|
11
12
|
if (!s) return;
|
|
12
|
-
let c =
|
|
13
|
+
let c = t[s];
|
|
13
14
|
if (c == null) return;
|
|
14
|
-
let l =
|
|
15
|
-
if (l?.type === "timestamp" && typeof c == "string" && c !== "") return
|
|
15
|
+
let l = i?.fields?.get(s);
|
|
16
|
+
if (l?.type === "timestamp" && typeof c == "string" && c !== "") return r(c, {
|
|
16
17
|
zone: e.timeZone,
|
|
17
|
-
declared: !!(l.timezone ||
|
|
18
|
+
declared: !!(l.timezone || i?.default_timezone)
|
|
18
19
|
});
|
|
19
20
|
let u = l?.values;
|
|
20
21
|
if (u && (typeof c == "string" || typeof c == "number")) {
|
|
@@ -24,52 +25,52 @@ function a(e, r, a) {
|
|
|
24
25
|
if (n) return n;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
|
-
return typeof c == "object" && !Array.isArray(c) ? e(c) || void 0 :
|
|
28
|
+
return typeof c == "object" && !Array.isArray(c) ? e(c) || void 0 : n(c);
|
|
29
|
+
}
|
|
30
|
+
function s(e, t, r, i) {
|
|
31
|
+
if (!r || !Object.hasOwn(t, r)) return i;
|
|
32
|
+
let a = t[r];
|
|
33
|
+
return a == null ? i : typeof a == "object" && !Array.isArray(a) ? e(a) || i : n(a);
|
|
28
34
|
}
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
let a = n[r];
|
|
32
|
-
return a == null ? i : typeof a == "object" && !Array.isArray(a) ? e(a) || i : t(a);
|
|
35
|
+
function c(e, t, n) {
|
|
36
|
+
return s(e, t, n, "").trim() !== "";
|
|
33
37
|
}
|
|
34
|
-
function
|
|
38
|
+
function l(e) {
|
|
35
39
|
let t = e.replace(/\/+$/, "").split("/").map((e) => e.startsWith(":") ? "[^/]+" : e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
36
40
|
return RegExp("^" + t.join("/") + "$");
|
|
37
41
|
}
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (n) {
|
|
57
|
-
let e = i.slice(i.lastIndexOf("/") + 1);
|
|
58
|
-
o = e ? `${n} ${c(e)}` : n;
|
|
42
|
+
function u(e) {
|
|
43
|
+
try {
|
|
44
|
+
return decodeURIComponent(e);
|
|
45
|
+
} catch {
|
|
46
|
+
return e;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function d(e, n, r, i) {
|
|
50
|
+
if (!r) return;
|
|
51
|
+
let a = n.replace(/\/+$/, "") || "/", o;
|
|
52
|
+
for (let n of Object.values(r)) {
|
|
53
|
+
if (!n.route || !l(n.route).test(a)) continue;
|
|
54
|
+
let r = n.route.includes("/:"), s = e(n.display?.name);
|
|
55
|
+
if (!s && !r && i && n.entity && (s = e(i[n.entity]?.display?.name_plural)), !s && r && i && n.entity) {
|
|
56
|
+
let r = e(i[n.entity]?.display?.name);
|
|
57
|
+
if (r) {
|
|
58
|
+
let e = a.slice(a.lastIndexOf("/") + 1);
|
|
59
|
+
s = e ? `${r} ${t(u(e))}` : r;
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
|
-
if (!
|
|
62
|
-
let
|
|
63
|
-
title:
|
|
64
|
-
icon:
|
|
65
|
-
exact: !
|
|
62
|
+
if (!s) continue;
|
|
63
|
+
let c = {
|
|
64
|
+
title: s,
|
|
65
|
+
icon: n.display?.icon,
|
|
66
|
+
exact: !r
|
|
66
67
|
};
|
|
67
|
-
if (!
|
|
68
|
-
|
|
68
|
+
if (!r) return c;
|
|
69
|
+
o ??= c;
|
|
69
70
|
}
|
|
70
|
-
return
|
|
71
|
+
return o;
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
+
function f(e, t, n, r) {
|
|
73
74
|
let i = e(t.display?.name);
|
|
74
75
|
if (i) return i;
|
|
75
76
|
if (t.type === "ref" && t.ref?.entity && r) {
|
|
@@ -81,18 +82,18 @@ function u(e, t, n, r) {
|
|
|
81
82
|
}
|
|
82
83
|
return n;
|
|
83
84
|
}
|
|
84
|
-
function
|
|
85
|
+
function p(e) {
|
|
85
86
|
if (e != null) return typeof e == "string" ? { entity: e } : e;
|
|
86
87
|
}
|
|
87
|
-
function
|
|
88
|
+
function m(e) {
|
|
88
89
|
return { $special: e };
|
|
89
90
|
}
|
|
90
|
-
function
|
|
91
|
+
function h(e) {
|
|
91
92
|
if (typeof e != "object" || !e || Array.isArray(e)) return null;
|
|
92
93
|
let t = Object.keys(e), n = e.$special;
|
|
93
94
|
return t.length === 1 && typeof n == "string" ? n : null;
|
|
94
95
|
}
|
|
95
|
-
function
|
|
96
|
+
function g(e, t) {
|
|
96
97
|
let n = e ?? [];
|
|
97
98
|
if (!t) return n;
|
|
98
99
|
switch (t.mode ?? "append") {
|
|
@@ -101,7 +102,7 @@ function m(e, t) {
|
|
|
101
102
|
default: return [...n, ...t.values ?? []];
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
|
-
function
|
|
105
|
+
function _(e) {
|
|
105
106
|
let t = e.name, n = e.display ? {
|
|
106
107
|
...e.display,
|
|
107
108
|
name: e.display.name ?? t
|
|
@@ -114,46 +115,49 @@ function h(e) {
|
|
|
114
115
|
structure: e.structure
|
|
115
116
|
};
|
|
116
117
|
}
|
|
117
|
-
function
|
|
118
|
+
function v(e) {
|
|
118
119
|
return !e.primary && !e.auto && !e.readonly && !e.source && !e.immutable;
|
|
119
120
|
}
|
|
120
|
-
function
|
|
121
|
+
function y(e, t) {
|
|
121
122
|
return !e || e.readonly ? !1 : e.mutations?.[t] ?? !0;
|
|
122
123
|
}
|
|
123
|
-
function
|
|
124
|
+
function b(e, t, n) {
|
|
124
125
|
let r = e?.tenant_key;
|
|
125
126
|
return !r || !t || !(r in t) || !!n && String(t[r]).toLowerCase() === n.toLowerCase();
|
|
126
127
|
}
|
|
127
|
-
function
|
|
128
|
-
return
|
|
128
|
+
function x(e, t, n, r) {
|
|
129
|
+
return y(e, t) && (t === "create" || b(e, n, r));
|
|
129
130
|
}
|
|
130
|
-
function
|
|
131
|
+
function S(e) {
|
|
131
132
|
return !e?.disable_defaults?.includes("__new");
|
|
132
133
|
}
|
|
133
|
-
function
|
|
134
|
+
function C(e) {
|
|
135
|
+
return !e?.disable_defaults?.includes("__edit");
|
|
136
|
+
}
|
|
137
|
+
function w(e) {
|
|
134
138
|
if (e.primary_key && e.primary_key.length > 0) return e.primary_key;
|
|
135
139
|
for (let [t, n] of e.fields) if (n.primary) return [t];
|
|
136
140
|
return ["id"];
|
|
137
141
|
}
|
|
138
|
-
function
|
|
139
|
-
let r =
|
|
140
|
-
for (let e of r) i[e] = t
|
|
142
|
+
function T(e, t) {
|
|
143
|
+
let r = w(e), i = {};
|
|
144
|
+
for (let e of r) i[e] = n(t[e]);
|
|
141
145
|
return i;
|
|
142
146
|
}
|
|
143
|
-
function
|
|
147
|
+
function E(e) {
|
|
144
148
|
return e.length === 1 ? e[0] : JSON.stringify(e);
|
|
145
149
|
}
|
|
146
|
-
function
|
|
147
|
-
return
|
|
150
|
+
function D(e) {
|
|
151
|
+
return E(Object.values(e));
|
|
148
152
|
}
|
|
149
|
-
function
|
|
150
|
-
return
|
|
153
|
+
function O(e, t) {
|
|
154
|
+
return E(w(e).map((e) => t[e] ?? ""));
|
|
151
155
|
}
|
|
152
|
-
function
|
|
153
|
-
let n =
|
|
156
|
+
function k(e, t) {
|
|
157
|
+
let n = w(e);
|
|
154
158
|
if (n.length === 1) return { [n[0]]: t };
|
|
155
159
|
}
|
|
156
|
-
function
|
|
160
|
+
function A(e, t) {
|
|
157
161
|
if (t <= 1) return [e];
|
|
158
162
|
try {
|
|
159
163
|
let n = JSON.parse(e);
|
|
@@ -163,23 +167,23 @@ function D(e, t) {
|
|
|
163
167
|
}
|
|
164
168
|
return null;
|
|
165
169
|
}
|
|
166
|
-
function
|
|
170
|
+
function j(e, t, n) {
|
|
167
171
|
if (e?.detail_screen === "none") return null;
|
|
168
172
|
let r = e?.detail_screen ?? t?.detail_screen;
|
|
169
173
|
return r ? n?.[r]?.route ?? null : null;
|
|
170
174
|
}
|
|
171
|
-
function
|
|
175
|
+
function M(e, t, n, r) {
|
|
172
176
|
if (!t) return null;
|
|
173
|
-
let i =
|
|
177
|
+
let i = j(e, n, r);
|
|
174
178
|
return i ? i.replace(":id", encodeURIComponent(t)) : null;
|
|
175
179
|
}
|
|
176
|
-
function
|
|
177
|
-
return !t ||
|
|
180
|
+
function N(e, t, n, r) {
|
|
181
|
+
return !t || w(t).some((e) => !r[e]) ? null : M(e, O(t, r), t, n);
|
|
178
182
|
}
|
|
179
|
-
function
|
|
180
|
-
return t ?
|
|
183
|
+
function P(e, t, n, r) {
|
|
184
|
+
return t ? N(e, t, n, T(t, r)) : null;
|
|
181
185
|
}
|
|
182
|
-
function
|
|
183
|
-
return
|
|
186
|
+
function F(e) {
|
|
187
|
+
return w(e).length > 1;
|
|
184
188
|
}
|
|
185
|
-
export {
|
|
189
|
+
export { i as DETAIL_SCREEN_NONE, a as DISPLAY_KEY, e as OrderedMap, M as buildDetailHrefFromId, N as buildEntityDetailHref, P as buildRowDetailHref, g as effectiveSpecialValues, S as entityAllowsCreateRoute, C as entityAllowsEditForm, y as entityAllowsMutation, T as extractPkValues, f as fieldDisplayName, o as getDisplayValue, w as getPrimaryKeyFields, F as isCompositePk, v as isUserEditableField, p as normalizeRefConfig, E as pkValuePartsToId, A as pkValuesFromId, O as pkValuesToDetailId, D as pkValuesToId, _ as propertyToField, c as refRecordHasLabel, j as resolveDetailRoute, s as resolveRefRecordLabel, x as rowAllowsMutation, b as rowSetInTenant, d as screenTitleForPath, k as singlePkValues, m as specialValueMarker, h as specialValueMarkerCode };
|
|
@@ -75,6 +75,9 @@ interface FileFieldDef {
|
|
|
75
75
|
required?: boolean;
|
|
76
76
|
slots?: Record<string, FileNamedSlotDef>;
|
|
77
77
|
display?: FileFieldDisplay;
|
|
78
|
+
attachment_fields?: {
|
|
79
|
+
uploaded_by?: EntityField;
|
|
80
|
+
};
|
|
78
81
|
}
|
|
79
82
|
/** How a client reaches one file row, an original or a derivation: `url` serves its bytes; `presigned_url` answers JSON with where to load them. */
|
|
80
83
|
interface FileAddress {
|
|
@@ -317,6 +320,7 @@ interface EntityField {
|
|
|
317
320
|
currency_display?: "symbol" | "narrow_symbol" | "code" | "name";
|
|
318
321
|
favicon_source?: FaviconSource;
|
|
319
322
|
fill_from?: string;
|
|
323
|
+
flatten?: boolean;
|
|
320
324
|
};
|
|
321
325
|
values?: Array<{
|
|
322
326
|
code: string;
|
|
@@ -788,7 +792,7 @@ interface QuickPeekConfig {
|
|
|
788
792
|
* `sections` is consulted; when that's also absent the platform falls back
|
|
789
793
|
* to all simple scalar fields on the entity (capped at 8).
|
|
790
794
|
*/
|
|
791
|
-
fields?:
|
|
795
|
+
fields?: LayoutField[];
|
|
792
796
|
/** Section names from the detail-layout. Their `fields:` get flattened. */
|
|
793
797
|
sections?: string[];
|
|
794
798
|
inline_editable?: boolean;
|
|
@@ -1034,6 +1038,7 @@ interface Schema {
|
|
|
1034
1038
|
parameters: Record<string, ParameterDef>;
|
|
1035
1039
|
messages?: Record<string, LocalizedString>;
|
|
1036
1040
|
errors?: Record<string, LocalizedString>;
|
|
1041
|
+
error_fields?: Record<string, LocalizedString>;
|
|
1037
1042
|
areas?: AreaDef[];
|
|
1038
1043
|
accents?: Record<string, AccentDef>;
|
|
1039
1044
|
classifications?: Record<string, ClassificationTierDef>;
|
|
@@ -1270,7 +1275,6 @@ interface BrandingIdentity {
|
|
|
1270
1275
|
interface PublicMeta {
|
|
1271
1276
|
version?: string;
|
|
1272
1277
|
revision?: string;
|
|
1273
|
-
build_time?: string;
|
|
1274
1278
|
region?: string;
|
|
1275
1279
|
}
|
|
1276
1280
|
/** Envelope returned by GET /api/params/public. */
|
|
@@ -1381,6 +1385,7 @@ interface EvidenceVerdict {
|
|
|
1381
1385
|
seq?: number;
|
|
1382
1386
|
generation?: number;
|
|
1383
1387
|
covered: boolean;
|
|
1388
|
+
record_id?: string;
|
|
1384
1389
|
}
|
|
1385
1390
|
interface V2ParamInstance {
|
|
1386
1391
|
param_code: string;
|
package/package.json
CHANGED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Icon as e } from "./Icons.js";
|
|
2
|
-
import { useText as t } from "../../hooks/useText.js";
|
|
3
|
-
import { isUuid as n } from "../../lib/uuid.js";
|
|
4
|
-
import { useCallback as r, useState as i } from "react";
|
|
5
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
-
// src/components/primitives/RecordIdBadge.tsx
|
|
7
|
-
var s = 1200;
|
|
8
|
-
function c({ value: c }) {
|
|
9
|
-
let l = t(), [u, d] = i(!1), f = n(c) ? `${c.slice(0, 8)}…` : c, p = r(async () => {
|
|
10
|
-
try {
|
|
11
|
-
await navigator.clipboard.writeText(c), d(!0), window.setTimeout(() => d(!1), s);
|
|
12
|
-
} catch {}
|
|
13
|
-
}, [c]);
|
|
14
|
-
return /* @__PURE__ */ o("button", {
|
|
15
|
-
type: "button",
|
|
16
|
-
onClick: p,
|
|
17
|
-
title: u ? l("control.copied", "Copied") : l("control.copy_value", "Copy {value}", { value: c }),
|
|
18
|
-
className: "mono inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] text-text-4 hover:bg-surface-2 hover:text-text-3 transition-colors shrink-0 border border-transparent hover:border-border",
|
|
19
|
-
children: [/* @__PURE__ */ a("span", { children: f }), u ? /* @__PURE__ */ a(e.check, { size: 10 }) : /* @__PURE__ */ a(e.copy, {
|
|
20
|
-
size: 10,
|
|
21
|
-
style: { opacity: .6 }
|
|
22
|
-
})]
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
export { c as RecordIdBadge };
|