@byeolnaerim/flex-layout 0.0.6 → 0.0.7
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 +76 -0
- package/dist/flex-layout/components/FlexLayout.cjs.map +1 -0
- package/dist/flex-layout/components/FlexLayout.js +70 -0
- package/dist/flex-layout/components/FlexLayout.js.map +1 -0
- package/dist/flex-layout/components/FlexLayoutContainer.cjs +196 -0
- package/dist/flex-layout/components/FlexLayoutContainer.cjs.map +1 -0
- package/dist/flex-layout/components/FlexLayoutContainer.js +189 -0
- package/dist/flex-layout/components/FlexLayoutContainer.js.map +1 -0
- package/dist/flex-layout/components/FlexLayoutResizePanel.cjs +181 -0
- package/dist/flex-layout/components/FlexLayoutResizePanel.cjs.map +1 -0
- package/dist/flex-layout/components/FlexLayoutResizePanel.js +175 -0
- package/dist/flex-layout/components/FlexLayoutResizePanel.js.map +1 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreen.cjs +1211 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreen.cjs.map +1 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreen.js +1197 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreen.js.map +1 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBox.cjs +339 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBox.cjs.map +1 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBox.js +333 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBox.js.map +1 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.cjs +32 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.cjs.map +1 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.js +25 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.js.map +1 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxItem.cjs +40 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxItem.cjs.map +1 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxItem.d.ts +2 -2
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxItem.js +34 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxItem.js.map +1 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxTitleMore.cjs +30 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxTitleMore.cjs.map +1 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxTitleMore.d.ts +2 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxTitleMore.js +24 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxTitleMore.js.map +1 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreenScrollBox.cjs +109 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreenScrollBox.cjs.map +1 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreenScrollBox.js +103 -0
- package/dist/flex-layout/components/FlexLayoutSplitScreenScrollBox.js.map +1 -0
- package/dist/flex-layout/components/FlexLayoutStickyBox.cjs +226 -0
- package/dist/flex-layout/components/FlexLayoutStickyBox.cjs.map +1 -0
- package/dist/flex-layout/components/FlexLayoutStickyBox.d.ts +6 -6
- package/dist/flex-layout/components/FlexLayoutStickyBox.js +224 -0
- package/dist/flex-layout/components/FlexLayoutStickyBox.js.map +1 -0
- package/dist/flex-layout/components/index.cjs +52 -0
- package/dist/flex-layout/components/index.cjs.map +1 -0
- package/dist/flex-layout/components/index.js +9 -0
- package/dist/flex-layout/components/index.js.map +1 -0
- package/dist/flex-layout/hooks/index.cjs +21 -0
- package/dist/flex-layout/hooks/index.cjs.map +1 -0
- package/dist/flex-layout/hooks/index.js +4 -0
- package/dist/flex-layout/hooks/index.js.map +1 -0
- package/dist/{hooks.cjs → flex-layout/hooks/useDrag.cjs} +15 -208
- package/dist/flex-layout/hooks/useDrag.cjs.map +1 -0
- package/dist/flex-layout/hooks/useDrag.d.ts +4 -4
- package/dist/{hooks.js → flex-layout/hooks/useDrag.js} +13 -203
- package/dist/flex-layout/hooks/useDrag.js.map +1 -0
- package/dist/flex-layout/hooks/useFlexLayoutSplitScreen.cjs +118 -0
- package/dist/flex-layout/hooks/useFlexLayoutSplitScreen.cjs.map +1 -0
- package/dist/flex-layout/hooks/useFlexLayoutSplitScreen.js +116 -0
- package/dist/flex-layout/hooks/useFlexLayoutSplitScreen.js.map +1 -0
- package/dist/flex-layout/hooks/useListPaging.cjs +179 -0
- package/dist/flex-layout/hooks/useListPaging.cjs.map +1 -0
- package/dist/flex-layout/hooks/useListPaging.js +175 -0
- package/dist/flex-layout/hooks/useListPaging.js.map +1 -0
- package/dist/flex-layout/hooks/useSizes.cjs +104 -0
- package/dist/flex-layout/hooks/useSizes.cjs.map +1 -0
- package/dist/flex-layout/hooks/useSizes.js +101 -0
- package/dist/flex-layout/hooks/useSizes.js.map +1 -0
- package/dist/flex-layout/index.cjs +42 -0
- package/dist/flex-layout/index.cjs.map +1 -0
- package/dist/flex-layout/index.js +7 -0
- package/dist/flex-layout/index.js.map +1 -0
- package/dist/flex-layout/providers/FlexLayoutContext.cjs +26 -0
- package/dist/flex-layout/providers/FlexLayoutContext.cjs.map +1 -0
- package/dist/flex-layout/providers/FlexLayoutContext.d.ts +2 -1
- package/dist/flex-layout/providers/FlexLayoutContext.js +23 -0
- package/dist/flex-layout/providers/FlexLayoutContext.js.map +1 -0
- package/dist/{providers.cjs → flex-layout/providers/FlexLayoutHooks.cjs} +22 -186
- package/dist/flex-layout/providers/FlexLayoutHooks.cjs.map +1 -0
- package/dist/{providers.js → flex-layout/providers/FlexLayoutHooks.js} +14 -178
- package/dist/flex-layout/providers/FlexLayoutHooks.js.map +1 -0
- package/dist/flex-layout/providers/index.cjs +14 -0
- package/dist/flex-layout/providers/index.cjs.map +1 -0
- package/dist/flex-layout/providers/index.js +3 -0
- package/dist/flex-layout/providers/index.js.map +1 -0
- package/dist/{store.cjs → flex-layout/store/FlexLayoutContainerStore.cjs} +20 -21
- package/dist/flex-layout/store/FlexLayoutContainerStore.cjs.map +1 -0
- package/dist/flex-layout/store/FlexLayoutContainerStore.d.ts +2 -2
- package/dist/{store.js → flex-layout/store/FlexLayoutContainerStore.js} +20 -21
- package/dist/flex-layout/store/FlexLayoutContainerStore.js.map +1 -0
- package/dist/flex-layout/store/index.cjs +14 -0
- package/dist/flex-layout/store/index.cjs.map +1 -0
- package/dist/flex-layout/store/index.js +3 -0
- package/dist/flex-layout/store/index.js.map +1 -0
- package/dist/flex-layout/types/FlexDirectionTypes.cjs +4 -0
- package/dist/flex-layout/types/FlexDirectionTypes.cjs.map +1 -0
- package/dist/flex-layout/types/FlexDirectionTypes.js +3 -0
- package/dist/flex-layout/types/FlexDirectionTypes.js.map +1 -0
- package/dist/flex-layout/types/FlexLayoutTypes.cjs +4 -0
- package/dist/flex-layout/types/FlexLayoutTypes.cjs.map +1 -0
- package/dist/flex-layout/types/FlexLayoutTypes.d.ts +3 -3
- package/dist/flex-layout/types/FlexLayoutTypes.js +3 -0
- package/dist/flex-layout/types/FlexLayoutTypes.js.map +1 -0
- package/dist/{utils.cjs → flex-layout/utils/FlexLayoutUtils.cjs} +3 -4
- package/dist/flex-layout/utils/FlexLayoutUtils.cjs.map +1 -0
- package/dist/{utils.js → flex-layout/utils/FlexLayoutUtils.js} +3 -4
- package/dist/flex-layout/utils/FlexLayoutUtils.js.map +1 -0
- package/dist/flex-layout/utils/index.cjs +14 -0
- package/dist/flex-layout/utils/index.cjs.map +1 -0
- package/dist/flex-layout/utils/index.js +3 -0
- package/dist/flex-layout/utils/index.js.map +1 -0
- package/dist/index.cjs +7 -3451
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -3396
- package/dist/index.js.map +1 -1
- package/dist/types/css.d.cjs +4 -0
- package/dist/types/css.d.cjs.map +1 -0
- package/dist/types/css.d.js +3 -0
- package/dist/types/css.d.js.map +1 -0
- package/package.json +31 -2
- package/dist/components.cjs +0 -3042
- package/dist/components.cjs.map +0 -1
- package/dist/components.css +0 -471
- package/dist/components.css.map +0 -1
- package/dist/components.js +0 -3029
- package/dist/components.js.map +0 -1
- package/dist/hooks.cjs.map +0 -1
- package/dist/hooks.js.map +0 -1
- package/dist/index.css +0 -471
- package/dist/index.css.map +0 -1
- package/dist/providers.cjs.map +0 -1
- package/dist/providers.js.map +0 -1
- package/dist/store.cjs.map +0 -1
- package/dist/store.js.map +0 -1
- package/dist/utils.cjs.map +0 -1
- package/dist/utils.js.map +0 -1
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useRef, useState, useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
function clamp(n, min, max) {
|
|
5
|
+
return Math.max(min, Math.min(max, n));
|
|
6
|
+
}
|
|
7
|
+
function pickDefaultScrollRoot() {
|
|
8
|
+
if (typeof document === "undefined") return null;
|
|
9
|
+
let el = document.body;
|
|
10
|
+
while (el && el !== document.documentElement && el !== document.body) {
|
|
11
|
+
const style = getComputedStyle(el);
|
|
12
|
+
const oy = style.overflowY;
|
|
13
|
+
const ox = style.overflowX;
|
|
14
|
+
const scrollable = oy === "auto" || oy === "scroll" || ox === "auto" || ox === "scroll";
|
|
15
|
+
if (scrollable) return el;
|
|
16
|
+
el = el.parentElement;
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
function isVerticalScroll(root) {
|
|
21
|
+
if (typeof window == "undefined") return true;
|
|
22
|
+
if (!root) {
|
|
23
|
+
return document.documentElement.scrollHeight > window.innerHeight + 1;
|
|
24
|
+
}
|
|
25
|
+
const el = root;
|
|
26
|
+
return el.scrollHeight > el.clientHeight + 1;
|
|
27
|
+
}
|
|
28
|
+
const dpr = typeof window != "undefined" ? window.devicePixelRatio || 1 : 1;
|
|
29
|
+
function quantizeToDevicePixel(n) {
|
|
30
|
+
return Math.round(n * dpr) / dpr;
|
|
31
|
+
}
|
|
32
|
+
const FlexLayoutStickyBox = ({
|
|
33
|
+
edge = "auto",
|
|
34
|
+
offset = 16,
|
|
35
|
+
scrollRoot = null,
|
|
36
|
+
debug = false,
|
|
37
|
+
children,
|
|
38
|
+
style,
|
|
39
|
+
className,
|
|
40
|
+
onTranslateChange = () => {
|
|
41
|
+
},
|
|
42
|
+
...rest
|
|
43
|
+
}) => {
|
|
44
|
+
const offsetRef = useRef(offset);
|
|
45
|
+
const rootRef = useRef(null);
|
|
46
|
+
const contentRef = useRef(null);
|
|
47
|
+
const mutatingRef = useRef(false);
|
|
48
|
+
const lastOffsetRef = useRef(0);
|
|
49
|
+
const [resolvedEdge, setResolvedEdge] = useState("top");
|
|
50
|
+
const rafId = useRef(null);
|
|
51
|
+
const [contentDynamicStyle, setContentDynamicStyle] = useState({});
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
setContentDynamicStyle({
|
|
54
|
+
willChange: "transform",
|
|
55
|
+
transition: "transform 50ms linear"
|
|
56
|
+
});
|
|
57
|
+
}, []);
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
offsetRef.current = offset;
|
|
60
|
+
scheduleUpdate();
|
|
61
|
+
}, [offset]);
|
|
62
|
+
const [ioRoot, setIoRoot] = useState(null);
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
const root = scrollRoot ?? pickDefaultScrollRoot();
|
|
65
|
+
setResolvedEdge(
|
|
66
|
+
edge === "auto" ? isVerticalScroll(root) ? "top" : "left" : edge
|
|
67
|
+
);
|
|
68
|
+
setIoRoot(root);
|
|
69
|
+
}, [edge, scrollRoot]);
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
if (edge !== "auto") {
|
|
72
|
+
setResolvedEdge(edge);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const vertical = isVerticalScroll(ioRoot);
|
|
76
|
+
setResolvedEdge(vertical ? "top" : "left");
|
|
77
|
+
}, [edge, ioRoot]);
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
}, []);
|
|
80
|
+
const scheduleUpdate = () => {
|
|
81
|
+
if (rafId.current != null) return;
|
|
82
|
+
rafId.current = requestAnimationFrame(() => {
|
|
83
|
+
rafId.current = null;
|
|
84
|
+
doUpdate();
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
const doUpdate = () => {
|
|
88
|
+
if (mutatingRef.current) return;
|
|
89
|
+
mutatingRef.current = true;
|
|
90
|
+
const rootEl = rootRef.current;
|
|
91
|
+
const contentEl = contentRef.current;
|
|
92
|
+
if (!rootEl || !contentEl) {
|
|
93
|
+
mutatingRef.current = false;
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const parentEl = rootEl.parentElement;
|
|
97
|
+
if (!parentEl) {
|
|
98
|
+
mutatingRef.current = false;
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const rootBounds = ioRoot && "getBoundingClientRect" in ioRoot ? ioRoot.getBoundingClientRect() : new DOMRect(0, 0, window.innerWidth, window.innerHeight);
|
|
102
|
+
const parentRect = parentEl.getBoundingClientRect();
|
|
103
|
+
const contentRect = contentEl.getBoundingClientRect();
|
|
104
|
+
let newOffset = 0;
|
|
105
|
+
if (resolvedEdge === "top" || resolvedEdge === "bottom") {
|
|
106
|
+
const maxTranslate = Math.max(
|
|
107
|
+
0,
|
|
108
|
+
parentRect.height - contentRect.height
|
|
109
|
+
);
|
|
110
|
+
let desiredTop = 0;
|
|
111
|
+
if (resolvedEdge === "top") {
|
|
112
|
+
desiredTop = rootBounds.top + offsetRef.current - parentRect.top;
|
|
113
|
+
} else {
|
|
114
|
+
const targetBottomFromParentTop = Math.min(
|
|
115
|
+
parentRect.bottom,
|
|
116
|
+
rootBounds.bottom - offsetRef.current
|
|
117
|
+
) - parentRect.top;
|
|
118
|
+
desiredTop = targetBottomFromParentTop - contentRect.height;
|
|
119
|
+
}
|
|
120
|
+
newOffset = clamp(desiredTop, 0, maxTranslate);
|
|
121
|
+
} else {
|
|
122
|
+
const maxTranslate = Math.max(
|
|
123
|
+
0,
|
|
124
|
+
parentRect.width - contentRect.width
|
|
125
|
+
);
|
|
126
|
+
let desiredLeft = 0;
|
|
127
|
+
if (resolvedEdge === "left") {
|
|
128
|
+
desiredLeft = rootBounds.left + offsetRef.current - parentRect.left;
|
|
129
|
+
} else {
|
|
130
|
+
const targetRightFromParentLeft = Math.min(
|
|
131
|
+
parentRect.right,
|
|
132
|
+
rootBounds.right - offsetRef.current
|
|
133
|
+
) - parentRect.left;
|
|
134
|
+
desiredLeft = targetRightFromParentLeft - contentRect.width;
|
|
135
|
+
}
|
|
136
|
+
newOffset = clamp(desiredLeft, 0, maxTranslate);
|
|
137
|
+
}
|
|
138
|
+
const nextOffset = quantizeToDevicePixel(newOffset);
|
|
139
|
+
if (Math.abs(lastOffsetRef.current - nextOffset) > 0.5) {
|
|
140
|
+
if (resolvedEdge === "top" || resolvedEdge === "bottom") {
|
|
141
|
+
contentEl.style.transform = `translateY(${nextOffset}px)`;
|
|
142
|
+
} else {
|
|
143
|
+
contentEl.style.transform = `translateX(${nextOffset}px)`;
|
|
144
|
+
}
|
|
145
|
+
lastOffsetRef.current = nextOffset;
|
|
146
|
+
onTranslateChange(nextOffset, rootRef, contentRef);
|
|
147
|
+
}
|
|
148
|
+
if (debug) {
|
|
149
|
+
rootEl.style.outline = "1px dashed rgba(0,0,0,.2)";
|
|
150
|
+
contentEl.style.outline = "1px solid rgba(0,128,255,.35)";
|
|
151
|
+
}
|
|
152
|
+
queueMicrotask(() => {
|
|
153
|
+
mutatingRef.current = false;
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
useEffect(() => {
|
|
157
|
+
if (typeof window == "undefined") return;
|
|
158
|
+
const rootEl = rootRef.current;
|
|
159
|
+
if (!rootEl) return;
|
|
160
|
+
const parentEl = rootEl.parentElement;
|
|
161
|
+
console.log(parentEl);
|
|
162
|
+
if (!parentEl) return;
|
|
163
|
+
const targets = [parentEl];
|
|
164
|
+
const observerCallback = () => {
|
|
165
|
+
if (!mutatingRef.current) scheduleUpdate();
|
|
166
|
+
};
|
|
167
|
+
const io = new IntersectionObserver(observerCallback, {
|
|
168
|
+
root: ioRoot instanceof Element ? ioRoot : null,
|
|
169
|
+
threshold: 0,
|
|
170
|
+
rootMargin: "1px"
|
|
171
|
+
});
|
|
172
|
+
const ro = new ResizeObserver(observerCallback);
|
|
173
|
+
targets.forEach((t) => io.observe(t));
|
|
174
|
+
ro.observe(parentEl);
|
|
175
|
+
if (contentRef.current) {
|
|
176
|
+
ro.observe(contentRef.current);
|
|
177
|
+
}
|
|
178
|
+
const scrollTarget = ioRoot || window;
|
|
179
|
+
scrollTarget.addEventListener("scroll", scheduleUpdate, {
|
|
180
|
+
passive: true
|
|
181
|
+
});
|
|
182
|
+
window.addEventListener("resize", scheduleUpdate);
|
|
183
|
+
scheduleUpdate();
|
|
184
|
+
return () => {
|
|
185
|
+
io.disconnect();
|
|
186
|
+
ro.disconnect();
|
|
187
|
+
scrollTarget.removeEventListener("scroll", scheduleUpdate);
|
|
188
|
+
window.removeEventListener("resize", scheduleUpdate);
|
|
189
|
+
if (rafId.current != null) {
|
|
190
|
+
cancelAnimationFrame(rafId.current);
|
|
191
|
+
rafId.current = null;
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
}, [ioRoot, resolvedEdge, offset, debug]);
|
|
195
|
+
return /* @__PURE__ */ jsx(
|
|
196
|
+
"div",
|
|
197
|
+
{
|
|
198
|
+
ref: rootRef,
|
|
199
|
+
className,
|
|
200
|
+
style: {
|
|
201
|
+
display: "block",
|
|
202
|
+
minWidth: 0,
|
|
203
|
+
minHeight: 0,
|
|
204
|
+
height: "100%",
|
|
205
|
+
// 부모 높이를 채우도록 설정
|
|
206
|
+
...style
|
|
207
|
+
},
|
|
208
|
+
...rest,
|
|
209
|
+
children: /* @__PURE__ */ jsx(
|
|
210
|
+
"div",
|
|
211
|
+
{
|
|
212
|
+
ref: contentRef,
|
|
213
|
+
style: contentDynamicStyle,
|
|
214
|
+
children
|
|
215
|
+
}
|
|
216
|
+
)
|
|
217
|
+
}
|
|
218
|
+
);
|
|
219
|
+
};
|
|
220
|
+
var FlexLayoutStickyBox_default = FlexLayoutStickyBox;
|
|
221
|
+
|
|
222
|
+
export { FlexLayoutStickyBox_default as default };
|
|
223
|
+
//# sourceMappingURL=FlexLayoutStickyBox.js.map
|
|
224
|
+
//# sourceMappingURL=FlexLayoutStickyBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/flex-layout/components/FlexLayoutStickyBox.tsx"],"names":[],"mappings":";;;AAiCA,SAAS,KAAA,CAAM,CAAA,EAAW,GAAA,EAAa,GAAA,EAAa;AACnD,EAAA,OAAO,KAAK,GAAA,CAAI,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA,EAAK,CAAC,CAAC,CAAA;AACtC;AAEA,SAAS,qBAAA,GAAwC;AAChD,EAAA,IAAI,OAAO,QAAA,KAAa,WAAA,EAAa,OAAO,IAAA;AAE5C,EAAA,IAAI,KAAqB,QAAA,CAAS,IAAA;AAClC,EAAA,OAAO,MAAM,EAAA,KAAO,QAAA,CAAS,eAAA,IAAmB,EAAA,KAAO,SAAS,IAAA,EAAM;AACrE,IAAA,MAAM,KAAA,GAAQ,iBAAiB,EAAE,CAAA;AACjC,IAAA,MAAM,KAAK,KAAA,CAAM,SAAA;AACjB,IAAA,MAAM,KAAK,KAAA,CAAM,SAAA;AACjB,IAAA,MAAM,aACL,EAAA,KAAO,MAAA,IACP,OAAO,QAAA,IACP,EAAA,KAAO,UACP,EAAA,KAAO,QAAA;AACR,IAAA,IAAI,YAAY,OAAO,EAAA;AACvB,IAAA,EAAA,GAAK,EAAA,CAAG,aAAA;AAAA,EACT;AACA,EAAA,OAAO,IAAA;AACR;AAEA,SAAS,iBAAiB,IAAA,EAA+B;AACxD,EAAA,IAAI,OAAO,MAAA,IAAU,WAAA,EAAa,OAAO,IA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EA,IAAO,2BAAA,GAAQ","file":"FlexLayoutStickyBox.js","sourcesContent":["\"use client\";\r\nimport {\r\n\tCSSProperties,\r\n\tFC,\r\n\tHTMLAttributes,\r\n\tReactNode,\r\n\tRefObject,\r\n\tuseEffect,\r\n\tuseRef,\r\n\tuseState,\r\n} from \"react\";\r\n\r\ntype Edge = \"auto\" | \"top\" | \"bottom\" | \"left\" | \"right\";\r\n\r\ninterface FlexLayoutStickyBoxProps extends HTMLAttributes<HTMLDivElement> {\r\n\t/** 어느 방향으로 붙일지. 기본은 'auto' (세로 스크롤이면 top, 가로 스크롤이면 left) */\r\n\tedge?: Edge;\r\n\t/** 화면 모서리와의 여백(px). 기본 16 */\r\n\toffset?: number;\r\n\t/** 스크롤 루트. 명시 안 하면 가장 흔한 케이스인 <main> → 없으면 window(=viewport) */\r\n\tscrollRoot?: Element | null;\r\n\t/** 디버그 보조선 표시 */\r\n\tdebug?: boolean;\r\n\t/** 자식 */\r\n\tchildren: ReactNode;\r\n\r\n\tonTranslateChange?: (\r\n\t\tvalue: number,\r\n\t\trootRef: RefObject<HTMLDivElement | null>,\r\n\t\tcontentRef: RefObject<HTMLDivElement | null>,\r\n\t) => void;\r\n}\r\n\r\nfunction clamp(n: number, min: number, max: number) {\r\n\treturn Math.max(min, Math.min(max, n));\r\n}\r\n\r\nfunction pickDefaultScrollRoot(): Element | null {\r\n\tif (typeof document === \"undefined\") return null;\r\n\r\n\tlet el: Element | null = document.body;\r\n\twhile (el && el !== document.documentElement && el !== document.body) {\r\n\t\tconst style = getComputedStyle(el);\r\n\t\tconst oy = style.overflowY;\r\n\t\tconst ox = style.overflowX;\r\n\t\tconst scrollable =\r\n\t\t\toy === \"auto\" ||\r\n\t\t\toy === \"scroll\" ||\r\n\t\t\tox === \"auto\" ||\r\n\t\t\tox === \"scroll\";\r\n\t\tif (scrollable) return el;\r\n\t\tel = el.parentElement;\r\n\t}\r\n\treturn null;\r\n}\r\n\r\nfunction isVerticalScroll(root: Element | null): boolean {\r\n\tif (typeof window == \"undefined\") return true;\r\n\tif (!root) {\r\n\t\treturn document.documentElement.scrollHeight > window.innerHeight + 1;\r\n\t}\r\n\tconst el = root as HTMLElement;\r\n\treturn el.scrollHeight > el.clientHeight + 1;\r\n}\r\n\r\nconst dpr = typeof window != \"undefined\" ? window.devicePixelRatio || 1 : 1;\r\nfunction quantizeToDevicePixel(n: number) {\r\n\treturn Math.round(n * dpr) / dpr;\r\n}\r\n\r\n/**\r\n * FlexLayoutStickyBox\r\n * 부모(실제 경계) 안에서만 움직이며, `transform`을 동적으로 부여해\r\n * “sticky처럼 보이도록” 만든다.\r\n *\r\n * 구조:\r\n * <div data-root> // 이 박스가 부모 경계 안에서 공간을 차지\r\n * <div data-content> // 이 박스가 transform으로 부드럽게 움직임\r\n * {children}\r\n * </div>\r\n * </div>\r\n */\r\nconst FlexLayoutStickyBox: FC<FlexLayoutStickyBoxProps> = ({\r\n\tedge = \"auto\",\r\n\toffset = 16,\r\n\tscrollRoot = null,\r\n\tdebug = false,\r\n\tchildren,\r\n\tstyle,\r\n\tclassName,\r\n\tonTranslateChange = () => {},\r\n\t...rest\r\n}) => {\r\n\tconst offsetRef = useRef(offset);\r\n\tconst rootRef = useRef<HTMLDivElement>(null); // 내가 들어있는 박스(부모의 자식)\r\n\tconst contentRef = useRef<HTMLDivElement>(null); // 실제 내용\r\n\tconst mutatingRef = useRef(false);\r\n\tconst lastOffsetRef = useRef(0);\r\n\tconst [resolvedEdge, setResolvedEdge] = useState<Edge>(\"top\");\r\n\tconst rafId = useRef<number | null>(null);\r\n\r\n\t// 마운트 이후에만(클라이언트에서만) 터치 스타일을 적용\r\n\tconst [contentDynamicStyle, setContentDynamicStyle] =\r\n\t\tuseState<CSSProperties>({});\r\n\tuseEffect(() => {\r\n\t\t// if (\r\n\t\t// typeof navigator !== 'undefined' &&\r\n\t\t// (navigator.maxTouchPoints ?? 0) > 0\r\n\t\t// ) {\r\n\t\tsetContentDynamicStyle({\r\n\t\t\twillChange: \"transform\",\r\n\t\t\ttransition: \"transform 50ms linear\",\r\n\t\t});\r\n\t\t// }\r\n\t}, []);\r\n\r\n\tuseEffect(() => {\r\n\t\toffsetRef.current = offset;\r\n\t\tscheduleUpdate();\r\n\t}, [offset]);\r\n\tconst [ioRoot, setIoRoot] = useState<Element | null>(null);\r\n\tuseEffect(() => {\r\n\t\t// CSR로 전환된 후에 반드시 최신 scroll root를 계산\r\n\t\tconst root = scrollRoot ?? pickDefaultScrollRoot();\r\n\t\tsetResolvedEdge(\r\n\t\t\tedge === \"auto\" ? (isVerticalScroll(root) ? \"top\" : \"left\") : edge,\r\n\t\t);\r\n\r\n\t\tsetIoRoot(root);\r\n\t}, [edge, scrollRoot]);\r\n\tuseEffect(() => {\r\n\t\tif (edge !== \"auto\") {\r\n\t\t\tsetResolvedEdge(edge);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst vertical = isVerticalScroll(ioRoot);\r\n\t\tsetResolvedEdge(vertical ? \"top\" : \"left\");\r\n\t}, [edge, ioRoot]);\r\n\r\n\tuseEffect(() => {}, []);\r\n\r\n\tconst scheduleUpdate = () => {\r\n\t\tif (rafId.current != null) return;\r\n\t\trafId.current = requestAnimationFrame(() => {\r\n\t\t\trafId.current = null;\r\n\t\t\tdoUpdate();\r\n\t\t});\r\n\t};\r\n\r\n\tconst doUpdate = () => {\r\n\t\tif (mutatingRef.current) return;\r\n\t\tmutatingRef.current = true;\r\n\r\n\t\tconst rootEl = rootRef.current;\r\n\t\tconst contentEl = contentRef.current;\r\n\t\tif (!rootEl || !contentEl) {\r\n\t\t\tmutatingRef.current = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst parentEl = rootEl.parentElement;\r\n\t\tif (!parentEl) {\r\n\t\t\tmutatingRef.current = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst rootBounds =\r\n\t\t\tioRoot && \"getBoundingClientRect\" in ioRoot\r\n\t\t\t\t? (ioRoot as Element).getBoundingClientRect()\r\n\t\t\t\t: new DOMRect(0, 0, window.innerWidth, window.innerHeight);\r\n\r\n\t\tconst parentRect = parentEl.getBoundingClientRect();\r\n\t\tconst contentRect = contentEl.getBoundingClientRect();\r\n\r\n\t\tlet newOffset = 0;\r\n\r\n\t\tif (resolvedEdge === \"top\" || resolvedEdge === \"bottom\") {\r\n\t\t\tconst maxTranslate = Math.max(\r\n\t\t\t\t0,\r\n\t\t\t\tparentRect.height - contentRect.height,\r\n\t\t\t);\r\n\t\t\tlet desiredTop = 0;\r\n\r\n\t\t\tif (resolvedEdge === \"top\") {\r\n\t\t\t\tdesiredTop =\r\n\t\t\t\t\trootBounds.top + offsetRef.current - parentRect.top;\r\n\t\t\t} else {\r\n\t\t\t\t// bottom\r\n\t\t\t\tconst targetBottomFromParentTop =\r\n\t\t\t\t\tMath.min(\r\n\t\t\t\t\t\tparentRect.bottom,\r\n\t\t\t\t\t\trootBounds.bottom - offsetRef.current,\r\n\t\t\t\t\t) - parentRect.top;\r\n\t\t\t\tdesiredTop = targetBottomFromParentTop - contentRect.height;\r\n\t\t\t}\r\n\t\t\tnewOffset = clamp(desiredTop, 0, maxTranslate);\r\n\t\t} else {\r\n\t\t\t// left or right\r\n\t\t\tconst maxTranslate = Math.max(\r\n\t\t\t\t0,\r\n\t\t\t\tparentRect.width - contentRect.width,\r\n\t\t\t);\r\n\t\t\tlet desiredLeft = 0;\r\n\r\n\t\t\tif (resolvedEdge === \"left\") {\r\n\t\t\t\tdesiredLeft =\r\n\t\t\t\t\trootBounds.left + offsetRef.current - parentRect.left;\r\n\t\t\t} else {\r\n\t\t\t\t// right\r\n\t\t\t\tconst targetRightFromParentLeft =\r\n\t\t\t\t\tMath.min(\r\n\t\t\t\t\t\tparentRect.right,\r\n\t\t\t\t\t\trootBounds.right - offsetRef.current,\r\n\t\t\t\t\t) - parentRect.left;\r\n\t\t\t\tdesiredLeft = targetRightFromParentLeft - contentRect.width;\r\n\t\t\t}\r\n\t\t\tnewOffset = clamp(desiredLeft, 0, maxTranslate);\r\n\t\t}\r\n\r\n\t\tconst nextOffset = quantizeToDevicePixel(newOffset);\r\n\r\n\t\t// 변화가 거의 없으면 업데이트 건너뛰기 (미세한 떨림 방지)\r\n\t\tif (Math.abs(lastOffsetRef.current - nextOffset) > 0.5) {\r\n\t\t\tif (resolvedEdge === \"top\" || resolvedEdge === \"bottom\") {\r\n\t\t\t\tcontentEl.style.transform = `translateY(${nextOffset}px)`;\r\n\t\t\t} else {\r\n\t\t\t\tcontentEl.style.transform = `translateX(${nextOffset}px)`;\r\n\t\t\t}\r\n\t\t\tlastOffsetRef.current = nextOffset;\r\n\t\t\tonTranslateChange(nextOffset, rootRef, contentRef);\r\n\t\t}\r\n\r\n\t\tif (debug) {\r\n\t\t\trootEl.style.outline = \"1px dashed rgba(0,0,0,.2)\";\r\n\t\t\tcontentEl.style.outline = \"1px solid rgba(0,128,255,.35)\";\r\n\t\t}\r\n\r\n\t\tqueueMicrotask(() => {\r\n\t\t\tmutatingRef.current = false;\r\n\t\t});\r\n\t};\r\n\r\n\t// IntersectionObserver, ResizeObserver, Event Listeners 설정\r\n\tuseEffect(() => {\r\n\t\tif (typeof window == \"undefined\") return;\r\n\t\tconst rootEl = rootRef.current;\r\n\t\tif (!rootEl) return;\r\n\r\n\t\tconst parentEl = rootEl.parentElement;\r\n\r\n\t\tconsole.log(parentEl);\r\n\t\tif (!parentEl) return;\r\n\r\n\t\tconst targets: Element[] = [parentEl];\r\n\r\n\t\tconst observerCallback = () => {\r\n\t\t\tif (!mutatingRef.current) scheduleUpdate();\r\n\t\t};\r\n\r\n\t\tconst io = new IntersectionObserver(observerCallback, {\r\n\t\t\troot: ioRoot instanceof Element ? ioRoot : null,\r\n\t\t\tthreshold: 0,\r\n\t\t\trootMargin: \"1px\",\r\n\t\t});\r\n\r\n\t\tconst ro = new ResizeObserver(observerCallback);\r\n\r\n\t\ttargets.forEach((t) => io.observe(t));\r\n\t\tro.observe(parentEl);\r\n\t\tif (contentRef.current) {\r\n\t\t\tro.observe(contentRef.current);\r\n\t\t}\r\n\r\n\t\tconst scrollTarget = ioRoot || window;\r\n\t\tscrollTarget.addEventListener(\"scroll\", scheduleUpdate, {\r\n\t\t\tpassive: true,\r\n\t\t});\r\n\t\twindow.addEventListener(\"resize\", scheduleUpdate);\r\n\r\n\t\t// 최초 1회 계산\r\n\t\tscheduleUpdate();\r\n\r\n\t\treturn () => {\r\n\t\t\tio.disconnect();\r\n\t\t\tro.disconnect();\r\n\t\t\tscrollTarget.removeEventListener(\"scroll\", scheduleUpdate);\r\n\t\t\twindow.removeEventListener(\"resize\", scheduleUpdate);\r\n\t\t\tif (rafId.current != null) {\r\n\t\t\t\tcancelAnimationFrame(rafId.current);\r\n\t\t\t\trafId.current = null;\r\n\t\t\t}\r\n\t\t};\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [ioRoot, resolvedEdge, offset, debug]);\r\n\r\n\treturn (\r\n\t\t<div\r\n\t\t\tref={rootRef}\r\n\t\t\tclassName={className}\r\n\t\t\tstyle={{\r\n\t\t\t\tdisplay: \"block\",\r\n\t\t\t\tminWidth: 0,\r\n\t\t\t\tminHeight: 0,\r\n\t\t\t\theight: \"100%\", // 부모 높이를 채우도록 설정\r\n\t\t\t\t...style,\r\n\t\t\t}}\r\n\t\t\t{...rest}\r\n\t\t>\r\n\t\t\t<div\r\n\t\t\t\tref={contentRef}\r\n\t\t\t\t// SSR/클라이언트 첫 렌더 동일 → 마운트 후에만 스타일 부여\r\n\t\t\t\tstyle={contentDynamicStyle}\r\n\t\t\t>\r\n\t\t\t\t{children}\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nexport default FlexLayoutStickyBox;\r\n"]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var FlexLayout = require('./FlexLayout');
|
|
4
|
+
var FlexLayoutContainer = require('./FlexLayoutContainer');
|
|
5
|
+
var FlexLayoutResizePanel = require('./FlexLayoutResizePanel');
|
|
6
|
+
var FlexLayoutSplitScreen = require('./FlexLayoutSplitScreen');
|
|
7
|
+
var FlexLayoutSplitScreenDragBox = require('./FlexLayoutSplitScreenDragBox');
|
|
8
|
+
var FlexLayoutSplitScreenScrollBox = require('./FlexLayoutSplitScreenScrollBox');
|
|
9
|
+
var FlexLayoutStickyBox = require('./FlexLayoutStickyBox');
|
|
10
|
+
|
|
11
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
|
|
13
|
+
var FlexLayout__default = /*#__PURE__*/_interopDefault(FlexLayout);
|
|
14
|
+
var FlexLayoutContainer__default = /*#__PURE__*/_interopDefault(FlexLayoutContainer);
|
|
15
|
+
var FlexLayoutResizePanel__default = /*#__PURE__*/_interopDefault(FlexLayoutResizePanel);
|
|
16
|
+
var FlexLayoutSplitScreen__default = /*#__PURE__*/_interopDefault(FlexLayoutSplitScreen);
|
|
17
|
+
var FlexLayoutSplitScreenDragBox__default = /*#__PURE__*/_interopDefault(FlexLayoutSplitScreenDragBox);
|
|
18
|
+
var FlexLayoutSplitScreenScrollBox__default = /*#__PURE__*/_interopDefault(FlexLayoutSplitScreenScrollBox);
|
|
19
|
+
var FlexLayoutStickyBox__default = /*#__PURE__*/_interopDefault(FlexLayoutStickyBox);
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
Object.defineProperty(exports, "FlexLayout", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () { return FlexLayout__default.default; }
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(exports, "FlexLayoutContainer", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () { return FlexLayoutContainer__default.default; }
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "FlexLayoutResizePanel", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () { return FlexLayoutResizePanel__default.default; }
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(exports, "FlexLayoutSplitScreen", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () { return FlexLayoutSplitScreen__default.default; }
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(exports, "FlexLayoutSplitScreenDragBox", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () { return FlexLayoutSplitScreenDragBox__default.default; }
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(exports, "FlexLayoutSplitScreenScrollBox", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () { return FlexLayoutSplitScreenScrollBox__default.default; }
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(exports, "FlexLayoutStickyBox", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function () { return FlexLayoutStickyBox__default.default; }
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=index.cjs.map
|
|
52
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs","sourcesContent":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as FlexLayout } from './FlexLayout';
|
|
2
|
+
export { default as FlexLayoutContainer } from './FlexLayoutContainer';
|
|
3
|
+
export { default as FlexLayoutResizePanel } from './FlexLayoutResizePanel';
|
|
4
|
+
export { default as FlexLayoutSplitScreen } from './FlexLayoutSplitScreen';
|
|
5
|
+
export { default as FlexLayoutSplitScreenDragBox } from './FlexLayoutSplitScreenDragBox';
|
|
6
|
+
export { default as FlexLayoutSplitScreenScrollBox } from './FlexLayoutSplitScreenScrollBox';
|
|
7
|
+
export { default as FlexLayoutStickyBox } from './FlexLayoutStickyBox';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var useDrag = require('./useDrag');
|
|
4
|
+
var useListPaging = require('./useListPaging');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.keys(useDrag).forEach(function (k) {
|
|
9
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return useDrag[k]; }
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
Object.keys(useListPaging).forEach(function (k) {
|
|
15
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return useListPaging[k]; }
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=index.cjs.map
|
|
21
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs","sourcesContent":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
|
|
@@ -3,39 +3,18 @@
|
|
|
3
3
|
var equal = require('fast-deep-equal');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
var rxjs = require('rxjs');
|
|
6
|
+
var FlexLayoutUtils = require('../utils/FlexLayoutUtils');
|
|
6
7
|
|
|
7
8
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
9
|
|
|
9
10
|
var equal__default = /*#__PURE__*/_interopDefault(equal);
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// src/flex-layout/utils/FlexLayoutUtils.ts
|
|
14
|
-
var lastTouchEvent;
|
|
15
|
-
function getClientXy(event) {
|
|
16
|
-
let clientX;
|
|
17
|
-
let clientY;
|
|
18
|
-
if (window.MouseEvent && event instanceof window.MouseEvent) {
|
|
19
|
-
clientX = event.clientX;
|
|
20
|
-
clientY = event.clientY;
|
|
21
|
-
} else if (window.TouchEvent && event instanceof window.TouchEvent) {
|
|
22
|
-
const _event = event.touches.length == 0 ? lastTouchEvent : event;
|
|
23
|
-
clientX = _event.touches[0].clientX;
|
|
24
|
-
clientY = _event.touches[0].clientY;
|
|
25
|
-
lastTouchEvent = event;
|
|
26
|
-
} else {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
return { clientX, clientY };
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// src/flex-layout/hooks/useDrag.ts
|
|
33
|
-
var dragState = new rxjs.Subject();
|
|
34
|
-
var filterChildren = (obj) => {
|
|
12
|
+
const dragState = new rxjs.Subject();
|
|
13
|
+
const filterChildren = (obj) => {
|
|
35
14
|
const { children, ...rest } = obj || {};
|
|
36
15
|
return rest;
|
|
37
16
|
};
|
|
38
|
-
|
|
17
|
+
const useDragCapture = (targetRef) => {
|
|
39
18
|
const stateRef = react.useRef(null);
|
|
40
19
|
const forceUpdate = react.useRef(0);
|
|
41
20
|
react.useEffect(() => {
|
|
@@ -102,9 +81,9 @@ var useDragCapture = (targetRef) => {
|
|
|
102
81
|
}, []);
|
|
103
82
|
return stateRef.current;
|
|
104
83
|
};
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
84
|
+
const dropMovementEventSubject = new rxjs.Subject();
|
|
85
|
+
const allSplitScreenCount = new rxjs.BehaviorSubject(0);
|
|
86
|
+
const useDragEvents = ({
|
|
108
87
|
isBlockingActiveInput = false
|
|
109
88
|
}) => {
|
|
110
89
|
const dragResumeTimer = react.useRef(null);
|
|
@@ -145,7 +124,7 @@ var useDragEvents = ({
|
|
|
145
124
|
if (!isPending.current || isScrolling.current) return;
|
|
146
125
|
isPending.current = false;
|
|
147
126
|
isDragging.current = true;
|
|
148
|
-
const xy = getClientXy(event);
|
|
127
|
+
const xy = FlexLayoutUtils.getClientXy(event);
|
|
149
128
|
if (!xy) return;
|
|
150
129
|
const { clientX, clientY } = xy;
|
|
151
130
|
dragStartCallback({ x: clientX, y: clientY });
|
|
@@ -162,7 +141,7 @@ var useDragEvents = ({
|
|
|
162
141
|
}) => {
|
|
163
142
|
if (!isMouseDown.current) return;
|
|
164
143
|
const event = _event instanceof Event ? _event : _event.nativeEvent;
|
|
165
|
-
const xy = getClientXy(event);
|
|
144
|
+
const xy = FlexLayoutUtils.getClientXy(event);
|
|
166
145
|
if (!xy) return;
|
|
167
146
|
const { clientX, clientY } = xy;
|
|
168
147
|
const deltaX = Math.abs(clientX - touchStartX.current);
|
|
@@ -206,7 +185,7 @@ var useDragEvents = ({
|
|
|
206
185
|
const event = _event instanceof Event ? _event : _event.nativeEvent;
|
|
207
186
|
if (!isDragging.current) return;
|
|
208
187
|
isDragging.current = false;
|
|
209
|
-
const xy = getClientXy(event);
|
|
188
|
+
const xy = FlexLayoutUtils.getClientXy(event);
|
|
210
189
|
if (!xy) return;
|
|
211
190
|
const { clientX, clientY } = xy;
|
|
212
191
|
dragEndCallback({ x: clientX, y: clientY });
|
|
@@ -219,11 +198,11 @@ var useDragEvents = ({
|
|
|
219
198
|
handleEnd
|
|
220
199
|
};
|
|
221
200
|
};
|
|
222
|
-
|
|
223
|
-
|
|
201
|
+
const folderEventSubject = new rxjs.Subject();
|
|
202
|
+
const setFolderEvent = (newValue) => {
|
|
224
203
|
folderEventSubject.next(newValue);
|
|
225
204
|
};
|
|
226
|
-
|
|
205
|
+
const useFolderEvent = () => {
|
|
227
206
|
const [folderEvent, setFolderEvent2] = react.useState(
|
|
228
207
|
null
|
|
229
208
|
);
|
|
@@ -240,175 +219,6 @@ var useFolderEvent = () => {
|
|
|
240
219
|
}, []);
|
|
241
220
|
return { folderEvent };
|
|
242
221
|
};
|
|
243
|
-
var useListPagingForSentinel = ({
|
|
244
|
-
//initPageNumber,
|
|
245
|
-
//initPageSize,
|
|
246
|
-
onReachTerminal
|
|
247
|
-
}) => {
|
|
248
|
-
const [firstChildNode, setFirstChildNode] = react.useState(null);
|
|
249
|
-
const [lastChildNode, setLastChildNode] = react.useState(null);
|
|
250
|
-
const observerRef = react.useRef(null);
|
|
251
|
-
const firstChildRef = react.useCallback((node) => {
|
|
252
|
-
setFirstChildNode(node);
|
|
253
|
-
}, []);
|
|
254
|
-
const lastChildRef = react.useCallback((node) => {
|
|
255
|
-
setLastChildNode(node);
|
|
256
|
-
}, []);
|
|
257
|
-
react.useEffect(() => {
|
|
258
|
-
if (firstChildNode && observerRef.current)
|
|
259
|
-
observerRef.current.unobserve(firstChildNode);
|
|
260
|
-
if (lastChildNode && observerRef.current)
|
|
261
|
-
observerRef.current.unobserve(lastChildNode);
|
|
262
|
-
const handleIntersect = (entries, observer2) => {
|
|
263
|
-
entries.forEach((entry) => {
|
|
264
|
-
if (entry.isIntersecting) {
|
|
265
|
-
if (entry.target === firstChildNode) {
|
|
266
|
-
if (onReachTerminal)
|
|
267
|
-
onReachTerminal({
|
|
268
|
-
isFirst: true,
|
|
269
|
-
isLast: false,
|
|
270
|
-
observer: observer2
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
if (entry.target === lastChildNode) {
|
|
274
|
-
if (onReachTerminal)
|
|
275
|
-
onReachTerminal({
|
|
276
|
-
isFirst: false,
|
|
277
|
-
isLast: true,
|
|
278
|
-
observer: observer2
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
});
|
|
283
|
-
};
|
|
284
|
-
const observer = new IntersectionObserver(handleIntersect, {
|
|
285
|
-
threshold: 0.1
|
|
286
|
-
});
|
|
287
|
-
observerRef.current = observer;
|
|
288
|
-
if (firstChildNode) observer.observe(firstChildNode);
|
|
289
|
-
if (lastChildNode) observer.observe(lastChildNode);
|
|
290
|
-
return () => {
|
|
291
|
-
if (observerRef.current) {
|
|
292
|
-
observerRef.current.disconnect();
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
}, [firstChildNode, lastChildNode]);
|
|
296
|
-
return {
|
|
297
|
-
firstChildRef,
|
|
298
|
-
lastChildRef
|
|
299
|
-
};
|
|
300
|
-
};
|
|
301
|
-
var usePaginationViewNumber = ({
|
|
302
|
-
initPageNumber
|
|
303
|
-
}) => {
|
|
304
|
-
const [showCurrentPageNumber, setShowCurrentPageNumber] = react.useState(initPageNumber);
|
|
305
|
-
const observerRef = react.useRef(null);
|
|
306
|
-
const showCurrentPageObserveTarget = react.useCallback(
|
|
307
|
-
(node) => {
|
|
308
|
-
if (!node) return;
|
|
309
|
-
if (!observerRef.current) {
|
|
310
|
-
observerRef.current = new IntersectionObserver(
|
|
311
|
-
(entries) => {
|
|
312
|
-
entries.forEach((entry) => {
|
|
313
|
-
if (entry.isIntersecting) {
|
|
314
|
-
const pageIndexAttr = entry.target.getAttribute(
|
|
315
|
-
"data-page-index"
|
|
316
|
-
);
|
|
317
|
-
if (!pageIndexAttr) return;
|
|
318
|
-
const pageIndex = parseInt(pageIndexAttr, 10);
|
|
319
|
-
setShowCurrentPageNumber(pageIndex);
|
|
320
|
-
}
|
|
321
|
-
});
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
threshold: 0.1
|
|
325
|
-
// 예: 10% 이상 보여야 intersect로 판단
|
|
326
|
-
}
|
|
327
|
-
);
|
|
328
|
-
}
|
|
329
|
-
observerRef.current.observe(node);
|
|
330
|
-
},
|
|
331
|
-
[]
|
|
332
|
-
);
|
|
333
|
-
react.useEffect(() => {
|
|
334
|
-
const currentObserver = observerRef.current;
|
|
335
|
-
return () => {
|
|
336
|
-
if (currentObserver) {
|
|
337
|
-
currentObserver.disconnect();
|
|
338
|
-
}
|
|
339
|
-
};
|
|
340
|
-
}, []);
|
|
341
|
-
return {
|
|
342
|
-
showCurrentPageNumber,
|
|
343
|
-
showCurrentPageObserveTarget
|
|
344
|
-
};
|
|
345
|
-
};
|
|
346
|
-
var usePagingHandler = ({
|
|
347
|
-
lastCallPageNumber,
|
|
348
|
-
dataListRef
|
|
349
|
-
}) => {
|
|
350
|
-
const jumpingPageNumberRef = react.useRef(lastCallPageNumber);
|
|
351
|
-
react.useEffect(() => {
|
|
352
|
-
if (jumpingPageNumberRef.current) {
|
|
353
|
-
setTimeout(() => {
|
|
354
|
-
jumpingPageNumberRef.current = null;
|
|
355
|
-
}, 1e3);
|
|
356
|
-
}
|
|
357
|
-
}, [jumpingPageNumberRef]);
|
|
358
|
-
const paginationScrollIntoViewTarget = react.useRef({});
|
|
359
|
-
const pageNumberRef = react.useRef(lastCallPageNumber);
|
|
360
|
-
const setPaginationRef = react.useCallback(
|
|
361
|
-
(i) => (node) => {
|
|
362
|
-
if (!node) return;
|
|
363
|
-
paginationScrollIntoViewTarget.current[i] = node;
|
|
364
|
-
if (jumpingPageNumberRef.current !== null && i === jumpingPageNumberRef.current) {
|
|
365
|
-
node.scrollIntoView({
|
|
366
|
-
behavior: "instant",
|
|
367
|
-
// 필요한 경우 'smooth' 등으로 수정 가능
|
|
368
|
-
block: "start"
|
|
369
|
-
});
|
|
370
|
-
jumpingPageNumberRef.current = null;
|
|
371
|
-
}
|
|
372
|
-
},
|
|
373
|
-
[]
|
|
374
|
-
);
|
|
375
|
-
const handleReachTerminal = ({ isFirst, isLast, observer }, dataCallFetch) => {
|
|
376
|
-
if (dataListRef.current.length === 0) return;
|
|
377
|
-
if (jumpingPageNumberRef.current != null) return;
|
|
378
|
-
if (!isFirst && !isLast) return;
|
|
379
|
-
const callPageNumber = isFirst ? Math.max(pageNumberRef.current - 1, 0) : pageNumberRef.current + 1;
|
|
380
|
-
if (dataListRef.current[callPageNumber] != null && (dataListRef.current[callPageNumber]?.length || 0) > 0)
|
|
381
|
-
return;
|
|
382
|
-
jumpingPageNumberRef.current = callPageNumber;
|
|
383
|
-
setTimeout(() => {
|
|
384
|
-
jumpingPageNumberRef.current = null;
|
|
385
|
-
}, 1e3);
|
|
386
|
-
dataCallFetch(callPageNumber);
|
|
387
|
-
};
|
|
388
|
-
const handleClickPageChange = (page, dataCallFetch) => {
|
|
389
|
-
const pageData = dataListRef.current[page];
|
|
390
|
-
if (pageData != null && Array.isArray(pageData) && pageData.length > 0) {
|
|
391
|
-
paginationScrollIntoViewTarget.current[page]?.scrollIntoView({
|
|
392
|
-
behavior: "smooth",
|
|
393
|
-
block: "start"
|
|
394
|
-
});
|
|
395
|
-
return;
|
|
396
|
-
}
|
|
397
|
-
jumpingPageNumberRef.current = page;
|
|
398
|
-
setTimeout(() => {
|
|
399
|
-
jumpingPageNumberRef.current = null;
|
|
400
|
-
}, 1e3);
|
|
401
|
-
dataCallFetch(page);
|
|
402
|
-
};
|
|
403
|
-
return {
|
|
404
|
-
jumpingPageNumberRef,
|
|
405
|
-
paginationScrollIntoViewTarget,
|
|
406
|
-
pageNumberRef,
|
|
407
|
-
setPaginationRef,
|
|
408
|
-
handleReachTerminal,
|
|
409
|
-
handleClickPageChange
|
|
410
|
-
};
|
|
411
|
-
};
|
|
412
222
|
|
|
413
223
|
exports.allSplitScreenCount = allSplitScreenCount;
|
|
414
224
|
exports.dragState = dragState;
|
|
@@ -418,8 +228,5 @@ exports.setFolderEvent = setFolderEvent;
|
|
|
418
228
|
exports.useDragCapture = useDragCapture;
|
|
419
229
|
exports.useDragEvents = useDragEvents;
|
|
420
230
|
exports.useFolderEvent = useFolderEvent;
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
exports.usePagingHandler = usePagingHandler;
|
|
424
|
-
//# sourceMappingURL=hooks.cjs.map
|
|
425
|
-
//# sourceMappingURL=hooks.cjs.map
|
|
231
|
+
//# sourceMappingURL=useDrag.cjs.map
|
|
232
|
+
//# sourceMappingURL=useDrag.cjs.map
|