@burdenoff/fe-libs 2026.527.2 → 2026.527.3
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/button/Button.js +18 -16
- package/dist/chrome/AccountSwitcher.js +10 -7
- package/dist/chrome/AutoBreadcrumbs.js +2 -0
- package/dist/chrome/Breadcrumbs.js +2 -0
- package/dist/chrome/CommandPalette.js +5 -3
- package/dist/chrome/ContextSwitcher.js +12 -11
- package/dist/chrome/DynamicFooter.js +7 -7
- package/dist/chrome/Footer.js +5 -5
- package/dist/chrome/GeographySwitcher.js +3 -3
- package/dist/chrome/GlobalSearch.js +18 -9
- package/dist/chrome/HeaderBar.js +6 -1
- package/dist/chrome/LanguagePickerSheet.js +1 -1
- package/dist/chrome/LanguageSwitcher.js +2 -2
- package/dist/chrome/NotificationCenter.js +19 -10
- package/dist/chrome/PanelTabs.js +7 -4
- package/dist/chrome/PluginContextMenuTarget.js +1 -1
- package/dist/chrome/ProductPickerSheet.js +4 -4
- package/dist/chrome/ProductSideNav.js +1 -1
- package/dist/chrome/ProductSwitcher.js +3 -3
- package/dist/chrome/ProfileSwitcher.js +13 -8
- package/dist/chrome/ShortcutHelpDialog.js +2 -1
- package/dist/chrome/SideNavigation.js +7 -3
- package/dist/chrome/Sidebar.js +1 -0
- package/dist/form/Checkbox.js +17 -15
- package/dist/form/FormDescription.js +9 -10
- package/dist/form/FormField.js +11 -12
- package/dist/form/FormLabel.js +13 -13
- package/dist/form/FormMessage.js +10 -11
- package/dist/form/Input.js +11 -10
- package/dist/form/Radio.js +25 -21
- package/dist/form/Select.js +81 -66
- package/dist/form/Textarea.js +10 -9
- package/dist/shared/components/AccessDenied.js +8 -4
- package/dist/shared/components/AppErrorBoundary.js +2 -0
- package/dist/shared/components/ContextConversationWidget.js +15 -15
- package/dist/shared/components/ErrorFallback.js +3 -0
- package/dist/shared/components/PWAInstallBanner.js +8 -4
- package/dist/shared/components/RequireAuth.js +4 -4
- package/dist/shared/components/SSORedirectGuard.js +1 -1
- package/dist/shared/feature-flags/FeatureFlagProvider.js +21 -21
- package/dist/shared/geography/GeographyProvider.js +20 -20
- package/dist/shared/graphql/GatewayContext.js +1 -1
- package/dist/shared/motion/MotionList.js +1 -1
- package/dist/shared/pages/AiPage.js +3 -3
- package/dist/shared/pages/SearchPage.js +38 -33
- package/dist/shared/plugins/PluginRuntimeProvider.js +1 -1
- package/dist/shared/providers/shell/ActiveContextProvider.js +12 -12
- package/dist/shared/providers/shell/AppShellContext.js +1 -1
- package/dist/shared/providers/shell/AuthProvider.js +17 -17
- package/dist/shared/providers/shell/AuthTokenProvider.js +6 -6
- package/dist/shared/providers/shell/ContextManagerProvider.js +1 -1
- package/dist/shared/providers/shell/FeatureFlagsProvider.js +5 -5
- package/dist/shared/providers/shell/GlobalUiProvider.js +17 -17
- package/dist/shared/providers/shell/I18nProvider.js +15 -15
- package/dist/shared/providers/shell/PageConversationContextProvider.js +14 -14
- package/dist/shared/providers/shell/PermissionProvider.js +16 -16
- package/dist/shared/providers/shell/ShellUiProvider.js +13 -13
- package/dist/shared/providers/shell/ThemeProvider.js +9 -9
- package/dist/shared/tours/TourPlayer.js +1 -0
- package/dist/shared/tours/TourPlayerProvider.js +1 -1
- package/dist/shared/tours/TourTooltip.js +3 -0
- package/dist/shared/tours/TourTrigger.js +12 -9
- package/dist/shared/tours/ToursContext.js +11 -11
- package/dist/shared-events.js +3 -3
- package/dist/shared-hooks.js +1 -1
- package/dist/storage/SaveToFilesButton.js +3 -3
- package/dist/storage/SaveToFilesDialog.js +1 -1
- package/dist/tag/TagBadge.js +1 -1
- package/dist/tag/TagsWidget.js +6 -6
- package/dist/ui/card.js +44 -39
- package/dist/ui/dropdown-menu.js +82 -66
- package/dist/ui/input.js +10 -10
- package/dist/ui/label.js +13 -11
- package/dist/ui/select.js +80 -66
- package/dist/ui/table.js +61 -54
- package/dist/ui/textarea.js +9 -9
- package/dist/ui/tooltip.js +13 -11
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { PROFILE_STORAGE_CHANGE_EVENT as n, addProfile as r, getActiveProfileId
|
|
|
4
4
|
import { clearShellSsoCookies as g, isSharedSsoCookieDomain as re, isTrustedSsoOrigin as _, readShellSsoCookie as v, setShellSsoCookies as ie } from "../../utils/authCookie.js";
|
|
5
5
|
import { getAuthBridge as y, initAuthBridge as ae, isAuthBridgeInitialized as oe } from "./AuthBridgeClient.js";
|
|
6
6
|
import { checkRemoteSLO as se, checkSLO as ce, clearLocalAuthState as b, hasRecentSSORedirectAttempt as x, markSSORedirectAttempt as S, shouldSkipSSORedirect as C } from "../../components/SSORedirectGuard.js";
|
|
7
|
-
import { createContext as w,
|
|
7
|
+
import { createContext as w, use as T, useCallback as E, useEffect as D, useMemo as le, useRef as ue, useState as O } from "react";
|
|
8
8
|
import { jsx as de } from "react/jsx-runtime";
|
|
9
9
|
//#region src/shared/providers/shell/AuthProvider.tsx
|
|
10
10
|
var k = w(null);
|
|
@@ -79,7 +79,7 @@ function F(e) {
|
|
|
79
79
|
return null;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefreshToken: b, bridgeUrl: w, bridgeAllowedOrigins:
|
|
82
|
+
function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefreshToken: b, bridgeUrl: w, bridgeAllowedOrigins: T, bridgeDebug: j, onBridgeReady: M }) {
|
|
83
83
|
let P = ue(!1), [I, L] = O(() => u()), [R, z] = O(() => I ? o(I) : null), [B, V] = O(() => I ? a(I) : null), [H, U] = O(() => I ? s(I) : null), [W, G] = O(() => {
|
|
84
84
|
if (I && o(I)) return !1;
|
|
85
85
|
if (w) try {
|
|
@@ -94,7 +94,7 @@ function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefresh
|
|
|
94
94
|
avatar: e.avatar,
|
|
95
95
|
isActive: e.id === I,
|
|
96
96
|
lastLogin: e.lastLogin
|
|
97
|
-
}))), Y =
|
|
97
|
+
}))), Y = E(() => {
|
|
98
98
|
let e = i();
|
|
99
99
|
J(c().map((t) => ({
|
|
100
100
|
id: t.id,
|
|
@@ -160,7 +160,7 @@ function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefresh
|
|
|
160
160
|
}, 5e3);
|
|
161
161
|
return ae({
|
|
162
162
|
bridgeUrl: w,
|
|
163
|
-
allowedOrigins:
|
|
163
|
+
allowedOrigins: T,
|
|
164
164
|
onStateChanged: t,
|
|
165
165
|
debug: j ?? !1
|
|
166
166
|
}), () => {
|
|
@@ -168,12 +168,12 @@ function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefresh
|
|
|
168
168
|
};
|
|
169
169
|
}, [
|
|
170
170
|
w,
|
|
171
|
-
|
|
171
|
+
T,
|
|
172
172
|
j,
|
|
173
173
|
M,
|
|
174
174
|
Y
|
|
175
175
|
]);
|
|
176
|
-
let ge =
|
|
176
|
+
let ge = E((e, t, n) => {
|
|
177
177
|
let r = A(t) ?? Date.now() + 3600 * 1e3, i = {
|
|
178
178
|
accessToken: t,
|
|
179
179
|
refreshToken: n,
|
|
@@ -194,7 +194,7 @@ function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefresh
|
|
|
194
194
|
activeProfileId: a,
|
|
195
195
|
profiles: c()
|
|
196
196
|
});
|
|
197
|
-
}, [Y]), X =
|
|
197
|
+
}, [Y]), X = E(() => {
|
|
198
198
|
I && l(I);
|
|
199
199
|
let e = u();
|
|
200
200
|
e ? (L(e), z(o(e)), V(a(e)), U(s(e))) : (L(null), z(null), V(null), U(null)), K(!1), q(null), Y();
|
|
@@ -204,7 +204,7 @@ function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefresh
|
|
|
204
204
|
P.current || y()?.notifyLogout();
|
|
205
205
|
let t = N();
|
|
206
206
|
t && !P.current && window.location.replace(t);
|
|
207
|
-
}, [I, Y]), _e =
|
|
207
|
+
}, [I, Y]), _e = E((e) => {
|
|
208
208
|
if (!R || !I) return;
|
|
209
209
|
let t = {
|
|
210
210
|
...R,
|
|
@@ -221,7 +221,7 @@ function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefresh
|
|
|
221
221
|
R,
|
|
222
222
|
I,
|
|
223
223
|
Y
|
|
224
|
-
]), Z =
|
|
224
|
+
]), Z = E(async () => {
|
|
225
225
|
if (!(!B?.refreshToken || !b || !I)) {
|
|
226
226
|
G(!0);
|
|
227
227
|
try {
|
|
@@ -247,29 +247,29 @@ function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefresh
|
|
|
247
247
|
I,
|
|
248
248
|
X,
|
|
249
249
|
h
|
|
250
|
-
]), Q =
|
|
250
|
+
]), Q = E((e) => R?.permissions ? R.permissions.includes(e) || R.permissions.includes("*") : !1, [R]), ve = E((e) => {
|
|
251
251
|
U(e), I && m(I, e);
|
|
252
|
-
}, [I]), ye =
|
|
252
|
+
}, [I]), ye = E((e, t) => {
|
|
253
253
|
K(e), q(t ?? null);
|
|
254
|
-
}, []), be =
|
|
254
|
+
}, []), be = E((e) => {
|
|
255
255
|
if (!ne(e)) {
|
|
256
256
|
console.error(`Profile ${e} not found`);
|
|
257
257
|
return;
|
|
258
258
|
}
|
|
259
259
|
L(e), z(o(e)), V(a(e)), U(s(e)), K(!1), q(null), Y(), P.current || y()?.notifyAccountSwitch(e);
|
|
260
|
-
}, [Y]), xe =
|
|
260
|
+
}, [Y]), xe = E((e, t, n) => {
|
|
261
261
|
ee(e, {
|
|
262
262
|
accessToken: t,
|
|
263
263
|
refreshToken: n,
|
|
264
264
|
expiresAt: A(t) ?? Date.now() + 3600 * 1e3
|
|
265
265
|
}), I && d(I), Y();
|
|
266
|
-
}, [I, Y]), Se =
|
|
266
|
+
}, [I, Y]), Se = E((e) => {
|
|
267
267
|
if (e === I) {
|
|
268
268
|
console.error("Cannot remove active account — logout first");
|
|
269
269
|
return;
|
|
270
270
|
}
|
|
271
271
|
l(e), Y();
|
|
272
|
-
}, [I, Y]), Ce =
|
|
272
|
+
}, [I, Y]), Ce = E(() => {
|
|
273
273
|
te(), L(null), z(null), V(null), U(null), K(!1), q(null), J([]);
|
|
274
274
|
try {
|
|
275
275
|
g();
|
|
@@ -309,7 +309,7 @@ function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefresh
|
|
|
309
309
|
h,
|
|
310
310
|
_
|
|
311
311
|
]);
|
|
312
|
-
let we =
|
|
312
|
+
let we = E(() => {
|
|
313
313
|
let e = u();
|
|
314
314
|
if (!e) {
|
|
315
315
|
(R || B) && (z(null), V(null), U(null), L(null), J([]));
|
|
@@ -399,7 +399,7 @@ function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefresh
|
|
|
399
399
|
});
|
|
400
400
|
}
|
|
401
401
|
function L() {
|
|
402
|
-
let e =
|
|
402
|
+
let e = T(k);
|
|
403
403
|
if (!e) throw Error("useAuth must be used within an AuthProvider");
|
|
404
404
|
return e;
|
|
405
405
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getProfileWorkspaceToken as e, resolveActiveProfileId as t } from "./ProfileStorageManager.js";
|
|
2
2
|
import { readActiveContextValueWithUrlPrecedence as n } from "./ActiveContextStorage.js";
|
|
3
3
|
import { isWorkspaceTokenValidForContext as r } from "../../graphql/workspaceToken.js";
|
|
4
|
-
import { createContext as i,
|
|
4
|
+
import { createContext as i, use as a, useCallback as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
5
5
|
import { jsx as d } from "react/jsx-runtime";
|
|
6
6
|
//#region src/shared/providers/shell/AuthTokenProvider.tsx
|
|
7
7
|
var f = "bf-p", p = "bf-active-profile", m = i(null);
|
|
@@ -62,13 +62,13 @@ function b() {
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
function x({ children: e, debug: t = !1, onTokenChange: n, onWorkspaceChange: r }) {
|
|
65
|
-
let [i,
|
|
65
|
+
let [i, a] = u(b), h = l(i.accessToken), g = l(i.workspaceToken);
|
|
66
66
|
s(() => {
|
|
67
67
|
h.current = i.accessToken, g.current = i.workspaceToken;
|
|
68
68
|
}, [i.accessToken, i.workspaceToken]);
|
|
69
|
-
let _ =
|
|
69
|
+
let _ = o(() => {
|
|
70
70
|
let e = b();
|
|
71
|
-
|
|
71
|
+
a(e), t && console.log("[AuthTokenProvider] Reloaded from profile storage:", {
|
|
72
72
|
hasAccessToken: !!e.accessToken,
|
|
73
73
|
hasWorkspaceToken: !!e.workspaceToken,
|
|
74
74
|
userId: e.userId
|
|
@@ -93,7 +93,7 @@ function x({ children: e, debug: t = !1, onTokenChange: n, onWorkspaceChange: r
|
|
|
93
93
|
]), s(() => {
|
|
94
94
|
r?.(i.workspaceId);
|
|
95
95
|
}, [i.workspaceId, r]);
|
|
96
|
-
let v =
|
|
96
|
+
let v = o(() => h.current, []), y = o(() => g.current, []), x = o(() => g.current || h.current, []), S = c(() => ({
|
|
97
97
|
accessToken: i.accessToken,
|
|
98
98
|
workspaceToken: i.workspaceToken,
|
|
99
99
|
workspaceId: i.workspaceId,
|
|
@@ -117,7 +117,7 @@ function x({ children: e, debug: t = !1, onTokenChange: n, onWorkspaceChange: r
|
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
119
|
function S() {
|
|
120
|
-
let e =
|
|
120
|
+
let e = a(m);
|
|
121
121
|
if (!e) throw Error("useAuthToken must be used within AuthTokenProvider");
|
|
122
122
|
return e;
|
|
123
123
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useAuth as e } from "./AuthProvider.js";
|
|
2
2
|
import { useActiveContext as t } from "./ActiveContextProvider.js";
|
|
3
|
-
import { createContext as n,
|
|
3
|
+
import { createContext as n, use as r, useMemo as i } from "react";
|
|
4
4
|
import { jsx as a } from "react/jsx-runtime";
|
|
5
5
|
//#region src/shared/providers/shell/ContextManagerProvider.tsx
|
|
6
6
|
var o = n(null);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { createContext as e,
|
|
1
|
+
import { createContext as e, use as t, useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
|
|
2
2
|
import { jsx as o } from "react/jsx-runtime";
|
|
3
3
|
//#region src/shared/providers/shell/FeatureFlagsProvider.tsx
|
|
4
4
|
var s = e(null);
|
|
5
|
-
function c({ children: e, initialFlags:
|
|
6
|
-
let [u, d] = a(
|
|
5
|
+
function c({ children: e, initialFlags: t = {}, fetchFlags: c, refreshInterval: l }) {
|
|
6
|
+
let [u, d] = a(t), [f, p] = a(!1), m = n(async () => {
|
|
7
7
|
if (c) {
|
|
8
8
|
p(!0);
|
|
9
9
|
try {
|
|
@@ -14,7 +14,7 @@ function c({ children: e, initialFlags: n = {}, fetchFlags: c, refreshInterval:
|
|
|
14
14
|
p(!1);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
}, [c]), h =
|
|
17
|
+
}, [c]), h = n((e) => !!u[e], [u]), g = n((e, t) => {
|
|
18
18
|
let n = u[e];
|
|
19
19
|
return n === void 0 && t !== void 0 ? t : n;
|
|
20
20
|
}, [u]);
|
|
@@ -50,7 +50,7 @@ function c({ children: e, initialFlags: n = {}, fetchFlags: c, refreshInterval:
|
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
function l() {
|
|
53
|
-
let e =
|
|
53
|
+
let e = t(s);
|
|
54
54
|
if (!e) throw Error("useFeatureFlags must be used within a FeatureFlagsProvider");
|
|
55
55
|
return e;
|
|
56
56
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { createContext as e,
|
|
1
|
+
import { createContext as e, use as t, useCallback as n, useMemo as r, useState as i } from "react";
|
|
2
2
|
import { jsx as a } from "react/jsx-runtime";
|
|
3
3
|
//#region src/shared/providers/shell/GlobalUiProvider.tsx
|
|
4
4
|
var o = e(null);
|
|
5
|
-
function s({ children: e, maxToasts:
|
|
6
|
-
let [c, l] = i([]), [u, d] = i([]), [f, p] = i(!1), [m, h] = i(!1), g =
|
|
5
|
+
function s({ children: e, maxToasts: t = 5, defaultToastDuration: s = 5e3 }) {
|
|
6
|
+
let [c, l] = i([]), [u, d] = i([]), [f, p] = i(!1), [m, h] = i(!1), g = n((e, n = "info", r = s) => {
|
|
7
7
|
let i = `toast-${Date.now()}-${Math.random()}`, a = {
|
|
8
8
|
id: i,
|
|
9
|
-
type:
|
|
9
|
+
type: n,
|
|
10
10
|
message: e,
|
|
11
11
|
duration: r
|
|
12
12
|
};
|
|
13
|
-
l((e) => [...e, a].slice(-
|
|
13
|
+
l((e) => [...e, a].slice(-t)), r > 0 && setTimeout(() => {
|
|
14
14
|
l((e) => e.filter((e) => e.id !== i));
|
|
15
15
|
}, r);
|
|
16
|
-
}, [
|
|
16
|
+
}, [t, s]), _ = n((e) => {
|
|
17
17
|
l((t) => t.filter((t) => t.id !== e));
|
|
18
|
-
}, []), v =
|
|
18
|
+
}, []), v = n((e) => {
|
|
19
19
|
let t = {
|
|
20
20
|
...e,
|
|
21
21
|
id: `notification-${Date.now()}-${Math.random()}`,
|
|
@@ -23,29 +23,29 @@ function s({ children: e, maxToasts: n = 5, defaultToastDuration: s = 5e3 }) {
|
|
|
23
23
|
read: !1
|
|
24
24
|
};
|
|
25
25
|
d((e) => [t, ...e]);
|
|
26
|
-
}, []), y =
|
|
26
|
+
}, []), y = n((e) => {
|
|
27
27
|
d((t) => t.map((t) => t.id === e ? {
|
|
28
28
|
...t,
|
|
29
29
|
read: !0
|
|
30
30
|
} : t));
|
|
31
|
-
}, []), b =
|
|
31
|
+
}, []), b = n(() => {
|
|
32
32
|
d((e) => e.map((e) => ({
|
|
33
33
|
...e,
|
|
34
34
|
read: !0
|
|
35
35
|
})));
|
|
36
|
-
}, []), x =
|
|
36
|
+
}, []), x = n(() => {
|
|
37
37
|
d([]);
|
|
38
|
-
}, []), S =
|
|
38
|
+
}, []), S = n(() => {
|
|
39
39
|
p(!0);
|
|
40
|
-
}, []), C =
|
|
40
|
+
}, []), C = n(() => {
|
|
41
41
|
p(!1);
|
|
42
|
-
}, []), w =
|
|
42
|
+
}, []), w = n(() => {
|
|
43
43
|
p((e) => !e);
|
|
44
|
-
}, []), T =
|
|
44
|
+
}, []), T = n(() => {
|
|
45
45
|
h(!0);
|
|
46
|
-
}, []), E =
|
|
46
|
+
}, []), E = n(() => {
|
|
47
47
|
h(!1);
|
|
48
|
-
}, []), D =
|
|
48
|
+
}, []), D = n(() => {
|
|
49
49
|
h((e) => !e);
|
|
50
50
|
}, []), O = r(() => u.filter((e) => !e.read).length, [u]), k = r(() => ({
|
|
51
51
|
toasts: c,
|
|
@@ -91,7 +91,7 @@ function s({ children: e, maxToasts: n = 5, defaultToastDuration: s = 5e3 }) {
|
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
function c() {
|
|
94
|
-
let e =
|
|
94
|
+
let e = t(o);
|
|
95
95
|
if (!e) throw Error("useGlobalUi must be used within a GlobalUiProvider");
|
|
96
96
|
return e;
|
|
97
97
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createContext as e,
|
|
1
|
+
import { createContext as e, use as t, useCallback as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
|
|
2
2
|
import { Fragment as s, jsx as c } from "react/jsx-runtime";
|
|
3
3
|
//#region src/shared/providers/shell/I18nProvider.tsx
|
|
4
4
|
var l = e(null), u = {
|
|
@@ -51,15 +51,15 @@ function h(e, t) {
|
|
|
51
51
|
}
|
|
52
52
|
return n;
|
|
53
53
|
}
|
|
54
|
-
function g({ children: e, defaultLocale:
|
|
55
|
-
let [x, S] = o(() => f(_, g,
|
|
54
|
+
function g({ children: e, defaultLocale: t = "en", translations: m = u, storageKey: g = "burdenoff-locale", profileId: _, fetchTranslations: v, showChildrenWhileLoading: y = !0, loadingComponent: b }) {
|
|
55
|
+
let [x, S] = o(() => f(_, g, t)), [C, w] = o({}), [T, E] = o(!!v), [D, O] = o(null), k = a(/* @__PURE__ */ new Set()), A = a(d.version), j = i(() => {
|
|
56
56
|
let e = { ...m };
|
|
57
57
|
for (let [t, n] of Object.entries(C)) if (n && Object.keys(n).length > 0) {
|
|
58
58
|
let r = t;
|
|
59
59
|
e[r] = h(m[r], n);
|
|
60
60
|
}
|
|
61
61
|
return e;
|
|
62
|
-
}, [m, C]), M =
|
|
62
|
+
}, [m, C]), M = n(async (e) => {
|
|
63
63
|
if (v) {
|
|
64
64
|
if (A.current !== d.version && (k.current.clear(), A.current = d.version), d.attempted.has(e)) {
|
|
65
65
|
let t = d.translations[e];
|
|
@@ -92,28 +92,28 @@ function g({ children: e, defaultLocale: n = "en", translations: m = u, storageK
|
|
|
92
92
|
x,
|
|
93
93
|
M
|
|
94
94
|
]), r(() => {
|
|
95
|
-
let e = f(_, g,
|
|
95
|
+
let e = f(_, g, t);
|
|
96
96
|
S(e), document.documentElement.setAttribute("lang", e);
|
|
97
97
|
}, [
|
|
98
98
|
_,
|
|
99
99
|
g,
|
|
100
|
-
|
|
100
|
+
t
|
|
101
101
|
]);
|
|
102
|
-
let N =
|
|
102
|
+
let N = n((e) => {
|
|
103
103
|
S(e), localStorage.setItem(g, e), _ && localStorage.setItem(`bf-p-${_}-locale`, e), document.documentElement.setAttribute("lang", e);
|
|
104
|
-
}, [g, _]), P =
|
|
104
|
+
}, [g, _]), P = n((e, n, r) => {
|
|
105
105
|
let i, a;
|
|
106
|
-
if (typeof
|
|
107
|
-
else if (
|
|
108
|
-
let { defaultValue: e, ...
|
|
109
|
-
typeof e == "string" ? i = e : typeof e == "number" && (i = String(e)), a =
|
|
106
|
+
if (typeof n == "string") i = n, a = r;
|
|
107
|
+
else if (n && typeof n == "object") {
|
|
108
|
+
let { defaultValue: e, ...t } = n;
|
|
109
|
+
typeof e == "string" ? i = e : typeof e == "number" && (i = String(e)), a = t;
|
|
110
110
|
}
|
|
111
|
-
let o = p(j[x], e) ?? (x ===
|
|
111
|
+
let o = p(j[x], e) ?? (x === t ? void 0 : p(j[t], e)) ?? (t === "en" ? void 0 : p(j.en, e)) ?? i ?? e;
|
|
112
112
|
return a ? Object.entries(a).reduce((e, [t, n]) => e.replace(`{{${t}}}`, String(n)), o) : o;
|
|
113
113
|
}, [
|
|
114
114
|
x,
|
|
115
115
|
j,
|
|
116
|
-
|
|
116
|
+
t
|
|
117
117
|
]), F = i(() => ({
|
|
118
118
|
locale: x,
|
|
119
119
|
translations: j[x] || {},
|
|
@@ -135,7 +135,7 @@ function g({ children: e, defaultLocale: n = "en", translations: m = u, storageK
|
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
function _() {
|
|
138
|
-
let e =
|
|
138
|
+
let e = t(l);
|
|
139
139
|
if (!e) throw Error("useI18n must be used within an I18nProvider");
|
|
140
140
|
return e;
|
|
141
141
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createContext as e,
|
|
1
|
+
import { createContext as e, use as t, useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
|
|
2
2
|
import { jsx as o } from "react/jsx-runtime";
|
|
3
3
|
import { useLocation as s } from "react-router-dom";
|
|
4
4
|
//#region src/shared/providers/shell/PageConversationContextProvider.tsx
|
|
@@ -7,7 +7,7 @@ function l(e) {
|
|
|
7
7
|
let t = e.split("/").filter(Boolean).map((e) => e.replace(/[-_]+/g, " "));
|
|
8
8
|
return t.length === 0 ? "Home" : t.map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" · ");
|
|
9
9
|
}
|
|
10
|
-
function u({ children: e, product:
|
|
10
|
+
function u({ children: e, product: t, resolveContext: u }) {
|
|
11
11
|
let d = s(), [f, p] = a(null);
|
|
12
12
|
r(() => {
|
|
13
13
|
p(null);
|
|
@@ -17,11 +17,11 @@ function u({ children: e, product: n, resolveContext: u }) {
|
|
|
17
17
|
d.hash
|
|
18
18
|
]);
|
|
19
19
|
let m = i(() => {
|
|
20
|
-
let e = typeof document < "u" && document.title.trim().length > 0 ? document.title : l(d.pathname),
|
|
20
|
+
let e = typeof document < "u" && document.title.trim().length > 0 ? document.title : l(d.pathname), n = typeof window < "u" ? `${window.location.origin}${d.pathname}${d.search}${d.hash}` : `${d.pathname}${d.search}${d.hash}`, r = u?.(d) ?? null;
|
|
21
21
|
return {
|
|
22
|
-
product:
|
|
22
|
+
product: t,
|
|
23
23
|
pagePath: `${d.pathname}${d.search}${d.hash}`,
|
|
24
|
-
contextHref:
|
|
24
|
+
contextHref: n,
|
|
25
25
|
contextTitle: e,
|
|
26
26
|
widgetKey: "default",
|
|
27
27
|
...r ?? {},
|
|
@@ -29,7 +29,7 @@ function u({ children: e, product: n, resolveContext: u }) {
|
|
|
29
29
|
};
|
|
30
30
|
}, [
|
|
31
31
|
d,
|
|
32
|
-
|
|
32
|
+
t,
|
|
33
33
|
u
|
|
34
34
|
]), h = i(() => ({
|
|
35
35
|
...m,
|
|
@@ -38,9 +38,9 @@ function u({ children: e, product: n, resolveContext: u }) {
|
|
|
38
38
|
...m.metadata ?? {},
|
|
39
39
|
...f?.metadata ?? {}
|
|
40
40
|
}
|
|
41
|
-
}), [m, f]), g =
|
|
41
|
+
}), [m, f]), g = n((e) => {
|
|
42
42
|
p(e);
|
|
43
|
-
}, []), _ =
|
|
43
|
+
}, []), _ = n(() => {
|
|
44
44
|
p(null);
|
|
45
45
|
}, []);
|
|
46
46
|
return /* @__PURE__ */ o(c.Provider, {
|
|
@@ -53,16 +53,16 @@ function u({ children: e, product: n, resolveContext: u }) {
|
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
function d() {
|
|
56
|
-
let e =
|
|
56
|
+
let e = t(c);
|
|
57
57
|
if (!e) throw Error("usePageConversationContext must be used within PageConversationContextProvider");
|
|
58
58
|
return e.context;
|
|
59
59
|
}
|
|
60
60
|
function f(e) {
|
|
61
|
-
let
|
|
62
|
-
if (!
|
|
63
|
-
r(() => (
|
|
64
|
-
|
|
65
|
-
}), [
|
|
61
|
+
let n = t(c);
|
|
62
|
+
if (!n) throw Error("useRegisterPageConversationContext must be used within PageConversationContextProvider");
|
|
63
|
+
r(() => (n.setOverride(e ?? null), () => {
|
|
64
|
+
n.clearOverride();
|
|
65
|
+
}), [n, e]);
|
|
66
66
|
}
|
|
67
67
|
//#endregion
|
|
68
68
|
export { u as PageConversationContextProvider, d as usePageConversationContext, f as useRegisterPageConversationContext };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { graphqlFetch as e } from "../../graphql/fetch.js";
|
|
2
2
|
import { useAuth as t } from "./AuthProvider.js";
|
|
3
|
-
import { createContext as n,
|
|
3
|
+
import { createContext as n, use as r, useCallback as i, useEffect as a, useMemo as o } from "react";
|
|
4
4
|
import { jsx as s } from "react/jsx-runtime";
|
|
5
5
|
import { useQuery as c, useQueryClient as l } from "@tanstack/react-query";
|
|
6
6
|
//#region src/shared/providers/shell/PermissionProvider.tsx
|
|
@@ -41,22 +41,22 @@ function g(e) {
|
|
|
41
41
|
let t = e;
|
|
42
42
|
return typeof t.actorType == "string" ? t.actorType : typeof t.actor_type == "string" ? t.actor_type : null;
|
|
43
43
|
}
|
|
44
|
-
function _({ children: n, scopeId:
|
|
44
|
+
function _({ children: n, scopeId: r, gateway: p = "workspace", staleTime: _ = 300 * 1e3, refetchInterval: v = 300 * 1e3, refetchOnFocusStaleTime: y = 120 * 1e3, debug: b = !1 }) {
|
|
45
45
|
let { isAuthenticated: x, tokens: S, workspaceToken: C, user: w } = t(), T = l(), E = h(x, w?.role, g(w)), D = p === "workspace" ? C ? C.slice(-16) : "missing" : "n/a", O = o(() => [
|
|
46
46
|
"permissions",
|
|
47
47
|
p,
|
|
48
|
-
|
|
48
|
+
r,
|
|
49
49
|
D
|
|
50
50
|
], [
|
|
51
51
|
p,
|
|
52
|
-
|
|
52
|
+
r,
|
|
53
53
|
D
|
|
54
|
-
]), k =
|
|
55
|
-
if (!
|
|
56
|
-
b && console.log("[PermissionProvider] Fetching permissions for scope:",
|
|
54
|
+
]), k = i(async () => {
|
|
55
|
+
if (!r) throw Error("scopeId is required for permission fetching");
|
|
56
|
+
b && console.log("[PermissionProvider] Fetching permissions for scope:", r);
|
|
57
57
|
let t = await e({
|
|
58
58
|
query: d,
|
|
59
|
-
variables: { scopeId:
|
|
59
|
+
variables: { scopeId: r },
|
|
60
60
|
gateway: p
|
|
61
61
|
});
|
|
62
62
|
if (t.errors?.length) throw Error(t.errors[0].message);
|
|
@@ -64,10 +64,10 @@ function _({ children: n, scopeId: i, gateway: p = "workspace", staleTime: _ = 3
|
|
|
64
64
|
let n = f(t.data.myPermissions);
|
|
65
65
|
return b && console.log("[PermissionProvider] Received permissions:", n), n;
|
|
66
66
|
}, [
|
|
67
|
-
|
|
67
|
+
r,
|
|
68
68
|
p,
|
|
69
69
|
b
|
|
70
|
-
]), A = !E && x && !!
|
|
70
|
+
]), A = !E && x && !!r && !!S?.accessToken, j = c({
|
|
71
71
|
queryKey: O,
|
|
72
72
|
queryFn: k,
|
|
73
73
|
enabled: A,
|
|
@@ -98,12 +98,12 @@ function _({ children: n, scopeId: i, gateway: p = "workspace", staleTime: _ = 3
|
|
|
98
98
|
A,
|
|
99
99
|
F
|
|
100
100
|
]);
|
|
101
|
-
let I = A ? M ?? null : null, L =
|
|
101
|
+
let I = A ? M ?? null : null, L = i((e) => E ? !0 : I?.permissionStrings ? m(I.permissionStrings, e) : !1, [I?.permissionStrings, E]), R = i((e, t) => {
|
|
102
102
|
if (E) return !0;
|
|
103
103
|
if (!I?.permissionStrings) return !1;
|
|
104
104
|
let { requireAll: n = !1 } = t ?? {};
|
|
105
105
|
return n ? e.every((e) => m(I.permissionStrings, e)) : e.some((e) => m(I.permissionStrings, e));
|
|
106
|
-
}, [I?.permissionStrings, E]), z =
|
|
106
|
+
}, [I?.permissionStrings, E]), z = i((e) => E ? !0 : I?.roles ? I.roles.includes(e) : !1, [I?.roles, E]), B = i((e) => E ? !0 : I?.roles ? e.some((e) => I.roles.includes(e)) : !1, [I?.roles, E]), V = i((e) => E ? !0 : I?.roles ? e.every((e) => I.roles.includes(e)) : !1, [I?.roles, E]), H = i(async () => {
|
|
107
107
|
if (!A) {
|
|
108
108
|
b && console.log("[PermissionProvider] Skipping manual refresh — workspace token not available");
|
|
109
109
|
return;
|
|
@@ -113,7 +113,7 @@ function _({ children: n, scopeId: i, gateway: p = "workspace", staleTime: _ = 3
|
|
|
113
113
|
F,
|
|
114
114
|
b,
|
|
115
115
|
A
|
|
116
|
-
]), U =
|
|
116
|
+
]), U = i(async () => {
|
|
117
117
|
b && console.log("[PermissionProvider] Invalidating permissions cache"), await T.invalidateQueries({ queryKey: O });
|
|
118
118
|
}, [
|
|
119
119
|
T,
|
|
@@ -130,7 +130,7 @@ function _({ children: n, scopeId: i, gateway: p = "workspace", staleTime: _ = 3
|
|
|
130
130
|
hasAllRoles: V,
|
|
131
131
|
refreshPermissions: H,
|
|
132
132
|
invalidatePermissions: U,
|
|
133
|
-
scopeId:
|
|
133
|
+
scopeId: r,
|
|
134
134
|
query: j
|
|
135
135
|
}), [
|
|
136
136
|
I,
|
|
@@ -145,7 +145,7 @@ function _({ children: n, scopeId: i, gateway: p = "workspace", staleTime: _ = 3
|
|
|
145
145
|
V,
|
|
146
146
|
H,
|
|
147
147
|
U,
|
|
148
|
-
|
|
148
|
+
r
|
|
149
149
|
]);
|
|
150
150
|
return /* @__PURE__ */ s(u.Provider, {
|
|
151
151
|
value: W,
|
|
@@ -153,7 +153,7 @@ function _({ children: n, scopeId: i, gateway: p = "workspace", staleTime: _ = 3
|
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
155
|
function v() {
|
|
156
|
-
let e =
|
|
156
|
+
let e = r(u);
|
|
157
157
|
if (!e) throw Error("usePermissions must be used within a PermissionProvider");
|
|
158
158
|
return e;
|
|
159
159
|
}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { createContext as e,
|
|
1
|
+
import { createContext as e, use as t, useCallback as n, useMemo as r, useState as i } from "react";
|
|
2
2
|
import { jsx as a } from "react/jsx-runtime";
|
|
3
3
|
//#region src/shared/providers/shell/ShellUiProvider.tsx
|
|
4
4
|
var o = e(null);
|
|
5
|
-
function s({ children: e, defaultSidebarCollapsed:
|
|
5
|
+
function s({ children: e, defaultSidebarCollapsed: t = !1, defaultSidebarOpen: s = !0, defaultHeaderVisible: c = !0, defaultFooterVisible: l = !0, defaultSidebarVisible: u = !0, storageKey: d = "burdenoff-shell-ui" }) {
|
|
6
6
|
let [f, p] = i(() => {
|
|
7
|
-
if (typeof window > "u") return
|
|
7
|
+
if (typeof window > "u") return t;
|
|
8
8
|
let e = localStorage.getItem(`${d}-sidebar-collapsed`);
|
|
9
|
-
return e ? e === "true" :
|
|
9
|
+
return e ? e === "true" : t;
|
|
10
10
|
}), [m, h] = i(() => {
|
|
11
11
|
if (typeof window > "u") return s;
|
|
12
12
|
let e = localStorage.getItem(`${d}-sidebar-open`);
|
|
13
13
|
return e ? e === "true" : s;
|
|
14
|
-
}), [g, _] = i(c), [v, y] = i(l), [b, x] = i(u), [S, C] = i([]), [w, T] = i(!1), E =
|
|
14
|
+
}), [g, _] = i(c), [v, y] = i(l), [b, x] = i(u), [S, C] = i([]), [w, T] = i(!1), E = n((e) => {
|
|
15
15
|
p(e), localStorage.setItem(`${d}-sidebar-collapsed`, String(e));
|
|
16
|
-
}, [d]), D =
|
|
16
|
+
}, [d]), D = n(() => {
|
|
17
17
|
p((e) => {
|
|
18
18
|
let t = !e;
|
|
19
19
|
return localStorage.setItem(`${d}-sidebar-collapsed`, String(t)), t;
|
|
20
20
|
});
|
|
21
|
-
}, [d]), O =
|
|
21
|
+
}, [d]), O = n((e) => {
|
|
22
22
|
h(e), localStorage.setItem(`${d}-sidebar-open`, String(e));
|
|
23
|
-
}, [d]), k =
|
|
23
|
+
}, [d]), k = n(() => {
|
|
24
24
|
h((e) => {
|
|
25
25
|
let t = !e;
|
|
26
26
|
return localStorage.setItem(`${d}-sidebar-open`, String(t)), t;
|
|
27
27
|
});
|
|
28
|
-
}, [d]), A =
|
|
28
|
+
}, [d]), A = n((e) => {
|
|
29
29
|
C(e);
|
|
30
|
-
}, []), j =
|
|
30
|
+
}, []), j = n((e) => {
|
|
31
31
|
C((t) => [...t, e]);
|
|
32
|
-
}, []), M =
|
|
32
|
+
}, []), M = n(() => {
|
|
33
33
|
C([]);
|
|
34
34
|
}, []), N = r(() => ({
|
|
35
35
|
isSidebarCollapsed: f,
|
|
@@ -78,12 +78,12 @@ function s({ children: e, defaultSidebarCollapsed: n = !1, defaultSidebarOpen: s
|
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
function c() {
|
|
81
|
-
let e =
|
|
81
|
+
let e = t(o);
|
|
82
82
|
if (!e) throw Error("useShellUi must be used within a ShellUiProvider");
|
|
83
83
|
return e;
|
|
84
84
|
}
|
|
85
85
|
function l() {
|
|
86
|
-
return
|
|
86
|
+
return t(o);
|
|
87
87
|
}
|
|
88
88
|
//#endregion
|
|
89
89
|
export { s as ShellUiProvider, l as useSafeShellUi, c as useShellUi };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { createContext as e,
|
|
1
|
+
import { createContext as e, use as t, useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
|
|
2
2
|
import { jsx as o } from "react/jsx-runtime";
|
|
3
3
|
//#region src/shared/providers/shell/ThemeProvider.tsx
|
|
4
4
|
var s = e(null);
|
|
5
|
-
function c({ children: e, defaultMode:
|
|
6
|
-
let [f, p] = a(() => typeof window > "u" ?
|
|
5
|
+
function c({ children: e, defaultMode: t = "system", defaultBrand: c = "default", defaultDensity: l = "comfortable", defaultTypography: u = "default", storageKey: d = "burdenoff-theme" }) {
|
|
6
|
+
let [f, p] = a(() => typeof window > "u" ? t : localStorage.getItem(`${d}-mode`) || t), [m, h] = a(() => typeof window > "u" ? c : localStorage.getItem(`${d}-brand`) || c), [g, _] = a(() => typeof window > "u" ? l : localStorage.getItem(`${d}-density`) || l), [v, y] = a(() => typeof window > "u" ? u : localStorage.getItem(`${d}-typography`) || u), [b, x] = a(() => f === "system" ? typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : f);
|
|
7
7
|
r(() => {
|
|
8
8
|
if (f === "system") {
|
|
9
9
|
let e = window.matchMedia("(prefers-color-scheme: dark)"), t = (e) => {
|
|
@@ -20,15 +20,15 @@ function c({ children: e, defaultMode: n = "system", defaultBrand: c = "default"
|
|
|
20
20
|
g,
|
|
21
21
|
v
|
|
22
22
|
]);
|
|
23
|
-
let S =
|
|
23
|
+
let S = n((e) => {
|
|
24
24
|
p(e), localStorage.setItem(`${d}-mode`, e);
|
|
25
|
-
}, [d]), C =
|
|
25
|
+
}, [d]), C = n((e) => {
|
|
26
26
|
h(e), localStorage.setItem(`${d}-brand`, e);
|
|
27
|
-
}, [d]), w =
|
|
27
|
+
}, [d]), w = n((e) => {
|
|
28
28
|
_(e), localStorage.setItem(`${d}-density`, e);
|
|
29
|
-
}, [d]), T =
|
|
29
|
+
}, [d]), T = n((e) => {
|
|
30
30
|
y(e), localStorage.setItem(`${d}-typography`, e);
|
|
31
|
-
}, [d]), E =
|
|
31
|
+
}, [d]), E = n(() => {
|
|
32
32
|
S(b === "light" ? "dark" : "light");
|
|
33
33
|
}, [b, S]), D = i(() => ({
|
|
34
34
|
mode: f,
|
|
@@ -60,7 +60,7 @@ function c({ children: e, defaultMode: n = "system", defaultBrand: c = "default"
|
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
function l() {
|
|
63
|
-
let e =
|
|
63
|
+
let e = t(s);
|
|
64
64
|
if (!e) throw Error("useTheme must be used within a ThemeProvider");
|
|
65
65
|
return e;
|
|
66
66
|
}
|