@adriansteffan/reactive 0.1.8 → 0.1.10
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/{mod-mnMF_iBn.js → mod-Cu_Zktcq.js} +4811 -4798
- package/dist/reactive.es.js +1 -1
- package/dist/reactive.umd.js +619 -619
- package/dist/{web-BOQjjxqz.js → web-C5bGJ59T.js} +1 -1
- package/dist/{web-C8o1fEqF.js → web-jzuaNWaD.js} +1 -1
- package/package.json +1 -1
- package/src/components/tutorial.tsx +14 -2
package/package.json
CHANGED
|
@@ -97,6 +97,13 @@ export const Tutorial = ({
|
|
|
97
97
|
|
|
98
98
|
const canProgress = progressMap[page] !== false;
|
|
99
99
|
|
|
100
|
+
const prevCanProgress = useRef(canProgress);
|
|
101
|
+
const [pulseKey, setPulseKey] = useState(0);
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
if (canProgress && !prevCanProgress.current) setPulseKey((k) => k + 1);
|
|
104
|
+
prevCanProgress.current = canProgress;
|
|
105
|
+
}, [canProgress]);
|
|
106
|
+
|
|
100
107
|
const handleSetCanProgress = useCallback(
|
|
101
108
|
(value: boolean) => {
|
|
102
109
|
setProgressMap((prev) => ({ ...prev, [page]: value }));
|
|
@@ -193,6 +200,7 @@ export const Tutorial = ({
|
|
|
193
200
|
onClick={goBack}
|
|
194
201
|
className={NAV_BTN_ACTIVE}
|
|
195
202
|
tabIndex={-1}
|
|
203
|
+
onKeyDown={(e) => { if (e.key === ' ' || e.key === 'Enter') e.preventDefault(); }}
|
|
196
204
|
style={{ visibility: page > 0 ? 'visible' : 'hidden' }}
|
|
197
205
|
>
|
|
198
206
|
←
|
|
@@ -217,13 +225,17 @@ export const Tutorial = ({
|
|
|
217
225
|
</div>
|
|
218
226
|
|
|
219
227
|
<div style={{ justifySelf: 'start', marginLeft: '1rem' }}>
|
|
220
|
-
<button
|
|
228
|
+
<motion.button
|
|
229
|
+
key={pulseKey}
|
|
221
230
|
onClick={goNextIfCan}
|
|
222
231
|
tabIndex={-1}
|
|
232
|
+
onKeyDown={(e) => { if (e.key === ' ' || e.key === 'Enter') e.preventDefault(); }}
|
|
233
|
+
animate={{ scale: [1, 1.2, 1] }}
|
|
234
|
+
transition={{ duration: 0.3 }}
|
|
223
235
|
className={(canProgress ? NAV_BTN_ACTIVE : NAV_BTN_DISABLED) + (page === slides.length - 1 ? ' px-8' : '')}
|
|
224
236
|
>
|
|
225
237
|
{page === slides.length - 1 ? finishText : '→'}
|
|
226
|
-
</button>
|
|
238
|
+
</motion.button>
|
|
227
239
|
</div>
|
|
228
240
|
</div>
|
|
229
241
|
</div>
|