@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.
- 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 +90 -338
- 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 +73 -448
- 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 +69 -694
- 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 +75 -239
- package/dist/chrome/Sidebar.js +1 -0
- package/dist/chrome/contextSwitcher/EmptyState.js +32 -0
- package/dist/chrome/contextSwitcher/OrganizationList.js +34 -0
- package/dist/chrome/contextSwitcher/ProjectList.js +34 -0
- package/dist/chrome/contextSwitcher/SearchInput.js +50 -0
- package/dist/chrome/contextSwitcher/TabButton.js +9 -0
- package/dist/chrome/contextSwitcher/TriggerButton.js +38 -0
- package/dist/chrome/contextSwitcher/WorkspaceList.js +34 -0
- package/dist/chrome/contextSwitcher/icons.js +58 -0
- package/dist/chrome/contextSwitcher/useIsMobile.js +11 -0
- package/dist/chrome/globalSearch/AdvancedFiltersPanel.js +253 -0
- package/dist/chrome/globalSearch/CategoryTabs.js +28 -0
- package/dist/chrome/globalSearch/ResultsList.js +58 -0
- package/dist/chrome/globalSearch/SearchInput.js +28 -0
- package/dist/chrome/globalSearch/SearchModeBar.js +36 -0
- package/dist/chrome/globalSearch/useAdvancedFilters.js +78 -0
- package/dist/chrome/globalSearch/utils.js +22 -0
- package/dist/chrome/notificationCenter/BellButton.js +27 -0
- package/dist/chrome/notificationCenter/NotificationCardItem.js +129 -0
- package/dist/chrome/notificationCenter/NotificationFilters.js +67 -0
- package/dist/chrome/notificationCenter/NotificationFooter.js +23 -0
- package/dist/chrome/notificationCenter/NotificationHeader.js +75 -0
- package/dist/chrome/notificationCenter/NotificationList.js +75 -0
- package/dist/chrome/notificationCenter/NotificationPanel.js +19 -0
- package/dist/chrome/notificationCenter/SkeletonCard.js +18 -0
- package/dist/chrome/notificationCenter/constants.js +93 -0
- package/dist/chrome/notificationCenter/gql.js +58 -0
- package/dist/chrome/notificationCenter/useNotificationCenter.js +149 -0
- package/dist/chrome/notificationCenter/usePanelChrome.js +36 -0
- package/dist/chrome/sideNavigation/CollapseToggle.js +29 -0
- package/dist/chrome/sideNavigation/MobileActionsBar.js +25 -0
- package/dist/chrome/sideNavigation/NavItemRenderer.js +79 -0
- package/dist/chrome/sideNavigation/SidebarHeader.js +29 -0
- package/dist/chrome/sideNavigation/helpers.js +19 -0
- package/dist/chrome/sideNavigation/useSideNavigationState.js +45 -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 +173 -767
- 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/components/contextConversationWidget/Composer.js +66 -0
- package/dist/shared/components/contextConversationWidget/MessageItem.js +124 -0
- package/dist/shared/components/contextConversationWidget/MessageList.js +32 -0
- package/dist/shared/components/contextConversationWidget/NoWorkspaceCard.js +19 -0
- package/dist/shared/components/contextConversationWidget/PendingAttachmentsBar.js +28 -0
- package/dist/shared/components/contextConversationWidget/ReplyBanner.js +32 -0
- package/dist/shared/components/contextConversationWidget/WidgetHeader.js +70 -0
- package/dist/shared/components/contextConversationWidget/queries.js +197 -0
- package/dist/shared/components/contextConversationWidget/types.js +10 -0
- package/dist/shared/components/contextConversationWidget/useAttachmentUpload.js +57 -0
- package/dist/shared/components/contextConversationWidget/useConversationSubscriptions.js +26 -0
- package/dist/shared/components/contextConversationWidget/useMessageActions.js +34 -0
- package/dist/shared/components/contextConversationWidget/useSendMessage.js +45 -0
- package/dist/shared/components/contextConversationWidget/useWidgetMessages.js +44 -0
- package/dist/shared/components/contextConversationWidget/utils.js +56 -0
- 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 +293 -1071
- package/dist/shared/pages/searchPage/ActiveFilterChips.js +176 -0
- package/dist/shared/pages/searchPage/FiltersPanel.js +329 -0
- package/dist/shared/pages/searchPage/ResultsList.js +119 -0
- package/dist/shared/pages/searchPage/ResultsStatus.js +32 -0
- package/dist/shared/pages/searchPage/SearchInput.js +31 -0
- package/dist/shared/pages/searchPage/SearchPagination.js +37 -0
- package/dist/shared/pages/searchPage/SearchToolbar.js +58 -0
- package/dist/shared/pages/searchPage/constants.js +155 -0
- package/dist/shared/pages/searchPage/utils.js +24 -0
- 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 +130 -384
- 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/providers/shell/authProvider/bridgeStateSync.js +34 -0
- package/dist/shared/providers/shell/authProvider/jwt.js +13 -0
- package/dist/shared/providers/shell/authProvider/ssoRelay.js +38 -0
- package/dist/shared/providers/shell/authProvider/useAuthActions.js +170 -0
- package/dist/shared/providers/shell/authProvider/useBridgeInitialization.js +86 -0
- package/dist/shared/providers/shell/authProvider/useRemoteSLO.js +32 -0
- package/dist/shared/providers/shell/authProvider/useStorageSync.js +35 -0
- package/dist/shared/providers/shell/authProvider/useTokenExpiryTimer.js +37 -0
- 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 +86 -259
- package/dist/shared/tours/ToursContext.js +108 -398
- package/dist/shared/tours/tourTrigger/DesktopTourDropdown.js +48 -0
- package/dist/shared/tours/tourTrigger/MobileTourSheet.js +68 -0
- package/dist/shared/tours/tourTrigger/TourListItemDesktop.js +36 -0
- package/dist/shared/tours/tourTrigger/TourListItemMobile.js +47 -0
- package/dist/shared/tours/tourTrigger/TourStatusChip.js +30 -0
- package/dist/shared/tours/tourTrigger/TourTriggerButton.js +22 -0
- package/dist/shared/tours/toursContext/errors.js +18 -0
- package/dist/shared/tours/toursContext/gql.js +152 -0
- package/dist/shared/tours/toursContext/route.js +20 -0
- package/dist/shared/tours/toursContext/session.js +19 -0
- package/dist/shared/tours/toursContext/useIdleReady.js +18 -0
- package/dist/shared/tours/toursContext/useTourMutations.js +118 -0
- 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 +81 -226
- package/dist/tag/tagsWidget/AddTagTrigger.js +14 -0
- package/dist/tag/tagsWidget/TagBadgeList.js +17 -0
- package/dist/tag/tagsWidget/TagSearchPopover.js +80 -0
- package/dist/tag/tagsWidget/operations.js +64 -0
- package/dist/tag/tagsWidget/useVocabResolver.js +30 -0
- 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
|
@@ -5,460 +5,170 @@ import { useActiveContext as n } from "../providers/shell/ActiveContextProvider.
|
|
|
5
5
|
import { useAppShell as r } from "../providers/shell/AppShellContext.js";
|
|
6
6
|
import { useLogger as i } from "../logger/useLogger.js";
|
|
7
7
|
import "../../shared-logger.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
8
|
+
import { isTourVisibleForContext as a } from "./routeCatalog.js";
|
|
9
|
+
import { GET_TOURS_FOR_CONTEXT as o, GET_TOURS_FOR_CONTEXT_WITHOUT_PROGRESS as s } from "./toursContext/gql.js";
|
|
10
|
+
import { isMyProgressFieldMissingError as c, isTeardownInvariant as l } from "./toursContext/errors.js";
|
|
11
|
+
import { normalizeDeviceType as u } from "./toursContext/session.js";
|
|
12
|
+
import { deriveRouteContext as d } from "./toursContext/route.js";
|
|
13
|
+
import { useIdleReady as ee } from "./toursContext/useIdleReady.js";
|
|
14
|
+
import { useTourMutations as te } from "./toursContext/useTourMutations.js";
|
|
15
|
+
import { createContext as f, use as p, useCallback as m, useEffect as h, useMemo as g, useRef as _, useState as v } from "react";
|
|
16
|
+
import { jsx as ne } from "react/jsx-runtime";
|
|
17
|
+
import { useLocation as y } from "react-router-dom";
|
|
15
18
|
//#region src/shared/tours/ToursContext.tsx
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
productId
|
|
26
|
-
moduleId
|
|
27
|
-
pageId
|
|
28
|
-
status
|
|
29
|
-
isActive
|
|
30
|
-
triggerType
|
|
31
|
-
triggerConfig
|
|
32
|
-
mobileConfig
|
|
33
|
-
tabletConfig
|
|
34
|
-
desktopConfig
|
|
35
|
-
priority
|
|
36
|
-
displayOrder
|
|
37
|
-
}
|
|
38
|
-
`, _ = h`
|
|
39
|
-
fragment ToursStepFields on Tour {
|
|
40
|
-
steps {
|
|
41
|
-
id
|
|
42
|
-
tourId
|
|
43
|
-
title
|
|
44
|
-
content
|
|
45
|
-
stepOrder
|
|
46
|
-
targetSelector
|
|
47
|
-
placement
|
|
48
|
-
targetSelectorMobile
|
|
49
|
-
targetSelectorTablet
|
|
50
|
-
targetSelectorDesktop
|
|
51
|
-
customData
|
|
52
|
-
actions
|
|
53
|
-
requireInteraction
|
|
54
|
-
waitForSelector
|
|
55
|
-
waitForEvent
|
|
56
|
-
waitForTimeout
|
|
57
|
-
skipConditions
|
|
58
|
-
media {
|
|
59
|
-
id
|
|
60
|
-
position
|
|
61
|
-
mediaId
|
|
62
|
-
media {
|
|
63
|
-
id
|
|
64
|
-
name
|
|
65
|
-
type
|
|
66
|
-
cdnUrl
|
|
67
|
-
mimeType
|
|
68
|
-
altText
|
|
69
|
-
caption
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
`, v = h`
|
|
75
|
-
${g}
|
|
76
|
-
${_}
|
|
77
|
-
query GetToursForContext($context: TourContextInput!) {
|
|
78
|
-
toursForContext(context: $context) {
|
|
79
|
-
...ToursCoreFields
|
|
80
|
-
myProgress {
|
|
81
|
-
id
|
|
82
|
-
status
|
|
83
|
-
}
|
|
84
|
-
...ToursStepFields
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
`, y = h`
|
|
88
|
-
${g}
|
|
89
|
-
${_}
|
|
90
|
-
query GetToursForContextFallback($context: TourContextInput!) {
|
|
91
|
-
toursForContext(context: $context) {
|
|
92
|
-
...ToursCoreFields
|
|
93
|
-
...ToursStepFields
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
`;
|
|
97
|
-
function b(e) {
|
|
98
|
-
let t = e instanceof Error || typeof e == "object" && e && "message" in e && typeof e.message == "string" ? e.message : "";
|
|
99
|
-
return t.includes("myProgress") ? t.includes("Cannot query field") || t.includes("Unknown field") : !1;
|
|
100
|
-
}
|
|
101
|
-
var ne = h`
|
|
102
|
-
mutation StartTour($tourId: ID!, $userId: ID!, $deviceType: DeviceType) {
|
|
103
|
-
startTour(tourId: $tourId, userId: $userId, deviceType: $deviceType) {
|
|
104
|
-
id
|
|
105
|
-
tourId
|
|
106
|
-
userId
|
|
107
|
-
status
|
|
108
|
-
currentStepId
|
|
109
|
-
completedSteps
|
|
110
|
-
startedAt
|
|
111
|
-
completedAt
|
|
112
|
-
lastViewedAt
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
`, re = h`
|
|
116
|
-
mutation CompleteTour($tourId: ID!, $userId: ID!) {
|
|
117
|
-
completeTour(tourId: $tourId, userId: $userId) {
|
|
118
|
-
id
|
|
119
|
-
tourId
|
|
120
|
-
userId
|
|
121
|
-
status
|
|
122
|
-
currentStepId
|
|
123
|
-
completedSteps
|
|
124
|
-
startedAt
|
|
125
|
-
completedAt
|
|
126
|
-
lastViewedAt
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
`, ie = h`
|
|
130
|
-
mutation SkipTour($tourId: ID!, $userId: ID!) {
|
|
131
|
-
skipTour(tourId: $tourId, userId: $userId) {
|
|
132
|
-
id
|
|
133
|
-
tourId
|
|
134
|
-
userId
|
|
135
|
-
status
|
|
136
|
-
currentStepId
|
|
137
|
-
completedSteps
|
|
138
|
-
startedAt
|
|
139
|
-
completedAt
|
|
140
|
-
lastViewedAt
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
`, ae = h`
|
|
144
|
-
mutation CompleteStep($tourId: ID!, $stepId: ID!, $userId: ID!) {
|
|
145
|
-
completeStep(tourId: $tourId, stepId: $stepId, userId: $userId) {
|
|
146
|
-
id
|
|
147
|
-
tourId
|
|
148
|
-
userId
|
|
149
|
-
status
|
|
150
|
-
currentStepId
|
|
151
|
-
completedSteps
|
|
152
|
-
startedAt
|
|
153
|
-
completedAt
|
|
154
|
-
lastViewedAt
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
`, oe = h`
|
|
158
|
-
mutation TrackTourEvent($input: RecordTourAnalyticsInput!) {
|
|
159
|
-
trackTourEvent(input: $input) {
|
|
160
|
-
id
|
|
161
|
-
tourId
|
|
162
|
-
eventType
|
|
163
|
-
stepId
|
|
164
|
-
stepOrder
|
|
165
|
-
timestamp
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
`, x = [
|
|
169
|
-
"The client has been stopped",
|
|
170
|
-
"QueryManager stopped",
|
|
171
|
-
"This Apollo Client has been destroyed",
|
|
172
|
-
"aborted"
|
|
173
|
-
];
|
|
174
|
-
function se(e) {
|
|
175
|
-
if (!(e instanceof Error)) return !1;
|
|
176
|
-
let t = e.message;
|
|
177
|
-
return e.name === "InvariantError" || t.startsWith("Invariant Violation") ? x.some((e) => t.includes(e)) : !1;
|
|
178
|
-
}
|
|
179
|
-
function S(e, t) {
|
|
180
|
-
let n = e.split("/").filter(Boolean);
|
|
181
|
-
return n.length === 0 ? t : n[0];
|
|
182
|
-
}
|
|
183
|
-
function C() {
|
|
184
|
-
let e = a();
|
|
185
|
-
return e === "mobile" ? "MOBILE" : e === "tablet" ? "TABLET" : "DESKTOP";
|
|
186
|
-
}
|
|
187
|
-
function ce() {
|
|
188
|
-
let e = "bf-tour-session-id";
|
|
189
|
-
try {
|
|
190
|
-
let t = sessionStorage.getItem(e);
|
|
191
|
-
if (t) return t;
|
|
192
|
-
let n = typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `tour-session-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
193
|
-
return sessionStorage.setItem(e, n), n;
|
|
194
|
-
} catch {
|
|
195
|
-
return `tour-session-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
function le(e, t, n, r) {
|
|
199
|
-
let i = e.split("/").filter(Boolean), a = r ? r(e) : S(e, n);
|
|
200
|
-
return i.length === 0 ? {
|
|
201
|
-
moduleId: t,
|
|
202
|
-
pageId: a
|
|
203
|
-
} : i[0] === t ? {
|
|
204
|
-
moduleId: t,
|
|
205
|
-
pageId: i[1] ?? n
|
|
206
|
-
} : {
|
|
207
|
-
moduleId: i[0],
|
|
208
|
-
pageId: a
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
var w = c(null);
|
|
212
|
-
function T({ children: a, defaultPageId: c = "home", getPageIdFromPath: u, disabled: h = !1 }) {
|
|
213
|
-
let g = te(), _ = e("global"), { workspaceId: x } = n(), { user: S } = t(), { productSlug: T } = r(), E = i("ToursContext"), D = x ?? void 0, O = h || g.pathname.startsWith("/devportal"), { moduleId: k, pageId: A } = f(() => le(g.pathname, T, c, u), [
|
|
214
|
-
c,
|
|
215
|
-
u,
|
|
216
|
-
g.pathname,
|
|
217
|
-
T
|
|
218
|
-
]), [j, M] = m([]), [N, P] = m(!1), [F, I] = m(null), [L, ue] = m(!1);
|
|
219
|
-
d(() => {
|
|
220
|
-
let e = () => ue(!0);
|
|
221
|
-
if (typeof window < "u" && "requestIdleCallback" in window) {
|
|
222
|
-
let t = window.requestIdleCallback(e, { timeout: 2e3 });
|
|
223
|
-
return () => {
|
|
224
|
-
window.cancelIdleCallback?.(t);
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
let t = setTimeout(e, 500);
|
|
228
|
-
return () => clearTimeout(t);
|
|
229
|
-
}, []);
|
|
230
|
-
let R = p([]), z = p(0), B = p(/* @__PURE__ */ new Map()), V = p(void 0), H = p(!1), U = p(!0), W = p(0), G = p(!0);
|
|
231
|
-
d(() => (U.current = !0, () => {
|
|
19
|
+
var b = f(null);
|
|
20
|
+
function x({ children: f, defaultPageId: p = "home", getPageIdFromPath: x, disabled: S = !1 }) {
|
|
21
|
+
let C = y(), w = e("global"), { workspaceId: T } = n(), { user: E } = t(), { productSlug: D } = r(), O = i("ToursContext"), k = T ?? void 0, A = S || C.pathname.startsWith("/devportal"), { moduleId: j, pageId: M } = g(() => d(C.pathname, D, p, x), [
|
|
22
|
+
p,
|
|
23
|
+
x,
|
|
24
|
+
C.pathname,
|
|
25
|
+
D
|
|
26
|
+
]), [N, P] = v([]), [F, I] = v(!1), [L, R] = v(null), z = ee(), B = _([]), re = _(0), ie = _(/* @__PURE__ */ new Map()), V = _(void 0), H = _(!1), U = _(!0), W = _(0), G = _(!0);
|
|
27
|
+
h(() => (U.current = !0, () => {
|
|
232
28
|
U.current = !1;
|
|
233
29
|
}), []);
|
|
234
|
-
let K =
|
|
235
|
-
if (!
|
|
236
|
-
if (
|
|
237
|
-
U.current && (
|
|
30
|
+
let K = m(async (e = !1) => {
|
|
31
|
+
if (!z && !e) return;
|
|
32
|
+
if (A) {
|
|
33
|
+
U.current && (P([]), I(!1), R(null));
|
|
238
34
|
return;
|
|
239
35
|
}
|
|
240
|
-
if (!
|
|
241
|
-
let t =
|
|
242
|
-
productSlug:
|
|
243
|
-
workspaceId:
|
|
244
|
-
moduleId:
|
|
245
|
-
pageId:
|
|
246
|
-
}), n =
|
|
247
|
-
T,
|
|
248
|
-
k ?? "",
|
|
249
|
-
A ?? "",
|
|
36
|
+
if (!w) return;
|
|
37
|
+
let t = O.child("fetch", {
|
|
38
|
+
productSlug: D,
|
|
39
|
+
workspaceId: k,
|
|
40
|
+
moduleId: j,
|
|
41
|
+
pageId: M
|
|
42
|
+
}), n = u(), r = [
|
|
250
43
|
D,
|
|
44
|
+
j ?? "",
|
|
45
|
+
M ?? "",
|
|
46
|
+
k,
|
|
251
47
|
n,
|
|
252
|
-
|
|
48
|
+
E?.id ?? "anonymous"
|
|
253
49
|
].join("::");
|
|
254
50
|
if (!e && H.current && V.current === r) return;
|
|
255
|
-
U.current && (
|
|
51
|
+
U.current && (I(!0), R(null));
|
|
256
52
|
let i = ++W.current;
|
|
257
53
|
try {
|
|
258
54
|
let e = { context: {
|
|
259
|
-
productId:
|
|
260
|
-
moduleId:
|
|
261
|
-
pageId:
|
|
262
|
-
workspaceId:
|
|
55
|
+
productId: D,
|
|
56
|
+
moduleId: j,
|
|
57
|
+
pageId: M,
|
|
58
|
+
workspaceId: k,
|
|
263
59
|
deviceType: n
|
|
264
|
-
} }, a = "network-only",
|
|
60
|
+
} }, a = "network-only", l, u = G.current ? o : s;
|
|
265
61
|
try {
|
|
266
|
-
|
|
267
|
-
query:
|
|
62
|
+
l = await w.query({
|
|
63
|
+
query: u,
|
|
268
64
|
variables: e,
|
|
269
65
|
fetchPolicy: a,
|
|
270
66
|
errorPolicy: "none"
|
|
271
67
|
});
|
|
272
|
-
let n =
|
|
273
|
-
|
|
274
|
-
query:
|
|
68
|
+
let n = l.errors;
|
|
69
|
+
u === o && n?.some((e) => c(e)) && (G.current = !1, t.warn("[ToursContext] Gateway returned a Tour.myProgress validation error — falling back to query without progress chips until the backend field is published."), l = await w.query({
|
|
70
|
+
query: s,
|
|
275
71
|
variables: e,
|
|
276
72
|
fetchPolicy: a,
|
|
277
73
|
errorPolicy: "none"
|
|
278
74
|
}));
|
|
279
75
|
} catch (n) {
|
|
280
|
-
if (
|
|
281
|
-
query:
|
|
76
|
+
if (u === o && c(n)) G.current = !1, t.warn("[ToursContext] Gateway does not expose Tour.myProgress yet — falling back to query without progress chips until the backend field is published."), l = await w.query({
|
|
77
|
+
query: s,
|
|
282
78
|
variables: e,
|
|
283
79
|
fetchPolicy: a,
|
|
284
80
|
errorPolicy: "none"
|
|
285
81
|
});
|
|
286
82
|
else throw n;
|
|
287
83
|
}
|
|
288
|
-
let
|
|
289
|
-
U.current && i === W.current && (
|
|
84
|
+
let d = (l.data?.toursForContext ?? []).filter((e, t, n) => n.findIndex((t) => t.id === e.id) === t);
|
|
85
|
+
U.current && i === W.current && (P(d), V.current = r, H.current = !0);
|
|
290
86
|
} catch (e) {
|
|
291
|
-
if (!U.current || i !== W.current ||
|
|
87
|
+
if (!U.current || i !== W.current || l(e)) return;
|
|
292
88
|
let n = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to fetch tours");
|
|
293
|
-
t.error("Failed to fetch tours for context", n),
|
|
89
|
+
t.error("Failed to fetch tours for context", n), R(n), P([]);
|
|
294
90
|
} finally {
|
|
295
|
-
U.current && i === W.current &&
|
|
91
|
+
U.current && i === W.current && I(!1);
|
|
296
92
|
}
|
|
297
93
|
}, [
|
|
298
|
-
|
|
299
|
-
O,
|
|
300
|
-
_,
|
|
301
|
-
E,
|
|
302
|
-
k,
|
|
94
|
+
z,
|
|
303
95
|
A,
|
|
304
|
-
|
|
96
|
+
w,
|
|
97
|
+
O,
|
|
98
|
+
j,
|
|
99
|
+
M,
|
|
305
100
|
D,
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
101
|
+
k,
|
|
102
|
+
E?.id
|
|
103
|
+
]), q = _(E?.id);
|
|
104
|
+
h(() => {
|
|
105
|
+
q.current !== E?.id && (q.current = E?.id, H.current = !1, V.current = void 0, U.current && P([]));
|
|
106
|
+
}, [E?.id]), h(() => {
|
|
311
107
|
K();
|
|
312
|
-
}, [K]),
|
|
313
|
-
|
|
314
|
-
}, [
|
|
315
|
-
let J =
|
|
108
|
+
}, [K]), h(() => {
|
|
109
|
+
B.current = N;
|
|
110
|
+
}, [N]);
|
|
111
|
+
let J = m(() => {
|
|
316
112
|
K(!0);
|
|
317
|
-
}, [K]), Y =
|
|
318
|
-
productId:
|
|
319
|
-
moduleId:
|
|
320
|
-
pageId:
|
|
113
|
+
}, [K]), Y = g(() => N.filter((e) => e.isActive && e.steps?.length > 0 && a(e, {
|
|
114
|
+
productId: D,
|
|
115
|
+
moduleId: j,
|
|
116
|
+
pageId: M
|
|
321
117
|
})).sort((e, t) => (t.priority ?? 0) - (e.priority ?? 0)), [
|
|
118
|
+
N,
|
|
322
119
|
j,
|
|
323
|
-
|
|
324
|
-
A,
|
|
325
|
-
T
|
|
326
|
-
]), X = f(() => L ? Y.find((e) => e.triggerType === "AUTO_FIRST_VISIT" || e.triggerType === "AUTO_ALWAYS") ?? null : null, [Y, L]), Z = l(async (e, t, n) => {
|
|
327
|
-
if (!_ || !S?.id) return;
|
|
328
|
-
let r = t === "started" ? "IN_PROGRESS" : t === "completed" ? "COMPLETED" : "SKIPPED", i = R.current.find((t) => t.id === e)?.myProgress, a = z.current + 1;
|
|
329
|
-
z.current = a, B.current.set(e, a), M((t) => {
|
|
330
|
-
let n = s(t, e, r);
|
|
331
|
-
return R.current = n, n;
|
|
332
|
-
});
|
|
333
|
-
try {
|
|
334
|
-
if (t === "started") {
|
|
335
|
-
await _.mutate({
|
|
336
|
-
mutation: ne,
|
|
337
|
-
variables: {
|
|
338
|
-
tourId: e,
|
|
339
|
-
userId: S.id,
|
|
340
|
-
deviceType: C()
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
if (t === "completed") {
|
|
346
|
-
await _.mutate({
|
|
347
|
-
mutation: re,
|
|
348
|
-
variables: {
|
|
349
|
-
tourId: e,
|
|
350
|
-
userId: S.id
|
|
351
|
-
}
|
|
352
|
-
});
|
|
353
|
-
return;
|
|
354
|
-
}
|
|
355
|
-
await _.mutate({
|
|
356
|
-
mutation: ie,
|
|
357
|
-
variables: {
|
|
358
|
-
tourId: e,
|
|
359
|
-
userId: S.id
|
|
360
|
-
}
|
|
361
|
-
});
|
|
362
|
-
} catch {
|
|
363
|
-
if (B.current.get(e) !== a) return;
|
|
364
|
-
M((t) => {
|
|
365
|
-
let n = t.map((t) => t.id === e ? {
|
|
366
|
-
...t,
|
|
367
|
-
myProgress: i
|
|
368
|
-
} : t);
|
|
369
|
-
return R.current = n, n;
|
|
370
|
-
});
|
|
371
|
-
} finally {
|
|
372
|
-
B.current.get(e) === a && B.current.delete(e);
|
|
373
|
-
}
|
|
374
|
-
}, [_, S?.id]), Q = l(async (e, t) => {
|
|
375
|
-
if (!(!_ || !S?.id || !t)) try {
|
|
376
|
-
await _.mutate({
|
|
377
|
-
mutation: ae,
|
|
378
|
-
variables: {
|
|
379
|
-
tourId: e,
|
|
380
|
-
stepId: t,
|
|
381
|
-
userId: S.id
|
|
382
|
-
}
|
|
383
|
-
});
|
|
384
|
-
} catch {}
|
|
385
|
-
}, [_, S?.id]), $ = l(async (e, t, n) => {
|
|
386
|
-
if (!(!_ || !S?.id)) try {
|
|
387
|
-
await _.mutate({
|
|
388
|
-
mutation: oe,
|
|
389
|
-
variables: { input: {
|
|
390
|
-
tourId: t,
|
|
391
|
-
userId: S.id,
|
|
392
|
-
sessionId: ce(),
|
|
393
|
-
eventType: e,
|
|
394
|
-
stepId: n?.stepId,
|
|
395
|
-
stepOrder: n?.stepOrder,
|
|
396
|
-
productId: T,
|
|
397
|
-
moduleId: k,
|
|
398
|
-
pageId: A,
|
|
399
|
-
deviceType: C(),
|
|
400
|
-
userAgent: typeof navigator < "u" ? navigator.userAgent : void 0,
|
|
401
|
-
duration: n?.duration,
|
|
402
|
-
metadata: n?.metadata,
|
|
403
|
-
context: D ? {
|
|
404
|
-
workspaceId: D,
|
|
405
|
-
productId: T,
|
|
406
|
-
moduleId: k,
|
|
407
|
-
pageId: A
|
|
408
|
-
} : {
|
|
409
|
-
productId: T,
|
|
410
|
-
moduleId: k,
|
|
411
|
-
pageId: A
|
|
412
|
-
}
|
|
413
|
-
} }
|
|
414
|
-
});
|
|
415
|
-
} catch {}
|
|
416
|
-
}, [
|
|
417
|
-
_,
|
|
418
|
-
k,
|
|
419
|
-
A,
|
|
420
|
-
T,
|
|
421
|
-
S?.id,
|
|
120
|
+
M,
|
|
422
121
|
D
|
|
423
|
-
]),
|
|
424
|
-
|
|
122
|
+
]), X = g(() => z ? Y.find((e) => e.triggerType === "AUTO_FIRST_VISIT" || e.triggerType === "AUTO_ALWAYS") ?? null : null, [Y, z]), { trackProgress: Z, recordStepCompletion: Q, trackEvent: $ } = te({
|
|
123
|
+
globalClient: w,
|
|
124
|
+
userId: E?.id,
|
|
125
|
+
productSlug: D,
|
|
126
|
+
moduleId: j,
|
|
127
|
+
pageId: M,
|
|
128
|
+
workspaceId: k,
|
|
129
|
+
setAllTours: P,
|
|
130
|
+
allToursRef: B,
|
|
131
|
+
progressMutationVersionRef: re,
|
|
132
|
+
latestProgressMutationByTourRef: ie
|
|
133
|
+
}), ae = g(() => ({
|
|
134
|
+
tours: N,
|
|
425
135
|
pageTours: Y,
|
|
426
|
-
loading:
|
|
427
|
-
error:
|
|
136
|
+
loading: F,
|
|
137
|
+
error: L,
|
|
428
138
|
refetch: J,
|
|
429
139
|
trackProgress: Z,
|
|
430
140
|
recordStepCompletion: Q,
|
|
431
141
|
trackEvent: $,
|
|
432
142
|
autoStartTour: X,
|
|
433
|
-
productId:
|
|
434
|
-
moduleId:
|
|
435
|
-
pageId:
|
|
143
|
+
productId: D,
|
|
144
|
+
moduleId: j,
|
|
145
|
+
pageId: M
|
|
436
146
|
}), [
|
|
437
|
-
|
|
147
|
+
N,
|
|
438
148
|
X,
|
|
149
|
+
L,
|
|
439
150
|
F,
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
A,
|
|
151
|
+
j,
|
|
152
|
+
M,
|
|
443
153
|
Y,
|
|
444
|
-
|
|
154
|
+
D,
|
|
445
155
|
Q,
|
|
446
156
|
J,
|
|
447
157
|
$,
|
|
448
158
|
Z
|
|
449
159
|
]);
|
|
450
|
-
return /* @__PURE__ */
|
|
451
|
-
value:
|
|
452
|
-
children:
|
|
160
|
+
return /* @__PURE__ */ ne(b.Provider, {
|
|
161
|
+
value: ae,
|
|
162
|
+
children: f
|
|
453
163
|
});
|
|
454
164
|
}
|
|
455
|
-
function
|
|
456
|
-
let e =
|
|
165
|
+
function S() {
|
|
166
|
+
let e = p(b);
|
|
457
167
|
if (!e) throw Error("useToursContext must be used within a ToursProvider");
|
|
458
168
|
return e;
|
|
459
169
|
}
|
|
460
|
-
function
|
|
461
|
-
return
|
|
170
|
+
function C() {
|
|
171
|
+
return p(b) || {
|
|
462
172
|
tours: [],
|
|
463
173
|
pageTours: [],
|
|
464
174
|
loading: !1,
|
|
@@ -473,8 +183,8 @@ function D() {
|
|
|
473
183
|
pageId: void 0
|
|
474
184
|
};
|
|
475
185
|
}
|
|
476
|
-
function
|
|
477
|
-
let e =
|
|
186
|
+
function w() {
|
|
187
|
+
let e = S();
|
|
478
188
|
return {
|
|
479
189
|
tours: e.pageTours,
|
|
480
190
|
loading: e.loading,
|
|
@@ -483,8 +193,8 @@ function O() {
|
|
|
483
193
|
trackProgress: e.trackProgress
|
|
484
194
|
};
|
|
485
195
|
}
|
|
486
|
-
function
|
|
487
|
-
return
|
|
196
|
+
function T() {
|
|
197
|
+
return S().autoStartTour;
|
|
488
198
|
}
|
|
489
199
|
//#endregion
|
|
490
|
-
export {
|
|
200
|
+
export { x as ToursProvider, T as useAutoStartTour, C as useSafeToursContext, w as useTours, S as useToursContext };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { TourListItemDesktop as e } from "./TourListItemDesktop.js";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import { Sparkles as n } from "lucide-react";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
//#region src/shared/tours/tourTrigger/DesktopTourDropdown.tsx
|
|
6
|
+
var a = t(function({ loading: t, tours: a, onStartTour: o }, s) {
|
|
7
|
+
return /* @__PURE__ */ i("div", {
|
|
8
|
+
ref: s,
|
|
9
|
+
className: "absolute right-0 top-full mt-2 w-80 bg-bg-surface rounded-lg shadow-xl border border-border-subtle z-50 animate-in fade-in slide-in-from-top-2 duration-200",
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ i("div", {
|
|
12
|
+
className: "flex items-center gap-2 px-4 py-3 border-b border-border-subtle",
|
|
13
|
+
children: [/* @__PURE__ */ r(n, { className: "size-4 text-action-primary-bg" }), /* @__PURE__ */ r("h3", {
|
|
14
|
+
className: "font-medium text-text-primary",
|
|
15
|
+
children: "Product Tours"
|
|
16
|
+
})]
|
|
17
|
+
}),
|
|
18
|
+
/* @__PURE__ */ r("div", {
|
|
19
|
+
className: "max-h-80 overflow-y-auto",
|
|
20
|
+
children: t ? /* @__PURE__ */ r("div", {
|
|
21
|
+
className: "flex items-center justify-center py-6",
|
|
22
|
+
children: /* @__PURE__ */ r("div", { className: "animate-spin rounded-full size-5 border-2 border-action-primary-bg border-t-transparent" })
|
|
23
|
+
}) : a.length > 0 ? /* @__PURE__ */ r("div", {
|
|
24
|
+
className: "p-2",
|
|
25
|
+
children: a.map((t) => /* @__PURE__ */ r(e, {
|
|
26
|
+
tour: t,
|
|
27
|
+
onStart: o
|
|
28
|
+
}, t.id))
|
|
29
|
+
}) : /* @__PURE__ */ r("div", {
|
|
30
|
+
className: "text-center py-6 px-4",
|
|
31
|
+
children: /* @__PURE__ */ r("p", {
|
|
32
|
+
className: "text-sm text-text-secondary",
|
|
33
|
+
children: "No tours available for this page"
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
}),
|
|
37
|
+
a.length > 0 && /* @__PURE__ */ r("div", {
|
|
38
|
+
className: "px-4 py-2 border-t border-border-subtle bg-bg-muted/50 rounded-b-lg",
|
|
39
|
+
children: /* @__PURE__ */ r("p", {
|
|
40
|
+
className: "text-xs text-text-tertiary text-center",
|
|
41
|
+
children: "Click a tour to start the guided walkthrough"
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
//#endregion
|
|
48
|
+
export { a as DesktopTourDropdown };
|