@burdenoff/microfe-tours 2026.510.112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +342 -0
- package/dist/__tests__/setup.d.ts +2 -0
- package/dist/__tests__/setup.d.ts.map +1 -0
- package/dist/constants/featureFlags.d.ts +25 -0
- package/dist/constants/featureFlags.d.ts.map +1 -0
- package/dist/constants/featureFlags.js +9 -0
- package/dist/constants/featureFlags.js.map +1 -0
- package/dist/constants/permissions.d.ts +49 -0
- package/dist/constants/permissions.d.ts.map +1 -0
- package/dist/constants/permissions.js +38 -0
- package/dist/constants/permissions.js.map +1 -0
- package/dist/dev/main.d.ts +2 -0
- package/dist/dev/main.d.ts.map +1 -0
- package/dist/generated/global-operations.d.ts +1270 -0
- package/dist/generated/global-operations.d.ts.map +1 -0
- package/dist/generated/global-operations.js +650 -0
- package/dist/generated/global-operations.js.map +1 -0
- package/dist/generated/global-types.d.ts +20448 -0
- package/dist/generated/global-types.d.ts.map +1 -0
- package/dist/generated/wspace-operations.d.ts +2 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -0
- package/dist/generated/wspace-types.d.ts +53398 -0
- package/dist/generated/wspace-types.d.ts.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/tours/ToursAdminRoot.d.ts +16 -0
- package/dist/tours/ToursAdminRoot.d.ts.map +1 -0
- package/dist/tours/ToursAdminRoot.js +42 -0
- package/dist/tours/ToursAdminRoot.js.map +1 -0
- package/dist/tours/ToursAdminRoutes.d.ts +12 -0
- package/dist/tours/ToursAdminRoutes.d.ts.map +1 -0
- package/dist/tours/ToursAdminRoutes.js +109 -0
- package/dist/tours/ToursAdminRoutes.js.map +1 -0
- package/dist/tours/ToursRoot.d.ts +10 -0
- package/dist/tours/ToursRoot.d.ts.map +1 -0
- package/dist/tours/ToursRoot.js +1 -0
- package/dist/tours/ToursRoutes.d.ts +8 -0
- package/dist/tours/ToursRoutes.d.ts.map +1 -0
- package/dist/tours/ToursUserRoot.d.ts +15 -0
- package/dist/tours/ToursUserRoot.d.ts.map +1 -0
- package/dist/tours/ToursUserRoot.js +48 -0
- package/dist/tours/ToursUserRoot.js.map +1 -0
- package/dist/tours/ToursUserRoutes.d.ts +15 -0
- package/dist/tours/ToursUserRoutes.d.ts.map +1 -0
- package/dist/tours/ToursUserRoutes.js +66 -0
- package/dist/tours/ToursUserRoutes.js.map +1 -0
- package/dist/tours/components/RouteHelpers.d.ts +33 -0
- package/dist/tours/components/RouteHelpers.d.ts.map +1 -0
- package/dist/tours/components/RouteHelpers.js +75 -0
- package/dist/tours/components/RouteHelpers.js.map +1 -0
- package/dist/tours/components/ToursAdminNavRegistrar.d.ts +25 -0
- package/dist/tours/components/ToursAdminNavRegistrar.d.ts.map +1 -0
- package/dist/tours/components/ToursAdminNavRegistrar.js +60 -0
- package/dist/tours/components/ToursAdminNavRegistrar.js.map +1 -0
- package/dist/tours/components/ui.d.ts +2 -0
- package/dist/tours/components/ui.d.ts.map +1 -0
- package/dist/tours/hooks/useMediaLibrary.d.ts +22 -0
- package/dist/tours/hooks/useMediaLibrary.d.ts.map +1 -0
- package/dist/tours/hooks/useMediaLibrary.js +82 -0
- package/dist/tours/hooks/useMediaLibrary.js.map +1 -0
- package/dist/tours/hooks/useStepSequencer.d.ts +20 -0
- package/dist/tours/hooks/useStepSequencer.d.ts.map +1 -0
- package/dist/tours/hooks/useStepSequencer.js +53 -0
- package/dist/tours/hooks/useStepSequencer.js.map +1 -0
- package/dist/tours/hooks/useTourAnalytics.d.ts +32 -0
- package/dist/tours/hooks/useTourAnalytics.d.ts.map +1 -0
- package/dist/tours/hooks/useTourAnalytics.js +70 -0
- package/dist/tours/hooks/useTourAnalytics.js.map +1 -0
- package/dist/tours/hooks/useTourBuilder.d.ts +61 -0
- package/dist/tours/hooks/useTourBuilder.d.ts.map +1 -0
- package/dist/tours/hooks/useTourBuilder.js +192 -0
- package/dist/tours/hooks/useTourBuilder.js.map +1 -0
- package/dist/tours/hooks/useTourLifecycle.d.ts +22 -0
- package/dist/tours/hooks/useTourLifecycle.d.ts.map +1 -0
- package/dist/tours/hooks/useTourLifecycle.js +28 -0
- package/dist/tours/hooks/useTourLifecycle.js.map +1 -0
- package/dist/tours/hooks/useTourPreview.d.ts +33 -0
- package/dist/tours/hooks/useTourPreview.d.ts.map +1 -0
- package/dist/tours/hooks/useTourPreview.js +70 -0
- package/dist/tours/hooks/useTourPreview.js.map +1 -0
- package/dist/tours/hooks/useToursList.d.ts +30 -0
- package/dist/tours/hooks/useToursList.d.ts.map +1 -0
- package/dist/tours/hooks/useToursList.js +49 -0
- package/dist/tours/hooks/useToursList.js.map +1 -0
- package/dist/tours/hooks/useToursPermissionAccess.d.ts +16 -0
- package/dist/tours/hooks/useToursPermissionAccess.d.ts.map +1 -0
- package/dist/tours/hooks/useToursPermissionAccess.js +9 -0
- package/dist/tours/hooks/useToursPermissionAccess.js.map +1 -0
- package/dist/tours/i18n.d.ts +172 -0
- package/dist/tours/i18n.d.ts.map +1 -0
- package/dist/tours/i18n.js +175 -0
- package/dist/tours/i18n.js.map +1 -0
- package/dist/tours/index.d.ts +21 -0
- package/dist/tours/index.d.ts.map +1 -0
- package/dist/tours/index.js +5 -0
- package/dist/tours/pages/AnalyticsDashboardPage.d.ts +6 -0
- package/dist/tours/pages/AnalyticsDashboardPage.d.ts.map +1 -0
- package/dist/tours/pages/AnalyticsDashboardPage.js +230 -0
- package/dist/tours/pages/AnalyticsDashboardPage.js.map +1 -0
- package/dist/tours/pages/MediaLibraryPage.d.ts +6 -0
- package/dist/tours/pages/MediaLibraryPage.d.ts.map +1 -0
- package/dist/tours/pages/MediaLibraryPage.js +195 -0
- package/dist/tours/pages/MediaLibraryPage.js.map +1 -0
- package/dist/tours/pages/MyToursPage.d.ts +11 -0
- package/dist/tours/pages/MyToursPage.d.ts.map +1 -0
- package/dist/tours/pages/MyToursPage.js +103 -0
- package/dist/tours/pages/MyToursPage.js.map +1 -0
- package/dist/tours/pages/MyToursProgressPage.d.ts +6 -0
- package/dist/tours/pages/MyToursProgressPage.d.ts.map +1 -0
- package/dist/tours/pages/MyToursProgressPage.js +142 -0
- package/dist/tours/pages/MyToursProgressPage.js.map +1 -0
- package/dist/tours/pages/SchedulerPage.d.ts +6 -0
- package/dist/tours/pages/SchedulerPage.d.ts.map +1 -0
- package/dist/tours/pages/SchedulerPage.js +231 -0
- package/dist/tours/pages/SchedulerPage.js.map +1 -0
- package/dist/tours/pages/StepEditorPage.d.ts +7 -0
- package/dist/tours/pages/StepEditorPage.d.ts.map +1 -0
- package/dist/tours/pages/StepEditorPage.js +586 -0
- package/dist/tours/pages/StepEditorPage.js.map +1 -0
- package/dist/tours/pages/SystemAnalyticsPage.d.ts +6 -0
- package/dist/tours/pages/SystemAnalyticsPage.d.ts.map +1 -0
- package/dist/tours/pages/SystemAnalyticsPage.js +155 -0
- package/dist/tours/pages/SystemAnalyticsPage.js.map +1 -0
- package/dist/tours/pages/TemplateLibraryPage.d.ts +6 -0
- package/dist/tours/pages/TemplateLibraryPage.d.ts.map +1 -0
- package/dist/tours/pages/TemplateLibraryPage.js +207 -0
- package/dist/tours/pages/TemplateLibraryPage.js.map +1 -0
- package/dist/tours/pages/TourBuilderPage.d.ts +6 -0
- package/dist/tours/pages/TourBuilderPage.d.ts.map +1 -0
- package/dist/tours/pages/TourBuilderPage.js +363 -0
- package/dist/tours/pages/TourBuilderPage.js.map +1 -0
- package/dist/tours/pages/TourPreviewPage.d.ts +6 -0
- package/dist/tours/pages/TourPreviewPage.d.ts.map +1 -0
- package/dist/tours/pages/TourPreviewPage.js +239 -0
- package/dist/tours/pages/TourPreviewPage.js.map +1 -0
- package/dist/tours/pages/ToursListPage.d.ts +6 -0
- package/dist/tours/pages/ToursListPage.d.ts.map +1 -0
- package/dist/tours/pages/ToursListPage.js +310 -0
- package/dist/tours/pages/ToursListPage.js.map +1 -0
- package/dist/tours/providers/ToursProvider.d.ts +27 -0
- package/dist/tours/providers/ToursProvider.d.ts.map +1 -0
- package/dist/tours/providers/ToursProvider.js +28 -0
- package/dist/tours/providers/ToursProvider.js.map +1 -0
- package/dist/tours/store/toursStore.d.ts +39 -0
- package/dist/tours/store/toursStore.d.ts.map +1 -0
- package/dist/tours/store/toursStore.js +143 -0
- package/dist/tours/store/toursStore.js.map +1 -0
- package/dist/tours/types/index.d.ts +350 -0
- package/dist/tours/types/index.d.ts.map +1 -0
- package/dist/tours/utils/cn.d.ts +8 -0
- package/dist/tours/utils/cn.d.ts.map +1 -0
- package/dist/tours/utils/index.d.ts +102 -0
- package/dist/tours/utils/index.d.ts.map +1 -0
- package/dist/tours/utils/index.js +28 -0
- package/dist/tours/utils/index.js.map +1 -0
- package/dist/tours/utils/joinPath.d.ts +9 -0
- package/dist/tours/utils/joinPath.d.ts.map +1 -0
- package/dist/tours/utils/joinPath.js +8 -0
- package/dist/tours/utils/joinPath.js.map +1 -0
- package/dist/utils/nativeBridge.d.ts +3 -0
- package/dist/utils/nativeBridge.d.ts.map +1 -0
- package/dist/utils/nativeBridge.js +2 -0
- package/package.json +114 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { create as e } from "zustand";
|
|
2
|
+
//#region src/tours/store/toursStore.ts
|
|
3
|
+
var t = {
|
|
4
|
+
search: "",
|
|
5
|
+
status: "all",
|
|
6
|
+
productId: void 0,
|
|
7
|
+
moduleId: void 0,
|
|
8
|
+
pageId: void 0,
|
|
9
|
+
dateRange: {
|
|
10
|
+
start: null,
|
|
11
|
+
end: null
|
|
12
|
+
},
|
|
13
|
+
createdBy: void 0
|
|
14
|
+
}, n = e((e, n) => ({
|
|
15
|
+
selectedTour: null,
|
|
16
|
+
selectedStep: null,
|
|
17
|
+
viewMode: "grid",
|
|
18
|
+
devicePreview: "desktop",
|
|
19
|
+
tourFilter: t,
|
|
20
|
+
stepSequence: [],
|
|
21
|
+
isDirty: !1,
|
|
22
|
+
validationErrors: [],
|
|
23
|
+
selectedMedia: [],
|
|
24
|
+
uploadProgress: {},
|
|
25
|
+
sidebarOpen: !0,
|
|
26
|
+
setSelectedTour: (t) => e({
|
|
27
|
+
selectedTour: t,
|
|
28
|
+
stepSequence: t?.steps || [],
|
|
29
|
+
isDirty: !1,
|
|
30
|
+
validationErrors: []
|
|
31
|
+
}),
|
|
32
|
+
setSelectedStep: (t) => e({ selectedStep: t }),
|
|
33
|
+
setViewMode: (t) => e({ viewMode: t }),
|
|
34
|
+
setDevicePreview: (t) => e({ devicePreview: t }),
|
|
35
|
+
toggleSidebar: () => e((e) => ({ sidebarOpen: !e.sidebarOpen })),
|
|
36
|
+
setSidebarOpen: (t) => e({ sidebarOpen: t }),
|
|
37
|
+
updateTourFilter: (t) => e((e) => ({ tourFilter: {
|
|
38
|
+
...e.tourFilter,
|
|
39
|
+
...t
|
|
40
|
+
} })),
|
|
41
|
+
resetTourFilter: () => e({ tourFilter: t }),
|
|
42
|
+
updateStepSequence: (t) => e({
|
|
43
|
+
stepSequence: t,
|
|
44
|
+
isDirty: !0
|
|
45
|
+
}),
|
|
46
|
+
reorderSteps: (t, r) => {
|
|
47
|
+
let i = [...n().stepSequence], [a] = i.splice(t, 1);
|
|
48
|
+
i.splice(r, 0, a), e({
|
|
49
|
+
stepSequence: i.map((e, t) => ({
|
|
50
|
+
...e,
|
|
51
|
+
stepOrder: t + 1
|
|
52
|
+
})),
|
|
53
|
+
isDirty: !0
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
addStep: (t) => {
|
|
57
|
+
let r = [...n().stepSequence], i = {
|
|
58
|
+
id: `temp_${Date.now()}`,
|
|
59
|
+
tourId: n().selectedTour?.id || "",
|
|
60
|
+
title: t.title || "New Step",
|
|
61
|
+
content: t.content || "",
|
|
62
|
+
stepOrder: r.length + 1,
|
|
63
|
+
targetSelector: t.targetSelector || "",
|
|
64
|
+
placement: t.placement || "AUTO",
|
|
65
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
66
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
67
|
+
...t
|
|
68
|
+
};
|
|
69
|
+
r.push(i), e({
|
|
70
|
+
stepSequence: r,
|
|
71
|
+
isDirty: !0
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
removeStep: (t) => {
|
|
75
|
+
e({
|
|
76
|
+
stepSequence: n().stepSequence.filter((e) => e.id !== t).map((e, t) => ({
|
|
77
|
+
...e,
|
|
78
|
+
stepOrder: t + 1
|
|
79
|
+
})),
|
|
80
|
+
isDirty: !0
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
updateStep: (t, r) => {
|
|
84
|
+
e({
|
|
85
|
+
stepSequence: n().stepSequence.map((e) => e.id === t ? {
|
|
86
|
+
...e,
|
|
87
|
+
...r
|
|
88
|
+
} : e),
|
|
89
|
+
isDirty: !0
|
|
90
|
+
});
|
|
91
|
+
},
|
|
92
|
+
setDirty: (t) => e({ isDirty: t }),
|
|
93
|
+
validateTour: () => {
|
|
94
|
+
let t = [], { selectedTour: r, stepSequence: i } = n();
|
|
95
|
+
return r ? ((!r.name || r.name.trim() === "") && t.push({
|
|
96
|
+
field: "name",
|
|
97
|
+
message: "Tour name is required"
|
|
98
|
+
}), r.productId || t.push({
|
|
99
|
+
field: "productId",
|
|
100
|
+
message: "Product ID is required"
|
|
101
|
+
}), i.length === 0 && t.push({
|
|
102
|
+
field: "steps",
|
|
103
|
+
message: "At least one step is required"
|
|
104
|
+
}), i.forEach((e, n) => {
|
|
105
|
+
(!e.title || e.title.trim() === "") && t.push({
|
|
106
|
+
field: `step[${n}].title`,
|
|
107
|
+
message: `Step ${n + 1} title is required`
|
|
108
|
+
}), (!e.content || e.content.trim() === "") && t.push({
|
|
109
|
+
field: `step[${n}].content`,
|
|
110
|
+
message: `Step ${n + 1} content is required`
|
|
111
|
+
}), e.placement !== "CENTER" && (!e.targetSelector || e.targetSelector.trim() === "") && t.push({
|
|
112
|
+
field: `step[${n}].targetSelector`,
|
|
113
|
+
message: `Step ${n + 1} selector is required`
|
|
114
|
+
});
|
|
115
|
+
}), e({ validationErrors: t }), t) : (t.push({
|
|
116
|
+
field: "tour",
|
|
117
|
+
message: "No tour selected"
|
|
118
|
+
}), e({ validationErrors: t }), t);
|
|
119
|
+
},
|
|
120
|
+
clearValidationErrors: () => e({ validationErrors: [] }),
|
|
121
|
+
selectMedia: (t) => {
|
|
122
|
+
let r = [...n().selectedMedia];
|
|
123
|
+
r.find((e) => e.id === t.id) || (r.push(t), e({ selectedMedia: r }));
|
|
124
|
+
},
|
|
125
|
+
unselectMedia: (t) => {
|
|
126
|
+
e({ selectedMedia: n().selectedMedia.filter((e) => e.id !== t) });
|
|
127
|
+
},
|
|
128
|
+
clearSelectedMedia: () => e({ selectedMedia: [] }),
|
|
129
|
+
updateUploadProgress: (t, r) => {
|
|
130
|
+
e({ uploadProgress: {
|
|
131
|
+
...n().uploadProgress,
|
|
132
|
+
[t]: r
|
|
133
|
+
} });
|
|
134
|
+
},
|
|
135
|
+
removeUploadProgress: (t) => {
|
|
136
|
+
let r = { ...n().uploadProgress };
|
|
137
|
+
delete r[t], e({ uploadProgress: r });
|
|
138
|
+
}
|
|
139
|
+
}));
|
|
140
|
+
//#endregion
|
|
141
|
+
export { n as useToursStore };
|
|
142
|
+
|
|
143
|
+
//# sourceMappingURL=toursStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toursStore.js","names":[],"sources":["../../../src/tours/store/toursStore.ts"],"sourcesContent":["import { create } from 'zustand';\nimport type {\n Tour,\n TourStep,\n TourMedia,\n TourFilters,\n ValidationError,\n ToursViewMode,\n DeviceType,\n} from '../types';\n\ninterface ToursState {\n // View state\n selectedTour: Tour | null;\n selectedStep: TourStep | null;\n viewMode: ToursViewMode;\n devicePreview: DeviceType;\n\n // Filters\n tourFilter: TourFilters;\n\n // Builder state\n stepSequence: TourStep[];\n isDirty: boolean;\n validationErrors: ValidationError[];\n\n // Media state\n selectedMedia: TourMedia[];\n uploadProgress: Record<string, number>;\n\n // UI state\n sidebarOpen: boolean;\n\n // Actions - View\n setSelectedTour: (tour: Tour | null) => void;\n setSelectedStep: (step: TourStep | null) => void;\n setViewMode: (mode: ToursViewMode) => void;\n setDevicePreview: (device: DeviceType) => void;\n toggleSidebar: () => void;\n setSidebarOpen: (open: boolean) => void;\n\n // Actions - Filters\n updateTourFilter: (filter: Partial<TourFilters>) => void;\n resetTourFilter: () => void;\n\n // Actions - Steps\n updateStepSequence: (steps: TourStep[]) => void;\n reorderSteps: (startIndex: number, endIndex: number) => void;\n addStep: (step: Partial<TourStep>) => void;\n removeStep: (stepId: string) => void;\n updateStep: (stepId: string, updates: Partial<TourStep>) => void;\n\n // Actions - Validation\n setDirty: (dirty: boolean) => void;\n validateTour: () => ValidationError[];\n clearValidationErrors: () => void;\n\n // Actions - Media\n selectMedia: (media: TourMedia) => void;\n unselectMedia: (mediaId: string) => void;\n clearSelectedMedia: () => void;\n updateUploadProgress: (fileId: string, progress: number) => void;\n removeUploadProgress: (fileId: string) => void;\n}\n\nconst defaultFilter: TourFilters = {\n search: '',\n status: 'all',\n productId: undefined,\n moduleId: undefined,\n pageId: undefined,\n dateRange: { start: null, end: null },\n createdBy: undefined,\n};\n\nexport const useToursStore = create<ToursState>((set, get) => ({\n // Initial state\n selectedTour: null,\n selectedStep: null,\n viewMode: 'grid',\n devicePreview: 'desktop',\n tourFilter: defaultFilter,\n stepSequence: [],\n isDirty: false,\n validationErrors: [],\n selectedMedia: [],\n uploadProgress: {},\n sidebarOpen: true,\n\n // View actions\n setSelectedTour: (tour) =>\n set({\n selectedTour: tour,\n stepSequence: tour?.steps || [],\n isDirty: false,\n validationErrors: [],\n }),\n\n setSelectedStep: (step) => set({ selectedStep: step }),\n\n setViewMode: (mode) => set({ viewMode: mode }),\n\n setDevicePreview: (device) => set({ devicePreview: device }),\n\n toggleSidebar: () => set((state) => ({ sidebarOpen: !state.sidebarOpen })),\n\n setSidebarOpen: (open) => set({ sidebarOpen: open }),\n\n // Filter actions\n updateTourFilter: (filter) =>\n set((state) => ({\n tourFilter: { ...state.tourFilter, ...filter },\n })),\n\n resetTourFilter: () => set({ tourFilter: defaultFilter }),\n\n // Step actions\n updateStepSequence: (steps) => set({ stepSequence: steps, isDirty: true }),\n\n reorderSteps: (startIndex, endIndex) => {\n const steps = [...get().stepSequence];\n const [removed] = steps.splice(startIndex, 1);\n steps.splice(endIndex, 0, removed);\n const reorderedSteps = steps.map((step, index) => ({\n ...step,\n stepOrder: index + 1,\n }));\n set({ stepSequence: reorderedSteps, isDirty: true });\n },\n\n addStep: (step) => {\n const steps = [...get().stepSequence];\n const newStep: TourStep = {\n id: `temp_${Date.now()}`,\n tourId: get().selectedTour?.id || '',\n title: step.title || 'New Step',\n content: step.content || '',\n stepOrder: steps.length + 1,\n targetSelector: step.targetSelector || '',\n placement: step.placement || 'AUTO',\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n ...step,\n } as TourStep;\n steps.push(newStep);\n set({ stepSequence: steps, isDirty: true });\n },\n\n removeStep: (stepId) => {\n const steps = get().stepSequence.filter((s) => s.id !== stepId);\n const reorderedSteps = steps.map((step, index) => ({\n ...step,\n stepOrder: index + 1,\n }));\n set({ stepSequence: reorderedSteps, isDirty: true });\n },\n\n updateStep: (stepId, updates) => {\n const steps = get().stepSequence.map((step) =>\n step.id === stepId ? { ...step, ...updates } : step\n );\n set({ stepSequence: steps, isDirty: true });\n },\n\n // Validation actions\n setDirty: (dirty) => set({ isDirty: dirty }),\n\n validateTour: () => {\n const errors: ValidationError[] = [];\n const { selectedTour, stepSequence } = get();\n\n if (!selectedTour) {\n errors.push({ field: 'tour', message: 'No tour selected' });\n set({ validationErrors: errors });\n return errors;\n }\n\n if (!selectedTour.name || selectedTour.name.trim() === '') {\n errors.push({ field: 'name', message: 'Tour name is required' });\n }\n\n if (!selectedTour.productId) {\n errors.push({ field: 'productId', message: 'Product ID is required' });\n }\n\n if (stepSequence.length === 0) {\n errors.push({ field: 'steps', message: 'At least one step is required' });\n }\n\n stepSequence.forEach((step, index) => {\n if (!step.title || step.title.trim() === '') {\n errors.push({\n field: `step[${index}].title`,\n message: `Step ${index + 1} title is required`,\n });\n }\n if (!step.content || step.content.trim() === '') {\n errors.push({\n field: `step[${index}].content`,\n message: `Step ${index + 1} content is required`,\n });\n }\n if (\n step.placement !== 'CENTER' &&\n (!step.targetSelector || step.targetSelector.trim() === '')\n ) {\n errors.push({\n field: `step[${index}].targetSelector`,\n message: `Step ${index + 1} selector is required`,\n });\n }\n });\n\n set({ validationErrors: errors });\n return errors;\n },\n\n clearValidationErrors: () => set({ validationErrors: [] }),\n\n // Media actions\n selectMedia: (media) => {\n const selected = [...get().selectedMedia];\n if (!selected.find((m) => m.id === media.id)) {\n selected.push(media);\n set({ selectedMedia: selected });\n }\n },\n\n unselectMedia: (mediaId) => {\n set({\n selectedMedia: get().selectedMedia.filter((m) => m.id !== mediaId),\n });\n },\n\n clearSelectedMedia: () => set({ selectedMedia: [] }),\n\n updateUploadProgress: (fileId, progress) => {\n set({\n uploadProgress: { ...get().uploadProgress, [fileId]: progress },\n });\n },\n\n removeUploadProgress: (fileId) => {\n const progress = { ...get().uploadProgress };\n delete progress[fileId];\n set({ uploadProgress: progress });\n },\n}));\n"],"mappings":";;AAiEA,IAAM,IAA6B;CACjC,QAAQ;CACR,QAAQ;CACR,WAAW,KAAA;CACX,UAAU,KAAA;CACV,QAAQ,KAAA;CACR,WAAW;EAAE,OAAO;EAAM,KAAK;EAAM;CACrC,WAAW,KAAA;CACZ,EAEY,IAAgB,GAAoB,GAAK,OAAS;CAE7D,cAAc;CACd,cAAc;CACd,UAAU;CACV,eAAe;CACf,YAAY;CACZ,cAAc,EAAE;CAChB,SAAS;CACT,kBAAkB,EAAE;CACpB,eAAe,EAAE;CACjB,gBAAgB,EAAE;CAClB,aAAa;CAGb,kBAAkB,MAChB,EAAI;EACF,cAAc;EACd,cAAc,GAAM,SAAS,EAAE;EAC/B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EF,EAAI,EAAE,kBAAkB,GAAQ,CAAC,EAC1B,MA1CL,EAAO,KAAK;GAAE,OAAO;GAAQ,SAAS;GAAoB,CAAC,EAC3D,EAAI,EAAE,kBAAkB,GAAQ,CAAC,EAC1B;;CA2CX,6BAA6B,EAAI,EAAE,kBAAkB,EAAE,EAAE,CAAC;CAG1D,cAAc,MAAU;EACtB,IAAM,IAAW,CAAC,GAAG,GAAK,CAAC,cAAc;AACzC,EAAK,EAAS,MAAM,MAAM,EAAE,OAAO,EAAM,GAAG,KAC1C,EAAS,KAAK,EAAM,EACpB,EAAI,EAAE,eAAe,GAAU,CAAC;;CAIpC,gBAAgB,MAAY;AAC1B,IAAI,EACF,eAAe,GAAK,CAAC,cAAc,QAAQ,MAAM,EAAE,OAAO,EAAQ,EACnE,CAAC;;CAGJ,0BAA0B,EAAI,EAAE,eAAe,EAAE,EAAE,CAAC;CAEpD,uBAAuB,GAAQ,MAAa;AAC1C,IAAI,EACF,gBAAgB;GAAE,GAAG,GAAK,CAAC;IAAiB,IAAS;GAAU,EAChE,CAAC;;CAGJ,uBAAuB,MAAW;EAChC,IAAM,IAAW,EAAE,GAAG,GAAK,CAAC,gBAAgB;AAE5C,EADA,OAAO,EAAS,IAChB,EAAI,EAAE,gBAAgB,GAAU,CAAC;;CAEpC,EAAE"}
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navigation item for shell integration
|
|
3
|
+
*/
|
|
4
|
+
export interface NavItem {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
path: string;
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
order?: number;
|
|
10
|
+
group?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Footer item for shell integration
|
|
14
|
+
*/
|
|
15
|
+
export interface FooterItem {
|
|
16
|
+
id: string;
|
|
17
|
+
label: string;
|
|
18
|
+
type: 'status' | 'action';
|
|
19
|
+
order?: number;
|
|
20
|
+
section: 'left' | 'center' | 'right';
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Base microfrontend root props
|
|
24
|
+
*/
|
|
25
|
+
export interface MicrofrontendRootProps {
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Tours UI variant — selects which surface area is rendered.
|
|
29
|
+
*
|
|
30
|
+
* - "admin" — full authoring suite (CRUD, media library, scheduler, analytics).
|
|
31
|
+
* Consumed by `ToursAdminRoot` from `admin-app`.
|
|
32
|
+
* - "user" — read-only "My Tours" + "My Progress" surface. Consumed by
|
|
33
|
+
* `ToursUserRoot` from product user shells (e.g., vibecontrols-app).
|
|
34
|
+
*
|
|
35
|
+
* Defaults to "admin" for back-compatibility with the original `ToursRoot`.
|
|
36
|
+
*/
|
|
37
|
+
export type ToursVariant = 'admin' | 'user';
|
|
38
|
+
/**
|
|
39
|
+
* Props for the ToursRoot component
|
|
40
|
+
*/
|
|
41
|
+
export interface ToursRootProps extends MicrofrontendRootProps {
|
|
42
|
+
/**
|
|
43
|
+
* Base path for the tours microfrontend
|
|
44
|
+
*/
|
|
45
|
+
basePath?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Which Tours surface to render. Defaults to "admin".
|
|
48
|
+
* @see ToursVariant
|
|
49
|
+
*/
|
|
50
|
+
variant?: ToursVariant;
|
|
51
|
+
/**
|
|
52
|
+
* Product identifier the shell is mounting this MFE under (e.g., "workspaces",
|
|
53
|
+
* "vibecontrols", "bigconsole"). Used by `MyToursPage.toursForContext` to
|
|
54
|
+
* scope the listed tours to the right product — NOT a user-controlled query
|
|
55
|
+
* param. Shells should pass the product slug they are themselves known as.
|
|
56
|
+
*/
|
|
57
|
+
productId?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Optional module identifier within the product (e.g., "calendar"). Narrows
|
|
60
|
+
* the tour list further when the shell can supply it.
|
|
61
|
+
*/
|
|
62
|
+
moduleId?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Optional page identifier within the module (e.g., "settings/team"). Narrows
|
|
65
|
+
* the tour list to tours scoped at the current page.
|
|
66
|
+
*/
|
|
67
|
+
pageId?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Current workspace ID (fallback scope for embedded contexts)
|
|
70
|
+
*/
|
|
71
|
+
workspaceId?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Current tenant ID (preferred scope for global permission checks)
|
|
74
|
+
*/
|
|
75
|
+
tenantId?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Current organization ID (fallback scope for global permission checks)
|
|
78
|
+
*/
|
|
79
|
+
organizationId?: string;
|
|
80
|
+
/**
|
|
81
|
+
* API Gateway URL for GraphQL requests
|
|
82
|
+
*/
|
|
83
|
+
apiGatewayUrl?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Authentication token for API requests
|
|
86
|
+
*/
|
|
87
|
+
authToken?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Navigation function provided by the shell
|
|
90
|
+
*/
|
|
91
|
+
navigate?: (path: string) => void;
|
|
92
|
+
/**
|
|
93
|
+
* Current user information
|
|
94
|
+
*/
|
|
95
|
+
currentUser?: {
|
|
96
|
+
id: string;
|
|
97
|
+
email: string;
|
|
98
|
+
firstName?: string;
|
|
99
|
+
lastName?: string;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Optional function to register navigation items with the shell
|
|
103
|
+
* Injected by the shell app
|
|
104
|
+
*/
|
|
105
|
+
registerNavItems?: (items: NavItem | NavItem[]) => () => void;
|
|
106
|
+
/**
|
|
107
|
+
* Optional function to register footer items with the shell
|
|
108
|
+
* Injected by the shell app
|
|
109
|
+
*/
|
|
110
|
+
registerFooterItems?: (items: FooterItem | FooterItem[]) => () => void;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Tour status enumeration
|
|
114
|
+
*/
|
|
115
|
+
export type TourStatus = 'DRAFT' | 'PUBLISHED' | 'ARCHIVED' | 'SCHEDULED';
|
|
116
|
+
/**
|
|
117
|
+
* Tour trigger type enumeration
|
|
118
|
+
*/
|
|
119
|
+
export type TourTriggerType = 'MANUAL' | 'AUTO_FIRST_VISIT' | 'AUTO_ALWAYS' | 'ON_EVENT' | 'SCHEDULED';
|
|
120
|
+
/**
|
|
121
|
+
* Step placement enumeration
|
|
122
|
+
*/
|
|
123
|
+
export type StepPlacement = 'AUTO' | 'TOP' | 'BOTTOM' | 'LEFT' | 'RIGHT' | 'CENTER';
|
|
124
|
+
/**
|
|
125
|
+
* Media type enumeration
|
|
126
|
+
*/
|
|
127
|
+
export type TourMediaType = 'IMAGE' | 'VIDEO' | 'AUDIO' | 'DOCUMENT';
|
|
128
|
+
/**
|
|
129
|
+
* Device type enumeration
|
|
130
|
+
*/
|
|
131
|
+
export type DeviceType = 'mobile' | 'tablet' | 'desktop';
|
|
132
|
+
/**
|
|
133
|
+
* Media position within step
|
|
134
|
+
*/
|
|
135
|
+
export type MediaPosition = 'header' | 'body' | 'inline' | 'footer';
|
|
136
|
+
/**
|
|
137
|
+
* Tour template category
|
|
138
|
+
*/
|
|
139
|
+
export type TemplateCategory = 'ONBOARDING' | 'FEATURE_ANNOUNCEMENT' | 'HELP' | 'CUSTOM';
|
|
140
|
+
/**
|
|
141
|
+
* Recurrence pattern for scheduled tours
|
|
142
|
+
*/
|
|
143
|
+
export type RecurrencePattern = 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'CUSTOM';
|
|
144
|
+
/**
|
|
145
|
+
* Tour entity
|
|
146
|
+
*/
|
|
147
|
+
export interface Tour {
|
|
148
|
+
id: string;
|
|
149
|
+
name: string;
|
|
150
|
+
slug: string;
|
|
151
|
+
description?: string;
|
|
152
|
+
productId: string;
|
|
153
|
+
moduleId?: string;
|
|
154
|
+
pageId?: string;
|
|
155
|
+
status: TourStatus;
|
|
156
|
+
isActive: boolean;
|
|
157
|
+
triggerType: TourTriggerType;
|
|
158
|
+
triggerConfig?: Record<string, unknown>;
|
|
159
|
+
conditions?: Record<string, unknown>;
|
|
160
|
+
config?: Record<string, unknown>;
|
|
161
|
+
mobileConfig?: Record<string, unknown>;
|
|
162
|
+
tabletConfig?: Record<string, unknown>;
|
|
163
|
+
desktopConfig?: Record<string, unknown>;
|
|
164
|
+
priority: number;
|
|
165
|
+
displayOrder: number;
|
|
166
|
+
startDate?: string;
|
|
167
|
+
endDate?: string;
|
|
168
|
+
viewCount: number;
|
|
169
|
+
completionCount: number;
|
|
170
|
+
skipCount: number;
|
|
171
|
+
steps?: TourStep[];
|
|
172
|
+
schedules?: TourSchedule[];
|
|
173
|
+
metadata?: Record<string, unknown>;
|
|
174
|
+
version: number;
|
|
175
|
+
createdBy: string;
|
|
176
|
+
updatedBy?: string;
|
|
177
|
+
createdAt: string;
|
|
178
|
+
updatedAt: string;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Tour step entity
|
|
182
|
+
*/
|
|
183
|
+
export interface TourStep {
|
|
184
|
+
id: string;
|
|
185
|
+
tourId: string;
|
|
186
|
+
title: string;
|
|
187
|
+
content: string;
|
|
188
|
+
stepOrder: number;
|
|
189
|
+
targetSelector?: string;
|
|
190
|
+
placement: StepPlacement;
|
|
191
|
+
targetSelectorMobile?: string;
|
|
192
|
+
targetSelectorTablet?: string;
|
|
193
|
+
targetSelectorDesktop?: string;
|
|
194
|
+
customData?: Record<string, unknown>;
|
|
195
|
+
actions?: Record<string, unknown>;
|
|
196
|
+
requireInteraction?: boolean;
|
|
197
|
+
waitForSelector?: string;
|
|
198
|
+
waitForEvent?: string;
|
|
199
|
+
waitForTimeout?: number;
|
|
200
|
+
skipConditions?: Record<string, unknown>;
|
|
201
|
+
media?: TourStepMedia[];
|
|
202
|
+
metadata?: Record<string, unknown>;
|
|
203
|
+
createdAt: string;
|
|
204
|
+
updatedAt: string;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Tour media entity
|
|
208
|
+
*/
|
|
209
|
+
export interface TourMedia {
|
|
210
|
+
id: string;
|
|
211
|
+
name: string;
|
|
212
|
+
type: TourMediaType;
|
|
213
|
+
cdnUrl: string;
|
|
214
|
+
mimeType: string;
|
|
215
|
+
size: number;
|
|
216
|
+
duration?: number;
|
|
217
|
+
width?: number;
|
|
218
|
+
height?: number;
|
|
219
|
+
altText?: string;
|
|
220
|
+
caption?: string;
|
|
221
|
+
transcript?: string;
|
|
222
|
+
metadata?: Record<string, unknown>;
|
|
223
|
+
createdBy: string;
|
|
224
|
+
createdAt: string;
|
|
225
|
+
updatedAt: string;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Tour step media (junction entity)
|
|
229
|
+
*/
|
|
230
|
+
export interface TourStepMedia {
|
|
231
|
+
id: string;
|
|
232
|
+
stepId: string;
|
|
233
|
+
mediaId: string;
|
|
234
|
+
order?: number;
|
|
235
|
+
position: MediaPosition;
|
|
236
|
+
media: TourMedia;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Tour schedule entity
|
|
240
|
+
*/
|
|
241
|
+
export interface TourSchedule {
|
|
242
|
+
id: string;
|
|
243
|
+
tourId: string;
|
|
244
|
+
startDate: string;
|
|
245
|
+
endDate?: string;
|
|
246
|
+
recurrenceRule?: string;
|
|
247
|
+
timezone: string;
|
|
248
|
+
isActive: boolean;
|
|
249
|
+
nextExecutionAt?: string;
|
|
250
|
+
executionCount?: number;
|
|
251
|
+
createdAt: string;
|
|
252
|
+
updatedAt: string;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Tour template entity
|
|
256
|
+
*/
|
|
257
|
+
export interface TourTemplate {
|
|
258
|
+
id: string;
|
|
259
|
+
name: string;
|
|
260
|
+
slug: string;
|
|
261
|
+
description?: string;
|
|
262
|
+
category: TemplateCategory;
|
|
263
|
+
tags: string[];
|
|
264
|
+
thumbnail?: string;
|
|
265
|
+
config: Record<string, unknown>;
|
|
266
|
+
isPublic: boolean;
|
|
267
|
+
isPremium: boolean;
|
|
268
|
+
useCount: number;
|
|
269
|
+
createdBy: string;
|
|
270
|
+
createdAt: string;
|
|
271
|
+
updatedAt: string;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Tour analytics data
|
|
275
|
+
*/
|
|
276
|
+
export interface TourAnalytics {
|
|
277
|
+
tourId: string;
|
|
278
|
+
totalViews: number;
|
|
279
|
+
totalCompletions: number;
|
|
280
|
+
totalSkips: number;
|
|
281
|
+
averageCompletionRate: number;
|
|
282
|
+
averageDuration: number;
|
|
283
|
+
byDeviceType: Array<{
|
|
284
|
+
deviceType: DeviceType;
|
|
285
|
+
count: number;
|
|
286
|
+
completionRate: number;
|
|
287
|
+
}>;
|
|
288
|
+
byEventType: Array<{
|
|
289
|
+
eventType: string;
|
|
290
|
+
count: number;
|
|
291
|
+
}>;
|
|
292
|
+
stepAnalytics?: Array<{
|
|
293
|
+
stepId: string;
|
|
294
|
+
stepOrder: number;
|
|
295
|
+
views: number;
|
|
296
|
+
completions: number;
|
|
297
|
+
dropOffRate: number;
|
|
298
|
+
averageDuration: number;
|
|
299
|
+
}>;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Tour filters for queries
|
|
303
|
+
*/
|
|
304
|
+
export interface TourFilters {
|
|
305
|
+
search?: string;
|
|
306
|
+
status?: TourStatus | 'all';
|
|
307
|
+
productId?: string;
|
|
308
|
+
moduleId?: string;
|
|
309
|
+
pageId?: string;
|
|
310
|
+
dateRange?: {
|
|
311
|
+
start: string | null;
|
|
312
|
+
end: string | null;
|
|
313
|
+
};
|
|
314
|
+
createdBy?: string;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Pagination for tour queries
|
|
318
|
+
*/
|
|
319
|
+
export interface TourPagination {
|
|
320
|
+
page: number;
|
|
321
|
+
limit: number;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Tours query result
|
|
325
|
+
*/
|
|
326
|
+
export interface ToursQueryResult {
|
|
327
|
+
tours: Tour[];
|
|
328
|
+
total: number;
|
|
329
|
+
hasMore: boolean;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Validation error
|
|
333
|
+
*/
|
|
334
|
+
export interface ValidationError {
|
|
335
|
+
field: string;
|
|
336
|
+
message: string;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* View mode for tours list
|
|
340
|
+
*/
|
|
341
|
+
export type ToursViewMode = 'grid' | 'list';
|
|
342
|
+
/**
|
|
343
|
+
* Tab in step editor
|
|
344
|
+
*/
|
|
345
|
+
export type StepEditorTab = 'content' | 'targeting' | 'actions' | 'advanced';
|
|
346
|
+
/**
|
|
347
|
+
* Tour builder step
|
|
348
|
+
*/
|
|
349
|
+
export type TourBuilderStep = 'info' | 'steps' | 'targeting' | 'schedule' | 'preview';
|
|
350
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tours/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;CACtC;AAED;;GAEG;AAEH,MAAM,WAAW,sBAAsB;CAAG;AAE1C;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,sBAAsB;IAC5D;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Value } from 'clsx';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Utility function to merge Tailwind CSS classes
|
|
5
|
+
* Combines clsx for conditional classes and tailwind-merge for deduplication
|
|
6
|
+
*/
|
|
7
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
8
|
+
//# sourceMappingURL=cn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../../src/tours/utils/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAG7C;;;GAGG;AACH,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { TourStatus, TourTriggerType, DeviceType, StepPlacement } from '../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Format tour status for display
|
|
5
|
+
*/
|
|
6
|
+
export declare function formatTourStatus(status: TourStatus): string;
|
|
7
|
+
/**
|
|
8
|
+
* Get status color variant
|
|
9
|
+
*/
|
|
10
|
+
export declare function getStatusColor(status: TourStatus): 'default' | 'success' | 'warning' | 'destructive';
|
|
11
|
+
/**
|
|
12
|
+
* Format trigger type for display
|
|
13
|
+
*/
|
|
14
|
+
export declare function formatTriggerType(triggerType: TourTriggerType): string;
|
|
15
|
+
/**
|
|
16
|
+
* Format device type for display
|
|
17
|
+
*/
|
|
18
|
+
export declare function formatDeviceType(device: DeviceType): string;
|
|
19
|
+
/**
|
|
20
|
+
* Format step placement for display
|
|
21
|
+
*/
|
|
22
|
+
export declare function formatPlacement(placement: StepPlacement): string;
|
|
23
|
+
/**
|
|
24
|
+
* Format file size
|
|
25
|
+
*/
|
|
26
|
+
export declare function formatFileSize(bytes: number): string;
|
|
27
|
+
/**
|
|
28
|
+
* Format duration (seconds to human readable)
|
|
29
|
+
*/
|
|
30
|
+
export declare function formatDuration(seconds: number): string;
|
|
31
|
+
/**
|
|
32
|
+
* Format percentage
|
|
33
|
+
*/
|
|
34
|
+
export declare function formatPercentage(value: number, decimals?: number): string;
|
|
35
|
+
/**
|
|
36
|
+
* Format number with commas
|
|
37
|
+
*/
|
|
38
|
+
export declare function formatNumber(num: number): string;
|
|
39
|
+
/**
|
|
40
|
+
* Generate slug from string
|
|
41
|
+
*/
|
|
42
|
+
export declare function generateSlug(text: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Validate CSS selector
|
|
45
|
+
*/
|
|
46
|
+
export declare function isValidSelector(selector: string): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Validate email
|
|
49
|
+
*/
|
|
50
|
+
export declare function isValidEmail(email: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Validate URL
|
|
53
|
+
*/
|
|
54
|
+
export declare function isValidUrl(url: string): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Truncate text
|
|
57
|
+
*/
|
|
58
|
+
export declare function truncateText(text: string, maxLength: number): string;
|
|
59
|
+
/**
|
|
60
|
+
* Get relative time string
|
|
61
|
+
*/
|
|
62
|
+
export declare function getRelativeTime(date: string | Date): string;
|
|
63
|
+
/**
|
|
64
|
+
* Deep clone object
|
|
65
|
+
*/
|
|
66
|
+
export declare function deepClone<T>(obj: T): T;
|
|
67
|
+
/**
|
|
68
|
+
* Debounce function
|
|
69
|
+
*/
|
|
70
|
+
export declare function debounce<T extends (...args: unknown[]) => unknown>(func: T, wait: number): (...args: Parameters<T>) => void;
|
|
71
|
+
/**
|
|
72
|
+
* Throttle function
|
|
73
|
+
*/
|
|
74
|
+
export declare function throttle<T extends (...args: unknown[]) => unknown>(func: T, limit: number): (...args: Parameters<T>) => void;
|
|
75
|
+
/**
|
|
76
|
+
* Generate unique ID
|
|
77
|
+
*/
|
|
78
|
+
export declare function generateId(prefix?: string): string;
|
|
79
|
+
/**
|
|
80
|
+
* Check if object is empty
|
|
81
|
+
*/
|
|
82
|
+
export declare function isEmpty(obj: object): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Get device viewport dimensions
|
|
85
|
+
*/
|
|
86
|
+
export declare function getDeviceViewport(device: DeviceType): {
|
|
87
|
+
width: number;
|
|
88
|
+
height: number;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Sanitize HTML content
|
|
92
|
+
*/
|
|
93
|
+
export declare function sanitizeHtml(html: string): string;
|
|
94
|
+
/**
|
|
95
|
+
* Calculate completion rate
|
|
96
|
+
*/
|
|
97
|
+
export declare function calculateCompletionRate(completions: number, views: number): number;
|
|
98
|
+
/**
|
|
99
|
+
* Calculate drop-off rate
|
|
100
|
+
*/
|
|
101
|
+
export declare function calculateDropOffRate(currentViews: number, previousViews: number): number;
|
|
102
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tours/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEvF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAQ3D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,UAAU,GACjB,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAQnD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,eAAe,GAAG,MAAM,CAStE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAO3D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM,CAUhE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQpD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,G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,CAAC,MAAM,GAAE,MAAa,GAAG,MAAM,CAExD;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE5C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAOvF;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGlF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAIxF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/tours/utils/index.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
if (e === 0) return "0 Bytes";
|
|
4
|
+
let t = 1024, n = [
|
|
5
|
+
"Bytes",
|
|
6
|
+
"KB",
|
|
7
|
+
"MB",
|
|
8
|
+
"GB"
|
|
9
|
+
], r = Math.floor(Math.log(e) / Math.log(t));
|
|
10
|
+
return Math.round(e / t ** +r * 100) / 100 + " " + n[r];
|
|
11
|
+
}
|
|
12
|
+
function t(e) {
|
|
13
|
+
if (e < 60) return `${Math.round(e)}s`;
|
|
14
|
+
let t = Math.floor(e / 60), n = Math.round(e % 60);
|
|
15
|
+
if (t < 60) return n > 0 ? `${t}m ${n}s` : `${t}m`;
|
|
16
|
+
let r = Math.floor(t / 60), i = t % 60;
|
|
17
|
+
return i > 0 ? `${r}h ${i}m` : `${r}h`;
|
|
18
|
+
}
|
|
19
|
+
function n(e, t = 1) {
|
|
20
|
+
return `${e.toFixed(t)}%`;
|
|
21
|
+
}
|
|
22
|
+
function r(e) {
|
|
23
|
+
return e.toLocaleString("en-US");
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { t as formatDuration, e as formatFileSize, r as formatNumber, n as formatPercentage };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=index.js.map
|