@burdenoff/microfe-tours 2026.519.1 → 2026.523.1

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 (52) hide show
  1. package/dist/index.js +2 -1
  2. package/dist/tours/ToursAdminRoot.d.ts.map +1 -1
  3. package/dist/tours/ToursAdminRoot.js +23 -20
  4. package/dist/tours/ToursAdminRoot.js.map +1 -1
  5. package/dist/tours/ToursUserRoot.d.ts.map +1 -1
  6. package/dist/tours/ToursUserRoot.js +25 -22
  7. package/dist/tours/ToursUserRoot.js.map +1 -1
  8. package/dist/tours/hooks/useMediaLibrary.js +3 -3
  9. package/dist/tours/hooks/useTourBuilder.js +10 -10
  10. package/dist/tours/hooks/useTourLifecycle.js +3 -3
  11. package/dist/tours/i18n.d.ts +5 -1
  12. package/dist/tours/i18n.d.ts.map +1 -1
  13. package/dist/tours/i18n.js +4 -0
  14. package/dist/tours/i18n.js.map +1 -1
  15. package/dist/tours/index.d.ts +1 -0
  16. package/dist/tours/index.d.ts.map +1 -1
  17. package/dist/tours/index.js +1 -0
  18. package/dist/tours/pages/AnalyticsDashboardPage.d.ts.map +1 -1
  19. package/dist/tours/pages/AnalyticsDashboardPage.js +5 -5
  20. package/dist/tours/pages/AnalyticsDashboardPage.js.map +1 -1
  21. package/dist/tours/pages/MediaLibraryPage.d.ts.map +1 -1
  22. package/dist/tours/pages/MediaLibraryPage.js +97 -96
  23. package/dist/tours/pages/MediaLibraryPage.js.map +1 -1
  24. package/dist/tours/pages/SchedulerPage.d.ts.map +1 -1
  25. package/dist/tours/pages/SchedulerPage.js +129 -126
  26. package/dist/tours/pages/SchedulerPage.js.map +1 -1
  27. package/dist/tours/pages/StepEditorPage.d.ts.map +1 -1
  28. package/dist/tours/pages/StepEditorPage.js +133 -128
  29. package/dist/tours/pages/StepEditorPage.js.map +1 -1
  30. package/dist/tours/pages/SystemAnalyticsPage.d.ts.map +1 -1
  31. package/dist/tours/pages/SystemAnalyticsPage.js +3 -3
  32. package/dist/tours/pages/SystemAnalyticsPage.js.map +1 -1
  33. package/dist/tours/pages/TemplateLibraryPage.d.ts.map +1 -1
  34. package/dist/tours/pages/TemplateLibraryPage.js +97 -94
  35. package/dist/tours/pages/TemplateLibraryPage.js.map +1 -1
  36. package/dist/tours/pages/TourBuilderPage.d.ts.map +1 -1
  37. package/dist/tours/pages/TourBuilderPage.js +232 -230
  38. package/dist/tours/pages/TourBuilderPage.js.map +1 -1
  39. package/dist/tours/pages/TourPreviewPage.d.ts.map +1 -1
  40. package/dist/tours/pages/TourPreviewPage.js +20 -18
  41. package/dist/tours/pages/TourPreviewPage.js.map +1 -1
  42. package/dist/tours/pages/ToursListPage.js +14 -14
  43. package/dist/tours/pages/ToursListPage.js.map +1 -1
  44. package/dist/tours/store/toursStore.d.ts +1 -0
  45. package/dist/tours/store/toursStore.d.ts.map +1 -1
  46. package/dist/tours/store/toursStore.js +14 -0
  47. package/dist/tours/store/toursStore.js.map +1 -1
  48. package/dist/tours/telemetry.d.ts +9 -0
  49. package/dist/tours/telemetry.d.ts.map +1 -0
  50. package/dist/tours/telemetry.js +19 -0
  51. package/dist/tours/telemetry.js.map +1 -0
  52. package/package.json +1 -1
