@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.
@@ -7,12 +7,12 @@
7
7
  CJS Build start
8
8
  ESM Build start
9
9
  DTS Build start
10
- ESM dist/index.js 541.22 KB
10
+ ESM dist/index.js 541.75 KB
11
11
  ESM dist/index.js.map 1.12 MB
12
- ESM ⚡️ Build success in 7846ms
13
- CJS dist/index.cjs 573.11 KB
14
- CJS dist/index.cjs.map 1.12 MB
15
- CJS ⚡️ Build success in 7847ms
16
- DTS ⚡️ Build success in 21839ms
17
- DTS dist/index.d.cts 114.50 KB
18
- DTS dist/index.d.ts 114.50 KB
12
+ ESM ⚡️ Build success in 7672ms
13
+ CJS dist/index.cjs 573.67 KB
14
+ CJS dist/index.cjs.map 1.13 MB
15
+ CJS ⚡️ Build success in 7672ms
16
+ DTS ⚡️ Build success in 20962ms
17
+ DTS dist/index.d.cts 114.88 KB
18
+ DTS dist/index.d.ts 114.88 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @butternutbox/pawprint-native
2
2
 
3
+ ## 1.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 061597a: Add `onExitComplete` to `Drawer.Root`, called once the drawer has fully closed (exit animation finished and native `Modal` removed), so consumers can chain another modal drawer or unmount the drawer's host without racing the exit.
8
+
3
9
  ## 1.5.1
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -6440,6 +6440,7 @@ var DrawerRoot = React66__default.default.forwardRef(
6440
6440
  open: controlledOpen,
6441
6441
  defaultOpen = false,
6442
6442
  onOpenChange,
6443
+ onExitComplete,
6443
6444
  backdrop = true,
6444
6445
  children,
6445
6446
  style,
@@ -6448,6 +6449,7 @@ var DrawerRoot = React66__default.default.forwardRef(
6448
6449
  "open",
6449
6450
  "defaultOpen",
6450
6451
  "onOpenChange",
6452
+ "onExitComplete",
6451
6453
  "backdrop",
6452
6454
  "children",
6453
6455
  "style",
@@ -6470,9 +6472,19 @@ var DrawerRoot = React66__default.default.forwardRef(
6470
6472
  if (!isControlled.current) setInternalOpen(false);
6471
6473
  onOpenChange == null ? void 0 : onOpenChange(false);
6472
6474
  }, [onOpenChange]);
6473
- const onExitComplete = React66.useCallback(() => {
6475
+ const handleExitComplete = React66.useCallback(() => {
6474
6476
  setModalVisible(false);
6475
6477
  }, []);
6478
+ const onExitCompleteRef = React66.useRef(onExitComplete);
6479
+ onExitCompleteRef.current = onExitComplete;
6480
+ const wasModalVisible = React66.useRef(modalVisible);
6481
+ React66.useEffect(() => {
6482
+ var _a2;
6483
+ if (wasModalVisible.current && !modalVisible) {
6484
+ (_a2 = onExitCompleteRef.current) == null ? void 0 : _a2.call(onExitCompleteRef);
6485
+ }
6486
+ wasModalVisible.current = modalVisible;
6487
+ }, [modalVisible]);
6476
6488
  const ctx = React66.useMemo(
6477
6489
  () => ({
6478
6490
  isOpen,
@@ -6480,9 +6492,16 @@ var DrawerRoot = React66__default.default.forwardRef(
6480
6492
  backdrop,
6481
6493
  openDrawer,
6482
6494
  closeDrawer,
6483
- onExitComplete
6495
+ onExitComplete: handleExitComplete
6484
6496
  }),
6485
- [isOpen, modalVisible, backdrop, openDrawer, closeDrawer, onExitComplete]
6497
+ [
6498
+ isOpen,
6499
+ modalVisible,
6500
+ backdrop,
6501
+ openDrawer,
6502
+ closeDrawer,
6503
+ handleExitComplete
6504
+ ]
6486
6505
  );
6487
6506
  return /* @__PURE__ */ jsxRuntime.jsx(DrawerContext.Provider, { value: ctx, children: /* @__PURE__ */ jsxRuntime.jsx(
6488
6507
  reactNative.View,