@byeolnaerim/flex-layout 0.0.8 → 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 +96 -42
- 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 +44 -14
- 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,16 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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 FlexLayoutSplitScreenDragBox_exports = {};
|
|
31
|
+
__export(FlexLayoutSplitScreenDragBox_exports, {
|
|
32
|
+
default: () => FlexLayoutSplitScreenDragBox
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(FlexLayoutSplitScreenDragBox_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_react = require("react");
|
|
37
|
+
var import_useDrag = require("../hooks/useDrag");
|
|
38
|
+
var import_FlexLayout = __toESM(require("../styles/FlexLayout.module.css"), 1);
|
|
39
|
+
var import_FlexLayoutUtils = require("../utils/FlexLayoutUtils");
|
|
40
|
+
var import_FlexLayoutIFramePane = require("./FlexLayoutIFramePane");
|
|
13
41
|
const MAX_STEP = 18;
|
|
42
|
+
function shouldAllowViewportScroll(x, y) {
|
|
43
|
+
const w = window.innerWidth;
|
|
44
|
+
const h = window.innerHeight;
|
|
45
|
+
const marginX = w * 0.15;
|
|
46
|
+
const marginY = h * 0.15;
|
|
47
|
+
return x < marginX || // 왼쪽 15 %
|
|
48
|
+
x > w - marginX || // 오른쪽 15 %
|
|
49
|
+
y < marginY || // 상단 15 %
|
|
50
|
+
y > h - marginY;
|
|
51
|
+
}
|
|
14
52
|
function edgeVelocity(x, y) {
|
|
15
53
|
const w = window.innerWidth, h = window.innerHeight;
|
|
16
54
|
const mx = w * 0.15, my = h * 0.15;
|
|
@@ -26,6 +64,38 @@ function edgeVelocity(x, y) {
|
|
|
26
64
|
vy = (y - (h - my)) / my * MAX_STEP;
|
|
27
65
|
return { vx, vy };
|
|
28
66
|
}
|
|
67
|
+
function calcVelocity(dx, dy, x, y) {
|
|
68
|
+
const w = window.innerWidth, h = window.innerHeight;
|
|
69
|
+
const marginX = w * 0.15, marginY = h * 0.15;
|
|
70
|
+
const multX = x < marginX ? 1 + (marginX - x) / marginX * 3 : x > w - marginX ? 1 + (x - (w - marginX)) / marginX * 3 : 1;
|
|
71
|
+
const multY = y < marginY ? 1 + (marginY - y) / marginY * 3 : y > h - marginY ? 1 + (y - (h - marginY)) / marginY * 3 : 1;
|
|
72
|
+
return { vx: -dx * multX, vy: -dy * multY };
|
|
73
|
+
}
|
|
74
|
+
function createScreenKey() {
|
|
75
|
+
const c = globalThis.crypto;
|
|
76
|
+
if (c?.randomUUID) return c.randomUUID();
|
|
77
|
+
if (c?.getRandomValues) {
|
|
78
|
+
return Array.from(
|
|
79
|
+
c.getRandomValues(new Uint32Array(16)),
|
|
80
|
+
(e) => e.toString(32).padStart(2, "0")
|
|
81
|
+
).join("");
|
|
82
|
+
}
|
|
83
|
+
return `${Date.now().toString(32)}-${Math.random().toString(32).slice(2)}`;
|
|
84
|
+
}
|
|
85
|
+
function getFallbackElement(targetComponent, url) {
|
|
86
|
+
if (targetComponent) return targetComponent;
|
|
87
|
+
if (url) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_FlexLayoutIFramePane.FlexLayoutIFramePane, { url });
|
|
88
|
+
return void 0;
|
|
89
|
+
}
|
|
90
|
+
function titleFromUrl(url) {
|
|
91
|
+
if (!url) return void 0;
|
|
92
|
+
try {
|
|
93
|
+
const u = new URL(url);
|
|
94
|
+
return u.hostname;
|
|
95
|
+
} catch {
|
|
96
|
+
return url;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
29
99
|
function FlexLayoutSplitScreenDragBox({
|
|
30
100
|
onMouseDown,
|
|
31
101
|
onTouchStart,
|
|
@@ -37,26 +107,47 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
37
107
|
children,
|
|
38
108
|
className,
|
|
39
109
|
dropDocumentOutsideOption,
|
|
40
|
-
screenKey
|
|
41
|
-
window.crypto.getRandomValues(new Uint32Array(16)),
|
|
42
|
-
(e) => e.toString(32).padStart(2, "0")
|
|
43
|
-
).join(""),
|
|
110
|
+
screenKey: _screenKey,
|
|
44
111
|
isBlockingActiveInput = false,
|
|
45
112
|
customData = {},
|
|
46
113
|
scrollTargetRef,
|
|
47
114
|
...props
|
|
48
115
|
}) {
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
const
|
|
116
|
+
const [screenKey, setScreenKey] = (0, import_react.useState)();
|
|
117
|
+
(0, import_react.useEffect)(() => {
|
|
118
|
+
if (!_screenKey) setScreenKey(createScreenKey());
|
|
119
|
+
else setScreenKey(_screenKey);
|
|
120
|
+
}, [_screenKey]);
|
|
121
|
+
const scrollRAF = (0, import_react.useRef)(null);
|
|
122
|
+
const velocity = (0, import_react.useRef)({ vx: 0, vy: 0 });
|
|
123
|
+
const ref = (0, import_react.useRef)(null);
|
|
124
|
+
const clonedNodeRef = (0, import_react.useRef)(null);
|
|
125
|
+
const clonedWidth = (0, import_react.useRef)(null);
|
|
126
|
+
const clonedHeight = (0, import_react.useRef)(null);
|
|
127
|
+
const hrefUrlRef = (0, import_react.useRef)("");
|
|
128
|
+
const rafId = (0, import_react.useRef)(null);
|
|
129
|
+
const pending = (0, import_react.useRef)(null);
|
|
130
|
+
const lastPointRef = (0, import_react.useRef)({ x: 0, y: 0 });
|
|
131
|
+
const escCanceledRef = (0, import_react.useRef)(false);
|
|
132
|
+
const emitDragState = (v) => {
|
|
133
|
+
pending.current = v;
|
|
134
|
+
if (rafId.current != null) return;
|
|
135
|
+
rafId.current = requestAnimationFrame(() => {
|
|
136
|
+
if (pending.current) import_useDrag.dragStateSubject.next(pending.current);
|
|
137
|
+
pending.current = null;
|
|
138
|
+
rafId.current = null;
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
(0, import_react.useEffect)(() => {
|
|
142
|
+
return () => {
|
|
143
|
+
if (rafId.current != null) cancelAnimationFrame(rafId.current);
|
|
144
|
+
};
|
|
145
|
+
}, []);
|
|
146
|
+
const { handleStart, handleMove, handleEnd } = (0, import_useDrag.useDragEvents)({
|
|
57
147
|
isBlockingActiveInput
|
|
58
148
|
});
|
|
59
149
|
const handleMoveWrapper = (event) => {
|
|
150
|
+
let allowScrollEdge = false;
|
|
60
151
|
let x = 0;
|
|
61
152
|
let y = 0;
|
|
62
153
|
if (event.type === "touchmove") {
|
|
@@ -70,6 +161,7 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
70
161
|
}
|
|
71
162
|
const { vx, vy } = edgeVelocity(x, y);
|
|
72
163
|
const inEdge = vx !== 0 || vy !== 0;
|
|
164
|
+
allowScrollEdge = shouldAllowViewportScroll(x, y);
|
|
73
165
|
if (clonedNodeRef.current?.isConnected && !inEdge) {
|
|
74
166
|
event.preventDefault();
|
|
75
167
|
if (scrollRAF.current) {
|
|
@@ -114,19 +206,21 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
114
206
|
dragStartCallback: ({ x: x2, y: y2 }) => {
|
|
115
207
|
if (!clonedNodeRef.current) return;
|
|
116
208
|
navigator.vibrate(100);
|
|
117
|
-
clonedNodeRef.current.style.
|
|
118
|
-
clonedNodeRef.current.style.top = `${y2 - (clonedHeight.current || 0) / 2}px`;
|
|
209
|
+
clonedNodeRef.current.style.transform = `translate3d(${x2 - (clonedWidth.current || 0) / 2}px, ${y2 - (clonedHeight.current || 0) / 2}px, 0)`;
|
|
119
210
|
},
|
|
120
211
|
moveingCallback: ({ x: x2, y: y2 }) => {
|
|
212
|
+
lastPointRef.current = { x: x2, y: y2 };
|
|
121
213
|
if (clonedNodeRef.current?.isConnected) {
|
|
122
|
-
clonedNodeRef.current.style.
|
|
123
|
-
clonedNodeRef.current.style.top = `${y2 - (clonedHeight.current || 0) / 2}px`;
|
|
214
|
+
clonedNodeRef.current.style.transform = `translate3d(${x2 - (clonedWidth.current || 0) / 2}px, ${y2 - (clonedHeight.current || 0) / 2}px, 0)`;
|
|
124
215
|
}
|
|
125
|
-
|
|
216
|
+
emitDragState({
|
|
126
217
|
isDragging: true,
|
|
127
218
|
isDrop: false,
|
|
128
|
-
navigationTitle,
|
|
129
|
-
children:
|
|
219
|
+
navigationTitle: navigationTitle ?? titleFromUrl(dropDocumentOutsideOption?.openUrl),
|
|
220
|
+
children: getFallbackElement(
|
|
221
|
+
targetComponent,
|
|
222
|
+
dropDocumentOutsideOption?.openUrl
|
|
223
|
+
),
|
|
130
224
|
x: x2,
|
|
131
225
|
y: y2,
|
|
132
226
|
containerName,
|
|
@@ -142,12 +236,34 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
142
236
|
scrollRAF.current = null;
|
|
143
237
|
}
|
|
144
238
|
velocity.current = { vx: 0, vy: 0 };
|
|
239
|
+
if (event.type === "blur" || event.type === "touchcancel" || event.type === "pointercancel") {
|
|
240
|
+
if (clonedNodeRef.current) clonedNodeRef.current.remove();
|
|
241
|
+
}
|
|
145
242
|
handleEnd({
|
|
146
243
|
event,
|
|
147
244
|
dragEndCallback: ({ x, y }) => {
|
|
245
|
+
if (escCanceledRef.current) {
|
|
246
|
+
escCanceledRef.current = false;
|
|
247
|
+
if (clonedNodeRef.current) clonedNodeRef.current.remove();
|
|
248
|
+
emitDragState({
|
|
249
|
+
isDragging: false,
|
|
250
|
+
isDrop: false,
|
|
251
|
+
navigationTitle: navigationTitle ?? titleFromUrl(dropDocumentOutsideOption?.openUrl),
|
|
252
|
+
children: getFallbackElement(
|
|
253
|
+
targetComponent,
|
|
254
|
+
dropDocumentOutsideOption?.openUrl
|
|
255
|
+
),
|
|
256
|
+
x,
|
|
257
|
+
y,
|
|
258
|
+
containerName,
|
|
259
|
+
dropDocumentOutsideOption,
|
|
260
|
+
customData
|
|
261
|
+
});
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
148
264
|
const href = hrefUrlRef.current;
|
|
149
265
|
if (clonedNodeRef.current) clonedNodeRef.current.remove();
|
|
150
|
-
if (dropDocumentOutsideOption &&
|
|
266
|
+
if (dropDocumentOutsideOption && (0, import_FlexLayoutUtils.isDocumentOut)({ x, y })) {
|
|
151
267
|
if (dropDocumentOutsideOption.isNewTap || !dropDocumentOutsideOption.widthRatio && !dropDocumentOutsideOption.heightRatio) {
|
|
152
268
|
window.open(href, "_blank");
|
|
153
269
|
} else {
|
|
@@ -160,11 +276,14 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
160
276
|
);
|
|
161
277
|
}
|
|
162
278
|
}
|
|
163
|
-
|
|
279
|
+
emitDragState({
|
|
164
280
|
isDragging: false,
|
|
165
281
|
isDrop: true,
|
|
166
|
-
navigationTitle,
|
|
167
|
-
children:
|
|
282
|
+
navigationTitle: navigationTitle ?? titleFromUrl(dropDocumentOutsideOption?.openUrl),
|
|
283
|
+
children: getFallbackElement(
|
|
284
|
+
targetComponent,
|
|
285
|
+
dropDocumentOutsideOption?.openUrl
|
|
286
|
+
),
|
|
168
287
|
x,
|
|
169
288
|
y,
|
|
170
289
|
containerName,
|
|
@@ -176,7 +295,7 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
176
295
|
}
|
|
177
296
|
});
|
|
178
297
|
};
|
|
179
|
-
|
|
298
|
+
(0, import_react.useEffect)(() => {
|
|
180
299
|
if (ref.current) {
|
|
181
300
|
const clone = ref.current.cloneNode(true);
|
|
182
301
|
const originRect = ref.current.getBoundingClientRect();
|
|
@@ -192,24 +311,38 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
192
311
|
href.textContent = hrefUrlRef.current;
|
|
193
312
|
clone.prepend(href);
|
|
194
313
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
clone.prepend(title);
|
|
199
|
-
}
|
|
314
|
+
const title = document.createElement("span");
|
|
315
|
+
title.textContent = navigationTitle ?? titleFromUrl(dropDocumentOutsideOption?.openUrl) ?? "";
|
|
316
|
+
clone.prepend(title);
|
|
200
317
|
clone.style.position = "fixed";
|
|
318
|
+
clone.style.left = "0px";
|
|
319
|
+
clone.style.top = "0px";
|
|
320
|
+
clone.style.margin = "0px";
|
|
321
|
+
clone.style.willChange = "transform";
|
|
322
|
+
clone.style.transform = "translate3d(-9999px, -9999px, 0)";
|
|
323
|
+
clone.style.pointerEvents = "none";
|
|
201
324
|
clonedNodeRef.current = clone;
|
|
202
325
|
clonedNodeRef.current.classList.add(
|
|
203
|
-
|
|
326
|
+
import_FlexLayout.default["flex-split-screen-drag-box-clone"]
|
|
204
327
|
);
|
|
205
328
|
}
|
|
206
329
|
}, []);
|
|
207
|
-
|
|
330
|
+
(0, import_react.useEffect)(() => {
|
|
208
331
|
const moveEvents = [
|
|
209
332
|
"mousemove",
|
|
210
333
|
"touchmove"
|
|
211
334
|
];
|
|
212
|
-
const endEvents = [
|
|
335
|
+
const endEvents = [
|
|
336
|
+
"mouseup",
|
|
337
|
+
"touchend",
|
|
338
|
+
"touchcancel",
|
|
339
|
+
// 터치 제스처 시스템 인터럽트
|
|
340
|
+
"pointerup",
|
|
341
|
+
// 범용 포인터 이벤트
|
|
342
|
+
"pointercancel",
|
|
343
|
+
"blur"
|
|
344
|
+
// 윈도우 포커스 아웃 (Alt+Tab 등)
|
|
345
|
+
];
|
|
213
346
|
moveEvents.forEach((eventName) => {
|
|
214
347
|
window.addEventListener(eventName, handleMoveWrapper, {
|
|
215
348
|
passive: false
|
|
@@ -236,7 +369,7 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
236
369
|
navigationTitle,
|
|
237
370
|
dropEndCallback
|
|
238
371
|
]);
|
|
239
|
-
|
|
372
|
+
(0, import_react.useEffect)(() => {
|
|
240
373
|
const el = ref.current;
|
|
241
374
|
if (!el) return;
|
|
242
375
|
const onCtx = (e) => e.preventDefault();
|
|
@@ -245,10 +378,64 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
245
378
|
el.removeEventListener("contextmenu", onCtx);
|
|
246
379
|
};
|
|
247
380
|
}, []);
|
|
248
|
-
|
|
381
|
+
(0, import_react.useEffect)(() => {
|
|
382
|
+
return () => {
|
|
383
|
+
if (scrollRAF.current !== null) {
|
|
384
|
+
cancelAnimationFrame(scrollRAF.current);
|
|
385
|
+
scrollRAF.current = null;
|
|
386
|
+
}
|
|
387
|
+
velocity.current = { vx: 0, vy: 0 };
|
|
388
|
+
clonedNodeRef.current?.remove();
|
|
389
|
+
};
|
|
390
|
+
}, []);
|
|
391
|
+
(0, import_react.useEffect)(() => {
|
|
392
|
+
const onKeyDown = (e) => {
|
|
393
|
+
if (e.key !== "Escape") return;
|
|
394
|
+
if (!clonedNodeRef.current?.isConnected) return;
|
|
395
|
+
e.preventDefault();
|
|
396
|
+
e.stopPropagation();
|
|
397
|
+
escCanceledRef.current = true;
|
|
398
|
+
if (scrollRAF.current !== null) {
|
|
399
|
+
cancelAnimationFrame(scrollRAF.current);
|
|
400
|
+
scrollRAF.current = null;
|
|
401
|
+
}
|
|
402
|
+
velocity.current = { vx: 0, vy: 0 };
|
|
403
|
+
clonedNodeRef.current?.remove();
|
|
404
|
+
handleEnd({
|
|
405
|
+
event: new Event("pointercancel"),
|
|
406
|
+
dragEndCallback: () => {
|
|
407
|
+
}
|
|
408
|
+
});
|
|
409
|
+
const { x, y } = lastPointRef.current;
|
|
410
|
+
emitDragState({
|
|
411
|
+
isDragging: false,
|
|
412
|
+
isDrop: false,
|
|
413
|
+
navigationTitle: navigationTitle ?? titleFromUrl(dropDocumentOutsideOption?.openUrl),
|
|
414
|
+
children: getFallbackElement(
|
|
415
|
+
targetComponent,
|
|
416
|
+
dropDocumentOutsideOption?.openUrl
|
|
417
|
+
),
|
|
418
|
+
x,
|
|
419
|
+
y,
|
|
420
|
+
containerName,
|
|
421
|
+
dropDocumentOutsideOption,
|
|
422
|
+
customData
|
|
423
|
+
});
|
|
424
|
+
};
|
|
425
|
+
window.addEventListener("keydown", onKeyDown, true);
|
|
426
|
+
return () => window.removeEventListener("keydown", onKeyDown, true);
|
|
427
|
+
}, [
|
|
428
|
+
handleEnd,
|
|
429
|
+
containerName,
|
|
430
|
+
navigationTitle,
|
|
431
|
+
dropDocumentOutsideOption,
|
|
432
|
+
targetComponent,
|
|
433
|
+
customData
|
|
434
|
+
]);
|
|
435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
249
436
|
"div",
|
|
250
437
|
{
|
|
251
|
-
className: `${className || ""} ${
|
|
438
|
+
className: `${className || ""} ${import_FlexLayout.default["flex-split-screen-drag-box"]}`,
|
|
252
439
|
ref,
|
|
253
440
|
onContextMenu: (e) => e.preventDefault(),
|
|
254
441
|
onMouseDown: (ev) => {
|
|
@@ -258,6 +445,7 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
258
445
|
handleStart({
|
|
259
446
|
event: ev,
|
|
260
447
|
dragStartCallback: ({ x, y }) => {
|
|
448
|
+
lastPointRef.current = { x, y };
|
|
261
449
|
if (clonedNodeRef.current) {
|
|
262
450
|
document.body.appendChild(
|
|
263
451
|
clonedNodeRef.current
|
|
@@ -272,14 +460,18 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
272
460
|
}
|
|
273
461
|
if (clonedNodeRef.current?.isConnected) {
|
|
274
462
|
navigator.vibrate(100);
|
|
275
|
-
clonedNodeRef.current.style.
|
|
276
|
-
clonedNodeRef.current.style.top = `${y - (clonedHeight.current || 0) / 2}px`;
|
|
463
|
+
clonedNodeRef.current.style.transform = `translate3d(${x - (clonedWidth.current || 0) / 2}px, ${y - (clonedHeight.current || 0) / 2}px, 0)`;
|
|
277
464
|
}
|
|
278
|
-
|
|
465
|
+
emitDragState({
|
|
279
466
|
isDragging: true,
|
|
280
467
|
isDrop: false,
|
|
281
|
-
navigationTitle
|
|
282
|
-
|
|
468
|
+
navigationTitle: navigationTitle ?? titleFromUrl(
|
|
469
|
+
dropDocumentOutsideOption?.openUrl
|
|
470
|
+
),
|
|
471
|
+
children: getFallbackElement(
|
|
472
|
+
targetComponent,
|
|
473
|
+
dropDocumentOutsideOption?.openUrl
|
|
474
|
+
),
|
|
283
475
|
x,
|
|
284
476
|
y,
|
|
285
477
|
containerName,
|
|
@@ -310,14 +502,18 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
310
502
|
}
|
|
311
503
|
if (clonedNodeRef.current?.isConnected) {
|
|
312
504
|
navigator.vibrate(100);
|
|
313
|
-
clonedNodeRef.current.style.
|
|
314
|
-
clonedNodeRef.current.style.top = `${y - (clonedHeight.current || 0) / 2}px`;
|
|
505
|
+
clonedNodeRef.current.style.transform = `translate3d(${x - (clonedWidth.current || 0) / 2}px, ${y - (clonedHeight.current || 0) / 2}px, 0)`;
|
|
315
506
|
}
|
|
316
|
-
|
|
507
|
+
emitDragState({
|
|
317
508
|
isDragging: true,
|
|
318
509
|
isDrop: false,
|
|
319
|
-
navigationTitle
|
|
320
|
-
|
|
510
|
+
navigationTitle: navigationTitle ?? titleFromUrl(
|
|
511
|
+
dropDocumentOutsideOption?.openUrl
|
|
512
|
+
),
|
|
513
|
+
children: getFallbackElement(
|
|
514
|
+
targetComponent,
|
|
515
|
+
dropDocumentOutsideOption?.openUrl
|
|
516
|
+
),
|
|
321
517
|
x,
|
|
322
518
|
y,
|
|
323
519
|
containerName,
|
|
@@ -333,7 +529,4 @@ function FlexLayoutSplitScreenDragBox({
|
|
|
333
529
|
}
|
|
334
530
|
) });
|
|
335
531
|
}
|
|
336
|
-
|
|
337
|
-
module.exports = FlexLayoutSplitScreenDragBox;
|
|
338
|
-
//# sourceMappingURL=FlexLayoutSplitScreenDragBox.cjs.map
|
|
339
532
|
//# sourceMappingURL=FlexLayoutSplitScreenDragBox.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/flex-layout/components/FlexLayoutSplitScreenDragBox.tsx"],"names":["useRef","useDragEvents","x","y","dragState","isDocumentOut","useEffect","styles","jsx","Fragment"],"mappings":";;;;;;;;;;;;AAeA,MAAM,QAAA,GAAW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,cACA,QAAA,EAAU,eAAA;AAAA,cACV,CAAA;AAAA,cACA,CAAA;AAAA,cACA,aAAA;AAAA,cACA,yBAAA;AAAA,cACA;AAAA,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.cjs","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2GiB;AA1GjB,mBAWO;AACP,qBAIO;AAEP,wBAAmB;AACnB,6BAA8B;AAC9B,kCAAqC;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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gBACT;AAAA,gBACA,2BAA2B;AAAA,cAC5B;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,YACD,CAAC;AAAA,UACF;AAAA,QACD,CAAC;AAAA,MACF;AAAA,MACA,OAAO,EAAE,GAAG,MAAM;AAAA,MACjB,GAAG;AAAA,MAEH;AAAA;AAAA,EACF,GAED;AAEF;","names":["x","y","styles"]}
|
|
@@ -24,4 +24,4 @@ export interface DropDocumentOutsideOption {
|
|
|
24
24
|
heightRatio?: number;
|
|
25
25
|
isNewTap?: boolean;
|
|
26
26
|
}
|
|
27
|
-
export default function FlexLayoutSplitScreenDragBox<E extends HTMLElement>({ onMouseDown, onTouchStart, dropEndCallback, style, navigationTitle, targetComponent, containerName, children, className, dropDocumentOutsideOption, screenKey, isBlockingActiveInput, customData, scrollTargetRef, ...props }: FlexLayoutSplitScreenDragBoxProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export default function FlexLayoutSplitScreenDragBox<E extends HTMLElement>({ onMouseDown, onTouchStart, dropEndCallback, style, navigationTitle, targetComponent, containerName, children, className, dropDocumentOutsideOption, screenKey: _screenKey, isBlockingActiveInput, customData, scrollTargetRef, ...props }: FlexLayoutSplitScreenDragBoxProps): import("react/jsx-runtime").JSX.Element;
|