react-panel-layout 0.6.0 → 0.6.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/{FloatingPanelFrame-SgYLc6Ud.js → FloatingPanelFrame-3eU9AwPo.js} +2 -2
- package/dist/{FloatingPanelFrame-SgYLc6Ud.js.map → FloatingPanelFrame-3eU9AwPo.js.map} +1 -1
- package/dist/FloatingWindow-CUXnEtrb.js +827 -0
- package/dist/FloatingWindow-CUXnEtrb.js.map +1 -0
- package/dist/FloatingWindow-DMwyK0eK.cjs +2 -0
- package/dist/FloatingWindow-DMwyK0eK.cjs.map +1 -0
- package/dist/GridLayout-DKTg_N61.cjs +2 -0
- package/dist/{GridLayout-B4VRsC0r.cjs.map → GridLayout-DKTg_N61.cjs.map} +1 -1
- package/dist/{GridLayout-BltqeCPK.js → GridLayout-UWNxXw77.js} +34 -35
- package/dist/{GridLayout-BltqeCPK.js.map → GridLayout-UWNxXw77.js.map} +1 -1
- package/dist/{HorizontalDivider-WF1k_qND.js → HorizontalDivider-DdxzfV0l.js} +3 -3
- package/dist/{HorizontalDivider-WF1k_qND.js.map → HorizontalDivider-DdxzfV0l.js.map} +1 -1
- package/dist/{HorizontalDivider-B5Z-KZLk.cjs → HorizontalDivider-_pgV4Mcv.cjs} +2 -2
- package/dist/{HorizontalDivider-B5Z-KZLk.cjs.map → HorizontalDivider-_pgV4Mcv.cjs.map} +1 -1
- package/dist/{PanelSystem-Dr1TBhxM.js → PanelSystem-BqUzNtf2.js} +5 -5
- package/dist/{PanelSystem-Dr1TBhxM.js.map → PanelSystem-BqUzNtf2.js.map} +1 -1
- package/dist/{PanelSystem-Bs8bQwQF.cjs → PanelSystem-D603LKKv.cjs} +2 -2
- package/dist/{PanelSystem-Bs8bQwQF.cjs.map → PanelSystem-D603LKKv.cjs.map} +1 -1
- package/dist/ResizeHandle-CBcAS918.cjs +2 -0
- package/dist/{ResizeHandle-CScipO5l.cjs.map → ResizeHandle-CBcAS918.cjs.map} +1 -1
- package/dist/{ResizeHandle-CdA_JYfN.js → ResizeHandle-CXjc1meV.js} +28 -29
- package/dist/{ResizeHandle-CdA_JYfN.js.map → ResizeHandle-CXjc1meV.js.map} +1 -1
- package/dist/SwipePivotTabBar-DWrCuwEI.js +411 -0
- package/dist/SwipePivotTabBar-DWrCuwEI.js.map +1 -0
- package/dist/SwipePivotTabBar-fjjXkpj7.cjs +2 -0
- package/dist/SwipePivotTabBar-fjjXkpj7.cjs.map +1 -0
- package/dist/components/gesture/SwipeSafeZone.d.ts +40 -0
- package/dist/components/window/Drawer.d.ts +3 -1
- package/dist/components/window/DrawerLayers.d.ts +1 -1
- package/dist/components/window/drawerStyles.d.ts +69 -0
- package/dist/components/window/drawerSwipeConfig.d.ts +29 -0
- package/dist/components/window/useDrawerSwipeTransform.d.ts +23 -0
- package/dist/config.cjs +1 -1
- package/dist/config.js +3 -3
- package/dist/constants/styles.d.ts +17 -0
- package/dist/dialog/index.d.ts +69 -0
- package/dist/floating.js +1 -1
- package/dist/grid.cjs +1 -1
- package/dist/grid.js +2 -2
- package/dist/hooks/gesture/testing/createGestureSimulator.d.ts +7 -0
- package/dist/hooks/gesture/types.d.ts +48 -5
- package/dist/hooks/gesture/utils.d.ts +19 -0
- package/dist/hooks/useAnimationFrame.d.ts +2 -0
- package/dist/hooks/useOperationContinuity.d.ts +64 -0
- package/dist/hooks/useResizeObserver.d.ts +33 -1
- package/dist/hooks/useSharedElementTransition.d.ts +112 -0
- package/dist/hooks/useSwipeContentTransform.d.ts +9 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +7 -7
- package/dist/modules/dialog/AlertDialog.d.ts +9 -0
- package/dist/modules/dialog/DialogContainer.d.ts +37 -0
- package/dist/modules/dialog/Modal.d.ts +26 -0
- package/dist/modules/dialog/SwipeDialogContainer.d.ts +16 -0
- package/dist/modules/dialog/dialogAnimationUtils.d.ts +113 -0
- package/dist/modules/dialog/types.d.ts +183 -0
- package/dist/modules/dialog/useDialog.d.ts +39 -0
- package/dist/modules/dialog/useDialogContainer.d.ts +47 -0
- package/dist/modules/dialog/useDialogSwipeInput.d.ts +70 -0
- package/dist/modules/dialog/useDialogTransform.d.ts +82 -0
- package/dist/modules/drawer/types.d.ts +74 -0
- package/dist/modules/drawer/useDrawerSwipeInput.d.ts +24 -0
- package/dist/modules/pivot/SwipePivotTabBar.d.ts +3 -0
- package/dist/modules/stack/SwipeStackContent.d.ts +6 -3
- package/dist/modules/stack/SwipeStackOutlet.d.ts +4 -4
- package/dist/modules/stack/computeSwipeStackTransform.d.ts +1 -1
- package/dist/panels.cjs +1 -1
- package/dist/panels.js +1 -1
- package/dist/pivot.cjs +1 -1
- package/dist/pivot.js +1 -1
- package/dist/resizer.cjs +1 -1
- package/dist/resizer.js +2 -2
- package/dist/stack.cjs +1 -1
- package/dist/stack.cjs.map +1 -1
- package/dist/stack.js +503 -762
- package/dist/stack.js.map +1 -1
- package/dist/sticky-header/calculateStickyMetrics.d.ts +28 -0
- package/dist/sticky-header.cjs +1 -1
- package/dist/sticky-header.cjs.map +1 -1
- package/dist/sticky-header.js +59 -51
- package/dist/sticky-header.js.map +1 -1
- package/dist/{styles-DPPuJ0sf.js → styles-NkjuMOVS.js} +13 -13
- package/dist/{styles-DPPuJ0sf.js.map → styles-NkjuMOVS.js.map} +1 -1
- package/dist/styles-qf6ptVLD.cjs.map +1 -1
- package/dist/types.d.ts +16 -0
- package/dist/useDocumentPointerEvents-DXxw3qWj.js +54 -0
- package/dist/useDocumentPointerEvents-DXxw3qWj.js.map +1 -0
- package/dist/useDocumentPointerEvents-DxDSOtip.cjs +2 -0
- package/dist/useDocumentPointerEvents-DxDSOtip.cjs.map +1 -0
- package/dist/useNativeGestureGuard-C7TSqEkr.cjs +2 -0
- package/dist/useNativeGestureGuard-C7TSqEkr.cjs.map +1 -0
- package/dist/useNativeGestureGuard-CGYo6O0r.js +347 -0
- package/dist/useNativeGestureGuard-CGYo6O0r.js.map +1 -0
- package/dist/window/index.d.ts +2 -0
- package/dist/window.cjs +1 -1
- package/dist/window.cjs.map +1 -1
- package/dist/window.js +114 -103
- package/dist/window.js.map +1 -1
- package/package.json +6 -1
- package/src/components/gesture/SwipeSafeZone.tsx +69 -0
- package/src/components/window/Drawer.tsx +249 -162
- package/src/components/window/DrawerLayers.tsx +13 -3
- package/src/components/window/drawerStyles.spec.ts +263 -0
- package/src/components/window/drawerStyles.ts +228 -0
- package/src/components/window/drawerSwipeConfig.spec.ts +131 -0
- package/src/components/window/drawerSwipeConfig.ts +112 -0
- package/src/components/window/useDrawerSwipeTransform.spec.ts +234 -0
- package/src/components/window/useDrawerSwipeTransform.ts +129 -0
- package/src/constants/styles.ts +19 -0
- package/src/demo/pages/Dialog/alerts/index.tsx +22 -0
- package/src/demo/pages/Dialog/card/index.tsx +22 -0
- package/src/demo/pages/Dialog/components/AlertDialogDemo.tsx +124 -0
- package/src/demo/pages/Dialog/components/CardExpandDemo.module.css +243 -0
- package/src/demo/pages/Dialog/components/CardExpandDemo.tsx +204 -0
- package/src/demo/pages/Dialog/components/CustomAlertDialogDemo.tsx +219 -0
- package/src/demo/pages/Dialog/components/DialogDemos.module.css +77 -0
- package/src/demo/pages/Dialog/components/ModalBasics.tsx +45 -0
- package/src/demo/pages/Dialog/components/SwipeDialogDemo.module.css +77 -0
- package/src/demo/pages/Dialog/components/SwipeDialogDemo.tsx +181 -0
- package/src/demo/pages/Dialog/custom-alert/index.tsx +22 -0
- package/src/demo/pages/Dialog/modal/index.tsx +17 -0
- package/src/demo/pages/Dialog/swipe/index.tsx +22 -0
- package/src/demo/pages/Drawer/components/DrawerSwipe.module.css +316 -0
- package/src/demo/pages/Drawer/components/DrawerSwipe.tsx +178 -0
- package/src/demo/pages/Drawer/swipe/index.tsx +17 -0
- package/src/demo/pages/Pivot/components/SwipeTabsPivot.tsx +54 -23
- package/src/demo/pages/Pivot/swipe-debug/index.tsx +1 -1
- package/src/demo/pages/Stack/components/StackBasics.spec.tsx +152 -0
- package/src/demo/pages/Stack/components/StackBasics.tsx +179 -95
- package/src/demo/pages/Stack/components/StackTablet.spec.tsx +120 -0
- package/src/demo/pages/Stack/components/StackTablet.tsx +42 -21
- package/src/demo/routes.tsx +22 -1
- package/src/dialog/index.ts +85 -0
- package/src/hooks/gesture/testing/createGestureSimulator.spec.ts +68 -64
- package/src/hooks/gesture/testing/createGestureSimulator.ts +112 -37
- package/src/hooks/gesture/types.ts +83 -6
- package/src/hooks/gesture/useEdgeSwipeInput.spec.ts +22 -14
- package/src/hooks/gesture/useNativeGestureGuard.spec.ts +91 -31
- package/src/hooks/gesture/useNativeGestureGuard.ts +3 -1
- package/src/hooks/gesture/utils.ts +91 -0
- package/src/hooks/useAnimatedVisibility.spec.ts +44 -24
- package/src/hooks/useAnimatedVisibility.ts +28 -2
- package/src/hooks/useAnimationFrame.ts +8 -0
- package/src/hooks/useOperationContinuity.spec.ts +387 -0
- package/src/hooks/useOperationContinuity.ts +135 -0
- package/src/hooks/useResizeObserver.spec.tsx +277 -0
- package/src/hooks/useResizeObserver.tsx +108 -39
- package/src/hooks/useScrollContainer.ts +4 -10
- package/src/hooks/useSharedElementTransition.ts +333 -0
- package/src/hooks/useSwipeContentTransform.spec.ts +18 -18
- package/src/hooks/useSwipeContentTransform.ts +166 -28
- package/src/modules/dialog/AlertDialog.spec.tsx +387 -0
- package/src/modules/dialog/AlertDialog.tsx +221 -0
- package/src/modules/dialog/DialogContainer.spec.tsx +228 -0
- package/src/modules/dialog/DialogContainer.tsx +188 -0
- package/src/modules/dialog/Modal.spec.tsx +220 -0
- package/src/modules/dialog/Modal.tsx +182 -0
- package/src/modules/dialog/SwipeDialogContainer.tsx +208 -0
- package/src/modules/dialog/dialogAnimationUtils.spec.ts +253 -0
- package/src/modules/dialog/dialogAnimationUtils.ts +297 -0
- package/src/modules/dialog/types.ts +186 -0
- package/src/modules/dialog/useDialog.spec.tsx +447 -0
- package/src/modules/dialog/useDialog.ts +214 -0
- package/src/modules/dialog/useDialogContainer.spec.ts +331 -0
- package/src/modules/dialog/useDialogContainer.ts +150 -0
- package/src/modules/dialog/useDialogSwipeInput.spec.ts +157 -0
- package/src/modules/dialog/useDialogSwipeInput.ts +319 -0
- package/src/modules/dialog/useDialogTransform.spec.ts +370 -0
- package/src/modules/dialog/useDialogTransform.ts +407 -0
- package/src/modules/drawer/types.ts +102 -0
- package/src/modules/drawer/useDrawerSwipeInput.spec.ts +566 -0
- package/src/modules/drawer/useDrawerSwipeInput.ts +399 -0
- package/src/modules/panels/rendering/ContentRegistry.spec.tsx +21 -14
- package/src/modules/pivot/SwipePivotContent.position.spec.tsx +12 -8
- package/src/modules/pivot/SwipePivotContent.spec.tsx +55 -25
- package/src/modules/pivot/SwipePivotContent.tsx +2 -2
- package/src/modules/pivot/SwipePivotTabBar.spec.tsx +85 -68
- package/src/modules/pivot/SwipePivotTabBar.tsx +75 -15
- package/src/modules/pivot/scaleInputState.spec.ts +11 -2
- package/src/modules/pivot/usePivot.spec.ts +17 -3
- package/src/modules/pivot/usePivotSwipeInput.spec.ts +182 -123
- package/src/modules/stack/SwipeStackContent.spec.tsx +387 -100
- package/src/modules/stack/SwipeStackContent.tsx +43 -33
- package/src/modules/stack/SwipeStackOutlet.spec.tsx +14 -16
- package/src/modules/stack/SwipeStackOutlet.tsx +6 -6
- package/src/modules/stack/computeSwipeStackTransform.spec.ts +5 -5
- package/src/modules/stack/computeSwipeStackTransform.ts +3 -3
- package/src/modules/stack/swipeTransitionContinuity.spec.tsx +1133 -0
- package/src/modules/stack/useStackAnimationState.spec.ts +3 -1
- package/src/modules/stack/useStackAnimationState.ts +18 -13
- package/src/modules/stack/useStackNavigation.spec.ts +198 -3
- package/src/modules/stack/useStackNavigation.tsx +113 -56
- package/src/modules/stack/useStackSwipeInput.spec.ts +65 -32
- package/src/modules/stack/useStackSwipeInput.ts +1 -1
- package/src/sticky-header/StickyArea.tsx +29 -57
- package/src/sticky-header/calculateStickyMetrics.spec.ts +105 -0
- package/src/sticky-header/calculateStickyMetrics.ts +50 -0
- package/src/types.ts +18 -0
- package/src/window/index.ts +2 -0
- package/dist/FloatingWindow-BpdOpg_L.js +0 -400
- package/dist/FloatingWindow-BpdOpg_L.js.map +0 -1
- package/dist/FloatingWindow-TCDNY5gE.cjs +0 -2
- package/dist/FloatingWindow-TCDNY5gE.cjs.map +0 -1
- package/dist/GridLayout-B4VRsC0r.cjs +0 -2
- package/dist/ResizeHandle-CScipO5l.cjs +0 -2
- package/dist/SwipePivotTabBar-BGO9X94m.js +0 -407
- package/dist/SwipePivotTabBar-BGO9X94m.js.map +0 -1
- package/dist/SwipePivotTabBar-BrQismcZ.cjs +0 -2
- package/dist/SwipePivotTabBar-BrQismcZ.cjs.map +0 -1
- package/dist/useDocumentPointerEvents-CKdhGXd0.js +0 -46
- package/dist/useDocumentPointerEvents-CKdhGXd0.js.map +0 -1
- package/dist/useDocumentPointerEvents-ChqrKXDk.cjs +0 -2
- package/dist/useDocumentPointerEvents-ChqrKXDk.cjs.map +0 -1
- package/dist/useEffectEvent-Dp7HLCf0.js +0 -13
- package/dist/useEffectEvent-Dp7HLCf0.js.map +0 -1
- package/dist/useEffectEvent-huSsGUnl.cjs +0 -2
- package/dist/useEffectEvent-huSsGUnl.cjs.map +0 -1
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx as w, Fragment as Z, jsxs as K } from "react/jsx-runtime";
|
|
2
2
|
import * as d from "react";
|
|
3
|
-
import { e as zt, F as Tt, u as wt, L as Mt, P as Pt, f as xt, G as kt, b as Ht } from "./FloatingWindow-
|
|
4
|
-
import { G as $,
|
|
5
|
-
import { u as Nt } from "./SwipePivotTabBar-
|
|
6
|
-
import { R as
|
|
3
|
+
import { e as zt, F as Tt, u as wt, L as Mt, P as Pt, f as xt, G as kt, b as Ht } from "./FloatingWindow-CUXnEtrb.js";
|
|
4
|
+
import { G as $, v as L, w as j } from "./styles-NkjuMOVS.js";
|
|
5
|
+
import { u as Nt } from "./SwipePivotTabBar-DWrCuwEI.js";
|
|
6
|
+
import { R as Dt } from "./ResizeHandle-CXjc1meV.js";
|
|
7
7
|
import { u as St } from "./useIsomorphicLayoutEffect-DhmEnmZ_.js";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
const Dt = () => {
|
|
8
|
+
import { u as st, b as it } from "./useDocumentPointerEvents-DXxw3qWj.js";
|
|
9
|
+
const Gt = () => {
|
|
11
10
|
const t = /* @__PURE__ */ new Map();
|
|
12
11
|
return (e) => {
|
|
13
12
|
if (!e)
|
|
@@ -18,8 +17,8 @@ const Dt = () => {
|
|
|
18
17
|
const r = t.size;
|
|
19
18
|
return t.set(e, r), r;
|
|
20
19
|
};
|
|
21
|
-
},
|
|
22
|
-
const e = `ovs-threshold:${t.threshold}-rootMargin:${t.rootMargin}-root:${
|
|
20
|
+
}, At = Gt(), V = /* @__PURE__ */ new Map(), $t = (t) => {
|
|
21
|
+
const e = `ovs-threshold:${t.threshold}-rootMargin:${t.rootMargin}-root:${At(t.root)}`;
|
|
23
22
|
if (V.has(e))
|
|
24
23
|
return V.get(e);
|
|
25
24
|
const n = new class {
|
|
@@ -267,7 +266,7 @@ const Ut = ({ layers: t }) => {
|
|
|
267
266
|
...n === "start" ? { top: -g } : { bottom: -g }
|
|
268
267
|
};
|
|
269
268
|
}, [n, t, r]);
|
|
270
|
-
return /* @__PURE__ */ w("div", { "data-resizable": "true", style: { ...u, position: "relative", pointerEvents: "none" }, children: /* @__PURE__ */ w("div", { "data-direction": a, "data-align": n, "data-handle": "true", style: p, children: /* @__PURE__ */ w(
|
|
269
|
+
return /* @__PURE__ */ w("div", { "data-resizable": "true", style: { ...u, position: "relative", pointerEvents: "none" }, children: /* @__PURE__ */ w("div", { "data-direction": a, "data-align": n, "data-handle": "true", style: p, children: /* @__PURE__ */ w(Dt, { direction: a, onResize: l }) }) });
|
|
271
270
|
}, Zt = (t) => {
|
|
272
271
|
const e = /* @__PURE__ */ new Map();
|
|
273
272
|
t.forEach((r, o) => {
|
|
@@ -355,7 +354,7 @@ const Ut = ({ layers: t }) => {
|
|
|
355
354
|
return [];
|
|
356
355
|
const n = getComputedStyle(t);
|
|
357
356
|
return (e === "col" ? n.gridTemplateColumns : n.gridTemplateRows).split(/\s+/).map((o) => parseFloat(o)).filter((o) => !Number.isNaN(o));
|
|
358
|
-
}, yt = (t, e = Number.NEGATIVE_INFINITY, n = Number.POSITIVE_INFINITY) => Math.min(Math.max(t, e), n),
|
|
357
|
+
}, yt = (t, e = Number.NEGATIVE_INFINITY, n = Number.POSITIVE_INFINITY) => Math.min(Math.max(t, e), n), je = (t, e) => typeof t != "number" || !Number.isFinite(t) ? e : t, _ = (t, e) => `${t}-${e}`, ee = (t, e, n, r) => {
|
|
359
358
|
const o = _(n, r), s = e[o];
|
|
360
359
|
return s !== void 0 ? `minmax(${t.minSize ?? 0}px, ${s}px)` : t.size;
|
|
361
360
|
}, ut = (t, e, n) => t.map((r, o) => ee(r, e, n, o)).join(" "), F = (t, e) => t.reduce((n, r, o) => (r.resizable && r.size.endsWith("px") && (n[_(e, o)] = parseInt(r.size, 10)), n), {}), ne = ({
|
|
@@ -492,9 +491,9 @@ const Ut = ({ layers: t }) => {
|
|
|
492
491
|
containerRef: n,
|
|
493
492
|
gapSizes: a
|
|
494
493
|
}), x = _(g, b);
|
|
495
|
-
o((
|
|
494
|
+
o((D) => {
|
|
496
495
|
const y = M + v, I = se(y, R.minSize, P);
|
|
497
|
-
return { ...
|
|
496
|
+
return { ...D, [x]: I };
|
|
498
497
|
});
|
|
499
498
|
},
|
|
500
499
|
[t.columns, t.rows, r, n, a]
|
|
@@ -610,9 +609,9 @@ const Ut = ({ layers: t }) => {
|
|
|
610
609
|
layerById: e,
|
|
611
610
|
isRootLevel: n
|
|
612
611
|
}) => {
|
|
613
|
-
const [r, o] = d.useState(null), [s, a] = d.useState(null), [l, u] = d.useState({}), [p, f] = d.useState({}), g = d.useRef(null), b = d.useRef(null), v =
|
|
612
|
+
const [r, o] = d.useState(null), [s, a] = d.useState(null), [l, u] = d.useState({}), [p, f] = d.useState({}), g = d.useRef(null), b = d.useRef(null), v = st((c, i) => {
|
|
614
613
|
e.get(c)?.floating?.onMove?.(i);
|
|
615
|
-
}), E =
|
|
614
|
+
}), E = st((c, i) => {
|
|
616
615
|
e.get(c)?.floating?.onResize?.(i);
|
|
617
616
|
});
|
|
618
617
|
St(() => {
|
|
@@ -704,7 +703,7 @@ const Ut = ({ layers: t }) => {
|
|
|
704
703
|
}, a(c);
|
|
705
704
|
},
|
|
706
705
|
[e, l, p]
|
|
707
|
-
),
|
|
706
|
+
), D = d.useCallback(
|
|
708
707
|
(c) => {
|
|
709
708
|
const i = g.current;
|
|
710
709
|
if (!i)
|
|
@@ -724,22 +723,22 @@ const Ut = ({ layers: t }) => {
|
|
|
724
723
|
const i = b.current;
|
|
725
724
|
if (!i || i.pointerId !== c.pointerId || !e.get(i.layerId))
|
|
726
725
|
return;
|
|
727
|
-
const m = c.clientX - i.startX, z = c.clientY - i.startY, C = Ee(i.horizontalEdge, i.startWidth, m), S = ye(i.verticalEdge, i.startHeight, z), T = ft(C, i.minWidth, i.maxWidth), k = ft(S, i.minHeight, i.maxHeight),
|
|
726
|
+
const m = c.clientX - i.startX, z = c.clientY - i.startY, C = Ee(i.horizontalEdge, i.startWidth, m), S = ye(i.verticalEdge, i.startHeight, z), T = ft(C, i.minWidth, i.maxWidth), k = ft(S, i.minHeight, i.maxHeight), G = i.startWidth - T, B = i.startHeight - k, nt = Ie(
|
|
728
727
|
i.horizontalEdge,
|
|
729
728
|
i.startPosition.x,
|
|
730
|
-
|
|
729
|
+
G
|
|
731
730
|
), Lt = Le(i.verticalEdge, i.startPosition.y, B), W = p[i.layerId], rt = { width: T, height: k };
|
|
732
731
|
(!W || W.width !== T || W.height !== k) && (f((X) => ({
|
|
733
732
|
...X,
|
|
734
733
|
[i.layerId]: rt
|
|
735
734
|
})), E(i.layerId, rt));
|
|
736
|
-
const ot = l[i.layerId] ?? { x: 0, y: 0 },
|
|
737
|
-
(ot.x !==
|
|
735
|
+
const ot = l[i.layerId] ?? { x: 0, y: 0 }, A = { x: nt, y: Lt };
|
|
736
|
+
(ot.x !== A.x || ot.y !== A.y) && (u((X) => ({
|
|
738
737
|
...X,
|
|
739
|
-
[i.layerId]:
|
|
738
|
+
[i.layerId]: A
|
|
740
739
|
})), v(i.layerId, {
|
|
741
|
-
left: i.baseLeft +
|
|
742
|
-
top: i.baseTop +
|
|
740
|
+
left: i.baseLeft + A.x,
|
|
741
|
+
top: i.baseTop + A.y
|
|
743
742
|
}));
|
|
744
743
|
},
|
|
745
744
|
[e, l, p, v, E]
|
|
@@ -766,11 +765,11 @@ const Ut = ({ layers: t }) => {
|
|
|
766
765
|
}
|
|
767
766
|
a(null);
|
|
768
767
|
}, []);
|
|
769
|
-
|
|
770
|
-
onMove:
|
|
768
|
+
it(r !== null, {
|
|
769
|
+
onMove: D,
|
|
771
770
|
onUp: I,
|
|
772
771
|
onCancel: I
|
|
773
|
-
}),
|
|
772
|
+
}), it(s !== null, {
|
|
774
773
|
onMove: y,
|
|
775
774
|
onUp: N,
|
|
776
775
|
onCancel: N
|
|
@@ -780,7 +779,7 @@ const Ut = ({ layers: t }) => {
|
|
|
780
779
|
const i = ve(c), h = H(c);
|
|
781
780
|
if (!h || h.draggable !== !0)
|
|
782
781
|
return i;
|
|
783
|
-
const m = l[c.id], z = r === c.id, C = s === c.id, S = m ? { transform: `translate(${m.x}px, ${m.y}px)` } : {}, T = p[c.id], k = O(c) ? Y(c) : null,
|
|
782
|
+
const m = l[c.id], z = r === c.id, C = s === c.id, S = m ? { transform: `translate(${m.x}px, ${m.y}px)` } : {}, T = p[c.id], k = O(c) ? Y(c) : null, G = T ?? k, B = G ? { width: `${G.width}px`, height: `${G.height}px` } : {};
|
|
784
783
|
return {
|
|
785
784
|
...i,
|
|
786
785
|
...B,
|
|
@@ -860,15 +859,15 @@ const Ut = ({ layers: t }) => {
|
|
|
860
859
|
overflow: "visible",
|
|
861
860
|
height: "auto",
|
|
862
861
|
minHeight: "100%"
|
|
863
|
-
}, Ne = (t) => t ? He : It,
|
|
862
|
+
}, Ne = (t) => t ? He : It, Ve = ({ config: t, layers: e, style: n, root: r = !1 }) => {
|
|
864
863
|
const o = d.useRef(null), { isIntersecting: s } = Ft(o, { threshold: 0 });
|
|
865
|
-
return /* @__PURE__ */ w(xt, { config: t, layers: e, style: n, children: /* @__PURE__ */ w(
|
|
866
|
-
},
|
|
864
|
+
return /* @__PURE__ */ w(xt, { config: t, layers: e, style: n, children: /* @__PURE__ */ w(De, { gridRef: o, isIntersecting: s, isRoot: r }) });
|
|
865
|
+
}, De = ({ gridRef: t, isIntersecting: e, isRoot: n }) => {
|
|
867
866
|
const { config: r, style: o, layers: s } = zt(), { normalizedLayers: a, visibleLayers: l, regularLayers: u, layerById: p } = Jt(r, s.defs), { columnHandles: f, rowHandles: g, gapSizes: b, gridStyle: v, handleResize: E } = ue(r, o, t), { providerValue: R, draggingLayerId: M, resizingLayerId: P } = Pe({
|
|
868
867
|
layers: a,
|
|
869
868
|
layerById: p,
|
|
870
869
|
isRootLevel: n
|
|
871
|
-
}), x = M ? !0 : !!P,
|
|
870
|
+
}), x = M ? !0 : !!P, D = d.useMemo(() => ({
|
|
872
871
|
...Ne(n),
|
|
873
872
|
...v,
|
|
874
873
|
...x ? ke : {}
|
|
@@ -878,7 +877,7 @@ const Ut = ({ layers: t }) => {
|
|
|
878
877
|
"div",
|
|
879
878
|
{
|
|
880
879
|
ref: t,
|
|
881
|
-
style:
|
|
880
|
+
style: D,
|
|
882
881
|
"data-dragging": !!M,
|
|
883
882
|
"data-resizing": !!P,
|
|
884
883
|
"data-visible": e,
|
|
@@ -915,13 +914,13 @@ const Ut = ({ layers: t }) => {
|
|
|
915
914
|
] });
|
|
916
915
|
};
|
|
917
916
|
export {
|
|
918
|
-
|
|
917
|
+
Ve as G,
|
|
919
918
|
Ut as a,
|
|
920
919
|
Xt as b,
|
|
921
920
|
lt as c,
|
|
922
921
|
ue as d,
|
|
923
922
|
yt as e,
|
|
924
|
-
|
|
923
|
+
je as t,
|
|
925
924
|
Jt as u
|
|
926
925
|
};
|
|
927
|
-
//# sourceMappingURL=GridLayout-
|
|
926
|
+
//# sourceMappingURL=GridLayout-UWNxXw77.js.map
|