@adriansteffan/reactive 0.1.9 → 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.
@@ -1,4 +1,4 @@
1
- import { W as e } from "./mod-EKiYITB-.js";
1
+ import { W as e } from "./mod-Cu_Zktcq.js";
2
2
  class s extends e {
3
3
  async enable() {
4
4
  console.log("Immersive mode is only available on Android");
@@ -1,4 +1,4 @@
1
- import { W as P, b as x, E } from "./mod-EKiYITB-.js";
1
+ import { W as P, b as x, E } from "./mod-Cu_Zktcq.js";
2
2
  function m(w) {
3
3
  const e = w.split("/").filter((t) => t !== "."), r = [];
4
4
  return e.forEach((t) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adriansteffan/reactive",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -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 }));
@@ -218,14 +225,17 @@ export const Tutorial = ({
218
225
  </div>
219
226
 
220
227
  <div style={{ justifySelf: 'start', marginLeft: '1rem' }}>
221
- <button
228
+ <motion.button
229
+ key={pulseKey}
222
230
  onClick={goNextIfCan}
223
231
  tabIndex={-1}
224
232
  onKeyDown={(e) => { if (e.key === ' ' || e.key === 'Enter') e.preventDefault(); }}
233
+ animate={{ scale: [1, 1.2, 1] }}
234
+ transition={{ duration: 0.3 }}
225
235
  className={(canProgress ? NAV_BTN_ACTIVE : NAV_BTN_DISABLED) + (page === slides.length - 1 ? ' px-8' : '')}
226
236
  >
227
237
  {page === slides.length - 1 ? finishText : '→'}
228
- </button>
238
+ </motion.button>
229
239
  </div>
230
240
  </div>
231
241
  </div>