@declarion/react 0.177.0 → 0.182.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/access-expiry.js +28 -6
- package/dist-lib/api/agents.js +19 -8
- package/dist-lib/api/audience.js +1 -1
- package/dist-lib/api/auth.js +63 -62
- package/dist-lib/api/client.js +39 -37
- package/dist-lib/app.js +101 -101
- package/dist-lib/components/agents/AgentChatPanel.impl.js +275 -177
- package/dist-lib/components/agents/transcript-runs.js +19 -7
- package/dist-lib/components/detail-layout/EvidenceBlock.js +1 -1
- package/dist-lib/components/pages/auth/SignIn.js +4 -2
- package/dist-lib/components/pages/profile/Profile.impl.js +149 -135
- package/dist-lib/hooks/useSchema.js +15 -14
- package/dist-lib/index.d.ts +19 -1
- package/dist-lib/stores/auth.js +55 -46
- package/package.json +1 -1
package/dist-lib/app.js
CHANGED
|
@@ -3,16 +3,16 @@ import { Layout as t } from "./components/layout/Layout.js";
|
|
|
3
3
|
import { SignIn as n } from "./components/pages/auth/SignIn.js";
|
|
4
4
|
import { SignUp as r } from "./components/pages/auth/SignUp.js";
|
|
5
5
|
import { Forgot as i } from "./components/pages/auth/Forgot.js";
|
|
6
|
-
import { Reset as
|
|
7
|
-
import { TwoFA as
|
|
8
|
-
import { OAuthConsent as
|
|
9
|
-
import { SSOCallbackPage as
|
|
10
|
-
import { SSO_RETURN_PATH as
|
|
11
|
-
import { NotFoundPage as
|
|
12
|
-
import { NoScreensPage as
|
|
13
|
-
import { Profile as
|
|
14
|
-
import { TenantParamsPage as
|
|
15
|
-
import { Preferences as
|
|
6
|
+
import { Reset as a } from "./components/pages/auth/Reset.js";
|
|
7
|
+
import { TwoFA as o } from "./components/pages/auth/TwoFA.js";
|
|
8
|
+
import { OAuthConsent as ee } from "./components/pages/auth/OAuthConsent.js";
|
|
9
|
+
import { SSOCallbackPage as te } from "./components/pages/SSOCallbackPage.js";
|
|
10
|
+
import { SSO_RETURN_PATH as ne } from "./api/access-expiry.js";
|
|
11
|
+
import { NotFoundPage as s } from "./components/pages/NotFoundPage.js";
|
|
12
|
+
import { NoScreensPage as c } from "./components/pages/NoScreensPage.js";
|
|
13
|
+
import { Profile as l } from "./components/pages/profile/Profile.js";
|
|
14
|
+
import { TenantParamsPage as u } from "./components/pages/tenant-params/TenantParamsPage.js";
|
|
15
|
+
import { Preferences as re } from "./components/pages/profile/Preferences.js";
|
|
16
16
|
import { AdminCatalogPage as ie } from "./components/pages/AdminCatalogPage.js";
|
|
17
17
|
import { SmartListPage as d } from "./components/pages/SmartListPage.js";
|
|
18
18
|
import { SmartDetailPage as f } from "./components/pages/SmartDetailPage.js";
|
|
@@ -23,37 +23,37 @@ import { usePreferencesStore as g } from "./stores/preferences.js";
|
|
|
23
23
|
import { useSchema as _ } from "./hooks/useSchema.js";
|
|
24
24
|
import { usePublicParams as v } from "./hooks/useParams.js";
|
|
25
25
|
import { useBranding as y } from "./hooks/useBranding.js";
|
|
26
|
-
import { identityProvidersQueryOptions as
|
|
27
|
-
import { useBrandingBreakpoints as
|
|
28
|
-
import { useVersionWatcher as
|
|
29
|
-
import { ConnectionNotice as
|
|
30
|
-
import { shouldRetryQuery as
|
|
31
|
-
import { backoffDelayMs as
|
|
32
|
-
import { ResponsiveModeProvider as
|
|
33
|
-
import { isValidLogoUrl as
|
|
34
|
-
import { useFirstScreenSettledOnInput as
|
|
35
|
-
import { schemaDefaultRoute as
|
|
36
|
-
import { getRegisteredScreen as
|
|
37
|
-
import { CurrentScreenProvider as
|
|
38
|
-
import { setIconRegistry as
|
|
39
|
-
import { applyRetainedReadGcTime as
|
|
40
|
-
import { DEFAULT_PAGE_STATE_TTL_MS as
|
|
41
|
-
import { EmbedProvider as
|
|
42
|
-
import { EmbedAuthBootstrap as
|
|
43
|
-
import { BlankScreen as
|
|
44
|
-
import { CONSUMER_BRAND_CSS_ID as
|
|
45
|
-
import { useEffect as
|
|
46
|
-
import { QueryClient as
|
|
26
|
+
import { identityProvidersQueryOptions as b, setupQueryOptions as ae } from "./hooks/useSignInData.js";
|
|
27
|
+
import { useBrandingBreakpoints as x, useBrandingViewport as S } from "./hooks/useBrandingChrome.js";
|
|
28
|
+
import { useVersionWatcher as C } from "./hooks/useVersionWatcher.js";
|
|
29
|
+
import { ConnectionNotice as w } from "./components/shared/ConnectionNotice.js";
|
|
30
|
+
import { shouldRetryQuery as T } from "./lib/query-retry.js";
|
|
31
|
+
import { backoffDelayMs as E } from "./api/request-bounds.js";
|
|
32
|
+
import { ResponsiveModeProvider as D } from "./hooks/useResponsiveMode.js";
|
|
33
|
+
import { isValidLogoUrl as O } from "./lib/branding.js";
|
|
34
|
+
import { useFirstScreenSettledOnInput as k } from "./lib/capabilityPrefetch.js";
|
|
35
|
+
import { schemaDefaultRoute as A } from "./lib/schema-routing.js";
|
|
36
|
+
import { getRegisteredScreen as j, registerScreen as M } from "./stores/screen-registry.js";
|
|
37
|
+
import { CurrentScreenProvider as N } from "./hooks/useCurrentScreen.js";
|
|
38
|
+
import { setIconRegistry as oe } from "./stores/icon-registry.js";
|
|
39
|
+
import { applyRetainedReadGcTime as P } from "./hooks/usePageStateRuntime.js";
|
|
40
|
+
import { DEFAULT_PAGE_STATE_TTL_MS as F } from "./stores/page-state.js";
|
|
41
|
+
import { EmbedProvider as I, useEmbed as L } from "./embed/EmbedContext.js";
|
|
42
|
+
import { EmbedAuthBootstrap as R } from "./embed/EmbedAuthBootstrap.js";
|
|
43
|
+
import { BlankScreen as z } from "./components/shared/BlankScreen.js";
|
|
44
|
+
import { CONSUMER_BRAND_CSS_ID as B, applyBrandTokens as V, brandTokenCss as H } from "./lib/brand-tokens.js";
|
|
45
|
+
import { useEffect as U, useMemo as W } from "react";
|
|
46
|
+
import { QueryClient as G, QueryClientProvider as K, useQueryClient as se } from "@tanstack/react-query";
|
|
47
47
|
import { Fragment as ce, jsx as q, jsxs as J } from "react/jsx-runtime";
|
|
48
48
|
import { BrowserRouter as le, Navigate as Y, Route as X, Routes as ue, useLocation as de } from "react-router";
|
|
49
49
|
import { Toaster as fe } from "sonner";
|
|
50
|
-
|
|
51
|
-
var Z = "declarion-managed-favicon", Q = new
|
|
50
|
+
M("Profile", l), M("TenantParameters", u);
|
|
51
|
+
var Z = "declarion-managed-favicon", Q = new G({ defaultOptions: { queries: {
|
|
52
52
|
staleTime: 3e5,
|
|
53
|
-
retry:
|
|
54
|
-
retryDelay:
|
|
53
|
+
retry: T,
|
|
54
|
+
retryDelay: E
|
|
55
55
|
} } });
|
|
56
|
-
|
|
56
|
+
P(Q, F);
|
|
57
57
|
function $(e) {
|
|
58
58
|
if (typeof window > "u") return null;
|
|
59
59
|
try {
|
|
@@ -64,12 +64,12 @@ function $(e) {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
function pe({ component: e, screenCode: t }) {
|
|
67
|
-
return
|
|
67
|
+
return k(), /* @__PURE__ */ q(e, { screenCode: t });
|
|
68
68
|
}
|
|
69
69
|
function me() {
|
|
70
70
|
let { data: e } = _();
|
|
71
71
|
return {
|
|
72
|
-
routes:
|
|
72
|
+
routes: W(() => {
|
|
73
73
|
if (!e) return [];
|
|
74
74
|
let t = [];
|
|
75
75
|
for (let [n, r] of Object.entries(e.screens ?? {})) if (r.type === "list") {
|
|
@@ -77,30 +77,30 @@ function me() {
|
|
|
77
77
|
if ((i ? e.entities?.[i] : void 0)?.singleton) continue;
|
|
78
78
|
t.push(/* @__PURE__ */ q(X, {
|
|
79
79
|
path: r.route,
|
|
80
|
-
element: /* @__PURE__ */ q(m, { children: /* @__PURE__ */ q(
|
|
80
|
+
element: /* @__PURE__ */ q(m, { children: /* @__PURE__ */ q(N, {
|
|
81
81
|
code: n,
|
|
82
82
|
children: /* @__PURE__ */ q(d, { screenCode: n })
|
|
83
83
|
}) })
|
|
84
84
|
}, n));
|
|
85
85
|
} else if (r.type === "detail") t.push(/* @__PURE__ */ q(X, {
|
|
86
86
|
path: r.route,
|
|
87
|
-
element: /* @__PURE__ */ q(m, { children: /* @__PURE__ */ q(
|
|
87
|
+
element: /* @__PURE__ */ q(m, { children: /* @__PURE__ */ q(N, {
|
|
88
88
|
code: n,
|
|
89
89
|
children: /* @__PURE__ */ q(f, { screenCode: n })
|
|
90
90
|
}) })
|
|
91
91
|
}, n));
|
|
92
92
|
else if (r.type === "record_list") t.push(/* @__PURE__ */ q(X, {
|
|
93
93
|
path: r.route,
|
|
94
|
-
element: /* @__PURE__ */ q(m, { children: /* @__PURE__ */ q(
|
|
94
|
+
element: /* @__PURE__ */ q(m, { children: /* @__PURE__ */ q(N, {
|
|
95
95
|
code: n,
|
|
96
96
|
children: /* @__PURE__ */ q(p, { screenCode: n })
|
|
97
97
|
}) })
|
|
98
98
|
}, n));
|
|
99
99
|
else if (r.type === "custom") {
|
|
100
|
-
let e = r.component ?
|
|
100
|
+
let e = r.component ? j(r.component) : void 0;
|
|
101
101
|
e && t.push(/* @__PURE__ */ q(X, {
|
|
102
102
|
path: r.route,
|
|
103
|
-
element: /* @__PURE__ */ q(m, { children: /* @__PURE__ */ q(
|
|
103
|
+
element: /* @__PURE__ */ q(m, { children: /* @__PURE__ */ q(N, {
|
|
104
104
|
code: n,
|
|
105
105
|
children: /* @__PURE__ */ q(pe, {
|
|
106
106
|
component: e,
|
|
@@ -111,43 +111,43 @@ function me() {
|
|
|
111
111
|
}
|
|
112
112
|
return t;
|
|
113
113
|
}, [e]),
|
|
114
|
-
defaultRoute:
|
|
114
|
+
defaultRoute: W(() => A(e), [e])
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
function he() {
|
|
118
|
-
let
|
|
119
|
-
|
|
118
|
+
let l = h((e) => e.initialize), u = h((e) => e.signedOutPresumed), d = h((e) => e.isAuthenticated), { data: f, isError: p } = _(), m = e(), { data: g, isLoading: x } = v(), { branding: S, isLoading: C } = y(), { routes: w, defaultRoute: T } = me(), E = L(), D = de(), k = se(), A = h((e) => e.isLoading) && !u;
|
|
119
|
+
U(() => {
|
|
120
120
|
document.documentElement.lang = m;
|
|
121
121
|
}, [m]);
|
|
122
|
-
let
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
let j = typeof window < "u" && window.self !== window.top && !E.enabled;
|
|
123
|
+
U(() => {
|
|
124
|
+
D.pathname !== "/login" || E.enabled || j || A || d || (k.prefetchQuery(ae), k.prefetchQuery(b));
|
|
125
125
|
}, [
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
D.pathname,
|
|
127
|
+
E.enabled,
|
|
128
|
+
j,
|
|
129
|
+
A,
|
|
130
130
|
d,
|
|
131
|
-
|
|
132
|
-
]),
|
|
133
|
-
|
|
131
|
+
k
|
|
132
|
+
]), U(() => {
|
|
133
|
+
E.enabled || j || l();
|
|
134
134
|
}, [
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
E.enabled,
|
|
136
|
+
j,
|
|
137
|
+
l
|
|
138
138
|
]);
|
|
139
|
-
let
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}, [
|
|
143
|
-
let
|
|
144
|
-
|
|
139
|
+
let M = f?.icons;
|
|
140
|
+
U(() => {
|
|
141
|
+
oe(M ?? {});
|
|
142
|
+
}, [M]);
|
|
143
|
+
let N = S?.identity, P = S?.theme;
|
|
144
|
+
U(() => {
|
|
145
145
|
if (typeof document > "u") return;
|
|
146
|
-
let e =
|
|
146
|
+
let e = N?.app_name?.trim();
|
|
147
147
|
e && (document.title = e);
|
|
148
|
-
}, [
|
|
148
|
+
}, [N?.app_name]), U(() => {
|
|
149
149
|
if (typeof document > "u") return;
|
|
150
|
-
let e =
|
|
150
|
+
let e = N?.app_logo, t = O(e) ? $(e.trim()) : null, n = document.getElementById(Z);
|
|
151
151
|
if (!t) n && n.remove();
|
|
152
152
|
else if (n) n.href !== t && (n.href = t);
|
|
153
153
|
else {
|
|
@@ -155,36 +155,36 @@ function he() {
|
|
|
155
155
|
let e = document.createElement("link");
|
|
156
156
|
e.id = Z, e.rel = "icon", e.href = t, document.head.appendChild(e);
|
|
157
157
|
}
|
|
158
|
-
}, [
|
|
159
|
-
let
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}, [
|
|
158
|
+
}, [N?.app_logo]);
|
|
159
|
+
let F = P?.css_url ?? null, I = W(() => H(P), [P]);
|
|
160
|
+
U(() => {
|
|
161
|
+
V(I);
|
|
162
|
+
}, [I]), U(() => {
|
|
163
163
|
if (typeof document > "u") return;
|
|
164
|
-
let e = document.getElementById(
|
|
165
|
-
if (!
|
|
164
|
+
let e = document.getElementById(B);
|
|
165
|
+
if (!F) {
|
|
166
166
|
e && e.remove();
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
169
|
-
let t = $(
|
|
169
|
+
let t = $(F);
|
|
170
170
|
if (!t) {
|
|
171
|
-
e && e.remove(), console.error(`[declarion] branding.theme.css_url rejected: ${
|
|
171
|
+
e && e.remove(), console.error(`[declarion] branding.theme.css_url rejected: ${F}. Only same-origin, relative URLs are allowed (e.g. /modules/crm/public/brand.css).`);
|
|
172
172
|
return;
|
|
173
173
|
}
|
|
174
174
|
if (e && e.href === t) return;
|
|
175
175
|
e && e.remove();
|
|
176
176
|
let n = document.createElement("link");
|
|
177
|
-
n.id =
|
|
178
|
-
}, [
|
|
179
|
-
let
|
|
180
|
-
return
|
|
177
|
+
n.id = B, n.rel = "stylesheet", n.href = t, document.head.appendChild(n);
|
|
178
|
+
}, [F]);
|
|
179
|
+
let R = E.enabled && !d;
|
|
180
|
+
return j || R || A || x && !g || C || !f && (d || !p) ? /* @__PURE__ */ q(z, {}) : /* @__PURE__ */ J(ue, { children: [
|
|
181
181
|
/* @__PURE__ */ q(X, {
|
|
182
182
|
path: "/login",
|
|
183
183
|
element: /* @__PURE__ */ q(n, {})
|
|
184
184
|
}),
|
|
185
185
|
/* @__PURE__ */ q(X, {
|
|
186
|
-
path:
|
|
187
|
-
element: /* @__PURE__ */ q(
|
|
186
|
+
path: ne,
|
|
187
|
+
element: /* @__PURE__ */ q(te, {})
|
|
188
188
|
}),
|
|
189
189
|
/* @__PURE__ */ q(X, {
|
|
190
190
|
path: "/signup",
|
|
@@ -196,40 +196,40 @@ function he() {
|
|
|
196
196
|
}),
|
|
197
197
|
/* @__PURE__ */ q(X, {
|
|
198
198
|
path: "/reset",
|
|
199
|
-
element: /* @__PURE__ */ q(
|
|
199
|
+
element: /* @__PURE__ */ q(a, {})
|
|
200
200
|
}),
|
|
201
201
|
/* @__PURE__ */ q(X, {
|
|
202
202
|
path: "/2fa",
|
|
203
|
-
element: /* @__PURE__ */ q(
|
|
203
|
+
element: /* @__PURE__ */ q(o, {})
|
|
204
204
|
}),
|
|
205
205
|
/* @__PURE__ */ q(X, {
|
|
206
206
|
path: "/oauth/consent",
|
|
207
|
-
element: /* @__PURE__ */ q(
|
|
207
|
+
element: /* @__PURE__ */ q(ee, {})
|
|
208
208
|
}),
|
|
209
209
|
/* @__PURE__ */ J(X, {
|
|
210
210
|
element: /* @__PURE__ */ q(t, {}),
|
|
211
211
|
children: [
|
|
212
|
-
f && !
|
|
212
|
+
f && !T && /* @__PURE__ */ q(X, {
|
|
213
213
|
index: !0,
|
|
214
|
-
element: /* @__PURE__ */ q(
|
|
214
|
+
element: /* @__PURE__ */ q(c, {})
|
|
215
215
|
}),
|
|
216
|
-
|
|
216
|
+
T && /* @__PURE__ */ J(ce, { children: [/* @__PURE__ */ q(X, {
|
|
217
217
|
index: !0,
|
|
218
218
|
element: /* @__PURE__ */ q(Y, {
|
|
219
|
-
to:
|
|
219
|
+
to: T,
|
|
220
220
|
replace: !0
|
|
221
221
|
})
|
|
222
222
|
}), /* @__PURE__ */ q(X, {
|
|
223
223
|
path: "/admin",
|
|
224
224
|
element: /* @__PURE__ */ q(Y, {
|
|
225
|
-
to:
|
|
225
|
+
to: T,
|
|
226
226
|
replace: !0
|
|
227
227
|
})
|
|
228
228
|
})] }),
|
|
229
|
-
|
|
229
|
+
w,
|
|
230
230
|
/* @__PURE__ */ q(X, {
|
|
231
231
|
path: "/preferences",
|
|
232
|
-
element: /* @__PURE__ */ q(
|
|
232
|
+
element: /* @__PURE__ */ q(re, {})
|
|
233
233
|
}),
|
|
234
234
|
/* @__PURE__ */ q(X, {
|
|
235
235
|
path: "/admin/catalog",
|
|
@@ -237,18 +237,18 @@ function he() {
|
|
|
237
237
|
}),
|
|
238
238
|
/* @__PURE__ */ q(X, {
|
|
239
239
|
path: "*",
|
|
240
|
-
element: /* @__PURE__ */ q(
|
|
240
|
+
element: /* @__PURE__ */ q(s, {})
|
|
241
241
|
})
|
|
242
242
|
]
|
|
243
243
|
})
|
|
244
244
|
] });
|
|
245
245
|
}
|
|
246
246
|
function ge() {
|
|
247
|
-
|
|
247
|
+
C();
|
|
248
248
|
let e = g((e) => e.toastPosition);
|
|
249
249
|
return /* @__PURE__ */ J(le, { children: [
|
|
250
|
-
/* @__PURE__ */ q(
|
|
251
|
-
/* @__PURE__ */ q(
|
|
250
|
+
/* @__PURE__ */ q(R, {}),
|
|
251
|
+
/* @__PURE__ */ q(w, {}),
|
|
252
252
|
/* @__PURE__ */ q(he, {}),
|
|
253
253
|
/* @__PURE__ */ q(fe, {
|
|
254
254
|
position: e,
|
|
@@ -266,17 +266,17 @@ function ge() {
|
|
|
266
266
|
] });
|
|
267
267
|
}
|
|
268
268
|
function _e({ children: e }) {
|
|
269
|
-
let t =
|
|
270
|
-
return /* @__PURE__ */ q(
|
|
269
|
+
let t = S(), n = x();
|
|
270
|
+
return /* @__PURE__ */ q(D, {
|
|
271
271
|
viewport: t,
|
|
272
272
|
breakpoints: n,
|
|
273
273
|
children: e
|
|
274
274
|
});
|
|
275
275
|
}
|
|
276
276
|
function ve() {
|
|
277
|
-
return /* @__PURE__ */ q(m, { children: /* @__PURE__ */ q(
|
|
277
|
+
return /* @__PURE__ */ q(m, { children: /* @__PURE__ */ q(K, {
|
|
278
278
|
client: Q,
|
|
279
|
-
children: /* @__PURE__ */ q(
|
|
279
|
+
children: /* @__PURE__ */ q(I, { children: /* @__PURE__ */ q(_e, { children: /* @__PURE__ */ q(ge, {}) }) })
|
|
280
280
|
}) });
|
|
281
281
|
}
|
|
282
282
|
export { ve as App };
|