@overmap-ai/blocks 1.0.40-slide-out-resize-handle.0 → 1.0.40-slide-out-resize-handle.1
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/SlideOut/Content.d.ts +0 -1
- package/dist/SlideOut/Root.d.ts +1 -0
- package/dist/SlideOut/context.d.ts +1 -0
- package/dist/blocks.js +33 -13
- package/dist/blocks.js.map +1 -1
- package/dist/blocks.umd.cjs +33 -13
- package/dist/blocks.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/blocks.umd.cjs
CHANGED
|
@@ -2342,9 +2342,9 @@
|
|
|
2342
2342
|
}, []);
|
|
2343
2343
|
}
|
|
2344
2344
|
const SlideOutContent = react.memo((props) => {
|
|
2345
|
-
const { ref, children, style, side, type, resizeable = false, initialSize, minSize, maxSize,
|
|
2345
|
+
const { ref, children, style, side, type, resizeable = false, initialSize, minSize, maxSize, ...rest } = props;
|
|
2346
2346
|
const internalRef = react.useRef(null);
|
|
2347
|
-
const { open, setOpen, parentElement, modal } = react.use(SlideOutRootContext);
|
|
2347
|
+
const { open, setOpen, parentElement, modal, hide } = react.use(SlideOutRootContext);
|
|
2348
2348
|
const [computedSize, setComputedSize] = react.useState(null);
|
|
2349
2349
|
const handleClose = react.useCallback(() => {
|
|
2350
2350
|
if (modal) setOpen(false);
|
|
@@ -2574,12 +2574,21 @@
|
|
|
2574
2574
|
SlideOutHandle.displayName = "SlideOutHandle";
|
|
2575
2575
|
const SlideOutOverlay = react.memo((props) => {
|
|
2576
2576
|
const { ref, ...rest } = props;
|
|
2577
|
-
const { open } = react.use(SlideOutRootContext);
|
|
2578
|
-
return open ? /* @__PURE__ */ jsxRuntime.jsx("div", { ref, "data-open": open, ...rest }) : null;
|
|
2577
|
+
const { open, hide } = react.use(SlideOutRootContext);
|
|
2578
|
+
return open && !hide ? /* @__PURE__ */ jsxRuntime.jsx("div", { ref, "data-open": open, ...rest }) : null;
|
|
2579
2579
|
});
|
|
2580
2580
|
SlideOutOverlay.displayName = "SlideOutOverlay";
|
|
2581
2581
|
const SlideOutRoot = react.memo((props) => {
|
|
2582
|
-
const {
|
|
2582
|
+
const {
|
|
2583
|
+
ref,
|
|
2584
|
+
children,
|
|
2585
|
+
defaultOpen = false,
|
|
2586
|
+
open: controlledOpen,
|
|
2587
|
+
onOpenChange,
|
|
2588
|
+
modal = false,
|
|
2589
|
+
hide = false,
|
|
2590
|
+
...rest
|
|
2591
|
+
} = props;
|
|
2583
2592
|
const [parentElement, setParentElement] = react.useState(null);
|
|
2584
2593
|
const [open, setOpen] = useControlledState(defaultOpen, controlledOpen, onOpenChange);
|
|
2585
2594
|
const contextValue = react.useMemo(
|
|
@@ -2587,9 +2596,10 @@
|
|
|
2587
2596
|
parentElement,
|
|
2588
2597
|
open,
|
|
2589
2598
|
setOpen,
|
|
2590
|
-
modal
|
|
2599
|
+
modal,
|
|
2600
|
+
hide
|
|
2591
2601
|
}),
|
|
2592
|
-
[modal, open, parentElement, setOpen]
|
|
2602
|
+
[hide, modal, open, parentElement, setOpen]
|
|
2593
2603
|
);
|
|
2594
2604
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: mergeRefs([ref, setParentElement]), ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(SlideOutRootContext, { value: contextValue, children }) });
|
|
2595
2605
|
});
|
|
@@ -2641,9 +2651,9 @@
|
|
|
2641
2651
|
});
|
|
2642
2652
|
LayoutSlideOutClose.displayName = "LayoutSlideOutClose";
|
|
2643
2653
|
const LayoutSlideOutContent = react.memo((props) => {
|
|
2644
|
-
const { ref, type,
|
|
2645
|
-
const { small
|
|
2646
|
-
return /* @__PURE__ */ jsxRuntime.jsx(SlideOutContent, { ref, type: type ?? (small ? "overlay" : "inline"),
|
|
2654
|
+
const { ref, type, ...rest } = props;
|
|
2655
|
+
const { small } = react.use(LayoutContext);
|
|
2656
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SlideOutContent, { ref, type: type ?? (small ? "overlay" : "inline"), ...rest });
|
|
2647
2657
|
});
|
|
2648
2658
|
LayoutSlideOutContent.displayName = "LayoutSlideOutContent";
|
|
2649
2659
|
const LayoutSlideOutHandle = react.memo((props) => {
|
|
@@ -2663,8 +2673,8 @@
|
|
|
2663
2673
|
});
|
|
2664
2674
|
LayoutSlideOutOverlay.displayName = "SlideOutOverlay";
|
|
2665
2675
|
const LayoutSlideOutRoot = react.memo((props) => {
|
|
2666
|
-
const { ref, slideOutId, defaultOpen, ...rest } = props;
|
|
2667
|
-
const { isOpen, setOpen, small } = react.use(LayoutContext);
|
|
2676
|
+
const { ref, slideOutId, defaultOpen, hide, ...rest } = props;
|
|
2677
|
+
const { isOpen, setOpen, small, hideLayout } = react.use(LayoutContext);
|
|
2668
2678
|
const open = isOpen(slideOutId);
|
|
2669
2679
|
const handleOpenChange = react.useCallback(
|
|
2670
2680
|
(open2) => {
|
|
@@ -2679,7 +2689,17 @@
|
|
|
2679
2689
|
setOpen(slideOutId, defaultOpen == null ? void 0 : defaultOpen.large);
|
|
2680
2690
|
}
|
|
2681
2691
|
}, [defaultOpen, slideOutId, setOpen, small]);
|
|
2682
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2692
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2693
|
+
SlideOutRoot,
|
|
2694
|
+
{
|
|
2695
|
+
ref,
|
|
2696
|
+
open,
|
|
2697
|
+
onOpenChange: handleOpenChange,
|
|
2698
|
+
modal: small,
|
|
2699
|
+
hide: hide ?? hideLayout,
|
|
2700
|
+
...rest
|
|
2701
|
+
}
|
|
2702
|
+
);
|
|
2683
2703
|
});
|
|
2684
2704
|
LayoutSlideOutRoot.displayName = "LayoutSlideOutRoot";
|
|
2685
2705
|
const LayoutSlideOutTrigger = react.memo((props) => {
|