@declarion/react 0.104.0 → 0.109.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/api/agents.js +8 -7
- package/dist-lib/api/client.js +48 -49
- package/dist-lib/components/agents/AgentChatPanel.impl.js +362 -301
- package/dist-lib/components/agents/ChatAttachments.js +144 -0
- package/dist-lib/components/agents/transcript-runs.js +1 -1
- package/dist-lib/components/chrome/AssociationTabs.js +89 -75
- package/dist-lib/components/detail-layout/AssociatedBlock.js +243 -235
- package/dist-lib/components/detail-layout/ChildrenCards.js +57 -55
- package/dist-lib/components/detail-layout/ChildrenList.js +45 -43
- package/dist-lib/components/detail-layout/ChildrenTable.js +93 -91
- package/dist-lib/components/detail-layout/ChildrenTimeline.js +160 -155
- package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +127 -121
- package/dist-lib/components/fields/RefCombobox.js +53 -48
- package/dist-lib/components/fields/index.js +1 -0
- package/dist-lib/components/file-widgets/useFileSelection.js +152 -0
- package/dist-lib/components/pages/SmartDetailPage.impl.js +506 -482
- package/dist-lib/components/pages/SmartRecordListPage.impl.js +335 -300
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +112 -109
- package/dist-lib/components/params/ParamsBlock.js +18 -15
- package/dist-lib/components/params/param-editors.js +60 -54
- package/dist-lib/components/primitives/RetryButton.js +14 -0
- package/dist-lib/components/primitives/StatTile.js +42 -34
- package/dist-lib/hooks/useAgentConversation.js +18 -13
- package/dist-lib/hooks/useParams.js +54 -52
- package/dist-lib/hooks/useSchema.js +5 -2
- package/dist-lib/hooks/useTimelineData.js +26 -24
- package/dist-lib/index.d.ts +89 -5
- package/dist-lib/index.js +95 -93
- package/dist-lib/lib/read-display-state.js +19 -0
- package/dist-lib/stores/auth.js +1 -0
- package/dist-lib/testing.d.ts +1 -1
- package/dist-lib/types/fieldType.js +1 -1
- package/dist-lib/{useResponsiveMode-ECv1AEhv.d.ts → useResponsiveMode-DODbtSrY.d.ts} +3 -0
- package/package.json +1 -1
package/dist-lib/api/agents.js
CHANGED
|
@@ -6,15 +6,16 @@ async function n() {
|
|
|
6
6
|
}
|
|
7
7
|
async function r(t) {
|
|
8
8
|
return {
|
|
9
|
-
id: (await e("
|
|
9
|
+
id: (await e("agents.start_conversation", { ...t.agent_id ? { agent_id: t.agent_id } : {} })).conversation_id,
|
|
10
10
|
status: "active"
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
async function i(t, n, r) {
|
|
13
|
+
async function i(t, n, r, i) {
|
|
14
14
|
return {
|
|
15
|
-
id: (await e("
|
|
15
|
+
id: (await e("agents.send_message", {
|
|
16
16
|
conversation_id: n,
|
|
17
|
-
text: t,
|
|
17
|
+
...t ? { text: t } : {},
|
|
18
|
+
...i?.length ? { attachments: i } : {},
|
|
18
19
|
...r ? { context: r } : {}
|
|
19
20
|
})).message_id,
|
|
20
21
|
conversation_id: n,
|
|
@@ -22,7 +23,7 @@ async function i(t, n, r) {
|
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
25
|
async function a(t, n) {
|
|
25
|
-
await e("
|
|
26
|
+
await e("agents.answer_question", {
|
|
26
27
|
invocation_id: t,
|
|
27
28
|
answer: n
|
|
28
29
|
});
|
|
@@ -43,10 +44,10 @@ async function c(e, t) {
|
|
|
43
44
|
});
|
|
44
45
|
}
|
|
45
46
|
async function l(t) {
|
|
46
|
-
await e("
|
|
47
|
+
await e("agents.cancel_question", { invocation_id: t });
|
|
47
48
|
}
|
|
48
49
|
async function u(t) {
|
|
49
|
-
await e("
|
|
50
|
+
await e("agents.cancel_conversation", { conversation_id: t });
|
|
50
51
|
}
|
|
51
52
|
async function d() {
|
|
52
53
|
let e = await t("agent_conversation", {
|
package/dist-lib/api/client.js
CHANGED
|
@@ -116,11 +116,11 @@ async function A() {
|
|
|
116
116
|
let n = await O(t);
|
|
117
117
|
return T(n), n;
|
|
118
118
|
}
|
|
119
|
-
var j = null;
|
|
120
|
-
function
|
|
119
|
+
var j = null, M = /* @__PURE__ */ new Set(["auth.token_refresh_needed", "auth.unauthorized"]);
|
|
120
|
+
function N(n) {
|
|
121
121
|
return n instanceof t || n instanceof e;
|
|
122
122
|
}
|
|
123
|
-
async function
|
|
123
|
+
async function P() {
|
|
124
124
|
if (j !== null) throw new S(j);
|
|
125
125
|
return h || (h = x().catch((e) => {
|
|
126
126
|
throw e instanceof S && (j = e.status), e;
|
|
@@ -128,67 +128,66 @@ async function N() {
|
|
|
128
128
|
h = null;
|
|
129
129
|
}), h);
|
|
130
130
|
}
|
|
131
|
-
var
|
|
131
|
+
var F = () => {
|
|
132
132
|
if (typeof window > "u") return;
|
|
133
133
|
let { pathname: e } = window.location;
|
|
134
134
|
e.startsWith("/login") || e.startsWith("/signup") || e === "/reset" || e === "/forgot" || e === "/2fa" || (window.location.href = i());
|
|
135
135
|
};
|
|
136
|
-
function
|
|
137
|
-
let t =
|
|
138
|
-
return
|
|
136
|
+
function I(e) {
|
|
137
|
+
let t = F;
|
|
138
|
+
return F = e, t;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
return
|
|
140
|
+
function L() {
|
|
141
|
+
return F;
|
|
142
142
|
}
|
|
143
|
-
var
|
|
143
|
+
var R = ({ status: e, code: t, message: n }) => {
|
|
144
144
|
console.error(`[API ${e}] ${t}: ${n}`);
|
|
145
145
|
};
|
|
146
|
-
function
|
|
146
|
+
function z(e, t, n, r) {
|
|
147
147
|
let i = new Headers(e);
|
|
148
148
|
return !i.has("Content-Type") && t && i.set("Content-Type", "application/json"), n.setAccept && !i.has("Accept") && i.set("Accept", "*/*"), r && i.set("Authorization", `Bearer ${r}`), i;
|
|
149
149
|
}
|
|
150
|
-
var
|
|
151
|
-
function
|
|
152
|
-
e ||
|
|
150
|
+
var B = null, V = 0;
|
|
151
|
+
function H(e) {
|
|
152
|
+
e || V++, B = e || null;
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
return
|
|
154
|
+
function U() {
|
|
155
|
+
return V;
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
e ===
|
|
157
|
+
function W(e, t) {
|
|
158
|
+
e === V && (B = t || null);
|
|
159
159
|
}
|
|
160
|
-
function
|
|
161
|
-
return
|
|
160
|
+
function G() {
|
|
161
|
+
return B;
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
return !
|
|
163
|
+
function K(e) {
|
|
164
|
+
return !B || !e.startsWith("/api/") || /[?&]language=/.test(e) ? e : `${e}${e.includes("?") ? "&" : "?"}language=${encodeURIComponent(B)}`;
|
|
165
165
|
}
|
|
166
|
-
async function
|
|
167
|
-
let p =
|
|
166
|
+
async function q(t, i, u, f) {
|
|
167
|
+
let p = K(t), m = c(), h = m ? "omit" : "include", g = z(i.headers, !!i.body, u, m ? s() : null), _ = d(t, i), v = await D(p, {
|
|
168
168
|
...i,
|
|
169
169
|
headers: g,
|
|
170
170
|
credentials: h
|
|
171
171
|
}, _);
|
|
172
172
|
if (l(v.headers), !v.ok) {
|
|
173
173
|
let { raw: t, body: s } = await r(v), c = n(s.type), l = s.title ?? "";
|
|
174
|
-
if (v.status === 401 && (c
|
|
174
|
+
if (v.status === 401 && M.has(c)) try {
|
|
175
175
|
let t = null;
|
|
176
|
-
m ? (o(), t = await a()) : await
|
|
177
|
-
let
|
|
176
|
+
m ? (o(), t = await a()) : await P();
|
|
177
|
+
let s = z(i.headers, !!i.body, u, t), c = await D(p, {
|
|
178
178
|
...i,
|
|
179
|
-
headers:
|
|
179
|
+
headers: s,
|
|
180
180
|
credentials: h
|
|
181
181
|
}, _);
|
|
182
|
-
if (!
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
throw new e(s.status, t.body, t.raw);
|
|
182
|
+
if (!c.ok) {
|
|
183
|
+
let t = await r(c);
|
|
184
|
+
throw !m && c.status === 401 && M.has(n(t.body.type)) && (j = 401), c.status === 401 && !u.isSessionProbe && F(), new e(c.status, t.body, t.raw);
|
|
186
185
|
}
|
|
187
|
-
return f(
|
|
186
|
+
return f(c);
|
|
188
187
|
} catch (n) {
|
|
189
|
-
throw
|
|
188
|
+
throw N(n) ? n : (u.isSessionProbe || F(), new e(401, s, t));
|
|
190
189
|
}
|
|
191
|
-
throw v.status === 401 && !u.isSessionProbe &&
|
|
190
|
+
throw v.status === 401 && !u.isSessionProbe && F(), R({
|
|
192
191
|
status: v.status,
|
|
193
192
|
code: c,
|
|
194
193
|
message: l
|
|
@@ -196,29 +195,29 @@ async function K(t, i, u, f) {
|
|
|
196
195
|
}
|
|
197
196
|
return f(v);
|
|
198
197
|
}
|
|
199
|
-
function
|
|
198
|
+
function J(e) {
|
|
200
199
|
return e.status === 204 ? Promise.resolve(void 0) : e.json();
|
|
201
200
|
}
|
|
202
|
-
async function
|
|
203
|
-
return
|
|
201
|
+
async function Y(e, t = {}, { isSessionProbe: n = !1 } = {}) {
|
|
202
|
+
return q(e, t, {
|
|
204
203
|
setAccept: !1,
|
|
205
204
|
isSessionProbe: n
|
|
206
|
-
},
|
|
205
|
+
}, J);
|
|
207
206
|
}
|
|
208
|
-
async function
|
|
207
|
+
async function X(e) {
|
|
209
208
|
return {
|
|
210
209
|
blob: await e.blob(),
|
|
211
|
-
filename:
|
|
210
|
+
filename: Q(e.headers),
|
|
212
211
|
headers: e.headers
|
|
213
212
|
};
|
|
214
213
|
}
|
|
215
|
-
async function
|
|
216
|
-
return
|
|
214
|
+
async function Z(e, t = {}) {
|
|
215
|
+
return q(e, t, {
|
|
217
216
|
setAccept: !0,
|
|
218
217
|
isSessionProbe: !1
|
|
219
|
-
},
|
|
218
|
+
}, X);
|
|
220
219
|
}
|
|
221
|
-
function
|
|
220
|
+
function Q(e) {
|
|
222
221
|
let t = e.get("Content-Disposition");
|
|
223
222
|
if (!t) return "";
|
|
224
223
|
let n = t.match(/filename\*\s*=\s*([^']*)'([^']*)'([^;]+)/i);
|
|
@@ -228,14 +227,14 @@ function Z(e) {
|
|
|
228
227
|
let r = t.match(/filename\s*=\s*("([^"]+)"|([^;]+))/i);
|
|
229
228
|
return r ? (r[2] ?? r[3] ?? "").trim() : "";
|
|
230
229
|
}
|
|
231
|
-
async function
|
|
232
|
-
return (await
|
|
230
|
+
async function $(e, t = {}, { isSessionProbe: n = !1 } = {}) {
|
|
231
|
+
return (await q(`/api/actions/${encodeURIComponent(e)}`, {
|
|
233
232
|
method: "POST",
|
|
234
233
|
body: m(t)
|
|
235
234
|
}, {
|
|
236
235
|
setAccept: !1,
|
|
237
236
|
isSessionProbe: n
|
|
238
|
-
},
|
|
237
|
+
}, J)).result;
|
|
239
238
|
}
|
|
240
239
|
//#endregion
|
|
241
|
-
export { S as RefreshDeadError,
|
|
240
|
+
export { S as RefreshDeadError, Y as apiFetch, Z as apiFetchBlob, $ as callHandler, E as cancelProactiveRefresh, G as currentPublishedLanguage, U as currentReader, P as ensureRefresh, L as getPersistentAuthFailureHandler, N as isTransientFailure, Q as parseContentDispositionFilename, H as publishLanguage, W as publishLanguageFor, T as scheduleProactiveRefresh, I as setPersistentAuthFailureHandler, K as withPublishedLanguage };
|