@burdenoff/microfe-tours 2026.510.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/README.md +342 -0
  2. package/dist/__tests__/setup.d.ts +2 -0
  3. package/dist/__tests__/setup.d.ts.map +1 -0
  4. package/dist/constants/featureFlags.d.ts +25 -0
  5. package/dist/constants/featureFlags.d.ts.map +1 -0
  6. package/dist/constants/featureFlags.js +9 -0
  7. package/dist/constants/featureFlags.js.map +1 -0
  8. package/dist/constants/permissions.d.ts +49 -0
  9. package/dist/constants/permissions.d.ts.map +1 -0
  10. package/dist/constants/permissions.js +38 -0
  11. package/dist/constants/permissions.js.map +1 -0
  12. package/dist/dev/main.d.ts +2 -0
  13. package/dist/dev/main.d.ts.map +1 -0
  14. package/dist/generated/global-operations.d.ts +1270 -0
  15. package/dist/generated/global-operations.d.ts.map +1 -0
  16. package/dist/generated/global-operations.js +650 -0
  17. package/dist/generated/global-operations.js.map +1 -0
  18. package/dist/generated/global-types.d.ts +20448 -0
  19. package/dist/generated/global-types.d.ts.map +1 -0
  20. package/dist/generated/wspace-operations.d.ts +2 -0
  21. package/dist/generated/wspace-operations.d.ts.map +1 -0
  22. package/dist/generated/wspace-types.d.ts +53398 -0
  23. package/dist/generated/wspace-types.d.ts.map +1 -0
  24. package/dist/index.d.ts +6 -0
  25. package/dist/index.d.ts.map +1 -0
  26. package/dist/index.js +6 -0
  27. package/dist/tours/ToursAdminRoot.d.ts +16 -0
  28. package/dist/tours/ToursAdminRoot.d.ts.map +1 -0
  29. package/dist/tours/ToursAdminRoot.js +42 -0
  30. package/dist/tours/ToursAdminRoot.js.map +1 -0
  31. package/dist/tours/ToursAdminRoutes.d.ts +12 -0
  32. package/dist/tours/ToursAdminRoutes.d.ts.map +1 -0
  33. package/dist/tours/ToursAdminRoutes.js +109 -0
  34. package/dist/tours/ToursAdminRoutes.js.map +1 -0
  35. package/dist/tours/ToursRoot.d.ts +10 -0
  36. package/dist/tours/ToursRoot.d.ts.map +1 -0
  37. package/dist/tours/ToursRoot.js +1 -0
  38. package/dist/tours/ToursRoutes.d.ts +8 -0
  39. package/dist/tours/ToursRoutes.d.ts.map +1 -0
  40. package/dist/tours/ToursUserRoot.d.ts +15 -0
  41. package/dist/tours/ToursUserRoot.d.ts.map +1 -0
  42. package/dist/tours/ToursUserRoot.js +48 -0
  43. package/dist/tours/ToursUserRoot.js.map +1 -0
  44. package/dist/tours/ToursUserRoutes.d.ts +15 -0
  45. package/dist/tours/ToursUserRoutes.d.ts.map +1 -0
  46. package/dist/tours/ToursUserRoutes.js +66 -0
  47. package/dist/tours/ToursUserRoutes.js.map +1 -0
  48. package/dist/tours/components/RouteHelpers.d.ts +33 -0
  49. package/dist/tours/components/RouteHelpers.d.ts.map +1 -0
  50. package/dist/tours/components/RouteHelpers.js +75 -0
  51. package/dist/tours/components/RouteHelpers.js.map +1 -0
  52. package/dist/tours/components/ToursAdminNavRegistrar.d.ts +25 -0
  53. package/dist/tours/components/ToursAdminNavRegistrar.d.ts.map +1 -0
  54. package/dist/tours/components/ToursAdminNavRegistrar.js +60 -0
  55. package/dist/tours/components/ToursAdminNavRegistrar.js.map +1 -0
  56. package/dist/tours/components/ui.d.ts +2 -0
  57. package/dist/tours/components/ui.d.ts.map +1 -0
  58. package/dist/tours/hooks/useMediaLibrary.d.ts +22 -0
  59. package/dist/tours/hooks/useMediaLibrary.d.ts.map +1 -0
  60. package/dist/tours/hooks/useMediaLibrary.js +82 -0
  61. package/dist/tours/hooks/useMediaLibrary.js.map +1 -0
  62. package/dist/tours/hooks/useStepSequencer.d.ts +20 -0
  63. package/dist/tours/hooks/useStepSequencer.d.ts.map +1 -0
  64. package/dist/tours/hooks/useStepSequencer.js +53 -0
  65. package/dist/tours/hooks/useStepSequencer.js.map +1 -0
  66. package/dist/tours/hooks/useTourAnalytics.d.ts +32 -0
  67. package/dist/tours/hooks/useTourAnalytics.d.ts.map +1 -0
  68. package/dist/tours/hooks/useTourAnalytics.js +70 -0
  69. package/dist/tours/hooks/useTourAnalytics.js.map +1 -0
  70. package/dist/tours/hooks/useTourBuilder.d.ts +61 -0
  71. package/dist/tours/hooks/useTourBuilder.d.ts.map +1 -0
  72. package/dist/tours/hooks/useTourBuilder.js +192 -0
  73. package/dist/tours/hooks/useTourBuilder.js.map +1 -0
  74. package/dist/tours/hooks/useTourLifecycle.d.ts +22 -0
  75. package/dist/tours/hooks/useTourLifecycle.d.ts.map +1 -0
  76. package/dist/tours/hooks/useTourLifecycle.js +28 -0
  77. package/dist/tours/hooks/useTourLifecycle.js.map +1 -0
  78. package/dist/tours/hooks/useTourPreview.d.ts +33 -0
  79. package/dist/tours/hooks/useTourPreview.d.ts.map +1 -0
  80. package/dist/tours/hooks/useTourPreview.js +70 -0
  81. package/dist/tours/hooks/useTourPreview.js.map +1 -0
  82. package/dist/tours/hooks/useToursList.d.ts +30 -0
  83. package/dist/tours/hooks/useToursList.d.ts.map +1 -0
  84. package/dist/tours/hooks/useToursList.js +49 -0
  85. package/dist/tours/hooks/useToursList.js.map +1 -0
  86. package/dist/tours/hooks/useToursPermissionAccess.d.ts +16 -0
  87. package/dist/tours/hooks/useToursPermissionAccess.d.ts.map +1 -0
  88. package/dist/tours/hooks/useToursPermissionAccess.js +9 -0
  89. package/dist/tours/hooks/useToursPermissionAccess.js.map +1 -0
  90. package/dist/tours/i18n.d.ts +172 -0
  91. package/dist/tours/i18n.d.ts.map +1 -0
  92. package/dist/tours/i18n.js +175 -0
  93. package/dist/tours/i18n.js.map +1 -0
  94. package/dist/tours/index.d.ts +21 -0
  95. package/dist/tours/index.d.ts.map +1 -0
  96. package/dist/tours/index.js +5 -0
  97. package/dist/tours/pages/AnalyticsDashboardPage.d.ts +6 -0
  98. package/dist/tours/pages/AnalyticsDashboardPage.d.ts.map +1 -0
  99. package/dist/tours/pages/AnalyticsDashboardPage.js +230 -0
  100. package/dist/tours/pages/AnalyticsDashboardPage.js.map +1 -0
  101. package/dist/tours/pages/MediaLibraryPage.d.ts +6 -0
  102. package/dist/tours/pages/MediaLibraryPage.d.ts.map +1 -0
  103. package/dist/tours/pages/MediaLibraryPage.js +195 -0
  104. package/dist/tours/pages/MediaLibraryPage.js.map +1 -0
  105. package/dist/tours/pages/MyToursPage.d.ts +11 -0
  106. package/dist/tours/pages/MyToursPage.d.ts.map +1 -0
  107. package/dist/tours/pages/MyToursPage.js +103 -0
  108. package/dist/tours/pages/MyToursPage.js.map +1 -0
  109. package/dist/tours/pages/MyToursProgressPage.d.ts +6 -0
  110. package/dist/tours/pages/MyToursProgressPage.d.ts.map +1 -0
  111. package/dist/tours/pages/MyToursProgressPage.js +142 -0
  112. package/dist/tours/pages/MyToursProgressPage.js.map +1 -0
  113. package/dist/tours/pages/SchedulerPage.d.ts +6 -0
  114. package/dist/tours/pages/SchedulerPage.d.ts.map +1 -0
  115. package/dist/tours/pages/SchedulerPage.js +231 -0
  116. package/dist/tours/pages/SchedulerPage.js.map +1 -0
  117. package/dist/tours/pages/StepEditorPage.d.ts +7 -0
  118. package/dist/tours/pages/StepEditorPage.d.ts.map +1 -0
  119. package/dist/tours/pages/StepEditorPage.js +586 -0
  120. package/dist/tours/pages/StepEditorPage.js.map +1 -0
  121. package/dist/tours/pages/SystemAnalyticsPage.d.ts +6 -0
  122. package/dist/tours/pages/SystemAnalyticsPage.d.ts.map +1 -0
  123. package/dist/tours/pages/SystemAnalyticsPage.js +155 -0
  124. package/dist/tours/pages/SystemAnalyticsPage.js.map +1 -0
  125. package/dist/tours/pages/TemplateLibraryPage.d.ts +6 -0
  126. package/dist/tours/pages/TemplateLibraryPage.d.ts.map +1 -0
  127. package/dist/tours/pages/TemplateLibraryPage.js +207 -0
  128. package/dist/tours/pages/TemplateLibraryPage.js.map +1 -0
  129. package/dist/tours/pages/TourBuilderPage.d.ts +6 -0
  130. package/dist/tours/pages/TourBuilderPage.d.ts.map +1 -0
  131. package/dist/tours/pages/TourBuilderPage.js +363 -0
  132. package/dist/tours/pages/TourBuilderPage.js.map +1 -0
  133. package/dist/tours/pages/TourPreviewPage.d.ts +6 -0
  134. package/dist/tours/pages/TourPreviewPage.d.ts.map +1 -0
  135. package/dist/tours/pages/TourPreviewPage.js +239 -0
  136. package/dist/tours/pages/TourPreviewPage.js.map +1 -0
  137. package/dist/tours/pages/ToursListPage.d.ts +6 -0
  138. package/dist/tours/pages/ToursListPage.d.ts.map +1 -0
  139. package/dist/tours/pages/ToursListPage.js +310 -0
  140. package/dist/tours/pages/ToursListPage.js.map +1 -0
  141. package/dist/tours/providers/ToursProvider.d.ts +27 -0
  142. package/dist/tours/providers/ToursProvider.d.ts.map +1 -0
  143. package/dist/tours/providers/ToursProvider.js +28 -0
  144. package/dist/tours/providers/ToursProvider.js.map +1 -0
  145. package/dist/tours/store/toursStore.d.ts +39 -0
  146. package/dist/tours/store/toursStore.d.ts.map +1 -0
  147. package/dist/tours/store/toursStore.js +143 -0
  148. package/dist/tours/store/toursStore.js.map +1 -0
  149. package/dist/tours/types/index.d.ts +350 -0
  150. package/dist/tours/types/index.d.ts.map +1 -0
  151. package/dist/tours/utils/cn.d.ts +8 -0
  152. package/dist/tours/utils/cn.d.ts.map +1 -0
  153. package/dist/tours/utils/index.d.ts +102 -0
  154. package/dist/tours/utils/index.d.ts.map +1 -0
  155. package/dist/tours/utils/index.js +28 -0
  156. package/dist/tours/utils/index.js.map +1 -0
  157. package/dist/tours/utils/joinPath.d.ts +9 -0
  158. package/dist/tours/utils/joinPath.d.ts.map +1 -0
  159. package/dist/tours/utils/joinPath.js +8 -0
  160. package/dist/tours/utils/joinPath.js.map +1 -0
  161. package/dist/utils/nativeBridge.d.ts +3 -0
  162. package/dist/utils/nativeBridge.d.ts.map +1 -0
  163. package/dist/utils/nativeBridge.js +2 -0
  164. package/package.json +114 -0
