@burdenoff/microfe-tours 2026.527.1 → 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/tours/ToursUserRoutes.js +2 -4
- package/dist/tours/ToursUserRoutes.js.map +1 -1
- package/dist/tours/components/RouteHelpers.js +4 -4
- package/dist/tours/components/RouteHelpers.js.map +1 -1
- package/dist/tours/hooks/useTourPreview.js +39 -39
- package/dist/tours/hooks/useTourPreview.js.map +1 -1
- package/dist/tours/hooks/useToursList.js.map +1 -1
- package/dist/tours/i18n.js +4 -0
- package/dist/tours/i18n.js.map +1 -1
- package/dist/tours/pages/MediaLibraryPage.js +11 -8
- package/dist/tours/pages/MediaLibraryPage.js.map +1 -1
- package/dist/tours/pages/MyToursPage.js +59 -57
- package/dist/tours/pages/MyToursPage.js.map +1 -1
- package/dist/tours/pages/MyToursProgressPage.js +65 -61
- package/dist/tours/pages/MyToursProgressPage.js.map +1 -1
- package/dist/tours/pages/SchedulerPage.js +18 -4
- package/dist/tours/pages/SchedulerPage.js.map +1 -1
- package/dist/tours/pages/StepEditorPage.js +330 -276
- package/dist/tours/pages/StepEditorPage.js.map +1 -1
- package/dist/tours/pages/TemplateLibraryPage.js +7 -2
- package/dist/tours/pages/TemplateLibraryPage.js.map +1 -1
- package/dist/tours/pages/TourBuilderPage.js +144 -101
- package/dist/tours/pages/TourBuilderPage.js.map +1 -1
- package/dist/tours/pages/TourPreviewPage.js +12 -4
- package/dist/tours/pages/TourPreviewPage.js.map +1 -1
- package/dist/tours/pages/ToursListPage.js +165 -149
- package/dist/tours/pages/ToursListPage.js.map +1 -1
- package/dist/tours/providers/ToursProvider.js +1 -1
- package/dist/tours/providers/ToursProvider.js.map +1 -1
- package/dist/tours/utils/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -11,11 +11,11 @@ import { PermissionGate as l } from "@burdenoff/fe-libs/shared/components";
|
|
|
11
11
|
import { ArrowLeft as re, BarChart3 as ie, Calendar as ae, Eye as oe, LayoutTemplate as se, ListOrdered as ce, Save as le, Sparkles as ue } from "lucide-react";
|
|
12
12
|
import { Fragment as de, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
13
13
|
import { useNavigate as fe, useParams as pe } from "react-router-dom";
|
|
14
|
-
import { useGatewayClient as
|
|
15
|
-
import { useEventBus as
|
|
16
|
-
import { gql as
|
|
14
|
+
import { useGatewayClient as me } from "@burdenoff/fe-libs/shared/graphql";
|
|
15
|
+
import { useEventBus as he } from "@burdenoff/fe-libs/shared/events";
|
|
16
|
+
import { gql as f } from "@apollo/client/core";
|
|
17
17
|
//#region src/tours/pages/TourBuilderPage.tsx
|
|
18
|
-
var
|
|
18
|
+
var ge = 250, _e = f`
|
|
19
19
|
mutation SeedVibeControlsUserTours {
|
|
20
20
|
seedVibeControlsUserTours {
|
|
21
21
|
productId
|
|
@@ -33,7 +33,7 @@ var he = 250, ge = p`
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
`;
|
|
36
|
-
function
|
|
36
|
+
function ve(e) {
|
|
37
37
|
if (!e || typeof e != "object") return null;
|
|
38
38
|
let t = e, n = t.error;
|
|
39
39
|
if (n instanceof Error) return n.message;
|
|
@@ -47,7 +47,7 @@ function _e(e) {
|
|
|
47
47
|
}).filter((e) => !!e);
|
|
48
48
|
return i.length > 0 ? i.join("; ") : "Seed mutation returned errors.";
|
|
49
49
|
}
|
|
50
|
-
var
|
|
50
|
+
var p = [
|
|
51
51
|
{
|
|
52
52
|
productId: "vibecontrols",
|
|
53
53
|
moduleId: "dashboard",
|
|
@@ -280,37 +280,38 @@ var m = [
|
|
|
280
280
|
path: "/conversations/settings"
|
|
281
281
|
}
|
|
282
282
|
];
|
|
283
|
-
function
|
|
283
|
+
function m(e) {
|
|
284
284
|
return e?.trim() || void 0;
|
|
285
285
|
}
|
|
286
|
-
function
|
|
287
|
-
let t =
|
|
288
|
-
return t ?
|
|
286
|
+
function h(e) {
|
|
287
|
+
let t = m(e);
|
|
288
|
+
return t ? p.filter((e) => e.productId === t) : [];
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function ye(e) {
|
|
291
291
|
let t = /* @__PURE__ */ new Map();
|
|
292
|
-
for (let n of
|
|
292
|
+
for (let n of h(e)) (!t.get(n.moduleId) || n.isModuleHome) && t.set(n.moduleId, {
|
|
293
293
|
moduleId: n.moduleId,
|
|
294
294
|
label: n.moduleLabel,
|
|
295
295
|
path: n.path
|
|
296
296
|
});
|
|
297
297
|
return [...t.values()];
|
|
298
298
|
}
|
|
299
|
-
function
|
|
300
|
-
let n =
|
|
301
|
-
return n ?
|
|
299
|
+
function be(e, t) {
|
|
300
|
+
let n = m(t);
|
|
301
|
+
return n ? h(e).flatMap((e) => e.moduleId === n ? [{
|
|
302
302
|
pageId: e.pageId,
|
|
303
303
|
label: e.pageLabel,
|
|
304
304
|
path: e.path
|
|
305
|
-
})
|
|
305
|
+
}] : []) : [];
|
|
306
306
|
}
|
|
307
|
-
function
|
|
308
|
-
let { tr:
|
|
307
|
+
function g() {
|
|
308
|
+
let { tr: f } = ee(), { tourId: p } = pe(), m = fe(), h = e(), { basePath: g = "/" } = h, _ = he(), xe = me("global"), { hasPermission: v, isLoading: y } = r(), b = !p || p === "new", x = v(i.TOUR_CREATE), S = v(i.TOUR_UPDATE), Se = v(i.TOUR_TEMPLATE_CREATE), C = b ? x : S, w = x && S, { tour: T, loadTour: E, createTour: Ce, updateTour: we, saving: D, validationErrors: O, error: k } = te(p), { saveAsTemplate: Te } = n(), { data: A, loading: j } = t({
|
|
309
309
|
variables: {
|
|
310
|
-
limit:
|
|
310
|
+
limit: ge,
|
|
311
311
|
offset: 0
|
|
312
312
|
},
|
|
313
|
-
fetchPolicy: "cache-and-network"
|
|
313
|
+
fetchPolicy: "cache-and-network",
|
|
314
|
+
skip: y || !C
|
|
314
315
|
}), [M, N] = c({
|
|
315
316
|
name: "",
|
|
316
317
|
description: "",
|
|
@@ -324,12 +325,17 @@ function _() {
|
|
|
324
325
|
displayOrder: 1,
|
|
325
326
|
startDate: "",
|
|
326
327
|
endDate: ""
|
|
327
|
-
}), [P, F] = c(!1), [I, L] = c(!1), [R, z] = c(!1), [B, V] = c(!1), [H, U] = c(null), [W, G] = c(null), K = ne(!1), q = s(() => [...A?.platformProducts.items ?? []].sort((e, t) => e.name.localeCompare(t.name)), [A]), J = s(() => new Set(q.map((e) => e.slug)), [q]), Y = s(() =>
|
|
328
|
+
}), [P, F] = c(!1), [I, L] = c(!1), [R, z] = c(!1), [B, V] = c(!1), [H, U] = c(null), [W, G] = c(null), K = ne(!1), q = s(() => [...A?.platformProducts.items ?? []].sort((e, t) => e.name.localeCompare(t.name)), [A]), J = s(() => new Set(q.map((e) => e.slug)), [q]), Y = s(() => ye(M.productId), [M.productId]), X = s(() => new Set(Y.map((e) => e.moduleId)), [Y]), Z = s(() => be(M.productId, M.moduleId), [M.moduleId, M.productId]), Q = s(() => new Set(Z.map((e) => e.pageId)), [Z]);
|
|
328
329
|
o(() => {
|
|
329
|
-
|
|
330
|
-
}, [
|
|
331
|
-
|
|
332
|
-
|
|
330
|
+
K.current || !y && C && p && p !== "new" && E(p);
|
|
331
|
+
}, [
|
|
332
|
+
C,
|
|
333
|
+
E,
|
|
334
|
+
y,
|
|
335
|
+
p
|
|
336
|
+
]), o(() => {
|
|
337
|
+
T && !K.current && (N(T), K.current = !0);
|
|
338
|
+
}, [T]), o(() => {
|
|
333
339
|
if (!M.productId || j) {
|
|
334
340
|
F(!1);
|
|
335
341
|
return;
|
|
@@ -363,75 +369,82 @@ function _() {
|
|
|
363
369
|
Q,
|
|
364
370
|
Z.length
|
|
365
371
|
]);
|
|
366
|
-
let
|
|
372
|
+
let Ee = !!(M.productId && !P && !J.has(M.productId)), De = !!(M.moduleId && !I && !X.has(M.moduleId)), Oe = !!(M.pageId && !R && !Q.has(M.pageId)), ke = async (e) => {
|
|
367
373
|
e.preventDefault();
|
|
368
374
|
try {
|
|
369
|
-
|
|
375
|
+
p && p !== "new" ? await we(p, M) : await Ce(M);
|
|
370
376
|
} catch {
|
|
371
|
-
a(
|
|
377
|
+
a(_, "tour.save", h);
|
|
372
378
|
}
|
|
373
|
-
},
|
|
374
|
-
|
|
379
|
+
}, Ae = () => {
|
|
380
|
+
m(`${g}/list`);
|
|
375
381
|
}, $ = (e) => {
|
|
376
382
|
if (!e) return "";
|
|
377
383
|
let t = new Date(e);
|
|
378
384
|
return Number.isNaN(t.getTime()) ? "" : (/* @__PURE__ */ new Date(t.getTime() - t.getTimezoneOffset() * 6e4)).toISOString().slice(0, 16);
|
|
379
|
-
},
|
|
380
|
-
if (!
|
|
381
|
-
let e = `${M.name ||
|
|
385
|
+
}, je = async () => {
|
|
386
|
+
if (!p || p === "new") return;
|
|
387
|
+
let e = `${M.name || T?.name || "Tour"} Template`, t = window.prompt("Template name", e);
|
|
382
388
|
if (!t) return;
|
|
383
389
|
let n = window.prompt("Template category (ONBOARDING, FEATURE_ANNOUNCEMENT, HELP, CUSTOM)", "ONBOARDING") || "ONBOARDING";
|
|
384
390
|
try {
|
|
385
|
-
await
|
|
391
|
+
await Te(p, {
|
|
386
392
|
name: t,
|
|
387
393
|
description: M.description,
|
|
388
394
|
category: n,
|
|
389
395
|
isPublic: !1
|
|
390
|
-
}),
|
|
396
|
+
}), m(`${g}/templates`);
|
|
391
397
|
} catch {
|
|
392
|
-
a(
|
|
398
|
+
a(_, "template.save", h);
|
|
393
399
|
}
|
|
394
|
-
},
|
|
395
|
-
if (window.confirm(
|
|
400
|
+
}, Me = async () => {
|
|
401
|
+
if (window.confirm(f("tourBuilder.seedVibeControls.confirm"))) {
|
|
396
402
|
V(!0), U(null), G(null);
|
|
397
403
|
try {
|
|
398
|
-
let e = await
|
|
404
|
+
let e = await xe.mutate({ mutation: _e }), t = ve(e);
|
|
399
405
|
if (t) throw Error(t);
|
|
400
406
|
let n = e.data?.seedVibeControlsUserTours;
|
|
401
407
|
if (!n) throw Error("Seed mutation returned no result.");
|
|
402
408
|
U(n);
|
|
403
409
|
} catch (e) {
|
|
404
|
-
let t = e instanceof Error ? e.message :
|
|
405
|
-
G(t),
|
|
410
|
+
let t = e instanceof Error ? e.message : f("tourBuilder.seedVibeControls.error");
|
|
411
|
+
G(t), _.emit("tours.api.failed", {
|
|
406
412
|
route: "/tours",
|
|
407
413
|
operation: "tour.seed_vibecontrols_user_tours",
|
|
408
414
|
errorMessage: t,
|
|
409
|
-
productId:
|
|
410
|
-
workspaceId:
|
|
415
|
+
productId: h.productId,
|
|
416
|
+
workspaceId: h.workspaceId
|
|
411
417
|
}, { component: "microfe-tours" });
|
|
412
418
|
} finally {
|
|
413
419
|
V(!1);
|
|
414
420
|
}
|
|
415
421
|
}
|
|
416
422
|
};
|
|
417
|
-
return /* @__PURE__ */
|
|
423
|
+
return y ? /* @__PURE__ */ u("div", {
|
|
424
|
+
className: "flex h-full items-center justify-center p-3 sm:p-6",
|
|
425
|
+
children: /* @__PURE__ */ u("p", {
|
|
426
|
+
className: "text-sm text-muted-foreground",
|
|
427
|
+
children: f("tourBuilder.loading")
|
|
428
|
+
})
|
|
429
|
+
}) : C ? /* @__PURE__ */ d("div", {
|
|
418
430
|
className: "space-y-4 sm:space-y-6 p-3 sm:p-6 max-w-4xl mx-auto",
|
|
419
431
|
children: [
|
|
420
432
|
/* @__PURE__ */ d("div", {
|
|
421
433
|
className: "flex items-center gap-4",
|
|
422
434
|
children: [/* @__PURE__ */ u("button", {
|
|
423
|
-
|
|
435
|
+
type: "button",
|
|
436
|
+
onClick: Ae,
|
|
424
437
|
className: "p-2 hover:bg-accent rounded-md",
|
|
425
|
-
"aria-label":
|
|
438
|
+
"aria-label": f("tourBuilder.goBack"),
|
|
426
439
|
children: /* @__PURE__ */ u(re, { size: 20 })
|
|
427
440
|
}), /* @__PURE__ */ d("div", {
|
|
428
441
|
className: "flex-1",
|
|
429
442
|
children: [/* @__PURE__ */ u("h1", {
|
|
430
443
|
className: "text-xl sm:text-2xl font-bold text-foreground",
|
|
431
|
-
children: p
|
|
444
|
+
children: f(p && p !== "new" ? "tourBuilder.titleEdit" : "tourBuilder.titleCreate")
|
|
432
445
|
}), /* @__PURE__ */ u("p", {
|
|
433
446
|
className: "text-sm text-muted-foreground",
|
|
434
|
-
children:
|
|
447
|
+
children: f("tourBuilder.subtitle")
|
|
435
448
|
})]
|
|
436
449
|
})]
|
|
437
450
|
}),
|
|
@@ -444,22 +457,22 @@ function _() {
|
|
|
444
457
|
className: "space-y-1",
|
|
445
458
|
children: [/* @__PURE__ */ u("h2", {
|
|
446
459
|
className: "text-lg font-semibold text-foreground",
|
|
447
|
-
children:
|
|
460
|
+
children: f("tourBuilder.seedVibeControls.title")
|
|
448
461
|
}), /* @__PURE__ */ u("p", {
|
|
449
462
|
className: "text-sm text-muted-foreground",
|
|
450
|
-
children:
|
|
463
|
+
children: f("tourBuilder.seedVibeControls.description")
|
|
451
464
|
})]
|
|
452
465
|
}), /* @__PURE__ */ d("button", {
|
|
453
466
|
type: "button",
|
|
454
|
-
onClick: () => void
|
|
455
|
-
disabled: B || !
|
|
467
|
+
onClick: () => void Me(),
|
|
468
|
+
disabled: B || !w,
|
|
456
469
|
className: "inline-flex min-h-11 items-center justify-center gap-2 rounded-md border border-border bg-secondary px-4 py-2 text-sm font-medium text-secondary-foreground hover:bg-secondary/80 disabled:cursor-not-allowed disabled:opacity-50",
|
|
457
|
-
children: [/* @__PURE__ */ u(ue, { size: 18 }),
|
|
470
|
+
children: [/* @__PURE__ */ u(ue, { size: 18 }), f(B ? "tourBuilder.seedVibeControls.loading" : "tourBuilder.seedVibeControls.button")]
|
|
458
471
|
})]
|
|
459
472
|
}),
|
|
460
|
-
|
|
473
|
+
w ? null : /* @__PURE__ */ u("p", {
|
|
461
474
|
className: "mt-3 text-sm text-muted-foreground",
|
|
462
|
-
children:
|
|
475
|
+
children: f("tourBuilder.seedVibeControls.permissionHint")
|
|
463
476
|
}),
|
|
464
477
|
W ? /* @__PURE__ */ u("p", {
|
|
465
478
|
className: "mt-3 text-sm text-destructive",
|
|
@@ -467,7 +480,7 @@ function _() {
|
|
|
467
480
|
}) : null,
|
|
468
481
|
H ? /* @__PURE__ */ u("div", {
|
|
469
482
|
className: "mt-3 rounded-md border border-border bg-background p-3 text-sm text-muted-foreground",
|
|
470
|
-
children:
|
|
483
|
+
children: f("tourBuilder.seedVibeControls.result", {
|
|
471
484
|
totalCount: H.totalCount,
|
|
472
485
|
productId: H.productId,
|
|
473
486
|
workspaceId: H.workspaceId,
|
|
@@ -478,21 +491,21 @@ function _() {
|
|
|
478
491
|
]
|
|
479
492
|
}) : null,
|
|
480
493
|
/* @__PURE__ */ d("form", {
|
|
481
|
-
onSubmit:
|
|
494
|
+
onSubmit: ke,
|
|
482
495
|
className: "space-y-6",
|
|
483
496
|
children: [
|
|
484
497
|
/* @__PURE__ */ d("div", {
|
|
485
498
|
className: "border border-border rounded-md p-4 sm:p-6 bg-card",
|
|
486
499
|
children: [/* @__PURE__ */ u("h2", {
|
|
487
500
|
className: "text-lg font-semibold mb-4",
|
|
488
|
-
children:
|
|
501
|
+
children: f("tourBuilder.sectionBasicInfo")
|
|
489
502
|
}), /* @__PURE__ */ d("div", {
|
|
490
503
|
className: "space-y-4",
|
|
491
504
|
children: [
|
|
492
505
|
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
|
|
493
506
|
className: "block text-sm font-medium mb-2",
|
|
494
507
|
htmlFor: "tour-name",
|
|
495
|
-
children:
|
|
508
|
+
children: f("tourBuilder.labelName")
|
|
496
509
|
}), /* @__PURE__ */ u("input", {
|
|
497
510
|
id: "tour-name",
|
|
498
511
|
type: "text",
|
|
@@ -502,12 +515,13 @@ function _() {
|
|
|
502
515
|
name: e.target.value
|
|
503
516
|
}),
|
|
504
517
|
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
505
|
-
required: !0
|
|
518
|
+
required: !0,
|
|
519
|
+
"aria-label": f("tourBuilder.labelName")
|
|
506
520
|
})] }),
|
|
507
521
|
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
|
|
508
522
|
className: "block text-sm font-medium mb-2",
|
|
509
523
|
htmlFor: "tour-description",
|
|
510
|
-
children:
|
|
524
|
+
children: f("tourBuilder.labelDescription")
|
|
511
525
|
}), /* @__PURE__ */ u("textarea", {
|
|
512
526
|
id: "tour-description",
|
|
513
527
|
value: M.description || "",
|
|
@@ -516,13 +530,14 @@ function _() {
|
|
|
516
530
|
description: e.target.value
|
|
517
531
|
}),
|
|
518
532
|
rows: 3,
|
|
519
|
-
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground"
|
|
533
|
+
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
534
|
+
"aria-label": f("tourBuilder.labelDescription")
|
|
520
535
|
})] }),
|
|
521
536
|
/* @__PURE__ */ d("div", { children: [
|
|
522
537
|
/* @__PURE__ */ u("label", {
|
|
523
538
|
className: "block text-sm font-medium mb-2",
|
|
524
539
|
htmlFor: "product-id",
|
|
525
|
-
children:
|
|
540
|
+
children: f("tourBuilder.labelProductId")
|
|
526
541
|
}),
|
|
527
542
|
/* @__PURE__ */ d("select", {
|
|
528
543
|
id: "product-id",
|
|
@@ -546,6 +561,7 @@ function _() {
|
|
|
546
561
|
},
|
|
547
562
|
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
548
563
|
required: !0,
|
|
564
|
+
"aria-label": f("tourBuilder.labelProductId"),
|
|
549
565
|
children: [
|
|
550
566
|
/* @__PURE__ */ u("option", {
|
|
551
567
|
value: "",
|
|
@@ -553,7 +569,7 @@ function _() {
|
|
|
553
569
|
}),
|
|
554
570
|
j ? /* @__PURE__ */ u("option", {
|
|
555
571
|
disabled: !0,
|
|
556
|
-
children: "Loading products
|
|
572
|
+
children: "Loading products…"
|
|
557
573
|
}) : null,
|
|
558
574
|
q.map((e) => /* @__PURE__ */ d("option", {
|
|
559
575
|
value: e.slug,
|
|
@@ -564,7 +580,7 @@ function _() {
|
|
|
564
580
|
")"
|
|
565
581
|
]
|
|
566
582
|
}, e.id)),
|
|
567
|
-
|
|
583
|
+
Ee ? /* @__PURE__ */ d("option", {
|
|
568
584
|
value: M.productId,
|
|
569
585
|
children: ["Current: ", M.productId]
|
|
570
586
|
}) : null,
|
|
@@ -576,6 +592,7 @@ function _() {
|
|
|
576
592
|
}),
|
|
577
593
|
P ? /* @__PURE__ */ u("input", {
|
|
578
594
|
id: "product-id-custom",
|
|
595
|
+
"aria-label": "Custom product slug",
|
|
579
596
|
type: "text",
|
|
580
597
|
value: M.productId || "",
|
|
581
598
|
onChange: (e) => N({
|
|
@@ -617,6 +634,7 @@ function _() {
|
|
|
617
634
|
},
|
|
618
635
|
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
619
636
|
disabled: !M.productId,
|
|
637
|
+
"aria-label": "Module ID",
|
|
620
638
|
children: [
|
|
621
639
|
/* @__PURE__ */ u("option", {
|
|
622
640
|
value: "",
|
|
@@ -631,7 +649,7 @@ function _() {
|
|
|
631
649
|
")"
|
|
632
650
|
]
|
|
633
651
|
}, e.moduleId)),
|
|
634
|
-
|
|
652
|
+
De ? /* @__PURE__ */ d("option", {
|
|
635
653
|
value: M.moduleId,
|
|
636
654
|
children: ["Current: ", M.moduleId]
|
|
637
655
|
}) : null,
|
|
@@ -643,6 +661,7 @@ function _() {
|
|
|
643
661
|
}),
|
|
644
662
|
I ? /* @__PURE__ */ u("input", {
|
|
645
663
|
id: "module-id-custom",
|
|
664
|
+
"aria-label": "Custom module ID",
|
|
646
665
|
type: "text",
|
|
647
666
|
value: M.moduleId || "",
|
|
648
667
|
onChange: (e) => N({
|
|
@@ -677,6 +696,7 @@ function _() {
|
|
|
677
696
|
},
|
|
678
697
|
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
679
698
|
disabled: !M.productId,
|
|
699
|
+
"aria-label": "Page ID",
|
|
680
700
|
children: [
|
|
681
701
|
/* @__PURE__ */ u("option", {
|
|
682
702
|
value: "",
|
|
@@ -691,7 +711,7 @@ function _() {
|
|
|
691
711
|
")"
|
|
692
712
|
]
|
|
693
713
|
}, e.pageId)),
|
|
694
|
-
|
|
714
|
+
Oe ? /* @__PURE__ */ d("option", {
|
|
695
715
|
value: M.pageId,
|
|
696
716
|
children: ["Current: ", M.pageId]
|
|
697
717
|
}) : null,
|
|
@@ -703,6 +723,7 @@ function _() {
|
|
|
703
723
|
}),
|
|
704
724
|
R ? /* @__PURE__ */ u("input", {
|
|
705
725
|
id: "page-id-custom",
|
|
726
|
+
"aria-label": "Custom page ID",
|
|
706
727
|
type: "text",
|
|
707
728
|
value: M.pageId || "",
|
|
708
729
|
onChange: (e) => N({
|
|
@@ -723,7 +744,8 @@ function _() {
|
|
|
723
744
|
...M,
|
|
724
745
|
isActive: e.target.checked
|
|
725
746
|
}),
|
|
726
|
-
className: "
|
|
747
|
+
className: "size-4 rounded",
|
|
748
|
+
"aria-label": "Active"
|
|
727
749
|
}), /* @__PURE__ */ u("span", {
|
|
728
750
|
className: "text-sm font-medium",
|
|
729
751
|
children: "Active"
|
|
@@ -736,14 +758,14 @@ function _() {
|
|
|
736
758
|
className: "border border-border rounded-md p-4 sm:p-6 bg-card",
|
|
737
759
|
children: [/* @__PURE__ */ u("h2", {
|
|
738
760
|
className: "text-lg font-semibold mb-4",
|
|
739
|
-
children:
|
|
761
|
+
children: f("tourBuilder.sectionTriggerSettings")
|
|
740
762
|
}), /* @__PURE__ */ d("div", {
|
|
741
763
|
className: "space-y-4",
|
|
742
764
|
children: [
|
|
743
765
|
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
|
|
744
766
|
className: "block text-sm font-medium mb-2",
|
|
745
767
|
htmlFor: "trigger-type",
|
|
746
|
-
children:
|
|
768
|
+
children: f("tourBuilder.labelTriggerType")
|
|
747
769
|
}), /* @__PURE__ */ d("select", {
|
|
748
770
|
id: "trigger-type",
|
|
749
771
|
value: M.triggerType || "MANUAL",
|
|
@@ -752,33 +774,34 @@ function _() {
|
|
|
752
774
|
triggerType: e.target.value
|
|
753
775
|
}),
|
|
754
776
|
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
777
|
+
"aria-label": f("tourBuilder.labelTriggerType"),
|
|
755
778
|
children: [
|
|
756
779
|
/* @__PURE__ */ u("option", {
|
|
757
780
|
value: "MANUAL",
|
|
758
|
-
children:
|
|
781
|
+
children: f("tourBuilder.triggerManual")
|
|
759
782
|
}),
|
|
760
783
|
/* @__PURE__ */ u("option", {
|
|
761
784
|
value: "AUTO_FIRST_VISIT",
|
|
762
|
-
children:
|
|
785
|
+
children: f("tourBuilder.triggerAutoFirstVisit")
|
|
763
786
|
}),
|
|
764
787
|
/* @__PURE__ */ u("option", {
|
|
765
788
|
value: "AUTO_ALWAYS",
|
|
766
|
-
children:
|
|
789
|
+
children: f("tourBuilder.triggerAutoAlways")
|
|
767
790
|
}),
|
|
768
791
|
/* @__PURE__ */ u("option", {
|
|
769
792
|
value: "ON_EVENT",
|
|
770
|
-
children:
|
|
793
|
+
children: f("tourBuilder.triggerOnEvent")
|
|
771
794
|
}),
|
|
772
795
|
/* @__PURE__ */ u("option", {
|
|
773
796
|
value: "SCHEDULED",
|
|
774
|
-
children:
|
|
797
|
+
children: f("tourBuilder.triggerScheduled")
|
|
775
798
|
})
|
|
776
799
|
]
|
|
777
800
|
})] }),
|
|
778
801
|
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
|
|
779
802
|
className: "block text-sm font-medium mb-2",
|
|
780
803
|
htmlFor: "priority",
|
|
781
|
-
children:
|
|
804
|
+
children: f("tourBuilder.labelPriority")
|
|
782
805
|
}), /* @__PURE__ */ u("input", {
|
|
783
806
|
id: "priority",
|
|
784
807
|
type: "number",
|
|
@@ -792,7 +815,8 @@ function _() {
|
|
|
792
815
|
priority: t
|
|
793
816
|
});
|
|
794
817
|
},
|
|
795
|
-
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground"
|
|
818
|
+
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
819
|
+
"aria-label": f("tourBuilder.labelPriority")
|
|
796
820
|
})] }),
|
|
797
821
|
/* @__PURE__ */ d("div", {
|
|
798
822
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
@@ -808,7 +832,8 @@ function _() {
|
|
|
808
832
|
...M,
|
|
809
833
|
startDate: e.target.value ? new Date(e.target.value).toISOString() : void 0
|
|
810
834
|
}),
|
|
811
|
-
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground"
|
|
835
|
+
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
836
|
+
"aria-label": "Start Date"
|
|
812
837
|
})] }), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
|
|
813
838
|
className: "block text-sm font-medium mb-2",
|
|
814
839
|
htmlFor: "tour-end-date",
|
|
@@ -821,33 +846,34 @@ function _() {
|
|
|
821
846
|
...M,
|
|
822
847
|
endDate: e.target.value ? new Date(e.target.value).toISOString() : void 0
|
|
823
848
|
}),
|
|
824
|
-
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground"
|
|
849
|
+
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
850
|
+
"aria-label": "End Date"
|
|
825
851
|
})] })]
|
|
826
852
|
})
|
|
827
853
|
]
|
|
828
854
|
})]
|
|
829
855
|
}),
|
|
830
|
-
|
|
856
|
+
k && /* @__PURE__ */ d("div", {
|
|
831
857
|
className: "border border-destructive rounded-md p-4 bg-destructive/10",
|
|
832
858
|
children: [/* @__PURE__ */ u("h3", {
|
|
833
859
|
className: "font-semibold text-destructive mb-2",
|
|
834
|
-
children:
|
|
860
|
+
children: f("tourBuilder.errorTitle")
|
|
835
861
|
}), /* @__PURE__ */ u("p", {
|
|
836
862
|
className: "text-sm text-destructive",
|
|
837
|
-
children:
|
|
863
|
+
children: k.message
|
|
838
864
|
})]
|
|
839
865
|
}),
|
|
840
|
-
|
|
866
|
+
O.length > 0 && /* @__PURE__ */ d("div", {
|
|
841
867
|
className: "border border-destructive rounded-md p-4 bg-destructive/10",
|
|
842
868
|
children: [/* @__PURE__ */ u("h3", {
|
|
843
869
|
className: "font-semibold text-destructive mb-2",
|
|
844
|
-
children:
|
|
870
|
+
children: f("tourBuilder.validationErrorsTitle")
|
|
845
871
|
}), /* @__PURE__ */ u("ul", {
|
|
846
872
|
className: "list-disc list-inside space-y-1",
|
|
847
|
-
children:
|
|
873
|
+
children: O.map((e) => /* @__PURE__ */ u("li", {
|
|
848
874
|
className: "text-sm text-destructive",
|
|
849
875
|
children: e.message
|
|
850
|
-
},
|
|
876
|
+
}, e.message))
|
|
851
877
|
})]
|
|
852
878
|
}),
|
|
853
879
|
/* @__PURE__ */ d("div", {
|
|
@@ -856,39 +882,39 @@ function _() {
|
|
|
856
882
|
permission: b ? i.TOUR_CREATE : i.TOUR_UPDATE,
|
|
857
883
|
children: /* @__PURE__ */ d("button", {
|
|
858
884
|
type: "submit",
|
|
859
|
-
disabled:
|
|
885
|
+
disabled: D || !C,
|
|
860
886
|
className: "flex-1 min-w-[200px] px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 disabled:opacity-50 flex items-center justify-center gap-2",
|
|
861
|
-
children: [/* @__PURE__ */ u(le, { size: 20 }),
|
|
887
|
+
children: [/* @__PURE__ */ u(le, { size: 20 }), f(D ? "tourBuilder.saving" : p && p !== "new" ? "tourBuilder.updateTour" : "tourBuilder.createAndAddSteps")]
|
|
862
888
|
})
|
|
863
|
-
}),
|
|
889
|
+
}), p && p !== "new" && /* @__PURE__ */ d(de, { children: [
|
|
864
890
|
/* @__PURE__ */ d("button", {
|
|
865
891
|
type: "button",
|
|
866
|
-
onClick: () =>
|
|
892
|
+
onClick: () => m(`${g}/${p}/steps`),
|
|
867
893
|
className: "px-4 py-2 bg-secondary text-secondary-foreground rounded-md hover:bg-secondary/80 flex items-center gap-2",
|
|
868
894
|
children: [
|
|
869
895
|
/* @__PURE__ */ u(ce, { size: 20 }),
|
|
870
|
-
|
|
871
|
-
|
|
896
|
+
f("tourBuilder.editSteps"),
|
|
897
|
+
T?.steps && T.steps.length > 0 && /* @__PURE__ */ u("span", {
|
|
872
898
|
className: "ml-1 px-2 py-0.5 text-xs bg-primary/20 rounded-full",
|
|
873
|
-
children:
|
|
899
|
+
children: T.steps.length
|
|
874
900
|
})
|
|
875
901
|
]
|
|
876
902
|
}),
|
|
877
903
|
/* @__PURE__ */ d("button", {
|
|
878
904
|
type: "button",
|
|
879
|
-
onClick: () =>
|
|
905
|
+
onClick: () => m(`${g}/${p}/preview`),
|
|
880
906
|
className: "px-4 py-2 border border-border rounded-md hover:bg-accent flex items-center gap-2",
|
|
881
|
-
children: [/* @__PURE__ */ u(oe, { size: 20 }),
|
|
907
|
+
children: [/* @__PURE__ */ u(oe, { size: 20 }), f("tourBuilder.preview")]
|
|
882
908
|
}),
|
|
883
909
|
/* @__PURE__ */ d("button", {
|
|
884
910
|
type: "button",
|
|
885
|
-
onClick: () =>
|
|
911
|
+
onClick: () => m(`${g}/${p}/analytics`),
|
|
886
912
|
className: "px-4 py-2 border border-border rounded-md hover:bg-accent flex items-center gap-2",
|
|
887
|
-
children: [/* @__PURE__ */ u(ie, { size: 20 }),
|
|
913
|
+
children: [/* @__PURE__ */ u(ie, { size: 20 }), f("tourBuilder.analytics")]
|
|
888
914
|
}),
|
|
889
915
|
/* @__PURE__ */ d("button", {
|
|
890
916
|
type: "button",
|
|
891
|
-
onClick: () =>
|
|
917
|
+
onClick: () => m(`${g}/${p}/schedule`),
|
|
892
918
|
className: "px-4 py-2 border border-border rounded-md hover:bg-accent flex items-center gap-2",
|
|
893
919
|
children: [/* @__PURE__ */ u(ae, { size: 20 }), "Schedule"]
|
|
894
920
|
}),
|
|
@@ -896,8 +922,8 @@ function _() {
|
|
|
896
922
|
permission: i.TOUR_TEMPLATE_CREATE,
|
|
897
923
|
children: /* @__PURE__ */ d("button", {
|
|
898
924
|
type: "button",
|
|
899
|
-
onClick:
|
|
900
|
-
disabled: !
|
|
925
|
+
onClick: je,
|
|
926
|
+
disabled: !Se,
|
|
901
927
|
className: "px-4 py-2 border border-border rounded-md hover:bg-accent flex items-center gap-2 disabled:opacity-50",
|
|
902
928
|
children: [/* @__PURE__ */ u(se, { size: 20 }), "Save as Template"]
|
|
903
929
|
})
|
|
@@ -907,9 +933,26 @@ function _() {
|
|
|
907
933
|
]
|
|
908
934
|
})
|
|
909
935
|
]
|
|
936
|
+
}) : /* @__PURE__ */ u("div", {
|
|
937
|
+
className: "flex h-full items-center justify-center p-3 sm:p-6",
|
|
938
|
+
children: /* @__PURE__ */ d("div", {
|
|
939
|
+
className: "text-center space-y-4",
|
|
940
|
+
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h2", {
|
|
941
|
+
className: "text-lg font-semibold text-foreground mb-2",
|
|
942
|
+
children: f("tourBuilder.accessDeniedTitle")
|
|
943
|
+
}), /* @__PURE__ */ u("p", {
|
|
944
|
+
className: "text-sm text-muted-foreground",
|
|
945
|
+
children: f(b ? "tourBuilder.createAccessDeniedMessage" : "tourBuilder.updateAccessDeniedMessage")
|
|
946
|
+
})] }), /* @__PURE__ */ u("button", {
|
|
947
|
+
type: "button",
|
|
948
|
+
onClick: Ae,
|
|
949
|
+
className: "inline-flex items-center justify-center rounded-md border border-border px-4 py-2 text-sm font-medium text-foreground hover:bg-accent",
|
|
950
|
+
children: f("tourBuilder.goBack")
|
|
951
|
+
})]
|
|
952
|
+
})
|
|
910
953
|
});
|
|
911
954
|
}
|
|
912
955
|
//#endregion
|
|
913
|
-
export {
|
|
956
|
+
export { g as TourBuilderPage };
|
|
914
957
|
|
|
915
958
|
//# sourceMappingURL=TourBuilderPage.js.map
|