@butternutbox/pawprint-native 1.5.1 → 1.6.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.d.cts CHANGED
@@ -941,6 +941,14 @@ type DrawerRootOwnProps = {
941
941
  open?: boolean;
942
942
  defaultOpen?: boolean;
943
943
  onOpenChange?: (open: boolean) => void;
944
+ /**
945
+ * Called once the drawer has fully closed: the exit animation has finished
946
+ * and the native `Modal` has been removed. Use it to chain work that can't
947
+ * overlap the drawer, such as opening another modal drawer (iOS won't present
948
+ * a second `Modal` while the first is still on screen) or unmounting the
949
+ * drawer's host.
950
+ */
951
+ onExitComplete?: () => void;
944
952
  /**
945
953
  * Whether the drawer shows a dimming backdrop and presents as a blocking
946
954
  * modal (default `true`). Set to `false` for a backdrop-less, pass-through
package/dist/index.d.ts CHANGED
@@ -941,6 +941,14 @@ type DrawerRootOwnProps = {
941
941
  open?: boolean;
942
942
  defaultOpen?: boolean;
943
943
  onOpenChange?: (open: boolean) => void;
944
+ /**
945
+ * Called once the drawer has fully closed: the exit animation has finished
946
+ * and the native `Modal` has been removed. Use it to chain work that can't
947
+ * overlap the drawer, such as opening another modal drawer (iOS won't present
948
+ * a second `Modal` while the first is still on screen) or unmounting the
949
+ * drawer's host.
950
+ */
951
+ onExitComplete?: () => void;
944
952
  /**
945
953
  * Whether the drawer shows a dimming backdrop and presents as a blocking
946
954
  * modal (default `true`). Set to `false` for a backdrop-less, pass-through
package/dist/index.js CHANGED
@@ -6409,6 +6409,7 @@ var DrawerRoot = React66.forwardRef(
6409
6409
  open: controlledOpen,
6410
6410
  defaultOpen = false,
6411
6411
  onOpenChange,
6412
+ onExitComplete,
6412
6413
  backdrop = true,
6413
6414
  children,
6414
6415
  style,
@@ -6417,6 +6418,7 @@ var DrawerRoot = React66.forwardRef(
6417
6418
  "open",
6418
6419
  "defaultOpen",
6419
6420
  "onOpenChange",
6421
+ "onExitComplete",
6420
6422
  "backdrop",
6421
6423
  "children",
6422
6424
  "style",
@@ -6439,9 +6441,19 @@ var DrawerRoot = React66.forwardRef(
6439
6441
  if (!isControlled.current) setInternalOpen(false);
6440
6442
  onOpenChange == null ? void 0 : onOpenChange(false);
6441
6443
  }, [onOpenChange]);
6442
- const onExitComplete = useCallback(() => {
6444
+ const handleExitComplete = useCallback(() => {
6443
6445
  setModalVisible(false);
6444
6446
  }, []);
6447
+ const onExitCompleteRef = useRef(onExitComplete);
6448
+ onExitCompleteRef.current = onExitComplete;
6449
+ const wasModalVisible = useRef(modalVisible);
6450
+ useEffect(() => {
6451
+ var _a2;
6452
+ if (wasModalVisible.current && !modalVisible) {
6453
+ (_a2 = onExitCompleteRef.current) == null ? void 0 : _a2.call(onExitCompleteRef);
6454
+ }
6455
+ wasModalVisible.current = modalVisible;
6456
+ }, [modalVisible]);
6445
6457
  const ctx = useMemo(
6446
6458
  () => ({
6447
6459
  isOpen,
@@ -6449,9 +6461,16 @@ var DrawerRoot = React66.forwardRef(
6449
6461
  backdrop,
6450
6462
  openDrawer,
6451
6463
  closeDrawer,
6452
- onExitComplete
6464
+ onExitComplete: handleExitComplete
6453
6465
  }),
6454
- [isOpen, modalVisible, backdrop, openDrawer, closeDrawer, onExitComplete]
6466
+ [
6467
+ isOpen,
6468
+ modalVisible,
6469
+ backdrop,
6470
+ openDrawer,
6471
+ closeDrawer,
6472
+ handleExitComplete
6473
+ ]
6455
6474
  );
6456
6475
  return /* @__PURE__ */ jsx(DrawerContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx(
6457
6476
  View,