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