@@ -2,65 +2,67 @@ import { useToursContext as e } from "../providers/ToursProvider.js";
2
2
  import { useToursPermissionAccess as t } from "../hooks/useToursPermissionAccess.js";
3
3
  import { TOUR_PERMISSIONS as n } from "../../constants/permissions.js";
4
4
  import { useToursI18n as r } from "../i18n.js";
5
- import { useMediaLibrary as i } from "../hooks/useMediaLibrary.js";
5
+ import { emitToursApiFailed as i } from "../telemetry.js";
6
+ import { useMediaLibrary as ee } from "../hooks/useMediaLibrary.js";
6
7
  import { useStepSequencer as a } from "../hooks/useStepSequencer.js";
7
8
  import { useTourBuilder as o } from "../hooks/useTourBuilder.js";
8
9
  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";
10
+ import { PermissionGate as te } from "@burdenoff/fe-libs/shared/components";
11
+ import { ArrowLeft as ne, ChevronDown as re, ChevronLeft as l, ChevronRight as u, ChevronUp as d, Menu as f, Paperclip as p, Plus as m, Save as h, Trash2 as g, X as _ } from "lucide-react";
11
12
  import { jsx as v, jsxs as y } from "react/jsx-runtime";
12
13
  import { useNavigate as b, useParams as x } from "react-router-dom";
14
+ import { useEventBus as ie } from "@burdenoff/fe-libs/shared/events";
13
15
  //#region src/tours/pages/StepEditorPage.tsx
14
16
  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);
17
+ let { tr: S } = r(), { tourId: C, stepId: w } = x(), ae = b(), T = e(), { basePath: oe = "/" } = T, E = ie(), { hasPermission: D } = t(), O = D(n.TOUR_STEP_CREATE), k = D(n.TOUR_STEP_UPDATE), A = D(n.TOUR_STEP_DELETE), { tour: j, loadTour: M, syncSteps: N, saving: P } = o(C), { steps: F, selectedStep: I, selectStep: L, createStep: R, deleteStep: z, updateStepField: B, moveStep: V } = a(), { media: se, fetchMedia: H, attachToStep: U, loading: W } = ee(), [G, K] = c(!1), [q, ce] = c(!1), [J, Y] = c(""), [X, Z] = c("body"), [le, Q] = c(!1);
16
18
  s(() => {
17
19
  let e = () => {
18
20
  let e = window.innerWidth < 768;
19
- q(e), e || G(!1);
21
+ ce(e), e || K(!1);
20
22
  };
21
23
  return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
22
24
  }, []), 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);
25
+ C && M(C);
26
+ }, [C, M]), s(() => {
27
+ H();
28
+ }, [H]), s(() => {
29
+ let e = w || I?.id;
30
+ if (e && F.length > 0) {
31
+ let t = F.find((t) => t.id === e);
32
+ t && L(t);
31
33
  }
32
34
  }, [
33
35
  w,
34
- N,
35
36
  F,
36
- P?.id
37
+ L,
38
+ I?.id
37
39
  ]);
