siteguide.js 0.5.1 → 0.6.0
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/css/siteguide.css +1 -1
- package/dist/index.d.ts +38 -405
- package/dist/index.js +2 -2
- package/dist/index.mjs +511 -457
- package/package.json +1 -1
package/dist/css/siteguide.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--sg-bg: var(--sg-mono-100);--sg-text: var(--sg-mono-900);--sg-line: var(--sg-mono-500);--primary: #2e62d9;--primary-hover: #2ca2fd;--secondary: #2ca2fd;--secondary-hover: #2ca2fd;--sg-mono-900: #101828;--sg-mono-800: #4c525e;--sg-mono-700: #7c8089;--sg-mono-600: #acaeb5;--sg-mono-500: #d5d6d9;--sg-mono-400: #e6e7e8;--sg-mono-300: #f4f4f5;--sg-mono-200: #f9f9fa;--sg-mono-100: #fff;--padding-s: 8px;--padding-m: 12px;--padding-l: 16px;--padding-2l: 20px;--sg-text-m: 16px;--sg-text-l: 18px}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.siteguide{color:var(--sg-text);box-sizing:border-box;font-family:Inter,sans-serif;font-size:var(--sg-text-m);width:280px;min-height:150px;background-color:var(--sg-bg);border-radius:8px;border:1px solid var(--sg-line);display:flex;flex-direction:column;position:absolute;box-shadow:0 10px 10px #0001;z-index:1000001;max-height:400px}.siteguide-animation{animation:fadeIn .3s ease-out}.siteguide-arrow{position:absolute;width:10px;height:10px;background-color:
|
|
1
|
+
:root{--sg-bg: var(--sg-mono-100);--sg-text: var(--sg-mono-900);--sg-line: var(--sg-mono-500);--primary: #2e62d9;--primary-hover: #2ca2fd;--secondary: #2ca2fd;--secondary-hover: #2ca2fd;--sg-mono-900: #101828;--sg-mono-800: #4c525e;--sg-mono-700: #7c8089;--sg-mono-600: #acaeb5;--sg-mono-500: #d5d6d9;--sg-mono-400: #e6e7e8;--sg-mono-300: #f4f4f5;--sg-mono-200: #f9f9fa;--sg-mono-100: #fff;--padding-s: 8px;--padding-m: 12px;--padding-l: 16px;--padding-2l: 20px;--sg-text-m: 16px;--sg-text-l: 18px}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.siteguide{color:var(--sg-text);box-sizing:border-box;font-family:Inter,sans-serif;font-size:var(--sg-text-m);width:280px;min-height:150px;background-color:var(--sg-bg);border-radius:8px;border:1px solid var(--sg-line);display:flex;flex-direction:column;position:absolute;box-shadow:0 10px 10px #0001;z-index:1000001;max-height:400px}.siteguide-animation{animation:fadeIn .3s ease-out}.siteguide-arrow{position:absolute;width:10px;height:10px;background-color:inherit}.siteguide-highlight{box-shadow:0 0 #212121cc,0 0 0 5000px #21212180;border:2px solid var(--sg-mono-900);border-radius:4px;opacity:1;z-index:1000000;position:absolute;transition:all .3s ease-out;pointer-events:none}.siteguide-header{display:flex;align-items:center;width:100%;padding:var(--padding-m) var(--padding-2l) 0;font-family:inherit}.siteguide-content{width:100%;padding:var(--padding-m) var(--padding-2l);overflow-y:auto;font-family:inherit}.siteguide-content::-webkit-scrollbar{width:4px}.siteguide-content::-webkit-scrollbar-thumb{background-color:var(--primary);border-radius:4px}.siteguide-title{display:block;font-size:var(--sg-text-l);font-weight:800;color:var(--sg-text);font-family:inherit}.siteguide-image{width:100%;height:auto;border-radius:4px;object-fit:cover;margin-bottom:var(--padding-m)}.siteguide-description{font-size:14px;font-weight:400;color:var(--sg-text);font-family:inherit}.siteguide-footer{width:100%;display:flex;align-items:center;justify-content:space-between;padding:var(--padding-m);border-top:1px solid var(--sg-line);gap:var(--padding-l);margin-top:auto}.siteguide-button{padding:var(--padding-s) var(--padding-l);border-radius:4px;cursor:pointer;font-size:14px;line-height:20px;transition:background-color .3s ease-out;color:var(--sg-mono-100);border:none;font-family:inherit}.siteguide-button-secondary{background-color:var(--secondary)}.siteguide-button-secondary:hover{background-color:var(--secondary-hover)}.siteguide-button-primary{background-color:var(--primary)}.siteguide-button-primary:hover{background-color:var(--primary-hover)}.siteguide-button-link{color:var(--primary);background-color:transparent;cursor:pointer;transition:color .3s ease-out}.siteguide-button-link:hover{color:var(--primary-hover)}.siteguide-close{width:20px;height:20px;display:flex;align-items:center;justify-content:center;background-color:transparent;border-radius:4px;cursor:pointer;position:absolute;top:10px;right:10px;transition:background-color .3s ease-out}.siteguide-close:hover{background-color:var(--secondary-hover);color:#fff}.siteguide-close-icon{height:10px}
|
package/dist/index.d.ts
CHANGED
|
@@ -21,38 +21,13 @@ export declare type CustomPopupData = SharedPopupData & {
|
|
|
21
21
|
node: HTMLElement;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
/**
|
|
25
|
-
* Represents the data for a custom popup
|
|
26
|
-
*/
|
|
27
|
-
declare type CustomPopupData_2 = SharedPopupData_2 & {
|
|
28
|
-
/**
|
|
29
|
-
* The type of the popup
|
|
30
|
-
*/
|
|
31
|
-
type: Extract<PopupType_2, 'custom'>;
|
|
32
|
-
/**
|
|
33
|
-
* The HTML element to use as the content of the custom popup
|
|
34
|
-
*/
|
|
35
|
-
node: HTMLElement;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
24
|
/**
|
|
39
25
|
* Represents a deep required type, ensuring all properties of an object are required and recursively applies to nested objects
|
|
40
26
|
* @template T The type to make deep required
|
|
41
27
|
* @returns A type that represents a deep required version of T
|
|
42
28
|
*/
|
|
43
|
-
declare type DeepRequired<T> = T extends (...args: any[]) => any
|
|
44
|
-
|
|
45
|
-
: T extends object
|
|
46
|
-
? { [K in keyof T]-?: DeepRequired<T[K]> }
|
|
47
|
-
: T;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Represents a deep required type, ensuring all properties of an object are required and recursively applies to nested objects
|
|
51
|
-
* @template T The type to make deep required
|
|
52
|
-
* @returns A type that represents a deep required version of T
|
|
53
|
-
*/
|
|
54
|
-
declare type DeepRequired_2<T> = T extends (...args: any[]) => any ? T : T extends object ? {
|
|
55
|
-
[K in keyof T]-?: DeepRequired_2<T[K]>;
|
|
29
|
+
declare type DeepRequired<T> = T extends (...args: any[]) => any ? T : T extends object ? {
|
|
30
|
+
[K in keyof T]-?: DeepRequired<T[K]>;
|
|
56
31
|
} : T;
|
|
57
32
|
|
|
58
33
|
/**
|
|
@@ -64,114 +39,17 @@ declare interface IRenderer {
|
|
|
64
39
|
* @param {HTMLElement} popup - The popup element to render content into
|
|
65
40
|
* @param {TourStep} step - The tour step for which to render the popup content
|
|
66
41
|
*/
|
|
67
|
-
render(popup: HTMLElement, step:
|
|
68
|
-
|
|
42
|
+
render(popup: HTMLElement, step: TourStep): Promise<void>;
|
|
69
43
|
/**
|
|
70
44
|
* Updates the position of the popup based on the step's host element
|
|
71
45
|
* @param {HTMLElement} popup - The popup element to update the position for
|
|
72
46
|
* @param {TourStep} step - The tour step that the popup is associated with
|
|
73
47
|
*/
|
|
74
|
-
updatePosition(popup: HTMLElement, step:
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Interface for rendering element
|
|
79
|
-
*/
|
|
80
|
-
declare interface IRenderer_2 {
|
|
81
|
-
/**
|
|
82
|
-
* Renders the popup for a given step
|
|
83
|
-
* @param {HTMLElement} popup - The popup element to render content into
|
|
84
|
-
* @param {TourStep} step - The tour step for which to render the popup content
|
|
85
|
-
*/
|
|
86
|
-
render(popup: HTMLElement, step: ITourStep_2): Promise<void>;
|
|
87
|
-
/**
|
|
88
|
-
* Updates the position of the popup based on the step's host element
|
|
89
|
-
* @param {HTMLElement} popup - The popup element to update the position for
|
|
90
|
-
* @param {TourStep} step - The tour step that the popup is associated with
|
|
91
|
-
*/
|
|
92
|
-
updatePosition(popup: HTMLElement, step: ITourStep_2): void;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* @deprecated need to rethink
|
|
97
|
-
* Made for resolving circular dependencies
|
|
98
|
-
*/
|
|
99
|
-
declare interface ITour {
|
|
100
|
-
get stepList(): readonly ITourStep[];
|
|
101
|
-
get config(): RequiredTourConfig;
|
|
102
|
-
get popup(): HTMLElement | null;
|
|
103
|
-
get highlight(): HTMLElement | null;
|
|
104
|
-
get popupRenderer(): IRenderer;
|
|
105
|
-
get highlightRenderer(): IRenderer;
|
|
106
|
-
addStep(config: TourStepConfig_2): void;
|
|
107
|
-
addSteps(steps: TourStepConfig_2[]): void;
|
|
108
|
-
removeStep(stepId: StepId): void;
|
|
109
|
-
start(): void;
|
|
110
|
-
complete(): void;
|
|
111
|
-
prev(): void;
|
|
112
|
-
next(): void;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* @deprecated need to rethink
|
|
117
|
-
* Made for resolving circular dependencies
|
|
118
|
-
*/
|
|
119
|
-
declare interface ITour_2 {
|
|
120
|
-
get stepList(): readonly ITourStep_2[];
|
|
121
|
-
get config(): RequiredTourConfig_2;
|
|
122
|
-
get popup(): HTMLElement | null;
|
|
123
|
-
get highlight(): HTMLElement | null;
|
|
124
|
-
get popupRenderer(): IRenderer;
|
|
125
|
-
get highlightRenderer(): IRenderer;
|
|
126
|
-
addStep(config: TourStepConfig): void;
|
|
127
|
-
addSteps(steps: TourStepConfig[]): void;
|
|
128
|
-
removeStep(stepId: StepId_2): void;
|
|
129
|
-
start(): void;
|
|
130
|
-
complete(): void;
|
|
131
|
-
prev(): void;
|
|
132
|
-
next(): void;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* @deprecated need to rethink
|
|
137
|
-
* Made for resolving circular dependencies
|
|
138
|
-
*/
|
|
139
|
-
declare interface ITourStep {
|
|
140
|
-
get direction(): StepDirection;
|
|
141
|
-
get isFirst(): boolean;
|
|
142
|
-
get nextStep(): ITourStep | null;
|
|
143
|
-
get prevStep(): ITourStep | null;
|
|
144
|
-
get hasHost(): boolean;
|
|
145
|
-
get hostElement(): HTMLElement | null;
|
|
146
|
-
readonly id: StepId;
|
|
147
|
-
readonly popupData: PopupData_2;
|
|
148
|
-
readonly tour: ITour;
|
|
149
|
-
readonly index: number | null;
|
|
150
|
-
show(direction: StepDirection): Promise<void>;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* @deprecated need to rethink
|
|
155
|
-
* Made for resolving circular dependencies
|
|
156
|
-
*/
|
|
157
|
-
declare interface ITourStep_2 {
|
|
158
|
-
get direction(): StepDirection_2;
|
|
159
|
-
get isFirst(): boolean;
|
|
160
|
-
get nextStep(): ITourStep_2 | null;
|
|
161
|
-
get prevStep(): ITourStep_2 | null;
|
|
162
|
-
get hasHost(): boolean;
|
|
163
|
-
get hostElement(): HTMLElement | null;
|
|
164
|
-
readonly id: StepId_2;
|
|
165
|
-
readonly popupData: PopupData_2;
|
|
166
|
-
readonly tour: ITour_2;
|
|
167
|
-
readonly index: number | null;
|
|
168
|
-
show(direction: StepDirection_2): Promise<void>;
|
|
48
|
+
updatePosition(popup: HTMLElement, step: TourStep): void;
|
|
169
49
|
}
|
|
170
50
|
|
|
171
51
|
export declare type PopupCloseIconElement = InnerHTML | HTMLElement;
|
|
172
52
|
|
|
173
|
-
declare type PopupCloseIconElement_2 = InnerHTML | HTMLElement;
|
|
174
|
-
|
|
175
53
|
/**
|
|
176
54
|
* Represents the customization options for a popup
|
|
177
55
|
*/
|
|
@@ -210,54 +88,11 @@ export declare type PopupCustomization = {
|
|
|
210
88
|
imageClass?: string;
|
|
211
89
|
};
|
|
212
90
|
|
|
213
|
-
/**
|
|
214
|
-
* Represents the customization options for a popup
|
|
215
|
-
*/
|
|
216
|
-
declare type PopupCustomization_2 = {
|
|
217
|
-
/**
|
|
218
|
-
* The CSS class to apply to the popup container
|
|
219
|
-
*/
|
|
220
|
-
class?: string;
|
|
221
|
-
/**
|
|
222
|
-
* The CSS class to apply to the popup header
|
|
223
|
-
*/
|
|
224
|
-
headerClass?: string;
|
|
225
|
-
/**
|
|
226
|
-
* The CSS class to apply to the popup title
|
|
227
|
-
*/
|
|
228
|
-
titleClass?: string;
|
|
229
|
-
/**
|
|
230
|
-
* The CSS class to apply to the popup close button
|
|
231
|
-
*/
|
|
232
|
-
closeButtonClass?: string;
|
|
233
|
-
/**
|
|
234
|
-
* The CSS class to apply to the popup content
|
|
235
|
-
*/
|
|
236
|
-
contentClass?: string;
|
|
237
|
-
/**
|
|
238
|
-
* The CSS class to apply to the popup description
|
|
239
|
-
*/
|
|
240
|
-
descriptionClass?: string;
|
|
241
|
-
/**
|
|
242
|
-
* The CSS class to apply to the popup footer
|
|
243
|
-
*/
|
|
244
|
-
footerClass?: string;
|
|
245
|
-
/**
|
|
246
|
-
* The CSS class to apply to the popup image
|
|
247
|
-
*/
|
|
248
|
-
imageClass?: string;
|
|
249
|
-
};
|
|
250
|
-
|
|
251
91
|
/**
|
|
252
92
|
* Represents the data for a popup
|
|
253
93
|
*/
|
|
254
94
|
export declare type PopupData = TextPopupData | CustomPopupData;
|
|
255
95
|
|
|
256
|
-
/**
|
|
257
|
-
* Represents the data for a popup
|
|
258
|
-
*/
|
|
259
|
-
declare type PopupData_2 = TextPopupData_2 | CustomPopupData_2;
|
|
260
|
-
|
|
261
96
|
/**
|
|
262
97
|
* Represents the host of a tour step. It can be a string, an HTMLElement, or a function that returns either an HTMLElement or a string.
|
|
263
98
|
* @example
|
|
@@ -275,67 +110,21 @@ declare type PopupData_2 = TextPopupData_2 | CustomPopupData_2;
|
|
|
275
110
|
*/
|
|
276
111
|
export declare type PopupHost = string | Element | (() => Element | string);
|
|
277
112
|
|
|
278
|
-
/**
|
|
279
|
-
* Represents the host of a tour step. It can be a string, an HTMLElement, or a function that returns either an HTMLElement or a string.
|
|
280
|
-
* @example
|
|
281
|
-
* // Example 1: Class as host
|
|
282
|
-
* { host: '.example-element' }
|
|
283
|
-
* @example
|
|
284
|
-
* // Example 2: HTMLElement as host
|
|
285
|
-
* { host: document.querySelector('.example-element') }
|
|
286
|
-
* @example
|
|
287
|
-
* // Example 3: Function returning HTMLElement as host
|
|
288
|
-
* { host: () => document.querySelector('.example-element') };
|
|
289
|
-
* @example
|
|
290
|
-
* // Example 4: Function returning string as host
|
|
291
|
-
* { host: () => '.example-element' };
|
|
292
|
-
*/
|
|
293
|
-
declare type PopupHost_2 = string | Element | (() => Element | string);
|
|
294
|
-
|
|
295
113
|
/**
|
|
296
114
|
* The position of a popup
|
|
297
115
|
*/
|
|
298
116
|
export declare type PopupPosition = 'auto' | 'top' | 'bottom' | 'left' | 'right' | 'top-end' | 'top-start' | 'bottom-end' | 'bottom-start' | 'left-end' | 'left-start' | 'right-end' | 'right-start';
|
|
299
117
|
|
|
300
|
-
/**
|
|
301
|
-
* The position of a popup
|
|
302
|
-
*/
|
|
303
|
-
declare type PopupPosition_2 =
|
|
304
|
-
| 'auto'
|
|
305
|
-
| 'top'
|
|
306
|
-
| 'bottom'
|
|
307
|
-
| 'left'
|
|
308
|
-
| 'right'
|
|
309
|
-
| 'top-end'
|
|
310
|
-
| 'top-start'
|
|
311
|
-
| 'bottom-end'
|
|
312
|
-
| 'bottom-start'
|
|
313
|
-
| 'left-end'
|
|
314
|
-
| 'left-start'
|
|
315
|
-
| 'right-end'
|
|
316
|
-
| 'right-start';
|
|
317
|
-
|
|
318
118
|
/**
|
|
319
119
|
* The type of a popup
|
|
320
120
|
*/
|
|
321
121
|
export declare type PopupType = 'text' | 'custom';
|
|
322
122
|
|
|
323
|
-
/**
|
|
324
|
-
* The type of a popup
|
|
325
|
-
*/
|
|
326
|
-
declare type PopupType_2 = 'text' | 'custom';
|
|
327
|
-
|
|
328
123
|
/**
|
|
329
124
|
* Represents a required tour configuration.
|
|
330
125
|
* This type ensures all properties of the TourConfig are required.
|
|
331
126
|
*/
|
|
332
|
-
declare type RequiredTourConfig = DeepRequired<
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* Represents a required tour configuration.
|
|
336
|
-
* This type ensures all properties of the TourConfig are required.
|
|
337
|
-
*/
|
|
338
|
-
declare type RequiredTourConfig_2 = DeepRequired_2<TourConfig>;
|
|
127
|
+
declare type RequiredTourConfig = DeepRequired<TourConfig>;
|
|
339
128
|
|
|
340
129
|
/**
|
|
341
130
|
* Represents the shared data for a popup, including title, position, customization, and button collection.
|
|
@@ -362,39 +151,13 @@ export declare type SharedPopupData = {
|
|
|
362
151
|
buttonList?: TourButtonConfig[];
|
|
363
152
|
};
|
|
364
153
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
declare type SharedPopupData_2 = {
|
|
369
|
-
/**
|
|
370
|
-
* The title of the popup
|
|
371
|
-
*/
|
|
372
|
-
title?: string;
|
|
373
|
-
/**
|
|
374
|
-
* The position of the popup
|
|
375
|
-
* @default 'auto'
|
|
376
|
-
*/
|
|
377
|
-
position?: PopupPosition_2;
|
|
378
|
-
/**
|
|
379
|
-
* Customization options for the popup
|
|
380
|
-
*
|
|
381
|
-
* Each step-popup can have own styles by providing it's own classes
|
|
382
|
-
*/
|
|
383
|
-
customization?: PopupCustomization_2;
|
|
384
|
-
/**
|
|
385
|
-
* A collection of button configurations for the popup
|
|
386
|
-
*/
|
|
387
|
-
buttonList?: TourButtonConfig_2[];
|
|
154
|
+
export declare const Siteguide: {
|
|
155
|
+
readonly isActive: boolean;
|
|
156
|
+
readonly activeTour: Tour | null;
|
|
388
157
|
};
|
|
389
158
|
|
|
390
159
|
declare type StepDirection = 'toNext' | 'fromBack';
|
|
391
160
|
|
|
392
|
-
declare type StepDirection_2 = 'toNext' | 'fromBack';
|
|
393
|
-
|
|
394
|
-
declare type StepId = string;
|
|
395
|
-
|
|
396
|
-
declare type StepId_2 = string;
|
|
397
|
-
|
|
398
161
|
/**
|
|
399
162
|
* Represents the data for a text popup
|
|
400
163
|
*/
|
|
@@ -413,42 +176,25 @@ export declare type TextPopupData = SharedPopupData & {
|
|
|
413
176
|
imgSrc?: string;
|
|
414
177
|
};
|
|
415
178
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
declare type TextPopupData_2 = SharedPopupData_2 & {
|
|
420
|
-
/**
|
|
421
|
-
* The type of the popup
|
|
422
|
-
*/
|
|
423
|
-
type: Extract<PopupType_2, 'text'>;
|
|
424
|
-
/**
|
|
425
|
-
* The text to display in the popup
|
|
426
|
-
*/
|
|
427
|
-
text?: string;
|
|
428
|
-
/**
|
|
429
|
-
* The source of the image to display in the popup
|
|
430
|
-
*/
|
|
431
|
-
imgSrc?: string;
|
|
432
|
-
};
|
|
433
|
-
|
|
434
|
-
export declare class Tour implements ITour {
|
|
435
|
-
get stepList(): readonly ITourStep[];
|
|
436
|
-
get config(): RequiredTourConfig_2;
|
|
179
|
+
export declare class Tour {
|
|
180
|
+
get stepList(): readonly TourStep[];
|
|
181
|
+
get config(): RequiredTourConfig;
|
|
437
182
|
get popup(): HTMLElement | null;
|
|
438
183
|
get highlight(): HTMLElement | null;
|
|
439
|
-
|
|
440
|
-
readonly
|
|
184
|
+
get activeStep(): TourStep | null;
|
|
185
|
+
readonly popupRenderer: IRenderer;
|
|
186
|
+
readonly highlightRenderer: IRenderer;
|
|
441
187
|
private _popup;
|
|
442
188
|
private _highlight;
|
|
443
189
|
private _stepList;
|
|
444
190
|
private _activeStep;
|
|
445
191
|
private _bodyResizeObserver;
|
|
446
192
|
private _config;
|
|
447
|
-
private readonly _stepMap;
|
|
448
193
|
constructor(config: TourConfig);
|
|
449
194
|
addStep(config: TourStepConfig): void;
|
|
450
195
|
addSteps(steps: TourStepConfig[]): void;
|
|
451
|
-
|
|
196
|
+
addNext(config: TourStepConfig): void;
|
|
197
|
+
removeStep(index: number): void;
|
|
452
198
|
start(): void;
|
|
453
199
|
complete(): void;
|
|
454
200
|
prev(): void;
|
|
@@ -480,39 +226,11 @@ export declare type TourButtonConfig = {
|
|
|
480
226
|
action: (() => void) | (() => Promise<void>);
|
|
481
227
|
};
|
|
482
228
|
|
|
483
|
-
/**
|
|
484
|
-
* Represents the configuration for a button
|
|
485
|
-
*/
|
|
486
|
-
declare type TourButtonConfig_2 = {
|
|
487
|
-
/**
|
|
488
|
-
* The text to display on the button
|
|
489
|
-
*/
|
|
490
|
-
text: string;
|
|
491
|
-
/**
|
|
492
|
-
* The type of the button, which can be 'primary' or 'secondary'
|
|
493
|
-
*/
|
|
494
|
-
type?: TourButtonType_2;
|
|
495
|
-
/**
|
|
496
|
-
* Additional CSS class to apply to the button
|
|
497
|
-
*/
|
|
498
|
-
class?: string;
|
|
499
|
-
/**
|
|
500
|
-
* The action to perform when the button is clicked.
|
|
501
|
-
* This can be a function that returns void or a Promise that resolves to void
|
|
502
|
-
*/
|
|
503
|
-
action: (() => void) | (() => Promise<void>);
|
|
504
|
-
};
|
|
505
|
-
|
|
506
229
|
/**
|
|
507
230
|
* Type of a button
|
|
508
231
|
*/
|
|
509
232
|
export declare type TourButtonType = 'primary' | 'secondary' | 'link';
|
|
510
233
|
|
|
511
|
-
/**
|
|
512
|
-
* Type of a button
|
|
513
|
-
*/
|
|
514
|
-
declare type TourButtonType_2 = 'primary' | 'secondary' | 'link';
|
|
515
|
-
|
|
516
234
|
/**
|
|
517
235
|
* Represents the configuration for a tour.
|
|
518
236
|
*/
|
|
@@ -524,6 +242,11 @@ export declare type TourConfig = {
|
|
|
524
242
|
* @default 'siteguide'
|
|
525
243
|
*/
|
|
526
244
|
classPrefix?: string;
|
|
245
|
+
/**
|
|
246
|
+
* Additional class to provide for popup
|
|
247
|
+
* @default ''
|
|
248
|
+
*/
|
|
249
|
+
class?: string;
|
|
527
250
|
/**
|
|
528
251
|
* Indicates if the tour popup can be closed by the user
|
|
529
252
|
* @default true
|
|
@@ -545,77 +268,20 @@ export declare type TourConfig = {
|
|
|
545
268
|
*/
|
|
546
269
|
closeIcon?: PopupCloseIconElement;
|
|
547
270
|
/**
|
|
548
|
-
*
|
|
549
|
-
* @default false
|
|
550
|
-
*/
|
|
551
|
-
disableArrow?: boolean;
|
|
552
|
-
/**
|
|
553
|
-
* Configuration for the helper layout.
|
|
271
|
+
* Arrow configuration
|
|
554
272
|
*/
|
|
555
|
-
|
|
273
|
+
arrow?: {
|
|
556
274
|
/**
|
|
557
|
-
* Indicates if the
|
|
275
|
+
* Indicates if the arrow should be shown
|
|
558
276
|
* @default false
|
|
559
277
|
*/
|
|
560
278
|
disable?: boolean;
|
|
561
279
|
/**
|
|
562
|
-
*
|
|
563
|
-
* @default
|
|
564
|
-
*/
|
|
565
|
-
padding?: number;
|
|
566
|
-
/**
|
|
567
|
-
* The class to apply to the highlight
|
|
568
|
-
* @default 'siteguide-highlight'
|
|
280
|
+
* Additional class to apply to the arrow
|
|
281
|
+
* @default ''
|
|
569
282
|
*/
|
|
570
283
|
class?: string;
|
|
571
284
|
};
|
|
572
|
-
/**
|
|
573
|
-
* The class to apply to the tour popup animation
|
|
574
|
-
* @default 'siteguide-animation'
|
|
575
|
-
*/
|
|
576
|
-
animationClass?: string;
|
|
577
|
-
/**
|
|
578
|
-
* The function to translate the tokens
|
|
579
|
-
*/
|
|
580
|
-
translateFn?: TranslateFn_2;
|
|
581
|
-
};
|
|
582
|
-
|
|
583
|
-
/**
|
|
584
|
-
* Represents the configuration for a tour.
|
|
585
|
-
*/
|
|
586
|
-
declare type TourConfig_2 = {
|
|
587
|
-
/**
|
|
588
|
-
* The prefix for the CSS classes used in the tour
|
|
589
|
-
* Overriding this prefix will replace all 'siteguide-' prefixes with '{classPrefix}-'
|
|
590
|
-
* This option allows to easily replace all classes for customizing popup html
|
|
591
|
-
* @default 'siteguide'
|
|
592
|
-
*/
|
|
593
|
-
classPrefix?: string;
|
|
594
|
-
/**
|
|
595
|
-
* Indicates if the tour popup can be closed by the user
|
|
596
|
-
* @default true
|
|
597
|
-
*/
|
|
598
|
-
allowClose?: boolean;
|
|
599
|
-
/**
|
|
600
|
-
* Indicates if the tour popup can be closed by clicking outside the popup
|
|
601
|
-
* @default true
|
|
602
|
-
*/
|
|
603
|
-
allowClickoutClose?: boolean;
|
|
604
|
-
/**
|
|
605
|
-
* Specifies if the tour should scroll to the current step and how to scroll
|
|
606
|
-
* Can be a boolean to enable or disable scrolling, or an object with options for scrollIntoView
|
|
607
|
-
* @default {behavior:'smooth',block:'center',inline:'center'}
|
|
608
|
-
*/
|
|
609
|
-
scrollTo?: boolean | ScrollIntoViewOptions;
|
|
610
|
-
/**
|
|
611
|
-
* The element or HTML to use as the close icon
|
|
612
|
-
*/
|
|
613
|
-
closeIcon?: PopupCloseIconElement_2;
|
|
614
|
-
/**
|
|
615
|
-
* Indicates if the arrow should be shown
|
|
616
|
-
* @default false
|
|
617
|
-
*/
|
|
618
|
-
disableArrow?: boolean;
|
|
619
285
|
/**
|
|
620
286
|
* Configuration for the helper layout.
|
|
621
287
|
*/
|
|
@@ -631,12 +297,11 @@ declare type TourConfig_2 = {
|
|
|
631
297
|
*/
|
|
632
298
|
padding?: number;
|
|
633
299
|
/**
|
|
634
|
-
*
|
|
635
|
-
* @default '
|
|
300
|
+
* Additional class to apply to the highlight
|
|
301
|
+
* @default ''
|
|
636
302
|
*/
|
|
637
303
|
class?: string;
|
|
638
304
|
};
|
|
639
|
-
|
|
640
305
|
/**
|
|
641
306
|
* The class to apply to the tour popup animation
|
|
642
307
|
* @default 'siteguide-animation'
|
|
@@ -648,24 +313,25 @@ declare type TourConfig_2 = {
|
|
|
648
313
|
translateFn?: TranslateFn;
|
|
649
314
|
};
|
|
650
315
|
|
|
651
|
-
export declare class TourStep
|
|
316
|
+
export declare class TourStep {
|
|
652
317
|
get isFirst(): boolean;
|
|
653
|
-
get nextStep():
|
|
654
|
-
get prevStep():
|
|
655
|
-
get direction():
|
|
318
|
+
get nextStep(): TourStep | null;
|
|
319
|
+
get prevStep(): TourStep | null;
|
|
320
|
+
get direction(): StepDirection;
|
|
656
321
|
get hasHost(): boolean;
|
|
657
322
|
get hostElement(): HTMLElement | null;
|
|
658
|
-
|
|
323
|
+
get index(): number | null;
|
|
324
|
+
set index(value: number);
|
|
659
325
|
readonly popupData: PopupData;
|
|
660
|
-
readonly tour:
|
|
661
|
-
|
|
326
|
+
readonly tour: Tour;
|
|
327
|
+
private _index;
|
|
662
328
|
private _hostElement;
|
|
663
329
|
private _direction;
|
|
664
330
|
private readonly _hostData;
|
|
665
331
|
private readonly _popupRenderer;
|
|
666
332
|
private readonly _highlightRenderer;
|
|
667
|
-
constructor(tour:
|
|
668
|
-
show(direction:
|
|
333
|
+
constructor(tour: Tour, config: TourStepConfig);
|
|
334
|
+
show(direction: StepDirection): Promise<void>;
|
|
669
335
|
private resolveHostElement;
|
|
670
336
|
}
|
|
671
337
|
|
|
@@ -673,10 +339,6 @@ export declare class TourStep implements ITourStep_2 {
|
|
|
673
339
|
* Represents the configuration for a single step in a tour
|
|
674
340
|
*/
|
|
675
341
|
export declare type TourStepConfig = {
|
|
676
|
-
/**
|
|
677
|
-
* The unique identifier for the tour step.
|
|
678
|
-
*/
|
|
679
|
-
id: StepId_2;
|
|
680
342
|
/**
|
|
681
343
|
* The index of the step in the tour
|
|
682
344
|
*/
|
|
@@ -691,28 +353,6 @@ export declare type TourStepConfig = {
|
|
|
691
353
|
popup: PopupData;
|
|
692
354
|
};
|
|
693
355
|
|
|
694
|
-
/**
|
|
695
|
-
* Represents the configuration for a single step in a tour
|
|
696
|
-
*/
|
|
697
|
-
declare type TourStepConfig_2 = {
|
|
698
|
-
/**
|
|
699
|
-
* The unique identifier for the tour step.
|
|
700
|
-
*/
|
|
701
|
-
id: StepId;
|
|
702
|
-
/**
|
|
703
|
-
* The index of the step in the tour
|
|
704
|
-
*/
|
|
705
|
-
index?: number;
|
|
706
|
-
/**
|
|
707
|
-
* The host element or a function that returns the host element for the tour step
|
|
708
|
-
*/
|
|
709
|
-
host?: PopupHost_2;
|
|
710
|
-
/**
|
|
711
|
-
* The popup data for the tour step
|
|
712
|
-
*/
|
|
713
|
-
popup: PopupData_2;
|
|
714
|
-
};
|
|
715
|
-
|
|
716
356
|
/**
|
|
717
357
|
* The function to translate the tokens
|
|
718
358
|
* @param {string} token - The token to translate
|
|
@@ -720,11 +360,4 @@ declare type TourStepConfig_2 = {
|
|
|
720
360
|
*/
|
|
721
361
|
declare type TranslateFn = (token: string) => string;
|
|
722
362
|
|
|
723
|
-
/**
|
|
724
|
-
* The function to translate the tokens
|
|
725
|
-
* @param {string} token - The token to translate
|
|
726
|
-
* @returns {string} The translated string
|
|
727
|
-
*/
|
|
728
|
-
declare type TranslateFn_2 = (token: string) => string;
|
|
729
|
-
|
|
730
363
|
export { }
|