@declarion/react 0.106.0 → 0.110.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 +9 -7
- package/dist-lib/api/audience.js +12 -0
- package/dist-lib/api/auth.js +1 -1
- package/dist-lib/api/client.js +101 -93
- package/dist-lib/api/schema.js +31 -31
- package/dist-lib/components/agents/AgentChatPanel.impl.js +362 -301
- package/dist-lib/components/agents/ChatAttachments.js +154 -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/DocumentCard.js +1 -1
- package/dist-lib/components/file-widgets/FileList.js +1 -1
- package/dist-lib/components/file-widgets/Grid.js +1 -1
- package/dist-lib/components/file-widgets/upload.js +64 -61
- 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 +122 -109
- package/dist-lib/hooks/useAuth.js +4 -1
- package/dist-lib/hooks/useParams.js +54 -52
- package/dist-lib/hooks/useSchema.js +25 -30
- package/dist-lib/hooks/useTimelineData.js +26 -24
- package/dist-lib/index.d.ts +90 -6
- package/dist-lib/index.js +95 -93
- package/dist-lib/lib/read-display-state.js +19 -0
- package/dist-lib/stores/auth.js +35 -34
- package/dist-lib/test/seed-schema.js +4 -3
- package/dist-lib/testing.d.ts +1 -1
- package/dist-lib/types/fieldType.js +1 -1
- package/dist-lib/{useResponsiveMode-ECv1AEhv.d.ts → useResponsiveMode-C4MeAgoS.d.ts} +3 -1
- package/package.json +1 -1
package/dist-lib/stores/auth.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { isEmbedTokenMode as e } from "../embed/token.js";
|
|
2
|
+
import { startOrderNow as t } from "../api/access-expiry.js";
|
|
3
|
+
import { sessionCaller as n } from "../api/audience.js";
|
|
4
|
+
import { cancelProactiveRefresh as r, ensureRefresh as i, scheduleProactiveRefresh as a, setLanguageReader as o } from "../api/client.js";
|
|
5
|
+
import { getMe as s, listTenants as c, logout as l, probeSession as u } from "../api/auth.js";
|
|
6
|
+
import { warmRoutePages as d } from "../lib/capabilityPrefetch.js";
|
|
7
|
+
import { usePreferencesStore as f } from "./preferences.js";
|
|
8
|
+
import { create as p } from "zustand";
|
|
7
9
|
//#region src/stores/auth.ts
|
|
8
|
-
async function
|
|
10
|
+
async function m(e, t, n) {
|
|
9
11
|
try {
|
|
10
12
|
let r = await n();
|
|
11
|
-
|
|
13
|
+
a(r.access_expires_at), e({
|
|
12
14
|
user: r,
|
|
13
15
|
isAuthenticated: !0,
|
|
14
16
|
isLoading: !1,
|
|
@@ -25,7 +27,7 @@ async function f(e, t, n) {
|
|
|
25
27
|
});
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
|
-
var
|
|
30
|
+
var h = p((e, n) => ({
|
|
29
31
|
user: null,
|
|
30
32
|
isAuthenticated: !1,
|
|
31
33
|
isLoading: !0,
|
|
@@ -34,52 +36,51 @@ var p = d((r, i) => ({
|
|
|
34
36
|
sessionPresumed: !1,
|
|
35
37
|
identitySince: 0,
|
|
36
38
|
initialize: async () => {
|
|
37
|
-
let
|
|
38
|
-
|
|
39
|
+
let r = t();
|
|
40
|
+
r === "refresh-first" && (r = await i().then(() => "first-wave", () => "probe-first")), e({ sessionPresumed: r === "first-wave" }), r === "first-wave" && d(), await m(e, n, u), r === "probe-first" && n().isAuthenticated && d();
|
|
39
41
|
},
|
|
40
|
-
reloadSession: () =>
|
|
42
|
+
reloadSession: () => m(e, n, s),
|
|
43
|
+
recheckSession: () => m(e, n, u),
|
|
41
44
|
refreshMe: async () => {
|
|
42
45
|
try {
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
user:
|
|
46
|
-
activeTenant:
|
|
47
|
-
...
|
|
46
|
+
let t = await s(), r = n(), i = r.user?.id !== t.id || r.activeTenant?.id !== t.tenant?.id;
|
|
47
|
+
e({
|
|
48
|
+
user: t,
|
|
49
|
+
activeTenant: t.tenant ?? null,
|
|
50
|
+
...i ? { identitySince: performance.now() } : {}
|
|
48
51
|
});
|
|
49
52
|
} catch {}
|
|
50
53
|
},
|
|
51
|
-
setUser: (
|
|
52
|
-
|
|
53
|
-
user:
|
|
54
|
+
setUser: (t, n) => {
|
|
55
|
+
e({
|
|
56
|
+
user: t,
|
|
54
57
|
isAuthenticated: !0,
|
|
55
58
|
isLoading: !1,
|
|
56
|
-
activeTenant:
|
|
59
|
+
activeTenant: n ?? null,
|
|
57
60
|
identitySince: performance.now()
|
|
58
61
|
});
|
|
59
62
|
},
|
|
60
63
|
loadTenants: () => {
|
|
61
|
-
|
|
64
|
+
c().then((t) => e({ tenants: t }), () => void 0);
|
|
62
65
|
},
|
|
63
|
-
setActiveTenant: (
|
|
64
|
-
|
|
66
|
+
setActiveTenant: (t) => {
|
|
67
|
+
e({ activeTenant: t });
|
|
65
68
|
},
|
|
66
69
|
logout: async () => {
|
|
67
|
-
|
|
68
|
-
try {
|
|
69
|
-
await s();
|
|
70
|
-
} catch {}
|
|
71
|
-
r({
|
|
70
|
+
r(), e({
|
|
72
71
|
user: null,
|
|
73
72
|
isAuthenticated: !1,
|
|
74
73
|
activeTenant: null,
|
|
75
74
|
tenants: [],
|
|
76
75
|
sessionPresumed: !1,
|
|
77
76
|
identitySince: performance.now()
|
|
78
|
-
});
|
|
77
|
+
}), await l(), _?.postMessage(g);
|
|
79
78
|
}
|
|
80
|
-
}));
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
})), g = "signed-out", _ = typeof BroadcastChannel == "function" ? new BroadcastChannel("declarion.auth") : null;
|
|
80
|
+
_?.addEventListener("message", (t) => {
|
|
81
|
+
t.data === g && !e() && h.getState().isAuthenticated && (r(), window.location.assign("/login"));
|
|
82
|
+
}), h.subscribe((e, t) => {
|
|
83
|
+
o(n(e)), e.user?.id !== t.user?.id && f.getState().startIdentity();
|
|
83
84
|
});
|
|
84
85
|
//#endregion
|
|
85
|
-
export {
|
|
86
|
+
export { h as useAuthStore };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { sessionCaller as e } from "../api/audience.js";
|
|
2
|
+
import { useAuthStore as t } from "../stores/auth.js";
|
|
3
|
+
import { SCHEMA_QUERY_KEY as n, schemaAnswerFor as r } from "../hooks/useSchema.js";
|
|
3
4
|
//#region src/test/seed-schema.ts
|
|
4
5
|
function i(i, a) {
|
|
5
|
-
|
|
6
|
+
t.getState().isLoading && t.setState({ isLoading: !1 }), i.setQueryData(n, r(a, e(t.getState()) ?? null));
|
|
6
7
|
}
|
|
7
8
|
//#endregion
|
|
8
9
|
export { i as seedSchemaCache };
|
package/dist-lib/testing.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as Refs, M as ListMeta, P as ListResponse, d as ActionExecuteResponse, jt as TextFn, k as DataResponse, o as ResponsiveViewport, pt as Schema, st as LocalizedString, u as ActionExecuteRequest } from "./useResponsiveMode-
|
|
1
|
+
import { B as Refs, M as ListMeta, P as ListResponse, d as ActionExecuteResponse, jt as TextFn, k as DataResponse, o as ResponsiveViewport, pt as Schema, st as LocalizedString, u as ActionExecuteRequest } from "./useResponsiveMode-C4MeAgoS.js";
|
|
2
2
|
import { ReactElement, ReactNode } from "react";
|
|
3
3
|
import { QueryClient } from "@tanstack/react-query";
|
|
4
4
|
import { RenderResult } from "@testing-library/react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
//#region src/types/fieldType.ts
|
|
2
|
-
var e = /* @__PURE__ */ "bool.bytes.date.decimal.email.enum.file_ref.float.int.int_array.json.multilang.multilang_array.multilang_text.password.phone.ref.rich_text.secret.string.string_array.structure.tags.text.time.timestamp.url.uuid.uuid_array".split(".");
|
|
2
|
+
var e = /* @__PURE__ */ "bool.bytes.date.decimal.email.enum.file_ref.float.folder_ref.int.int_array.json.multilang.multilang_array.multilang_text.password.phone.ref.rich_text.secret.string.string_array.structure.tags.text.time.timestamp.url.uuid.uuid_array".split(".");
|
|
3
3
|
//#endregion
|
|
4
4
|
export { e as FIELD_TYPES };
|
|
@@ -117,7 +117,6 @@ interface UploadedFile extends FileAddress {
|
|
|
117
117
|
content_type: string;
|
|
118
118
|
size_bytes: number;
|
|
119
119
|
sha256: string;
|
|
120
|
-
dedup?: boolean;
|
|
121
120
|
width?: number;
|
|
122
121
|
height?: number;
|
|
123
122
|
metadata?: Record<string, unknown>;
|
|
@@ -268,6 +267,9 @@ interface EntityField {
|
|
|
268
267
|
file_ref?: {
|
|
269
268
|
storage_backend: string;
|
|
270
269
|
};
|
|
270
|
+
folder_ref?: {
|
|
271
|
+
storage_backend: string;
|
|
272
|
+
};
|
|
271
273
|
/**
|
|
272
274
|
* Populated by the schema hydrator from the enclosing map key. Tests and
|
|
273
275
|
* fixtures may omit it; production code always receives it set.
|