@korsolutions/guidon 1.0.15 → 1.0.17
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 +72 -167
- package/dist/commonjs/components/GuidonOverlay.js +9 -20
- package/dist/commonjs/components/GuidonOverlay.js.map +1 -1
- package/dist/commonjs/components/GuidonProvider.js +11 -77
- package/dist/commonjs/components/GuidonProvider.js.map +1 -1
- package/dist/commonjs/components/GuidonTooltip.js +48 -55
- package/dist/commonjs/components/GuidonTooltip.js.map +1 -1
- package/dist/commonjs/components/index.js +2 -2
- package/dist/commonjs/components/index.js.map +1 -1
- package/dist/commonjs/hooks/useGuidonRef.js +7 -7
- package/dist/commonjs/hooks/useGuidonRef.js.map +1 -1
- package/dist/commonjs/store.js +34 -66
- package/dist/commonjs/store.js.map +1 -1
- package/dist/module/components/GuidonOverlay.js +14 -25
- package/dist/module/components/GuidonOverlay.js.map +1 -1
- package/dist/module/components/GuidonProvider.js +12 -78
- package/dist/module/components/GuidonProvider.js.map +1 -1
- package/dist/module/components/GuidonTooltip.js +53 -60
- package/dist/module/components/GuidonTooltip.js.map +1 -1
- package/dist/module/components/index.js +2 -2
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/hooks/useGuidonRef.js +7 -7
- package/dist/module/hooks/useGuidonRef.js.map +1 -1
- package/dist/module/store.js +34 -66
- package/dist/module/store.js.map +1 -1
- package/dist/typescript/commonjs/components/GuidonOverlay.d.ts +1 -1
- package/dist/typescript/commonjs/components/GuidonOverlay.d.ts.map +1 -1
- package/dist/typescript/commonjs/components/GuidonProvider.d.ts +4 -4
- package/dist/typescript/commonjs/components/GuidonProvider.d.ts.map +1 -1
- package/dist/typescript/commonjs/components/GuidonTooltip.d.ts +1 -1
- package/dist/typescript/commonjs/components/GuidonTooltip.d.ts.map +1 -1
- package/dist/typescript/commonjs/components/index.d.ts +4 -4
- package/dist/typescript/commonjs/components/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/hooks/useGuidonRef.d.ts.map +1 -1
- package/dist/typescript/commonjs/store.d.ts +14 -15
- package/dist/typescript/commonjs/store.d.ts.map +1 -1
- package/dist/typescript/commonjs/types.d.ts +10 -69
- package/dist/typescript/commonjs/types.d.ts.map +1 -1
- package/dist/typescript/module/components/GuidonOverlay.d.ts +1 -1
- package/dist/typescript/module/components/GuidonOverlay.d.ts.map +1 -1
- package/dist/typescript/module/components/GuidonProvider.d.ts +4 -4
- package/dist/typescript/module/components/GuidonProvider.d.ts.map +1 -1
- package/dist/typescript/module/components/GuidonTooltip.d.ts +1 -1
- package/dist/typescript/module/components/GuidonTooltip.d.ts.map +1 -1
- package/dist/typescript/module/components/index.d.ts +4 -4
- package/dist/typescript/module/components/index.d.ts.map +1 -1
- package/dist/typescript/module/hooks/useGuidonRef.d.ts.map +1 -1
- package/dist/typescript/module/store.d.ts +14 -15
- package/dist/typescript/module/store.d.ts.map +1 -1
- package/dist/typescript/module/types.d.ts +10 -69
- package/dist/typescript/module/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/GuidonOverlay.tsx +28 -29
- package/src/components/GuidonProvider.tsx +46 -111
- package/src/components/GuidonTooltip.tsx +125 -91
- package/src/components/index.ts +4 -4
- package/src/hooks/useGuidonRef.ts +23 -8
- package/src/store.ts +50 -70
- package/src/types.ts +10 -69
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,CAAC;AAEnB;;GAEG;AACH,MAAM,WAAW,k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5B,+DAA+D;IAC/D,cAAc,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACpD,yBAAyB;IACzB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,kDAAkD;IAClD,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,4BAA4B;IAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,sBAAsB;IACtB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,0BAA0B;IAC1B,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,uCAAuC;IACvC,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC7E,0BAA0B;IAC1B,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,wBAAwB;IACxB,UAAU,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,sBAAsB;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC1C;AAED,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@korsolutions/guidon",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"description": "A cross-platform walkthrough/onboarding component library for React Native with web support. Features spotlight effects, customizable tooltips, and flexible persistence options. ",
|
|
5
5
|
"repository": "https://github.com/KorSoftwareSolutions/guidon.git",
|
|
6
6
|
"author": "Christian Jimenez <christianjimenezfael@gmail.com>",
|
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
import { useMemo } from
|
|
1
|
+
import { useMemo } from "react";
|
|
2
2
|
import {
|
|
3
|
-
StyleSheet,
|
|
4
3
|
Dimensions,
|
|
5
|
-
TouchableWithoutFeedback,
|
|
6
4
|
Platform,
|
|
7
|
-
|
|
5
|
+
StyleSheet,
|
|
6
|
+
TouchableWithoutFeedback,
|
|
7
|
+
} from "react-native";
|
|
8
8
|
import Animated, {
|
|
9
|
+
Easing,
|
|
9
10
|
useAnimatedStyle,
|
|
10
11
|
withTiming,
|
|
11
|
-
|
|
12
|
-
} from
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import type { TargetMeasurements, GuidonTheme, GuidonStore } from '../types';
|
|
12
|
+
} from "react-native-reanimated";
|
|
13
|
+
import Svg, { Defs, G, Mask, Rect } from "react-native-svg";
|
|
14
|
+
import { useGuidonStore, useIsFloatingStep, useWaitingState } from "../store";
|
|
15
|
+
import type { GuidonStore, GuidonTheme, TargetMeasurements } from "../types";
|
|
16
16
|
|
|
17
17
|
const AnimatedSvg = Animated.createAnimatedComponent(Svg);
|
|
18
18
|
|
|
19
19
|
const DEFAULT_THEME: Required<
|
|
20
20
|
Pick<
|
|
21
21
|
GuidonTheme,
|
|
22
|
-
|
|
22
|
+
| "backdropColor"
|
|
23
|
+
| "backdropOpacity"
|
|
24
|
+
| "spotlightBorderRadius"
|
|
25
|
+
| "spotlightPadding"
|
|
23
26
|
>
|
|
24
27
|
> = {
|
|
25
|
-
backdropColor:
|
|
28
|
+
backdropColor: "#000000",
|
|
26
29
|
backdropOpacity: 0.7,
|
|
27
30
|
spotlightBorderRadius: 8,
|
|
28
31
|
spotlightPadding: 8,
|
|
@@ -41,16 +44,19 @@ export function GuidonOverlay({
|
|
|
41
44
|
}: GuidonOverlayProps) {
|
|
42
45
|
const isActive = useGuidonStore((state: GuidonStore) => state.isActive);
|
|
43
46
|
const config = useGuidonStore((state: GuidonStore) => state.config);
|
|
44
|
-
const currentStepIndex = useGuidonStore(
|
|
45
|
-
|
|
47
|
+
const currentStepIndex = useGuidonStore(
|
|
48
|
+
(state: GuidonStore) => state.currentStepIndex,
|
|
49
|
+
);
|
|
50
|
+
const targetMeasurements = useGuidonStore(
|
|
51
|
+
(state: GuidonStore) => state.targetMeasurements,
|
|
52
|
+
);
|
|
46
53
|
|
|
47
|
-
// Check for floating or waiting states
|
|
48
54
|
const isFloatingStep = useIsFloatingStep();
|
|
49
55
|
const waitingState = useWaitingState();
|
|
50
56
|
const isWaiting = waitingState?.isWaiting ?? false;
|
|
51
57
|
|
|
52
58
|
const mergedTheme = { ...DEFAULT_THEME, ...theme };
|
|
53
|
-
const { width: screenWidth, height: screenHeight } = Dimensions.get(
|
|
59
|
+
const { width: screenWidth, height: screenHeight } = Dimensions.get("window");
|
|
54
60
|
|
|
55
61
|
// Get current step's target measurements
|
|
56
62
|
const currentStep = config?.steps[currentStepIndex];
|
|
@@ -59,10 +65,9 @@ export function GuidonOverlay({
|
|
|
59
65
|
? targetMeasurements[currentTargetId]
|
|
60
66
|
: undefined;
|
|
61
67
|
|
|
62
|
-
// Determine if we should show full backdrop (no spotlight cutout)
|
|
63
68
|
const showFullBackdrop = isFloatingStep || isWaiting;
|
|
64
69
|
|
|
65
|
-
//
|
|
70
|
+
// Calculations for spotlight dimensions with padding
|
|
66
71
|
const spotlight = useMemo(() => {
|
|
67
72
|
if (!measurements) {
|
|
68
73
|
return { x: 0, y: 0, width: 0, height: 0 };
|
|
@@ -75,8 +80,7 @@ export function GuidonOverlay({
|
|
|
75
80
|
};
|
|
76
81
|
}, [measurements, mergedTheme.spotlightPadding]);
|
|
77
82
|
|
|
78
|
-
//
|
|
79
|
-
// Show backdrop for: normal steps with measurements, floating steps, or waiting states
|
|
83
|
+
//Stylized for fade in/out
|
|
80
84
|
const shouldShow = isActive && (measurements || showFullBackdrop);
|
|
81
85
|
const animatedStyle = useAnimatedStyle(() => {
|
|
82
86
|
return {
|
|
@@ -91,15 +95,14 @@ export function GuidonOverlay({
|
|
|
91
95
|
return null;
|
|
92
96
|
}
|
|
93
97
|
|
|
94
|
-
// Render full backdrop without spotlight for floating steps or waiting states
|
|
95
98
|
if (showFullBackdrop) {
|
|
96
|
-
if (Platform.OS ===
|
|
99
|
+
if (Platform.OS === "web") {
|
|
97
100
|
return (
|
|
98
101
|
<TouchableWithoutFeedback onPress={onBackdropPress}>
|
|
99
102
|
<Animated.View style={[styles.container, animatedStyle]}>
|
|
100
103
|
<div
|
|
101
104
|
style={{
|
|
102
|
-
position:
|
|
105
|
+
position: "absolute",
|
|
103
106
|
inset: 0,
|
|
104
107
|
backgroundColor: mergedTheme.backdropColor,
|
|
105
108
|
opacity: mergedTheme.backdropOpacity,
|
|
@@ -132,19 +135,17 @@ export function GuidonOverlay({
|
|
|
132
135
|
);
|
|
133
136
|
}
|
|
134
137
|
|
|
135
|
-
// If we have a target but no measurements yet, don't render anything
|
|
136
138
|
if (!measurements) {
|
|
137
139
|
return null;
|
|
138
140
|
}
|
|
139
141
|
|
|
140
|
-
|
|
141
|
-
if (Platform.OS === 'web') {
|
|
142
|
+
if (Platform.OS === "web") {
|
|
142
143
|
return (
|
|
143
144
|
<TouchableWithoutFeedback onPress={onBackdropPress}>
|
|
144
145
|
<Animated.View style={[styles.container, animatedStyle]}>
|
|
145
146
|
<div
|
|
146
147
|
style={{
|
|
147
|
-
position:
|
|
148
|
+
position: "absolute",
|
|
148
149
|
inset: 0,
|
|
149
150
|
backgroundColor: mergedTheme.backdropColor,
|
|
150
151
|
opacity: mergedTheme.backdropOpacity,
|
|
@@ -167,7 +168,7 @@ export function GuidonOverlay({
|
|
|
167
168
|
);
|
|
168
169
|
}
|
|
169
170
|
|
|
170
|
-
// Native implementation
|
|
171
|
+
// Native implementation
|
|
171
172
|
return (
|
|
172
173
|
<TouchableWithoutFeedback onPress={onBackdropPress}>
|
|
173
174
|
<AnimatedSvg
|
|
@@ -178,9 +179,7 @@ export function GuidonOverlay({
|
|
|
178
179
|
>
|
|
179
180
|
<Defs>
|
|
180
181
|
<Mask id="spotlight-mask">
|
|
181
|
-
{/* White background (visible) */}
|
|
182
182
|
<Rect x="0" y="0" width="100%" height="100%" fill="white" />
|
|
183
|
-
{/* Black cutout (transparent) */}
|
|
184
183
|
<Rect
|
|
185
184
|
x={spotlight.x}
|
|
186
185
|
y={spotlight.y}
|
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
GuidonProviderProps,
|
|
8
|
-
GuidonConfig,
|
|
9
|
-
GuidonStore,
|
|
10
|
-
} from '../types';
|
|
1
|
+
import { createContext, useCallback, useContext, useEffect } from "react";
|
|
2
|
+
import { useGuidonPersistence } from "../persistence/hooks";
|
|
3
|
+
import { useGuidonStore, useWaitingState } from "../store";
|
|
4
|
+
import type { GuidonProviderProps, GuidonStore } from "../types";
|
|
5
|
+
import { GuidonOverlay } from "./GuidonOverlay";
|
|
6
|
+
import { GuidonTooltip } from "./GuidonTooltip";
|
|
11
7
|
|
|
12
8
|
interface GuidonContextValue {
|
|
13
|
-
start: (tourId
|
|
9
|
+
start: (tourId: string) => void;
|
|
14
10
|
skip: () => void;
|
|
15
11
|
reset: () => void;
|
|
16
|
-
replay: () => Promise<void>;
|
|
12
|
+
replay: (tourId: string) => Promise<void>;
|
|
17
13
|
isActive: boolean;
|
|
18
14
|
isCompleted: boolean;
|
|
19
15
|
isLoading: boolean;
|
|
@@ -24,28 +20,27 @@ const GuidonContext = createContext<GuidonContextValue | null>(null);
|
|
|
24
20
|
export function useGuidonContext() {
|
|
25
21
|
const context = useContext(GuidonContext);
|
|
26
22
|
if (!context) {
|
|
27
|
-
throw new Error(
|
|
23
|
+
throw new Error("useGuidonContext must be used within a GuidonProvider");
|
|
28
24
|
}
|
|
29
25
|
return context;
|
|
30
26
|
}
|
|
31
27
|
|
|
32
28
|
export function GuidonProvider({
|
|
33
29
|
children,
|
|
34
|
-
config,
|
|
35
|
-
autoStart = true,
|
|
36
|
-
shouldStart,
|
|
37
30
|
persistenceAdapter,
|
|
38
31
|
portalComponent: Portal,
|
|
39
32
|
renderTooltip,
|
|
40
33
|
tooltipLabels,
|
|
41
34
|
onBackdropPress,
|
|
42
35
|
}: GuidonProviderProps) {
|
|
43
|
-
const hasInitialized = useRef(false);
|
|
44
36
|
const isActive = useGuidonStore((state: GuidonStore) => state.isActive);
|
|
45
|
-
const storeIsCompleted = useGuidonStore(
|
|
37
|
+
const storeIsCompleted = useGuidonStore(
|
|
38
|
+
(state: GuidonStore) => state.isCompleted,
|
|
39
|
+
);
|
|
46
40
|
const storeConfig = useGuidonStore((state: GuidonStore) => state.config);
|
|
47
|
-
const currentStepIndex = useGuidonStore(
|
|
48
|
-
|
|
41
|
+
const currentStepIndex = useGuidonStore(
|
|
42
|
+
(state: GuidonStore) => state.currentStepIndex,
|
|
43
|
+
);
|
|
49
44
|
const start = useGuidonStore((state: GuidonStore) => state.start);
|
|
50
45
|
const next = useGuidonStore((state: GuidonStore) => state.next);
|
|
51
46
|
const skip = useGuidonStore((state: GuidonStore) => state.skip);
|
|
@@ -54,89 +49,22 @@ export function GuidonProvider({
|
|
|
54
49
|
// Check for waiting state (target element not mounted)
|
|
55
50
|
const waitingState = useWaitingState();
|
|
56
51
|
|
|
57
|
-
// Use config
|
|
58
|
-
const persistenceId =
|
|
52
|
+
// Use store config ID for persistence
|
|
53
|
+
const persistenceId = storeConfig?.id ?? "__guidon_default__";
|
|
59
54
|
|
|
60
55
|
const {
|
|
61
56
|
isLoading,
|
|
62
57
|
isCompleted: persistedCompleted,
|
|
63
|
-
markCompleted,
|
|
64
|
-
markStepViewed,
|
|
65
58
|
clearProgress,
|
|
66
59
|
} = useGuidonPersistence(persistenceAdapter, persistenceId);
|
|
67
60
|
|
|
68
61
|
const isCompleted = storeIsCompleted || persistedCompleted;
|
|
69
62
|
|
|
70
|
-
// Track if we've already configured to prevent re-configuring during active tour
|
|
71
|
-
const hasConfigured = useRef(false);
|
|
72
|
-
const configRef = useRef(config);
|
|
73
|
-
configRef.current = config;
|
|
74
|
-
|
|
75
|
-
// Only configure if a config prop is provided (legacy single-config mode)
|
|
76
|
-
// Don't reconfigure if a tour is already active
|
|
77
|
-
useEffect(() => {
|
|
78
|
-
if (!config) return;
|
|
79
|
-
if (isActive) return; // Don't reconfigure while tour is running
|
|
80
|
-
if (hasConfigured.current && configRef.current === config) return; // Same config, already configured
|
|
81
|
-
|
|
82
|
-
hasConfigured.current = true;
|
|
83
|
-
|
|
84
|
-
const enhancedConfig: GuidonConfig = {
|
|
85
|
-
...config,
|
|
86
|
-
onComplete: async () => {
|
|
87
|
-
config.onComplete?.();
|
|
88
|
-
if (persistenceAdapter) {
|
|
89
|
-
await markCompleted();
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
onSkip: async () => {
|
|
93
|
-
config.onSkip?.();
|
|
94
|
-
if (persistenceAdapter) {
|
|
95
|
-
// Get current step index from store at time of skip
|
|
96
|
-
const currentIdx = useGuidonStore.getState().currentStepIndex;
|
|
97
|
-
await markStepViewed(currentIdx);
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
onStepChange: async (stepIndex, step) => {
|
|
101
|
-
config.onStepChange?.(stepIndex, step);
|
|
102
|
-
if (persistenceAdapter) {
|
|
103
|
-
await markStepViewed(stepIndex);
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
configure(enhancedConfig);
|
|
109
|
-
}, [config, configure, persistenceAdapter, markCompleted, markStepViewed, isActive]);
|
|
110
|
-
|
|
111
|
-
// Auto-start only in legacy single-config mode
|
|
112
|
-
useEffect(() => {
|
|
113
|
-
if (!config || !autoStart || hasInitialized.current || isLoading) return;
|
|
114
|
-
|
|
115
|
-
const checkAndStart = async () => {
|
|
116
|
-
hasInitialized.current = true;
|
|
117
|
-
|
|
118
|
-
if (persistedCompleted) return;
|
|
119
|
-
|
|
120
|
-
if (shouldStart) {
|
|
121
|
-
const should = await shouldStart();
|
|
122
|
-
if (!should) return;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
setTimeout(() => {
|
|
126
|
-
start();
|
|
127
|
-
}, 500);
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
checkAndStart();
|
|
131
|
-
}, [config, autoStart, isLoading, persistedCompleted, shouldStart, start]);
|
|
132
|
-
|
|
133
63
|
// Handle wait timeout - auto-skip to next step if waiting too long
|
|
134
|
-
// Works for both legacy and multi-tour mode (reads from store)
|
|
135
64
|
useEffect(() => {
|
|
136
|
-
|
|
137
|
-
if (!activeConfig) return;
|
|
65
|
+
if (!storeConfig) return;
|
|
138
66
|
|
|
139
|
-
const currentStep =
|
|
67
|
+
const currentStep = storeConfig.steps[currentStepIndex];
|
|
140
68
|
const waitTimeout = currentStep?.waitTimeout;
|
|
141
69
|
|
|
142
70
|
// Only set timeout if:
|
|
@@ -149,7 +77,9 @@ export function GuidonProvider({
|
|
|
149
77
|
|
|
150
78
|
const timer = setTimeout(() => {
|
|
151
79
|
// Check if we're still waiting when the timeout fires
|
|
152
|
-
const stillWaiting =
|
|
80
|
+
const stillWaiting =
|
|
81
|
+
useGuidonStore.getState().targetMeasurements[currentStep.targetId!] ===
|
|
82
|
+
undefined;
|
|
153
83
|
if (stillWaiting) {
|
|
154
84
|
next(); // Skip to next step
|
|
155
85
|
}
|
|
@@ -158,22 +88,27 @@ export function GuidonProvider({
|
|
|
158
88
|
return () => clearTimeout(timer);
|
|
159
89
|
}, [currentStepIndex, storeConfig, waitingState?.isWaiting, next]);
|
|
160
90
|
|
|
161
|
-
const replay = useCallback(
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
91
|
+
const replay = useCallback(
|
|
92
|
+
async (tourId: string) => {
|
|
93
|
+
if (persistenceAdapter) {
|
|
94
|
+
await clearProgress();
|
|
95
|
+
}
|
|
96
|
+
reset();
|
|
97
|
+
setTimeout(() => {
|
|
98
|
+
start(tourId);
|
|
99
|
+
}, 100);
|
|
100
|
+
},
|
|
101
|
+
[persistenceAdapter, clearProgress, reset, start],
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
const manualStart = useCallback(
|
|
105
|
+
(tourId: string) => {
|
|
106
|
+
if (!isActive && !isLoading) {
|
|
107
|
+
start(tourId);
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
[isActive, isLoading, start],
|
|
111
|
+
);
|
|
177
112
|
|
|
178
113
|
const contextValue: GuidonContextValue = {
|
|
179
114
|
start: manualStart,
|
|
@@ -185,9 +120,9 @@ export function GuidonProvider({
|
|
|
185
120
|
isLoading,
|
|
186
121
|
};
|
|
187
122
|
|
|
188
|
-
// Get theme from
|
|
189
|
-
const activeTheme =
|
|
190
|
-
const activeDuration =
|
|
123
|
+
// Get theme from store config
|
|
124
|
+
const activeTheme = storeConfig?.theme;
|
|
125
|
+
const activeDuration = storeConfig?.animationDuration;
|
|
191
126
|
|
|
192
127
|
const overlayContent = (
|
|
193
128
|
<>
|