@korsolutions/guidon 1.0.14 → 1.0.16
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 +70 -23
- package/dist/commonjs/components/GuidonOverlay.js +1 -1
- package/dist/commonjs/components/GuidonOverlay.js.map +1 -1
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/store.js +41 -10
- package/dist/commonjs/store.js.map +1 -1
- package/dist/module/components/GuidonOverlay.js +1 -1
- package/dist/module/components/GuidonOverlay.js.map +1 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/store.js +41 -10
- package/dist/module/store.js.map +1 -1
- package/dist/typescript/commonjs/index.d.ts +1 -1
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/store.d.ts +16 -5
- package/dist/typescript/commonjs/store.d.ts.map +1 -1
- package/dist/typescript/commonjs/types.d.ts +45 -70
- package/dist/typescript/commonjs/types.d.ts.map +1 -1
- package/dist/typescript/module/index.d.ts +1 -1
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/dist/typescript/module/store.d.ts +16 -5
- package/dist/typescript/module/store.d.ts.map +1 -1
- package/dist/typescript/module/types.d.ts +45 -70
- package/dist/typescript/module/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/GuidonOverlay.tsx +1 -1
- package/src/index.ts +1 -0
- package/src/store.ts +43 -11
- package/src/types.ts +46 -70
package/src/types.ts
CHANGED
|
@@ -221,82 +221,51 @@ export interface GuidonTargetProps {
|
|
|
221
221
|
export type GuidonTours = Record<string, GuidonConfig>;
|
|
222
222
|
|
|
223
223
|
/**
|
|
224
|
-
*
|
|
225
|
-
*
|
|
224
|
+
* Single tour configuration for use within GuidonToursConfig.
|
|
225
|
+
* Identical to GuidonConfig - use this alias for semantic clarity in multi-tour setups.
|
|
226
|
+
*/
|
|
227
|
+
export type GuidonTourDefinition = GuidonConfig;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Configuration object for defining multiple tours with shared settings.
|
|
226
231
|
*
|
|
227
232
|
* @example
|
|
228
233
|
* ```tsx
|
|
229
|
-
* const
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
* { id: "
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
234
|
+
* const config = {
|
|
235
|
+
* theme: { backdropOpacity: 0.8, primaryColor: '#007AFF' },
|
|
236
|
+
* tours: {
|
|
237
|
+
* welcome: {
|
|
238
|
+
* id: "welcome",
|
|
239
|
+
* steps: [{ id: "s1", title: "Welcome", description: "..." }],
|
|
240
|
+
* },
|
|
241
|
+
* explore: {
|
|
242
|
+
* id: "explore",
|
|
243
|
+
* steps: [...],
|
|
244
|
+
* theme: { primaryColor: '#FF0000' }, // Override for this tour
|
|
245
|
+
* },
|
|
241
246
|
* },
|
|
242
247
|
* } satisfies GuidonToursConfig;
|
|
243
248
|
*
|
|
244
|
-
* Guidon.configureTours(
|
|
249
|
+
* Guidon.configureTours(config);
|
|
245
250
|
* ```
|
|
246
251
|
*/
|
|
247
|
-
export
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* Preferred position of the tooltip relative to target
|
|
266
|
-
* @default 'auto'
|
|
267
|
-
*/
|
|
268
|
-
tooltipPosition?: TooltipPosition;
|
|
269
|
-
/**
|
|
270
|
-
* Position for floating tooltips (when no targetId)
|
|
271
|
-
* @default 'center'
|
|
272
|
-
*/
|
|
273
|
-
floatingPosition?: FloatingPosition;
|
|
274
|
-
/** Custom React content to render in the tooltip */
|
|
275
|
-
customContent?: ReactNode;
|
|
276
|
-
/** Called when this step becomes active */
|
|
277
|
-
onStepEnter?: () => void;
|
|
278
|
-
/** Called when leaving this step */
|
|
279
|
-
onStepExit?: () => void;
|
|
280
|
-
/** Message shown while waiting for target element to mount */
|
|
281
|
-
waitingMessage?: string;
|
|
282
|
-
/**
|
|
283
|
-
* Auto-skip timeout in ms if target doesn't mount.
|
|
284
|
-
* Set to 0 to disable.
|
|
285
|
-
*/
|
|
286
|
-
waitTimeout?: number;
|
|
287
|
-
}>;
|
|
288
|
-
/** Theme customization for this tour */
|
|
289
|
-
theme?: GuidonTheme;
|
|
290
|
-
/** Animation duration in milliseconds */
|
|
291
|
-
animationDuration?: number;
|
|
292
|
-
/** Called when the tour is completed (user finishes all steps) */
|
|
293
|
-
onComplete?: () => void;
|
|
294
|
-
/** Called when the tour is skipped */
|
|
295
|
-
onSkip?: () => void;
|
|
296
|
-
/** Called when the step changes */
|
|
297
|
-
onStepChange?: (stepIndex: number, step: GuidonStep) => void;
|
|
298
|
-
};
|
|
299
|
-
};
|
|
252
|
+
export interface GuidonToursConfig {
|
|
253
|
+
/**
|
|
254
|
+
* Global theme applied to all tours.
|
|
255
|
+
* Individual tours can override with their own theme.
|
|
256
|
+
* @default { backdropOpacity: 0.7 }
|
|
257
|
+
*/
|
|
258
|
+
theme?: GuidonTheme;
|
|
259
|
+
/**
|
|
260
|
+
* Global animation duration applied to all tours.
|
|
261
|
+
* Individual tours can override.
|
|
262
|
+
*/
|
|
263
|
+
animationDuration?: number;
|
|
264
|
+
/**
|
|
265
|
+
* Map of tour IDs to tour configurations
|
|
266
|
+
*/
|
|
267
|
+
tours: Record<string, GuidonTourDefinition>;
|
|
268
|
+
}
|
|
300
269
|
|
|
301
270
|
/**
|
|
302
271
|
* Internal store state
|
|
@@ -304,6 +273,10 @@ export type GuidonToursConfig = {
|
|
|
304
273
|
export interface GuidonState {
|
|
305
274
|
/** Collection of all configured tours */
|
|
306
275
|
tours: GuidonTours;
|
|
276
|
+
/** Global theme applied to all tours */
|
|
277
|
+
globalTheme?: GuidonTheme;
|
|
278
|
+
/** Global animation duration applied to all tours */
|
|
279
|
+
globalAnimationDuration?: number;
|
|
307
280
|
/** ID of the currently active tour */
|
|
308
281
|
activeTourId: string | null;
|
|
309
282
|
/** Currently active guidon config (derived from tours + activeTourId, or legacy single config) */
|
|
@@ -332,8 +305,11 @@ export interface GuidonState {
|
|
|
332
305
|
export interface GuidonActions {
|
|
333
306
|
/** Configure a single guidon (legacy API, still supported) */
|
|
334
307
|
configure: (config: GuidonConfig) => void;
|
|
335
|
-
/**
|
|
336
|
-
|
|
308
|
+
/**
|
|
309
|
+
* Configure multiple named tours.
|
|
310
|
+
* Accepts either GuidonToursConfig (with global theme) or legacy GuidonTours format.
|
|
311
|
+
*/
|
|
312
|
+
configureTours: (config: GuidonToursConfig | GuidonTours) => void;
|
|
337
313
|
/** Start a tour by ID, or the legacy single config if no ID provided */
|
|
338
314
|
start: (tourId?: string) => void;
|
|
339
315
|
/** Stop the current tour without completing it */
|