@@ -0,0 +1,586 @@
1
+ import { useToursContext as e } from "../providers/ToursProvider.js";
2
+ import { useToursPermissionAccess as t } from "../hooks/useToursPermissionAccess.js";
3
+ import { TOUR_PERMISSIONS as n } from "../../constants/permissions.js";
4
+ import { useToursI18n as r } from "../i18n.js";
5
+ import { useMediaLibrary as i } from "../hooks/useMediaLibrary.js";
6
+ import { useStepSequencer as a } from "../hooks/useStepSequencer.js";
7
+ import { useTourBuilder as o } from "../hooks/useTourBuilder.js";
8
+ import { useEffect as s, useState as c } from "react";
9
+ import { PermissionGate as ee } from "@burdenoff/fe-libs/shared/components";
10
+ import { ArrowLeft as te, ChevronDown as l, ChevronLeft as u, ChevronRight as d, ChevronUp as f, Menu as p, Paperclip as m, Plus as h, Save as g, Trash2 as _, X as ne } from "lucide-react";
11
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
12
+ import { useNavigate as b, useParams as x } from "react-router-dom";
13
+ //#region src/tours/pages/StepEditorPage.tsx
14
+ function S() {
15
+ let { tr: S } = r(), { tourId: C, stepId: w } = x(), re = b(), { basePath: ie = "/" } = e(), { hasPermission: T } = t(), E = T(n.TOUR_STEP_CREATE), D = T(n.TOUR_STEP_UPDATE), O = T(n.TOUR_STEP_DELETE), { tour: k, loadTour: A, syncSteps: j, saving: M } = o(C), { steps: N, selectedStep: P, selectStep: F, createStep: I, deleteStep: L, updateStepField: R, moveStep: z } = a(), { media: B, fetchMedia: V, attachToStep: H, loading: U } = i(), [W, G] = c(!1), [K, q] = c(!1), [J, Y] = c(""), [X, ae] = c("body"), [oe, Z] = c(!1);
16
+ s(() => {
17
+ let e = () => {
18
+ let e = window.innerWidth < 768;
19
+ q(e), e || G(!1);
20
+ };
21
+ return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
22
+ }, []), s(() => {
23
+ C && A(C);
24
+ }, [C, A]), s(() => {
25
+ V();
26
+ }, [V]), s(() => {
27
+ let e = w || P?.id;
28
+ if (e && N.length > 0) {
29
+ let t = N.find((t) => t.id === e);
30
+ t && F(t);
31
+ }
32
+ }, [
33
+ w,
34
+ N,
35
+ F,
36
+ P?.id
37
+ ]);
38
+ let Q = () => {
39
+ I();
40
+ }, $ = async () => {
41
+ if (C) try {
42
+ await j(C, N);
43
+ } catch (e) {
44
+ console.error("Failed to save steps:", e);
45
+ }
46
+ }, se = () => {
47
+ re(`${ie}/${C}/edit`);
48
+ }, ce = async () => {
49
+ if (!(!P || !C || !J)) {
50
+ if (P.id.startsWith("temp_")) {
51
+ window.alert("Save your steps before attaching media to them.");
52
+ return;
53
+ }
54
+ try {
55
+ Z(!0), await H(P.id, J, X, (P.media?.length ?? 0) + 1), await A(C), Y("");
56
+ } catch (e) {
57
+ console.error("Failed to attach media:", e);
58
+ } finally {
59
+ Z(!1);
60
+ }
61
+ }
62
+ }, le = (e) => {
63
+ F(e), K && G(!1);
64
+ };
65
+ return /* @__PURE__ */ y("div", {
66
+ className: "flex flex-col h-full bg-background",
67
+ children: [/* @__PURE__ */ y("div", {
68
+ className: "border-b border-border p-3 sm:p-4 flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-4 bg-card",
69
+ children: [/* @__PURE__ */ y("div", {
70
+ className: "flex items-center gap-3",
71
+ children: [/* @__PURE__ */ v("button", {
72
+ onClick: se,
73
+ className: "p-2 hover:bg-accent rounded-md shrink-0",
74
+ "aria-label": S("stepEditor.goBack"),
75
+ children: /* @__PURE__ */ v(te, { size: 20 })
76
+ }), /* @__PURE__ */ y("div", {
77
+ className: "flex-1 min-w-0",
78
+ children: [/* @__PURE__ */ y("h1", {
79
+ className: "text-base sm:text-lg font-semibold truncate",
80
+ children: [
81
+ k?.name || S("stepEditor.tourFallback"),
82
+ " - ",
83
+ S("stepEditor.stepsLabel")
84
+ ]
85
+ }), /* @__PURE__ */ y("p", {
86
+ className: "text-xs sm:text-sm text-muted-foreground",
87
+ children: [
88
+ N.length,
89
+ " ",
90
+ S("stepEditor.stepsCount")
91
+ ]
92
+ })]
93
+ })]
94
+ }), /* @__PURE__ */ y("div", {
95
+ className: "flex items-center gap-2 sm:gap-3 ml-auto",
96
+ children: [
97
+ K && /* @__PURE__ */ y("button", {
98
+ onClick: () => G(!W),
99
+ className: "px-3 py-2 border border-border rounded-md hover:bg-accent flex items-center gap-2 sm:hidden",
100
+ children: [
101
+ /* @__PURE__ */ v(p, { size: 18 }),
102
+ /* @__PURE__ */ v("span", {
103
+ className: "text-sm",
104
+ children: S("stepEditor.steps")
105
+ }),
106
+ N.length > 0 && /* @__PURE__ */ v("span", {
107
+ className: "px-1.5 py-0.5 text-xs bg-primary/20 rounded-full",
108
+ children: N.length
109
+ })
110
+ ]
111
+ }),
112
+ E && /* @__PURE__ */ y("button", {
113
+ onClick: Q,
114
+ className: "px-3 sm:px-4 py-2 border border-border rounded-md hover:bg-accent flex items-center gap-2 text-sm sm:text-base",
115
+ children: [/* @__PURE__ */ v(h, { size: 18 }), /* @__PURE__ */ v("span", {
116
+ className: "hidden xs:inline",
117
+ children: S("stepEditor.addStep")
118
+ })]
119
+ }),
120
+ /* @__PURE__ */ v(ee, {
121
+ permission: n.TOUR_STEP_UPDATE,
122
+ children: /* @__PURE__ */ y("button", {
123
+ onClick: $,
124
+ disabled: M || !D,
125
+ className: "px-3 sm:px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 disabled:opacity-50 flex items-center gap-2 text-sm sm:text-base",
126
+ children: [/* @__PURE__ */ v(g, { size: 18 }), /* @__PURE__ */ v("span", {
127
+ className: "hidden xs:inline",
128
+ children: S(M ? "stepEditor.saving" : "stepEditor.save")
129
+ })]
130
+ })
131
+ })
132
+ ]
133
+ })]
134
+ }), /* @__PURE__ */ y("div", {
135
+ className: "flex-1 flex overflow-hidden relative",
136
+ children: [
137
+ K && W && /* @__PURE__ */ v("div", {
138
+ className: "fixed inset-0 bg-black/50 z-40 md:hidden",
139
+ onClick: () => G(!1)
140
+ }),
141
+ /* @__PURE__ */ y("div", {
142
+ className: `
143
+ ${K ? "fixed inset-y-0 left-0 z-50 w-72 transform transition-transform duration-300" : "w-64 lg:w-80 shrink-0"}
144
+ ${K && !W ? "-translate-x-full" : "translate-x-0"}
145
+ border-r border-border overflow-y-auto bg-card
146
+ `,
147
+ children: [K && /* @__PURE__ */ y("div", {
148
+ className: "flex items-center justify-between p-4 border-b border-border sticky top-0 bg-card z-10",
149
+ children: [/* @__PURE__ */ v("h2", {
150
+ className: "font-semibold",
151
+ children: S("stepEditor.tourSteps")
152
+ }), /* @__PURE__ */ v("button", {
153
+ onClick: () => G(!1),
154
+ className: "p-2 hover:bg-accent rounded-md",
155
+ children: /* @__PURE__ */ v(ne, { size: 20 })
156
+ })]
157
+ }), /* @__PURE__ */ v("div", {
158
+ className: "p-3 sm:p-4 space-y-2",
159
+ children: N.length === 0 ? /* @__PURE__ */ y("div", {
160
+ className: "text-center py-8 text-muted-foreground",
161
+ children: [/* @__PURE__ */ v("p", {
162
+ className: "text-sm",
163
+ children: S("stepEditor.noStepsYet")
164
+ }), /* @__PURE__ */ v("p", {
165
+ className: "text-xs mt-1",
166
+ children: S("stepEditor.clickAddStep")
167
+ })]
168
+ }) : N.map((e, t) => /* @__PURE__ */ v("div", {
169
+ onClick: () => le(e),
170
+ className: `p-3 border rounded-md cursor-pointer transition-colors ${P?.id === e.id ? "border-primary bg-primary/10" : "border-border hover:bg-accent"}`,
171
+ children: /* @__PURE__ */ y("div", {
172
+ className: "flex items-start justify-between gap-2",
173
+ children: [/* @__PURE__ */ y("div", {
174
+ className: "flex-1 min-w-0",
175
+ children: [
176
+ /* @__PURE__ */ y("div", {
177
+ className: "text-xs text-muted-foreground mb-1",
178
+ children: [
179
+ S("stepEditor.stepNumber"),
180
+ " ",
181
+ t + 1
182
+ ]
183
+ }),
184
+ /* @__PURE__ */ v("div", {
185
+ className: "font-medium text-sm truncate",
186
+ children: e.title || S("stepEditor.untitled")
187
+ }),
188
+ e.targetSelector && /* @__PURE__ */ v("div", {
189
+ className: "text-xs text-muted-foreground mt-1 truncate font-mono",
190
+ children: e.targetSelector
191
+ })
192
+ ]
193
+ }), O && /* @__PURE__ */ y("div", {
194
+ className: "flex items-center gap-1 shrink-0",
195
+ children: [
196
+ /* @__PURE__ */ v("button", {
197
+ onClick: (e) => {
198
+ e.stopPropagation(), t > 0 && z(t, t - 1);
199
+ },
200
+ className: "p-1.5 hover:bg-accent rounded",
201
+ title: "Move step up",
202
+ "aria-label": "Move step up",
203
+ disabled: t === 0,
204
+ children: /* @__PURE__ */ v(f, { size: 14 })
205
+ }),
206
+ /* @__PURE__ */ v("button", {
207
+ onClick: (e) => {
208
+ e.stopPropagation(), t < N.length - 1 && z(t, t + 1);
209
+ },
210
+ className: "p-1.5 hover:bg-accent rounded",
211
+ title: "Move step down",
212
+ "aria-label": "Move step down",
213
+ disabled: t === N.length - 1,
214
+ children: /* @__PURE__ */ v(l, { size: 14 })
215
+ }),
216
+ /* @__PURE__ */ v("button", {
217
+ onClick: (t) => {
218
+ t.stopPropagation(), L(e.id);
219
+ },
220
+ className: "p-1.5 hover:bg-destructive/10 rounded text-destructive",
221
+ title: S("stepEditor.deleteStep"),
222
+ "aria-label": S("stepEditor.deleteStep"),
223
+ children: /* @__PURE__ */ v(_, { size: 14 })
224
+ })
225
+ ]
226
+ })]
227
+ })
228
+ }, e.id))
229
+ })]
230
+ }),
231
+ /* @__PURE__ */ v("div", {
232
+ className: "flex-1 overflow-y-auto p-4 sm:p-6",
233
+ children: P ? /* @__PURE__ */ y("div", {
234
+ className: "max-w-2xl mx-auto space-y-4 sm:space-y-6",
235
+ children: [
236
+ K && N.length > 1 && /* @__PURE__ */ y("div", {
237
+ className: "flex items-center justify-between bg-muted/50 rounded-lg p-2 mb-4",
238
+ children: [
239
+ /* @__PURE__ */ v("button", {
240
+ onClick: () => {
241
+ let e = N.findIndex((e) => e.id === P.id);
242
+ e > 0 && F(N[e - 1]);
243
+ },
244
+ disabled: N.findIndex((e) => e.id === P.id) === 0,
245
+ className: "p-2 hover:bg-accent rounded-md disabled:opacity-30",
246
+ children: /* @__PURE__ */ v(u, { size: 20 })
247
+ }),
248
+ /* @__PURE__ */ y("span", {
249
+ className: "text-sm text-muted-foreground",
250
+ children: [
251
+ S("stepEditor.stepNumber"),
252
+ " ",
253
+ N.findIndex((e) => e.id === P.id) + 1,
254
+ " ",
255
+ S("stepEditor.of"),
256
+ " ",
257
+ N.length
258
+ ]
259
+ }),
260
+ /* @__PURE__ */ v("button", {
261
+ onClick: () => {
262
+ let e = N.findIndex((e) => e.id === P.id);
263
+ e < N.length - 1 && F(N[e + 1]);
264
+ },
265
+ disabled: N.findIndex((e) => e.id === P.id) === N.length - 1,
266
+ className: "p-2 hover:bg-accent rounded-md disabled:opacity-30",
267
+ children: /* @__PURE__ */ v(d, { size: 20 })
268
+ })
269
+ ]
270
+ }),
271
+ /* @__PURE__ */ v("h2", {
272
+ className: "text-lg sm:text-xl font-semibold",
273
+ children: S("stepEditor.editStep")
274
+ }),
275
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
276
+ className: "block text-sm font-medium mb-2",
277
+ children: [S("stepEditor.stepTitle"), " *"]
278
+ }), /* @__PURE__ */ v("input", {
279
+ type: "text",
280
+ value: P.title,
281
+ onChange: (e) => R(P.id, "title", e.target.value),
282
+ className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm sm:text-base",
283
+ placeholder: S("stepEditor.stepTitlePlaceholder")
284
+ })] }),
285
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
286
+ className: "block text-sm font-medium mb-2",
287
+ children: [S("stepEditor.content"), " *"]
288
+ }), /* @__PURE__ */ v("textarea", {
289
+ value: P.content,
290
+ onChange: (e) => R(P.id, "content", e.target.value),
291
+ rows: 4,
292
+ className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm sm:text-base resize-y min-h-[100px]",
293
+ placeholder: S("stepEditor.contentPlaceholder")
294
+ })] }),
295
+ /* @__PURE__ */ y("div", { children: [
296
+ /* @__PURE__ */ y("label", {
297
+ className: "block text-sm font-medium mb-2",
298
+ children: [
299
+ S("stepEditor.cssSelector"),
300
+ " *",
301
+ /* @__PURE__ */ y("span", {
302
+ className: "text-muted-foreground font-normal ml-2",
303
+ children: [
304
+ "(",
305
+ S("stepEditor.targetElement"),
306
+ ")"
307
+ ]
308
+ })
309
+ ]
310
+ }),
311
+ /* @__PURE__ */ v("input", {
312
+ type: "text",
313
+ value: P.targetSelector || "",
314
+ onChange: (e) => R(P.id, "targetSelector", e.target.value),
315
+ placeholder: S("stepEditor.cssSelectorPlaceholder"),
316
+ className: "w-full px-3 py-2 border border-border rounded-md bg-background font-mono text-sm"
317
+ }),
318
+ /* @__PURE__ */ v("p", {
319
+ className: "text-xs text-muted-foreground mt-1",
320
+ children: S("stepEditor.dataTourHint")
321
+ })
322
+ ] }),
323
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
324
+ className: "block text-sm font-medium mb-2",
325
+ children: S("stepEditor.tooltipPlacement")
326
+ }), /* @__PURE__ */ y("select", {
327
+ value: P.placement,
328
+ onChange: (e) => R(P.id, "placement", e.target.value),
329
+ className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm sm:text-base",
330
+ children: [
331
+ /* @__PURE__ */ v("option", {
332
+ value: "AUTO",
333
+ children: S("stepEditor.placementAuto")
334
+ }),
335
+ /* @__PURE__ */ v("option", {
336
+ value: "TOP",
337
+ children: S("stepEditor.placementTop")
338
+ }),
339
+ /* @__PURE__ */ v("option", {
340
+ value: "BOTTOM",
341
+ children: S("stepEditor.placementBottom")
342
+ }),
343
+ /* @__PURE__ */ v("option", {
344
+ value: "LEFT",
345
+ children: S("stepEditor.placementLeft")
346
+ }),
347
+ /* @__PURE__ */ v("option", {
348
+ value: "RIGHT",
349
+ children: S("stepEditor.placementRight")
350
+ }),
351
+ /* @__PURE__ */ v("option", {
352
+ value: "CENTER",
353
+ children: S("stepEditor.placementCenter")
354
+ })
355
+ ]
356
+ })] }),
357
+ /* @__PURE__ */ y("details", {
358
+ className: "border border-border rounded-md",
359
+ children: [/* @__PURE__ */ v("summary", {
360
+ className: "px-4 py-3 cursor-pointer font-medium text-sm hover:bg-accent/50 rounded-t-md",
361
+ children: S("stepEditor.deviceSpecificSelectors")
362
+ }), /* @__PURE__ */ y("div", {
363
+ className: "p-4 pt-0 space-y-3 border-t border-border",
364
+ children: [
365
+ /* @__PURE__ */ v("p", {
366
+ className: "text-xs text-muted-foreground mb-3",
367
+ children: S("stepEditor.deviceSelectorHint")
368
+ }),
369
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
370
+ className: "block text-xs font-medium mb-1",
371
+ children: S("stepEditor.mobileSelector")
372
+ }), /* @__PURE__ */ v("input", {
373
+ type: "text",
374
+ value: P.targetSelectorMobile || "",
375
+ onChange: (e) => R(P.id, "targetSelectorMobile", e.target.value),
376
+ placeholder: S("stepEditor.leaveEmptyDefault"),
377
+ className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm font-mono"
378
+ })] }),
379
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
380
+ className: "block text-xs font-medium mb-1",
381
+ children: S("stepEditor.tabletSelector")
382
+ }), /* @__PURE__ */ v("input", {
383
+ type: "text",
384
+ value: P.targetSelectorTablet || "",
385
+ onChange: (e) => R(P.id, "targetSelectorTablet", e.target.value),
386
+ placeholder: S("stepEditor.leaveEmptyDefault"),
387
+ className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm font-mono"
388
+ })] }),
389
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
390
+ className: "block text-xs font-medium mb-1",
391
+ children: S("stepEditor.desktopSelector")
392
+ }), /* @__PURE__ */ v("input", {
393
+ type: "text",
394
+ value: P.targetSelectorDesktop || "",
395
+ onChange: (e) => R(P.id, "targetSelectorDesktop", e.target.value),
396
+ placeholder: S("stepEditor.leaveEmptyDefault"),
397
+ className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm font-mono"
398
+ })] })
399
+ ]
400
+ })]
401
+ }),
402
+ /* @__PURE__ */ y("div", {
403
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
404
+ children: [/* @__PURE__ */ y("label", {
405
+ className: "flex items-center gap-3 cursor-pointer rounded-md border border-border p-3",
406
+ children: [/* @__PURE__ */ v("input", {
407
+ type: "checkbox",
408
+ checked: P.requireInteraction ?? !1,
409
+ onChange: (e) => R(P.id, "requireInteraction", e.target.checked),
410
+ className: "w-4 h-4 rounded"
411
+ }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("div", {
412
+ className: "text-sm font-medium",
413
+ children: "Require interaction"
414
+ }), /* @__PURE__ */ v("div", {
415
+ className: "text-xs text-muted-foreground",
416
+ children: "User must interact with the highlighted element before advancing."
417
+ })] })]
418
+ }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
419
+ className: "block text-sm font-medium mb-2",
420
+ children: "Wait for timeout (ms)"
421
+ }), /* @__PURE__ */ v("input", {
422
+ type: "number",
423
+ min: "0",
424
+ value: P.waitForTimeout ?? "",
425
+ onChange: (e) => R(P.id, "waitForTimeout", e.target.value ? Number(e.target.value) : void 0),
426
+ className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm",
427
+ placeholder: "1500"
428
+ })] })]
429
+ }),
430
+ /* @__PURE__ */ y("div", {
431
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
432
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
433
+ className: "block text-sm font-medium mb-2",
434
+ children: "Wait for selector"
435
+ }), /* @__PURE__ */ v("input", {
436
+ type: "text",
437
+ value: P.waitForSelector || "",
438
+ onChange: (e) => R(P.id, "waitForSelector", e.target.value || void 0),
439
+ className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm font-mono",
440
+ placeholder: "[data-tour='agents-tabs']"
441
+ })] }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
442
+ className: "block text-sm font-medium mb-2",
443
+ children: "Wait for event"
444
+ }), /* @__PURE__ */ v("input", {
445
+ type: "text",
446
+ value: P.waitForEvent || "",
447
+ onChange: (e) => R(P.id, "waitForEvent", e.target.value || void 0),
448
+ className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm",
449
+ placeholder: "tour:ready"
450
+ })] })]
451
+ }),
452
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
453
+ className: "block text-sm font-medium mb-2",
454
+ children: "Skip conditions (JSON)"
455
+ }), /* @__PURE__ */ v("textarea", {
456
+ value: P.skipConditions ? JSON.stringify(P.skipConditions, null, 2) : "",
457
+ onChange: (e) => {
458
+ let t = e.target.value.trim();
459
+ if (!t) {
460
+ R(P.id, "skipConditions", void 0);
461
+ return;
462
+ }
463
+ try {
464
+ R(P.id, "skipConditions", JSON.parse(t));
465
+ } catch {
466
+ R(P.id, "skipConditions", t);
467
+ }
468
+ },
469
+ rows: 4,
470
+ className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm font-mono",
471
+ placeholder: "{\"selectorMissing\":\"[data-tour=\\\"missing\\\"]\"}"
472
+ })] }),
473
+ /* @__PURE__ */ y("div", {
474
+ className: "border border-border rounded-md p-4 space-y-4",
475
+ children: [
476
+ /* @__PURE__ */ y("div", {
477
+ className: "flex items-center gap-2",
478
+ children: [/* @__PURE__ */ v(m, { size: 18 }), /* @__PURE__ */ v("h3", {
479
+ className: "text-sm font-semibold",
480
+ children: "Step media"
481
+ })]
482
+ }),
483
+ P.media && P.media.length > 0 ? /* @__PURE__ */ v("div", {
484
+ className: "space-y-2",
485
+ children: P.media.map((e) => /* @__PURE__ */ y("div", {
486
+ className: "flex items-center justify-between rounded-md border border-border p-2 text-sm",
487
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("div", {
488
+ className: "font-medium",
489
+ children: e.media.name
490
+ }), /* @__PURE__ */ v("div", {
491
+ className: "text-xs text-muted-foreground",
492
+ children: e.position
493
+ })] }), /* @__PURE__ */ v("span", {
494
+ className: "text-xs text-muted-foreground",
495
+ children: e.media.type
496
+ })]
497
+ }, e.id))
498
+ }) : /* @__PURE__ */ v("p", {
499
+ className: "text-sm text-muted-foreground",
500
+ children: "No media attached to this step yet."
501
+ }),
502
+ /* @__PURE__ */ y("div", {
503
+ className: "grid grid-cols-1 gap-3 sm:grid-cols-[minmax(0,1fr)_160px_auto]",
504
+ children: [
505
+ /* @__PURE__ */ y("select", {
506
+ value: J,
507
+ onChange: (e) => Y(e.target.value),
508
+ className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm",
509
+ children: [/* @__PURE__ */ v("option", {
510
+ value: "",
511
+ children: U ? "Loading media..." : "Select uploaded media"
512
+ }), B.map((e) => /* @__PURE__ */ y("option", {
513
+ value: e.id,
514
+ children: [
515
+ e.name,
516
+ " (",
517
+ e.type,
518
+ ")"
519
+ ]
520
+ }, e.id))]
521
+ }),
522
+ /* @__PURE__ */ y("select", {
523
+ value: X,
524
+ onChange: (e) => ae(e.target.value),
525
+ className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm",
526
+ children: [
527
+ /* @__PURE__ */ v("option", {
528
+ value: "header",
529
+ children: "Header"
530
+ }),
531
+ /* @__PURE__ */ v("option", {
532
+ value: "body",
533
+ children: "Body"
534
+ }),
535
+ /* @__PURE__ */ v("option", {
536
+ value: "footer",
537
+ children: "Footer"
538
+ })
539
+ ]
540
+ }),
541
+ /* @__PURE__ */ v("button", {
542
+ type: "button",
543
+ onClick: ce,
544
+ disabled: oe || !J,
545
+ className: "px-4 py-2 border border-border rounded-md hover:bg-accent disabled:opacity-50",
546
+ children: "Attach"
547
+ })
548
+ ]
549
+ })
550
+ ]
551
+ })
552
+ ]
553
+ }) : /* @__PURE__ */ y("div", {
554
+ className: "flex flex-col items-center justify-center h-full text-center px-4",
555
+ children: [
556
+ /* @__PURE__ */ v("div", {
557
+ className: "w-16 h-16 bg-muted rounded-full flex items-center justify-center mb-4",
558
+ children: /* @__PURE__ */ v(h, {
559
+ size: 24,
560
+ className: "text-muted-foreground"
561
+ })
562
+ }),
563
+ /* @__PURE__ */ v("p", {
564
+ className: "text-muted-foreground mb-2",
565
+ children: S("stepEditor.noStepSelected")
566
+ }),
567
+ /* @__PURE__ */ v("p", {
568
+ className: "text-sm text-muted-foreground mb-4",
569
+ children: N.length > 0 ? S("stepEditor.selectStepToEdit") : S("stepEditor.createFirstStep")
570
+ }),
571
+ N.length === 0 && E && /* @__PURE__ */ y("button", {
572
+ onClick: Q,
573
+ className: "px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 flex items-center gap-2",
574
+ children: [/* @__PURE__ */ v(h, { size: 18 }), S("stepEditor.addFirstStep")]
575
+ })
576
+ ]
577
+ })
578
+ })
579
+ ]
580
+ })]
581
+ });
582
+ }
583
+ //#endregion
584
+ export { S as StepEditorPage };
585
+
586
+ //# sourceMappingURL=StepEditorPage.js.map