@burdenoff/fe-libs 2026.514.2 → 2026.516.2
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/shared/events/sinks/RybbitSink.d.ts.map +1 -1
- package/dist/shared/events/sinks/RybbitSink.js +1 -1
- package/dist/shared/providers/AppShellProvider.d.ts.map +1 -1
- package/dist/shared/providers/AppShellProvider.js +2 -8
- package/dist/shared/tours/TourTrigger.d.ts +14 -5
- package/dist/shared/tours/TourTrigger.d.ts.map +1 -1
- package/dist/shared/tours/TourTrigger.js +189 -99
- package/dist/shared/tours/ToursContext.d.ts +1 -0
- package/dist/shared/tours/ToursContext.d.ts.map +1 -1
- package/dist/shared/tours/ToursContext.js +152 -119
- package/dist/shared/tours/index.d.ts +5 -1
- package/dist/shared/tours/index.d.ts.map +1 -1
- package/dist/shared/tours/progress.d.ts +7 -0
- package/dist/shared/tours/progress.d.ts.map +1 -0
- package/dist/shared/tours/progress.js +12 -0
- package/dist/shared/tours/routeCatalog.d.ts +42 -0
- package/dist/shared/tours/routeCatalog.d.ts.map +1 -0
- package/dist/shared/tours/routeCatalog.js +228 -0
- package/dist/shared/utils/apollo.d.ts.map +1 -1
- package/dist/shared/utils/apollo.js +32 -32
- package/dist/shared/utils/gatewayFetchRewrite.d.ts.map +1 -1
- package/dist/shared/utils/gatewayFetchRewrite.js +3 -3
- package/dist/shared-tours.js +6 -4
- package/dist/shared.js +19 -17
- package/package.json +2 -2
|
@@ -6,12 +6,14 @@ 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
8
|
import { detectDeviceType as a } from "./types.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
9
|
+
import { isTourVisibleForContext as o } from "./routeCatalog.js";
|
|
10
|
+
import { withTourProgressStatus as s } from "./progress.js";
|
|
11
|
+
import { createContext as c, useCallback as l, useContext as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
12
|
+
import { jsx as ee } from "react/jsx-runtime";
|
|
13
|
+
import { gql as h } from "@apollo/client/core";
|
|
14
|
+
import { useLocation as te } from "react-router-dom";
|
|
13
15
|
//#region src/shared/tours/ToursContext.tsx
|
|
14
|
-
var g =
|
|
16
|
+
var g = h`
|
|
15
17
|
fragment ToursCoreFields on Tour {
|
|
16
18
|
id
|
|
17
19
|
context {
|
|
@@ -33,7 +35,7 @@ var g = m`
|
|
|
33
35
|
priority
|
|
34
36
|
displayOrder
|
|
35
37
|
}
|
|
36
|
-
`, _ =
|
|
38
|
+
`, _ = h`
|
|
37
39
|
fragment ToursStepFields on Tour {
|
|
38
40
|
steps {
|
|
39
41
|
id
|
|
@@ -69,7 +71,7 @@ var g = m`
|
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
}
|
|
72
|
-
`, v =
|
|
74
|
+
`, v = h`
|
|
73
75
|
${g}
|
|
74
76
|
${_}
|
|
75
77
|
query GetToursForContext($context: TourContextInput!) {
|
|
@@ -82,7 +84,7 @@ var g = m`
|
|
|
82
84
|
...ToursStepFields
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
|
-
`, y =
|
|
87
|
+
`, y = h`
|
|
86
88
|
${g}
|
|
87
89
|
${_}
|
|
88
90
|
query GetToursForContextFallback($context: TourContextInput!) {
|
|
@@ -96,7 +98,7 @@ function b(e) {
|
|
|
96
98
|
let t = e instanceof Error || typeof e == "object" && e && "message" in e && typeof e.message == "string" ? e.message : "";
|
|
97
99
|
return t.includes("myProgress") ? t.includes("Cannot query field") || t.includes("Unknown field") : !1;
|
|
98
100
|
}
|
|
99
|
-
var
|
|
101
|
+
var ne = h`
|
|
100
102
|
mutation StartTour($tourId: ID!, $userId: ID!, $deviceType: DeviceType) {
|
|
101
103
|
startTour(tourId: $tourId, userId: $userId, deviceType: $deviceType) {
|
|
102
104
|
id
|
|
@@ -110,7 +112,7 @@ var x = m`
|
|
|
110
112
|
lastViewedAt
|
|
111
113
|
}
|
|
112
114
|
}
|
|
113
|
-
`,
|
|
115
|
+
`, re = h`
|
|
114
116
|
mutation CompleteTour($tourId: ID!, $userId: ID!) {
|
|
115
117
|
completeTour(tourId: $tourId, userId: $userId) {
|
|
116
118
|
id
|
|
@@ -124,7 +126,7 @@ var x = m`
|
|
|
124
126
|
lastViewedAt
|
|
125
127
|
}
|
|
126
128
|
}
|
|
127
|
-
`,
|
|
129
|
+
`, ie = h`
|
|
128
130
|
mutation SkipTour($tourId: ID!, $userId: ID!) {
|
|
129
131
|
skipTour(tourId: $tourId, userId: $userId) {
|
|
130
132
|
id
|
|
@@ -138,7 +140,7 @@ var x = m`
|
|
|
138
140
|
lastViewedAt
|
|
139
141
|
}
|
|
140
142
|
}
|
|
141
|
-
`,
|
|
143
|
+
`, ae = h`
|
|
142
144
|
mutation CompleteStep($tourId: ID!, $stepId: ID!, $userId: ID!) {
|
|
143
145
|
completeStep(tourId: $tourId, stepId: $stepId, userId: $userId) {
|
|
144
146
|
id
|
|
@@ -152,7 +154,7 @@ var x = m`
|
|
|
152
154
|
lastViewedAt
|
|
153
155
|
}
|
|
154
156
|
}
|
|
155
|
-
`,
|
|
157
|
+
`, oe = h`
|
|
156
158
|
mutation TrackTourEvent($input: RecordTourAnalyticsInput!) {
|
|
157
159
|
trackTourEvent(input: $input) {
|
|
158
160
|
id
|
|
@@ -163,26 +165,26 @@ var x = m`
|
|
|
163
165
|
timestamp
|
|
164
166
|
}
|
|
165
167
|
}
|
|
166
|
-
`,
|
|
168
|
+
`, x = [
|
|
167
169
|
"The client has been stopped",
|
|
168
170
|
"QueryManager stopped",
|
|
169
171
|
"This Apollo Client has been destroyed",
|
|
170
172
|
"aborted"
|
|
171
173
|
];
|
|
172
|
-
function
|
|
174
|
+
function se(e) {
|
|
173
175
|
if (!(e instanceof Error)) return !1;
|
|
174
176
|
let t = e.message;
|
|
175
|
-
return e.name === "InvariantError" || t.startsWith("Invariant Violation") ?
|
|
177
|
+
return e.name === "InvariantError" || t.startsWith("Invariant Violation") ? x.some((e) => t.includes(e)) : !1;
|
|
176
178
|
}
|
|
177
|
-
function
|
|
179
|
+
function S(e, t) {
|
|
178
180
|
let n = e.split("/").filter(Boolean);
|
|
179
181
|
return n.length === 0 ? t : n[0];
|
|
180
182
|
}
|
|
181
|
-
function
|
|
183
|
+
function C() {
|
|
182
184
|
let e = a();
|
|
183
185
|
return e === "mobile" ? "MOBILE" : e === "tablet" ? "TABLET" : "DESKTOP";
|
|
184
186
|
}
|
|
185
|
-
function
|
|
187
|
+
function ce() {
|
|
186
188
|
let e = "bf-tour-session-id";
|
|
187
189
|
try {
|
|
188
190
|
let t = sessionStorage.getItem(e);
|
|
@@ -193,8 +195,8 @@ function E() {
|
|
|
193
195
|
return `tour-session-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
194
196
|
}
|
|
195
197
|
}
|
|
196
|
-
function
|
|
197
|
-
let i = e.split("/").filter(Boolean), a = r ? r(e) :
|
|
198
|
+
function w(e, t, n, r) {
|
|
199
|
+
let i = e.split("/").filter(Boolean), a = r ? r(e) : S(e, n);
|
|
198
200
|
return i.length === 0 ? {
|
|
199
201
|
moduleId: t,
|
|
200
202
|
pageId: a
|
|
@@ -206,45 +208,45 @@ function D(e, t, n, r) {
|
|
|
206
208
|
pageId: a
|
|
207
209
|
};
|
|
208
210
|
}
|
|
209
|
-
var
|
|
210
|
-
function
|
|
211
|
-
let g =
|
|
212
|
-
o,
|
|
211
|
+
var T = c(null);
|
|
212
|
+
function E({ children: a, defaultPageId: c = "home", getPageIdFromPath: u, disabled: h = !1 }) {
|
|
213
|
+
let g = te(), _ = e("global"), { workspaceId: x } = n(), { user: S } = t(), { productSlug: E } = r(), D = i("ToursContext"), O = x ?? void 0, k = h || g.pathname.startsWith("/devportal"), { moduleId: A, pageId: j } = f(() => w(g.pathname, E, c, u), [
|
|
213
214
|
c,
|
|
215
|
+
u,
|
|
214
216
|
g.pathname,
|
|
215
|
-
|
|
216
|
-
]), [
|
|
217
|
-
|
|
217
|
+
E
|
|
218
|
+
]), [M, N] = m([]), [P, F] = m(!1), [I, L] = m(null), 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);
|
|
219
|
+
d(() => (U.current = !0, () => {
|
|
218
220
|
U.current = !1;
|
|
219
221
|
}), []);
|
|
220
|
-
let K =
|
|
221
|
-
if (
|
|
222
|
-
U.current && (
|
|
222
|
+
let K = l(async (e = !1) => {
|
|
223
|
+
if (k) {
|
|
224
|
+
U.current && (N([]), F(!1), L(null));
|
|
223
225
|
return;
|
|
224
226
|
}
|
|
225
227
|
if (!_) return;
|
|
226
|
-
let t =
|
|
227
|
-
productSlug:
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}), n =
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
228
|
+
let t = D.child("fetch", {
|
|
229
|
+
productSlug: E,
|
|
230
|
+
workspaceId: O,
|
|
231
|
+
moduleId: A,
|
|
232
|
+
pageId: j
|
|
233
|
+
}), n = C(), r = [
|
|
234
|
+
E,
|
|
235
|
+
A ?? "",
|
|
236
|
+
j ?? "",
|
|
237
|
+
O,
|
|
236
238
|
n,
|
|
237
|
-
|
|
239
|
+
S?.id ?? "anonymous"
|
|
238
240
|
].join("::");
|
|
239
241
|
if (!e && H.current && V.current === r) return;
|
|
240
|
-
U.current && (
|
|
242
|
+
U.current && (F(!0), L(null));
|
|
241
243
|
let i = ++W.current;
|
|
242
244
|
try {
|
|
243
245
|
let e = { context: {
|
|
244
|
-
productId:
|
|
245
|
-
moduleId:
|
|
246
|
-
pageId:
|
|
247
|
-
workspaceId:
|
|
246
|
+
productId: E,
|
|
247
|
+
moduleId: A,
|
|
248
|
+
pageId: j,
|
|
249
|
+
workspaceId: O,
|
|
248
250
|
deviceType: n
|
|
249
251
|
} }, a = "network-only", o, s = G.current ? v : y;
|
|
250
252
|
try {
|
|
@@ -271,148 +273,178 @@ function k({ children: a, defaultPageId: o = "home", getPageIdFromPath: c, disab
|
|
|
271
273
|
else throw n;
|
|
272
274
|
}
|
|
273
275
|
let c = (o.data?.toursForContext ?? []).filter((e, t, n) => n.findIndex((t) => t.id === e.id) === t);
|
|
274
|
-
U.current && i === W.current && (
|
|
276
|
+
U.current && i === W.current && (N(c), V.current = r, H.current = !0);
|
|
275
277
|
} catch (e) {
|
|
276
|
-
if (!U.current || i !== W.current ||
|
|
278
|
+
if (!U.current || i !== W.current || se(e)) return;
|
|
277
279
|
let n = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to fetch tours");
|
|
278
|
-
t.error("Failed to fetch tours for context", n),
|
|
280
|
+
t.error("Failed to fetch tours for context", n), L(n), N([]);
|
|
279
281
|
} finally {
|
|
280
|
-
U.current && i === W.current &&
|
|
282
|
+
U.current && i === W.current && F(!1);
|
|
281
283
|
}
|
|
282
284
|
}, [
|
|
283
|
-
|
|
285
|
+
k,
|
|
284
286
|
_,
|
|
287
|
+
D,
|
|
285
288
|
A,
|
|
286
|
-
N,
|
|
287
|
-
P,
|
|
288
|
-
k,
|
|
289
289
|
j,
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
290
|
+
E,
|
|
291
|
+
O,
|
|
292
|
+
S?.id
|
|
293
|
+
]), q = p(S?.id);
|
|
294
|
+
d(() => {
|
|
295
|
+
q.current !== S?.id && (q.current = S?.id, H.current = !1, V.current = void 0, U.current && N([]));
|
|
296
|
+
}, [S?.id]), d(() => {
|
|
295
297
|
K();
|
|
296
|
-
}, [K])
|
|
297
|
-
|
|
298
|
+
}, [K]), d(() => {
|
|
299
|
+
R.current = M;
|
|
300
|
+
}, [M]);
|
|
301
|
+
let J = l(() => {
|
|
298
302
|
K(!0);
|
|
299
|
-
}, [K]), Y =
|
|
300
|
-
|
|
303
|
+
}, [K]), Y = f(() => M.filter((e) => e.isActive && e.steps?.length > 0 && o(e, {
|
|
304
|
+
productId: E,
|
|
305
|
+
moduleId: A,
|
|
306
|
+
pageId: j
|
|
307
|
+
})).sort((e, t) => (t.priority ?? 0) - (e.priority ?? 0)), [
|
|
308
|
+
M,
|
|
309
|
+
A,
|
|
310
|
+
j,
|
|
311
|
+
E
|
|
312
|
+
]), X = f(() => Y.find((e) => e.triggerType === "AUTO_FIRST_VISIT" || e.triggerType === "AUTO_ALWAYS") ?? null, [Y]), Z = l(async (e, t, n) => {
|
|
313
|
+
if (!_ || !S?.id) return;
|
|
314
|
+
let r = t === "started" ? "IN_PROGRESS" : t === "completed" ? "COMPLETED" : "SKIPPED", i = R.current.find((t) => t.id === e)?.myProgress, a = z.current + 1;
|
|
315
|
+
z.current = a, B.current.set(e, a), N((t) => {
|
|
316
|
+
let n = s(t, e, r);
|
|
317
|
+
return R.current = n, n;
|
|
318
|
+
});
|
|
319
|
+
try {
|
|
301
320
|
if (t === "started") {
|
|
302
321
|
await _.mutate({
|
|
303
|
-
mutation:
|
|
322
|
+
mutation: ne,
|
|
304
323
|
variables: {
|
|
305
324
|
tourId: e,
|
|
306
|
-
userId:
|
|
307
|
-
deviceType:
|
|
325
|
+
userId: S.id,
|
|
326
|
+
deviceType: C()
|
|
308
327
|
}
|
|
309
328
|
});
|
|
310
329
|
return;
|
|
311
330
|
}
|
|
312
331
|
if (t === "completed") {
|
|
313
332
|
await _.mutate({
|
|
314
|
-
mutation:
|
|
333
|
+
mutation: re,
|
|
315
334
|
variables: {
|
|
316
335
|
tourId: e,
|
|
317
|
-
userId:
|
|
336
|
+
userId: S.id
|
|
318
337
|
}
|
|
319
338
|
});
|
|
320
339
|
return;
|
|
321
340
|
}
|
|
322
341
|
await _.mutate({
|
|
323
|
-
mutation:
|
|
342
|
+
mutation: ie,
|
|
324
343
|
variables: {
|
|
325
344
|
tourId: e,
|
|
326
|
-
userId:
|
|
345
|
+
userId: S.id
|
|
327
346
|
}
|
|
328
347
|
});
|
|
329
|
-
} catch {
|
|
330
|
-
|
|
331
|
-
|
|
348
|
+
} catch {
|
|
349
|
+
if (B.current.get(e) !== a) return;
|
|
350
|
+
N((t) => {
|
|
351
|
+
let n = t.map((t) => t.id === e ? {
|
|
352
|
+
...t,
|
|
353
|
+
myProgress: i
|
|
354
|
+
} : t);
|
|
355
|
+
return R.current = n, n;
|
|
356
|
+
});
|
|
357
|
+
} finally {
|
|
358
|
+
B.current.get(e) === a && B.current.delete(e);
|
|
359
|
+
}
|
|
360
|
+
}, [_, S?.id]), Q = l(async (e, t) => {
|
|
361
|
+
if (!(!_ || !S?.id || !t)) try {
|
|
332
362
|
await _.mutate({
|
|
333
|
-
mutation:
|
|
363
|
+
mutation: ae,
|
|
334
364
|
variables: {
|
|
335
365
|
tourId: e,
|
|
336
366
|
stepId: t,
|
|
337
|
-
userId:
|
|
367
|
+
userId: S.id
|
|
338
368
|
}
|
|
339
369
|
});
|
|
340
370
|
} catch {}
|
|
341
|
-
}, [_,
|
|
342
|
-
if (!(!_ || !
|
|
371
|
+
}, [_, S?.id]), $ = l(async (e, t, n) => {
|
|
372
|
+
if (!(!_ || !S?.id)) try {
|
|
343
373
|
await _.mutate({
|
|
344
|
-
mutation:
|
|
374
|
+
mutation: oe,
|
|
345
375
|
variables: { input: {
|
|
346
376
|
tourId: t,
|
|
347
|
-
userId:
|
|
348
|
-
sessionId:
|
|
377
|
+
userId: S.id,
|
|
378
|
+
sessionId: ce(),
|
|
349
379
|
eventType: e,
|
|
350
380
|
stepId: n?.stepId,
|
|
351
381
|
stepOrder: n?.stepOrder,
|
|
352
|
-
productId:
|
|
353
|
-
moduleId:
|
|
354
|
-
pageId:
|
|
355
|
-
deviceType:
|
|
382
|
+
productId: E,
|
|
383
|
+
moduleId: A,
|
|
384
|
+
pageId: j,
|
|
385
|
+
deviceType: C(),
|
|
356
386
|
userAgent: typeof navigator < "u" ? navigator.userAgent : void 0,
|
|
357
387
|
duration: n?.duration,
|
|
358
388
|
metadata: n?.metadata,
|
|
359
|
-
context:
|
|
360
|
-
workspaceId:
|
|
361
|
-
productId:
|
|
362
|
-
moduleId:
|
|
363
|
-
pageId:
|
|
389
|
+
context: O ? {
|
|
390
|
+
workspaceId: O,
|
|
391
|
+
productId: E,
|
|
392
|
+
moduleId: A,
|
|
393
|
+
pageId: j
|
|
364
394
|
} : {
|
|
365
|
-
productId:
|
|
366
|
-
moduleId:
|
|
367
|
-
pageId:
|
|
395
|
+
productId: E,
|
|
396
|
+
moduleId: A,
|
|
397
|
+
pageId: j
|
|
368
398
|
}
|
|
369
399
|
} }
|
|
370
400
|
});
|
|
371
401
|
} catch {}
|
|
372
402
|
}, [
|
|
373
403
|
_,
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
]),
|
|
380
|
-
tours:
|
|
404
|
+
A,
|
|
405
|
+
j,
|
|
406
|
+
E,
|
|
407
|
+
S?.id,
|
|
408
|
+
O
|
|
409
|
+
]), le = f(() => ({
|
|
410
|
+
tours: M,
|
|
381
411
|
pageTours: Y,
|
|
382
|
-
loading:
|
|
383
|
-
error:
|
|
412
|
+
loading: P,
|
|
413
|
+
error: I,
|
|
384
414
|
refetch: J,
|
|
385
415
|
trackProgress: Z,
|
|
386
416
|
recordStepCompletion: Q,
|
|
387
417
|
trackEvent: $,
|
|
388
418
|
autoStartTour: X,
|
|
389
|
-
|
|
390
|
-
|
|
419
|
+
productId: E,
|
|
420
|
+
moduleId: A,
|
|
421
|
+
pageId: j
|
|
391
422
|
}), [
|
|
392
|
-
|
|
423
|
+
M,
|
|
393
424
|
X,
|
|
394
|
-
|
|
395
|
-
L,
|
|
396
|
-
N,
|
|
425
|
+
I,
|
|
397
426
|
P,
|
|
427
|
+
A,
|
|
428
|
+
j,
|
|
398
429
|
Y,
|
|
430
|
+
E,
|
|
399
431
|
Q,
|
|
400
432
|
J,
|
|
401
433
|
$,
|
|
402
434
|
Z
|
|
403
435
|
]);
|
|
404
|
-
return /* @__PURE__ */
|
|
405
|
-
value:
|
|
436
|
+
return /* @__PURE__ */ ee(T.Provider, {
|
|
437
|
+
value: le,
|
|
406
438
|
children: a
|
|
407
439
|
});
|
|
408
440
|
}
|
|
409
|
-
function
|
|
410
|
-
let e =
|
|
441
|
+
function D() {
|
|
442
|
+
let e = u(T);
|
|
411
443
|
if (!e) throw Error("useToursContext must be used within a ToursProvider");
|
|
412
444
|
return e;
|
|
413
445
|
}
|
|
414
|
-
function
|
|
415
|
-
return
|
|
446
|
+
function O() {
|
|
447
|
+
return u(T) || {
|
|
416
448
|
tours: [],
|
|
417
449
|
pageTours: [],
|
|
418
450
|
loading: !1,
|
|
@@ -422,12 +454,13 @@ function j() {
|
|
|
422
454
|
recordStepCompletion: async () => {},
|
|
423
455
|
trackEvent: async () => {},
|
|
424
456
|
autoStartTour: null,
|
|
457
|
+
productId: void 0,
|
|
425
458
|
moduleId: void 0,
|
|
426
459
|
pageId: void 0
|
|
427
460
|
};
|
|
428
461
|
}
|
|
429
|
-
function
|
|
430
|
-
let e =
|
|
462
|
+
function k() {
|
|
463
|
+
let e = D();
|
|
431
464
|
return {
|
|
432
465
|
tours: e.pageTours,
|
|
433
466
|
loading: e.loading,
|
|
@@ -436,8 +469,8 @@ function M() {
|
|
|
436
469
|
trackProgress: e.trackProgress
|
|
437
470
|
};
|
|
438
471
|
}
|
|
439
|
-
function
|
|
440
|
-
return
|
|
472
|
+
function A() {
|
|
473
|
+
return D().autoStartTour;
|
|
441
474
|
}
|
|
442
475
|
//#endregion
|
|
443
|
-
export {
|
|
476
|
+
export { E as ToursProvider, A as useAutoStartTour, O as useSafeToursContext, k as useTours, D as useToursContext };
|
|
@@ -40,8 +40,12 @@ export { TourPlayer, usePlayTour, TourTriggerButton } from './TourPlayer';
|
|
|
40
40
|
export { TourSpotlight } from './TourSpotlight';
|
|
41
41
|
export { TourTooltip } from './TourTooltip';
|
|
42
42
|
export { useTourPlayer } from './useTourPlayer';
|
|
43
|
-
export type { Tour, TourStep, TourStepMedia, TourStatus, TourTriggerType, StepPlacement, MediaType, MediaPosition, DeviceType, TourPlayerState, TourPlayerActions, TourPlayerContextValue, TourPlayerProviderProps, TourTooltipProps, TourSpotlightProps, } from './types';
|
|
43
|
+
export type { Tour, TourStep, TourStepMedia, TourStatus, TourUserStatus, TourUserProgressSummary, TourTriggerType, StepPlacement, MediaType, MediaPosition, DeviceType, TourPlayerState, TourPlayerActions, TourPlayerContextValue, TourPlayerProviderProps, TourTooltipProps, TourSpotlightProps, } from './types';
|
|
44
44
|
export { getResponsiveSelector, detectDeviceType } from './types';
|
|
45
|
+
export { getTourContextRank, getTourRouteCatalog, getTourRouteModules, getTourRoutePages, isTourVisibleForContext, normalizeTourPath, registerTourRouteCatalog, resolveTourTargetPath, } from './routeCatalog';
|
|
46
|
+
export type { TourCurrentContext, TourContextTarget, TourRouteCatalogEntry, TourRouteModuleOption, TourRoutePageOption, } from './routeCatalog';
|
|
47
|
+
export { withTourProgressStatus } from './progress';
|
|
48
|
+
export type { TourProgressCarrier } from './progress';
|
|
45
49
|
export { ToursProvider, useToursContext, useSafeToursContext, useTours, useAutoStartTour, } from './ToursContext';
|
|
46
50
|
export type { ToursContextValue, ToursProviderProps } from './ToursContext';
|
|
47
51
|
export { TourTrigger } from './TourTrigger';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/tours/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAGH,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,WAAW,EACX,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,YAAY,EACV,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,UAAU,EACV,eAAe,EACf,aAAa,EACb,SAAS,EACT,aAAa,EACb,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/tours/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAGH,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,WAAW,EACX,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,YAAY,EACV,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,UAAU,EACV,cAAc,EACd,uBAAuB,EACvB,eAAe,EACf,aAAa,EACb,SAAS,EACT,aAAa,EACb,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,YAAY,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGtD,OAAO,EACL,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,QAAQ,EACR,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAG5E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TourUserStatus, TourUserProgressSummary } from './types';
|
|
2
|
+
export interface TourProgressCarrier {
|
|
3
|
+
id: string;
|
|
4
|
+
myProgress?: TourUserProgressSummary | null;
|
|
5
|
+
}
|
|
6
|
+
export declare function withTourProgressStatus<T extends TourProgressCarrier>(tours: readonly T[], tourId: string, status: TourUserStatus): T[];
|
|
7
|
+
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/shared/tours/progress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvE,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;CAC7C;AAED,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,mBAAmB,EAClE,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,cAAc,GACrB,CAAC,EAAE,CAYL"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/shared/tours/progress.ts
|
|
2
|
+
function e(e, t, n) {
|
|
3
|
+
return e.map((e) => e.id === t ? {
|
|
4
|
+
...e,
|
|
5
|
+
myProgress: {
|
|
6
|
+
id: e.myProgress?.id ?? `optimistic-${t}`,
|
|
7
|
+
status: n
|
|
8
|
+
}
|
|
9
|
+
} : e);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { e as withTourProgressStatus };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export interface TourRouteCatalogEntry {
|
|
2
|
+
productId: string;
|
|
3
|
+
moduleId: string;
|
|
4
|
+
moduleLabel: string;
|
|
5
|
+
pageId: string;
|
|
6
|
+
pageLabel: string;
|
|
7
|
+
path: string;
|
|
8
|
+
isModuleHome?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface TourRouteModuleOption {
|
|
11
|
+
moduleId: string;
|
|
12
|
+
label: string;
|
|
13
|
+
path: string;
|
|
14
|
+
}
|
|
15
|
+
export interface TourRoutePageOption {
|
|
16
|
+
pageId: string;
|
|
17
|
+
label: string;
|
|
18
|
+
path: string;
|
|
19
|
+
}
|
|
20
|
+
export interface TourContextTarget {
|
|
21
|
+
productId?: string | null;
|
|
22
|
+
moduleId?: string | null;
|
|
23
|
+
pageId?: string | null;
|
|
24
|
+
}
|
|
25
|
+
export interface TourCurrentContext {
|
|
26
|
+
productId: string;
|
|
27
|
+
moduleId: string | null | undefined;
|
|
28
|
+
pageId: string | null | undefined;
|
|
29
|
+
}
|
|
30
|
+
export declare function normalizeTourPath(path: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Registers an app-owned route catalog for a product. Call the returned cleanup
|
|
33
|
+
* function from the same React effect that registered it.
|
|
34
|
+
*/
|
|
35
|
+
export declare function registerTourRouteCatalog(productId: string | null | undefined, entries: readonly TourRouteCatalogEntry[]): () => void;
|
|
36
|
+
export declare function getTourRouteCatalog(productId: string | null | undefined): TourRouteCatalogEntry[];
|
|
37
|
+
export declare function getTourRouteModules(productId: string | null | undefined): TourRouteModuleOption[];
|
|
38
|
+
export declare function getTourRoutePages(productId: string | null | undefined, moduleId: string | null | undefined): TourRoutePageOption[];
|
|
39
|
+
export declare function resolveTourTargetPath(tour: TourContextTarget): string | undefined;
|
|
40
|
+
export declare function isTourVisibleForContext(tour: TourContextTarget, context: TourCurrentContext): boolean;
|
|
41
|
+
export declare function getTourContextRank(tour: TourContextTarget, context: TourCurrentContext): number;
|
|
42
|
+
//# sourceMappingURL=routeCatalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routeCatalog.d.ts","sourceRoot":"","sources":["../../../src/shared/tours/routeCatalog.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACpC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACnC;AA6LD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGtD;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,EAAE,SAAS,qBAAqB,EAAE,GACxC,MAAM,IAAI,CAkCZ;AAED,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACnC,qBAAqB,EAAE,CAQzB;AAED,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACnC,qBAAqB,EAAE,CAezB;AAED,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAClC,mBAAmB,EAAE,CAWvB;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,iBAAiB,GACtB,MAAM,GAAG,SAAS,CAyBpB;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAyBT;AAED,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,kBAAkB,GAC1B,MAAM,CAKR"}
|