38
- let Q = () => {
39
- I();
40
- }, $ = async () => {
40
+ let $ = () => {
41
+ R();
42
+ }, ue = async () => {
41
43
  if (C) try {
42
- await j(C, N);
43
- } catch (e) {
44
- console.error("Failed to save steps:", e);
44
+ await N(C, F);
45
+ } catch {
46
+ i(E, "step.save", T);
45
47
  }
46
- }, se = () => {
47
- re(`${ie}/${C}/edit`);
48
- }, ce = async () => {
49
- if (!(!P || !C || !J)) {
50
- if (P.id.startsWith("temp_")) {
48
+ }, de = () => {
49
+ ae(`${oe}/${C}/edit`);
50
+ }, fe = async () => {
51
+ if (!(!I || !C || !J)) {
52
+ if (I.id.startsWith("temp_")) {
51
53
  window.alert("Save your steps before attaching media to them.");
52
54
  return;
53
55
  }
54
56
  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);
57
+ Q(!0), await U(I.id, J, X, (I.media?.length ?? 0) + 1), await M(C), Y("");
58
+ } catch {
59
+ i(E, "media.attach", T);
58
60
  } finally {
59
- Z(!1);
61
+ Q(!1);
60
62
  }
61
63
  }
62
- }, le = (e) => {
63
- F(e), K && G(!1);
64
+ }, pe = (e) => {
65
+ L(e), q && K(!1);
64
66
  };
65
67
  return /* @__PURE__ */ y("div", {
66
68
  className: "flex flex-col h-full bg-background",
@@ -69,23 +71,23 @@ function S() {
69
71
  children: [/* @__PURE__ */ y("div", {
70
72
  className: "flex items-center gap-3",
71
73
  children: [/* @__PURE__ */ v("button", {
72
- onClick: se,
74
+ onClick: de,
73
75
  className: "p-2 hover:bg-accent rounded-md shrink-0",
74
76
  "aria-label": S("stepEditor.goBack"),
75
- children: /* @__PURE__ */ v(te, { size: 20 })
77
+ children: /* @__PURE__ */ v(ne, { size: 20 })
76
78
  }), /* @__PURE__ */ y("div", {
77
79
  className: "flex-1 min-w-0",
78
80
  children: [/* @__PURE__ */ y("h1", {
79
81
  className: "text-base sm:text-lg font-semibold truncate",
80
82
  children: [
81
- k?.name || S("stepEditor.tourFallback"),
83
+ j?.name || S("stepEditor.tourFallback"),
82
84
  " - ",
83
85
  S("stepEditor.stepsLabel")
84
86
  ]
85
87
  }), /* @__PURE__ */ y("p", {
86
88
  className: "text-xs sm:text-sm text-muted-foreground",
87
89
  children: [
88
- N.length,
90
+ F.length,
89
91
  " ",
90
92
  S("stepEditor.stepsCount")
91
93
  ]
@@ -94,38 +96,38 @@ function S() {
94
96
  }), /* @__PURE__ */ y("div", {
95
97
  className: "flex items-center gap-2 sm:gap-3 ml-auto",
96
98
  children: [
97
- K && /* @__PURE__ */ y("button", {
98
- onClick: () => G(!W),
99
+ q && /* @__PURE__ */ y("button", {
100
+ onClick: () => K(!G),
99
101
  className: "px-3 py-2 border border-border rounded-md hover:bg-accent flex items-center gap-2 sm:hidden",
100
102
  children: [
101
- /* @__PURE__ */ v(p, { size: 18 }),
103
+ /* @__PURE__ */ v(f, { size: 18 }),
102
104
  /* @__PURE__ */ v("span", {
103
105
  className: "text-sm",
104
106
  children: S("stepEditor.steps")
105
107
  }),
106
- N.length > 0 && /* @__PURE__ */ v("span", {
108
+ F.length > 0 && /* @__PURE__ */ v("span", {
107
109
  className: "px-1.5 py-0.5 text-xs bg-primary/20 rounded-full",
108
- children: N.length
110
+ children: F.length
109
111
  })
110
112
  ]
111
113
  }),
112
- E && /* @__PURE__ */ y("button", {
113
- onClick: Q,
114
+ O && /* @__PURE__ */ y("button", {
115
+ onClick: $,
114
116
  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", {
117
+ children: [/* @__PURE__ */ v(m, { size: 18 }), /* @__PURE__ */ v("span", {
116
118
  className: "hidden xs:inline",
117
119
  children: S("stepEditor.addStep")
118
120
  })]
119
121
  }),
120
- /* @__PURE__ */ v(ee, {
122
+ /* @__PURE__ */ v(te, {
121
123
  permission: n.TOUR_STEP_UPDATE,
122
124
  children: /* @__PURE__ */ y("button", {
123
- onClick: $,
124
- disabled: M || !D,
125
+ onClick: ue,
126
+ disabled: P || !k,
125
127
  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", {
128
+ children: [/* @__PURE__ */ v(h, { size: 18 }), /* @__PURE__ */ v("span", {
127
129
  className: "hidden xs:inline",
128
- children: S(M ? "stepEditor.saving" : "stepEditor.save")
130
+ children: S(P ? "stepEditor.saving" : "stepEditor.save")
129
131
  })]
130
132
  })
131
133
  })
@@ -134,29 +136,30 @@ function S() {
134
136
  }), /* @__PURE__ */ y("div", {
135
137
  className: "flex-1 flex overflow-hidden relative",
136
138
  children: [
137
- K && W && /* @__PURE__ */ v("div", {
138
- className: "fixed inset-0 bg-black/50 z-40 md:hidden",
139
- onClick: () => G(!1)
139
+ q && G && /* @__PURE__ */ v("div", {
140
+ className: "fixed inset-0 bg-foreground/40 z-40 md:hidden",
141
+ onClick: () => K(!1)
140
142
  }),
141
143
  /* @__PURE__ */ y("div", {
142
144
  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
+ ${q ? "fixed inset-y-0 left-0 z-50 w-[min(18rem,calc(100vw-2rem))] transform transition-transform duration-300" : "w-64 lg:w-80 shrink-0"}
146
+ ${q && !G ? "-translate-x-full" : "translate-x-0"}
145
147
  border-r border-border overflow-y-auto bg-card
146
148
  `,
147
- children: [K && /* @__PURE__ */ y("div", {
149
+ children: [q && /* @__PURE__ */ y("div", {
148
150
  className: "flex items-center justify-between p-4 border-b border-border sticky top-0 bg-card z-10",
149
151
  children: [/* @__PURE__ */ v("h2", {
150
152
  className: "font-semibold",
151
153
  children: S("stepEditor.tourSteps")
152
154
  }), /* @__PURE__ */ v("button", {
153
- onClick: () => G(!1),
154
- className: "p-2 hover:bg-accent rounded-md",
155
- children: /* @__PURE__ */ v(ne, { size: 20 })
155
+ onClick: () => K(!1),
156
+ className: "p-2 min-h-[44px] min-w-[44px] hover:bg-accent rounded-md",
157
+ "aria-label": S("stepEditor.closeSteps"),
158
+ children: /* @__PURE__ */ v(_, { size: 20 })
156
159
  })]
157
160
  }), /* @__PURE__ */ v("div", {
158
161
  className: "p-3 sm:p-4 space-y-2",
159
- children: N.length === 0 ? /* @__PURE__ */ y("div", {
162
+ children: F.length === 0 ? /* @__PURE__ */ y("div", {
160
163
  className: "text-center py-8 text-muted-foreground",
161
164
  children: [/* @__PURE__ */ v("p", {
162
165
  className: "text-sm",
@@ -165,9 +168,9 @@ function S() {
165
168
  className: "text-xs mt-1",
166
169
  children: S("stepEditor.clickAddStep")
167
170
  })]
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
+ }) : F.map((e, t) => /* @__PURE__ */ v("div", {
172
+ onClick: () => pe(e),
173
+ className: `p-3 border rounded-md cursor-pointer transition-colors ${I?.id === e.id ? "border-primary bg-primary/10" : "border-border hover:bg-accent"}`,
171
174
  children: /* @__PURE__ */ y("div", {
172
175
  className: "flex items-start justify-between gap-2",
173
176
  children: [/* @__PURE__ */ y("div", {
@@ -190,37 +193,37 @@ function S() {
190
193
  children: e.targetSelector
191
194
  })
192
195
  ]
193
- }), O && /* @__PURE__ */ y("div", {
196
+ }), A && /* @__PURE__ */ y("div", {
194
197
  className: "flex items-center gap-1 shrink-0",
195
198
  children: [
196
199
  /* @__PURE__ */ v("button", {
197
200
  onClick: (e) => {
198
- e.stopPropagation(), t > 0 && z(t, t - 1);
201
+ e.stopPropagation(), t > 0 && V(t, t - 1);
199
202
  },
200
- className: "p-1.5 hover:bg-accent rounded",
203
+ className: "p-1.5 sm:p-2 min-h-[32px] min-w-[32px] sm:min-h-[40px] sm:min-w-[40px] hover:bg-accent rounded",
201
204
  title: "Move step up",
202
205
  "aria-label": "Move step up",
203
206
  disabled: t === 0,
204
- children: /* @__PURE__ */ v(f, { size: 14 })
207
+ children: /* @__PURE__ */ v(d, { size: 14 })
205
208
  }),
206
209
  /* @__PURE__ */ v("button", {
207
210
  onClick: (e) => {
208
- e.stopPropagation(), t < N.length - 1 && z(t, t + 1);
211
+ e.stopPropagation(), t < F.length - 1 && V(t, t + 1);
209
212
  },
210
- className: "p-1.5 hover:bg-accent rounded",
213
+ className: "p-1.5 sm:p-2 min-h-[32px] min-w-[32px] sm:min-h-[40px] sm:min-w-[40px] hover:bg-accent rounded",
211
214
  title: "Move step down",
212
215
  "aria-label": "Move step down",
213
- disabled: t === N.length - 1,
214
- children: /* @__PURE__ */ v(l, { size: 14 })
216
+ disabled: t === F.length - 1,
217
+ children: /* @__PURE__ */ v(re, { size: 14 })
215
218
  }),
216
219
  /* @__PURE__ */ v("button", {
217
220
  onClick: (t) => {
218
- t.stopPropagation(), L(e.id);
221
+ t.stopPropagation(), z(e.id);
219
222
  },
220
- className: "p-1.5 hover:bg-destructive/10 rounded text-destructive",
223
+ className: "p-1.5 sm:p-2 min-h-[32px] min-w-[32px] sm:min-h-[40px] sm:min-w-[40px] hover:bg-destructive/10 rounded text-destructive",
221
224
  title: S("stepEditor.deleteStep"),
222
225
  "aria-label": S("stepEditor.deleteStep"),
223
- children: /* @__PURE__ */ v(_, { size: 14 })
226
+ children: /* @__PURE__ */ v(g, { size: 14 })
224
227
  })
225
228
  ]
226
229
  })]
@@ -230,41 +233,43 @@ function S() {
230
233
  }),
231
234
  /* @__PURE__ */ v("div", {
232
235
  className: "flex-1 overflow-y-auto p-4 sm:p-6",
233
- children: P ? /* @__PURE__ */ y("div", {
236
+ children: I ? /* @__PURE__ */ y("div", {
234
237
  className: "max-w-2xl mx-auto space-y-4 sm:space-y-6",
235
238
  children: [
236
- K && N.length > 1 && /* @__PURE__ */ y("div", {
239
+ q && F.length > 1 && /* @__PURE__ */ y("div", {
237
240
  className: "flex items-center justify-between bg-muted/50 rounded-lg p-2 mb-4",
238
241
  children: [
239
242
  /* @__PURE__ */ v("button", {
240
243
  onClick: () => {
241
- let e = N.findIndex((e) => e.id === P.id);
242
- e > 0 && F(N[e - 1]);
244
+ let e = F.findIndex((e) => e.id === I.id);
245
+ e > 0 && L(F[e - 1]);
243
246
  },
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
+ disabled: F.findIndex((e) => e.id === I.id) === 0,
248
+ className: "p-2 min-h-[44px] min-w-[44px] hover:bg-accent rounded-md disabled:opacity-30",
249
+ "aria-label": S("stepEditor.previousStep"),
250
+ children: /* @__PURE__ */ v(l, { size: 20 })
247
251
  }),
248
252
  /* @__PURE__ */ y("span", {
249
253
  className: "text-sm text-muted-foreground",
250
254
  children: [
251
255
  S("stepEditor.stepNumber"),
252
256
  " ",
253
- N.findIndex((e) => e.id === P.id) + 1,
257
+ F.findIndex((e) => e.id === I.id) + 1,
254
258
  " ",
255
259
  S("stepEditor.of"),
256
260
  " ",
257
- N.length
261
+ F.length
258
262
  ]
259
263
  }),
260
264
  /* @__PURE__ */ v("button", {
261
265
  onClick: () => {
262
- let e = N.findIndex((e) => e.id === P.id);
263
- e < N.length - 1 && F(N[e + 1]);
266
+ let e = F.findIndex((e) => e.id === I.id);
267
+ e < F.length - 1 && L(F[e + 1]);
264
268
  },
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 })
269
+ disabled: F.findIndex((e) => e.id === I.id) === F.length - 1,
270
+ className: "p-2 min-h-[44px] min-w-[44px] hover:bg-accent rounded-md disabled:opacity-30",
271
+ "aria-label": S("stepEditor.nextStep"),
272
+ children: /* @__PURE__ */ v(u, { size: 20 })
268
273
  })
269
274
  ]
270
275
  }),
@@ -277,8 +282,8 @@ function S() {
277
282
  children: [S("stepEditor.stepTitle"), " *"]
278
283
  }), /* @__PURE__ */ v("input", {
279
284
  type: "text",
280
- value: P.title,
281
- onChange: (e) => R(P.id, "title", e.target.value),
285
+ value: I.title,
286
+ onChange: (e) => B(I.id, "title", e.target.value),
282
287
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm sm:text-base",
283
288
  placeholder: S("stepEditor.stepTitlePlaceholder")
284
289
  })] }),
@@ -286,8 +291,8 @@ function S() {
286
291
  className: "block text-sm font-medium mb-2",
287
292
  children: [S("stepEditor.content"), " *"]
288
293
  }), /* @__PURE__ */ v("textarea", {
289
- value: P.content,
290
- onChange: (e) => R(P.id, "content", e.target.value),
294
+ value: I.content,
295
+ onChange: (e) => B(I.id, "content", e.target.value),
291
296
  rows: 4,
292
297
  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
298
  placeholder: S("stepEditor.contentPlaceholder")
@@ -310,8 +315,8 @@ function S() {
310
315
  }),
311
316
  /* @__PURE__ */ v("input", {
312
317
  type: "text",
313
- value: P.targetSelector || "",
314
- onChange: (e) => R(P.id, "targetSelector", e.target.value),
318
+ value: I.targetSelector || "",
319
+ onChange: (e) => B(I.id, "targetSelector", e.target.value),
315
320
  placeholder: S("stepEditor.cssSelectorPlaceholder"),
316
321
  className: "w-full px-3 py-2 border border-border rounded-md bg-background font-mono text-sm"
317
322
  }),
@@ -324,8 +329,8 @@ function S() {
324
329
  className: "block text-sm font-medium mb-2",
325
330
  children: S("stepEditor.tooltipPlacement")
326
331
  }), /* @__PURE__ */ y("select", {
327
- value: P.placement,
328
- onChange: (e) => R(P.id, "placement", e.target.value),
332
+ value: I.placement,
333
+ onChange: (e) => B(I.id, "placement", e.target.value),
329
334
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm sm:text-base",
330
335
  children: [
331
336
  /* @__PURE__ */ v("option", {
@@ -371,8 +376,8 @@ function S() {
371
376
  children: S("stepEditor.mobileSelector")
372
377
  }), /* @__PURE__ */ v("input", {
373
378
  type: "text",
374
- value: P.targetSelectorMobile || "",
375
- onChange: (e) => R(P.id, "targetSelectorMobile", e.target.value),
379
+ value: I.targetSelectorMobile || "",
380
+ onChange: (e) => B(I.id, "targetSelectorMobile", e.target.value),
376
381
  placeholder: S("stepEditor.leaveEmptyDefault"),
377
382
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm font-mono"
378
383
  })] }),
@@ -381,8 +386,8 @@ function S() {
381
386
  children: S("stepEditor.tabletSelector")
382
387
  }), /* @__PURE__ */ v("input", {
383
388
  type: "text",
384
- value: P.targetSelectorTablet || "",
385
- onChange: (e) => R(P.id, "targetSelectorTablet", e.target.value),
389
+ value: I.targetSelectorTablet || "",
390
+ onChange: (e) => B(I.id, "targetSelectorTablet", e.target.value),
386
391
  placeholder: S("stepEditor.leaveEmptyDefault"),
387
392
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm font-mono"
388
393
  })] }),
@@ -391,8 +396,8 @@ function S() {
391
396
  children: S("stepEditor.desktopSelector")
392
397
  }), /* @__PURE__ */ v("input", {
393
398
  type: "text",
394
- value: P.targetSelectorDesktop || "",
395
- onChange: (e) => R(P.id, "targetSelectorDesktop", e.target.value),
399
+ value: I.targetSelectorDesktop || "",
400
+ onChange: (e) => B(I.id, "targetSelectorDesktop", e.target.value),
396
401
  placeholder: S("stepEditor.leaveEmptyDefault"),
397
402
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm font-mono"
398
403
  })] })
@@ -405,8 +410,8 @@ function S() {
405
410
  className: "flex items-center gap-3 cursor-pointer rounded-md border border-border p-3",
406
411
  children: [/* @__PURE__ */ v("input", {
407
412
  type: "checkbox",
408
- checked: P.requireInteraction ?? !1,
409
- onChange: (e) => R(P.id, "requireInteraction", e.target.checked),
413
+ checked: I.requireInteraction ?? !1,
414
+ onChange: (e) => B(I.id, "requireInteraction", e.target.checked),
410
415
  className: "w-4 h-4 rounded"
411
416
  }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("div", {
412
417
  className: "text-sm font-medium",
@@ -421,8 +426,8 @@ function S() {
421
426
  }), /* @__PURE__ */ v("input", {
422
427
  type: "number",
423
428
  min: "0",
424
- value: P.waitForTimeout ?? "",
425
- onChange: (e) => R(P.id, "waitForTimeout", e.target.value ? Number(e.target.value) : void 0),
429
+ value: I.waitForTimeout ?? "",
430
+ onChange: (e) => B(I.id, "waitForTimeout", e.target.value ? Number(e.target.value) : void 0),
426
431
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm",
427
432
  placeholder: "1500"
428
433
  })] })]
@@ -434,8 +439,8 @@ function S() {
434
439
  children: "Wait for selector"
435
440
  }), /* @__PURE__ */ v("input", {
436
441
  type: "text",
437
- value: P.waitForSelector || "",
438
- onChange: (e) => R(P.id, "waitForSelector", e.target.value || void 0),
442
+ value: I.waitForSelector || "",
443
+ onChange: (e) => B(I.id, "waitForSelector", e.target.value || void 0),
439
444
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm font-mono",
440
445
  placeholder: "[data-tour='agents-tabs']"
441
446
  })] }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
@@ -443,8 +448,8 @@ function S() {
443
448
  children: "Wait for event"
444
449
  }), /* @__PURE__ */ v("input", {
445
450
  type: "text",
446
- value: P.waitForEvent || "",
447
- onChange: (e) => R(P.id, "waitForEvent", e.target.value || void 0),
451
+ value: I.waitForEvent || "",
452
+ onChange: (e) => B(I.id, "waitForEvent", e.target.value || void 0),
448
453
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm",
449
454
  placeholder: "tour:ready"
450
455
  })] })]
@@ -453,17 +458,17 @@ function S() {
453
458
  className: "block text-sm font-medium mb-2",
454
459
  children: "Skip conditions (JSON)"
455
460
  }), /* @__PURE__ */ v("textarea", {
456
- value: P.skipConditions ? JSON.stringify(P.skipConditions, null, 2) : "",
461
+ value: I.skipConditions ? JSON.stringify(I.skipConditions, null, 2) : "",
457
462
  onChange: (e) => {
458
463
  let t = e.target.value.trim();
459
464
  if (!t) {
460
- R(P.id, "skipConditions", void 0);
465
+ B(I.id, "skipConditions", void 0);
461
466
  return;
462
467
  }
463
468
  try {
464
- R(P.id, "skipConditions", JSON.parse(t));
469
+ B(I.id, "skipConditions", JSON.parse(t));
465
470
  } catch {
466
- R(P.id, "skipConditions", t);
471
+ B(I.id, "skipConditions", t);
467
472
  }
468
473
  },
469
474
  rows: 4,
@@ -475,14 +480,14 @@ function S() {
475
480
  children: [
476
481
  /* @__PURE__ */ y("div", {
477
482
  className: "flex items-center gap-2",
478
- children: [/* @__PURE__ */ v(m, { size: 18 }), /* @__PURE__ */ v("h3", {
483
+ children: [/* @__PURE__ */ v(p, { size: 18 }), /* @__PURE__ */ v("h3", {
479
484
  className: "text-sm font-semibold",
480
485
  children: "Step media"
481
486
  })]
482
487
  }),
483
- P.media && P.media.length > 0 ? /* @__PURE__ */ v("div", {
488
+ I.media && I.media.length > 0 ? /* @__PURE__ */ v("div", {
484
489
  className: "space-y-2",
485
- children: P.media.map((e) => /* @__PURE__ */ y("div", {
490
+ children: I.media.map((e) => /* @__PURE__ */ y("div", {
486
491
  className: "flex items-center justify-between rounded-md border border-border p-2 text-sm",
487
492
  children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("div", {
488
493
  className: "font-medium",
@@ -508,8 +513,8 @@ function S() {
508
513
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm",
509
514
  children: [/* @__PURE__ */ v("option", {
510
515
  value: "",
511
- children: U ? "Loading media..." : "Select uploaded media"
512
- }), B.map((e) => /* @__PURE__ */ y("option", {
516
+ children: W ? "Loading media..." : "Select uploaded media"
517
+ }), se.map((e) => /* @__PURE__ */ y("option", {
513
518
  value: e.id,
514
519
  children: [
515
520
  e.name,
@@ -521,7 +526,7 @@ function S() {
521
526
  }),
522
527
  /* @__PURE__ */ y("select", {
523
528
  value: X,
524
- onChange: (e) => ae(e.target.value),
529
+ onChange: (e) => Z(e.target.value),
525
530
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm",
526
531
  children: [
527
532
  /* @__PURE__ */ v("option", {
@@ -540,9 +545,9 @@ function S() {
540
545
  }),
541
546
  /* @__PURE__ */ v("button", {
542
547
  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",
548
+ onClick: fe,
549
+ disabled: le || !J,
550
+ className: "px-4 py-2 min-h-[44px] border border-border rounded-md hover:bg-accent disabled:opacity-50",
546
551
  children: "Attach"
547
552
  })
548
553
  ]
@@ -555,7 +560,7 @@ function S() {
555
560
  children: [
556
561
  /* @__PURE__ */ v("div", {
557
562
  className: "w-16 h-16 bg-muted rounded-full flex items-center justify-center mb-4",
558
- children: /* @__PURE__ */ v(h, {
563
+ children: /* @__PURE__ */ v(m, {
559
564
  size: 24,
560
565
  className: "text-muted-foreground"
561
566
  })
@@ -566,12 +571,12 @@ function S() {
566
571
  }),
567
572
  /* @__PURE__ */ v("p", {
568
573
  className: "text-sm text-muted-foreground mb-4",
569
- children: N.length > 0 ? S("stepEditor.selectStepToEdit") : S("stepEditor.createFirstStep")
574
+ children: F.length > 0 ? S("stepEditor.selectStepToEdit") : S("stepEditor.createFirstStep")
570
575
  }),
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")]
576
+ F.length === 0 && O && /* @__PURE__ */ y("button", {
577
+ onClick: $,
578
+ className: "px-4 py-2 min-h-[44px] bg-primary text-primary-foreground rounded-md hover:bg-primary/90 flex items-center gap-2",
579
+ children: [/* @__PURE__ */ v(m, { size: 18 }), S("stepEditor.addFirstStep")]
575
580
  })
576
581
  ]
577
582
  })