@declarion/react 0.47.0 → 0.48.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-B6KjWkwD.js → DraggableChildrenTable-p2ZSdwzj.js} +1 -1
- package/dist-lib/{Grid-OdquWJNX.js → Grid-CjLFAKMZ.js} +2 -2
- package/dist-lib/{LayoutRenderer-CzAdhjNT.js → LayoutRenderer-X3p4yfo_.js} +124 -118
- package/dist-lib/{MarkdownRenderer-C6bhrAIe.js → MarkdownRenderer-Sb7zcvj0.js} +1 -1
- package/dist-lib/{RefreshControl-F9Ib9asP.js → RefreshControl-Cnl9nE0x.js} +255 -225
- package/dist-lib/{SmartDetailPage.impl-DdSu3kmW.js → SmartDetailPage.impl-bb0UNOII.js} +465 -463
- package/dist-lib/{SmartRecordListPage.impl-SkIp0_Rd.js → SmartRecordListPage.impl-BFh8auUZ.js} +141 -139
- package/dist-lib/api/agents.d.ts +8 -11
- package/dist-lib/components/agents/AgentChatPanel.d.ts +1 -0
- package/dist-lib/components/agents/AgentPicker.d.ts +9 -0
- package/dist-lib/components/primitives/Tooltip.d.ts +4 -0
- package/dist-lib/components/shared/ResponsiveActionBar.d.ts +10 -5
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/hooks/useAgentConversation.d.ts +5 -7
- package/dist-lib/hooks/useBrandingChrome.d.ts +11 -0
- package/dist-lib/hooks/useLongPress.d.ts +29 -0
- package/dist-lib/hooks/useResponsiveMode.d.ts +2 -21
- package/dist-lib/index.d.ts +2 -2
- package/dist-lib/index.js +2351 -2144
- package/dist-lib/lib/actions.d.ts +12 -4
- package/dist-lib/lib/longPressGesture.d.ts +55 -0
- package/dist-lib/lib/page-inset.d.ts +3 -0
- package/dist-lib/lib/viewport-category.d.ts +44 -0
- package/dist-lib/{registry-C2VD-5MD.js → registry-CWDnxiLJ.js} +1013 -954
- package/dist-lib/testing.js +10 -10
- package/dist-lib/types/api.d.ts +15 -2
- package/dist-lib/{useCurrentScreen-ow4r-nWa.js → useCurrentScreen-BshVTPVq.js} +979 -971
- package/dist-lib/{useProperties-lEKfzm2X.js → useProperties-B5p9mIH8.js} +2 -2
- package/dist-lib/{value-CXohNH6a.js → value-B1O6QikE.js} +1 -1
- package/package.json +1 -1
- package/dist-lib/components/agents/AgentVisualHints.d.ts +0 -6
package/dist-lib/{SmartRecordListPage.impl-SkIp0_Rd.js → SmartRecordListPage.impl-BFh8auUZ.js}
RENAMED
|
@@ -1,58 +1,58 @@
|
|
|
1
1
|
import { s as e } from "./DynamicIcon-Dc2j-rg_.js";
|
|
2
|
-
import { A as t, At as n, Cn as r, F as i, Kn as a, Ln as o, N as s, Pn as c, Sn as l, Tn as u, X as d, Yn as f, Zn as p, bn as m, lr as ee, q as h,
|
|
3
|
-
import { $ as v, A as
|
|
4
|
-
import { S as
|
|
5
|
-
import { t as F } from "./LayoutRenderer-
|
|
6
|
-
import { useCallback as I, useEffect as L, useMemo as R, useRef as z, useState as
|
|
7
|
-
import { useSearchParams as
|
|
2
|
+
import { A as t, At as n, Cn as r, F as i, Kn as a, Ln as o, N as s, Pn as c, Sn as l, Tn as u, X as d, Yn as f, Zn as p, bn as m, lr as ee, q as h, rt as g, tr as te, ur as _ } from "./useCurrentScreen-BshVTPVq.js";
|
|
3
|
+
import { $ as v, A as ne, Q as y, T as b, X as x, Z as S, a as C, c as re, dt as ie, et as w, nt as T, s as E, v as D } from "./registry-CWDnxiLJ.js";
|
|
4
|
+
import { S as O, c as k, f as A, g as j, h as ae, m as M, n as oe, r as N, v as P } from "./useProperties-B5p9mIH8.js";
|
|
5
|
+
import { t as F } from "./LayoutRenderer-X3p4yfo_.js";
|
|
6
|
+
import { useCallback as I, useEffect as L, useMemo as R, useRef as z, useState as se } from "react";
|
|
7
|
+
import { useSearchParams as ce } from "react-router";
|
|
8
8
|
import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/pages/SmartRecordListPage.impl.tsx
|
|
10
10
|
function U({ screenCode: t }) {
|
|
11
|
-
let [r, i] =
|
|
12
|
-
|
|
13
|
-
let _ =
|
|
11
|
+
let [r, i] = ce(), { data: s } = n(), c = te(), p = s?.screens[t], m = p?.entity ? s?.entities[p.entity] : void 0, g = p?.entity;
|
|
12
|
+
j(p, m, r.toString()), P(p?.route);
|
|
13
|
+
let _ = D(), v = r.get("selected") ?? null, ne = r.get("search") ?? "", y = h(ne, 300), b = r.get("sort") ?? p?.sort_default ?? "", x = R(() => A(r), [r]), S = x.filters.length > 0 ? x.filters : void 0, C = R(() => p?.columns ?? m?.fields.names().filter((e) => !m.fields.get(e)?.primary && !m.fields.get(e)?.auto && m.fields.get(e)?.display?.is_listable !== !1).slice(0, 4) ?? [], [p?.columns, m]), w = R(() => {
|
|
14
14
|
let e = p?.responsive?.[c.category]?.presentation;
|
|
15
15
|
return c.category === "phone" ? "drilldown" : e === "split" || e === "drilldown" || e === "stacked" ? e : "split";
|
|
16
|
-
}, [p?.responsive, c.category]),
|
|
16
|
+
}, [p?.responsive, c.category]), T = R(() => {
|
|
17
17
|
let e = p?.responsive?.[c.category];
|
|
18
18
|
return e?.list?.presentation === "table" || e?.list?.presentation === "cards" ? e.list.presentation : e?.presentation === "table" || e?.presentation === "cards" ? e.presentation : c.category === "phone" ? "cards" : "table";
|
|
19
|
-
}, [p?.responsive, c.category]),
|
|
19
|
+
}, [p?.responsive, c.category]), oe = p?.responsive?.[c.category]?.layout?.related_records, N = R(() => E({
|
|
20
20
|
entity: m,
|
|
21
21
|
screen: p
|
|
22
|
-
}), [m, p]), F = R(() =>
|
|
22
|
+
}), [m, p]), F = R(() => re({
|
|
23
23
|
entity: m,
|
|
24
24
|
screen: p,
|
|
25
|
-
presentation:
|
|
26
|
-
visibleColumns:
|
|
27
|
-
card:
|
|
28
|
-
sort:
|
|
25
|
+
presentation: T,
|
|
26
|
+
visibleColumns: C,
|
|
27
|
+
card: N,
|
|
28
|
+
sort: b
|
|
29
29
|
}), [
|
|
30
30
|
m,
|
|
31
31
|
p,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
T,
|
|
33
|
+
C,
|
|
34
|
+
N,
|
|
35
|
+
b
|
|
36
36
|
]), U = m?.list_pagination === "cursor", { data: W, isLoading: G } = d(g, {
|
|
37
37
|
page: 1,
|
|
38
38
|
per_page: 200,
|
|
39
|
-
sort:
|
|
40
|
-
search:
|
|
41
|
-
filters:
|
|
39
|
+
sort: b || void 0,
|
|
40
|
+
search: y || void 0,
|
|
41
|
+
filters: x.error ? void 0 : S,
|
|
42
42
|
select: F.selectFields,
|
|
43
43
|
expand: F.expandFields,
|
|
44
44
|
preview: !0,
|
|
45
45
|
screen: p?.fixed_filters ? t : void 0
|
|
46
|
-
}, !U), K =
|
|
47
|
-
sort:
|
|
48
|
-
search:
|
|
49
|
-
filters:
|
|
46
|
+
}, !U), K = O(g, {
|
|
47
|
+
sort: b || void 0,
|
|
48
|
+
search: y || void 0,
|
|
49
|
+
filters: x.error ? void 0 : S,
|
|
50
50
|
select: F.selectFields,
|
|
51
51
|
expand: F.expandFields,
|
|
52
52
|
preview: !0,
|
|
53
53
|
screen: p?.fixed_filters ? t : void 0,
|
|
54
54
|
limit: 200
|
|
55
|
-
}, U), J = U ? K.rows : W?.data ?? [],
|
|
55
|
+
}, U), J = U ? K.rows : W?.data ?? [], ue = U ? K.refs : W?.$refs, Y = U ? K.isLoading : G, de = R(() => m?.fields.names().find((e) => m.fields.get(e)?.primary) ?? "id", [m]), fe = I((e, t) => {
|
|
56
56
|
i((t) => {
|
|
57
57
|
let n = new URLSearchParams(t);
|
|
58
58
|
return e ? n.set("selected", e) : n.delete("selected"), n;
|
|
@@ -64,76 +64,78 @@ function U({ screenCode: t }) {
|
|
|
64
64
|
}, { replace: !0 });
|
|
65
65
|
}, [i]), me = I((e, t) => {
|
|
66
66
|
i((n) => {
|
|
67
|
-
let r = new URLSearchParams(n), i =
|
|
68
|
-
return a = t && t !== "__all__" ? [...
|
|
67
|
+
let r = new URLSearchParams(n), i = A(n).filters, a;
|
|
68
|
+
return a = t && t !== "__all__" ? [...M(i, e), k(e, t)] : M(i, e), ae(a, r), r;
|
|
69
69
|
}, { replace: !0 });
|
|
70
|
-
}, [i]),
|
|
70
|
+
}, [i]), X = (p?.list_resizable ?? !1) && w === "split" && c.category !== "phone" && !c.touch, he = z(null), [Z, Q] = se(null), ge = z(!1), $ = p?.list_width;
|
|
71
71
|
L(() => {
|
|
72
|
-
!
|
|
72
|
+
!X || !$?.endsWith("%") || Q(null);
|
|
73
73
|
}, [
|
|
74
|
-
|
|
74
|
+
X,
|
|
75
75
|
$,
|
|
76
76
|
c.width,
|
|
77
77
|
c.height
|
|
78
78
|
]), L(() => {
|
|
79
|
-
if (!
|
|
79
|
+
if (!X || Z !== null) return;
|
|
80
80
|
let e = he.current;
|
|
81
81
|
if (e) {
|
|
82
82
|
if ($ && $.endsWith("%")) {
|
|
83
83
|
let t = parseFloat($) / 100;
|
|
84
|
-
|
|
85
|
-
} else
|
|
84
|
+
Q(Math.round(e.getBoundingClientRect().width * t));
|
|
85
|
+
} else Q($ && parseInt($, 10) || 320);
|
|
86
86
|
}
|
|
87
87
|
}, [
|
|
88
|
-
Y,
|
|
89
|
-
$,
|
|
90
88
|
X,
|
|
89
|
+
$,
|
|
90
|
+
Z,
|
|
91
91
|
m
|
|
92
92
|
]);
|
|
93
|
-
let
|
|
93
|
+
let _e = z(null);
|
|
94
94
|
L(() => () => {
|
|
95
|
-
|
|
95
|
+
_e.current?.();
|
|
96
96
|
}, []);
|
|
97
|
-
let
|
|
98
|
-
e.preventDefault(),
|
|
99
|
-
let t = e.clientX, n =
|
|
100
|
-
if (!
|
|
97
|
+
let ve = I((e) => {
|
|
98
|
+
e.preventDefault(), ge.current = !0;
|
|
99
|
+
let t = e.clientX, n = Z ?? 320, r = (e) => {
|
|
100
|
+
if (!ge.current) return;
|
|
101
101
|
let r = (he.current?.getBoundingClientRect().width ?? window.innerWidth) - 300, i = Math.max(200, Math.min(r, n + e.clientX - t));
|
|
102
|
-
|
|
102
|
+
Q(i);
|
|
103
103
|
}, i = () => {
|
|
104
|
-
|
|
104
|
+
ge.current = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i), document.body.style.cursor = "", document.body.style.userSelect = "", _e.current = null;
|
|
105
105
|
};
|
|
106
|
-
document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", r), document.addEventListener("mouseup", i),
|
|
107
|
-
}, [
|
|
106
|
+
document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", r), document.addEventListener("mouseup", i), _e.current = i;
|
|
107
|
+
}, [Z]);
|
|
108
108
|
if (!s || !p || !m) return null;
|
|
109
|
-
let
|
|
109
|
+
let ye = S?.length ?? 0, be = w === "split" || w === "stacked" || !v, xe = w === "split" || w === "stacked" || !!v, Se = w !== "split" && v ? () => fe(null, { replace: !0 }) : void 0, Ce = w === "split" ? X && Z !== null ? Z : p.list_width ?? "320px" : "100%";
|
|
110
110
|
return /* @__PURE__ */ H("div", {
|
|
111
111
|
ref: he,
|
|
112
|
-
"data-record-list-presentation":
|
|
112
|
+
"data-record-list-presentation": w,
|
|
113
113
|
style: {
|
|
114
114
|
display: "flex",
|
|
115
|
-
flexDirection:
|
|
115
|
+
flexDirection: w === "stacked" ? "column" : "row",
|
|
116
116
|
height: "100%",
|
|
117
117
|
minWidth: 0,
|
|
118
118
|
overflow: "hidden"
|
|
119
119
|
},
|
|
120
120
|
children: [
|
|
121
|
-
|
|
121
|
+
be && /* @__PURE__ */ H("div", {
|
|
122
122
|
"data-testid": "record-list-panel",
|
|
123
123
|
style: {
|
|
124
|
-
flex:
|
|
124
|
+
flex: w === "split" ? "none" : "1 1 auto",
|
|
125
125
|
display: "flex",
|
|
126
126
|
flexDirection: "column",
|
|
127
127
|
overflow: "hidden",
|
|
128
|
-
borderRight:
|
|
129
|
-
borderBottom:
|
|
130
|
-
width:
|
|
128
|
+
borderRight: w === "split" && !X ? "1px solid var(--divider)" : "none",
|
|
129
|
+
borderBottom: w === "stacked" ? "1px solid var(--divider)" : "none",
|
|
130
|
+
width: Ce,
|
|
131
131
|
minWidth: 0,
|
|
132
|
-
height:
|
|
132
|
+
height: w === "stacked" ? "50%" : "100%"
|
|
133
133
|
},
|
|
134
134
|
children: [/* @__PURE__ */ H("div", {
|
|
135
135
|
style: {
|
|
136
|
-
|
|
136
|
+
paddingTop: 12,
|
|
137
|
+
paddingBottom: 12,
|
|
138
|
+
...ie(12),
|
|
137
139
|
display: "flex",
|
|
138
140
|
flexDirection: "column",
|
|
139
141
|
gap: 8,
|
|
@@ -160,12 +162,12 @@ function U({ screenCode: t }) {
|
|
|
160
162
|
})]
|
|
161
163
|
}),
|
|
162
164
|
/* @__PURE__ */ V(f, {
|
|
163
|
-
value:
|
|
165
|
+
value: ne,
|
|
164
166
|
onChange: pe,
|
|
165
167
|
placeholder: `Search ${u(m.display.name_plural)}…`,
|
|
166
168
|
prefix: /* @__PURE__ */ V(e.search, { size: 13 })
|
|
167
169
|
}),
|
|
168
|
-
|
|
170
|
+
x.error && /* @__PURE__ */ H("div", {
|
|
169
171
|
role: "alert",
|
|
170
172
|
"data-testid": "record-list-filter-url-error",
|
|
171
173
|
style: {
|
|
@@ -175,7 +177,7 @@ function U({ screenCode: t }) {
|
|
|
175
177
|
color: "var(--danger)",
|
|
176
178
|
fontSize: 11.5
|
|
177
179
|
},
|
|
178
|
-
children: [
|
|
180
|
+
children: [x.error, " Showing this list without URL filters."]
|
|
179
181
|
}),
|
|
180
182
|
p.filters && p.filters.length > 0 && /* @__PURE__ */ V("div", {
|
|
181
183
|
style: {
|
|
@@ -186,7 +188,7 @@ function U({ screenCode: t }) {
|
|
|
186
188
|
children: p.filters.map((e) => {
|
|
187
189
|
let t = m.fields.get(e);
|
|
188
190
|
if (!t?.values) return null;
|
|
189
|
-
let n =
|
|
191
|
+
let n = S?.find((t) => t.field === e && t.op === "eq")?.value ?? "__all__", r = l(t, e, s.entities), i = [{
|
|
190
192
|
value: "__all__",
|
|
191
193
|
label: `All ${r}`
|
|
192
194
|
}, ...t.values.map((e) => ({
|
|
@@ -212,7 +214,7 @@ function U({ screenCode: t }) {
|
|
|
212
214
|
fontSize: 11,
|
|
213
215
|
color: "var(--text-3)"
|
|
214
216
|
},
|
|
215
|
-
children: [/* @__PURE__ */ V("span", { children:
|
|
217
|
+
children: [/* @__PURE__ */ V("span", { children: Y ? "Loading…" : `${J.length} ${u(m.display.name_plural)}` }), ye > 0 && /* @__PURE__ */ V("button", {
|
|
216
218
|
onClick: () => i((e) => {
|
|
217
219
|
let t = new URLSearchParams(e);
|
|
218
220
|
return t.delete("filters"), t;
|
|
@@ -234,12 +236,12 @@ function U({ screenCode: t }) {
|
|
|
234
236
|
style: {
|
|
235
237
|
flex: 1,
|
|
236
238
|
overflowY: "auto",
|
|
237
|
-
padding:
|
|
238
|
-
display:
|
|
239
|
+
padding: T === "cards" ? 10 : 0,
|
|
240
|
+
display: T === "cards" ? "flex" : "block",
|
|
239
241
|
flexDirection: "column",
|
|
240
|
-
gap:
|
|
242
|
+
gap: T === "cards" ? 10 : void 0
|
|
241
243
|
},
|
|
242
|
-
children:
|
|
244
|
+
children: Y ? /* @__PURE__ */ V("div", {
|
|
243
245
|
style: {
|
|
244
246
|
padding: 12,
|
|
245
247
|
display: "flex",
|
|
@@ -261,15 +263,15 @@ function U({ screenCode: t }) {
|
|
|
261
263
|
children: "No records found"
|
|
262
264
|
}) : /* @__PURE__ */ H(B, { children: [J.map((e) => {
|
|
263
265
|
let t = o(e[de]);
|
|
264
|
-
return /* @__PURE__ */ V(
|
|
266
|
+
return /* @__PURE__ */ V(le, {
|
|
265
267
|
record: e,
|
|
266
268
|
entity: m,
|
|
267
|
-
columns:
|
|
268
|
-
card:
|
|
269
|
-
presentation:
|
|
270
|
-
refs:
|
|
269
|
+
columns: C,
|
|
270
|
+
card: N,
|
|
271
|
+
presentation: T,
|
|
272
|
+
refs: ue,
|
|
271
273
|
isSelected: t === v,
|
|
272
|
-
onClick: () => fe(t, { replace:
|
|
274
|
+
onClick: () => fe(t, { replace: w === "split" })
|
|
273
275
|
}, t);
|
|
274
276
|
}), U && K.hasMore && /* @__PURE__ */ V("button", {
|
|
275
277
|
type: "button",
|
|
@@ -290,9 +292,9 @@ function U({ screenCode: t }) {
|
|
|
290
292
|
})] })
|
|
291
293
|
})]
|
|
292
294
|
}),
|
|
293
|
-
|
|
295
|
+
X && /* @__PURE__ */ V("div", {
|
|
294
296
|
"data-testid": "record-list-resize-handle",
|
|
295
|
-
onMouseDown:
|
|
297
|
+
onMouseDown: ve,
|
|
296
298
|
style: {
|
|
297
299
|
flex: "none",
|
|
298
300
|
width: 1,
|
|
@@ -303,13 +305,13 @@ function U({ screenCode: t }) {
|
|
|
303
305
|
onMouseEnter: (e) => e.currentTarget.style.background = "var(--border-strong)",
|
|
304
306
|
onMouseLeave: (e) => e.currentTarget.style.background = "var(--divider)"
|
|
305
307
|
}),
|
|
306
|
-
|
|
308
|
+
xe && /* @__PURE__ */ V("div", {
|
|
307
309
|
"data-testid": "record-detail-panel",
|
|
308
310
|
style: {
|
|
309
311
|
flex: 1,
|
|
310
312
|
minWidth: 0,
|
|
311
313
|
overflow: "hidden",
|
|
312
|
-
height:
|
|
314
|
+
height: w === "stacked" ? "50%" : "100%"
|
|
313
315
|
},
|
|
314
316
|
children: v ? /* @__PURE__ */ V(q, {
|
|
315
317
|
entityCode: g,
|
|
@@ -317,8 +319,8 @@ function U({ screenCode: t }) {
|
|
|
317
319
|
items: p.items,
|
|
318
320
|
schema: s,
|
|
319
321
|
entity: m,
|
|
320
|
-
onBackToList:
|
|
321
|
-
relatedRecordsPresentation:
|
|
322
|
+
onBackToList: Se,
|
|
323
|
+
relatedRecordsPresentation: oe
|
|
322
324
|
}, v) : /* @__PURE__ */ V("div", {
|
|
323
325
|
style: {
|
|
324
326
|
display: "flex",
|
|
@@ -340,7 +342,7 @@ function U({ screenCode: t }) {
|
|
|
340
342
|
]
|
|
341
343
|
});
|
|
342
344
|
}
|
|
343
|
-
function
|
|
345
|
+
function le({ record: e, entity: n, columns: r, card: i, presentation: a, refs: o, isSelected: s, onClick: c }) {
|
|
344
346
|
let l = t();
|
|
345
347
|
if (a === "cards") {
|
|
346
348
|
let t = i.badgeFields.filter((t) => W(n, e, t)), r = i.bodyFields.filter((t) => W(n, e, t)), a = i.metaFields.filter((t) => W(n, e, t));
|
|
@@ -376,7 +378,7 @@ function ce({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
|
|
|
376
378
|
color: "var(--text-3)",
|
|
377
379
|
overflowWrap: "anywhere"
|
|
378
380
|
},
|
|
379
|
-
children:
|
|
381
|
+
children: w({
|
|
380
382
|
entity: n,
|
|
381
383
|
fieldName: i.subtitleField,
|
|
382
384
|
record: e,
|
|
@@ -401,7 +403,7 @@ function ce({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
|
|
|
401
403
|
maxWidth: "100%",
|
|
402
404
|
overflowWrap: "anywhere"
|
|
403
405
|
},
|
|
404
|
-
children:
|
|
406
|
+
children: w({
|
|
405
407
|
entity: n,
|
|
406
408
|
fieldName: t,
|
|
407
409
|
record: e,
|
|
@@ -439,7 +441,7 @@ function ce({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
|
|
|
439
441
|
minWidth: 0,
|
|
440
442
|
overflowWrap: "anywhere"
|
|
441
443
|
},
|
|
442
|
-
children:
|
|
444
|
+
children: w({
|
|
443
445
|
entity: n,
|
|
444
446
|
fieldName: t,
|
|
445
447
|
record: e,
|
|
@@ -485,7 +487,7 @@ function ce({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
|
|
|
485
487
|
whiteSpace: "nowrap",
|
|
486
488
|
color: "var(--text)"
|
|
487
489
|
},
|
|
488
|
-
children:
|
|
490
|
+
children: w({
|
|
489
491
|
entity: n,
|
|
490
492
|
fieldName: u,
|
|
491
493
|
record: e,
|
|
@@ -508,7 +510,7 @@ function ce({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
|
|
|
508
510
|
textOverflow: "ellipsis",
|
|
509
511
|
whiteSpace: "nowrap"
|
|
510
512
|
},
|
|
511
|
-
children:
|
|
513
|
+
children: w({
|
|
512
514
|
entity: n,
|
|
513
515
|
fieldName: d,
|
|
514
516
|
record: e,
|
|
@@ -525,7 +527,7 @@ function ce({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
|
|
|
525
527
|
},
|
|
526
528
|
children: f.map((t) => v(n, e, t) == null ? null : /* @__PURE__ */ V("div", {
|
|
527
529
|
style: { fontSize: 11 },
|
|
528
|
-
children:
|
|
530
|
+
children: w({
|
|
529
531
|
entity: n,
|
|
530
532
|
fieldName: t,
|
|
531
533
|
record: e,
|
|
@@ -543,7 +545,7 @@ function W(e, t, n) {
|
|
|
543
545
|
return !(r == null || r === "" || Array.isArray(r) && r.length === 0);
|
|
544
546
|
}
|
|
545
547
|
function G({ entity: e, record: n, field: i, refs: a }) {
|
|
546
|
-
let o = t(), s = r(n, e), c = i ?
|
|
548
|
+
let o = t(), s = r(n, e), c = i ? w({
|
|
547
549
|
entity: e,
|
|
548
550
|
fieldName: i,
|
|
549
551
|
record: n,
|
|
@@ -581,7 +583,7 @@ function K({ entity: e, record: t, fieldName: n, refs: r, locale: i }) {
|
|
|
581
583
|
minWidth: 0,
|
|
582
584
|
overflowWrap: "anywhere"
|
|
583
585
|
},
|
|
584
|
-
children:
|
|
586
|
+
children: w({
|
|
585
587
|
entity: e,
|
|
586
588
|
fieldName: n,
|
|
587
589
|
record: t,
|
|
@@ -603,87 +605,87 @@ function q({ entityCode: e, recordId: t, items: n, schema: r, entity: i, onBackT
|
|
|
603
605
|
}) });
|
|
604
606
|
}
|
|
605
607
|
function J({ entityCode: t, recordId: n, items: a, schema: s, entity: l, onBackToList: d, relatedRecordsPresentation: f }) {
|
|
606
|
-
let h = m(l, "update"), te = R(() => n ? c(l, n) : void 0, [n, l]), { data:
|
|
608
|
+
let h = m(l, "update"), te = R(() => n ? c(l, n) : void 0, [n, l]), { data: re, isLoading: ie } = C(t, te), w = ne(t), E = i(), [D, O] = se(!1), [k, A] = se({}), j = re?.data, ae = j?.$statuses, M = j?.$properties, P = N(t, n), L = oe(t, n), z = R(() => {
|
|
607
609
|
let e = /* @__PURE__ */ new Set();
|
|
608
610
|
for (let [t, n] of l.fields) !n.auto && !n.primary && e.add(t);
|
|
609
611
|
for (let [t] of l.files ?? []) e.add(t);
|
|
610
612
|
return e;
|
|
611
|
-
}, [l]),
|
|
612
|
-
if (
|
|
613
|
+
}, [l]), ce = I(() => {
|
|
614
|
+
if (j) {
|
|
613
615
|
let e = {};
|
|
614
|
-
|
|
615
|
-
let n = v(l,
|
|
616
|
-
e[t] =
|
|
617
|
-
}),
|
|
616
|
+
z.forEach((t) => {
|
|
617
|
+
let n = v(l, j, t);
|
|
618
|
+
e[t] = y(l, t) ? n ?? null : n ?? "";
|
|
619
|
+
}), A(e);
|
|
618
620
|
}
|
|
619
|
-
|
|
621
|
+
O(!0);
|
|
620
622
|
}, [
|
|
621
|
-
|
|
622
|
-
|
|
623
|
+
j,
|
|
624
|
+
z,
|
|
623
625
|
l
|
|
624
|
-
]),
|
|
625
|
-
await
|
|
626
|
-
}, [
|
|
627
|
-
let e = {}, t =
|
|
626
|
+
]), U = I(async () => {
|
|
627
|
+
await E.flushAllDrafts(), O(!1), A({});
|
|
628
|
+
}, [E]), le = I(() => {
|
|
629
|
+
let e = {}, t = x({
|
|
628
630
|
entity: l,
|
|
629
|
-
formData:
|
|
630
|
-
record:
|
|
631
|
+
formData: k,
|
|
632
|
+
record: j,
|
|
631
633
|
isNew: !1
|
|
632
|
-
}), r =
|
|
633
|
-
for (let [t, n] of Object.entries(
|
|
634
|
+
}), r = S(t);
|
|
635
|
+
for (let [t, n] of Object.entries(k)) l.files?.has(t) || (e[t] = T(l, t, n));
|
|
634
636
|
if (Object.keys(t).length > 0 && (e.$files = t), Object.keys(e).length === 0) {
|
|
635
|
-
|
|
637
|
+
O(!1), A({});
|
|
636
638
|
return;
|
|
637
639
|
}
|
|
638
|
-
|
|
640
|
+
w.mutate({
|
|
639
641
|
pkValues: n,
|
|
640
642
|
data: e
|
|
641
643
|
}, {
|
|
642
644
|
onSuccess: () => {
|
|
643
|
-
r.forEach((e) =>
|
|
645
|
+
r.forEach((e) => E.markCommitted(e)), O(!1), A({}), g.success("Saved");
|
|
644
646
|
},
|
|
645
647
|
onError: () => g.error("Failed to save")
|
|
646
648
|
});
|
|
647
649
|
}, [
|
|
648
|
-
|
|
649
|
-
|
|
650
|
+
E,
|
|
651
|
+
w,
|
|
650
652
|
n,
|
|
651
653
|
l,
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
]),
|
|
655
|
-
|
|
654
|
+
k,
|
|
655
|
+
j
|
|
656
|
+
]), W = I((e, t) => {
|
|
657
|
+
A((n) => ({
|
|
656
658
|
...n,
|
|
657
659
|
[e]: t
|
|
658
660
|
}));
|
|
659
661
|
}, []);
|
|
660
|
-
if (
|
|
661
|
-
if (!
|
|
662
|
-
let
|
|
662
|
+
if (ie) return /* @__PURE__ */ V(b, {});
|
|
663
|
+
if (!j) return null;
|
|
664
|
+
let G = r(j, l), K = l.display?.display_field, q = G ? void 0 : K ? j[K] : j[l.fields.names()[0]], J = G || (q != null && typeof q != "object" ? o(q) : u(l.display.name)), ue = j?.$refs, Y = {
|
|
663
665
|
schema: s,
|
|
664
666
|
entity: l,
|
|
665
667
|
entityCode: t,
|
|
666
668
|
recordId: n,
|
|
667
|
-
record:
|
|
668
|
-
...
|
|
669
|
-
...
|
|
670
|
-
} :
|
|
669
|
+
record: D ? {
|
|
670
|
+
...j,
|
|
671
|
+
...k
|
|
672
|
+
} : j,
|
|
671
673
|
isNew: !1,
|
|
672
|
-
mode:
|
|
673
|
-
onFieldChange:
|
|
674
|
+
mode: D ? "edit" : "display",
|
|
675
|
+
onFieldChange: D ? W : void 0,
|
|
674
676
|
refs: ue,
|
|
675
|
-
objectProperties:
|
|
676
|
-
onSetProperty: h ? (e, t) =>
|
|
677
|
+
objectProperties: M ?? void 0,
|
|
678
|
+
onSetProperty: h ? (e, t) => L.mutate({
|
|
677
679
|
propertyCode: e,
|
|
678
680
|
value: t
|
|
679
681
|
}) : void 0,
|
|
680
|
-
isPropertyPending:
|
|
681
|
-
objectStatuses:
|
|
682
|
-
onSetStatus: h ? (e, t) =>
|
|
682
|
+
isPropertyPending: L.isPending,
|
|
683
|
+
objectStatuses: ae ?? void 0,
|
|
684
|
+
onSetStatus: h ? (e, t) => P.mutate({
|
|
683
685
|
groupCode: e,
|
|
684
686
|
statusCode: t
|
|
685
687
|
}) : void 0,
|
|
686
|
-
isStatusPending:
|
|
688
|
+
isStatusPending: P.isPending,
|
|
687
689
|
relatedRecordsPresentation: f
|
|
688
690
|
};
|
|
689
691
|
return /* @__PURE__ */ H("div", {
|
|
@@ -714,7 +716,7 @@ function J({ entityCode: t, recordId: n, items: a, schema: s, entity: l, onBackT
|
|
|
714
716
|
whiteSpace: "nowrap",
|
|
715
717
|
color: "var(--text)"
|
|
716
718
|
},
|
|
717
|
-
children:
|
|
719
|
+
children: J
|
|
718
720
|
}), /* @__PURE__ */ H("div", {
|
|
719
721
|
style: {
|
|
720
722
|
display: "flex",
|
|
@@ -725,22 +727,22 @@ function J({ entityCode: t, recordId: n, items: a, schema: s, entity: l, onBackT
|
|
|
725
727
|
icon: /* @__PURE__ */ V(e.back, { size: 14 }),
|
|
726
728
|
title: "Back to list",
|
|
727
729
|
onClick: d
|
|
728
|
-
}), h && (
|
|
730
|
+
}), h && (D ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(_, {
|
|
729
731
|
size: "xs",
|
|
730
732
|
icon: /* @__PURE__ */ V(e.x, { size: 12 }),
|
|
731
|
-
onClick:
|
|
733
|
+
onClick: U,
|
|
732
734
|
children: "Cancel"
|
|
733
735
|
}), /* @__PURE__ */ V(_, {
|
|
734
736
|
kind: "primary",
|
|
735
737
|
size: "xs",
|
|
736
|
-
icon:
|
|
737
|
-
onClick:
|
|
738
|
-
disabled:
|
|
739
|
-
children:
|
|
738
|
+
icon: w.isPending ? /* @__PURE__ */ V(p, { size: 12 }) : /* @__PURE__ */ V(e.save, { size: 12 }),
|
|
739
|
+
onClick: le,
|
|
740
|
+
disabled: w.isPending,
|
|
741
|
+
children: w.isPending ? "Saving…" : "Save"
|
|
740
742
|
})] }) : /* @__PURE__ */ V(_, {
|
|
741
743
|
size: "xs",
|
|
742
744
|
icon: /* @__PURE__ */ V(e.edit, { size: 12 }),
|
|
743
|
-
onClick:
|
|
745
|
+
onClick: ce,
|
|
744
746
|
children: "Edit"
|
|
745
747
|
}))]
|
|
746
748
|
})]
|
|
@@ -755,7 +757,7 @@ function J({ entityCode: t, recordId: n, items: a, schema: s, entity: l, onBackT
|
|
|
755
757
|
},
|
|
756
758
|
children: a && a.length > 0 ? /* @__PURE__ */ V(F, {
|
|
757
759
|
nodes: a,
|
|
758
|
-
ctx:
|
|
760
|
+
ctx: Y
|
|
759
761
|
}) : /* @__PURE__ */ H("p", {
|
|
760
762
|
style: {
|
|
761
763
|
fontSize: 12.5,
|
package/dist-lib/api/agents.d.ts
CHANGED
|
@@ -13,12 +13,6 @@ export type AgentContentBlock = {
|
|
|
13
13
|
name?: string;
|
|
14
14
|
output: unknown;
|
|
15
15
|
is_error?: boolean;
|
|
16
|
-
} | {
|
|
17
|
-
type: "ui_hint";
|
|
18
|
-
kind: string;
|
|
19
|
-
target?: unknown;
|
|
20
|
-
ttl_ms?: number;
|
|
21
|
-
label?: string;
|
|
22
16
|
} | {
|
|
23
17
|
type: "elicit";
|
|
24
18
|
id: string;
|
|
@@ -109,9 +103,7 @@ export interface AgentConversation {
|
|
|
109
103
|
created_by?: string;
|
|
110
104
|
agent_id?: string;
|
|
111
105
|
agent?: string;
|
|
112
|
-
agent_version?: string;
|
|
113
106
|
title?: string;
|
|
114
|
-
context?: Record<string, unknown>;
|
|
115
107
|
model?: string;
|
|
116
108
|
status: AgentConversationStatus;
|
|
117
109
|
token_usage?: {
|
|
@@ -120,12 +112,17 @@ export interface AgentConversation {
|
|
|
120
112
|
cached_in?: number;
|
|
121
113
|
cost_cents?: number;
|
|
122
114
|
};
|
|
123
|
-
catalog_snapshot?: unknown;
|
|
124
|
-
active_instance?: string;
|
|
125
115
|
}
|
|
116
|
+
export interface AvailableAgent {
|
|
117
|
+
id: string;
|
|
118
|
+
code: string;
|
|
119
|
+
name?: Record<string, string>;
|
|
120
|
+
description?: Record<string, string>;
|
|
121
|
+
is_default: boolean;
|
|
122
|
+
}
|
|
123
|
+
export declare function listAvailableAgents(): Promise<AvailableAgent[]>;
|
|
126
124
|
export declare function createConversation(input: {
|
|
127
125
|
agent_id?: string;
|
|
128
|
-
context?: Record<string, unknown>;
|
|
129
126
|
}): Promise<AgentConversation>;
|
|
130
127
|
export declare function sendMessage(text: string, conversationId: string): Promise<AgentMessage>;
|
|
131
128
|
export declare function answerQuestion(invocationId: string, answer: Record<string, unknown>): Promise<void>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export interface AgentChatPanelProps {
|
|
2
2
|
open: boolean;
|
|
3
3
|
onClose: () => void;
|
|
4
|
+
/** Reserved for conversation context; the current action does not persist it. */
|
|
4
5
|
context?: string;
|
|
5
6
|
title?: string;
|
|
6
7
|
/** A question typed somewhere else - the command palette - to send once
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AvailableAgent } from "../../api/agents";
|
|
2
|
+
export interface AgentPickerProps {
|
|
3
|
+
agents: AvailableAgent[];
|
|
4
|
+
selectedId?: string;
|
|
5
|
+
onSelect: (id: string) => void;
|
|
6
|
+
locale: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function AgentPicker({ agents, selectedId, onSelect, locale, label }: AgentPickerProps): import("react").JSX.Element | null;
|
|
@@ -7,6 +7,10 @@ export interface AnchoredTooltip {
|
|
|
7
7
|
onMouseLeave: () => void;
|
|
8
8
|
onFocus: FocusEventHandler;
|
|
9
9
|
onBlur: () => void;
|
|
10
|
+
/** A coarse pointer has no hover, so a tap is the open gesture. */
|
|
11
|
+
onPointerUp: (event: {
|
|
12
|
+
pointerType?: string;
|
|
13
|
+
}) => void;
|
|
10
14
|
};
|
|
11
15
|
/** aria-describedby value for the trigger while the tooltip is open. */
|
|
12
16
|
describedBy: string | undefined;
|