@flowsterix/react 0.12.1 → 0.14.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/index.mjs CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  portalHost,
16
16
  subscribeToRouteChanges,
17
17
  supportsMasking
18
- } from "./chunk-B44EX7YT.mjs";
18
+ } from "./chunk-J2JMZXGD.mjs";
19
19
 
20
20
  // src/context.tsx
21
21
  import {
@@ -716,8 +716,12 @@ var TourProvider = ({
716
716
  [getActiveStore]
717
717
  );
718
718
  const advanceStep = useCallback2(
719
- (stepId) => getActiveStore().advanceStep(stepId),
720
- [getActiveStore]
719
+ (stepId) => {
720
+ const store = storeRef.current;
721
+ if (!store) return null;
722
+ return store.advanceStep(stepId);
723
+ },
724
+ []
721
725
  );
722
726
  const toggleDebug = useCallback2(() => {
723
727
  setDebugEnabled((previous) => !previous);
@@ -2460,11 +2464,11 @@ var useHudShortcuts = (target, options) => {
2460
2464
  // src/hooks/useTourHud.ts
2461
2465
  import { useMemo as useMemo9, useState as useState9 } from "react";
2462
2466
 
2463
- // src/hooks/useBodyScrollLock.ts
2464
- import { useEffect as useEffect11 } from "react";
2467
+ // src/hooks/useConstrainedScrollLock.ts
2468
+ import { useEffect as useEffect11, useRef as useRef8 } from "react";
2465
2469
  var lockCount = 0;
2466
2470
  var previousOverflow = null;
2467
- var acquireLock = () => {
2471
+ var acquireHardLock = () => {
2468
2472
  if (!isBrowser) return;
2469
2473
  if (lockCount === 0) {
2470
2474
  previousOverflow = document.body.style.overflow;
@@ -2472,7 +2476,7 @@ var acquireLock = () => {
2472
2476
  }
2473
2477
  lockCount += 1;
2474
2478
  };
2475
- var releaseLock = () => {
2479
+ var releaseHardLock = () => {
2476
2480
  if (!isBrowser) return;
2477
2481
  if (lockCount === 0) return;
2478
2482
  lockCount -= 1;
@@ -2481,14 +2485,57 @@ var releaseLock = () => {
2481
2485
  previousOverflow = null;
2482
2486
  }
2483
2487
  };
2484
- var useBodyScrollLock = (enabled) => {
2488
+ var useConstrainedScrollLock = ({
2489
+ enabled,
2490
+ targetRect,
2491
+ viewportHeight,
2492
+ padding = 0,
2493
+ bottomInset = 0
2494
+ }) => {
2495
+ const isConstrainedModeRef = useRef8(false);
2496
+ const boundsRef = useRef8({ minY: 0, maxY: 0 });
2497
+ const targetHeight = targetRect ? targetRect.height + padding * 2 : 0;
2498
+ const effectiveViewportHeight = viewportHeight - bottomInset;
2499
+ const isConstrainedMode = enabled && Boolean(targetRect) && targetHeight > effectiveViewportHeight;
2485
2500
  useEffect11(() => {
2486
- if (!enabled) return;
2487
- acquireLock();
2501
+ if (!enabled || !isBrowser) return;
2502
+ const targetHeight2 = targetRect ? targetRect.height + padding * 2 : 0;
2503
+ const effectiveViewportHeight2 = viewportHeight - bottomInset;
2504
+ const targetExceedsViewport = targetRect && targetHeight2 > effectiveViewportHeight2;
2505
+ if (!targetExceedsViewport) {
2506
+ acquireHardLock();
2507
+ isConstrainedModeRef.current = false;
2508
+ return () => {
2509
+ releaseHardLock();
2510
+ };
2511
+ }
2512
+ isConstrainedModeRef.current = true;
2513
+ const targetTop = targetRect.top - padding;
2514
+ const targetBottom = targetRect.bottom + padding;
2515
+ const currentScroll = window.scrollY;
2516
+ const minY = currentScroll + targetTop;
2517
+ const maxY = currentScroll + targetBottom - effectiveViewportHeight2;
2518
+ boundsRef.current = {
2519
+ minY: Math.max(0, minY),
2520
+ maxY: Math.max(0, maxY)
2521
+ };
2522
+ const handleScroll = () => {
2523
+ const { minY: minY2, maxY: maxY2 } = boundsRef.current;
2524
+ const currentY = window.scrollY;
2525
+ if (currentY < minY2) {
2526
+ window.scrollTo({ top: minY2, behavior: "auto" });
2527
+ } else if (currentY > maxY2) {
2528
+ window.scrollTo({ top: maxY2, behavior: "auto" });
2529
+ }
2530
+ };
2531
+ handleScroll();
2532
+ window.addEventListener("scroll", handleScroll, { passive: false });
2488
2533
  return () => {
2489
- releaseLock();
2534
+ window.removeEventListener("scroll", handleScroll);
2535
+ isConstrainedModeRef.current = false;
2490
2536
  };
2491
- }, [enabled]);
2537
+ }, [enabled, targetRect, viewportHeight, padding, bottomInset]);
2538
+ return { isConstrainedMode };
2492
2539
  };
2493
2540
 
2494
2541
  // src/hooks/useHudTargetIssue.ts
@@ -2558,7 +2605,8 @@ var useTourHud = (options = {}) => {
2558
2605
  const {
2559
2606
  overlayPadding,
2560
2607
  overlayRadius,
2561
- bodyScrollLock = DEFAULT_BODY_SCROLL_LOCK
2608
+ bodyScrollLock = DEFAULT_BODY_SCROLL_LOCK,
2609
+ scrollLockBottomInset
2562
2610
  } = options;
2563
2611
  const shortcuts = options.shortcuts ?? DEFAULT_SHORTCUTS;
2564
2612
  const { backdropInteraction, lockBodyScroll } = useTour();
@@ -2571,10 +2619,17 @@ var useTourHud = (options = {}) => {
2571
2619
  fallbackAriaDescribedBy: popoverOptions?.ariaDescribedBy
2572
2620
  });
2573
2621
  const targetIssue = useHudTargetIssue(hudState.hudTarget);
2622
+ const viewport = useViewportRect();
2574
2623
  const shouldLockBodyScroll = Boolean(
2575
2624
  bodyScrollLock && (hudState.flowHudOptions?.behavior?.lockBodyScroll ?? lockBodyScroll) && hudState.focusTrapActive
2576
2625
  );
2577
- useBodyScrollLock(shouldLockBodyScroll);
2626
+ const { isConstrainedMode: isConstrainedScrollActive } = useConstrainedScrollLock({
2627
+ enabled: shouldLockBodyScroll,
2628
+ targetRect: hudState.hudTarget.rect,
2629
+ viewportHeight: viewport.height,
2630
+ padding: overlayPadding ?? 12,
2631
+ bottomInset: scrollLockBottomInset
2632
+ });
2578
2633
  const shortcutOptions = typeof shortcuts === "object" ? shortcuts : {};
2579
2634
  const shortcutsEnabled = Boolean(
2580
2635
  (typeof shortcuts === "boolean" ? shortcuts : shortcuts.enabled ?? true) && hudState.shouldRender
@@ -2631,12 +2686,13 @@ var useTourHud = (options = {}) => {
2631
2686
  focusManager,
2632
2687
  targetIssue,
2633
2688
  shouldLockBodyScroll,
2634
- shortcutsEnabled
2689
+ shortcutsEnabled,
2690
+ isConstrainedScrollActive
2635
2691
  };
2636
2692
  };
2637
2693
 
2638
2694
  // src/hooks/useTourOverlay.ts
2639
- import { useEffect as useEffect13, useMemo as useMemo10, useRef as useRef8 } from "react";
2695
+ import { useEffect as useEffect13, useMemo as useMemo10, useRef as useRef9 } from "react";
2640
2696
  var DEFAULT_PADDING = 12;
2641
2697
  var DEFAULT_RADIUS = 12;
2642
2698
  var DEFAULT_EDGE_BUFFER = 0;
@@ -2649,8 +2705,8 @@ var useTourOverlay = (options) => {
2649
2705
  interactionMode = "passthrough",
2650
2706
  isInGracePeriod = false
2651
2707
  } = options;
2652
- const hasShownRef = useRef8(false);
2653
- const lastReadyTargetRef = useRef8(null);
2708
+ const hasShownRef = useRef9(false);
2709
+ const lastReadyTargetRef = useRef9(null);
2654
2710
  useEffect13(() => {
2655
2711
  if (!isBrowser) return;
2656
2712
  if (target.status === "ready") {
@@ -2892,7 +2948,7 @@ var waitForDom = () => new Promise(
2892
2948
  );
2893
2949
 
2894
2950
  // src/hooks/useRadixTourDialog.ts
2895
- import { useCallback as useCallback5, useEffect as useEffect14, useMemo as useMemo11, useRef as useRef9, useState as useState10 } from "react";
2951
+ import { useCallback as useCallback5, useEffect as useEffect14, useMemo as useMemo11, useRef as useRef10, useState as useState10 } from "react";
2896
2952
  var resolveAutoOpen2 = (config) => {
2897
2953
  if (!config) return { onEnter: true, onResume: true };
2898
2954
  const { autoOpen } = config;
@@ -2911,8 +2967,8 @@ var useRadixTourDialog = (params) => {
2911
2967
  const registry = useDialogRegistryOptional();
2912
2968
  const { suspendExternalFocusTrap } = useTourFocusDominance();
2913
2969
  const [internalOpen, setInternalOpen] = useState10(false);
2914
- const lastStepIndexRef = useRef9(-1);
2915
- const isResumeRef = useRef9(false);
2970
+ const lastStepIndexRef = useRef10(-1);
2971
+ const isResumeRef = useRef10(false);
2916
2972
  const flow = activeFlowId ? flows.get(activeFlowId) : void 0;
2917
2973
  const dialogConfig = flow?.dialogs?.[dialogId];
2918
2974
  const currentStep = flow && state && state.stepIndex >= 0 ? flow.steps[state.stepIndex] : void 0;
@@ -3160,7 +3216,7 @@ var useDelayAdvance = () => {
3160
3216
  };
3161
3217
 
3162
3218
  // src/components/OverlayBackdrop.tsx
3163
- import { useEffect as useEffect16, useRef as useRef10 } from "react";
3219
+ import { useEffect as useEffect16, useRef as useRef11 } from "react";
3164
3220
  import { createPortal } from "react-dom";
3165
3221
  import { AnimatePresence } from "motion/react";
3166
3222
  import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
@@ -3249,7 +3305,7 @@ var OverlayBackdrop = ({
3249
3305
  viewport
3250
3306
  } = overlay;
3251
3307
  const hasHighlightBounds = Boolean(highlight.rect);
3252
- const prevScreenTargetRef = useRef10(null);
3308
+ const prevScreenTargetRef = useRef11(null);
3253
3309
  const shouldSnapHighlight = prevScreenTargetRef.current === true && !highlight.isScreen && hasHighlightBounds;
3254
3310
  useEffect16(() => {
3255
3311
  prevScreenTargetRef.current = highlight.isScreen;
@@ -3488,7 +3544,7 @@ var OverlayBackdrop = ({
3488
3544
  };
3489
3545
 
3490
3546
  // src/components/TourPopoverPortal.tsx
3491
- import { useEffect as useEffect17, useLayoutEffect as useLayoutEffect2, useMemo as useMemo13, useRef as useRef11, useState as useState12 } from "react";
3547
+ import { useEffect as useEffect17, useLayoutEffect as useLayoutEffect2, useMemo as useMemo13, useRef as useRef12, useState as useState12 } from "react";
3492
3548
  import { createPortal as createPortal2 } from "react-dom";
3493
3549
  import {
3494
3550
  autoPlacement,
@@ -3556,11 +3612,11 @@ var TourPopoverPortal = ({
3556
3612
  const popoverContentTransition = transitionsOverride?.popoverContent ?? adapter.transitions.popoverContent ?? DEFAULT_POPOVER_CONTENT_TRANSITION;
3557
3613
  const viewport = useViewportRect();
3558
3614
  const prefersMobileLayout = viewport.width <= MOBILE_BREAKPOINT || viewport.height <= MOBILE_HEIGHT_BREAKPOINT;
3559
- const prefersMobileRef = useRef11(prefersMobileLayout);
3615
+ const prefersMobileRef = useRef12(prefersMobileLayout);
3560
3616
  useEffect17(() => {
3561
3617
  prefersMobileRef.current = prefersMobileLayout;
3562
3618
  }, [prefersMobileLayout]);
3563
- const lastReadyTargetRef = useRef11(null);
3619
+ const lastReadyTargetRef = useRef12(null);
3564
3620
  useEffect17(() => {
3565
3621
  if (target.status === "ready" && target.rect) {
3566
3622
  lastReadyTargetRef.current = {
@@ -3604,22 +3660,22 @@ var TourPopoverPortal = ({
3604
3660
  }),
3605
3661
  [viewport.height, viewport.width]
3606
3662
  );
3607
- const floatingRef = useRef11(null);
3608
- const cachedFloatingPositionRef = useRef11(null);
3609
- const appliedFloatingCacheRef = useRef11(null);
3610
- const deferredScreenSnapRef = useRef11(null);
3663
+ const floatingRef = useRef12(null);
3664
+ const cachedFloatingPositionRef = useRef12(null);
3665
+ const appliedFloatingCacheRef = useRef12(null);
3666
+ const deferredScreenSnapRef = useRef12(null);
3611
3667
  const [layoutMode, setLayoutMode] = useState12(
3612
3668
  () => prefersMobileLayout ? "mobile" : "floating"
3613
3669
  );
3614
3670
  const [floatingPosition, setFloatingPosition] = useState12(fallbackPosition);
3615
3671
  const [dragPosition, setDragPosition] = useState12(null);
3616
3672
  const [isDragging, setIsDragging] = useState12(false);
3617
- const dragStateRef = useRef11(null);
3618
- const overflowRetryRef = useRef11({
3673
+ const dragStateRef = useRef12(null);
3674
+ const overflowRetryRef = useRef12({
3619
3675
  stepId: null,
3620
3676
  attempts: 0
3621
3677
  });
3622
- const overflowRetryTimeoutRef = useRef11(null);
3678
+ const overflowRetryTimeoutRef = useRef12(null);
3623
3679
  useLayoutEffect2(() => {
3624
3680
  if (!isBrowser) return;
3625
3681
  const node = floatingRef.current;
@@ -4093,7 +4149,7 @@ var TourPopoverPortal = ({
4093
4149
  };
4094
4150
 
4095
4151
  // src/components/TourFocusManager.tsx
4096
- import { useEffect as useEffect18, useLayoutEffect as useLayoutEffect3, useRef as useRef12, useState as useState13 } from "react";
4152
+ import { useEffect as useEffect18, useLayoutEffect as useLayoutEffect3, useRef as useRef13, useState as useState13 } from "react";
4097
4153
  import { createPortal as createPortal3 } from "react-dom";
4098
4154
 
4099
4155
  // src/utils/focus.ts
@@ -4170,15 +4226,15 @@ var TourFocusManager = ({
4170
4226
  highlightRect,
4171
4227
  guardElementFocusRing
4172
4228
  }) => {
4173
- const previousFocusRef = useRef12(null);
4174
- const guardNodesRef = useRef12({
4229
+ const previousFocusRef = useRef13(null);
4230
+ const guardNodesRef = useRef13({
4175
4231
  "target-start": null,
4176
4232
  "target-end": null,
4177
4233
  "popover-start": null,
4178
4234
  "popover-end": null
4179
4235
  });
4180
- const lastTabDirectionRef = useRef12("forward");
4181
- const suppressGuardHopRef = useRef12(null);
4236
+ const lastTabDirectionRef = useRef13("forward");
4237
+ const suppressGuardHopRef = useRef13(null);
4182
4238
  const [targetRingActive, setTargetRingActive] = useState13(false);
4183
4239
  const [popoverRingActive, setPopoverRingActive] = useState13(false);
4184
4240
  const [popoverRect, setPopoverRect] = useState13(null);
@@ -4500,6 +4556,37 @@ var useHudMotion = () => {
4500
4556
  };
4501
4557
  }, [adapter]);
4502
4558
  };
4559
+
4560
+ // src/hooks/useBodyScrollLock.ts
4561
+ import { useEffect as useEffect19 } from "react";
4562
+ var lockCount2 = 0;
4563
+ var previousOverflow2 = null;
4564
+ var acquireLock = () => {
4565
+ if (!isBrowser) return;
4566
+ if (lockCount2 === 0) {
4567
+ previousOverflow2 = document.body.style.overflow;
4568
+ document.body.style.overflow = "hidden";
4569
+ }
4570
+ lockCount2 += 1;
4571
+ };
4572
+ var releaseLock = () => {
4573
+ if (!isBrowser) return;
4574
+ if (lockCount2 === 0) return;
4575
+ lockCount2 -= 1;
4576
+ if (lockCount2 === 0) {
4577
+ document.body.style.overflow = previousOverflow2 ?? "";
4578
+ previousOverflow2 = null;
4579
+ }
4580
+ };
4581
+ var useBodyScrollLock = (enabled) => {
4582
+ useEffect19(() => {
4583
+ if (!enabled) return;
4584
+ acquireLock();
4585
+ return () => {
4586
+ releaseLock();
4587
+ };
4588
+ }, [enabled]);
4589
+ };
4503
4590
  export {
4504
4591
  AnimationAdapterProvider,
4505
4592
  DialogRegistryProvider,
@@ -4518,6 +4605,7 @@ export {
4518
4605
  useAdvanceRules,
4519
4606
  useAnimationAdapter,
4520
4607
  useBodyScrollLock,
4608
+ useConstrainedScrollLock,
4521
4609
  useDelayAdvance,
4522
4610
  useDialogRegistry,
4523
4611
  useDialogRegistryOptional,
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkD5LQLRSUcjs = require('../chunk-D5LQLRSU.cjs');
9
+ var _chunk7SAJNRGZcjs = require('../chunk-7SAJNRGZ.cjs');
10
10
 
11
11
 
12
12
 
@@ -14,4 +14,4 @@ var _chunkD5LQLRSUcjs = require('../chunk-D5LQLRSU.cjs');
14
14
 
15
15
 
16
16
 
17
- exports.createPathString = _chunkD5LQLRSUcjs.createPathString; exports.getCurrentRoutePath = _chunkD5LQLRSUcjs.getCurrentRoutePath; exports.matchRoute = _chunkD5LQLRSUcjs.matchRoute; exports.notifyRouteChange = _chunkD5LQLRSUcjs.notifyRouteChange; exports.routeGatingChannel = _chunkD5LQLRSUcjs.routeGatingChannel; exports.subscribeToRouteChanges = _chunkD5LQLRSUcjs.subscribeToRouteChanges;
17
+ exports.createPathString = _chunk7SAJNRGZcjs.createPathString; exports.getCurrentRoutePath = _chunk7SAJNRGZcjs.getCurrentRoutePath; exports.matchRoute = _chunk7SAJNRGZcjs.matchRoute; exports.notifyRouteChange = _chunk7SAJNRGZcjs.notifyRouteChange; exports.routeGatingChannel = _chunk7SAJNRGZcjs.routeGatingChannel; exports.subscribeToRouteChanges = _chunk7SAJNRGZcjs.subscribeToRouteChanges;
@@ -6,7 +6,7 @@ import {
6
6
  notifyRouteChange,
7
7
  routeGatingChannel,
8
8
  subscribeToRouteChanges
9
- } from "../chunk-B44EX7YT.mjs";
9
+ } from "../chunk-J2JMZXGD.mjs";
10
10
  export {
11
11
  createPathString,
12
12
  getCurrentRoutePath,
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunkD5LQLRSUcjs = require('../chunk-D5LQLRSU.cjs');
4
+ var _chunk7SAJNRGZcjs = require('../chunk-7SAJNRGZ.cjs');
5
5
 
6
6
  // src/router/nextAppRouterAdapter.tsx
7
7
  var _navigation = require('next/navigation'); var NextNavigation = _interopRequireWildcard(_navigation);
@@ -22,12 +22,12 @@ var useNextAppRouterTourAdapter = () => {
22
22
  const searchValue = _nullishCoalesce(_optionalChain([searchParams, 'optionalAccess', _ => _.toString, 'call', _2 => _2()]), () => ( ""));
23
23
  _react.useEffect.call(void 0, () => {
24
24
  if (typeof pathname !== "string") return;
25
- const path = _chunkD5LQLRSUcjs.createPathString.call(void 0,
25
+ const path = _chunk7SAJNRGZcjs.createPathString.call(void 0,
26
26
  pathname,
27
27
  searchValue.length > 0 ? `?${searchValue}` : "",
28
28
  void 0
29
29
  );
30
- _chunkD5LQLRSUcjs.notifyRouteChange.call(void 0, path);
30
+ _chunk7SAJNRGZcjs.notifyRouteChange.call(void 0, path);
31
31
  }, [pathname, searchValue]);
32
32
  };
33
33
 
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createPathString,
3
3
  notifyRouteChange
4
- } from "../chunk-B44EX7YT.mjs";
4
+ } from "../chunk-J2JMZXGD.mjs";
5
5
 
6
6
  // src/router/nextAppRouterAdapter.tsx
7
7
  import * as NextNavigation from "next/navigation";
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
3
 
4
- var _chunkD5LQLRSUcjs = require('../chunk-D5LQLRSU.cjs');
4
+ var _chunk7SAJNRGZcjs = require('../chunk-7SAJNRGZ.cjs');
5
5
 
6
6
  // src/router/nextPagesRouterAdapter.tsx
7
7
  var _router = require('next/router'); var NextRouter = _interopRequireWildcard(_router);
@@ -19,8 +19,8 @@ var useNextPagesRouterTourAdapter = () => {
19
19
  const router = useRouter2();
20
20
  const pathCandidate = typeof router.asPath === "string" && router.asPath.length > 0 ? router.asPath : router.pathname;
21
21
  _react.useEffect.call(void 0, () => {
22
- const path = typeof pathCandidate === "string" && pathCandidate.length > 0 ? pathCandidate : _chunkD5LQLRSUcjs.createPathString.call(void 0, _nullishCoalesce(router.pathname, () => ( "/")));
23
- _chunkD5LQLRSUcjs.notifyRouteChange.call(void 0, path);
22
+ const path = typeof pathCandidate === "string" && pathCandidate.length > 0 ? pathCandidate : _chunk7SAJNRGZcjs.createPathString.call(void 0, _nullishCoalesce(router.pathname, () => ( "/")));
23
+ _chunk7SAJNRGZcjs.notifyRouteChange.call(void 0, path);
24
24
  }, [pathCandidate, router.pathname]);
25
25
  };
26
26
 
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createPathString,
3
3
  notifyRouteChange
4
- } from "../chunk-B44EX7YT.mjs";
4
+ } from "../chunk-J2JMZXGD.mjs";
5
5
 
6
6
  // src/router/nextPagesRouterAdapter.tsx
7
7
  import * as NextRouter from "next/router";
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
2
2
 
3
3
 
4
- var _chunkD5LQLRSUcjs = require('../chunk-D5LQLRSU.cjs');
4
+ var _chunk7SAJNRGZcjs = require('../chunk-7SAJNRGZ.cjs');
5
5
 
6
6
  // src/router/reactRouterAdapter.tsx
7
7
  var _react = require('react');
@@ -18,12 +18,12 @@ var useReactRouterTourAdapter = () => {
18
18
  }
19
19
  const location = useLocation2();
20
20
  _react.useEffect.call(void 0, () => {
21
- const path = _chunkD5LQLRSUcjs.createPathString.call(void 0,
21
+ const path = _chunk7SAJNRGZcjs.createPathString.call(void 0,
22
22
  location.pathname,
23
23
  location.search,
24
24
  location.hash
25
25
  );
26
- _chunkD5LQLRSUcjs.notifyRouteChange.call(void 0, path);
26
+ _chunk7SAJNRGZcjs.notifyRouteChange.call(void 0, path);
27
27
  }, [location.pathname, location.search, location.hash]);
28
28
  };
29
29
 
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createPathString,
3
3
  notifyRouteChange
4
- } from "../chunk-B44EX7YT.mjs";
4
+ } from "../chunk-J2JMZXGD.mjs";
5
5
 
6
6
  // src/router/reactRouterAdapter.tsx
7
7
  import { useEffect } from "react";
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunkD5LQLRSUcjs = require('../chunk-D5LQLRSU.cjs');
4
+ var _chunk7SAJNRGZcjs = require('../chunk-7SAJNRGZ.cjs');
5
5
 
6
6
  // src/router/tanstackRouterAdapter.tsx
7
7
  var _reactrouter = require('@tanstack/react-router'); var TanStackRouter = _interopRequireWildcard(_reactrouter);
@@ -55,8 +55,8 @@ var useTanStackRouterTourAdapter = () => {
55
55
  const resolvedPathname = typeof location.pathname === "string" && location.pathname.length > 0 ? location.pathname : "/";
56
56
  const resolvedSearch = "searchStr" in location && typeof location.searchStr === "string" ? location.searchStr : typeof location.search === "string" ? location.search : "";
57
57
  const resolvedHash = typeof location.hash === "string" ? location.hash : "";
58
- const path = typeof location.href === "string" && location.href.length > 0 ? location.href : _chunkD5LQLRSUcjs.createPathString.call(void 0, resolvedPathname, resolvedSearch, resolvedHash);
59
- _chunkD5LQLRSUcjs.notifyRouteChange.call(void 0, path);
58
+ const path = typeof location.href === "string" && location.href.length > 0 ? location.href : _chunk7SAJNRGZcjs.createPathString.call(void 0, resolvedPathname, resolvedSearch, resolvedHash);
59
+ _chunk7SAJNRGZcjs.notifyRouteChange.call(void 0, path);
60
60
  }, [location]);
61
61
  };
62
62
 
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createPathString,
3
3
  notifyRouteChange
4
- } from "../chunk-B44EX7YT.mjs";
4
+ } from "../chunk-J2JMZXGD.mjs";
5
5
 
6
6
  // src/router/tanstackRouterAdapter.tsx
7
7
  import { useRouterState } from "@tanstack/react-router";
@@ -1 +1 @@
1
- {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/utils/dom.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,SAC4C,CAAA;AAElE,KAAK,QAAQ,GAAG;IACd,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG;IACtC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,+BAKxB,QAAQ,KAAG,cAOZ,CAAA;AAEF,eAAO,MAAM,YAAY,GAAI,MAAM,OAAO,GAAG,eAAe,KAAG,cAM3D,CAAA;AAEJ,eAAO,MAAM,eAAe,QAAO,cAgBlC,CAAA;AAED,eAAO,MAAM,UAAU,GACrB,MAAM,cAAc,EACpB,SAAS,MAAM,KACd,cAqBF,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,MAAM,cAAc,EAAE,eAAU,YAUhE,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,SAAS,OAAO,KAAG,cACF,CAAA;AAe/C,eAAO,MAAM,gBAAgB,GAAI,SAAS,OAAO,KAAG,KAAK,CAAC,OAAO,CA4BhE,CAAA;AAED,eAAO,MAAM,UAAU,0BAA2C,CAAA;AA4BlE,eAAO,MAAM,eAAe,eAM3B,CAAA"}
1
+ {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/utils/dom.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,SAC4C,CAAA;AAElE,KAAK,QAAQ,GAAG;IACd,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG;IACtC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,+BAKxB,QAAQ,KAAG,cAOZ,CAAA;AAEF,eAAO,MAAM,YAAY,GAAI,MAAM,OAAO,GAAG,eAAe,KAAG,cAM3D,CAAA;AAEJ,eAAO,MAAM,eAAe,QAAO,cAgBlC,CAAA;AAED,eAAO,MAAM,UAAU,GACrB,MAAM,cAAc,EACpB,SAAS,MAAM,KACd,cAsBF,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,MAAM,cAAc,EAAE,eAAU,YAUhE,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,SAAS,OAAO,KAAG,cACF,CAAA;AAe/C,eAAO,MAAM,gBAAgB,GAAI,SAAS,OAAO,KAAG,KAAK,CAAC,OAAO,CA4BhE,CAAA;AAED,eAAO,MAAM,UAAU,0BAA2C,CAAA;AA4BlE,eAAO,MAAM,eAAe,eAM3B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowsterix/react",
3
- "version": "0.12.1",
3
+ "version": "0.14.0",
4
4
  "description": "React bindings for Flowsterix - guided tours and onboarding flows",
5
5
  "license": "MIT",
6
6
  "repository": {