@burdenoff/microfe-tours 2026.518.2 → 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.
- package/dist/index.js +2 -1
- package/dist/tours/ToursAdminRoot.d.ts.map +1 -1
- package/dist/tours/ToursAdminRoot.js +23 -20
- package/dist/tours/ToursAdminRoot.js.map +1 -1
- package/dist/tours/ToursUserRoot.d.ts.map +1 -1
- package/dist/tours/ToursUserRoot.js +25 -22
- package/dist/tours/ToursUserRoot.js.map +1 -1
- package/dist/tours/hooks/useMediaLibrary.js +3 -3
- package/dist/tours/hooks/useTourBuilder.js +10 -10
- package/dist/tours/hooks/useTourLifecycle.js +3 -3
- package/dist/tours/i18n.d.ts +5 -1
- package/dist/tours/i18n.d.ts.map +1 -1
- package/dist/tours/i18n.js +4 -0
- package/dist/tours/i18n.js.map +1 -1
- package/dist/tours/index.d.ts +1 -0
- package/dist/tours/index.d.ts.map +1 -1
- package/dist/tours/index.js +1 -0
- package/dist/tours/pages/AnalyticsDashboardPage.d.ts.map +1 -1
- package/dist/tours/pages/AnalyticsDashboardPage.js +5 -5
- package/dist/tours/pages/AnalyticsDashboardPage.js.map +1 -1
- package/dist/tours/pages/MediaLibraryPage.d.ts.map +1 -1
- package/dist/tours/pages/MediaLibraryPage.js +97 -96
- package/dist/tours/pages/MediaLibraryPage.js.map +1 -1
- package/dist/tours/pages/SchedulerPage.d.ts.map +1 -1
- package/dist/tours/pages/SchedulerPage.js +129 -126
- package/dist/tours/pages/SchedulerPage.js.map +1 -1
- package/dist/tours/pages/StepEditorPage.d.ts.map +1 -1
- package/dist/tours/pages/StepEditorPage.js +133 -128
- package/dist/tours/pages/StepEditorPage.js.map +1 -1
- package/dist/tours/pages/SystemAnalyticsPage.d.ts.map +1 -1
- package/dist/tours/pages/SystemAnalyticsPage.js +3 -3
- package/dist/tours/pages/SystemAnalyticsPage.js.map +1 -1
- package/dist/tours/pages/TemplateLibraryPage.d.ts.map +1 -1
- package/dist/tours/pages/TemplateLibraryPage.js +97 -94
- package/dist/tours/pages/TemplateLibraryPage.js.map +1 -1
- package/dist/tours/pages/TourBuilderPage.d.ts.map +1 -1
- package/dist/tours/pages/TourBuilderPage.js +232 -230
- package/dist/tours/pages/TourBuilderPage.js.map +1 -1
- package/dist/tours/pages/TourPreviewPage.d.ts.map +1 -1
- package/dist/tours/pages/TourPreviewPage.js +20 -18
- package/dist/tours/pages/TourPreviewPage.js.map +1 -1
- package/dist/tours/pages/ToursListPage.js +14 -14
- package/dist/tours/pages/ToursListPage.js.map +1 -1
- package/dist/tours/store/toursStore.d.ts +1 -0
- package/dist/tours/store/toursStore.d.ts.map +1 -1
- package/dist/tours/store/toursStore.js +14 -0
- package/dist/tours/store/toursStore.js.map +1 -1
- package/dist/tours/telemetry.d.ts +9 -0
- package/dist/tours/telemetry.d.ts.map +1 -0
- package/dist/tours/telemetry.js +19 -0
- package/dist/tours/telemetry.js.map +1 -0
- package/package.json +2 -2
|
@@ -4,14 +4,16 @@ import { useTourLifecycle as n } from "../hooks/useTourLifecycle.js";
|
|
|
4
4
|
import { useToursPermissionAccess as r } from "../hooks/useToursPermissionAccess.js";
|
|
5
5
|
import { TOUR_PERMISSIONS as i } from "../../constants/permissions.js";
|
|
6
6
|
import { useToursI18n as a } from "../i18n.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
7
|
+
import { emitToursApiFailed as o } from "../telemetry.js";
|
|
8
|
+
import { useTourBuilder as s } from "../hooks/useTourBuilder.js";
|
|
9
|
+
import { useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
10
|
+
import { PermissionGate as f } from "@burdenoff/fe-libs/shared/components";
|
|
11
|
+
import { ArrowLeft as ee, BarChart3 as te, Calendar as ne, Eye as re, LayoutTemplate as ie, ListOrdered as ae, Save as oe } from "lucide-react";
|
|
12
|
+
import { Fragment as se, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
13
|
+
import { useNavigate as h, useParams as g } from "react-router-dom";
|
|
14
|
+
import { useEventBus as _ } from "@burdenoff/fe-libs/shared/events";
|
|
13
15
|
//#region src/tours/pages/TourBuilderPage.tsx
|
|
14
|
-
var
|
|
16
|
+
var v = 250, y = [
|
|
15
17
|
{
|
|
16
18
|
productId: "vibecontrols",
|
|
17
19
|
moduleId: "dashboard",
|
|
@@ -169,38 +171,38 @@ var y = 250, b = [
|
|
|
169
171
|
isModuleHome: !0
|
|
170
172
|
}
|
|
171
173
|
];
|
|
172
|
-
function
|
|
174
|
+
function b(e) {
|
|
173
175
|
return e?.trim() || void 0;
|
|
174
176
|
}
|
|
175
|
-
function
|
|
176
|
-
let t =
|
|
177
|
-
return t ?
|
|
177
|
+
function x(e) {
|
|
178
|
+
let t = b(e);
|
|
179
|
+
return t ? y.filter((e) => e.productId === t) : [];
|
|
178
180
|
}
|
|
179
|
-
function
|
|
181
|
+
function ce(e) {
|
|
180
182
|
let t = /* @__PURE__ */ new Map();
|
|
181
|
-
for (let n of
|
|
183
|
+
for (let n of x(e)) (!t.get(n.moduleId) || n.isModuleHome) && t.set(n.moduleId, {
|
|
182
184
|
moduleId: n.moduleId,
|
|
183
185
|
label: n.moduleLabel,
|
|
184
186
|
path: n.path
|
|
185
187
|
});
|
|
186
188
|
return [...t.values()];
|
|
187
189
|
}
|
|
188
|
-
function
|
|
189
|
-
let n =
|
|
190
|
-
return n ?
|
|
190
|
+
function le(e, t) {
|
|
191
|
+
let n = b(t);
|
|
192
|
+
return n ? x(e).filter((e) => e.moduleId === n).map((e) => ({
|
|
191
193
|
pageId: e.pageId,
|
|
192
194
|
label: e.pageLabel,
|
|
193
195
|
path: e.path
|
|
194
196
|
})) : [];
|
|
195
197
|
}
|
|
196
|
-
function
|
|
197
|
-
let { tr:
|
|
198
|
+
function S() {
|
|
199
|
+
let { tr: y } = a(), { tourId: b } = g(), x = h(), S = e(), { basePath: C = "/" } = S, w = _(), { hasPermission: T } = r(), E = !b || b === "new", ue = T(i.TOUR_CREATE), de = T(i.TOUR_UPDATE), fe = T(i.TOUR_TEMPLATE_CREATE), pe = E ? ue : de, { tour: D, loadTour: O, createTour: k, updateTour: A, saving: j, validationErrors: M, error: N } = s(b), { saveAsTemplate: P } = n(), { data: F, loading: I } = t({
|
|
198
200
|
variables: {
|
|
199
|
-
limit:
|
|
201
|
+
limit: v,
|
|
200
202
|
offset: 0
|
|
201
203
|
},
|
|
202
204
|
fetchPolicy: "cache-and-network"
|
|
203
|
-
}), [
|
|
205
|
+
}), [L, R] = d({
|
|
204
206
|
name: "",
|
|
205
207
|
description: "",
|
|
206
208
|
productId: "",
|
|
@@ -213,140 +215,140 @@ function T() {
|
|
|
213
215
|
displayOrder: 1,
|
|
214
216
|
startDate: "",
|
|
215
217
|
endDate: ""
|
|
216
|
-
}), [
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}, [
|
|
220
|
-
|
|
221
|
-
}, [
|
|
222
|
-
if (!
|
|
223
|
-
|
|
218
|
+
}), [z, B] = d(!1), [V, H] = d(!1), [U, W] = d(!1), G = u(!1), K = l(() => [...F?.platformProducts.items ?? []].sort((e, t) => e.name.localeCompare(t.name)), [F]), q = l(() => new Set(K.map((e) => e.slug)), [K]), J = l(() => ce(L.productId), [L.productId]), Y = l(() => new Set(J.map((e) => e.moduleId)), [J]), X = l(() => le(L.productId, L.moduleId), [L.moduleId, L.productId]), Z = l(() => new Set(X.map((e) => e.pageId)), [X]);
|
|
219
|
+
c(() => {
|
|
220
|
+
b && b !== "new" && (G.current = !1, O(b));
|
|
221
|
+
}, [b, O]), c(() => {
|
|
222
|
+
D && !G.current && (R(D), G.current = !0);
|
|
223
|
+
}, [D]), c(() => {
|
|
224
|
+
if (!L.productId || I) {
|
|
225
|
+
B(!1);
|
|
224
226
|
return;
|
|
225
227
|
}
|
|
226
|
-
|
|
228
|
+
B(K.length > 0 && !q.has(L.productId));
|
|
227
229
|
}, [
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
]),
|
|
233
|
-
if (!
|
|
234
|
-
|
|
230
|
+
L.productId,
|
|
231
|
+
q,
|
|
232
|
+
K.length,
|
|
233
|
+
I
|
|
234
|
+
]), c(() => {
|
|
235
|
+
if (!L.productId || !L.moduleId) {
|
|
236
|
+
H(!1);
|
|
235
237
|
return;
|
|
236
238
|
}
|
|
237
|
-
|
|
239
|
+
H(J.length === 0 || !Y.has(L.moduleId));
|
|
238
240
|
}, [
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
]),
|
|
244
|
-
if (!
|
|
245
|
-
|
|
241
|
+
L.moduleId,
|
|
242
|
+
L.productId,
|
|
243
|
+
Y,
|
|
244
|
+
J.length
|
|
245
|
+
]), c(() => {
|
|
246
|
+
if (!L.productId || !L.pageId) {
|
|
247
|
+
W(!1);
|
|
246
248
|
return;
|
|
247
249
|
}
|
|
248
|
-
|
|
250
|
+
W(X.length === 0 || !Z.has(L.pageId));
|
|
249
251
|
}, [
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
L.pageId,
|
|
253
|
+
L.productId,
|
|
254
|
+
Z,
|
|
255
|
+
X.length
|
|
254
256
|
]);
|
|
255
|
-
let
|
|
257
|
+
let me = !!(L.productId && !z && !q.has(L.productId)), he = !!(L.moduleId && !V && !Y.has(L.moduleId)), ge = !!(L.pageId && !U && !Z.has(L.pageId)), _e = async (e) => {
|
|
256
258
|
e.preventDefault();
|
|
257
259
|
try {
|
|
258
|
-
|
|
259
|
-
} catch
|
|
260
|
-
|
|
260
|
+
b && b !== "new" ? await A(b, L) : await k(L);
|
|
261
|
+
} catch {
|
|
262
|
+
o(w, "tour.save", S);
|
|
261
263
|
}
|
|
262
|
-
},
|
|
263
|
-
|
|
264
|
+
}, Q = () => {
|
|
265
|
+
x(`${C}/list`);
|
|
264
266
|
}, $ = (e) => {
|
|
265
267
|
if (!e) return "";
|
|
266
268
|
let t = new Date(e);
|
|
267
269
|
return Number.isNaN(t.getTime()) ? "" : (/* @__PURE__ */ new Date(t.getTime() - t.getTimezoneOffset() * 6e4)).toISOString().slice(0, 16);
|
|
268
270
|
};
|
|
269
|
-
return /* @__PURE__ */
|
|
271
|
+
return /* @__PURE__ */ m("div", {
|
|
270
272
|
className: "space-y-4 sm:space-y-6 p-3 sm:p-6 max-w-4xl mx-auto",
|
|
271
|
-
children: [/* @__PURE__ */
|
|
273
|
+
children: [/* @__PURE__ */ m("div", {
|
|
272
274
|
className: "flex items-center gap-4",
|
|
273
|
-
children: [/* @__PURE__ */
|
|
274
|
-
onClick:
|
|
275
|
+
children: [/* @__PURE__ */ p("button", {
|
|
276
|
+
onClick: Q,
|
|
275
277
|
className: "p-2 hover:bg-accent rounded-md",
|
|
276
|
-
"aria-label":
|
|
277
|
-
children: /* @__PURE__ */
|
|
278
|
-
}), /* @__PURE__ */
|
|
278
|
+
"aria-label": y("tourBuilder.goBack"),
|
|
279
|
+
children: /* @__PURE__ */ p(ee, { size: 20 })
|
|
280
|
+
}), /* @__PURE__ */ m("div", {
|
|
279
281
|
className: "flex-1",
|
|
280
|
-
children: [/* @__PURE__ */
|
|
282
|
+
children: [/* @__PURE__ */ p("h1", {
|
|
281
283
|
className: "text-xl sm:text-2xl font-bold text-foreground",
|
|
282
|
-
children: b
|
|
283
|
-
}), /* @__PURE__ */
|
|
284
|
+
children: y(b && b !== "new" ? "tourBuilder.titleEdit" : "tourBuilder.titleCreate")
|
|
285
|
+
}), /* @__PURE__ */ p("p", {
|
|
284
286
|
className: "text-sm text-muted-foreground",
|
|
285
|
-
children:
|
|
287
|
+
children: y("tourBuilder.subtitle")
|
|
286
288
|
})]
|
|
287
289
|
})]
|
|
288
|
-
}), /* @__PURE__ */
|
|
289
|
-
onSubmit:
|
|
290
|
+
}), /* @__PURE__ */ m("form", {
|
|
291
|
+
onSubmit: _e,
|
|
290
292
|
className: "space-y-6",
|
|
291
293
|
children: [
|
|
292
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ m("div", {
|
|
293
295
|
className: "border border-border rounded-md p-4 sm:p-6 bg-card",
|
|
294
|
-
children: [/* @__PURE__ */
|
|
296
|
+
children: [/* @__PURE__ */ p("h2", {
|
|
295
297
|
className: "text-lg font-semibold mb-4",
|
|
296
|
-
children:
|
|
297
|
-
}), /* @__PURE__ */
|
|
298
|
+
children: y("tourBuilder.sectionBasicInfo")
|
|
299
|
+
}), /* @__PURE__ */ m("div", {
|
|
298
300
|
className: "space-y-4",
|
|
299
301
|
children: [
|
|
300
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
301
303
|
className: "block text-sm font-medium mb-2",
|
|
302
304
|
htmlFor: "tour-name",
|
|
303
|
-
children:
|
|
304
|
-
}), /* @__PURE__ */
|
|
305
|
+
children: y("tourBuilder.labelName")
|
|
306
|
+
}), /* @__PURE__ */ p("input", {
|
|
305
307
|
id: "tour-name",
|
|
306
308
|
type: "text",
|
|
307
|
-
value:
|
|
308
|
-
onChange: (e) =>
|
|
309
|
-
...
|
|
309
|
+
value: L.name || "",
|
|
310
|
+
onChange: (e) => R({
|
|
311
|
+
...L,
|
|
310
312
|
name: e.target.value
|
|
311
313
|
}),
|
|
312
314
|
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
313
315
|
required: !0
|
|
314
316
|
})] }),
|
|
315
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
316
318
|
className: "block text-sm font-medium mb-2",
|
|
317
319
|
htmlFor: "tour-description",
|
|
318
|
-
children:
|
|
319
|
-
}), /* @__PURE__ */
|
|
320
|
+
children: y("tourBuilder.labelDescription")
|
|
321
|
+
}), /* @__PURE__ */ p("textarea", {
|
|
320
322
|
id: "tour-description",
|
|
321
|
-
value:
|
|
322
|
-
onChange: (e) =>
|
|
323
|
-
...
|
|
323
|
+
value: L.description || "",
|
|
324
|
+
onChange: (e) => R({
|
|
325
|
+
...L,
|
|
324
326
|
description: e.target.value
|
|
325
327
|
}),
|
|
326
328
|
rows: 3,
|
|
327
329
|
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground"
|
|
328
330
|
})] }),
|
|
329
|
-
/* @__PURE__ */
|
|
330
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ m("div", { children: [
|
|
332
|
+
/* @__PURE__ */ p("label", {
|
|
331
333
|
className: "block text-sm font-medium mb-2",
|
|
332
334
|
htmlFor: "product-id",
|
|
333
|
-
children:
|
|
335
|
+
children: y("tourBuilder.labelProductId")
|
|
334
336
|
}),
|
|
335
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ m("select", {
|
|
336
338
|
id: "product-id",
|
|
337
|
-
value:
|
|
339
|
+
value: z ? "__custom__" : L.productId || "",
|
|
338
340
|
onChange: (e) => {
|
|
339
341
|
if (e.target.value === "__custom__") {
|
|
340
|
-
|
|
341
|
-
...
|
|
342
|
+
B(!0), R({
|
|
343
|
+
...L,
|
|
342
344
|
productId: "",
|
|
343
345
|
moduleId: void 0,
|
|
344
346
|
pageId: void 0
|
|
345
347
|
});
|
|
346
348
|
return;
|
|
347
349
|
}
|
|
348
|
-
|
|
349
|
-
...
|
|
350
|
+
B(!1), H(!1), W(!1), R({
|
|
351
|
+
...L,
|
|
350
352
|
productId: e.target.value,
|
|
351
353
|
moduleId: void 0,
|
|
352
354
|
pageId: void 0
|
|
@@ -355,15 +357,15 @@ function T() {
|
|
|
355
357
|
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
356
358
|
required: !0,
|
|
357
359
|
children: [
|
|
358
|
-
/* @__PURE__ */
|
|
360
|
+
/* @__PURE__ */ p("option", {
|
|
359
361
|
value: "",
|
|
360
362
|
children: "Select product"
|
|
361
363
|
}),
|
|
362
|
-
|
|
364
|
+
I ? /* @__PURE__ */ p("option", {
|
|
363
365
|
disabled: !0,
|
|
364
366
|
children: "Loading products..."
|
|
365
367
|
}) : null,
|
|
366
|
-
|
|
368
|
+
K.map((e) => /* @__PURE__ */ m("option", {
|
|
367
369
|
value: e.slug,
|
|
368
370
|
children: [
|
|
369
371
|
e.name,
|
|
@@ -372,22 +374,22 @@ function T() {
|
|
|
372
374
|
")"
|
|
373
375
|
]
|
|
374
376
|
}, e.id)),
|
|
375
|
-
|
|
376
|
-
value:
|
|
377
|
-
children: ["Current: ",
|
|
377
|
+
me ? /* @__PURE__ */ m("option", {
|
|
378
|
+
value: L.productId,
|
|
379
|
+
children: ["Current: ", L.productId]
|
|
378
380
|
}) : null,
|
|
379
|
-
/* @__PURE__ */
|
|
381
|
+
/* @__PURE__ */ p("option", {
|
|
380
382
|
value: "__custom__",
|
|
381
383
|
children: "Custom product slug"
|
|
382
384
|
})
|
|
383
385
|
]
|
|
384
386
|
}),
|
|
385
|
-
|
|
387
|
+
z ? /* @__PURE__ */ p("input", {
|
|
386
388
|
id: "product-id-custom",
|
|
387
389
|
type: "text",
|
|
388
|
-
value:
|
|
389
|
-
onChange: (e) =>
|
|
390
|
-
...
|
|
390
|
+
value: L.productId || "",
|
|
391
|
+
onChange: (e) => R({
|
|
392
|
+
...L,
|
|
391
393
|
productId: e.target.value,
|
|
392
394
|
moduleId: void 0,
|
|
393
395
|
pageId: void 0
|
|
@@ -397,40 +399,40 @@ function T() {
|
|
|
397
399
|
required: !0
|
|
398
400
|
}) : null
|
|
399
401
|
] }),
|
|
400
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ m("div", {
|
|
401
403
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
402
|
-
children: [/* @__PURE__ */
|
|
403
|
-
/* @__PURE__ */
|
|
404
|
+
children: [/* @__PURE__ */ m("div", { children: [
|
|
405
|
+
/* @__PURE__ */ p("label", {
|
|
404
406
|
className: "block text-sm font-medium mb-2",
|
|
405
407
|
htmlFor: "module-id",
|
|
406
408
|
children: "Module ID"
|
|
407
409
|
}),
|
|
408
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ m("select", {
|
|
409
411
|
id: "module-id",
|
|
410
|
-
value:
|
|
412
|
+
value: V ? "__custom__" : L.moduleId || "",
|
|
411
413
|
onChange: (e) => {
|
|
412
414
|
if (e.target.value === "__custom__") {
|
|
413
|
-
|
|
414
|
-
...
|
|
415
|
+
H(!0), R({
|
|
416
|
+
...L,
|
|
415
417
|
moduleId: "",
|
|
416
418
|
pageId: void 0
|
|
417
419
|
});
|
|
418
420
|
return;
|
|
419
421
|
}
|
|
420
|
-
|
|
421
|
-
...
|
|
422
|
+
H(!1), W(!1), R({
|
|
423
|
+
...L,
|
|
422
424
|
moduleId: e.target.value || void 0,
|
|
423
425
|
pageId: void 0
|
|
424
426
|
});
|
|
425
427
|
},
|
|
426
428
|
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
427
|
-
disabled: !
|
|
429
|
+
disabled: !L.productId,
|
|
428
430
|
children: [
|
|
429
|
-
/* @__PURE__ */
|
|
431
|
+
/* @__PURE__ */ p("option", {
|
|
430
432
|
value: "",
|
|
431
433
|
children: "All modules"
|
|
432
434
|
}),
|
|
433
|
-
|
|
435
|
+
J.map((e) => /* @__PURE__ */ m("option", {
|
|
434
436
|
value: e.moduleId,
|
|
435
437
|
children: [
|
|
436
438
|
e.label,
|
|
@@ -439,58 +441,58 @@ function T() {
|
|
|
439
441
|
")"
|
|
440
442
|
]
|
|
441
443
|
}, e.moduleId)),
|
|
442
|
-
|
|
443
|
-
value:
|
|
444
|
-
children: ["Current: ",
|
|
444
|
+
he ? /* @__PURE__ */ m("option", {
|
|
445
|
+
value: L.moduleId,
|
|
446
|
+
children: ["Current: ", L.moduleId]
|
|
445
447
|
}) : null,
|
|
446
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ p("option", {
|
|
447
449
|
value: "__custom__",
|
|
448
450
|
children: "Custom module ID"
|
|
449
451
|
})
|
|
450
452
|
]
|
|
451
453
|
}),
|
|
452
|
-
|
|
454
|
+
V ? /* @__PURE__ */ p("input", {
|
|
453
455
|
id: "module-id-custom",
|
|
454
456
|
type: "text",
|
|
455
|
-
value:
|
|
456
|
-
onChange: (e) =>
|
|
457
|
-
...
|
|
457
|
+
value: L.moduleId || "",
|
|
458
|
+
onChange: (e) => R({
|
|
459
|
+
...L,
|
|
458
460
|
moduleId: e.target.value || void 0,
|
|
459
461
|
pageId: void 0
|
|
460
462
|
}),
|
|
461
463
|
className: "mt-2 w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
462
464
|
placeholder: "vibecontrols"
|
|
463
465
|
}) : null
|
|
464
|
-
] }), /* @__PURE__ */
|
|
465
|
-
/* @__PURE__ */
|
|
466
|
+
] }), /* @__PURE__ */ m("div", { children: [
|
|
467
|
+
/* @__PURE__ */ p("label", {
|
|
466
468
|
className: "block text-sm font-medium mb-2",
|
|
467
469
|
htmlFor: "page-id",
|
|
468
470
|
children: "Page ID"
|
|
469
471
|
}),
|
|
470
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ m("select", {
|
|
471
473
|
id: "page-id",
|
|
472
|
-
value:
|
|
474
|
+
value: U ? "__custom__" : L.pageId || "",
|
|
473
475
|
onChange: (e) => {
|
|
474
476
|
if (e.target.value === "__custom__") {
|
|
475
|
-
|
|
476
|
-
...
|
|
477
|
+
W(!0), R({
|
|
478
|
+
...L,
|
|
477
479
|
pageId: ""
|
|
478
480
|
});
|
|
479
481
|
return;
|
|
480
482
|
}
|
|
481
|
-
|
|
482
|
-
...
|
|
483
|
+
W(!1), R({
|
|
484
|
+
...L,
|
|
483
485
|
pageId: e.target.value || void 0
|
|
484
486
|
});
|
|
485
487
|
},
|
|
486
488
|
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
487
|
-
disabled: !
|
|
489
|
+
disabled: !L.productId,
|
|
488
490
|
children: [
|
|
489
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ p("option", {
|
|
490
492
|
value: "",
|
|
491
493
|
children: "All pages"
|
|
492
494
|
}),
|
|
493
|
-
|
|
495
|
+
X.map((e) => /* @__PURE__ */ m("option", {
|
|
494
496
|
value: e.pageId,
|
|
495
497
|
children: [
|
|
496
498
|
e.label,
|
|
@@ -499,22 +501,22 @@ function T() {
|
|
|
499
501
|
")"
|
|
500
502
|
]
|
|
501
503
|
}, e.pageId)),
|
|
502
|
-
|
|
503
|
-
value:
|
|
504
|
-
children: ["Current: ",
|
|
504
|
+
ge ? /* @__PURE__ */ m("option", {
|
|
505
|
+
value: L.pageId,
|
|
506
|
+
children: ["Current: ", L.pageId]
|
|
505
507
|
}) : null,
|
|
506
|
-
/* @__PURE__ */
|
|
508
|
+
/* @__PURE__ */ p("option", {
|
|
507
509
|
value: "__custom__",
|
|
508
510
|
children: "Custom page ID"
|
|
509
511
|
})
|
|
510
512
|
]
|
|
511
513
|
}),
|
|
512
|
-
|
|
514
|
+
U ? /* @__PURE__ */ p("input", {
|
|
513
515
|
id: "page-id-custom",
|
|
514
516
|
type: "text",
|
|
515
|
-
value:
|
|
516
|
-
onChange: (e) =>
|
|
517
|
-
...
|
|
517
|
+
value: L.pageId || "",
|
|
518
|
+
onChange: (e) => R({
|
|
519
|
+
...L,
|
|
518
520
|
pageId: e.target.value || void 0
|
|
519
521
|
}),
|
|
520
522
|
className: "mt-2 w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
@@ -522,17 +524,17 @@ function T() {
|
|
|
522
524
|
}) : null
|
|
523
525
|
] })]
|
|
524
526
|
}),
|
|
525
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ m("label", {
|
|
526
528
|
className: "flex items-center gap-3 cursor-pointer",
|
|
527
|
-
children: [/* @__PURE__ */
|
|
529
|
+
children: [/* @__PURE__ */ p("input", {
|
|
528
530
|
type: "checkbox",
|
|
529
|
-
checked:
|
|
530
|
-
onChange: (e) =>
|
|
531
|
-
...
|
|
531
|
+
checked: L.isActive ?? !0,
|
|
532
|
+
onChange: (e) => R({
|
|
533
|
+
...L,
|
|
532
534
|
isActive: e.target.checked
|
|
533
535
|
}),
|
|
534
536
|
className: "w-4 h-4 rounded"
|
|
535
|
-
}), /* @__PURE__ */
|
|
537
|
+
}), /* @__PURE__ */ p("span", {
|
|
536
538
|
className: "text-sm font-medium",
|
|
537
539
|
children: "Active"
|
|
538
540
|
})]
|
|
@@ -540,93 +542,93 @@ function T() {
|
|
|
540
542
|
]
|
|
541
543
|
})]
|
|
542
544
|
}),
|
|
543
|
-
/* @__PURE__ */
|
|
545
|
+
/* @__PURE__ */ m("div", {
|
|
544
546
|
className: "border border-border rounded-md p-4 sm:p-6 bg-card",
|
|
545
|
-
children: [/* @__PURE__ */
|
|
547
|
+
children: [/* @__PURE__ */ p("h2", {
|
|
546
548
|
className: "text-lg font-semibold mb-4",
|
|
547
|
-
children:
|
|
548
|
-
}), /* @__PURE__ */
|
|
549
|
+
children: y("tourBuilder.sectionTriggerSettings")
|
|
550
|
+
}), /* @__PURE__ */ m("div", {
|
|
549
551
|
className: "space-y-4",
|
|
550
552
|
children: [
|
|
551
|
-
/* @__PURE__ */
|
|
553
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
552
554
|
className: "block text-sm font-medium mb-2",
|
|
553
555
|
htmlFor: "trigger-type",
|
|
554
|
-
children:
|
|
555
|
-
}), /* @__PURE__ */
|
|
556
|
+
children: y("tourBuilder.labelTriggerType")
|
|
557
|
+
}), /* @__PURE__ */ m("select", {
|
|
556
558
|
id: "trigger-type",
|
|
557
|
-
value:
|
|
558
|
-
onChange: (e) =>
|
|
559
|
-
...
|
|
559
|
+
value: L.triggerType || "MANUAL",
|
|
560
|
+
onChange: (e) => R({
|
|
561
|
+
...L,
|
|
560
562
|
triggerType: e.target.value
|
|
561
563
|
}),
|
|
562
564
|
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
563
565
|
children: [
|
|
564
|
-
/* @__PURE__ */
|
|
566
|
+
/* @__PURE__ */ p("option", {
|
|
565
567
|
value: "MANUAL",
|
|
566
|
-
children:
|
|
568
|
+
children: y("tourBuilder.triggerManual")
|
|
567
569
|
}),
|
|
568
|
-
/* @__PURE__ */
|
|
570
|
+
/* @__PURE__ */ p("option", {
|
|
569
571
|
value: "AUTO_FIRST_VISIT",
|
|
570
|
-
children:
|
|
572
|
+
children: y("tourBuilder.triggerAutoFirstVisit")
|
|
571
573
|
}),
|
|
572
|
-
/* @__PURE__ */
|
|
574
|
+
/* @__PURE__ */ p("option", {
|
|
573
575
|
value: "AUTO_ALWAYS",
|
|
574
|
-
children:
|
|
576
|
+
children: y("tourBuilder.triggerAutoAlways")
|
|
575
577
|
}),
|
|
576
|
-
/* @__PURE__ */
|
|
578
|
+
/* @__PURE__ */ p("option", {
|
|
577
579
|
value: "ON_EVENT",
|
|
578
|
-
children:
|
|
580
|
+
children: y("tourBuilder.triggerOnEvent")
|
|
579
581
|
}),
|
|
580
|
-
/* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ p("option", {
|
|
581
583
|
value: "SCHEDULED",
|
|
582
|
-
children:
|
|
584
|
+
children: y("tourBuilder.triggerScheduled")
|
|
583
585
|
})
|
|
584
586
|
]
|
|
585
587
|
})] }),
|
|
586
|
-
/* @__PURE__ */
|
|
588
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
587
589
|
className: "block text-sm font-medium mb-2",
|
|
588
590
|
htmlFor: "priority",
|
|
589
|
-
children:
|
|
590
|
-
}), /* @__PURE__ */
|
|
591
|
+
children: y("tourBuilder.labelPriority")
|
|
592
|
+
}), /* @__PURE__ */ p("input", {
|
|
591
593
|
id: "priority",
|
|
592
594
|
type: "number",
|
|
593
595
|
min: "1",
|
|
594
596
|
max: "100",
|
|
595
|
-
value:
|
|
597
|
+
value: L.priority || 50,
|
|
596
598
|
onChange: (e) => {
|
|
597
599
|
let t = Number.parseInt(e.target.value, 10) || 50;
|
|
598
|
-
|
|
599
|
-
...
|
|
600
|
+
R({
|
|
601
|
+
...L,
|
|
600
602
|
priority: t
|
|
601
603
|
});
|
|
602
604
|
},
|
|
603
605
|
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground"
|
|
604
606
|
})] }),
|
|
605
|
-
/* @__PURE__ */
|
|
607
|
+
/* @__PURE__ */ m("div", {
|
|
606
608
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
607
|
-
children: [/* @__PURE__ */
|
|
609
|
+
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
608
610
|
className: "block text-sm font-medium mb-2",
|
|
609
611
|
htmlFor: "tour-start-date",
|
|
610
612
|
children: "Start Date"
|
|
611
|
-
}), /* @__PURE__ */
|
|
613
|
+
}), /* @__PURE__ */ p("input", {
|
|
612
614
|
id: "tour-start-date",
|
|
613
615
|
type: "datetime-local",
|
|
614
|
-
value: $(
|
|
615
|
-
onChange: (e) =>
|
|
616
|
-
...
|
|
616
|
+
value: $(L.startDate),
|
|
617
|
+
onChange: (e) => R({
|
|
618
|
+
...L,
|
|
617
619
|
startDate: e.target.value ? new Date(e.target.value).toISOString() : void 0
|
|
618
620
|
}),
|
|
619
621
|
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground"
|
|
620
|
-
})] }), /* @__PURE__ */
|
|
622
|
+
})] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
621
623
|
className: "block text-sm font-medium mb-2",
|
|
622
624
|
htmlFor: "tour-end-date",
|
|
623
625
|
children: "End Date"
|
|
624
|
-
}), /* @__PURE__ */
|
|
626
|
+
}), /* @__PURE__ */ p("input", {
|
|
625
627
|
id: "tour-end-date",
|
|
626
628
|
type: "datetime-local",
|
|
627
|
-
value: $(
|
|
628
|
-
onChange: (e) =>
|
|
629
|
-
...
|
|
629
|
+
value: $(L.endDate),
|
|
630
|
+
onChange: (e) => R({
|
|
631
|
+
...L,
|
|
630
632
|
endDate: e.target.value ? new Date(e.target.value).toISOString() : void 0
|
|
631
633
|
}),
|
|
632
634
|
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground"
|
|
@@ -635,94 +637,94 @@ function T() {
|
|
|
635
637
|
]
|
|
636
638
|
})]
|
|
637
639
|
}),
|
|
638
|
-
|
|
640
|
+
N && /* @__PURE__ */ m("div", {
|
|
639
641
|
className: "border border-destructive rounded-md p-4 bg-destructive/10",
|
|
640
|
-
children: [/* @__PURE__ */
|
|
642
|
+
children: [/* @__PURE__ */ p("h3", {
|
|
641
643
|
className: "font-semibold text-destructive mb-2",
|
|
642
|
-
children:
|
|
643
|
-
}), /* @__PURE__ */
|
|
644
|
+
children: y("tourBuilder.errorTitle")
|
|
645
|
+
}), /* @__PURE__ */ p("p", {
|
|
644
646
|
className: "text-sm text-destructive",
|
|
645
|
-
children:
|
|
647
|
+
children: N.message
|
|
646
648
|
})]
|
|
647
649
|
}),
|
|
648
|
-
|
|
650
|
+
M.length > 0 && /* @__PURE__ */ m("div", {
|
|
649
651
|
className: "border border-destructive rounded-md p-4 bg-destructive/10",
|
|
650
|
-
children: [/* @__PURE__ */
|
|
652
|
+
children: [/* @__PURE__ */ p("h3", {
|
|
651
653
|
className: "font-semibold text-destructive mb-2",
|
|
652
|
-
children:
|
|
653
|
-
}), /* @__PURE__ */
|
|
654
|
+
children: y("tourBuilder.validationErrorsTitle")
|
|
655
|
+
}), /* @__PURE__ */ p("ul", {
|
|
654
656
|
className: "list-disc list-inside space-y-1",
|
|
655
|
-
children:
|
|
657
|
+
children: M.map((e, t) => /* @__PURE__ */ p("li", {
|
|
656
658
|
className: "text-sm text-destructive",
|
|
657
659
|
children: e.message
|
|
658
660
|
}, t))
|
|
659
661
|
})]
|
|
660
662
|
}),
|
|
661
|
-
/* @__PURE__ */
|
|
663
|
+
/* @__PURE__ */ m("div", {
|
|
662
664
|
className: "flex flex-wrap gap-3",
|
|
663
|
-
children: [/* @__PURE__ */
|
|
664
|
-
permission:
|
|
665
|
-
children: /* @__PURE__ */
|
|
665
|
+
children: [/* @__PURE__ */ p(f, {
|
|
666
|
+
permission: E ? i.TOUR_CREATE : i.TOUR_UPDATE,
|
|
667
|
+
children: /* @__PURE__ */ m("button", {
|
|
666
668
|
type: "submit",
|
|
667
|
-
disabled:
|
|
669
|
+
disabled: j || !pe,
|
|
668
670
|
className: "flex-1 min-w-[200px] px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 disabled:opacity-50 flex items-center justify-center gap-2",
|
|
669
|
-
children: [/* @__PURE__ */
|
|
671
|
+
children: [/* @__PURE__ */ p(oe, { size: 20 }), y(j ? "tourBuilder.saving" : b && b !== "new" ? "tourBuilder.updateTour" : "tourBuilder.createAndAddSteps")]
|
|
670
672
|
})
|
|
671
|
-
}),
|
|
672
|
-
/* @__PURE__ */
|
|
673
|
+
}), b && b !== "new" && /* @__PURE__ */ m(se, { children: [
|
|
674
|
+
/* @__PURE__ */ m("button", {
|
|
673
675
|
type: "button",
|
|
674
|
-
onClick: () =>
|
|
676
|
+
onClick: () => x(`${C}/${b}/steps`),
|
|
675
677
|
className: "px-4 py-2 bg-secondary text-secondary-foreground rounded-md hover:bg-secondary/80 flex items-center gap-2",
|
|
676
678
|
children: [
|
|
677
|
-
/* @__PURE__ */
|
|
678
|
-
|
|
679
|
-
|
|
679
|
+
/* @__PURE__ */ p(ae, { size: 20 }),
|
|
680
|
+
y("tourBuilder.editSteps"),
|
|
681
|
+
D?.steps && D.steps.length > 0 && /* @__PURE__ */ p("span", {
|
|
680
682
|
className: "ml-1 px-2 py-0.5 text-xs bg-primary/20 rounded-full",
|
|
681
|
-
children:
|
|
683
|
+
children: D.steps.length
|
|
682
684
|
})
|
|
683
685
|
]
|
|
684
686
|
}),
|
|
685
|
-
/* @__PURE__ */
|
|
687
|
+
/* @__PURE__ */ m("button", {
|
|
686
688
|
type: "button",
|
|
687
|
-
onClick: () =>
|
|
689
|
+
onClick: () => x(`${C}/${b}/preview`),
|
|
688
690
|
className: "px-4 py-2 border border-border rounded-md hover:bg-accent flex items-center gap-2",
|
|
689
|
-
children: [/* @__PURE__ */
|
|
691
|
+
children: [/* @__PURE__ */ p(re, { size: 20 }), y("tourBuilder.preview")]
|
|
690
692
|
}),
|
|
691
|
-
/* @__PURE__ */
|
|
693
|
+
/* @__PURE__ */ m("button", {
|
|
692
694
|
type: "button",
|
|
693
|
-
onClick: () =>
|
|
695
|
+
onClick: () => x(`${C}/${b}/analytics`),
|
|
694
696
|
className: "px-4 py-2 border border-border rounded-md hover:bg-accent flex items-center gap-2",
|
|
695
|
-
children: [/* @__PURE__ */
|
|
697
|
+
children: [/* @__PURE__ */ p(te, { size: 20 }), y("tourBuilder.analytics")]
|
|
696
698
|
}),
|
|
697
|
-
/* @__PURE__ */
|
|
699
|
+
/* @__PURE__ */ m("button", {
|
|
698
700
|
type: "button",
|
|
699
|
-
onClick: () =>
|
|
701
|
+
onClick: () => x(`${C}/${b}/schedule`),
|
|
700
702
|
className: "px-4 py-2 border border-border rounded-md hover:bg-accent flex items-center gap-2",
|
|
701
|
-
children: [/* @__PURE__ */
|
|
703
|
+
children: [/* @__PURE__ */ p(ne, { size: 20 }), "Schedule"]
|
|
702
704
|
}),
|
|
703
|
-
/* @__PURE__ */
|
|
705
|
+
/* @__PURE__ */ p(f, {
|
|
704
706
|
permission: i.TOUR_TEMPLATE_CREATE,
|
|
705
|
-
children: /* @__PURE__ */
|
|
707
|
+
children: /* @__PURE__ */ m("button", {
|
|
706
708
|
type: "button",
|
|
707
709
|
onClick: async () => {
|
|
708
|
-
if (!
|
|
709
|
-
let e = `${
|
|
710
|
+
if (!b || b === "new") return;
|
|
711
|
+
let e = `${L.name || D?.name || "Tour"} Template`, t = window.prompt("Template name", e);
|
|
710
712
|
if (!t) return;
|
|
711
713
|
let n = window.prompt("Template category (ONBOARDING, FEATURE_ANNOUNCEMENT, HELP, CUSTOM)", "ONBOARDING") || "ONBOARDING";
|
|
712
714
|
try {
|
|
713
|
-
await
|
|
715
|
+
await P(b, {
|
|
714
716
|
name: t,
|
|
715
|
-
description:
|
|
717
|
+
description: L.description,
|
|
716
718
|
category: n,
|
|
717
719
|
isPublic: !1
|
|
718
|
-
}),
|
|
719
|
-
} catch
|
|
720
|
-
|
|
720
|
+
}), x(`${C}/templates`);
|
|
721
|
+
} catch {
|
|
722
|
+
o(w, "template.save", S);
|
|
721
723
|
}
|
|
722
724
|
},
|
|
723
|
-
disabled: !
|
|
725
|
+
disabled: !fe,
|
|
724
726
|
className: "px-4 py-2 border border-border rounded-md hover:bg-accent flex items-center gap-2 disabled:opacity-50",
|
|
725
|
-
children: [/* @__PURE__ */
|
|
727
|
+
children: [/* @__PURE__ */ p(ie, { size: 20 }), "Save as Template"]
|
|
726
728
|
})
|
|
727
729
|
})
|
|
728
730
|
] })]
|
|
@@ -732,6 +734,6 @@ function T() {
|
|
|
732
734
|
});
|
|
733
735
|
}
|
|
734
736
|
//#endregion
|
|
735
|
-
export {
|
|
737
|
+
export { S as TourBuilderPage };
|
|
736
738
|
|
|
737
739
|
//# sourceMappingURL=TourBuilderPage.js.map
|