@burdenoff/fe-libs 2026.527.2 → 2026.527.4

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.
Files changed (161) hide show
  1. package/dist/button/Button.js +18 -16
  2. package/dist/chrome/AccountSwitcher.js +10 -7
  3. package/dist/chrome/AutoBreadcrumbs.js +2 -0
  4. package/dist/chrome/Breadcrumbs.js +2 -0
  5. package/dist/chrome/CommandPalette.js +5 -3
  6. package/dist/chrome/ContextSwitcher.js +90 -338
  7. package/dist/chrome/DynamicFooter.js +7 -7
  8. package/dist/chrome/Footer.js +5 -5
  9. package/dist/chrome/GeographySwitcher.js +3 -3
  10. package/dist/chrome/GlobalSearch.js +73 -448
  11. package/dist/chrome/HeaderBar.js +6 -1
  12. package/dist/chrome/LanguagePickerSheet.js +1 -1
  13. package/dist/chrome/LanguageSwitcher.js +2 -2
  14. package/dist/chrome/NotificationCenter.js +69 -694
  15. package/dist/chrome/PanelTabs.js +7 -4
  16. package/dist/chrome/PluginContextMenuTarget.js +1 -1
  17. package/dist/chrome/ProductPickerSheet.js +4 -4
  18. package/dist/chrome/ProductSideNav.js +1 -1
  19. package/dist/chrome/ProductSwitcher.js +3 -3
  20. package/dist/chrome/ProfileSwitcher.js +13 -8
  21. package/dist/chrome/ShortcutHelpDialog.js +2 -1
  22. package/dist/chrome/SideNavigation.js +75 -239
  23. package/dist/chrome/Sidebar.js +1 -0
  24. package/dist/chrome/contextSwitcher/EmptyState.js +32 -0
  25. package/dist/chrome/contextSwitcher/OrganizationList.js +34 -0
  26. package/dist/chrome/contextSwitcher/ProjectList.js +34 -0
  27. package/dist/chrome/contextSwitcher/SearchInput.js +50 -0
  28. package/dist/chrome/contextSwitcher/TabButton.js +9 -0
  29. package/dist/chrome/contextSwitcher/TriggerButton.js +38 -0
  30. package/dist/chrome/contextSwitcher/WorkspaceList.js +34 -0
  31. package/dist/chrome/contextSwitcher/icons.js +58 -0
  32. package/dist/chrome/contextSwitcher/useIsMobile.js +11 -0
  33. package/dist/chrome/globalSearch/AdvancedFiltersPanel.js +253 -0
  34. package/dist/chrome/globalSearch/CategoryTabs.js +28 -0
  35. package/dist/chrome/globalSearch/ResultsList.js +58 -0
  36. package/dist/chrome/globalSearch/SearchInput.js +28 -0
  37. package/dist/chrome/globalSearch/SearchModeBar.js +36 -0
  38. package/dist/chrome/globalSearch/useAdvancedFilters.js +78 -0
  39. package/dist/chrome/globalSearch/utils.js +22 -0
  40. package/dist/chrome/notificationCenter/BellButton.js +27 -0
  41. package/dist/chrome/notificationCenter/NotificationCardItem.js +129 -0
  42. package/dist/chrome/notificationCenter/NotificationFilters.js +67 -0
  43. package/dist/chrome/notificationCenter/NotificationFooter.js +23 -0
  44. package/dist/chrome/notificationCenter/NotificationHeader.js +75 -0
  45. package/dist/chrome/notificationCenter/NotificationList.js +75 -0
  46. package/dist/chrome/notificationCenter/NotificationPanel.js +19 -0
  47. package/dist/chrome/notificationCenter/SkeletonCard.js +18 -0
  48. package/dist/chrome/notificationCenter/constants.js +93 -0
  49. package/dist/chrome/notificationCenter/gql.js +58 -0
  50. package/dist/chrome/notificationCenter/useNotificationCenter.js +149 -0
  51. package/dist/chrome/notificationCenter/usePanelChrome.js +36 -0
  52. package/dist/chrome/sideNavigation/CollapseToggle.js +29 -0
  53. package/dist/chrome/sideNavigation/MobileActionsBar.js +25 -0
  54. package/dist/chrome/sideNavigation/NavItemRenderer.js +79 -0
  55. package/dist/chrome/sideNavigation/SidebarHeader.js +29 -0
  56. package/dist/chrome/sideNavigation/helpers.js +19 -0
  57. package/dist/chrome/sideNavigation/useSideNavigationState.js +45 -0
  58. package/dist/form/Checkbox.js +17 -15
  59. package/dist/form/FormDescription.js +9 -10
  60. package/dist/form/FormField.js +11 -12
  61. package/dist/form/FormLabel.js +13 -13
  62. package/dist/form/FormMessage.js +10 -11
  63. package/dist/form/Input.js +11 -10
  64. package/dist/form/Radio.js +25 -21
  65. package/dist/form/Select.js +81 -66
  66. package/dist/form/Textarea.js +10 -9
  67. package/dist/shared/components/AccessDenied.js +8 -4
  68. package/dist/shared/components/AppErrorBoundary.js +2 -0
  69. package/dist/shared/components/ContextConversationWidget.js +173 -767
  70. package/dist/shared/components/ErrorFallback.js +3 -0
  71. package/dist/shared/components/PWAInstallBanner.js +8 -4
  72. package/dist/shared/components/RequireAuth.js +4 -4
  73. package/dist/shared/components/SSORedirectGuard.js +1 -1
  74. package/dist/shared/components/contextConversationWidget/Composer.js +66 -0
  75. package/dist/shared/components/contextConversationWidget/MessageItem.js +124 -0
  76. package/dist/shared/components/contextConversationWidget/MessageList.js +32 -0
  77. package/dist/shared/components/contextConversationWidget/NoWorkspaceCard.js +19 -0
  78. package/dist/shared/components/contextConversationWidget/PendingAttachmentsBar.js +28 -0
  79. package/dist/shared/components/contextConversationWidget/ReplyBanner.js +32 -0
  80. package/dist/shared/components/contextConversationWidget/WidgetHeader.js +70 -0
  81. package/dist/shared/components/contextConversationWidget/queries.js +197 -0
  82. package/dist/shared/components/contextConversationWidget/types.js +10 -0
  83. package/dist/shared/components/contextConversationWidget/useAttachmentUpload.js +57 -0
  84. package/dist/shared/components/contextConversationWidget/useConversationSubscriptions.js +26 -0
  85. package/dist/shared/components/contextConversationWidget/useMessageActions.js +34 -0
  86. package/dist/shared/components/contextConversationWidget/useSendMessage.js +45 -0
  87. package/dist/shared/components/contextConversationWidget/useWidgetMessages.js +44 -0
  88. package/dist/shared/components/contextConversationWidget/utils.js +56 -0
  89. package/dist/shared/feature-flags/FeatureFlagProvider.js +21 -21
  90. package/dist/shared/geography/GeographyProvider.js +20 -20
  91. package/dist/shared/graphql/GatewayContext.js +1 -1
  92. package/dist/shared/motion/MotionList.js +1 -1
  93. package/dist/shared/pages/AiPage.js +3 -3
  94. package/dist/shared/pages/SearchPage.js +293 -1071
  95. package/dist/shared/pages/searchPage/ActiveFilterChips.js +176 -0
  96. package/dist/shared/pages/searchPage/FiltersPanel.js +329 -0
  97. package/dist/shared/pages/searchPage/ResultsList.js +119 -0
  98. package/dist/shared/pages/searchPage/ResultsStatus.js +32 -0
  99. package/dist/shared/pages/searchPage/SearchInput.js +31 -0
  100. package/dist/shared/pages/searchPage/SearchPagination.js +37 -0
  101. package/dist/shared/pages/searchPage/SearchToolbar.js +58 -0
  102. package/dist/shared/pages/searchPage/constants.js +155 -0
  103. package/dist/shared/pages/searchPage/utils.js +24 -0
  104. package/dist/shared/plugins/PluginRuntimeProvider.js +1 -1
  105. package/dist/shared/providers/shell/ActiveContextProvider.js +12 -12
  106. package/dist/shared/providers/shell/AppShellContext.js +1 -1
  107. package/dist/shared/providers/shell/AuthProvider.js +130 -384
  108. package/dist/shared/providers/shell/AuthTokenProvider.js +6 -6
  109. package/dist/shared/providers/shell/ContextManagerProvider.js +1 -1
  110. package/dist/shared/providers/shell/FeatureFlagsProvider.js +5 -5
  111. package/dist/shared/providers/shell/GlobalUiProvider.js +17 -17
  112. package/dist/shared/providers/shell/I18nProvider.js +15 -15
  113. package/dist/shared/providers/shell/PageConversationContextProvider.js +14 -14
  114. package/dist/shared/providers/shell/PermissionProvider.js +16 -16
  115. package/dist/shared/providers/shell/ShellUiProvider.js +13 -13
  116. package/dist/shared/providers/shell/ThemeProvider.js +9 -9
  117. package/dist/shared/providers/shell/authProvider/bridgeStateSync.js +34 -0
  118. package/dist/shared/providers/shell/authProvider/jwt.js +13 -0
  119. package/dist/shared/providers/shell/authProvider/ssoRelay.js +38 -0
  120. package/dist/shared/providers/shell/authProvider/useAuthActions.js +170 -0
  121. package/dist/shared/providers/shell/authProvider/useBridgeInitialization.js +86 -0
  122. package/dist/shared/providers/shell/authProvider/useRemoteSLO.js +32 -0
  123. package/dist/shared/providers/shell/authProvider/useStorageSync.js +35 -0
  124. package/dist/shared/providers/shell/authProvider/useTokenExpiryTimer.js +37 -0
  125. package/dist/shared/tours/TourPlayer.js +1 -0
  126. package/dist/shared/tours/TourPlayerProvider.js +1 -1
  127. package/dist/shared/tours/TourTooltip.js +3 -0
  128. package/dist/shared/tours/TourTrigger.js +86 -259
  129. package/dist/shared/tours/ToursContext.js +108 -398
  130. package/dist/shared/tours/tourTrigger/DesktopTourDropdown.js +48 -0
  131. package/dist/shared/tours/tourTrigger/MobileTourSheet.js +68 -0
  132. package/dist/shared/tours/tourTrigger/TourListItemDesktop.js +36 -0
  133. package/dist/shared/tours/tourTrigger/TourListItemMobile.js +47 -0
  134. package/dist/shared/tours/tourTrigger/TourStatusChip.js +30 -0
  135. package/dist/shared/tours/tourTrigger/TourTriggerButton.js +22 -0
  136. package/dist/shared/tours/toursContext/errors.js +18 -0
  137. package/dist/shared/tours/toursContext/gql.js +152 -0
  138. package/dist/shared/tours/toursContext/route.js +20 -0
  139. package/dist/shared/tours/toursContext/session.js +19 -0
  140. package/dist/shared/tours/toursContext/useIdleReady.js +18 -0
  141. package/dist/shared/tours/toursContext/useTourMutations.js +118 -0
  142. package/dist/shared-events.js +3 -3
  143. package/dist/shared-hooks.js +1 -1
  144. package/dist/storage/SaveToFilesButton.js +3 -3
  145. package/dist/storage/SaveToFilesDialog.js +1 -1
  146. package/dist/tag/TagBadge.js +1 -1
  147. package/dist/tag/TagsWidget.js +81 -226
  148. package/dist/tag/tagsWidget/AddTagTrigger.js +14 -0
  149. package/dist/tag/tagsWidget/TagBadgeList.js +17 -0
  150. package/dist/tag/tagsWidget/TagSearchPopover.js +80 -0
  151. package/dist/tag/tagsWidget/operations.js +64 -0
  152. package/dist/tag/tagsWidget/useVocabResolver.js +30 -0
  153. package/dist/ui/card.js +44 -39
  154. package/dist/ui/dropdown-menu.js +82 -66
  155. package/dist/ui/input.js +10 -10
  156. package/dist/ui/label.js +13 -11
  157. package/dist/ui/select.js +80 -66
  158. package/dist/ui/table.js +61 -54
  159. package/dist/ui/textarea.js +9 -9
  160. package/dist/ui/tooltip.js +13 -11
  161. package/package.json +1 -1
