@burdenoff/microfe-tours 2026.626.2 → 2026.720.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/tours/components/MarkdownEditor.js +144 -0
- package/dist/tours/components/MarkdownEditor.js.map +1 -0
- package/dist/tours/i18n.js +8 -0
- package/dist/tours/i18n.js.map +1 -1
- package/dist/tours/pages/MyToursPage.js +66 -63
- package/dist/tours/pages/MyToursPage.js.map +1 -1
- package/dist/tours/pages/StepEditorPage.js +219 -222
- package/dist/tours/pages/StepEditorPage.js.map +1 -1
- package/dist/tours/pages/TourBuilderPage.js +421 -119
- package/dist/tours/pages/TourBuilderPage.js.map +1 -1
- package/dist/tours/pages/TourPreviewPage.js +112 -111
- package/dist/tours/pages/TourPreviewPage.js.map +1 -1
- package/dist/tours/pages/ToursListPage.js +85 -84
- package/dist/tours/pages/ToursListPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -4,19 +4,20 @@ import { useTourLifecycle as n } from "../hooks/useTourLifecycle.js";
|
|
|
4
4
|
import { useToursPermissionAccess as r } from "../hooks/useToursPermissionAccess.js";
|
|
5
5
|
import { TOUR_PERMISSIONS as i } from "../../constants/permissions.js";
|
|
6
6
|
import { useToursI18n as ee } from "../i18n.js";
|
|
7
|
-
import { emitToursApiFailed as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
7
|
+
import { emitToursApiFailed as te } from "../telemetry.js";
|
|
8
|
+
import { MarkdownEditor as ne } from "../components/MarkdownEditor.js";
|
|
9
|
+
import { useTourBuilder as re } from "../hooks/useTourBuilder.js";
|
|
10
|
+
import { useEffect as a, useMemo as o, useRef as ie, useState as s } from "react";
|
|
11
|
+
import { PermissionGate as ae } from "@burdenoff/fe-libs/shared/components";
|
|
12
|
+
import { ArrowLeft as oe, BarChart3 as c, Calendar as l, Eye as u, LayoutTemplate as se, ListOrdered as d, Save as ce, Sparkles as f } from "lucide-react";
|
|
13
|
+
import { Fragment as le, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
14
|
+
import { useNavigate as ue, useParams as de } from "react-router-dom";
|
|
15
|
+
import { Button as fe, CTAOverflowMenu as pe, EmphasisPanel as me, GlassCard as he, NextSteps as ge, PagePurpose as _e } from "@burdenoff/fe-libs/ui";
|
|
16
|
+
import { useGatewayClient as ve } from "@burdenoff/fe-libs/shared/graphql";
|
|
17
|
+
import { useEventBus as ye } from "@burdenoff/fe-libs/shared/events";
|
|
17
18
|
import { gql as h } from "@apollo/client/core";
|
|
18
19
|
//#region src/tours/pages/TourBuilderPage.tsx
|
|
19
|
-
var
|
|
20
|
+
var be = 250, xe = h`
|
|
20
21
|
mutation SeedVibeControlsUserTours {
|
|
21
22
|
seedVibeControlsUserTours {
|
|
22
23
|
productId
|
|
@@ -33,8 +34,25 @@ var ve = 250, ye = h`
|
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
}
|
|
37
|
+
`, Se = h`
|
|
38
|
+
mutation SeedBuildmyiqUserTours {
|
|
39
|
+
seedBuildmyiqUserTours {
|
|
40
|
+
productId
|
|
41
|
+
workspaceId
|
|
42
|
+
createdCount
|
|
43
|
+
updatedCount
|
|
44
|
+
totalCount
|
|
45
|
+
tours {
|
|
46
|
+
tourId
|
|
47
|
+
slug
|
|
48
|
+
name
|
|
49
|
+
action
|
|
50
|
+
stepCount
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
36
54
|
`;
|
|
37
|
-
function
|
|
55
|
+
function Ce(e) {
|
|
38
56
|
if (!e || typeof e != "object") return null;
|
|
39
57
|
let t = e, n = t.error;
|
|
40
58
|
if (n instanceof Error) return n.message;
|
|
@@ -414,6 +432,231 @@ var g = [
|
|
|
414
432
|
pageLabel: "Search",
|
|
415
433
|
path: "/search",
|
|
416
434
|
isModuleHome: !0
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
productId: "buildmyiq",
|
|
438
|
+
moduleId: "dashboard",
|
|
439
|
+
moduleLabel: "Dashboard",
|
|
440
|
+
pageId: "dashboard",
|
|
441
|
+
pageLabel: "Dashboard",
|
|
442
|
+
path: "/dashboard",
|
|
443
|
+
isModuleHome: !0
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
productId: "buildmyiq",
|
|
447
|
+
moduleId: "catalog",
|
|
448
|
+
moduleLabel: "Course Catalog",
|
|
449
|
+
pageId: "home",
|
|
450
|
+
pageLabel: "Catalog",
|
|
451
|
+
path: "/catalog",
|
|
452
|
+
isModuleHome: !0
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
productId: "buildmyiq",
|
|
456
|
+
moduleId: "catalog",
|
|
457
|
+
moduleLabel: "Course Catalog",
|
|
458
|
+
pageId: "detail",
|
|
459
|
+
pageLabel: "Course Detail",
|
|
460
|
+
path: "/catalog/:courseId"
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
productId: "buildmyiq",
|
|
464
|
+
moduleId: "learning",
|
|
465
|
+
moduleLabel: "My Learning",
|
|
466
|
+
pageId: "home",
|
|
467
|
+
pageLabel: "My Learning",
|
|
468
|
+
path: "/learning",
|
|
469
|
+
isModuleHome: !0
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
productId: "buildmyiq",
|
|
473
|
+
moduleId: "learning",
|
|
474
|
+
moduleLabel: "My Learning",
|
|
475
|
+
pageId: "player",
|
|
476
|
+
pageLabel: "Lesson Player",
|
|
477
|
+
path: "/learning/:enrollmentId"
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
productId: "buildmyiq",
|
|
481
|
+
moduleId: "paths",
|
|
482
|
+
moduleLabel: "Skill Journeys",
|
|
483
|
+
pageId: "home",
|
|
484
|
+
pageLabel: "Skill Journeys",
|
|
485
|
+
path: "/paths",
|
|
486
|
+
isModuleHome: !0
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
productId: "buildmyiq",
|
|
490
|
+
moduleId: "authoring",
|
|
491
|
+
moduleLabel: "Authoring",
|
|
492
|
+
pageId: "home",
|
|
493
|
+
pageLabel: "Authoring",
|
|
494
|
+
path: "/authoring",
|
|
495
|
+
isModuleHome: !0
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
productId: "buildmyiq",
|
|
499
|
+
moduleId: "authoring",
|
|
500
|
+
moduleLabel: "Authoring",
|
|
501
|
+
pageId: "builder",
|
|
502
|
+
pageLabel: "Course Builder",
|
|
503
|
+
path: "/authoring/:courseId"
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
productId: "buildmyiq",
|
|
507
|
+
moduleId: "assessments",
|
|
508
|
+
moduleLabel: "Assessments",
|
|
509
|
+
pageId: "home",
|
|
510
|
+
pageLabel: "Assessments",
|
|
511
|
+
path: "/assessments",
|
|
512
|
+
isModuleHome: !0
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
productId: "buildmyiq",
|
|
516
|
+
moduleId: "assessments",
|
|
517
|
+
moduleLabel: "Assessments",
|
|
518
|
+
pageId: "detail",
|
|
519
|
+
pageLabel: "Assessment Detail",
|
|
520
|
+
path: "/assessments/:assessmentId"
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
productId: "buildmyiq",
|
|
524
|
+
moduleId: "assessments",
|
|
525
|
+
moduleLabel: "Assessments",
|
|
526
|
+
pageId: "take",
|
|
527
|
+
pageLabel: "Take Assessment",
|
|
528
|
+
path: "/assessments/:assessmentId/take"
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
productId: "buildmyiq",
|
|
532
|
+
moduleId: "insights",
|
|
533
|
+
moduleLabel: "Insights",
|
|
534
|
+
pageId: "home",
|
|
535
|
+
pageLabel: "Insights",
|
|
536
|
+
path: "/insights",
|
|
537
|
+
isModuleHome: !0
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
productId: "buildmyiq",
|
|
541
|
+
moduleId: "submissions",
|
|
542
|
+
moduleLabel: "Submissions",
|
|
543
|
+
pageId: "home",
|
|
544
|
+
pageLabel: "Submissions",
|
|
545
|
+
path: "/submissions",
|
|
546
|
+
isModuleHome: !0
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
productId: "buildmyiq",
|
|
550
|
+
moduleId: "cohorts",
|
|
551
|
+
moduleLabel: "Cohorts",
|
|
552
|
+
pageId: "home",
|
|
553
|
+
pageLabel: "Cohorts",
|
|
554
|
+
path: "/cohorts",
|
|
555
|
+
isModuleHome: !0
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
productId: "buildmyiq",
|
|
559
|
+
moduleId: "skills",
|
|
560
|
+
moduleLabel: "Skills",
|
|
561
|
+
pageId: "home",
|
|
562
|
+
pageLabel: "Skills",
|
|
563
|
+
path: "/skills",
|
|
564
|
+
isModuleHome: !0
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
productId: "buildmyiq",
|
|
568
|
+
moduleId: "certificates",
|
|
569
|
+
moduleLabel: "Certificates",
|
|
570
|
+
pageId: "home",
|
|
571
|
+
pageLabel: "Certificates",
|
|
572
|
+
path: "/certificates",
|
|
573
|
+
isModuleHome: !0
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
productId: "collabkin",
|
|
577
|
+
moduleId: "dashboard",
|
|
578
|
+
moduleLabel: "Dashboard",
|
|
579
|
+
pageId: "dashboard",
|
|
580
|
+
pageLabel: "Dashboard",
|
|
581
|
+
path: "/collabkin",
|
|
582
|
+
isModuleHome: !0
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
productId: "collabkin",
|
|
586
|
+
moduleId: "trees",
|
|
587
|
+
moduleLabel: "Family Trees",
|
|
588
|
+
pageId: "home",
|
|
589
|
+
pageLabel: "Family Trees",
|
|
590
|
+
path: "/collabkin/trees",
|
|
591
|
+
isModuleHome: !0
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
productId: "collabkin",
|
|
595
|
+
moduleId: "trees",
|
|
596
|
+
moduleLabel: "Family Trees",
|
|
597
|
+
pageId: "detail",
|
|
598
|
+
pageLabel: "Tree Detail",
|
|
599
|
+
path: "/collabkin/trees/:treeId"
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
productId: "collabkin",
|
|
603
|
+
moduleId: "people",
|
|
604
|
+
moduleLabel: "People",
|
|
605
|
+
pageId: "home",
|
|
606
|
+
pageLabel: "People",
|
|
607
|
+
path: "/collabkin/people",
|
|
608
|
+
isModuleHome: !0
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
productId: "collabkin",
|
|
612
|
+
moduleId: "people",
|
|
613
|
+
moduleLabel: "People",
|
|
614
|
+
pageId: "detail",
|
|
615
|
+
pageLabel: "Person Detail",
|
|
616
|
+
path: "/collabkin/people/:personId"
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
productId: "collabkin",
|
|
620
|
+
moduleId: "memories",
|
|
621
|
+
moduleLabel: "Memories",
|
|
622
|
+
pageId: "home",
|
|
623
|
+
pageLabel: "Memories",
|
|
624
|
+
path: "/collabkin/memories",
|
|
625
|
+
isModuleHome: !0
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
productId: "collabkin",
|
|
629
|
+
moduleId: "memories",
|
|
630
|
+
moduleLabel: "Memories",
|
|
631
|
+
pageId: "detail",
|
|
632
|
+
pageLabel: "Memory Detail",
|
|
633
|
+
path: "/collabkin/memories/:memoryId"
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
productId: "collabkin",
|
|
637
|
+
moduleId: "stories",
|
|
638
|
+
moduleLabel: "Stories",
|
|
639
|
+
pageId: "home",
|
|
640
|
+
pageLabel: "Stories",
|
|
641
|
+
path: "/collabkin/stories",
|
|
642
|
+
isModuleHome: !0
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
productId: "collabkin",
|
|
646
|
+
moduleId: "stories",
|
|
647
|
+
moduleLabel: "Stories",
|
|
648
|
+
pageId: "detail",
|
|
649
|
+
pageLabel: "Story Detail",
|
|
650
|
+
path: "/collabkin/stories/:storyId"
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
productId: "collabkin",
|
|
654
|
+
moduleId: "timeline",
|
|
655
|
+
moduleLabel: "Timeline",
|
|
656
|
+
pageId: "home",
|
|
657
|
+
pageLabel: "Timeline",
|
|
658
|
+
path: "/collabkin/timeline",
|
|
659
|
+
isModuleHome: !0
|
|
417
660
|
}
|
|
418
661
|
];
|
|
419
662
|
function _(e) {
|
|
@@ -423,7 +666,7 @@ function v(e) {
|
|
|
423
666
|
let t = _(e);
|
|
424
667
|
return t ? g.filter((e) => e.productId === t) : [];
|
|
425
668
|
}
|
|
426
|
-
function
|
|
669
|
+
function we(e) {
|
|
427
670
|
let t = /* @__PURE__ */ new Map();
|
|
428
671
|
for (let n of v(e)) (!t.get(n.moduleId) || n.isModuleHome) && t.set(n.moduleId, {
|
|
429
672
|
moduleId: n.moduleId,
|
|
@@ -432,7 +675,7 @@ function xe(e) {
|
|
|
432
675
|
});
|
|
433
676
|
return [...t.values()];
|
|
434
677
|
}
|
|
435
|
-
function
|
|
678
|
+
function Te(e, t) {
|
|
436
679
|
let n = _(t);
|
|
437
680
|
return n ? v(e).flatMap((e) => e.moduleId === n ? [{
|
|
438
681
|
pageId: e.pageId,
|
|
@@ -441,14 +684,14 @@ function Se(e, t) {
|
|
|
441
684
|
}] : []) : [];
|
|
442
685
|
}
|
|
443
686
|
function y() {
|
|
444
|
-
let { tr: h } = ee(), { tourId: g } =
|
|
687
|
+
let { tr: h } = ee(), { tourId: g } = de(), _ = ue(), v = e(), { basePath: y = "/" } = v, b = ye(), x = ve("global"), { hasPermission: S, isLoading: C } = r(), w = !g || g === "new", T = S(i.TOUR_CREATE), E = S(i.TOUR_UPDATE), Ee = S(i.TOUR_TEMPLATE_CREATE), D = w ? T : E, O = T && E, k = T && E, { tour: A, loadTour: j, createTour: De, updateTour: Oe, saving: M, validationErrors: N, error: ke } = re(g), { saveAsTemplate: Ae } = n(), { data: je, loading: P } = t({
|
|
445
688
|
variables: {
|
|
446
|
-
limit:
|
|
689
|
+
limit: be,
|
|
447
690
|
offset: 0
|
|
448
691
|
},
|
|
449
692
|
fetchPolicy: "cache-and-network",
|
|
450
|
-
skip:
|
|
451
|
-
}), [F, I] =
|
|
693
|
+
skip: C || !D
|
|
694
|
+
}), [F, I] = s({
|
|
452
695
|
name: "",
|
|
453
696
|
description: "",
|
|
454
697
|
productId: "",
|
|
@@ -461,90 +704,90 @@ function y() {
|
|
|
461
704
|
displayOrder: 1,
|
|
462
705
|
startDate: "",
|
|
463
706
|
endDate: ""
|
|
464
|
-
}), [L, R] =
|
|
465
|
-
|
|
466
|
-
|
|
707
|
+
}), [L, R] = s(!1), [z, B] = s(!1), [V, H] = s(!1), [Me, Ne] = s(!1), [U, Pe] = s(null), [Fe, Ie] = s(null), [Le, Re] = s(!1), [W, ze] = s(null), [Be, Ve] = s(null), G = ie(!1), K = o(() => [...je?.platformProducts.items ?? []].sort((e, t) => e.name.localeCompare(t.name)), [je]), q = o(() => new Set(K.map((e) => e.slug)), [K]), J = o(() => we(F.productId), [F.productId]), Y = o(() => new Set(J.map((e) => e.moduleId)), [J]), X = o(() => Te(F.productId, F.moduleId), [F.moduleId, F.productId]), Z = o(() => new Set(X.map((e) => e.pageId)), [X]);
|
|
708
|
+
a(() => {
|
|
709
|
+
G.current || !C && D && g && g !== "new" && j(g);
|
|
467
710
|
}, [
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
711
|
+
D,
|
|
712
|
+
j,
|
|
713
|
+
C,
|
|
471
714
|
g
|
|
472
|
-
]),
|
|
473
|
-
|
|
474
|
-
}, [
|
|
715
|
+
]), a(() => {
|
|
716
|
+
A && !G.current && (I(A), G.current = !0);
|
|
717
|
+
}, [A]), a(() => {
|
|
475
718
|
if (!F.productId || P) {
|
|
476
719
|
R(!1);
|
|
477
720
|
return;
|
|
478
721
|
}
|
|
479
|
-
R(
|
|
722
|
+
R(K.length > 0 && !q.has(F.productId));
|
|
480
723
|
}, [
|
|
481
724
|
F.productId,
|
|
482
|
-
|
|
483
|
-
|
|
725
|
+
q,
|
|
726
|
+
K.length,
|
|
484
727
|
P
|
|
485
|
-
]),
|
|
728
|
+
]), a(() => {
|
|
486
729
|
if (!F.productId || !F.moduleId) {
|
|
487
730
|
B(!1);
|
|
488
731
|
return;
|
|
489
732
|
}
|
|
490
|
-
B(
|
|
733
|
+
B(J.length === 0 || !Y.has(F.moduleId));
|
|
491
734
|
}, [
|
|
492
735
|
F.moduleId,
|
|
493
736
|
F.productId,
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
]),
|
|
737
|
+
Y,
|
|
738
|
+
J.length
|
|
739
|
+
]), a(() => {
|
|
497
740
|
if (!F.productId || !F.pageId) {
|
|
498
741
|
H(!1);
|
|
499
742
|
return;
|
|
500
743
|
}
|
|
501
|
-
H(
|
|
744
|
+
H(X.length === 0 || !Z.has(F.pageId));
|
|
502
745
|
}, [
|
|
503
746
|
F.pageId,
|
|
504
747
|
F.productId,
|
|
505
|
-
|
|
506
|
-
|
|
748
|
+
Z,
|
|
749
|
+
X.length
|
|
507
750
|
]);
|
|
508
|
-
let
|
|
751
|
+
let He = !!(F.productId && !L && !q.has(F.productId)), Ue = !!(F.moduleId && !z && !Y.has(F.moduleId)), We = !!(F.pageId && !V && !Z.has(F.pageId)), Ge = async (e) => {
|
|
509
752
|
e.preventDefault();
|
|
510
753
|
try {
|
|
511
|
-
g && g !== "new" ? await
|
|
754
|
+
g && g !== "new" ? await Oe(g, F) : await De(F);
|
|
512
755
|
} catch {
|
|
513
|
-
|
|
756
|
+
te(b, "tour.save", v);
|
|
514
757
|
}
|
|
515
|
-
},
|
|
758
|
+
}, Q = () => {
|
|
516
759
|
_(`${y}/list`);
|
|
517
|
-
},
|
|
760
|
+
}, Ke = (e) => {
|
|
518
761
|
if (!e) return "";
|
|
519
762
|
let t = new Date(e);
|
|
520
763
|
return Number.isNaN(t.getTime()) ? "" : (/* @__PURE__ */ new Date(t.getTime() - t.getTimezoneOffset() * 6e4)).toISOString().slice(0, 16);
|
|
521
|
-
},
|
|
764
|
+
}, qe = async () => {
|
|
522
765
|
if (!g || g === "new") return;
|
|
523
|
-
let e = `${F.name ||
|
|
766
|
+
let e = `${F.name || A?.name || "Tour"} Template`, t = window.prompt("Template name", e);
|
|
524
767
|
if (!t) return;
|
|
525
768
|
let n = window.prompt("Template category (ONBOARDING, FEATURE_ANNOUNCEMENT, HELP, CUSTOM)", "ONBOARDING") || "ONBOARDING";
|
|
526
769
|
try {
|
|
527
|
-
await
|
|
770
|
+
await Ae(g, {
|
|
528
771
|
name: t,
|
|
529
772
|
description: F.description,
|
|
530
773
|
category: n,
|
|
531
774
|
isPublic: !1
|
|
532
775
|
}), _(`${y}/templates`);
|
|
533
776
|
} catch {
|
|
534
|
-
|
|
777
|
+
te(b, "template.save", v);
|
|
535
778
|
}
|
|
536
|
-
},
|
|
779
|
+
}, Je = async () => {
|
|
537
780
|
if (window.confirm(h("tourBuilder.seedVibeControls.confirm"))) {
|
|
538
|
-
|
|
781
|
+
Ne(!0), Pe(null), Ie(null);
|
|
539
782
|
try {
|
|
540
|
-
let e = await
|
|
783
|
+
let e = await x.mutate({ mutation: xe }), t = Ce(e);
|
|
541
784
|
if (t) throw Error(t);
|
|
542
785
|
let n = e.data?.seedVibeControlsUserTours;
|
|
543
786
|
if (!n) throw Error("Seed mutation returned no result.");
|
|
544
|
-
|
|
787
|
+
Pe(n);
|
|
545
788
|
} catch (e) {
|
|
546
789
|
let t = e instanceof Error ? e.message : h("tourBuilder.seedVibeControls.error");
|
|
547
|
-
|
|
790
|
+
Ie(t), b.emit("tours.api.failed", {
|
|
548
791
|
route: "/tours",
|
|
549
792
|
operation: "tour.seed_vibecontrols_user_tours",
|
|
550
793
|
errorMessage: t,
|
|
@@ -552,82 +795,104 @@ function y() {
|
|
|
552
795
|
workspaceId: v.workspaceId
|
|
553
796
|
}, { component: "microfe-tours" });
|
|
554
797
|
} finally {
|
|
555
|
-
|
|
798
|
+
Ne(!1);
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
}, Ye = async () => {
|
|
802
|
+
if (window.confirm(h("tourBuilder.seedBuildmyiq.confirm"))) {
|
|
803
|
+
Re(!0), ze(null), Ve(null);
|
|
804
|
+
try {
|
|
805
|
+
let e = await x.mutate({ mutation: Se }), t = Ce(e);
|
|
806
|
+
if (t) throw Error(t);
|
|
807
|
+
let n = e.data?.seedBuildmyiqUserTours;
|
|
808
|
+
if (!n) throw Error("Seed mutation returned no result.");
|
|
809
|
+
ze(n);
|
|
810
|
+
} catch (e) {
|
|
811
|
+
let t = e instanceof Error ? e.message : h("tourBuilder.seedBuildmyiq.error");
|
|
812
|
+
Ve(t), b.emit("tours.api.failed", {
|
|
813
|
+
route: "/tours",
|
|
814
|
+
operation: "tour.seed_buildmyiq_user_tours",
|
|
815
|
+
errorMessage: t,
|
|
816
|
+
productId: v.productId,
|
|
817
|
+
workspaceId: v.workspaceId
|
|
818
|
+
}, { component: "microfe-tours" });
|
|
819
|
+
} finally {
|
|
820
|
+
Re(!1);
|
|
556
821
|
}
|
|
557
822
|
}
|
|
558
|
-
},
|
|
823
|
+
}, Xe = g && g !== "new" ? [
|
|
559
824
|
{
|
|
560
|
-
label:
|
|
825
|
+
label: A?.steps && A.steps.length > 0 ? `${h("tourBuilder.editSteps")} (${A.steps.length})` : h("tourBuilder.editSteps"),
|
|
561
826
|
onSelect: () => _(`${y}/${g}/steps`),
|
|
562
|
-
icon: /* @__PURE__ */ p(
|
|
827
|
+
icon: /* @__PURE__ */ p(d, { size: 16 })
|
|
563
828
|
},
|
|
564
829
|
{
|
|
565
830
|
label: h("tourBuilder.preview"),
|
|
566
831
|
onSelect: () => _(`${y}/${g}/preview`),
|
|
567
|
-
icon: /* @__PURE__ */ p(
|
|
832
|
+
icon: /* @__PURE__ */ p(u, { size: 16 })
|
|
568
833
|
},
|
|
569
834
|
{
|
|
570
835
|
label: h("tourBuilder.analytics"),
|
|
571
836
|
onSelect: () => _(`${y}/${g}/analytics`),
|
|
572
|
-
icon: /* @__PURE__ */ p(
|
|
837
|
+
icon: /* @__PURE__ */ p(c, { size: 16 })
|
|
573
838
|
},
|
|
574
839
|
{
|
|
575
840
|
label: "Schedule",
|
|
576
841
|
onSelect: () => _(`${y}/${g}/schedule`),
|
|
577
|
-
icon: /* @__PURE__ */ p(
|
|
842
|
+
icon: /* @__PURE__ */ p(l, { size: 16 })
|
|
578
843
|
},
|
|
579
|
-
...
|
|
844
|
+
...Ee ? [{
|
|
580
845
|
label: "Save as Template",
|
|
581
|
-
onSelect: () => void
|
|
582
|
-
icon: /* @__PURE__ */ p(
|
|
846
|
+
onSelect: () => void qe(),
|
|
847
|
+
icon: /* @__PURE__ */ p(se, { size: 16 })
|
|
583
848
|
}] : []
|
|
584
|
-
] : [], $ = g && g !== "new" &&
|
|
849
|
+
] : [], $ = g && g !== "new" && E ? [
|
|
585
850
|
{
|
|
586
851
|
id: "edit-steps",
|
|
587
852
|
label: h("tourBuilder.nextStepEditSteps"),
|
|
588
853
|
description: h("tourBuilder.nextStepEditStepsDesc"),
|
|
589
|
-
icon: /* @__PURE__ */ p(
|
|
854
|
+
icon: /* @__PURE__ */ p(d, { size: 16 }),
|
|
590
855
|
onClick: () => _(`${y}/${g}/steps`)
|
|
591
856
|
},
|
|
592
857
|
{
|
|
593
858
|
id: "preview",
|
|
594
859
|
label: h("tourBuilder.nextStepPreview"),
|
|
595
860
|
description: h("tourBuilder.nextStepPreviewDesc"),
|
|
596
|
-
icon: /* @__PURE__ */ p(
|
|
861
|
+
icon: /* @__PURE__ */ p(u, { size: 16 }),
|
|
597
862
|
onClick: () => _(`${y}/${g}/preview`)
|
|
598
863
|
},
|
|
599
864
|
{
|
|
600
865
|
id: "schedule",
|
|
601
866
|
label: h("tourBuilder.nextStepSchedule"),
|
|
602
867
|
description: h("tourBuilder.nextStepScheduleDesc"),
|
|
603
|
-
icon: /* @__PURE__ */ p(
|
|
868
|
+
icon: /* @__PURE__ */ p(l, { size: 16 }),
|
|
604
869
|
onClick: () => _(`${y}/${g}/schedule`)
|
|
605
870
|
},
|
|
606
871
|
{
|
|
607
872
|
id: "analytics",
|
|
608
873
|
label: h("tourBuilder.nextStepAnalytics"),
|
|
609
874
|
description: h("tourBuilder.nextStepAnalyticsDesc"),
|
|
610
|
-
icon: /* @__PURE__ */ p(
|
|
875
|
+
icon: /* @__PURE__ */ p(c, { size: 16 }),
|
|
611
876
|
onClick: () => _(`${y}/${g}/analytics`)
|
|
612
877
|
}
|
|
613
878
|
] : [];
|
|
614
|
-
return
|
|
879
|
+
return C ? /* @__PURE__ */ p("div", {
|
|
615
880
|
className: "flex h-full items-center justify-center p-3 sm:p-6",
|
|
616
881
|
children: /* @__PURE__ */ p("p", {
|
|
617
882
|
className: "text-sm text-text-secondary",
|
|
618
883
|
children: h("tourBuilder.loading")
|
|
619
884
|
})
|
|
620
|
-
}) :
|
|
885
|
+
}) : D ? /* @__PURE__ */ m("div", {
|
|
621
886
|
className: "space-y-4 sm:space-y-6 p-3 sm:p-6 max-w-4xl mx-auto",
|
|
622
887
|
children: [
|
|
623
888
|
/* @__PURE__ */ m("div", {
|
|
624
889
|
className: "flex items-center gap-4",
|
|
625
890
|
children: [/* @__PURE__ */ p("button", {
|
|
626
891
|
type: "button",
|
|
627
|
-
onClick:
|
|
892
|
+
onClick: Q,
|
|
628
893
|
className: "p-2 hover:bg-accent rounded-md",
|
|
629
894
|
"aria-label": h("tourBuilder.goBack"),
|
|
630
|
-
children: /* @__PURE__ */ p(
|
|
895
|
+
children: /* @__PURE__ */ p(oe, { size: 20 })
|
|
631
896
|
}), /* @__PURE__ */ m("div", {
|
|
632
897
|
className: "flex-1",
|
|
633
898
|
children: [/* @__PURE__ */ p("h1", {
|
|
@@ -639,13 +904,13 @@ function y() {
|
|
|
639
904
|
})]
|
|
640
905
|
})]
|
|
641
906
|
}),
|
|
642
|
-
/* @__PURE__ */ p(
|
|
643
|
-
$.length > 0 ? /* @__PURE__ */ p(
|
|
907
|
+
/* @__PURE__ */ p(_e, { children: h("tourBuilder.purpose") }),
|
|
908
|
+
$.length > 0 ? /* @__PURE__ */ p(ge, {
|
|
644
909
|
storageKey: "tours-builder",
|
|
645
910
|
title: h("tourBuilder.nextStepsTitle"),
|
|
646
911
|
steps: $
|
|
647
912
|
}) : null,
|
|
648
|
-
|
|
913
|
+
w ? /* @__PURE__ */ m(le, { children: [/* @__PURE__ */ m(me, {
|
|
649
914
|
className: "p-4 sm:p-6",
|
|
650
915
|
children: [
|
|
651
916
|
/* @__PURE__ */ m("div", {
|
|
@@ -661,37 +926,78 @@ function y() {
|
|
|
661
926
|
})]
|
|
662
927
|
}), /* @__PURE__ */ m("button", {
|
|
663
928
|
type: "button",
|
|
664
|
-
onClick: () => void
|
|
665
|
-
disabled:
|
|
929
|
+
onClick: () => void Je(),
|
|
930
|
+
disabled: Me || !O,
|
|
666
931
|
className: "inline-flex min-h-11 items-center justify-center gap-2 rounded-md border border-border-subtle bg-secondary px-4 py-2 text-sm font-medium text-secondary-foreground hover:bg-secondary/80 disabled:cursor-not-allowed disabled:opacity-50",
|
|
667
|
-
children: [/* @__PURE__ */ p(
|
|
932
|
+
children: [/* @__PURE__ */ p(f, { size: 18 }), h(Me ? "tourBuilder.seedVibeControls.loading" : "tourBuilder.seedVibeControls.button")]
|
|
668
933
|
})]
|
|
669
934
|
}),
|
|
670
|
-
|
|
935
|
+
O ? null : /* @__PURE__ */ p("p", {
|
|
671
936
|
className: "mt-3 text-sm text-text-secondary",
|
|
672
937
|
children: h("tourBuilder.seedVibeControls.permissionHint")
|
|
673
938
|
}),
|
|
674
|
-
|
|
939
|
+
Fe ? /* @__PURE__ */ p("p", {
|
|
675
940
|
className: "mt-3 text-sm text-status-error-text",
|
|
676
|
-
children:
|
|
941
|
+
children: Fe
|
|
677
942
|
}) : null,
|
|
678
|
-
|
|
943
|
+
U ? /* @__PURE__ */ p("div", {
|
|
679
944
|
className: "mt-3 rounded-md border border-border-seam bg-bg-surface p-3 text-sm text-text-secondary",
|
|
680
945
|
children: h("tourBuilder.seedVibeControls.result", {
|
|
681
|
-
totalCount:
|
|
682
|
-
productId:
|
|
683
|
-
workspaceId:
|
|
684
|
-
createdCount:
|
|
685
|
-
updatedCount:
|
|
946
|
+
totalCount: U.totalCount,
|
|
947
|
+
productId: U.productId,
|
|
948
|
+
workspaceId: U.workspaceId,
|
|
949
|
+
createdCount: U.createdCount,
|
|
950
|
+
updatedCount: U.updatedCount
|
|
686
951
|
})
|
|
687
952
|
}) : null
|
|
688
953
|
]
|
|
689
|
-
})
|
|
954
|
+
}), /* @__PURE__ */ m(me, {
|
|
955
|
+
className: "p-4 sm:p-6",
|
|
956
|
+
children: [
|
|
957
|
+
/* @__PURE__ */ m("div", {
|
|
958
|
+
className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
|
|
959
|
+
children: [/* @__PURE__ */ m("div", {
|
|
960
|
+
className: "space-y-1",
|
|
961
|
+
children: [/* @__PURE__ */ p("h2", {
|
|
962
|
+
className: "text-lg font-semibold text-text-primary",
|
|
963
|
+
children: h("tourBuilder.seedBuildmyiq.title")
|
|
964
|
+
}), /* @__PURE__ */ p("p", {
|
|
965
|
+
className: "text-sm text-text-secondary",
|
|
966
|
+
children: h("tourBuilder.seedBuildmyiq.description")
|
|
967
|
+
})]
|
|
968
|
+
}), /* @__PURE__ */ m("button", {
|
|
969
|
+
type: "button",
|
|
970
|
+
onClick: () => void Ye(),
|
|
971
|
+
disabled: Le || !k,
|
|
972
|
+
className: "inline-flex min-h-11 items-center justify-center gap-2 rounded-md border border-border-subtle bg-secondary px-4 py-2 text-sm font-medium text-secondary-foreground hover:bg-secondary/80 disabled:cursor-not-allowed disabled:opacity-50",
|
|
973
|
+
children: [/* @__PURE__ */ p(f, { size: 18 }), h(Le ? "tourBuilder.seedBuildmyiq.loading" : "tourBuilder.seedBuildmyiq.button")]
|
|
974
|
+
})]
|
|
975
|
+
}),
|
|
976
|
+
k ? null : /* @__PURE__ */ p("p", {
|
|
977
|
+
className: "mt-3 text-sm text-text-secondary",
|
|
978
|
+
children: h("tourBuilder.seedBuildmyiq.permissionHint")
|
|
979
|
+
}),
|
|
980
|
+
Be ? /* @__PURE__ */ p("p", {
|
|
981
|
+
className: "mt-3 text-sm text-status-error-text",
|
|
982
|
+
children: Be
|
|
983
|
+
}) : null,
|
|
984
|
+
W ? /* @__PURE__ */ p("div", {
|
|
985
|
+
className: "mt-3 rounded-md border border-border-seam bg-bg-surface p-3 text-sm text-text-secondary",
|
|
986
|
+
children: h("tourBuilder.seedBuildmyiq.result", {
|
|
987
|
+
totalCount: W.totalCount,
|
|
988
|
+
productId: W.productId,
|
|
989
|
+
workspaceId: W.workspaceId,
|
|
990
|
+
createdCount: W.createdCount,
|
|
991
|
+
updatedCount: W.updatedCount
|
|
992
|
+
})
|
|
993
|
+
}) : null
|
|
994
|
+
]
|
|
995
|
+
})] }) : null,
|
|
690
996
|
/* @__PURE__ */ m("form", {
|
|
691
|
-
onSubmit:
|
|
997
|
+
onSubmit: Ge,
|
|
692
998
|
className: "space-y-6",
|
|
693
999
|
children: [
|
|
694
|
-
/* @__PURE__ */ m(
|
|
1000
|
+
/* @__PURE__ */ m(he, {
|
|
695
1001
|
treatment: "plain",
|
|
696
1002
|
className: "p-4 sm:p-6 border-border-seam",
|
|
697
1003
|
children: [/* @__PURE__ */ p("h2", {
|
|
@@ -716,21 +1022,17 @@ function y() {
|
|
|
716
1022
|
required: !0,
|
|
717
1023
|
"aria-label": h("tourBuilder.labelName")
|
|
718
1024
|
})] }),
|
|
719
|
-
/* @__PURE__ */
|
|
720
|
-
className: "block text-sm font-medium mb-2",
|
|
721
|
-
htmlFor: "tour-description",
|
|
722
|
-
children: h("tourBuilder.labelDescription")
|
|
723
|
-
}), /* @__PURE__ */ p("textarea", {
|
|
1025
|
+
/* @__PURE__ */ p(ne, {
|
|
724
1026
|
id: "tour-description",
|
|
1027
|
+
label: h("tourBuilder.labelDescription"),
|
|
725
1028
|
value: F.description || "",
|
|
726
1029
|
onChange: (e) => I({
|
|
727
1030
|
...F,
|
|
728
|
-
description: e
|
|
1031
|
+
description: e
|
|
729
1032
|
}),
|
|
730
|
-
rows:
|
|
731
|
-
className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-text-primary",
|
|
1033
|
+
rows: 4,
|
|
732
1034
|
"aria-label": h("tourBuilder.labelDescription")
|
|
733
|
-
})
|
|
1035
|
+
}),
|
|
734
1036
|
/* @__PURE__ */ m("div", { children: [
|
|
735
1037
|
/* @__PURE__ */ p("label", {
|
|
736
1038
|
className: "block text-sm font-medium mb-2",
|
|
@@ -769,7 +1071,7 @@ function y() {
|
|
|
769
1071
|
disabled: !0,
|
|
770
1072
|
children: "Loading products…"
|
|
771
1073
|
}) : null,
|
|
772
|
-
|
|
1074
|
+
K.map((e) => /* @__PURE__ */ m("option", {
|
|
773
1075
|
value: e.slug,
|
|
774
1076
|
children: [
|
|
775
1077
|
e.name,
|
|
@@ -778,7 +1080,7 @@ function y() {
|
|
|
778
1080
|
")"
|
|
779
1081
|
]
|
|
780
1082
|
}, e.id)),
|
|
781
|
-
|
|
1083
|
+
He ? /* @__PURE__ */ m("option", {
|
|
782
1084
|
value: F.productId,
|
|
783
1085
|
children: ["Current: ", F.productId]
|
|
784
1086
|
}) : null,
|
|
@@ -838,7 +1140,7 @@ function y() {
|
|
|
838
1140
|
value: "",
|
|
839
1141
|
children: "All modules"
|
|
840
1142
|
}),
|
|
841
|
-
|
|
1143
|
+
J.map((e) => /* @__PURE__ */ m("option", {
|
|
842
1144
|
value: e.moduleId,
|
|
843
1145
|
children: [
|
|
844
1146
|
e.label,
|
|
@@ -847,7 +1149,7 @@ function y() {
|
|
|
847
1149
|
")"
|
|
848
1150
|
]
|
|
849
1151
|
}, e.moduleId)),
|
|
850
|
-
|
|
1152
|
+
Ue ? /* @__PURE__ */ m("option", {
|
|
851
1153
|
value: F.moduleId,
|
|
852
1154
|
children: ["Current: ", F.moduleId]
|
|
853
1155
|
}) : null,
|
|
@@ -900,7 +1202,7 @@ function y() {
|
|
|
900
1202
|
value: "",
|
|
901
1203
|
children: "All pages"
|
|
902
1204
|
}),
|
|
903
|
-
|
|
1205
|
+
X.map((e) => /* @__PURE__ */ m("option", {
|
|
904
1206
|
value: e.pageId,
|
|
905
1207
|
children: [
|
|
906
1208
|
e.label,
|
|
@@ -909,7 +1211,7 @@ function y() {
|
|
|
909
1211
|
")"
|
|
910
1212
|
]
|
|
911
1213
|
}, e.pageId)),
|
|
912
|
-
|
|
1214
|
+
We ? /* @__PURE__ */ m("option", {
|
|
913
1215
|
value: F.pageId,
|
|
914
1216
|
children: ["Current: ", F.pageId]
|
|
915
1217
|
}) : null,
|
|
@@ -952,7 +1254,7 @@ function y() {
|
|
|
952
1254
|
]
|
|
953
1255
|
})]
|
|
954
1256
|
}),
|
|
955
|
-
/* @__PURE__ */ m(
|
|
1257
|
+
/* @__PURE__ */ m(he, {
|
|
956
1258
|
treatment: "plain",
|
|
957
1259
|
className: "p-4 sm:p-6 border-border-seam",
|
|
958
1260
|
children: [/* @__PURE__ */ p("h2", {
|
|
@@ -1026,7 +1328,7 @@ function y() {
|
|
|
1026
1328
|
}), /* @__PURE__ */ p("input", {
|
|
1027
1329
|
id: "tour-start-date",
|
|
1028
1330
|
type: "datetime-local",
|
|
1029
|
-
value:
|
|
1331
|
+
value: Ke(F.startDate),
|
|
1030
1332
|
onChange: (e) => I({
|
|
1031
1333
|
...F,
|
|
1032
1334
|
startDate: e.target.value ? new Date(e.target.value).toISOString() : void 0
|
|
@@ -1040,7 +1342,7 @@ function y() {
|
|
|
1040
1342
|
}), /* @__PURE__ */ p("input", {
|
|
1041
1343
|
id: "tour-end-date",
|
|
1042
1344
|
type: "datetime-local",
|
|
1043
|
-
value:
|
|
1345
|
+
value: Ke(F.endDate),
|
|
1044
1346
|
onChange: (e) => I({
|
|
1045
1347
|
...F,
|
|
1046
1348
|
endDate: e.target.value ? new Date(e.target.value).toISOString() : void 0
|
|
@@ -1052,24 +1354,24 @@ function y() {
|
|
|
1052
1354
|
]
|
|
1053
1355
|
})]
|
|
1054
1356
|
}),
|
|
1055
|
-
|
|
1357
|
+
ke && /* @__PURE__ */ m("div", {
|
|
1056
1358
|
className: "border border-status-error-border rounded-md p-4 bg-status-error-bg/10",
|
|
1057
1359
|
children: [/* @__PURE__ */ p("h3", {
|
|
1058
1360
|
className: "font-semibold text-status-error-text mb-2",
|
|
1059
1361
|
children: h("tourBuilder.errorTitle")
|
|
1060
1362
|
}), /* @__PURE__ */ p("p", {
|
|
1061
1363
|
className: "text-sm text-status-error-text",
|
|
1062
|
-
children:
|
|
1364
|
+
children: ke.message
|
|
1063
1365
|
})]
|
|
1064
1366
|
}),
|
|
1065
|
-
|
|
1367
|
+
N.length > 0 && /* @__PURE__ */ m("div", {
|
|
1066
1368
|
className: "border border-status-error-border rounded-md p-4 bg-status-error-bg/10",
|
|
1067
1369
|
children: [/* @__PURE__ */ p("h3", {
|
|
1068
1370
|
className: "font-semibold text-status-error-text mb-2",
|
|
1069
1371
|
children: h("tourBuilder.validationErrorsTitle")
|
|
1070
1372
|
}), /* @__PURE__ */ p("ul", {
|
|
1071
1373
|
className: "list-disc list-inside space-y-1",
|
|
1072
|
-
children:
|
|
1374
|
+
children: N.map((e) => /* @__PURE__ */ p("li", {
|
|
1073
1375
|
className: "text-sm text-status-error-text",
|
|
1074
1376
|
children: e.message
|
|
1075
1377
|
}, e.message))
|
|
@@ -1077,15 +1379,15 @@ function y() {
|
|
|
1077
1379
|
}),
|
|
1078
1380
|
/* @__PURE__ */ m("div", {
|
|
1079
1381
|
className: "flex flex-wrap items-center gap-3",
|
|
1080
|
-
children: [/* @__PURE__ */ p(
|
|
1081
|
-
permission:
|
|
1082
|
-
children: /* @__PURE__ */ m(
|
|
1382
|
+
children: [/* @__PURE__ */ p(ae, {
|
|
1383
|
+
permission: w ? i.TOUR_CREATE : i.TOUR_UPDATE,
|
|
1384
|
+
children: /* @__PURE__ */ m(fe, {
|
|
1083
1385
|
type: "submit",
|
|
1084
|
-
disabled:
|
|
1386
|
+
disabled: M || !D,
|
|
1085
1387
|
className: "flex-1 min-w-[200px] min-h-[44px]",
|
|
1086
|
-
children: [/* @__PURE__ */ p(
|
|
1388
|
+
children: [/* @__PURE__ */ p(ce, { size: 20 }), h(M ? "tourBuilder.saving" : g && g !== "new" ? "tourBuilder.updateTour" : "tourBuilder.createAndAddSteps")]
|
|
1087
1389
|
})
|
|
1088
|
-
}), g && g !== "new" &&
|
|
1390
|
+
}), g && g !== "new" && Xe.length > 0 && /* @__PURE__ */ p(pe, { actions: Xe })]
|
|
1089
1391
|
})
|
|
1090
1392
|
]
|
|
1091
1393
|
})
|
|
@@ -1099,10 +1401,10 @@ function y() {
|
|
|
1099
1401
|
children: h("tourBuilder.accessDeniedTitle")
|
|
1100
1402
|
}), /* @__PURE__ */ p("p", {
|
|
1101
1403
|
className: "text-sm text-text-secondary",
|
|
1102
|
-
children: h(
|
|
1404
|
+
children: h(w ? "tourBuilder.createAccessDeniedMessage" : "tourBuilder.updateAccessDeniedMessage")
|
|
1103
1405
|
})] }), /* @__PURE__ */ p("button", {
|
|
1104
1406
|
type: "button",
|
|
1105
|
-
onClick:
|
|
1407
|
+
onClick: Q,
|
|
1106
1408
|
className: "inline-flex items-center justify-center rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent",
|
|
1107
1409
|
children: h("tourBuilder.goBack")
|
|
1108
1410
|
})]
|