@byeolnaerim/flex-layout 0.0.7 → 0.0.9
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/flex-layout/components/FlexLayout.cjs +62 -28
- package/dist/flex-layout/components/FlexLayout.cjs.map +1 -1
- package/dist/flex-layout/components/FlexLayout.js +26 -11
- package/dist/flex-layout/components/FlexLayout.js.map +1 -1
- package/dist/flex-layout/components/FlexLayoutContainer.cjs +121 -55
- package/dist/flex-layout/components/FlexLayoutContainer.cjs.map +1 -1
- package/dist/flex-layout/components/FlexLayoutContainer.js +68 -25
- package/dist/flex-layout/components/FlexLayoutContainer.js.map +1 -1
- package/dist/flex-layout/components/FlexLayoutIFramePane.cjs +68 -0
- package/dist/flex-layout/components/FlexLayoutIFramePane.cjs.map +1 -0
- package/dist/flex-layout/components/FlexLayoutIFramePane.d.ts +4 -0
- package/dist/flex-layout/components/FlexLayoutIFramePane.js +44 -0
- package/dist/flex-layout/components/FlexLayoutIFramePane.js.map +1 -0
- package/dist/flex-layout/components/FlexLayoutResizePanel.cjs +111 -46
- package/dist/flex-layout/components/FlexLayoutResizePanel.cjs.map +1 -1
- package/dist/flex-layout/components/FlexLayoutResizePanel.d.ts +1 -1
- package/dist/flex-layout/components/FlexLayoutResizePanel.js +68 -27
- package/dist/flex-layout/components/FlexLayoutResizePanel.js.map +1 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreen.cjs +184 -143
- package/dist/flex-layout/components/FlexLayoutSplitScreen.cjs.map +1 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreen.js +71 -32
- package/dist/flex-layout/components/FlexLayoutSplitScreen.js.map +1 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBox.cjs +253 -60
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBox.cjs.map +1 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBox.d.ts +1 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBox.js +215 -39
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBox.js.map +1 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.cjs +40 -17
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.cjs.map +1 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.js +7 -7
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.js.map +1 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxItem.cjs +44 -21
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxItem.cjs.map +1 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxItem.js +7 -8
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxItem.js.map +1 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxTitleMore.cjs +40 -17
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxTitleMore.cjs.map +1 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxTitleMore.js +5 -6
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxTitleMore.js.map +1 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenScrollBox.cjs +53 -29
- package/dist/flex-layout/components/FlexLayoutSplitScreenScrollBox.cjs.map +1 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenScrollBox.js +14 -10
- package/dist/flex-layout/components/FlexLayoutSplitScreenScrollBox.js.map +1 -1
- package/dist/flex-layout/components/FlexLayoutStickyBox.cjs +46 -27
- package/dist/flex-layout/components/FlexLayoutStickyBox.cjs.map +1 -1
- package/dist/flex-layout/components/FlexLayoutStickyBox.d.ts +1 -0
- package/dist/flex-layout/components/FlexLayoutStickyBox.js +13 -8
- package/dist/flex-layout/components/FlexLayoutStickyBox.js.map +1 -1
- package/dist/flex-layout/components/index.cjs +54 -49
- package/dist/flex-layout/components/index.cjs.map +1 -1
- package/dist/flex-layout/components/index.js +16 -8
- package/dist/flex-layout/components/index.js.map +1 -1
- package/dist/flex-layout/hooks/index.cjs +23 -19
- package/dist/flex-layout/hooks/index.cjs.map +1 -1
- package/dist/flex-layout/hooks/index.js +2 -3
- package/dist/flex-layout/hooks/index.js.map +1 -1
- package/dist/flex-layout/hooks/useDrag.cjs +136 -79
- package/dist/flex-layout/hooks/useDrag.cjs.map +1 -1
- package/dist/flex-layout/hooks/useDrag.d.ts +5 -0
- package/dist/flex-layout/hooks/useDrag.js +86 -47
- package/dist/flex-layout/hooks/useDrag.js.map +1 -1
- package/dist/flex-layout/hooks/useFlexLayoutSplitScreen.cjs +40 -19
- package/dist/flex-layout/hooks/useFlexLayoutSplitScreen.cjs.map +1 -1
- package/dist/flex-layout/hooks/useFlexLayoutSplitScreen.js +9 -7
- package/dist/flex-layout/hooks/useFlexLayoutSplitScreen.js.map +1 -1
- package/dist/flex-layout/hooks/useListPaging.cjs +68 -35
- package/dist/flex-layout/hooks/useListPaging.cjs.map +1 -1
- package/dist/flex-layout/hooks/useListPaging.js +34 -18
- package/dist/flex-layout/hooks/useListPaging.js.map +1 -1
- package/dist/flex-layout/hooks/useSizes.cjs +45 -23
- package/dist/flex-layout/hooks/useSizes.cjs.map +1 -1
- package/dist/flex-layout/hooks/useSizes.js +6 -6
- package/dist/flex-layout/hooks/useSizes.js.map +1 -1
- package/dist/flex-layout/index.cjs +29 -40
- package/dist/flex-layout/index.cjs.map +1 -1
- package/dist/flex-layout/index.js +5 -6
- package/dist/flex-layout/index.js.map +1 -1
- package/dist/flex-layout/providers/FlexLayoutContext.cjs +35 -12
- package/dist/flex-layout/providers/FlexLayoutContext.cjs.map +1 -1
- package/dist/flex-layout/providers/FlexLayoutContext.js +7 -6
- package/dist/flex-layout/providers/FlexLayoutContext.js.map +1 -1
- package/dist/flex-layout/providers/FlexLayoutHooks.cjs +82 -53
- package/dist/flex-layout/providers/FlexLayoutHooks.cjs.map +1 -1
- package/dist/flex-layout/providers/FlexLayoutHooks.js +33 -8
- package/dist/flex-layout/providers/FlexLayoutHooks.js.map +1 -1
- package/dist/flex-layout/providers/index.cjs +21 -12
- package/dist/flex-layout/providers/index.cjs.map +1 -1
- package/dist/flex-layout/providers/index.js +1 -2
- package/dist/flex-layout/providers/index.js.map +1 -1
- package/dist/flex-layout/store/FlexLayoutContainerStore.cjs +130 -76
- package/dist/flex-layout/store/FlexLayoutContainerStore.cjs.map +1 -1
- package/dist/flex-layout/store/FlexLayoutContainerStore.d.ts +1 -0
- package/dist/flex-layout/store/FlexLayoutContainerStore.js +63 -38
- package/dist/flex-layout/store/FlexLayoutContainerStore.js.map +1 -1
- package/dist/flex-layout/store/index.cjs +21 -12
- package/dist/flex-layout/store/index.cjs.map +1 -1
- package/dist/flex-layout/store/index.js +1 -2
- package/dist/flex-layout/store/index.js.map +1 -1
- package/dist/flex-layout/types/FlexDirectionTypes.cjs +16 -3
- package/dist/flex-layout/types/FlexDirectionTypes.cjs.map +1 -1
- package/dist/flex-layout/types/FlexDirectionTypes.js +0 -2
- package/dist/flex-layout/types/FlexDirectionTypes.js.map +1 -1
- package/dist/flex-layout/types/FlexLayoutTypes.cjs +16 -3
- package/dist/flex-layout/types/FlexLayoutTypes.cjs.map +1 -1
- package/dist/flex-layout/types/FlexLayoutTypes.d.ts +1 -3
- package/dist/flex-layout/types/FlexLayoutTypes.js +0 -2
- package/dist/flex-layout/types/FlexLayoutTypes.js.map +1 -1
- package/dist/flex-layout/utils/FlexLayoutUtils.cjs +57 -20
- package/dist/flex-layout/utils/FlexLayoutUtils.cjs.map +1 -1
- package/dist/flex-layout/utils/FlexLayoutUtils.d.ts +4 -4
- package/dist/flex-layout/utils/FlexLayoutUtils.js +23 -8
- package/dist/flex-layout/utils/FlexLayoutUtils.js.map +1 -1
- package/dist/flex-layout/utils/index.cjs +21 -12
- package/dist/flex-layout/utils/index.cjs.map +1 -1
- package/dist/flex-layout/utils/index.js +1 -2
- package/dist/flex-layout/utils/index.js.map +1 -1
- package/dist/index.cjs +21 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -0
- package/dist/metafile-esm.json +1 -0
- package/dist/types/css.d.cjs +1 -3
- package/dist/types/css.d.cjs.map +1 -1
- package/dist/types/css.d.js +0 -2
- package/dist/types/css.d.js.map +1 -1
- package/package.json +5 -1
|
@@ -1,10 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
useEffect,
|
|
5
|
+
useRef,
|
|
6
|
+
useState
|
|
7
|
+
} from "react";
|
|
8
|
+
import {
|
|
9
|
+
dragStateSubject,
|
|
10
|
+
useDragEvents
|
|
11
|
+
} from "../hooks/useDrag";
|
|
12
|
+
import styles from "../styles/FlexLayout.module.css";
|
|
13
|
+
import { isDocumentOut } from "../utils/FlexLayoutUtils";
|
|
14
|
+
import { FlexLayoutIFramePane } from "./FlexLayoutIFramePane";
|
|
7
15
|
const MAX_STEP = 18;
|
|
16
|
+
function shouldAllowViewportScroll(x, y) {
|
|
17
|
+
const w = window.innerWidth;
|
|
18
|
+
const h = window.innerHeight;
|
|
19
|
+
const marginX = w * 0.15;
|
|
20
|
+
const marginY = h * 0.15;
|
|
21
|
+
return x < marginX || // 왼쪽 15 %
|
|
22
|
+
x > w - marginX || // 오른쪽 15 %
|
|
23
|
+
y < marginY || // 상단 15 %
|
|
24
|
+
y > h - marginY;
|
|
25
|
+
}
|
|
8
26
|
function edgeVelocity(x, y) {
|
|
9
27
|
const w = window.innerWidth, h = window.innerHeight;
|
|
10
28
|
const mx = w * 0.15, my = h * 0.15;
|
|
@@ -20,6 +38,38 @@ function edgeVelocity(x, y) {
|
|
|
20
38
|
vy = (y - (h - my)) / my * MAX_STEP;
|
|
21
39
|
return { vx, vy };
|
|
22
40
|
}
|
|
41
|
+
function calcVelocity(dx, dy, x, y) {
|
|
42
|
+
const w = window.innerWidth, h = window.innerHeight;
|
|
43
|
+
const marginX = w * 0.15, marginY = h * 0.15;
|
|
44
|
+
const multX = x < marginX ? 1 + (marginX - x) / marginX * 3 : x > w - marginX ? 1 + (x - (w - marginX)) / marginX * 3 : 1;
|
|
45
|
+
const multY = y < marginY ? 1 + (marginY - y) / marginY * 3 : y > h - marginY ? 1 + (y - (h - marginY)) / marginY * 3 : 1;
|
|
46
|
+
return { vx: -dx * multX, vy: -dy * multY };
|
|
47
|
+
}
|
|
48
|
+
function createScreenKey() {
|
|
49
|
+
const c = globalThis.crypto;
|
|
50
|
+
if (c?.randomUUID) return c.randomUUID();
|
|
51
|
+
if (c?.getRandomValues) {
|
|
52
|
+
return Array.from(
|
|
53
|
+
c.getRandomValues(new Uint32Array(16)),
|
|
54
|
+
(e) => e.toString(32).padStart(2, "0")
|
|
55
|
+
).join("");
|
|
56
|
+
}
|
|
57
|
+
return `${Date.now().toString(32)}-${Math.random().toString(32).slice(2)}`;
|
|
58
|
+
}
|
|
59
|
+
function getFallbackElement(targetComponent, url) {
|
|
60
|
+
if (targetComponent) return targetComponent;
|
|
61
|
+
if (url) return /* @__PURE__ */ jsx(FlexLayoutIFramePane, { url });
|
|
62
|
+
return void 0;
|
|
63
|
+
}
|
|
64
|
+
function titleFromUrl(url) {
|
|
65
|
+
if (!url) return void 0;
|
|
66
|
+
try {
|
|
67
|
+
const u = new URL(url);
|
|
68
|
+
return u.hostname;
|
|
69
|
+
} catch {
|
|
70
|
+
return url;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
23
73
|
function FlexLayoutSplitScreenDragBox({
|
|
24
74
|
onMouseDown,
|
|
25
75
|
onTouchStart,
|
|
@@ -31,15 +81,17 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
31
81
|
children,
|
|
32
82
|
className,
|
|
33
83
|
dropDocumentOutsideOption,
|
|
34
|
-
screenKey
|
|
35
|
-
window.crypto.getRandomValues(new Uint32Array(16)),
|
|
36
|
-
(e) => e.toString(32).padStart(2, "0")
|
|
37
|
-
).join(""),
|
|
84
|
+
screenKey: _screenKey,
|
|
38
85
|
isBlockingActiveInput = false,
|
|
39
86
|
customData = {},
|
|
40
87
|
scrollTargetRef,
|
|
41
88
|
...props
|
|
42
89
|
}) {
|
|
90
|
+
const [screenKey, setScreenKey] = useState();
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
if (!_screenKey) setScreenKey(createScreenKey());
|
|
93
|
+
else setScreenKey(_screenKey);
|
|
94
|
+
}, [_screenKey]);
|
|
43
95
|
const scrollRAF = useRef(null);
|
|
44
96
|
const velocity = useRef({ vx: 0, vy: 0 });
|
|
45
97
|
const ref = useRef(null);
|
|
@@ -47,10 +99,29 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
47
99
|
const clonedWidth = useRef(null);
|
|
48
100
|
const clonedHeight = useRef(null);
|
|
49
101
|
const hrefUrlRef = useRef("");
|
|
102
|
+
const rafId = useRef(null);
|
|
103
|
+
const pending = useRef(null);
|
|
104
|
+
const lastPointRef = useRef({ x: 0, y: 0 });
|
|
105
|
+
const escCanceledRef = useRef(false);
|
|
106
|
+
const emitDragState = (v) => {
|
|
107
|
+
pending.current = v;
|
|
108
|
+
if (rafId.current != null) return;
|
|
109
|
+
rafId.current = requestAnimationFrame(() => {
|
|
110
|
+
if (pending.current) dragStateSubject.next(pending.current);
|
|
111
|
+
pending.current = null;
|
|
112
|
+
rafId.current = null;
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
return () => {
|
|
117
|
+
if (rafId.current != null) cancelAnimationFrame(rafId.current);
|
|
118
|
+
};
|
|
119
|
+
}, []);
|
|
50
120
|
const { handleStart, handleMove, handleEnd } = useDragEvents({
|
|
51
121
|
isBlockingActiveInput
|
|
52
122
|
});
|
|
53
123
|
const handleMoveWrapper = (event) => {
|
|
124
|
+
let allowScrollEdge = false;
|
|
54
125
|
let x = 0;
|
|
55
126
|
let y = 0;
|
|
56
127
|
if (event.type === "touchmove") {
|
|
@@ -64,6 +135,7 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
64
135
|
}
|
|
65
136
|
const { vx, vy } = edgeVelocity(x, y);
|
|
66
137
|
const inEdge = vx !== 0 || vy !== 0;
|
|
138
|
+
allowScrollEdge = shouldAllowViewportScroll(x, y);
|
|
67
139
|
if (clonedNodeRef.current?.isConnected && !inEdge) {
|
|
68
140
|
event.preventDefault();
|
|
69
141
|
if (scrollRAF.current) {
|
|
@@ -108,19 +180,21 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
108
180
|
dragStartCallback: ({ x: x2, y: y2 }) => {
|
|
109
181
|
if (!clonedNodeRef.current) return;
|
|
110
182
|
navigator.vibrate(100);
|
|
111
|
-
clonedNodeRef.current.style.
|
|
112
|
-
clonedNodeRef.current.style.top = `${y2 - (clonedHeight.current || 0) / 2}px`;
|
|
183
|
+
clonedNodeRef.current.style.transform = `translate3d(${x2 - (clonedWidth.current || 0) / 2}px, ${y2 - (clonedHeight.current || 0) / 2}px, 0)`;
|
|
113
184
|
},
|
|
114
185
|
moveingCallback: ({ x: x2, y: y2 }) => {
|
|
186
|
+
lastPointRef.current = { x: x2, y: y2 };
|
|
115
187
|
if (clonedNodeRef.current?.isConnected) {
|
|
116
|
-
clonedNodeRef.current.style.
|
|
117
|
-
clonedNodeRef.current.style.top = `${y2 - (clonedHeight.current || 0) / 2}px`;
|
|
188
|
+
clonedNodeRef.current.style.transform = `translate3d(${x2 - (clonedWidth.current || 0) / 2}px, ${y2 - (clonedHeight.current || 0) / 2}px, 0)`;
|
|
118
189
|
}
|
|
119
|
-
|
|
190
|
+
emitDragState({
|
|
120
191
|
isDragging: true,
|
|
121
192
|
isDrop: false,
|
|
122
|
-
navigationTitle,
|
|
123
|
-
children:
|
|
193
|
+
navigationTitle: navigationTitle ?? titleFromUrl(dropDocumentOutsideOption?.openUrl),
|
|
194
|
+
children: getFallbackElement(
|
|
195
|
+
targetComponent,
|
|
196
|
+
dropDocumentOutsideOption?.openUrl
|
|
197
|
+
),
|
|
124
198
|
x: x2,
|
|
125
199
|
y: y2,
|
|
126
200
|
containerName,
|
|
@@ -136,9 +210,31 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
136
210
|
scrollRAF.current = null;
|
|
137
211
|
}
|
|
138
212
|
velocity.current = { vx: 0, vy: 0 };
|
|
213
|
+
if (event.type === "blur" || event.type === "touchcancel" || event.type === "pointercancel") {
|
|
214
|
+
if (clonedNodeRef.current) clonedNodeRef.current.remove();
|
|
215
|
+
}
|
|
139
216
|
handleEnd({
|
|
140
217
|
event,
|
|
141
218
|
dragEndCallback: ({ x, y }) => {
|
|
219
|
+
if (escCanceledRef.current) {
|
|
220
|
+
escCanceledRef.current = false;
|
|
221
|
+
if (clonedNodeRef.current) clonedNodeRef.current.remove();
|
|
222
|
+
emitDragState({
|
|
223
|
+
isDragging: false,
|
|
224
|
+
isDrop: false,
|
|
225
|
+
navigationTitle: navigationTitle ?? titleFromUrl(dropDocumentOutsideOption?.openUrl),
|
|
226
|
+
children: getFallbackElement(
|
|
227
|
+
targetComponent,
|
|
228
|
+
dropDocumentOutsideOption?.openUrl
|
|
229
|
+
),
|
|
230
|
+
x,
|
|
231
|
+
y,
|
|
232
|
+
containerName,
|
|
233
|
+
dropDocumentOutsideOption,
|
|
234
|
+
customData
|
|
235
|
+
});
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
142
238
|
const href = hrefUrlRef.current;
|
|
143
239
|
if (clonedNodeRef.current) clonedNodeRef.current.remove();
|
|
144
240
|
if (dropDocumentOutsideOption && isDocumentOut({ x, y })) {
|
|
@@ -154,11 +250,14 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
154
250
|
);
|
|
155
251
|
}
|
|
156
252
|
}
|
|
157
|
-
|
|
253
|
+
emitDragState({
|
|
158
254
|
isDragging: false,
|
|
159
255
|
isDrop: true,
|
|
160
|
-
navigationTitle,
|
|
161
|
-
children:
|
|
256
|
+
navigationTitle: navigationTitle ?? titleFromUrl(dropDocumentOutsideOption?.openUrl),
|
|
257
|
+
children: getFallbackElement(
|
|
258
|
+
targetComponent,
|
|
259
|
+
dropDocumentOutsideOption?.openUrl
|
|
260
|
+
),
|
|
162
261
|
x,
|
|
163
262
|
y,
|
|
164
263
|
containerName,
|
|
@@ -186,12 +285,16 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
186
285
|
href.textContent = hrefUrlRef.current;
|
|
187
286
|
clone.prepend(href);
|
|
188
287
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
clone.prepend(title);
|
|
193
|
-
}
|
|
288
|
+
const title = document.createElement("span");
|
|
289
|
+
title.textContent = navigationTitle ?? titleFromUrl(dropDocumentOutsideOption?.openUrl) ?? "";
|
|
290
|
+
clone.prepend(title);
|
|
194
291
|
clone.style.position = "fixed";
|
|
292
|
+
clone.style.left = "0px";
|
|
293
|
+
clone.style.top = "0px";
|
|
294
|
+
clone.style.margin = "0px";
|
|
295
|
+
clone.style.willChange = "transform";
|
|
296
|
+
clone.style.transform = "translate3d(-9999px, -9999px, 0)";
|
|
297
|
+
clone.style.pointerEvents = "none";
|
|
195
298
|
clonedNodeRef.current = clone;
|
|
196
299
|
clonedNodeRef.current.classList.add(
|
|
197
300
|
styles["flex-split-screen-drag-box-clone"]
|
|
@@ -203,7 +306,17 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
203
306
|
"mousemove",
|
|
204
307
|
"touchmove"
|
|
205
308
|
];
|
|
206
|
-
const endEvents = [
|
|
309
|
+
const endEvents = [
|
|
310
|
+
"mouseup",
|
|
311
|
+
"touchend",
|
|
312
|
+
"touchcancel",
|
|
313
|
+
// 터치 제스처 시스템 인터럽트
|
|
314
|
+
"pointerup",
|
|
315
|
+
// 범용 포인터 이벤트
|
|
316
|
+
"pointercancel",
|
|
317
|
+
"blur"
|
|
318
|
+
// 윈도우 포커스 아웃 (Alt+Tab 등)
|
|
319
|
+
];
|
|
207
320
|
moveEvents.forEach((eventName) => {
|
|
208
321
|
window.addEventListener(eventName, handleMoveWrapper, {
|
|
209
322
|
passive: false
|
|
@@ -239,6 +352,60 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
239
352
|
el.removeEventListener("contextmenu", onCtx);
|
|
240
353
|
};
|
|
241
354
|
}, []);
|
|
355
|
+
useEffect(() => {
|
|
356
|
+
return () => {
|
|
357
|
+
if (scrollRAF.current !== null) {
|
|
358
|
+
cancelAnimationFrame(scrollRAF.current);
|
|
359
|
+
scrollRAF.current = null;
|
|
360
|
+
}
|
|
361
|
+
velocity.current = { vx: 0, vy: 0 };
|
|
362
|
+
clonedNodeRef.current?.remove();
|
|
363
|
+
};
|
|
364
|
+
}, []);
|
|
365
|
+
useEffect(() => {
|
|
366
|
+
const onKeyDown = (e) => {
|
|
367
|
+
if (e.key !== "Escape") return;
|
|
368
|
+
if (!clonedNodeRef.current?.isConnected) return;
|
|
369
|
+
e.preventDefault();
|
|
370
|
+
e.stopPropagation();
|
|
371
|
+
escCanceledRef.current = true;
|
|
372
|
+
if (scrollRAF.current !== null) {
|
|
373
|
+
cancelAnimationFrame(scrollRAF.current);
|
|
374
|
+
scrollRAF.current = null;
|
|
375
|
+
}
|
|
376
|
+
velocity.current = { vx: 0, vy: 0 };
|
|
377
|
+
clonedNodeRef.current?.remove();
|
|
378
|
+
handleEnd({
|
|
379
|
+
event: new Event("pointercancel"),
|
|
380
|
+
dragEndCallback: () => {
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
const { x, y } = lastPointRef.current;
|
|
384
|
+
emitDragState({
|
|
385
|
+
isDragging: false,
|
|
386
|
+
isDrop: false,
|
|
387
|
+
navigationTitle: navigationTitle ?? titleFromUrl(dropDocumentOutsideOption?.openUrl),
|
|
388
|
+
children: getFallbackElement(
|
|
389
|
+
targetComponent,
|
|
390
|
+
dropDocumentOutsideOption?.openUrl
|
|
391
|
+
),
|
|
392
|
+
x,
|
|
393
|
+
y,
|
|
394
|
+
containerName,
|
|
395
|
+
dropDocumentOutsideOption,
|
|
396
|
+
customData
|
|
397
|
+
});
|
|
398
|
+
};
|
|
399
|
+
window.addEventListener("keydown", onKeyDown, true);
|
|
400
|
+
return () => window.removeEventListener("keydown", onKeyDown, true);
|
|
401
|
+
}, [
|
|
402
|
+
handleEnd,
|
|
403
|
+
containerName,
|
|
404
|
+
navigationTitle,
|
|
405
|
+
dropDocumentOutsideOption,
|
|
406
|
+
targetComponent,
|
|
407
|
+
customData
|
|
408
|
+
]);
|
|
242
409
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
243
410
|
"div",
|
|
244
411
|
{
|
|
@@ -252,6 +419,7 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
252
419
|
handleStart({
|
|
253
420
|
event: ev,
|
|
254
421
|
dragStartCallback: ({ x, y }) => {
|
|
422
|
+
lastPointRef.current = { x, y };
|
|
255
423
|
if (clonedNodeRef.current) {
|
|
256
424
|
document.body.appendChild(
|
|
257
425
|
clonedNodeRef.current
|
|
@@ -266,14 +434,18 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
266
434
|
}
|
|
267
435
|
if (clonedNodeRef.current?.isConnected) {
|
|
268
436
|
navigator.vibrate(100);
|
|
269
|
-
clonedNodeRef.current.style.
|
|
270
|
-
clonedNodeRef.current.style.top = `${y - (clonedHeight.current || 0) / 2}px`;
|
|
437
|
+
clonedNodeRef.current.style.transform = `translate3d(${x - (clonedWidth.current || 0) / 2}px, ${y - (clonedHeight.current || 0) / 2}px, 0)`;
|
|
271
438
|
}
|
|
272
|
-
|
|
439
|
+
emitDragState({
|
|
273
440
|
isDragging: true,
|
|
274
441
|
isDrop: false,
|
|
275
|
-
navigationTitle
|
|
276
|
-
|
|
442
|
+
navigationTitle: navigationTitle ?? titleFromUrl(
|
|
443
|
+
dropDocumentOutsideOption?.openUrl
|
|
444
|
+
),
|
|
445
|
+
children: getFallbackElement(
|
|
446
|
+
targetComponent,
|
|
447
|
+
dropDocumentOutsideOption?.openUrl
|
|
448
|
+
),
|
|
277
449
|
x,
|
|
278
450
|
y,
|
|
279
451
|
containerName,
|
|
@@ -304,14 +476,18 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
304
476
|
}
|
|
305
477
|
if (clonedNodeRef.current?.isConnected) {
|
|
306
478
|
navigator.vibrate(100);
|
|
307
|
-
clonedNodeRef.current.style.
|
|
308
|
-
clonedNodeRef.current.style.top = `${y - (clonedHeight.current || 0) / 2}px`;
|
|
479
|
+
clonedNodeRef.current.style.transform = `translate3d(${x - (clonedWidth.current || 0) / 2}px, ${y - (clonedHeight.current || 0) / 2}px, 0)`;
|
|
309
480
|
}
|
|
310
|
-
|
|
481
|
+
emitDragState({
|
|
311
482
|
isDragging: true,
|
|
312
483
|
isDrop: false,
|
|
313
|
-
navigationTitle
|
|
314
|
-
|
|
484
|
+
navigationTitle: navigationTitle ?? titleFromUrl(
|
|
485
|
+
dropDocumentOutsideOption?.openUrl
|
|
486
|
+
),
|
|
487
|
+
children: getFallbackElement(
|
|
488
|
+
targetComponent,
|
|
489
|
+
dropDocumentOutsideOption?.openUrl
|
|
490
|
+
),
|
|
315
491
|
x,
|
|
316
492
|
y,
|
|
317
493
|
containerName,
|
|
@@ -327,7 +503,7 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
327
503
|
}
|
|
328
504
|
) });
|
|
329
505
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
506
|
+
export {
|
|
507
|
+
FlexLayoutSplitScreenDragBox as default
|
|
508
|
+
};
|
|
333
509
|
//# sourceMappingURL=FlexLayoutSplitScreenDragBox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/flex-layout/components/FlexLayoutSplitScreenDragBox.tsx"],"names":["x","y"],"mappings":";;;;;;AAeA,MAAM,QAAA,GAAW,EAAA;AAejB,SAAS,YAAA,CAAa,GAAW,CAAA,EAAW;AAC3C,EAAA,MAAM,CAA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A,aACA,CAAA;AAAA,UACF;AAAA,SACA,CAAA;AAAA,MACF,CAAA;AAAA,MACA,KAAA,EAAO,EAAE,GAAG,KAAA,EAAM;AAAA,MACjB,GAAG,KAAA;AAAA,MAEH;AAAA;AAAA,GACF,EAED,CAAA;AAEF","file":"FlexLayoutSplitScreenDragBox.js","sourcesContent":["import {\r\n\tCSSProperties,\r\n\tHTMLAttributes,\r\n\tMouseEvent,\r\n\tReactElement,\r\n\tReactNode,\r\n\tRefObject,\r\n\tTouchEvent,\r\n\tuseEffect,\r\n\tuseRef,\r\n} from \"react\";\r\nimport { dragState, useDragEvents } from \"../hooks/useDrag\";\r\n\r\nimport styles from \"../styles/FlexLayout.module.css\";\r\nimport { isDocumentOut } from \"../utils/FlexLayoutUtils\";\r\nconst MAX_STEP = 18;\r\n\r\nfunction shouldAllowViewportScroll(x: number, y: number) {\r\n\tconst w = window.innerWidth;\r\n\tconst h = window.innerHeight;\r\n\tconst marginX = w * 0.15;\r\n\tconst marginY = h * 0.15;\r\n\treturn (\r\n\t\tx < marginX || // 왼쪽 15 %\r\n\t\tx > w - marginX || // 오른쪽 15 %\r\n\t\ty < marginY || // 상단 15 %\r\n\t\ty > h - marginY // 하단 15 %\r\n\t);\r\n}\r\n\r\nfunction edgeVelocity(x: number, y: number) {\r\n\tconst w = window.innerWidth,\r\n\t\th = window.innerHeight;\r\n\tconst mx = w * 0.15,\r\n\t\tmy = h * 0.15;\r\n\r\n\t/* X 축 */\r\n\tlet vx = 0;\r\n\tif (x < mx)\r\n\t\t// ← 왼쪽\r\n\t\tvx = -((mx - x) / mx) * MAX_STEP;\r\n\telse if (x > w - mx)\r\n\t\t// → 오른쪽\r\n\t\tvx = ((x - (w - mx)) / mx) * MAX_STEP;\r\n\r\n\t/* Y 축 */\r\n\tlet vy = 0;\r\n\tif (y < my)\r\n\t\t// ↑ 상단\r\n\t\tvy = -((my - y) / my) * MAX_STEP;\r\n\telse if (y > h - my)\r\n\t\t// ↓ 하단\r\n\t\tvy = ((y - (h - my)) / my) * MAX_STEP;\r\n\r\n\treturn { vx, vy };\r\n}\r\nfunction calcVelocity(dx: number, dy: number, x: number, y: number) {\r\n\tconst w = window.innerWidth,\r\n\t\th = window.innerHeight;\r\n\tconst marginX = w * 0.15,\r\n\t\tmarginY = h * 0.15;\r\n\r\n\t/* 거리가 0(가장자리)~margin 사이면 1~4 배 가중치 */\r\n\tconst multX =\r\n\t\tx < marginX\r\n\t\t\t? 1 + ((marginX - x) / marginX) * 3\r\n\t\t\t: x > w - marginX\r\n\t\t\t\t? 1 + ((x - (w - marginX)) / marginX) * 3\r\n\t\t\t\t: 1;\r\n\r\n\tconst multY =\r\n\t\ty < marginY\r\n\t\t\t? 1 + ((marginY - y) / marginY) * 3\r\n\t\t\t: y > h - marginY\r\n\t\t\t\t? 1 + ((y - (h - marginY)) / marginY) * 3\r\n\t\t\t\t: 1;\r\n\r\n\t/* ←→·↑↓ **반대 방향**으로 스크롤 */\r\n\treturn { vx: -dx * multX, vy: -dy * multY };\r\n}\r\n\r\nexport interface FlexLayoutSplitScreenDragBoxProps<\r\n\tE extends HTMLElement = HTMLElement,\r\n> extends Omit<HTMLAttributes<HTMLDivElement>, \"children\"> {\r\n\tonMouseDown?: (event: MouseEvent<HTMLDivElement>) => void;\r\n\tonTouchStart?: (event: TouchEvent<HTMLDivElement>) => void;\r\n\tdropEndCallback?: ({\r\n\t\tx,\r\n\t\ty,\r\n\t\tcontainerName,\r\n\t}: {\r\n\t\tx: number;\r\n\t\ty: number;\r\n\t\tcontainerName: string;\r\n\t}) => void;\r\n\tstyle?: CSSProperties;\r\n\tnavigationTitle?: string;\r\n\ttargetComponent?: ReactElement;\r\n\tdropDocumentOutsideOption?: DropDocumentOutsideOption;\r\n\tchildren: ReactNode;\r\n\tcontainerName: string;\r\n\tscreenKey?: string;\r\n\tisBlockingActiveInput?: boolean;\r\n\tcustomData?: Record<string, string | number | boolean | undefined>;\r\n\tscrollTargetRef?: RefObject<E>;\r\n}\r\n\r\nexport interface DropDocumentOutsideOption {\r\n\topenUrl: string;\r\n\twidthRatio?: number;\r\n\theightRatio?: number;\r\n\tisNewTap?: boolean;\r\n}\r\n\r\nexport default function FlexLayoutSplitScreenDragBox<E extends HTMLElement>({\r\n\tonMouseDown,\r\n\tonTouchStart,\r\n\tdropEndCallback,\r\n\tstyle,\r\n\tnavigationTitle,\r\n\ttargetComponent,\r\n\tcontainerName,\r\n\tchildren,\r\n\tclassName,\r\n\tdropDocumentOutsideOption,\r\n\tscreenKey = Array.from(\r\n\t\twindow.crypto.getRandomValues(new Uint32Array(16)),\r\n\t\t(e) => e.toString(32).padStart(2, \"0\"),\r\n\t).join(\"\"),\r\n\tisBlockingActiveInput = false,\r\n\tcustomData = {},\r\n\tscrollTargetRef,\r\n\t...props\r\n}: FlexLayoutSplitScreenDragBoxProps) {\r\n\t//const lastTouch = useRef<{ x: number; y: number } | null>(null);\r\n\tconst scrollRAF = useRef<number | null>(null); // 애니메이션 루프 id\r\n\tconst velocity = useRef<{ vx: number; vy: number }>({ vx: 0, vy: 0 });\r\n\tconst ref = useRef<HTMLDivElement>(null);\r\n\tconst clonedNodeRef = useRef<HTMLDivElement | null>(null);\r\n\tconst clonedWidth = useRef<number | null>(null);\r\n\tconst clonedHeight = useRef<number | null>(null);\r\n\tconst hrefUrlRef = useRef<string>(\"\");\r\n\r\n\tconst { handleStart, handleMove, handleEnd } = useDragEvents({\r\n\t\tisBlockingActiveInput,\r\n\t});\r\n\tconst handleMoveWrapper = (event: Event) => {\r\n\t\tlet allowScrollEdge = false;\r\n\t\tlet x = 0;\r\n\t\tlet y = 0;\r\n\r\n\t\tif (event.type === \"touchmove\") {\r\n\t\t\tconst t = (event as globalThis.TouchEvent).touches[0];\r\n\t\t\tx = t.clientX;\r\n\t\t\ty = t.clientY;\r\n\t\t} else {\r\n\t\t\tconst m = event as globalThis.MouseEvent;\r\n\t\t\tx = m.clientX;\r\n\t\t\ty = m.clientY;\r\n\t\t}\r\n\t\tconst { vx, vy } = edgeVelocity(x, y);\r\n\t\tconst inEdge = vx !== 0 || vy !== 0;\r\n\r\n\t\tallowScrollEdge = shouldAllowViewportScroll(x, y);\r\n\t\t/* 중앙 영역이면 스크롤 막음, 가장자리면 허용 */\r\n\t\tif (clonedNodeRef.current?.isConnected && !inEdge) {\r\n\t\t\tevent.preventDefault(); // 화면 고정\r\n\t\t\tif (scrollRAF.current) {\r\n\t\t\t\tcancelAnimationFrame(scrollRAF.current);\r\n\t\t\t\tscrollRAF.current = null;\r\n\t\t\t}\r\n\t\t\t// velocity.current = { vx: 0, vy: 0 };\r\n\t\t}\r\n\r\n\t\tif (\r\n\t\t\tclonedNodeRef.current?.isConnected &&\r\n\t\t\tinEdge\r\n\t\t\t//&&lastTouch.current\r\n\t\t) {\r\n\t\t\tevent.preventDefault();\r\n\t\t\t// const dx = x - lastTouch.current.x; // 손가락 이동량\r\n\t\t\t// const dy = y - lastTouch.current.y;\r\n\r\n\t\t\tvelocity.current = { vx, vy }; // ← X·Y 둘 다 들어갈 수 있음\r\n\r\n\t\t\t// const { vx, vy } = calcVelocity(dx, dy, x, y);\r\n\r\n\t\t\tif (!scrollRAF.current) {\r\n\t\t\t\tconst step = () => {\r\n\t\t\t\t\tconst target =\r\n\t\t\t\t\t\tscrollTargetRef?.current ??\r\n\t\t\t\t\t\t(document.scrollingElement as HTMLElement | null);\r\n\r\n\t\t\t\t\tif (target?.scrollBy) {\r\n\t\t\t\t\t\ttarget.scrollBy(\r\n\t\t\t\t\t\t\tvelocity.current.vx,\r\n\t\t\t\t\t\t\tvelocity.current.vy,\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\twindow.scrollBy(\r\n\t\t\t\t\t\t\tvelocity.current.vx,\r\n\t\t\t\t\t\t\tvelocity.current.vy,\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\tvelocity.current.vx === 0 &&\r\n\t\t\t\t\t\tvelocity.current.vy === 0\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tscrollRAF.current = null;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tscrollRAF.current = requestAnimationFrame(step);\r\n\t\t\t\t};\r\n\t\t\t\tscrollRAF.current = requestAnimationFrame(step);\r\n\t\t\t}\r\n\r\n\t\t\t//lastTouch.current = { x, y };\r\n\t\t}\r\n\t\tif (event.type !== \"touchmove\") {\r\n\t\t\t/* 마우스 · 펜 → 항상 고정 */\r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\t\thandleMove({\r\n\t\t\tevent,\r\n\t\t\tnotDragCallback: ({ x, y }) => {\r\n\t\t\t\tif (clonedNodeRef.current) clonedNodeRef.current.remove();\r\n\t\t\t},\r\n\t\t\tdragStartCallback: ({ x, y }) => {\r\n\t\t\t\tif (!clonedNodeRef.current) return;\r\n\t\t\t\tnavigator.vibrate(100);\r\n\t\t\t\tclonedNodeRef.current.style.left = `${x - (clonedWidth.current || 0) / 2}px`;\r\n\t\t\t\tclonedNodeRef.current.style.top = `${y - (clonedHeight.current || 0) / 2}px`;\r\n\t\t\t},\r\n\t\t\tmoveingCallback: ({ x, y }) => {\r\n\t\t\t\tif (clonedNodeRef.current?.isConnected) {\r\n\t\t\t\t\tclonedNodeRef.current.style.left = `${x - (clonedWidth.current || 0) / 2}px`;\r\n\t\t\t\t\tclonedNodeRef.current.style.top = `${y - (clonedHeight.current || 0) / 2}px`;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdragState.next({\r\n\t\t\t\t\tisDragging: true,\r\n\t\t\t\t\tisDrop: false,\r\n\t\t\t\t\tnavigationTitle,\r\n\t\t\t\t\tchildren: targetComponent,\r\n\t\t\t\t\tx,\r\n\t\t\t\t\ty,\r\n\t\t\t\t\tcontainerName,\r\n\t\t\t\t\tdropDocumentOutsideOption,\r\n\t\t\t\t\tcustomData,\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t});\r\n\t};\r\n\tconst handleEndWrapper = (event: Event) => {\r\n\t\tif (scrollRAF.current !== null) {\r\n\t\t\tcancelAnimationFrame(scrollRAF.current);\r\n\t\t\tscrollRAF.current = null;\r\n\t\t}\r\n\t\tvelocity.current = { vx: 0, vy: 0 };\r\n\t\t//lastTouch.current = null;\r\n\t\thandleEnd({\r\n\t\t\tevent,\r\n\t\t\tdragEndCallback: ({ x, y }) => {\r\n\t\t\t\tconst href = hrefUrlRef.current;\r\n\t\t\t\tif (clonedNodeRef.current) clonedNodeRef.current.remove();\r\n\t\t\t\tif (dropDocumentOutsideOption && isDocumentOut({ x, y })) {\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\tdropDocumentOutsideOption.isNewTap ||\r\n\t\t\t\t\t\t(!dropDocumentOutsideOption.widthRatio &&\r\n\t\t\t\t\t\t\t!dropDocumentOutsideOption.heightRatio)\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\twindow.open(href, \"_blank\");\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconst width =\r\n\t\t\t\t\t\t\twindow.innerWidth *\r\n\t\t\t\t\t\t\t(dropDocumentOutsideOption.widthRatio || 1);\r\n\t\t\t\t\t\tconst height =\r\n\t\t\t\t\t\t\twindow.innerHeight *\r\n\t\t\t\t\t\t\t(dropDocumentOutsideOption.heightRatio || 1);\r\n\t\t\t\t\t\twindow.open(\r\n\t\t\t\t\t\t\thref,\r\n\t\t\t\t\t\t\t\"_blank\",\r\n\t\t\t\t\t\t\t`width=${width},height=${height},left=${window.screenLeft - x * -1 - width},top=${window.screenTop + y}`,\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tdragState.next({\r\n\t\t\t\t\tisDragging: false,\r\n\t\t\t\t\tisDrop: true,\r\n\t\t\t\t\tnavigationTitle,\r\n\t\t\t\t\tchildren: targetComponent,\r\n\t\t\t\t\tx,\r\n\t\t\t\t\ty,\r\n\t\t\t\t\tcontainerName,\r\n\t\t\t\t\tdropDocumentOutsideOption,\r\n\t\t\t\t\tdropEndCallback,\r\n\t\t\t\t\tscreenKey,\r\n\t\t\t\t\tcustomData,\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t});\r\n\t};\r\n\tuseEffect(() => {\r\n\t\tif (ref.current) {\r\n\t\t\tconst clone = ref.current.cloneNode(true) as HTMLDivElement; //document.createElement('div');\r\n\t\t\tconst originRect = ref.current.getBoundingClientRect();\r\n\t\t\tclone.style.width = originRect.width + \"px\";\r\n\t\t\tclone.style.height = originRect.height + \"px\";\r\n\t\t\tclone.style.opacity = \"0.3\";\r\n\t\t\tclone.style.backdropFilter = \"blur(6px)\";\r\n\t\t\tclonedWidth.current = originRect.width;\r\n\t\t\tclonedHeight.current = originRect.height;\r\n\t\t\tif (dropDocumentOutsideOption?.openUrl) {\r\n\t\t\t\threfUrlRef.current = dropDocumentOutsideOption!.openUrl;\r\n\t\t\t\tconst href = document.createElement(\"span\");\r\n\t\t\t\thref.textContent = hrefUrlRef.current;\r\n\t\t\t\tclone.prepend(href);\r\n\t\t\t}\r\n\r\n\t\t\tif (navigationTitle) {\r\n\t\t\t\tconst title = document.createElement(\"span\");\r\n\t\t\t\ttitle.textContent = navigationTitle;\r\n\t\t\t\tclone.prepend(title);\r\n\t\t\t}\r\n\t\t\tclone.style.position = \"fixed\";\r\n\t\t\tclonedNodeRef.current = clone;\r\n\t\t\tclonedNodeRef.current.classList.add(\r\n\t\t\t\tstyles[\"flex-split-screen-drag-box-clone\"],\r\n\t\t\t);\r\n\t\t}\r\n\t}, []);\r\n\r\n\tuseEffect(() => {\r\n\t\tconst moveEvents: Array<keyof WindowEventMap> = [\r\n\t\t\t\"mousemove\",\r\n\t\t\t\"touchmove\",\r\n\t\t];\r\n\t\tconst endEvents: Array<keyof WindowEventMap> = [\"mouseup\", \"touchend\"];\r\n\r\n\t\tmoveEvents.forEach((eventName) => {\r\n\t\t\twindow.addEventListener(eventName, handleMoveWrapper, {\r\n\t\t\t\tpassive: false,\r\n\t\t\t});\r\n\t\t});\r\n\t\tendEvents.forEach((eventName) => {\r\n\t\t\twindow.addEventListener(eventName, handleEndWrapper);\r\n\t\t});\r\n\t\treturn () => {\r\n\t\t\tmoveEvents.forEach((eventName) => {\r\n\t\t\t\twindow.removeEventListener(eventName, handleMoveWrapper);\r\n\t\t\t});\r\n\t\t\tendEvents.forEach((eventName) => {\r\n\t\t\t\twindow.removeEventListener(eventName, handleEndWrapper);\r\n\t\t\t});\r\n\t\t};\r\n\t}, [\r\n\t\tcustomData,\r\n\t\ttargetComponent,\r\n\t\tdropDocumentOutsideOption,\r\n\t\tscreenKey,\r\n\t\tisBlockingActiveInput,\r\n\t\tcontainerName,\r\n\t\tnavigationTitle,\r\n\t\tdropEndCallback,\r\n\t]);\r\n\tuseEffect(() => {\r\n\t\tconst el = ref.current;\r\n\t\tif (!el) return;\r\n\r\n\t\tconst onCtx = (e: Event) => e.preventDefault();\r\n\r\n\t\tel.addEventListener(\"contextmenu\", onCtx);\r\n\r\n\t\treturn () => {\r\n\t\t\tel.removeEventListener(\"contextmenu\", onCtx);\r\n\t\t};\r\n\t}, []);\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<div\r\n\t\t\t\tclassName={`${className || \"\"} ${styles[\"flex-split-screen-drag-box\"]}`}\r\n\t\t\t\tref={ref}\r\n\t\t\t\tonContextMenu={(e) => e.preventDefault()}\r\n\t\t\t\tonMouseDown={(ev) => {\r\n\t\t\t\t\tif (onMouseDown) {\r\n\t\t\t\t\t\tPromise.resolve().then(() => onMouseDown(ev));\r\n\t\t\t\t\t}\r\n\t\t\t\t\thandleStart({\r\n\t\t\t\t\t\tevent: ev,\r\n\t\t\t\t\t\tdragStartCallback: ({ x, y }) => {\r\n\t\t\t\t\t\t\tif (clonedNodeRef.current) {\r\n\t\t\t\t\t\t\t\tdocument.body.appendChild(\r\n\t\t\t\t\t\t\t\t\tclonedNodeRef.current,\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\tif (ref.current) {\r\n\t\t\t\t\t\t\t\t\tconst originRect =\r\n\t\t\t\t\t\t\t\t\t\tref.current.getBoundingClientRect();\r\n\t\t\t\t\t\t\t\t\tclonedNodeRef.current.style.width =\r\n\t\t\t\t\t\t\t\t\t\toriginRect.width + \"px\";\r\n\t\t\t\t\t\t\t\t\tclonedNodeRef.current.style.height =\r\n\t\t\t\t\t\t\t\t\t\toriginRect.height + \"px\";\r\n\r\n\t\t\t\t\t\t\t\t\tclonedWidth.current = originRect.width;\r\n\t\t\t\t\t\t\t\t\tclonedHeight.current = originRect.height;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif (clonedNodeRef.current?.isConnected) {\r\n\t\t\t\t\t\t\t\tnavigator.vibrate(100);\r\n\t\t\t\t\t\t\t\tclonedNodeRef.current.style.left = `${x - (clonedWidth.current || 0) / 2}px`;\r\n\t\t\t\t\t\t\t\tclonedNodeRef.current.style.top = `${y - (clonedHeight.current || 0) / 2}px`;\r\n\t\t\t\t\t\t\t\t//clonedNodeRef.current.style.left = `${clientX}px`;\r\n\t\t\t\t\t\t\t\t//clonedNodeRef.current.style.top = `${clientY}px`;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tdragState.next({\r\n\t\t\t\t\t\t\t\tisDragging: true,\r\n\t\t\t\t\t\t\t\tisDrop: false,\r\n\t\t\t\t\t\t\t\tnavigationTitle,\r\n\t\t\t\t\t\t\t\tchildren: targetComponent,\r\n\t\t\t\t\t\t\t\tx,\r\n\t\t\t\t\t\t\t\ty,\r\n\t\t\t\t\t\t\t\tcontainerName,\r\n\t\t\t\t\t\t\t\tdropDocumentOutsideOption,\r\n\t\t\t\t\t\t\t\tcustomData,\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t});\r\n\t\t\t\t}}\r\n\t\t\t\tonTouchStart={(ev) => {\r\n\t\t\t\t\tif (onTouchStart) {\r\n\t\t\t\t\t\tPromise.resolve().then(() => onTouchStart(ev));\r\n\t\t\t\t\t}\r\n\t\t\t\t\thandleStart({\r\n\t\t\t\t\t\tevent: ev,\r\n\t\t\t\t\t\tdragStartCallback: ({ x, y }) => {\r\n\t\t\t\t\t\t\tif (clonedNodeRef.current) {\r\n\t\t\t\t\t\t\t\tdocument.body.appendChild(\r\n\t\t\t\t\t\t\t\t\tclonedNodeRef.current,\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\tif (ref.current) {\r\n\t\t\t\t\t\t\t\t\tconst originRect =\r\n\t\t\t\t\t\t\t\t\t\tref.current.getBoundingClientRect();\r\n\t\t\t\t\t\t\t\t\tclonedNodeRef.current.style.width =\r\n\t\t\t\t\t\t\t\t\t\toriginRect.width + \"px\";\r\n\t\t\t\t\t\t\t\t\tclonedNodeRef.current.style.height =\r\n\t\t\t\t\t\t\t\t\t\toriginRect.height + \"px\";\r\n\r\n\t\t\t\t\t\t\t\t\tclonedWidth.current = originRect.width;\r\n\t\t\t\t\t\t\t\t\tclonedHeight.current = originRect.height;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (clonedNodeRef.current?.isConnected) {\r\n\t\t\t\t\t\t\t\tnavigator.vibrate(100);\r\n\t\t\t\t\t\t\t\tclonedNodeRef.current.style.left = `${x - (clonedWidth.current || 0) / 2}px`;\r\n\t\t\t\t\t\t\t\tclonedNodeRef.current.style.top = `${y - (clonedHeight.current || 0) / 2}px`;\r\n\t\t\t\t\t\t\t\t//clonedNodeRef.current.style.left = `${clientX}px`;\r\n\t\t\t\t\t\t\t\t//clonedNodeRef.current.style.top = `${clientY}px`;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tdragState.next({\r\n\t\t\t\t\t\t\t\tisDragging: true,\r\n\t\t\t\t\t\t\t\tisDrop: false,\r\n\t\t\t\t\t\t\t\tnavigationTitle,\r\n\t\t\t\t\t\t\t\tchildren: targetComponent,\r\n\t\t\t\t\t\t\t\tx,\r\n\t\t\t\t\t\t\t\ty,\r\n\t\t\t\t\t\t\t\tcontainerName,\r\n\t\t\t\t\t\t\t\tdropDocumentOutsideOption,\r\n\t\t\t\t\t\t\t\tcustomData,\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t});\r\n\t\t\t\t}}\r\n\t\t\t\tstyle={{ ...style }}\r\n\t\t\t\t{...props}\r\n\t\t\t>\r\n\t\t\t\t{children}\r\n\t\t\t</div>\r\n\t\t\t{}\r\n\t\t</>\r\n\t);\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/flex-layout/components/FlexLayoutSplitScreenDragBox.tsx"],"sourcesContent":["\"use client\";\r\nimport {\r\n\tCSSProperties,\r\n\tHTMLAttributes,\r\n\tMouseEvent,\r\n\tReactElement,\r\n\tReactNode,\r\n\tRefObject,\r\n\tTouchEvent,\r\n\tuseEffect,\r\n\tuseRef,\r\n\tuseState,\r\n} from \"react\";\r\nimport {\r\n\tdragStateSubject,\r\n\tDragStateType,\r\n\tuseDragEvents,\r\n} from \"../hooks/useDrag\";\r\n\r\nimport styles from \"../styles/FlexLayout.module.css\";\r\nimport { isDocumentOut } from \"../utils/FlexLayoutUtils\";\r\nimport { FlexLayoutIFramePane } from \"./FlexLayoutIFramePane\";\r\n\r\nconst MAX_STEP = 18;\r\n\r\nfunction shouldAllowViewportScroll(x: number, y: number) {\r\n\tconst w = window.innerWidth;\r\n\tconst h = window.innerHeight;\r\n\tconst marginX = w * 0.15;\r\n\tconst marginY = h * 0.15;\r\n\treturn (\r\n\t\tx < marginX || // 왼쪽 15 %\r\n\t\tx > w - marginX || // 오른쪽 15 %\r\n\t\ty < marginY || // 상단 15 %\r\n\t\ty > h - marginY // 하단 15 %\r\n\t);\r\n}\r\n\r\nfunction edgeVelocity(x: number, y: number) {\r\n\tconst w = window.innerWidth,\r\n\t\th = window.innerHeight;\r\n\tconst mx = w * 0.15,\r\n\t\tmy = h * 0.15;\r\n\r\n\t/* X 축 */\r\n\tlet vx = 0;\r\n\tif (x < mx)\r\n\t\t// ← 왼쪽\r\n\t\tvx = -((mx - x) / mx) * MAX_STEP;\r\n\telse if (x > w - mx)\r\n\t\t// → 오른쪽\r\n\t\tvx = ((x - (w - mx)) / mx) * MAX_STEP;\r\n\r\n\t/* Y 축 */\r\n\tlet vy = 0;\r\n\tif (y < my)\r\n\t\t// ↑ 상단\r\n\t\tvy = -((my - y) / my) * MAX_STEP;\r\n\telse if (y > h - my)\r\n\t\t// ↓ 하단\r\n\t\tvy = ((y - (h - my)) / my) * MAX_STEP;\r\n\r\n\treturn { vx, vy };\r\n}\r\n\r\nfunction calcVelocity(dx: number, dy: number, x: number, y: number) {\r\n\tconst w = window.innerWidth,\r\n\t\th = window.innerHeight;\r\n\tconst marginX = w * 0.15,\r\n\t\tmarginY = h * 0.15;\r\n\r\n\t/* 거리가 0(가장자리)~margin 사이면 1~4 배 가중치 */\r\n\tconst multX =\r\n\t\tx < marginX\r\n\t\t\t? 1 + ((marginX - x) / marginX) * 3\r\n\t\t\t: x > w - marginX\r\n\t\t\t\t? 1 + ((x - (w - marginX)) / marginX) * 3\r\n\t\t\t\t: 1;\r\n\r\n\tconst multY =\r\n\t\ty < marginY\r\n\t\t\t? 1 + ((marginY - y) / marginY) * 3\r\n\t\t\t: y > h - marginY\r\n\t\t\t\t? 1 + ((y - (h - marginY)) / marginY) * 3\r\n\t\t\t\t: 1;\r\n\r\n\t/* ←→·↑↓ **반대 방향**으로 스크롤 */\r\n\treturn { vx: -dx * multX, vy: -dy * multY };\r\n}\r\n\r\nfunction createScreenKey() {\r\n\tconst c = globalThis.crypto as Crypto | undefined;\r\n\r\n\tif (c?.randomUUID) return c.randomUUID();\r\n\r\n\tif (c?.getRandomValues) {\r\n\t\treturn Array.from(c.getRandomValues(new Uint32Array(16)), (e) =>\r\n\t\t\te.toString(32).padStart(2, \"0\"),\r\n\t\t).join(\"\");\r\n\t}\r\n\r\n\t// 폴백\r\n\treturn `${Date.now().toString(32)}-${Math.random().toString(32).slice(2)}`;\r\n}\r\n\r\nfunction getFallbackElement(targetComponent?: ReactElement, url?: string) {\r\n\tif (targetComponent) return targetComponent;\r\n\tif (url) return <FlexLayoutIFramePane url={url} />;\r\n\treturn undefined;\r\n}\r\n\r\nfunction titleFromUrl(url?: string) {\r\n\tif (!url) return undefined;\r\n\ttry {\r\n\t\tconst u = new URL(url);\r\n\t\treturn u.hostname;\r\n\t} catch {\r\n\t\treturn url;\r\n\t}\r\n}\r\n\r\nexport interface FlexLayoutSplitScreenDragBoxProps<\r\n\tE extends HTMLElement = HTMLElement,\r\n> extends Omit<HTMLAttributes<HTMLDivElement>, \"children\"> {\r\n\tonMouseDown?: (event: MouseEvent<HTMLDivElement>) => void;\r\n\tonTouchStart?: (event: TouchEvent<HTMLDivElement>) => void;\r\n\tdropEndCallback?: ({\r\n\t\tx,\r\n\t\ty,\r\n\t\tcontainerName,\r\n\t}: {\r\n\t\tx: number;\r\n\t\ty: number;\r\n\t\tcontainerName: string;\r\n\t}) => void;\r\n\tstyle?: CSSProperties;\r\n\tnavigationTitle?: string;\r\n\ttargetComponent?: ReactElement;\r\n\tdropDocumentOutsideOption?: DropDocumentOutsideOption;\r\n\tchildren: ReactNode;\r\n\tcontainerName: string;\r\n\tscreenKey?: string;\r\n\tisBlockingActiveInput?: boolean;\r\n\tcustomData?: Record<string, string | number | boolean | undefined>;\r\n\tscrollTargetRef?: RefObject<E>;\r\n}\r\n\r\nexport interface DropDocumentOutsideOption {\r\n\topenUrl: string;\r\n\twidthRatio?: number;\r\n\theightRatio?: number;\r\n\tisNewTap?: boolean;\r\n}\r\n\r\nexport default function FlexLayoutSplitScreenDragBox<E extends HTMLElement>({\r\n\tonMouseDown,\r\n\tonTouchStart,\r\n\tdropEndCallback,\r\n\tstyle,\r\n\tnavigationTitle,\r\n\ttargetComponent,\r\n\tcontainerName,\r\n\tchildren,\r\n\tclassName,\r\n\tdropDocumentOutsideOption,\r\n\tscreenKey: _screenKey,\r\n\tisBlockingActiveInput = false,\r\n\tcustomData = {},\r\n\tscrollTargetRef,\r\n\t...props\r\n}: FlexLayoutSplitScreenDragBoxProps) {\r\n\tconst [screenKey, setScreenKey] = useState<string>();\r\n\tuseEffect(() => {\r\n\t\tif (!_screenKey) setScreenKey(createScreenKey());\r\n\t\telse setScreenKey(_screenKey);\r\n\t}, [_screenKey]);\r\n\tconst scrollRAF = useRef<number | null>(null); // 애니메이션 루프 id\r\n\tconst velocity = useRef<{ vx: number; vy: number }>({ vx: 0, vy: 0 });\r\n\tconst ref = useRef<HTMLDivElement>(null);\r\n\tconst clonedNodeRef = useRef<HTMLDivElement | null>(null);\r\n\tconst clonedWidth = useRef<number | null>(null);\r\n\tconst clonedHeight = useRef<number | null>(null);\r\n\tconst hrefUrlRef = useRef<string>(\"\");\r\n\r\n\tconst rafId = useRef<number | null>(null);\r\n\tconst pending = useRef<DragStateType | null>(null);\r\n\r\n\tconst lastPointRef = useRef<{ x: number; y: number }>({ x: 0, y: 0 });\r\n\tconst escCanceledRef = useRef(false);\r\n\r\n\tconst emitDragState = (v: DragStateType) => {\r\n\t\tpending.current = v;\r\n\t\tif (rafId.current != null) return;\r\n\r\n\t\trafId.current = requestAnimationFrame(() => {\r\n\t\t\tif (pending.current) dragStateSubject.next(pending.current);\r\n\t\t\tpending.current = null;\r\n\t\t\trafId.current = null;\r\n\t\t});\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\treturn () => {\r\n\t\t\tif (rafId.current != null) cancelAnimationFrame(rafId.current);\r\n\t\t};\r\n\t}, []);\r\n\r\n\tconst { handleStart, handleMove, handleEnd } = useDragEvents({\r\n\t\tisBlockingActiveInput,\r\n\t});\r\n\r\n\tconst handleMoveWrapper = (event: Event) => {\r\n\t\tlet allowScrollEdge = false;\r\n\t\tlet x = 0;\r\n\t\tlet y = 0;\r\n\r\n\t\tif (event.type === \"touchmove\") {\r\n\t\t\tconst t = (event as globalThis.TouchEvent).touches[0];\r\n\t\t\tx = t.clientX;\r\n\t\t\ty = t.clientY;\r\n\t\t} else {\r\n\t\t\tconst m = event as globalThis.MouseEvent;\r\n\t\t\tx = m.clientX;\r\n\t\t\ty = m.clientY;\r\n\t\t}\r\n\t\tconst { vx, vy } = edgeVelocity(x, y);\r\n\t\tconst inEdge = vx !== 0 || vy !== 0;\r\n\r\n\t\tallowScrollEdge = shouldAllowViewportScroll(x, y);\r\n\t\t/* 중앙 영역이면 스크롤 막음, 가장자리면 허용 */\r\n\t\tif (clonedNodeRef.current?.isConnected && !inEdge) {\r\n\t\t\tevent.preventDefault(); // 화면 고정\r\n\t\t\tif (scrollRAF.current) {\r\n\t\t\t\tcancelAnimationFrame(scrollRAF.current);\r\n\t\t\t\tscrollRAF.current = null;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (clonedNodeRef.current?.isConnected && inEdge) {\r\n\t\t\tevent.preventDefault();\r\n\t\t\tvelocity.current = { vx, vy }; // ← X·Y 둘 다 들어갈 수 있음\r\n\r\n\t\t\tif (!scrollRAF.current) {\r\n\t\t\t\tconst step = () => {\r\n\t\t\t\t\tconst target =\r\n\t\t\t\t\t\tscrollTargetRef?.current ??\r\n\t\t\t\t\t\t(document.scrollingElement as HTMLElement | null);\r\n\r\n\t\t\t\t\tif (target?.scrollBy) {\r\n\t\t\t\t\t\ttarget.scrollBy(\r\n\t\t\t\t\t\t\tvelocity.current.vx,\r\n\t\t\t\t\t\t\tvelocity.current.vy,\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\twindow.scrollBy(\r\n\t\t\t\t\t\t\tvelocity.current.vx,\r\n\t\t\t\t\t\t\tvelocity.current.vy,\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\tvelocity.current.vx === 0 &&\r\n\t\t\t\t\t\tvelocity.current.vy === 0\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tscrollRAF.current = null;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tscrollRAF.current = requestAnimationFrame(step);\r\n\t\t\t\t};\r\n\t\t\t\tscrollRAF.current = requestAnimationFrame(step);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (event.type !== \"touchmove\") {\r\n\t\t\t/* 마우스 · 펜 → 항상 고정 */\r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\t\thandleMove({\r\n\t\t\tevent,\r\n\t\t\tnotDragCallback: ({ x, y }) => {\r\n\t\t\t\tif (clonedNodeRef.current) clonedNodeRef.current.remove();\r\n\t\t\t},\r\n\t\t\tdragStartCallback: ({ x, y }) => {\r\n\t\t\t\tif (!clonedNodeRef.current) return;\r\n\r\n\t\t\t\tnavigator.vibrate(100);\r\n\t\t\t\tclonedNodeRef.current.style.transform = `translate3d(${x - (clonedWidth.current || 0) / 2}px, ${y - (clonedHeight.current || 0) / 2}px, 0)`;\r\n\t\t\t},\r\n\t\t\tmoveingCallback: ({ x, y }) => {\r\n\t\t\t\tlastPointRef.current = { x, y };\r\n\t\t\t\tif (clonedNodeRef.current?.isConnected) {\r\n\t\t\t\t\tclonedNodeRef.current.style.transform = `translate3d(${x - (clonedWidth.current || 0) / 2}px, ${y - (clonedHeight.current || 0) / 2}px, 0)`;\r\n\t\t\t\t\t// clonedNodeRef.current.style.left = `${x - (clonedWidth.current || 0) / 2}px`;\r\n\t\t\t\t\t// clonedNodeRef.current.style.top = `${y - (clonedHeight.current || 0) / 2}px`;\r\n\t\t\t\t}\r\n\r\n\t\t\t\temitDragState({\r\n\t\t\t\t\tisDragging: true,\r\n\t\t\t\t\tisDrop: false,\r\n\t\t\t\t\tnavigationTitle:\r\n\t\t\t\t\t\tnavigationTitle ??\r\n\t\t\t\t\t\ttitleFromUrl(dropDocumentOutsideOption?.openUrl),\r\n\t\t\t\t\tchildren: getFallbackElement(\r\n\t\t\t\t\t\ttargetComponent,\r\n\t\t\t\t\t\tdropDocumentOutsideOption?.openUrl,\r\n\t\t\t\t\t),\r\n\t\t\t\t\tx,\r\n\t\t\t\t\ty,\r\n\t\t\t\t\tcontainerName,\r\n\t\t\t\t\tdropDocumentOutsideOption,\r\n\t\t\t\t\tcustomData,\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t});\r\n\t};\r\n\r\n\tconst handleEndWrapper = (event: Event) => {\r\n\t\t// 안전장치로 RAF 취소\r\n\t\tif (scrollRAF.current !== null) {\r\n\t\t\tcancelAnimationFrame(scrollRAF.current);\r\n\t\t\tscrollRAF.current = null;\r\n\t\t}\r\n\t\tvelocity.current = { vx: 0, vy: 0 };\r\n\r\n\t\t// 추가 안전장치 blur나 cancel 이벤트 발생 시 Clone 노드를 강제 정리\r\n\t\tif (\r\n\t\t\tevent.type === \"blur\" ||\r\n\t\t\tevent.type === \"touchcancel\" ||\r\n\t\t\tevent.type === \"pointercancel\"\r\n\t\t) {\r\n\t\t\tif (clonedNodeRef.current) clonedNodeRef.current.remove();\r\n\t\t}\r\n\r\n\t\thandleEnd({\r\n\t\t\tevent,\r\n\t\t\tdragEndCallback: ({ x, y }) => {\r\n\t\t\t\tif (escCanceledRef.current) {\r\n\t\t\t\t\tescCanceledRef.current = false;\r\n\t\t\t\t\tif (clonedNodeRef.current) clonedNodeRef.current.remove();\r\n\r\n\t\t\t\t\temitDragState({\r\n\t\t\t\t\t\tisDragging: false,\r\n\t\t\t\t\t\tisDrop: false,\r\n\t\t\t\t\t\tnavigationTitle:\r\n\t\t\t\t\t\t\tnavigationTitle ??\r\n\t\t\t\t\t\t\ttitleFromUrl(dropDocumentOutsideOption?.openUrl),\r\n\t\t\t\t\t\tchildren: getFallbackElement(\r\n\t\t\t\t\t\t\ttargetComponent,\r\n\t\t\t\t\t\t\tdropDocumentOutsideOption?.openUrl,\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\tx,\r\n\t\t\t\t\t\ty,\r\n\t\t\t\t\t\tcontainerName,\r\n\t\t\t\t\t\tdropDocumentOutsideOption,\r\n\t\t\t\t\t\tcustomData,\r\n\t\t\t\t\t});\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst href = hrefUrlRef.current;\r\n\t\t\t\tif (clonedNodeRef.current) clonedNodeRef.current.remove();\r\n\t\t\t\tif (dropDocumentOutsideOption && isDocumentOut({ x, y })) {\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\tdropDocumentOutsideOption.isNewTap ||\r\n\t\t\t\t\t\t(!dropDocumentOutsideOption.widthRatio &&\r\n\t\t\t\t\t\t\t!dropDocumentOutsideOption.heightRatio)\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\twindow.open(href, \"_blank\");\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconst width =\r\n\t\t\t\t\t\t\twindow.innerWidth *\r\n\t\t\t\t\t\t\t(dropDocumentOutsideOption.widthRatio || 1);\r\n\t\t\t\t\t\tconst height =\r\n\t\t\t\t\t\t\twindow.innerHeight *\r\n\t\t\t\t\t\t\t(dropDocumentOutsideOption.heightRatio || 1);\r\n\t\t\t\t\t\twindow.open(\r\n\t\t\t\t\t\t\thref,\r\n\t\t\t\t\t\t\t\"_blank\",\r\n\t\t\t\t\t\t\t`width=${width},height=${height},left=${window.screenLeft - x * -1 - width},top=${window.screenTop + y}`,\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\temitDragState({\r\n\t\t\t\t\tisDragging: false,\r\n\t\t\t\t\tisDrop: true,\r\n\t\t\t\t\tnavigationTitle:\r\n\t\t\t\t\t\tnavigationTitle ??\r\n\t\t\t\t\t\ttitleFromUrl(dropDocumentOutsideOption?.openUrl),\r\n\t\t\t\t\tchildren: getFallbackElement(\r\n\t\t\t\t\t\ttargetComponent,\r\n\t\t\t\t\t\tdropDocumentOutsideOption?.openUrl,\r\n\t\t\t\t\t),\r\n\t\t\t\t\tx,\r\n\t\t\t\t\ty,\r\n\t\t\t\t\tcontainerName,\r\n\t\t\t\t\tdropDocumentOutsideOption,\r\n\t\t\t\t\tdropEndCallback,\r\n\t\t\t\t\tscreenKey,\r\n\t\t\t\t\tcustomData,\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t});\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tif (ref.current) {\r\n\t\t\tconst clone = ref.current.cloneNode(true) as HTMLDivElement;\r\n\t\t\tconst originRect = ref.current.getBoundingClientRect();\r\n\t\t\tclone.style.width = originRect.width + \"px\";\r\n\t\t\tclone.style.height = originRect.height + \"px\";\r\n\t\t\tclone.style.opacity = \"0.3\";\r\n\t\t\tclone.style.backdropFilter = \"blur(6px)\";\r\n\t\t\tclonedWidth.current = originRect.width;\r\n\t\t\tclonedHeight.current = originRect.height;\r\n\t\t\tif (dropDocumentOutsideOption?.openUrl) {\r\n\t\t\t\threfUrlRef.current = dropDocumentOutsideOption!.openUrl;\r\n\t\t\t\tconst href = document.createElement(\"span\");\r\n\t\t\t\thref.textContent = hrefUrlRef.current;\r\n\t\t\t\tclone.prepend(href);\r\n\t\t\t}\r\n\r\n\t\t\tconst title = document.createElement(\"span\");\r\n\t\t\ttitle.textContent =\r\n\t\t\t\tnavigationTitle ??\r\n\t\t\t\ttitleFromUrl(dropDocumentOutsideOption?.openUrl) ??\r\n\t\t\t\t\"\";\r\n\t\t\tclone.prepend(title);\r\n\r\n\t\t\tclone.style.position = \"fixed\";\r\n\t\t\tclone.style.left = \"0px\";\r\n\t\t\tclone.style.top = \"0px\";\r\n\t\t\tclone.style.margin = \"0px\";\r\n\t\t\tclone.style.willChange = \"transform\";\r\n\t\t\tclone.style.transform = \"translate3d(-9999px, -9999px, 0)\";\r\n\t\t\tclone.style.pointerEvents = \"none\";\r\n\r\n\t\t\tclonedNodeRef.current = clone;\r\n\t\t\tclonedNodeRef.current.classList.add(\r\n\t\t\t\tstyles[\"flex-split-screen-drag-box-clone\"],\r\n\t\t\t);\r\n\t\t}\r\n\t}, []);\r\n\r\n\tuseEffect(() => {\r\n\t\tconst moveEvents: Array<keyof WindowEventMap> = [\r\n\t\t\t\"mousemove\",\r\n\t\t\t\"touchmove\",\r\n\t\t];\r\n\r\n\t\t// 드래그 상태가 붕괴되거나 좀비 상태가 될 수 있는 예외 케이스들을 모두 포함\r\n\t\tconst endEvents: Array<keyof WindowEventMap> = [\r\n\t\t\t\"mouseup\",\r\n\t\t\t\"touchend\",\r\n\t\t\t\"touchcancel\", // 터치 제스처 시스템 인터럽트\r\n\t\t\t\"pointerup\", // 범용 포인터 이벤트\r\n\t\t\t\"pointercancel\",\r\n\t\t\t\"blur\", // 윈도우 포커스 아웃 (Alt+Tab 등)\r\n\t\t];\r\n\r\n\t\tmoveEvents.forEach((eventName) => {\r\n\t\t\twindow.addEventListener(eventName, handleMoveWrapper, {\r\n\t\t\t\tpassive: false,\r\n\t\t\t});\r\n\t\t});\r\n\t\tendEvents.forEach((eventName) => {\r\n\t\t\twindow.addEventListener(eventName, handleEndWrapper);\r\n\t\t});\r\n\t\treturn () => {\r\n\t\t\tmoveEvents.forEach((eventName) => {\r\n\t\t\t\twindow.removeEventListener(eventName, handleMoveWrapper);\r\n\t\t\t});\r\n\t\t\tendEvents.forEach((eventName) => {\r\n\t\t\t\twindow.removeEventListener(eventName, handleEndWrapper);\r\n\t\t\t});\r\n\t\t};\r\n\t}, [\r\n\t\tcustomData,\r\n\t\ttargetComponent,\r\n\t\tdropDocumentOutsideOption,\r\n\t\tscreenKey,\r\n\t\tisBlockingActiveInput,\r\n\t\tcontainerName,\r\n\t\tnavigationTitle,\r\n\t\tdropEndCallback,\r\n\t]);\r\n\r\n\tuseEffect(() => {\r\n\t\tconst el = ref.current;\r\n\t\tif (!el) return;\r\n\r\n\t\tconst onCtx = (e: Event) => e.preventDefault();\r\n\r\n\t\tel.addEventListener(\"contextmenu\", onCtx);\r\n\r\n\t\treturn () => {\r\n\t\t\tel.removeEventListener(\"contextmenu\", onCtx);\r\n\t\t};\r\n\t}, []);\r\n\r\n\tuseEffect(() => {\r\n\t\treturn () => {\r\n\t\t\tif (scrollRAF.current !== null) {\r\n\t\t\t\tcancelAnimationFrame(scrollRAF.current);\r\n\t\t\t\tscrollRAF.current = null;\r\n\t\t\t}\r\n\t\t\tvelocity.current = { vx: 0, vy: 0 };\r\n\t\t\tclonedNodeRef.current?.remove();\r\n\t\t};\r\n\t}, []);\r\n\r\n\t//취소 이벤트\r\n\tuseEffect(() => {\r\n\t\tconst onKeyDown = (e: KeyboardEvent) => {\r\n\t\t\tif (e.key !== \"Escape\") return;\r\n\r\n\t\t\t// 드래그가 실제로 시작된 상태에서만 (clone이 body에 붙어있는 상태)\r\n\t\t\tif (!clonedNodeRef.current?.isConnected) return;\r\n\r\n\t\t\te.preventDefault();\r\n\t\t\te.stopPropagation();\r\n\r\n\t\t\t// 다음 mouseup이 와도 drop 로직 안 타게\r\n\t\t\tescCanceledRef.current = true;\r\n\r\n\t\t\t// 스크롤/RAF 정리\r\n\t\t\tif (scrollRAF.current !== null) {\r\n\t\t\t\tcancelAnimationFrame(scrollRAF.current);\r\n\t\t\t\tscrollRAF.current = null;\r\n\t\t\t}\r\n\t\t\tvelocity.current = { vx: 0, vy: 0 };\r\n\r\n\t\t\t// clone 제거\r\n\t\t\tclonedNodeRef.current?.remove();\r\n\r\n\t\t\t// useDragEvents 내부 상태도 \"끝\"으로 만들어 좀비 드래그 방지\r\n\t\t\t// (좌표는 hook이 마지막 좌표를 들고 있거나, 아래 emit에선 lastPointRef를 사용)\r\n\t\t\thandleEnd({\r\n\t\t\t\tevent: new Event(\"pointercancel\"),\r\n\t\t\t\tdragEndCallback: () => {},\r\n\t\t\t});\r\n\r\n\t\t\t// overlay 등 외부 UI도 즉시 종료시키기\r\n\t\t\tconst { x, y } = lastPointRef.current;\r\n\t\t\temitDragState({\r\n\t\t\t\tisDragging: false,\r\n\t\t\t\tisDrop: false,\r\n\t\t\t\tnavigationTitle:\r\n\t\t\t\t\tnavigationTitle ??\r\n\t\t\t\t\ttitleFromUrl(dropDocumentOutsideOption?.openUrl),\r\n\t\t\t\tchildren: getFallbackElement(\r\n\t\t\t\t\ttargetComponent,\r\n\t\t\t\t\tdropDocumentOutsideOption?.openUrl,\r\n\t\t\t\t),\r\n\t\t\t\tx,\r\n\t\t\t\ty,\r\n\t\t\t\tcontainerName,\r\n\t\t\t\tdropDocumentOutsideOption,\r\n\t\t\t\tcustomData,\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\twindow.addEventListener(\"keydown\", onKeyDown, true);\r\n\t\treturn () => window.removeEventListener(\"keydown\", onKeyDown, true);\r\n\t}, [\r\n\t\thandleEnd,\r\n\t\tcontainerName,\r\n\t\tnavigationTitle,\r\n\t\tdropDocumentOutsideOption,\r\n\t\ttargetComponent,\r\n\t\tcustomData,\r\n\t]);\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<div\r\n\t\t\t\tclassName={`${className || \"\"} ${styles[\"flex-split-screen-drag-box\"]}`}\r\n\t\t\t\tref={ref}\r\n\t\t\t\tonContextMenu={(e) => e.preventDefault()}\r\n\t\t\t\tonMouseDown={(ev) => {\r\n\t\t\t\t\tif (onMouseDown) {\r\n\t\t\t\t\t\tPromise.resolve().then(() => onMouseDown(ev));\r\n\t\t\t\t\t}\r\n\t\t\t\t\thandleStart({\r\n\t\t\t\t\t\tevent: ev,\r\n\t\t\t\t\t\tdragStartCallback: ({ x, y }) => {\r\n\t\t\t\t\t\t\tlastPointRef.current = { x, y };\r\n\t\t\t\t\t\t\tif (clonedNodeRef.current) {\r\n\t\t\t\t\t\t\t\tdocument.body.appendChild(\r\n\t\t\t\t\t\t\t\t\tclonedNodeRef.current,\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\tif (ref.current) {\r\n\t\t\t\t\t\t\t\t\tconst originRect =\r\n\t\t\t\t\t\t\t\t\t\tref.current.getBoundingClientRect();\r\n\t\t\t\t\t\t\t\t\tclonedNodeRef.current.style.width =\r\n\t\t\t\t\t\t\t\t\t\toriginRect.width + \"px\";\r\n\t\t\t\t\t\t\t\t\tclonedNodeRef.current.style.height =\r\n\t\t\t\t\t\t\t\t\t\toriginRect.height + \"px\";\r\n\r\n\t\t\t\t\t\t\t\t\tclonedWidth.current = originRect.width;\r\n\t\t\t\t\t\t\t\t\tclonedHeight.current = originRect.height;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif (clonedNodeRef.current?.isConnected) {\r\n\t\t\t\t\t\t\t\tnavigator.vibrate(100);\r\n\r\n\t\t\t\t\t\t\t\tclonedNodeRef.current.style.transform = `translate3d(${x - (clonedWidth.current || 0) / 2}px, ${y - (clonedHeight.current || 0) / 2}px, 0)`;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\temitDragState({\r\n\t\t\t\t\t\t\t\tisDragging: true,\r\n\t\t\t\t\t\t\t\tisDrop: false,\r\n\t\t\t\t\t\t\t\tnavigationTitle:\r\n\t\t\t\t\t\t\t\t\tnavigationTitle ??\r\n\t\t\t\t\t\t\t\t\ttitleFromUrl(\r\n\t\t\t\t\t\t\t\t\t\tdropDocumentOutsideOption?.openUrl,\r\n\t\t\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\t\tchildren: getFallbackElement(\r\n\t\t\t\t\t\t\t\t\ttargetComponent,\r\n\t\t\t\t\t\t\t\t\tdropDocumentOutsideOption?.openUrl,\r\n\t\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\t\tx,\r\n\t\t\t\t\t\t\t\ty,\r\n\t\t\t\t\t\t\t\tcontainerName,\r\n\t\t\t\t\t\t\t\tdropDocumentOutsideOption,\r\n\t\t\t\t\t\t\t\tcustomData,\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t});\r\n\t\t\t\t}}\r\n\t\t\t\tonTouchStart={(ev) => {\r\n\t\t\t\t\tif (onTouchStart) {\r\n\t\t\t\t\t\tPromise.resolve().then(() => onTouchStart(ev));\r\n\t\t\t\t\t}\r\n\t\t\t\t\thandleStart({\r\n\t\t\t\t\t\tevent: ev,\r\n\t\t\t\t\t\tdragStartCallback: ({ x, y }) => {\r\n\t\t\t\t\t\t\tif (clonedNodeRef.current) {\r\n\t\t\t\t\t\t\t\tdocument.body.appendChild(\r\n\t\t\t\t\t\t\t\t\tclonedNodeRef.current,\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\tif (ref.current) {\r\n\t\t\t\t\t\t\t\t\tconst originRect =\r\n\t\t\t\t\t\t\t\t\t\tref.current.getBoundingClientRect();\r\n\t\t\t\t\t\t\t\t\tclonedNodeRef.current.style.width =\r\n\t\t\t\t\t\t\t\t\t\toriginRect.width + \"px\";\r\n\t\t\t\t\t\t\t\t\tclonedNodeRef.current.style.height =\r\n\t\t\t\t\t\t\t\t\t\toriginRect.height + \"px\";\r\n\r\n\t\t\t\t\t\t\t\t\tclonedWidth.current = originRect.width;\r\n\t\t\t\t\t\t\t\t\tclonedHeight.current = originRect.height;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (clonedNodeRef.current?.isConnected) {\r\n\t\t\t\t\t\t\t\tnavigator.vibrate(100);\r\n\t\t\t\t\t\t\t\tclonedNodeRef.current.style.transform = `translate3d(${x - (clonedWidth.current || 0) / 2}px, ${y - (clonedHeight.current || 0) / 2}px, 0)`;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\temitDragState({\r\n\t\t\t\t\t\t\t\tisDragging: true,\r\n\t\t\t\t\t\t\t\tisDrop: false,\r\n\t\t\t\t\t\t\t\tnavigationTitle:\r\n\t\t\t\t\t\t\t\t\tnavigationTitle ??\r\n\t\t\t\t\t\t\t\t\ttitleFromUrl(\r\n\t\t\t\t\t\t\t\t\t\tdropDocumentOutsideOption?.openUrl,\r\n\t\t\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\t\tchildren: getFallbackElement(\r\n\t\t\t\t\t\t\t\t\ttargetComponent,\r\n\t\t\t\t\t\t\t\t\tdropDocumentOutsideOption?.openUrl,\r\n\t\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\t\tx,\r\n\t\t\t\t\t\t\t\ty,\r\n\t\t\t\t\t\t\t\tcontainerName,\r\n\t\t\t\t\t\t\t\tdropDocumentOutsideOption,\r\n\t\t\t\t\t\t\t\tcustomData,\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t});\r\n\t\t\t\t}}\r\n\t\t\t\tstyle={{ ...style }}\r\n\t\t\t\t{...props}\r\n\t\t\t>\r\n\t\t\t\t{children}\r\n\t\t\t</div>\r\n\t\t\t{}\r\n\t\t</>\r\n\t);\r\n}\r\n"],"mappings":";AA2GiB,SAgdf,UAhde;AA1GjB;AAAA,EAQC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EAEA;AAAA,OACM;AAEP,OAAO,YAAY;AACnB,SAAS,qBAAqB;AAC9B,SAAS,4BAA4B;AAErC,MAAM,WAAW;AAEjB,SAAS,0BAA0B,GAAW,GAAW;AACxD,QAAM,IAAI,OAAO;AACjB,QAAM,IAAI,OAAO;AACjB,QAAM,UAAU,IAAI;AACpB,QAAM,UAAU,IAAI;AACpB,SACC,IAAI;AAAA,EACJ,IAAI,IAAI;AAAA,EACR,IAAI;AAAA,EACJ,IAAI,IAAI;AAEV;AAEA,SAAS,aAAa,GAAW,GAAW;AAC3C,QAAM,IAAI,OAAO,YAChB,IAAI,OAAO;AACZ,QAAM,KAAK,IAAI,MACd,KAAK,IAAI;AAGV,MAAI,KAAK;AACT,MAAI,IAAI;AAEP,SAAK,GAAG,KAAK,KAAK,MAAM;AAAA,WAChB,IAAI,IAAI;AAEhB,UAAO,KAAK,IAAI,OAAO,KAAM;AAG9B,MAAI,KAAK;AACT,MAAI,IAAI;AAEP,SAAK,GAAG,KAAK,KAAK,MAAM;AAAA,WAChB,IA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ACD,CAAC;AAAA,MACF;AAAA,MACA,OAAO,EAAE,GAAG,MAAM;AAAA,MACjB,GAAG;AAAA,MAEH;AAAA;AAAA,EACF,GAED;AAEF;","names":["x","y"]}
|
|
@@ -1,32 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var FlexLayoutSplitScreenDragBoxContainer_exports = {};
|
|
31
|
+
__export(FlexLayoutSplitScreenDragBoxContainer_exports, {
|
|
32
|
+
default: () => FlexLayoutSplitScreenDragBoxContainer
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(FlexLayoutSplitScreenDragBoxContainer_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_FlexLayout = __toESM(require("../styles/FlexLayout.module.css"), 1);
|
|
37
|
+
var import_FlexLayoutSplitScreenScrollBox = __toESM(require("./FlexLayoutSplitScreenScrollBox"), 1);
|
|
12
38
|
function FlexLayoutSplitScreenDragBoxContainer({
|
|
13
39
|
className,
|
|
14
40
|
children,
|
|
15
41
|
layoutName,
|
|
16
42
|
...props
|
|
17
43
|
}) {
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
|
|
44
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
45
|
+
import_FlexLayoutSplitScreenScrollBox.default,
|
|
20
46
|
{
|
|
21
47
|
keyName: layoutName,
|
|
22
|
-
className: `${
|
|
48
|
+
className: `${import_FlexLayout.default["flex-split-screen-drag-box-title-container"]} ${className && className !== "" && className || ""}`,
|
|
23
49
|
direction: "x",
|
|
24
50
|
...props,
|
|
25
51
|
children
|
|
26
52
|
}
|
|
27
53
|
);
|
|
28
54
|
}
|
|
29
|
-
|
|
30
|
-
module.exports = FlexLayoutSplitScreenDragBoxContainer;
|
|
31
|
-
//# sourceMappingURL=FlexLayoutSplitScreenDragBoxContainer.cjs.map
|
|
32
55
|
//# sourceMappingURL=FlexLayoutSplitScreenDragBoxContainer.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.tsx"],"
|
|
1
|
+
{"version":3,"sources":["../../../src/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.tsx"],"sourcesContent":["\"use client\";\r\nimport { HTMLAttributes } from \"react\";\r\nimport styles from \"../styles/FlexLayout.module.css\";\r\nimport FlexLayoutSplitScreenScrollBox from \"./FlexLayoutSplitScreenScrollBox\";\r\nexport interface FlexLayoutSplitScreenDragBoxContainerProps extends HTMLAttributes<HTMLDivElement> {\r\n\tlayoutName: string;\r\n}\r\n\r\nexport default function FlexLayoutSplitScreenDragBoxContainer({\r\n\tclassName,\r\n\tchildren,\r\n\tlayoutName,\r\n\t...props\r\n}: FlexLayoutSplitScreenDragBoxContainerProps) {\r\n\treturn (\r\n\t\t<FlexLayoutSplitScreenScrollBox\r\n\t\t\tkeyName={layoutName}\r\n\t\t\tclassName={`${styles[\"flex-split-screen-drag-box-title-container\"]} ${(className && className !== \"\" && className) || \"\"}`}\r\n\t\t\tdirection=\"x\"\r\n\t\t\t{...props}\r\n\t\t>\r\n\t\t\t{children}\r\n\t\t</FlexLayoutSplitScreenScrollBox>\r\n\t);\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeE;AAbF,wBAAmB;AACnB,4CAA2C;AAK5B,SAAR,sCAAuD;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAA+C;AAC9C,SACC;AAAA,IAAC,sCAAAA;AAAA,IAAA;AAAA,MACA,SAAS;AAAA,MACT,WAAW,GAAG,kBAAAC,QAAO,4CAA4C,CAAC,IAAK,aAAa,cAAc,MAAM,aAAc,EAAE;AAAA,MACxH,WAAU;AAAA,MACT,GAAG;AAAA,MAEH;AAAA;AAAA,EACF;AAEF;","names":["FlexLayoutSplitScreenScrollBox","styles"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import styles from "../styles/FlexLayout.module.css";
|
|
4
|
+
import FlexLayoutSplitScreenScrollBox from "./FlexLayoutSplitScreenScrollBox";
|
|
5
5
|
function FlexLayoutSplitScreenDragBoxContainer({
|
|
6
6
|
className,
|
|
7
7
|
children,
|
|
@@ -19,7 +19,7 @@ function FlexLayoutSplitScreenDragBoxContainer({
|
|
|
19
19
|
}
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
export {
|
|
23
|
+
FlexLayoutSplitScreenDragBoxContainer as default
|
|
24
|
+
};
|
|
25
25
|
//# sourceMappingURL=FlexLayoutSplitScreenDragBoxContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.tsx"],"
|
|
1
|
+
{"version":3,"sources":["../../../src/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.tsx"],"sourcesContent":["\"use client\";\r\nimport { HTMLAttributes } from \"react\";\r\nimport styles from \"../styles/FlexLayout.module.css\";\r\nimport FlexLayoutSplitScreenScrollBox from \"./FlexLayoutSplitScreenScrollBox\";\r\nexport interface FlexLayoutSplitScreenDragBoxContainerProps extends HTMLAttributes<HTMLDivElement> {\r\n\tlayoutName: string;\r\n}\r\n\r\nexport default function FlexLayoutSplitScreenDragBoxContainer({\r\n\tclassName,\r\n\tchildren,\r\n\tlayoutName,\r\n\t...props\r\n}: FlexLayoutSplitScreenDragBoxContainerProps) {\r\n\treturn (\r\n\t\t<FlexLayoutSplitScreenScrollBox\r\n\t\t\tkeyName={layoutName}\r\n\t\t\tclassName={`${styles[\"flex-split-screen-drag-box-title-container\"]} ${(className && className !== \"\" && className) || \"\"}`}\r\n\t\t\tdirection=\"x\"\r\n\t\t\t{...props}\r\n\t\t>\r\n\t\t\t{children}\r\n\t\t</FlexLayoutSplitScreenScrollBox>\r\n\t);\r\n}\r\n"],"mappings":";AAeE;AAbF,OAAO,YAAY;AACnB,OAAO,oCAAoC;AAK5B,SAAR,sCAAuD;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAA+C;AAC9C,SACC;AAAA,IAAC;AAAA;AAAA,MACA,SAAS;AAAA,MACT,WAAW,GAAG,OAAO,4CAA4C,CAAC,IAAK,aAAa,cAAc,MAAM,aAAc,EAAE;AAAA,MACxH,WAAU;AAAA,MACT,GAAG;AAAA,MAEH;AAAA;AAAA,EACF;AAEF;","names":[]}
|