@@ -1,21 +1,21 @@
1
- import { createContext as e, useCallback as t, useContext as n, useMemo as r, useState as i } from "react";
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: n = 5, defaultToastDuration: s = 5e3 }) {
6
- let [c, l] = i([]), [u, d] = i([]), [f, p] = i(!1), [m, h] = i(!1), g = t((e, t = "info", r = s) => {
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: t,
9
+ type: n,
10
10
  message: e,
11
11
  duration: r
12
12
  };
13
- l((e) => [...e, a].slice(-n)), r > 0 && setTimeout(() => {
13
+ l((e) => [...e, a].slice(-t)), r > 0 && setTimeout(() => {
14
14
  l((e) => e.filter((e) => e.id !== i));
15
15
  }, r);
16
- }, [n, s]), _ = t((e) => {
16
+ }, [t, s]), _ = n((e) => {
17
17
  l((t) => t.filter((t) => t.id !== e));
18
- }, []), v = t((e) => {
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 = t((e) => {
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 = t(() => {
31
+ }, []), b = n(() => {
32
32
  d((e) => e.map((e) => ({
33
33
  ...e,
34
34
  read: !0
35
35
  })));
36
- }, []), x = t(() => {
36
+ }, []), x = n(() => {
37
37
  d([]);
38
- }, []), S = t(() => {
38
+ }, []), S = n(() => {
39
39
  p(!0);
40
- }, []), C = t(() => {
40
+ }, []), C = n(() => {
41
41
  p(!1);
42
- }, []), w = t(() => {
42
+ }, []), w = n(() => {
43
43
  p((e) => !e);
44
- }, []), T = t(() => {
44
+ }, []), T = n(() => {
45
45
  h(!0);
46
- }, []), E = t(() => {
46
+ }, []), E = n(() => {
47
47
  h(!1);
48
- }, []), D = t(() => {
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 = n(o);
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, useCallback as t, useContext as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
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: n = "en", translations: m = u, storageKey: g = "burdenoff-locale", profileId: _, fetchTranslations: v, showChildrenWhileLoading: y = !0, loadingComponent: b }) {
55
- let [x, S] = o(() => f(_, g, n)), [C, w] = o({}), [T, E] = o(!!v), [D, O] = o(null), k = a(/* @__PURE__ */ new Set()), A = a(d.version), j = i(() => {
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 = t(async (e) => {
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, n);
95
+ let e = f(_, g, t);
96
96
  S(e), document.documentElement.setAttribute("lang", e);
97
97
  }, [
98
98
  _,
99
99
  g,
100
- n
100
+ t
101
101
  ]);
102
- let N = t((e) => {
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 = t((e, t, r) => {
104
+ }, [g, _]), P = n((e, n, r) => {
105
105
  let i, a;
106
- if (typeof t == "string") i = t, a = r;
107
- else if (t && typeof t == "object") {
108
- let { defaultValue: e, ...n } = t;
109
- typeof e == "string" ? i = e : typeof e == "number" && (i = String(e)), a = n;
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 === n ? void 0 : p(j[n], e)) ?? (n === "en" ? void 0 : p(j.en, e)) ?? i ?? e;
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
- n
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 = n(l);
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, useCallback as t, useContext as n, useEffect as r, useMemo as i, useState as a } from "react";
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: n, resolveContext: u }) {
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), t = typeof window < "u" ? `${window.location.origin}${d.pathname}${d.search}${d.hash}` : `${d.pathname}${d.search}${d.hash}`, r = u?.(d) ?? null;
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: n,
22
+ product: t,
23
23
  pagePath: `${d.pathname}${d.search}${d.hash}`,
24
- contextHref: t,
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
- n,
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 = t((e) => {
41
+ }), [m, f]), g = n((e) => {
42
42
  p(e);
43
- }, []), _ = t(() => {
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 = n(c);
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 t = n(c);
62
- if (!t) throw Error("useRegisterPageConversationContext must be used within PageConversationContextProvider");
63
- r(() => (t.setOverride(e ?? null), () => {
64
- t.clearOverride();
65
- }), [t, e]);
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, useCallback as r, useContext as i, useEffect as a, useMemo as o } from "react";
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: i, gateway: p = "workspace", staleTime: _ = 300 * 1e3, refetchInterval: v = 300 * 1e3, refetchOnFocusStaleTime: y = 120 * 1e3, debug: b = !1 }) {
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
- i,
48
+ r,
49
49
  D
50
50
  ], [
51
51
  p,
52
- i,
52
+ r,
53
53
  D
54
- ]), k = r(async () => {
55
- if (!i) throw Error("scopeId is required for permission fetching");
56
- b && console.log("[PermissionProvider] Fetching permissions for scope:", i);
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: i },
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
- i,
67
+ r,
68
68
  p,
69
69
  b
70
- ]), A = !E && x && !!i && !!S?.accessToken, j = c({
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 = r((e) => E ? !0 : I?.permissionStrings ? m(I.permissionStrings, e) : !1, [I?.permissionStrings, E]), R = r((e, t) => {
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 = r((e) => E ? !0 : I?.roles ? I.roles.includes(e) : !1, [I?.roles, E]), B = r((e) => E ? !0 : I?.roles ? e.some((e) => I.roles.includes(e)) : !1, [I?.roles, E]), V = r((e) => E ? !0 : I?.roles ? e.every((e) => I.roles.includes(e)) : !1, [I?.roles, E]), H = r(async () => {
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 = r(async () => {
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: i,
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
- i
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 = i(u);
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, useCallback as t, useContext as n, useMemo as r, useState as i } from "react";
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: n = !1, defaultSidebarOpen: s = !0, defaultHeaderVisible: c = !0, defaultFooterVisible: l = !0, defaultSidebarVisible: u = !0, storageKey: d = "burdenoff-shell-ui" }) {
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 n;
7
+ if (typeof window > "u") return t;
8
8
  let e = localStorage.getItem(`${d}-sidebar-collapsed`);
9
- return e ? e === "true" : n;
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 = t((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 = t(() => {
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 = t((e) => {
21
+ }, [d]), O = n((e) => {
22
22
  h(e), localStorage.setItem(`${d}-sidebar-open`, String(e));
23
- }, [d]), k = t(() => {
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 = t((e) => {
28
+ }, [d]), A = n((e) => {
29
29
  C(e);
30
- }, []), j = t((e) => {
30
+ }, []), j = n((e) => {
31
31
  C((t) => [...t, e]);
32
- }, []), M = t(() => {
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 = n(o);
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 n(o);
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, useCallback as t, useContext as n, useEffect as r, useMemo as i, useState as a } from "react";
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: n = "system", defaultBrand: c = "default", defaultDensity: l = "comfortable", defaultTypography: u = "default", storageKey: d = "burdenoff-theme" }) {
6
- let [f, p] = a(() => typeof window > "u" ? n : localStorage.getItem(`${d}-mode`) || n), [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);
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 = t((e) => {
23
+ let S = n((e) => {
24
24
  p(e), localStorage.setItem(`${d}-mode`, e);
25
- }, [d]), C = t((e) => {
25
+ }, [d]), C = n((e) => {
26
26
  h(e), localStorage.setItem(`${d}-brand`, e);
27
- }, [d]), w = t((e) => {
27
+ }, [d]), w = n((e) => {
28
28
  _(e), localStorage.setItem(`${d}-density`, e);
29
- }, [d]), T = t((e) => {
29
+ }, [d]), T = n((e) => {
30
30
  y(e), localStorage.setItem(`${d}-typography`, e);
31
- }, [d]), E = t(() => {
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 = n(s);
63
+ let e = t(s);
64
64
  if (!e) throw Error("useTheme must be used within a ThemeProvider");
65
65
  return e;
66
66
  }
@@ -0,0 +1,34 @@
1
+ import { PROFILE_STORAGE_CHANGE_EVENT as e, setActiveProfileId as t, setProfileTokens as n, setProfileUser as r, setProfileWorkspaceToken as i, setProfiles as a } from "../ProfileStorageManager.js";
2
+ import { clearLocalAuthState as o } from "../../../components/SSORedirectGuard.js";
3
+ //#region src/shared/providers/shell/authProvider/bridgeStateSync.ts
4
+ function s(e) {
5
+ return e.trigger;
6
+ }
7
+ function c(e, t, n) {
8
+ let r = (Array.isArray(e.profiles) ? e.profiles : []).map((e) => {
9
+ let t = typeof e.id == "string" ? e.id : null, n = typeof e.email == "string" ? e.email : null;
10
+ return !t || !n ? null : {
11
+ id: t,
12
+ email: n,
13
+ name: typeof e.name == "string" && e.name.trim().length > 0 ? e.name : n,
14
+ avatar: typeof e.avatar == "string" ? e.avatar : void 0,
15
+ lastLogin: typeof e.lastLogin == "string" ? e.lastLogin : (/* @__PURE__ */ new Date()).toISOString()
16
+ };
17
+ }).filter((e) => e !== null);
18
+ return r.some((e) => e.id === t) ? r : [...r, {
19
+ id: t,
20
+ email: n.email,
21
+ name: n.name ?? `${n.firstName ?? ""} ${n.lastName ?? ""}`.trim(),
22
+ avatar: n.avatar,
23
+ lastLogin: (/* @__PURE__ */ new Date()).toISOString()
24
+ }];
25
+ }
26
+ function l(l) {
27
+ let u = s(l);
28
+ if (u === "logout" || u === "logout_all") return o(), !0;
29
+ if (!l.activeProfileId || !l.user || !l.tokens) return !1;
30
+ let d = l.activeProfileId, f = l.user, { workspaceToken: p, ...m } = l.tokens;
31
+ return a(c(l, d, f)), r(d, f), n(d, m), i(d, p ?? null), t(d), window.dispatchEvent(new Event(e)), !0;
32
+ }
33
+ //#endregion
34
+ export { l as syncBridgeStateToProfileStorage };
@@ -0,0 +1,13 @@
1
+ //#region src/shared/providers/shell/authProvider/jwt.ts
2
+ function e(e) {
3
+ try {
4
+ let t = e.split(".");
5
+ if (t.length !== 3) return null;
6
+ let n = JSON.parse(atob(t[1].replace(/-/g, "+").replace(/_/g, "/")));
7
+ return typeof n.exp == "number" ? n.exp * 1e3 : null;
8
+ } catch {
9
+ return null;
10
+ }
11
+ }
12
+ //#endregion
13
+ export { e as getJwtExpiry };
@@ -0,0 +1,38 @@
1
+ import { resolveAuthBridgeConfig as e } from "../../../config/authBridgeUrls.js";
2
+ import { isTrustedSsoOrigin as t, readShellSsoCookie as n } from "../../../utils/authCookie.js";
3
+ import { hasRecentSSORedirectAttempt as r, markSSORedirectAttempt as i, shouldSkipSSORedirect as a } from "../../../components/SSORedirectGuard.js";
4
+ //#region src/shared/providers/shell/authProvider/ssoRelay.ts
5
+ function o() {
6
+ if (typeof window > "u") return null;
7
+ try {
8
+ let t = e(), n = new URL(t.url).origin;
9
+ if (n === window.location.origin) return null;
10
+ let r = `${window.location.origin}/auth/login?reason=logout`;
11
+ return `${n}/auth/sso-clear?returnTo=${encodeURIComponent(r)}`;
12
+ } catch {
13
+ return null;
14
+ }
15
+ }
16
+ function s(e) {
17
+ if (!e) return !1;
18
+ try {
19
+ return !!(localStorage.getItem(`bf-p-${e}-tokens`) && localStorage.getItem(`bf-p-${e}-user`));
20
+ } catch {
21
+ return !1;
22
+ }
23
+ }
24
+ function c(e) {
25
+ try {
26
+ if (a()) return null;
27
+ let o = n();
28
+ if (!o?.origin || !t(o.origin)) return null;
29
+ let c = new URL(o.origin).origin, l = new URL(e).origin;
30
+ if (c === window.location.origin || c === l || s(o.id)) return null;
31
+ let u = window.location.href;
32
+ return r(c, u) ? null : (i(c, u), `${c}/auth/sso-relay?returnTo=${encodeURIComponent(u)}`);
33
+ } catch {
34
+ return null;
35
+ }
36
+ }
37
+ //#endregion
38
+ export { c as getCookieSsoRelayUrl, o as getCrossOriginLogoutUrl };