@byeolnaerim/flex-layout 0.0.4 → 0.0.5

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.
@@ -1,7 +1,3036 @@
1
- export { FlexLayout_default as FlexLayout, FlexLayoutContainer_default as FlexLayoutContainer, FlexLayoutResizePanel_default as FlexLayoutResizePanel, FlexLayoutSplitScreen_default as FlexLayoutSplitScreen, FlexLayoutSplitScreenDragBox, FlexLayoutSplitScreenScrollBox_default as FlexLayoutSplitScreenScrollBox, FlexLayoutStickyBox_default as FlexLayoutStickyBox } from './chunk-UYI4Z27V.js';
2
- import './chunk-PMTZFSP4.js';
3
- import './chunk-JM3CZ5DU.js';
4
- import './chunk-W4CNFJTK.js';
5
- import './chunk-CFQQ6ZDC.js';
1
+ import { createContext, memo, useRef, useState, useEffect, Children, isValidElement, Fragment as Fragment$1, useCallback, useContext, useLayoutEffect, cloneElement } from 'react';
2
+ import equal from 'fast-deep-equal';
3
+ import { BehaviorSubject, Subject, fromEvent, distinctUntilChanged as distinctUntilChanged$1, take as take$1, combineLatest, map as map$1 } from 'rxjs';
4
+ import { throttleTime, take, filter, map, distinctUntilChanged } from 'rxjs/operators';
5
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
6
+
7
+ // src/flex-layout/components/FlexLayout.tsx
8
+ function updateScrollStore(subject, newValue) {
9
+ const currentValue = subject.getValue();
10
+ if (!equal(currentValue, newValue)) {
11
+ subject.next(newValue);
12
+ }
13
+ }
14
+ function updateRefStore(store, newState) {
15
+ const prevState = store.getValue();
16
+ if (!equal(prevState, newState)) {
17
+ store.next(newState);
18
+ }
19
+ }
20
+ function updateSplitScreenStore(newValue) {
21
+ const prevValue = layoutSplitScreenStore.getValue();
22
+ if (!equal(prevValue, newValue)) {
23
+ layoutSplitScreenStore.next(newValue);
24
+ }
25
+ }
26
+ var scrollPositions = {};
27
+ var scrollPositionsSubject = new BehaviorSubject(scrollPositions);
28
+ var setScrollPosition = (layoutName, position) => {
29
+ const current = scrollPositionsSubject.getValue();
30
+ const prevPos = current[layoutName];
31
+ if (prevPos && prevPos.x === position.x && prevPos.y === position.y) {
32
+ return;
33
+ }
34
+ const newPositions = {
35
+ ...current,
36
+ [layoutName]: position
37
+ };
38
+ updateScrollStore(scrollPositionsSubject, newPositions);
39
+ };
40
+ var getScrollPosition = (layoutName) => {
41
+ return scrollPositionsSubject.pipe(
42
+ // 해당 layoutName이 정의되지 않았을 때는 제외
43
+ filter((e) => e[layoutName] !== void 0),
44
+ map((positions) => positions[layoutName]),
45
+ distinctUntilChanged(
46
+ (prev, curr) => prev?.x === curr?.x && prev?.y === curr?.y
47
+ )
48
+ );
49
+ };
50
+ var removeScrollPosition = (layoutName) => {
51
+ const current = scrollPositionsSubject.getValue();
52
+ delete current[layoutName];
53
+ const newPositions = { ...current };
54
+ updateScrollStore(scrollPositionsSubject, newPositions);
55
+ };
56
+ var layoutSplitScreenStore = new BehaviorSubject({});
57
+ var setSplitScreen = (rootName, layoutName, newComponents) => {
58
+ const current = layoutSplitScreenStore.getValue();
59
+ const updatedLayout = { ...current[rootName] || {} };
60
+ updatedLayout[layoutName] = newComponents;
61
+ const newStoreValue = {
62
+ ...current,
63
+ [rootName]: updatedLayout
64
+ };
65
+ updateSplitScreenStore(newStoreValue);
66
+ };
67
+ var resetRootSplitScreen = (rootName) => {
68
+ const current = layoutSplitScreenStore.getValue();
69
+ const newStoreValue = {
70
+ ...current,
71
+ [rootName]: {}
72
+ };
73
+ updateSplitScreenStore(newStoreValue);
74
+ };
75
+ var removeSplitScreenChild = (rootName, layoutName) => {
76
+ const current = layoutSplitScreenStore.getValue();
77
+ if (!current[rootName]) return;
78
+ const updatedLayout = { ...current[rootName] };
79
+ delete updatedLayout[layoutName];
80
+ const newStoreValue = {
81
+ ...current,
82
+ [rootName]: updatedLayout
83
+ };
84
+ updateSplitScreenStore(newStoreValue);
85
+ };
86
+ var getCurrentSplitScreenComponents = (rootName, layoutName) => {
87
+ const current = layoutSplitScreenStore.getValue();
88
+ if (!current[rootName]) return;
89
+ return current[rootName][layoutName];
90
+ };
91
+ var getSplitScreen = (rootName, layoutName) => {
92
+ return layoutSplitScreenStore.pipe(
93
+ map((splitScreen) => splitScreen[rootName][layoutName]),
94
+ distinctUntilChanged((prev, curr) => {
95
+ const filterChildren2 = (obj) => {
96
+ const { children, component, targetComponent, x, y, ...rest } = obj || {};
97
+ return rest;
98
+ };
99
+ return equal(filterChildren2(prev), filterChildren2(curr));
100
+ })
101
+ );
102
+ };
103
+ var flexContainerStore = new BehaviorSubject({});
104
+ var flexResizePanelStore = new BehaviorSubject({});
105
+ var setContainerRef = (layoutName, containerName, ref) => {
106
+ const currentRefs = flexContainerStore.getValue();
107
+ const updatedLayoutRefs = { ...currentRefs[layoutName] || {} };
108
+ if (ref === null) {
109
+ delete updatedLayoutRefs[containerName];
110
+ } else {
111
+ updatedLayoutRefs[containerName] = ref;
112
+ }
113
+ const newRefs = {
114
+ ...currentRefs,
115
+ [layoutName]: updatedLayoutRefs
116
+ };
117
+ updateRefStore(flexContainerStore, newRefs);
118
+ };
119
+ var setResizePanelRef = (layoutName, containerName, ref) => {
120
+ const currentRefs = flexResizePanelStore.getValue();
121
+ const updatedLayoutRefs = { ...currentRefs[layoutName] || {} };
122
+ if (ref === null) {
123
+ delete updatedLayoutRefs[containerName];
124
+ } else {
125
+ updatedLayoutRefs[containerName] = ref;
126
+ }
127
+ const newRefs = {
128
+ ...currentRefs,
129
+ [layoutName]: updatedLayoutRefs
130
+ };
131
+ updateRefStore(flexResizePanelStore, newRefs);
132
+ };
133
+ var getLayoutInfos = (layoutName) => {
134
+ return combineLatest([flexContainerStore, flexResizePanelStore]).pipe(
135
+ map(([containerRefs, resizePanelRefs]) => {
136
+ const containerData = containerRefs[layoutName] || {};
137
+ const resizePanelData = resizePanelRefs[layoutName] || {};
138
+ return {
139
+ container: containerData,
140
+ resizePanel: resizePanelData
141
+ };
142
+ }),
143
+ filter((result) => result.container !== null)
144
+ // 빈 객체 제외
145
+ );
146
+ };
147
+
148
+ // src/flex-layout/utils/FlexLayoutUtils.ts
149
+ function isDocumentOut({ x, y }) {
150
+ if (typeof window == "undefined") return;
151
+ const { innerWidth, innerHeight, scrollX, scrollY } = window;
152
+ return x < 0 || y < 0 || x > innerWidth + scrollX || y > innerHeight + scrollY;
153
+ }
154
+ var lastTouchEvent;
155
+ function getClientXy(event) {
156
+ let clientX;
157
+ let clientY;
158
+ if (window.MouseEvent && event instanceof window.MouseEvent) {
159
+ clientX = event.clientX;
160
+ clientY = event.clientY;
161
+ } else if (window.TouchEvent && event instanceof window.TouchEvent) {
162
+ const _event = event.touches.length == 0 ? lastTouchEvent : event;
163
+ clientX = _event.touches[0].clientX;
164
+ clientY = _event.touches[0].clientY;
165
+ lastTouchEvent = event;
166
+ } else {
167
+ return;
168
+ }
169
+ return { clientX, clientY };
170
+ }
171
+ function isOverMove(elementSize, elementMinSize) {
172
+ return Math.floor(elementSize) <= 0 || (isNaN(elementMinSize) ? false : elementMinSize >= Math.floor(elementSize));
173
+ }
174
+ function findNotCloseFlexContent(target, direction) {
175
+ if (!target) return target;
176
+ let _target = target;
177
+ const isCloseCheck = () => {
178
+ let grow = parseFloat(window.getComputedStyle(_target).flex.split(" ")[0]) || 0;
179
+ if (grow == 0) {
180
+ return true;
181
+ } else {
182
+ return false;
183
+ }
184
+ };
185
+ while (isCloseCheck()) {
186
+ let nextTarget = _target[direction]?.[direction];
187
+ _target = nextTarget;
188
+ if (!_target) {
189
+ break;
190
+ }
191
+ }
192
+ return _target;
193
+ }
194
+ function resize(list, totalGrow) {
195
+ return new Promise((resolve) => {
196
+ let resizeWeight = totalGrow / list.length;
197
+ list.forEach((e) => {
198
+ e.dataset.grow = resizeWeight.toString();
199
+ e.style.flex = `${resizeWeight} 1 0%`;
200
+ });
201
+ resolve(resizeWeight);
202
+ });
203
+ }
204
+ function mathWeight(totalCount, totalGrow) {
205
+ return 1 + (totalGrow - totalCount) / totalCount;
206
+ }
207
+ function mathGrow(childSize, parentSize, containerCount) {
208
+ return containerCount * (childSize / parentSize);
209
+ }
210
+ function getGrow(growTarget) {
211
+ const target = growTarget instanceof Element ? growTarget : growTarget;
212
+ return parseFloat(target.style.flex.split(" ")[0]) || parseFloat(target.dataset.grow || "");
213
+ }
214
+ function closeFlex(resizeTarget, containers, {
215
+ isResize = false,
216
+ isDsiabledResizePanel = false,
217
+ sizeName
218
+ }) {
219
+ return new Promise((resolve) => {
220
+ if (!resizeTarget.hasAttribute("data-is_resize_panel")) ; else if (isDsiabledResizePanel) {
221
+ resizeTarget.dataset.is_resize_panel = "false";
222
+ }
223
+ resizeTarget.dataset.prev_grow = getGrow(resizeTarget).toString();
224
+ let notCloseList = containers.filter(
225
+ (e) => e.style.flex != "0 1 0%" && e != resizeTarget
226
+ );
227
+ let notCloseAndOpenTargetList = [...notCloseList, resizeTarget];
228
+ notCloseAndOpenTargetList.forEach((e) => {
229
+ e.style.transition = "flex 0.5s";
230
+ e.ontransitionend = (event) => {
231
+ if (event.propertyName != "flex-grow") {
232
+ return;
233
+ }
234
+ notCloseAndOpenTargetList.forEach(
235
+ (e2) => e2.style.transition = ""
236
+ );
237
+ e.ontransitionend = () => {
238
+ };
239
+ };
240
+ if (e == resizeTarget) {
241
+ e.dataset.grow = "0";
242
+ e.style.flex = `0 1 0%`;
243
+ return;
244
+ }
245
+ if (isResize) {
246
+ return;
247
+ }
248
+ let percent = getGrow(e) / containers.length;
249
+ if (notCloseList.length == 1) {
250
+ e.dataset.grow = containers.length.toString();
251
+ e.style.flex = `${containers.length} 1 0%`;
252
+ return;
253
+ }
254
+ e.dataset.grow = (containers.length * percent).toString();
255
+ e.style.flex = `${containers.length * percent} 1 0%`;
256
+ });
257
+ if (isResize) {
258
+ resize(notCloseList, containers.length);
259
+ }
260
+ resolve(resizeTarget);
261
+ });
262
+ }
263
+ function openFlex(resizeTarget, containers, {
264
+ isPrevSizeOpen = false,
265
+ isResize = false,
266
+ openGrowImportant = 0,
267
+ sizeName
268
+ }) {
269
+ return new Promise((resolve) => {
270
+ if (!resizeTarget.hasAttribute("data-is_resize_panel")) ; else if (resizeTarget.hasAttribute("data-is_resize_panel") && resizeTarget.dataset.is_resize_panel == "false") {
271
+ resizeTarget.dataset.is_resize_panel = "true";
272
+ }
273
+ let notCloseList = containers.filter(
274
+ (e) => e.style.flex != "0 1 0%" && e != resizeTarget
275
+ );
276
+ let notCloseAndOpenTargetList = [...notCloseList, resizeTarget];
277
+ let openTargetGrow = 1;
278
+ const sizeStyleName = "client" + sizeName.charAt(0).toUpperCase() + sizeName.substring(1);
279
+ const parentSize = sizeName && resizeTarget.parentElement && resizeTarget.parentElement[sizeStyleName] || 0;
280
+ if (isPrevSizeOpen && resizeTarget.hasAttribute("data-prev_grow")) {
281
+ openTargetGrow = parseFloat(resizeTarget.dataset.prev_grow || "1") || 1;
282
+ } else if (parentSize && parentSize !== 0) {
283
+ openTargetGrow = parentSize / notCloseList.length / (parentSize - 1) * containers.length;
284
+ } else {
285
+ openTargetGrow = 1;
286
+ }
287
+ if (openGrowImportant) {
288
+ openTargetGrow = openGrowImportant;
289
+ }
290
+ openTargetGrow = openTargetGrow === Infinity ? 1 : openTargetGrow;
291
+ notCloseAndOpenTargetList.forEach((e) => {
292
+ e.style.transition = "flex 0.5s";
293
+ e.ontransitionend = (event) => {
294
+ if (event.propertyName != "flex-grow") {
295
+ return;
296
+ }
297
+ notCloseAndOpenTargetList.forEach(
298
+ (e2) => e2.style.transition = ""
299
+ );
300
+ e.ontransitionend = () => {
301
+ };
302
+ };
303
+ if (e == resizeTarget) {
304
+ resizeTarget.dataset.grow = openTargetGrow.toString();
305
+ resizeTarget.style.flex = `${openTargetGrow} 1 0%`;
306
+ return;
307
+ }
308
+ if (isResize) {
309
+ return;
310
+ }
311
+ let grow = parentSize / notCloseList.length / (parentSize - 1) * (containers.length - openTargetGrow);
312
+ grow = grow === Infinity ? 1 : grow;
313
+ e.dataset.grow = grow.toString();
314
+ e.style.flex = `${grow} 1 0%`;
315
+ });
316
+ if (isResize) {
317
+ resize(notCloseAndOpenTargetList, containers.length);
318
+ }
319
+ resolve(openTargetGrow);
320
+ });
321
+ }
322
+ var g = globalThis;
323
+ g.__FLEX_SUBJECTS__ ?? (g.__FLEX_SUBJECTS__ = { openClose: {}, spread: {} });
324
+ var containerOpenCloseSubjectMap = g.__FLEX_SUBJECTS__.openClose;
325
+ var containerSpreadSubjectMap = g.__FLEX_SUBJECTS__.spread;
326
+ var ContainerOpenCloseProvider = ({
327
+ layoutName,
328
+ containerName,
329
+ sizeName
330
+ }) => {
331
+ if (!containerOpenCloseSubjectMap[containerName]) {
332
+ containerOpenCloseSubjectMap[containerName] = new Subject();
333
+ }
334
+ if (!containerSpreadSubjectMap[containerName]) {
335
+ containerSpreadSubjectMap[containerName] = new Subject();
336
+ }
337
+ const [containers, setContainers] = useState([]);
338
+ const [container, setContainer] = useState();
339
+ useEffect(() => {
340
+ const subscription = getLayoutInfos(layoutName).subscribe(
341
+ (layout) => {
342
+ if (!layout || !layout.container[containerName] || !layout.container[containerName].current)
343
+ return;
344
+ setContainers(
345
+ Object.values(layout.container).filter(
346
+ (e) => e.current !== null
347
+ ).map((e) => e.current)
348
+ );
349
+ setContainer(layout.container[containerName].current);
350
+ }
351
+ );
352
+ return () => subscription.unsubscribe();
353
+ }, [containerName, layoutName]);
354
+ useEffect(() => {
355
+ const styleName = `${sizeName.charAt(0).toUpperCase() + sizeName.substring(1)}`;
356
+ const clientSize = "client" + styleName;
357
+ const outerSize = "outer" + styleName;
358
+ const maxSize = "max" + styleName;
359
+ const subscribe = containerOpenCloseSubjectMap[containerName].subscribe(
360
+ ({
361
+ mode,
362
+ initOpenState: isOpenState,
363
+ onClose,
364
+ onOpen,
365
+ openOption = {},
366
+ closeOption = {}
367
+ }) => {
368
+ if (!container || containers.length === 0) return;
369
+ const currentGrow = getGrow(container);
370
+ const styleMap = window.getComputedStyle(container);
371
+ const maxSizeGrow = mathGrow(
372
+ parseInt(styleMap[maxSize]),
373
+ container.parentElement && container.parentElement[clientSize] || window[outerSize],
374
+ containers.length
375
+ );
376
+ const open = () => openFlex(container, containers, {
377
+ sizeName,
378
+ ...isNaN(maxSizeGrow) ? {} : {
379
+ openGrowImportant: maxSizeGrow
380
+ },
381
+ ...openOption
382
+ }).then((openTargetGrow) => {
383
+ if (onOpen) onOpen();
384
+ containerSpreadSubjectMap[containerName].next({
385
+ isOpen: true,
386
+ grow: openTargetGrow,
387
+ targetContainer: container
388
+ });
389
+ });
390
+ const close = () => closeFlex(container, containers, {
391
+ sizeName,
392
+ ...closeOption
393
+ }).then(() => {
394
+ if (onClose) onClose();
395
+ containerSpreadSubjectMap[containerName].next({
396
+ isOpen: false,
397
+ grow: 0,
398
+ targetContainer: container
399
+ });
400
+ });
401
+ if (mode === "toggle") {
402
+ if (currentGrow === 0) {
403
+ open();
404
+ } else {
405
+ close();
406
+ }
407
+ } else if (mode === "open") {
408
+ if (currentGrow === 0) {
409
+ open();
410
+ }
411
+ } else if (mode === "close") {
412
+ if (currentGrow !== 0) {
413
+ close();
414
+ }
415
+ }
416
+ }
417
+ );
418
+ return () => {
419
+ subscribe.unsubscribe();
420
+ };
421
+ }, [containerName, container, containers, sizeName]);
422
+ return null;
423
+ };
424
+
425
+ // src/flex-layout/styles/FlexLayout.module.css
426
+ var FlexLayout_default = {};
427
+ var FlexLayoutContext = createContext(null);
428
+ function useFlexLayoutContext() {
429
+ const context = useContext(FlexLayoutContext);
430
+ if (!context) {
431
+ throw new Error(
432
+ "useFlexLayoutContext must be used within FlexLayoutContext.Provider"
433
+ );
434
+ }
435
+ return context;
436
+ }
437
+ function FlexLayoutProvider({
438
+ value,
439
+ children
440
+ }) {
441
+ return /* @__PURE__ */ jsx(FlexLayoutContext.Provider, { value, children });
442
+ }
443
+ var FlexLayout = ({
444
+ layoutName,
445
+ direction,
446
+ children,
447
+ ref,
448
+ className,
449
+ panelClassName,
450
+ panelMovementMode = "divorce",
451
+ ...props
452
+ }) => {
453
+ const containerCount = Children.count(children);
454
+ const fitContent = direction === "row" ? "width" : "height";
455
+ const isFragmentElement = (node) => isValidElement(node) && node.type === Fragment$1;
456
+ const nodes = Children.toArray(children).flatMap(
457
+ (node) => isFragmentElement(node) ? Children.toArray(node.props.children) : [node]
458
+ );
459
+ const flattenedChildren = nodes.filter(
460
+ isValidElement
461
+ );
462
+ if (flattenedChildren.length === 0) {
463
+ return null;
464
+ }
465
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
466
+ FlexLayoutProvider,
467
+ {
468
+ value: {
469
+ layoutName,
470
+ direction,
471
+ panelMovementMode,
472
+ panelClassName,
473
+ containerCount,
474
+ fitContent
475
+ },
476
+ children: /* @__PURE__ */ jsx(
477
+ "div",
478
+ {
479
+ className: `${FlexLayout_default["flex-layout"]} ${className && className !== "" ? className : ""}`,
480
+ ...ref ? { ref } : {},
481
+ ...props,
482
+ "data-layout_name": layoutName,
483
+ "data-direction": direction,
484
+ children: flattenedChildren.map((child, index) => {
485
+ if (!child || !isValidElement(child)) return null;
486
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
487
+ child,
488
+ /* @__PURE__ */ jsx(
489
+ ContainerOpenCloseProvider,
490
+ {
491
+ layoutName,
492
+ containerName: child.props.containerName,
493
+ sizeName: fitContent
494
+ }
495
+ )
496
+ ] }, index);
497
+ })
498
+ }
499
+ )
500
+ }
501
+ ) });
502
+ };
503
+ var FlexLayout_default2 = FlexLayout;
504
+ var useSize = (sizeName) => {
505
+ const ref = useRef(null);
506
+ const [size, setSize] = useState(void 0);
507
+ useLayoutEffect(() => {
508
+ if (!ref.current) return;
509
+ const handleResize = () => {
510
+ if (ref.current) {
511
+ const newSize = ref.current.getBoundingClientRect()[sizeName];
512
+ setSize(newSize);
513
+ }
514
+ };
515
+ handleResize();
516
+ const resizeObserver = new ResizeObserver(() => {
517
+ handleResize();
518
+ });
519
+ resizeObserver.observe(ref.current);
520
+ window.addEventListener("resize", handleResize);
521
+ return () => {
522
+ resizeObserver.disconnect();
523
+ window.removeEventListener("resize", handleResize);
524
+ };
525
+ }, [sizeName]);
526
+ return { ref, size };
527
+ };
528
+ var flexDirectionModel = {
529
+ row: {
530
+ xy: "x",
531
+ targetDirection: "left",
532
+ nextDirection: "right",
533
+ sizeName: "width",
534
+ resizeCursor: "ew-resize"
535
+ },
536
+ column: {
537
+ xy: "y",
538
+ targetDirection: "top",
539
+ nextDirection: "bottom",
540
+ sizeName: "height",
541
+ resizeCursor: "ns-resize"
542
+ }
543
+ };
544
+ var FlexLayoutResizePanel = ({
545
+ direction,
546
+ containerCount,
547
+ panelMode = "default",
548
+ containerName,
549
+ layoutName,
550
+ panelClassName,
551
+ panelMovementMode
552
+ }) => {
553
+ let isResizePanelClickRef = useRef(false);
554
+ let prevTouchEvent = null;
555
+ let parentSizeRef = useRef(0);
556
+ let totalMovementRef = useRef(0);
557
+ const containerCountRef = useRef(containerCount);
558
+ useEffect(() => {
559
+ return () => {
560
+ document.body.style.cursor = "";
561
+ };
562
+ }, []);
563
+ useEffect(() => {
564
+ containerCountRef.current = containerCount;
565
+ }, [containerCount]);
566
+ const panelRef = useRef(null);
567
+ const panelMouseDownEvent = (event) => {
568
+ if (!panelRef.current || !panelRef.current.parentElement) return;
569
+ isResizePanelClickRef.current = true;
570
+ containerCountRef.current = [
571
+ ...panelRef.current.parentElement.children
572
+ ].filter((e) => e.hasAttribute("data-container_name")).length;
573
+ const sizeName = flexDirectionModel[direction].sizeName;
574
+ parentSizeRef.current = panelRef.current.parentElement.getBoundingClientRect()[sizeName];
575
+ prevTouchEvent = null;
576
+ totalMovementRef.current = 0;
577
+ if (!parentSizeRef.current) return;
578
+ document.body.style.cursor = flexDirectionModel[direction].resizeCursor;
579
+ };
580
+ const panelMouseUpEvent = () => {
581
+ isResizePanelClickRef.current = false;
582
+ parentSizeRef.current = 0;
583
+ prevTouchEvent = null;
584
+ totalMovementRef.current = 0;
585
+ document.body.style.cursor = "";
586
+ };
587
+ function moveMouseFlex(originTarget, resizePanel, moveEvent) {
588
+ const model = flexDirectionModel[direction];
589
+ const movement = moveEvent["movement" + model.xy.toUpperCase()];
590
+ totalMovementRef.current += movement;
591
+ const minSizeName = "min-" + model.sizeName;
592
+ const maxSizeName = "max-" + model.sizeName;
593
+ let targetElement = findNotCloseFlexContent(
594
+ originTarget,
595
+ "previousElementSibling"
596
+ );
597
+ if (panelMovementMode === "divorce" && totalMovementRef.current > 0 || panelMovementMode === "bulldozer" && movement > 0 || !targetElement)
598
+ targetElement = originTarget;
599
+ let nextElement = findNotCloseFlexContent(
600
+ resizePanel.nextElementSibling,
601
+ "nextElementSibling"
602
+ );
603
+ if (panelMovementMode === "divorce" && totalMovementRef.current < 0 || panelMovementMode === "bulldozer" && movement < 0 || !nextElement)
604
+ nextElement = resizePanel.nextElementSibling;
605
+ if (!targetElement || !nextElement) return;
606
+ const targetRect = targetElement.getBoundingClientRect();
607
+ const targetStyle = window.getComputedStyle(targetElement);
608
+ const targetMinSize = parseFloat(targetStyle.getPropertyValue(minSizeName)) || 0;
609
+ const targetMaxSize = parseFloat(targetStyle.getPropertyValue(maxSizeName)) || 0;
610
+ const nextRect = nextElement.getBoundingClientRect();
611
+ const nextStyle = window.getComputedStyle(nextElement);
612
+ const nextMinSize = parseFloat(nextStyle.getPropertyValue(minSizeName)) || 0;
613
+ const nextMaxSize = parseFloat(nextStyle.getPropertyValue(maxSizeName)) || 0;
614
+ let targetSize = targetRect[model.sizeName] + movement;
615
+ let nextElementSize = nextRect[model.sizeName] - movement;
616
+ if (targetMaxSize > 0 && targetSize > targetMaxSize) {
617
+ return;
618
+ }
619
+ if (nextMaxSize > 0 && nextElementSize > nextMaxSize) {
620
+ return;
621
+ }
622
+ if (isOverMove(targetSize, targetMinSize)) {
623
+ targetSize = 0;
624
+ nextElementSize = nextRect[model.sizeName];
625
+ } else if (isOverMove(nextElementSize, nextMinSize)) {
626
+ nextElementSize = 0;
627
+ targetSize = targetRect[model.sizeName];
628
+ }
629
+ const targetFlexGrow = targetSize / (parentSizeRef.current - 1) * containerCountRef.current;
630
+ const nextElementFlexGrow = nextElementSize / (parentSizeRef.current - 1) * containerCountRef.current;
631
+ targetElement.style.flex = `${targetFlexGrow} 1 0%`;
632
+ nextElement.style.flex = `${nextElementFlexGrow} 1 0%`;
633
+ }
634
+ useEffect(() => {
635
+ const addGlobalMoveEvent = (event) => {
636
+ if (!isResizePanelClickRef.current || !panelRef.current) {
637
+ return;
638
+ }
639
+ event.preventDefault();
640
+ const targetElement = panelRef.current.previousElementSibling;
641
+ const targetPanel = panelRef.current;
642
+ if (!targetElement || !targetPanel) return;
643
+ let move = { movementX: 0, movementY: 0 };
644
+ if (window.TouchEvent && event instanceof window.TouchEvent) {
645
+ if (!prevTouchEvent) {
646
+ prevTouchEvent = event;
647
+ return;
648
+ }
649
+ move.movementX = (prevTouchEvent.touches[0].pageX - event.touches[0].pageX) * -2;
650
+ move.movementY = (prevTouchEvent.touches[0].pageY - event.touches[0].pageY) * -2;
651
+ prevTouchEvent = event;
652
+ } else {
653
+ move.movementX = event.movementX;
654
+ move.movementY = event.movementY;
655
+ }
656
+ moveMouseFlex(targetElement, targetPanel, move);
657
+ };
658
+ ["mousemove", "touchmove"].forEach((eventName) => {
659
+ window.addEventListener(eventName, addGlobalMoveEvent, {
660
+ passive: false
661
+ });
662
+ });
663
+ ["mouseup", "touchend"].forEach((eventName) => {
664
+ window.addEventListener(eventName, panelMouseUpEvent);
665
+ });
666
+ return () => {
667
+ ["mousemove", "touchmove"].forEach((eventName) => {
668
+ window.removeEventListener(eventName, addGlobalMoveEvent);
669
+ });
670
+ ["mouseup", "touchend"].forEach((eventName) => {
671
+ window.removeEventListener(eventName, panelMouseUpEvent);
672
+ });
673
+ };
674
+ }, []);
675
+ useEffect(() => {
676
+ if (!panelRef.current) return;
677
+ setResizePanelRef(layoutName, containerName, panelRef);
678
+ }, [containerName, layoutName]);
679
+ return /* @__PURE__ */ jsx(
680
+ "div",
681
+ {
682
+ id: containerName + "_resize_panel",
683
+ className: `${FlexLayout_default["flex-resize-panel"]} ${FlexLayout_default[panelMode]} ${panelClassName && panelClassName !== "" ? panelClassName : ""}`,
684
+ ref: panelRef,
685
+ onMouseDown: panelMouseDownEvent,
686
+ onTouchStart: panelMouseDownEvent,
687
+ children: /* @__PURE__ */ jsx("div", { className: FlexLayout_default.hover })
688
+ }
689
+ );
690
+ };
691
+ var FlexLayoutResizePanel_default = FlexLayoutResizePanel;
692
+ var FlexLayoutContainer = ({
693
+ isFitContent,
694
+ isFitResize,
695
+ // fitContent,
696
+ // containerCount,
697
+ // layoutName,
698
+ containerName,
699
+ grow: initialGrow,
700
+ prevGrow: initialPrevGrow,
701
+ isInitialResizable,
702
+ isResizePanel,
703
+ children,
704
+ className,
705
+ panelMode
706
+ }) => {
707
+ const {
708
+ direction,
709
+ panelMovementMode,
710
+ panelClassName,
711
+ layoutName,
712
+ fitContent,
713
+ containerCount
714
+ } = useFlexLayoutContext();
715
+ const { ref, size } = (
716
+ // isFitContent && fitContent
717
+ //?
718
+ useSize(fitContent)
719
+ );
720
+ const flexContainerNodeRef = useRef(null);
721
+ const flexContainerRef = useCallback(
722
+ (node) => {
723
+ flexContainerNodeRef.current = node;
724
+ if (node !== null) {
725
+ setContainerRef(layoutName, containerName, { current: node });
726
+ }
727
+ },
728
+ [layoutName, containerName]
729
+ );
730
+ const [growState, setGrowState] = useState(initialGrow);
731
+ useEffect(() => {
732
+ setGrowState(initialGrow);
733
+ }, [initialGrow]);
734
+ const [prevGrowState, setPrevGrowState] = useState(
735
+ initialPrevGrow
736
+ );
737
+ const [isFirstLoad, setIsFirstLoad] = useState(true);
738
+ useEffect(() => {
739
+ if (!flexContainerNodeRef.current) return;
740
+ setContainerRef(layoutName, containerName, flexContainerNodeRef);
741
+ return () => {
742
+ setContainerRef(layoutName, containerName, {
743
+ current: null
744
+ });
745
+ };
746
+ }, [containerName, layoutName]);
747
+ useEffect(() => {
748
+ if (typeof window == "undefined" || flexContainerNodeRef.current === null)
749
+ return;
750
+ const storedGrow = sessionStorage.getItem(containerName);
751
+ if (storedGrow !== null) {
752
+ const parsed = parseFloat(storedGrow);
753
+ if (!isNaN(parsed)) {
754
+ flexContainerNodeRef.current.style.flex = `${parsed} 1 0%`;
755
+ setGrowState(parsed);
756
+ }
757
+ }
758
+ }, [containerName]);
759
+ useEffect(() => {
760
+ if (!flexContainerNodeRef.current) return;
761
+ const targetNode = flexContainerNodeRef.current;
762
+ const observer = new MutationObserver((mutations) => {
763
+ for (const mutation of mutations) {
764
+ if (mutation.type === "attributes" && mutation.attributeName === "style" && targetNode.style.flex) {
765
+ const flexValue = targetNode.style.flex;
766
+ const parsedGrow = parseFloat(flexValue.split(" ")[0]);
767
+ if (!isNaN(parsedGrow)) {
768
+ setGrowState(parsedGrow);
769
+ }
770
+ }
771
+ }
772
+ });
773
+ observer.observe(targetNode, {
774
+ attributes: true,
775
+ attributeFilter: ["style"],
776
+ attributeOldValue: true
777
+ });
778
+ return () => {
779
+ observer.disconnect();
780
+ };
781
+ }, [containerName]);
782
+ useEffect(() => {
783
+ if (!flexContainerNodeRef.current || !ref || !ref.current || !size || !fitContent)
784
+ return;
785
+ requestAnimationFrame(() => {
786
+ if (!flexContainerNodeRef.current) return;
787
+ const sizeName = `${fitContent.charAt(0).toUpperCase() + fitContent.substring(1)}`;
788
+ const parentSize = flexContainerNodeRef.current.parentElement && flexContainerNodeRef.current.parentElement["client" + sizeName] || 0;
789
+ if (isFitContent) {
790
+ flexContainerNodeRef.current.style["max" + sizeName] = size + "px";
791
+ }
792
+ if (!isFitResize && isFirstLoad) {
793
+ setIsFirstLoad(false);
794
+ return;
795
+ }
796
+ if (getGrow(flexContainerNodeRef.current) != 0 && isFitResize) {
797
+ const newGrow = mathGrow(size, parentSize, containerCount);
798
+ setPrevGrowState(growState);
799
+ setGrowState(newGrow);
800
+ }
801
+ });
802
+ }, [size, containerCount, isFitResize, children]);
803
+ useEffect(() => {
804
+ if (!flexContainerNodeRef.current) return;
805
+ let notGrowList = [];
806
+ let containerList = [
807
+ ...flexContainerNodeRef.current.parentElement?.children || []
808
+ ].filter((e) => e.hasAttribute("data-container_name"));
809
+ let remainingGrow = containerList.reduce((t, e, i) => {
810
+ let item = e;
811
+ if (item.classList.contains(FlexLayout_default["flex-resize-panel"])) return t;
812
+ if (e.hasAttribute("data-grow") == false || e.getAttribute("data-is_resize") === "true") {
813
+ notGrowList.push(item);
814
+ return t;
815
+ }
816
+ let grow = parseFloat(item.dataset.grow || "");
817
+ item.style.flex = `${grow} 1 0%`;
818
+ t -= grow;
819
+ return t;
820
+ }, containerList.length);
821
+ if (notGrowList.length != 0) {
822
+ let resizeWeight = mathWeight(notGrowList.length, remainingGrow);
823
+ notGrowList.forEach((e) => {
824
+ e.dataset.grow = resizeWeight.toString();
825
+ e.style.flex = `${resizeWeight} 1 0%`;
826
+ });
827
+ }
828
+ }, []);
829
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
830
+ /* @__PURE__ */ jsx(
831
+ "div",
832
+ {
833
+ id: containerName,
834
+ "data-container_name": containerName,
835
+ ref: flexContainerRef,
836
+ className: `${FlexLayout_default["flex-container"]} ${className && className !== "" ? className : ""}`,
837
+ ...growState !== void 0 ? { ["data-grow"]: growState } : {},
838
+ ...prevGrowState != void 0 ? { ["data-prev_grow"]: prevGrowState } : {},
839
+ "data-is_resize": isInitialResizable,
840
+ "data-is_resize_panel": isResizePanel,
841
+ style: growState !== void 0 && {
842
+ flex: `${growState} 1 0%`
843
+ } || {},
844
+ children: isFitContent && /* @__PURE__ */ jsx(
845
+ "div",
846
+ {
847
+ className: `${FlexLayout_default["flex-content-fit-wrapper"]}`,
848
+ ref,
849
+ children
850
+ }
851
+ ) || children
852
+ }
853
+ ),
854
+ isResizePanel && /* @__PURE__ */ jsx(
855
+ FlexLayoutResizePanel_default,
856
+ {
857
+ containerName,
858
+ layoutName,
859
+ direction,
860
+ containerCount,
861
+ panelMode,
862
+ panelClassName,
863
+ panelMovementMode
864
+ }
865
+ )
866
+ ] });
867
+ };
868
+ var FlexLayoutContainer_default = FlexLayoutContainer;
869
+ var dragState = new Subject();
870
+ var filterChildren = (obj) => {
871
+ const { children, ...rest } = obj || {};
872
+ return rest;
873
+ };
874
+ var useDragCapture = (targetRef) => {
875
+ const stateRef = useRef(null);
876
+ const forceUpdate = useRef(0);
877
+ useEffect(() => {
878
+ const subscription = dragState.pipe(
879
+ map$1((value) => {
880
+ if (!targetRef || !targetRef.current) return null;
881
+ const { x, y } = value;
882
+ const rect = targetRef.current.getBoundingClientRect();
883
+ const {
884
+ width,
885
+ height,
886
+ x: rectX,
887
+ y: rectY,
888
+ right,
889
+ bottom
890
+ } = rect;
891
+ let isOver = false;
892
+ if (x < rectX || x > right || y < rectY || y > bottom) {
893
+ isOver = true;
894
+ }
895
+ const leftBoundary = rectX + width * 0.2;
896
+ const rightBoundary = right - width * 0.2;
897
+ const topBoundary = rectY + height * 0.2;
898
+ const bottomBoundary = bottom - height * 0.2;
899
+ let position = "centerBoundary";
900
+ if (x < leftBoundary) {
901
+ position = "leftBoundary";
902
+ } else if (x > rightBoundary) {
903
+ position = "rightBoundary";
904
+ } else if (y < topBoundary) {
905
+ position = "topBoundary";
906
+ } else if (y > bottomBoundary) {
907
+ position = "bottomBoundary";
908
+ }
909
+ return {
910
+ positionName: position,
911
+ isOver,
912
+ ...value
913
+ };
914
+ }),
915
+ distinctUntilChanged$1(
916
+ (prev, curr) => equal(filterChildren(prev), filterChildren(curr))
917
+ )
918
+ ).subscribe({
919
+ next: (value) => {
920
+ if (value && !equal(
921
+ filterChildren(stateRef.current),
922
+ filterChildren(value)
923
+ )) {
924
+ stateRef.current = value;
925
+ forceUpdate.current++;
926
+ }
927
+ },
928
+ error: (err) => console.error(err)
929
+ });
930
+ return () => subscription.unsubscribe();
931
+ }, [targetRef]);
932
+ const [, rerender] = useState({});
933
+ useEffect(() => {
934
+ const interval = setInterval(() => {
935
+ rerender({});
936
+ }, 50);
937
+ return () => clearInterval(interval);
938
+ }, []);
939
+ return stateRef.current;
940
+ };
941
+ var dropMovementEventSubject = new Subject();
942
+ var allSplitScreenCount = new BehaviorSubject(0);
943
+ var useDragEvents = ({
944
+ isBlockingActiveInput = false
945
+ }) => {
946
+ const dragResumeTimer = useRef(null);
947
+ const scrollThreshold = 10;
948
+ const isScrolling = useRef(false);
949
+ const isPending = useRef(false);
950
+ const isMouseDown = useRef(false);
951
+ const isDragging = useRef(false);
952
+ const touchStartX = useRef(0);
953
+ const touchStartY = useRef(0);
954
+ const handleStart = useCallback(
955
+ ({
956
+ event: _event,
957
+ dragStartCallback
958
+ }) => {
959
+ const event = _event instanceof Event ? _event : _event.nativeEvent;
960
+ if (dragResumeTimer.current) {
961
+ clearTimeout(dragResumeTimer.current);
962
+ dragResumeTimer.current = null;
963
+ }
964
+ if (event.target.contentEditable === "true" || isBlockingActiveInput && document.activeElement === event.target) {
965
+ return;
966
+ }
967
+ if (event.cancelable) {
968
+ event.preventDefault();
969
+ }
970
+ isPending.current = true;
971
+ isMouseDown.current = true;
972
+ if (event instanceof globalThis.TouchEvent) {
973
+ const touch = event.touches[0];
974
+ touchStartX.current = touch.clientX;
975
+ touchStartY.current = touch.clientY;
976
+ } else if (event instanceof globalThis.MouseEvent) {
977
+ touchStartX.current = event.clientX;
978
+ touchStartY.current = event.clientY;
979
+ }
980
+ setTimeout(() => {
981
+ if (!isPending.current || isScrolling.current) return;
982
+ isPending.current = false;
983
+ isDragging.current = true;
984
+ const xy = getClientXy(event);
985
+ if (!xy) return;
986
+ const { clientX, clientY } = xy;
987
+ dragStartCallback({ x: clientX, y: clientY });
988
+ }, 300);
989
+ },
990
+ [isBlockingActiveInput]
991
+ );
992
+ const handleMove = useCallback(
993
+ ({
994
+ event: _event,
995
+ notDragCallback,
996
+ dragStartCallback,
997
+ moveingCallback
998
+ }) => {
999
+ if (!isMouseDown.current) return;
1000
+ const event = _event instanceof Event ? _event : _event.nativeEvent;
1001
+ const xy = getClientXy(event);
1002
+ if (!xy) return;
1003
+ const { clientX, clientY } = xy;
1004
+ const deltaX = Math.abs(clientX - touchStartX.current);
1005
+ const deltaY = Math.abs(clientY - touchStartY.current);
1006
+ if (isPending.current && (deltaX > scrollThreshold || deltaY > scrollThreshold)) {
1007
+ isScrolling.current = true;
1008
+ isPending.current = false;
1009
+ isDragging.current = false;
1010
+ if (notDragCallback)
1011
+ notDragCallback({ x: clientX, y: clientY });
1012
+ if (dragResumeTimer.current) {
1013
+ clearTimeout(dragResumeTimer.current);
1014
+ dragResumeTimer.current = null;
1015
+ }
1016
+ dragResumeTimer.current = setTimeout(() => {
1017
+ if (!isMouseDown.current) return;
1018
+ if (dragStartCallback)
1019
+ dragStartCallback({ x: clientX, y: clientY });
1020
+ isPending.current = true;
1021
+ isScrolling.current = false;
1022
+ handleStart({ event: _event, dragStartCallback });
1023
+ }, 400);
1024
+ return;
1025
+ }
1026
+ if (!isDragging.current || isPending.current) return;
1027
+ moveingCallback({ x: clientX, y: clientY });
1028
+ },
1029
+ [isBlockingActiveInput]
1030
+ );
1031
+ const handleEnd = useCallback(
1032
+ ({
1033
+ event: _event,
1034
+ dragEndCallback
1035
+ }) => {
1036
+ isScrolling.current = false;
1037
+ isMouseDown.current = false;
1038
+ if (isPending.current) {
1039
+ isPending.current = false;
1040
+ return;
1041
+ }
1042
+ const event = _event instanceof Event ? _event : _event.nativeEvent;
1043
+ if (!isDragging.current) return;
1044
+ isDragging.current = false;
1045
+ const xy = getClientXy(event);
1046
+ if (!xy) return;
1047
+ const { clientX, clientY } = xy;
1048
+ dragEndCallback({ x: clientX, y: clientY });
1049
+ },
1050
+ [isBlockingActiveInput]
1051
+ );
1052
+ return {
1053
+ handleStart,
1054
+ handleMove,
1055
+ handleEnd
1056
+ };
1057
+ };
1058
+ new Subject();
1059
+ function useFlexLayoutSplitScreen({
1060
+ isSplitInitial = false,
1061
+ parentDirection,
1062
+ directionInitial = "row",
1063
+ selfContainerName,
1064
+ parentLayoutName,
1065
+ layoutName
1066
+ }) {
1067
+ const [direction, setDirection] = useState(
1068
+ directionInitial
1069
+ );
1070
+ const [isSplit, setIsSplit] = useState(isSplitInitial);
1071
+ const [boundaryContainerSize, setBoundaryContainerSize] = useState(null);
1072
+ const [centerDropTargetComponent, setCenterDropTargetComponent] = useState([]);
1073
+ const [afterDropTargetComponent, setAfterDropTargetComponent] = useState([]);
1074
+ const [beforeDropTargetComponent, setBeforeDropTargetComponent] = useState([]);
1075
+ const layoutRef = useRef(null);
1076
+ const dragState2 = useDragCapture(layoutRef);
1077
+ useEffect(() => {
1078
+ if (!dragState2) {
1079
+ setBoundaryContainerSize(null);
1080
+ return;
1081
+ }
1082
+ const {
1083
+ isDrop,
1084
+ isDragging,
1085
+ positionName,
1086
+ containerName,
1087
+ children: dropComponent,
1088
+ isOver,
1089
+ navigationTitle,
1090
+ dropEndCallback,
1091
+ x,
1092
+ y,
1093
+ screenKey
1094
+ } = dragState2;
1095
+ const orderName = positionName === "leftBoundary" || positionName === "topBoundary" ? "before" : positionName === "rightBoundary" || positionName === "bottomBoundary" ? "after" : "center";
1096
+ if ((isOver || isDrop) && boundaryContainerSize) {
1097
+ setBoundaryContainerSize(null);
1098
+ }
1099
+ if (selfContainerName.startsWith(containerName)) {
1100
+ return;
1101
+ }
1102
+ if (isDrop && screenKey) {
1103
+ const dropDirection = positionName === "leftBoundary" || positionName === "rightBoundary" ? "row" : "column";
1104
+ if (!isSplit && !isOver) {
1105
+ if (positionName !== "centerBoundary" && dropDirection !== parentDirection) {
1106
+ setIsSplit(true);
1107
+ setDirection(dropDirection);
1108
+ }
1109
+ dropMovementEventSubject.next({
1110
+ state: "append",
1111
+ targetContainerName: containerName,
1112
+ targetParentLayoutName: parentLayoutName,
1113
+ targetLayoutName: layoutName,
1114
+ targetComponent: dropComponent,
1115
+ orderName,
1116
+ x,
1117
+ y,
1118
+ dropEndCallback,
1119
+ dropTargetComponentEvent: {
1120
+ navigationTitle,
1121
+ dropDocumentOutsideOption: dragState2?.dropDocumentOutsideOption,
1122
+ direction: dropDirection,
1123
+ screenKey
1124
+ }
1125
+ });
1126
+ }
1127
+ }
1128
+ if (isDragging && !isSplit && !isOver) {
1129
+ const newSize = {
1130
+ left: positionName === "rightBoundary" ? "50%" : "0",
1131
+ top: positionName === "bottomBoundary" ? "50%" : "0",
1132
+ width: positionName === "leftBoundary" || positionName === "rightBoundary" ? "50%" : "100%",
1133
+ height: positionName === "topBoundary" || positionName === "bottomBoundary" ? "50%" : "100%"
1134
+ };
1135
+ if (JSON.stringify(boundaryContainerSize) !== JSON.stringify(newSize)) {
1136
+ setBoundaryContainerSize(newSize);
1137
+ }
1138
+ }
1139
+ }, [
1140
+ dragState2,
1141
+ isSplit,
1142
+ boundaryContainerSize,
1143
+ parentLayoutName,
1144
+ layoutName,
1145
+ selfContainerName,
1146
+ direction
1147
+ ]);
1148
+ return {
1149
+ direction,
1150
+ setDirection,
1151
+ isSplit,
1152
+ setIsSplit,
1153
+ boundaryContainerSize,
1154
+ //setBoundaryContainerSize,
1155
+ centerDropTargetComponent,
1156
+ afterDropTargetComponent,
1157
+ beforeDropTargetComponent,
1158
+ setAfterDropTargetComponent,
1159
+ setBeforeDropTargetComponent,
1160
+ setCenterDropTargetComponent,
1161
+ //dropTargetComponent,
1162
+ //setDropTargetComponent,
1163
+ //setDropPosition,
1164
+ isOver: dragState2?.isOver,
1165
+ layoutRef
1166
+ };
1167
+ }
1168
+ var MAX_STEP = 18;
1169
+ function edgeVelocity(x, y) {
1170
+ const w = window.innerWidth, h = window.innerHeight;
1171
+ const mx = w * 0.15, my = h * 0.15;
1172
+ let vx = 0;
1173
+ if (x < mx)
1174
+ vx = -((mx - x) / mx) * MAX_STEP;
1175
+ else if (x > w - mx)
1176
+ vx = (x - (w - mx)) / mx * MAX_STEP;
1177
+ let vy = 0;
1178
+ if (y < my)
1179
+ vy = -((my - y) / my) * MAX_STEP;
1180
+ else if (y > h - my)
1181
+ vy = (y - (h - my)) / my * MAX_STEP;
1182
+ return { vx, vy };
1183
+ }
1184
+ function FlexLayoutSplitScreenDragBox({
1185
+ onMouseDown,
1186
+ onTouchStart,
1187
+ dropEndCallback,
1188
+ style,
1189
+ navigationTitle,
1190
+ targetComponent,
1191
+ containerName,
1192
+ children,
1193
+ className,
1194
+ dropDocumentOutsideOption,
1195
+ screenKey = Array.from(
1196
+ window.crypto.getRandomValues(new Uint32Array(16)),
1197
+ (e) => e.toString(32).padStart(2, "0")
1198
+ ).join(""),
1199
+ isBlockingActiveInput = false,
1200
+ customData = {},
1201
+ scrollTargetRef,
1202
+ ...props
1203
+ }) {
1204
+ const scrollRAF = useRef(null);
1205
+ const velocity = useRef({ vx: 0, vy: 0 });
1206
+ const ref = useRef(null);
1207
+ const clonedNodeRef = useRef(null);
1208
+ const clonedWidth = useRef(null);
1209
+ const clonedHeight = useRef(null);
1210
+ const hrefUrlRef = useRef("");
1211
+ const { handleStart, handleMove, handleEnd } = useDragEvents({
1212
+ isBlockingActiveInput
1213
+ });
1214
+ const handleMoveWrapper = (event) => {
1215
+ let x = 0;
1216
+ let y = 0;
1217
+ if (event.type === "touchmove") {
1218
+ const t = event.touches[0];
1219
+ x = t.clientX;
1220
+ y = t.clientY;
1221
+ } else {
1222
+ const m = event;
1223
+ x = m.clientX;
1224
+ y = m.clientY;
1225
+ }
1226
+ const { vx, vy } = edgeVelocity(x, y);
1227
+ const inEdge = vx !== 0 || vy !== 0;
1228
+ if (clonedNodeRef.current?.isConnected && !inEdge) {
1229
+ event.preventDefault();
1230
+ if (scrollRAF.current) {
1231
+ cancelAnimationFrame(scrollRAF.current);
1232
+ scrollRAF.current = null;
1233
+ }
1234
+ }
1235
+ if (clonedNodeRef.current?.isConnected && inEdge) {
1236
+ event.preventDefault();
1237
+ velocity.current = { vx, vy };
1238
+ if (!scrollRAF.current) {
1239
+ const step = () => {
1240
+ scrollTargetRef?.current?.scrollBy(
1241
+ velocity.current.vx,
1242
+ velocity.current.vy
1243
+ );
1244
+ if (velocity.current.vx === 0 && velocity.current.vy === 0) {
1245
+ scrollRAF.current = null;
1246
+ return;
1247
+ }
1248
+ scrollRAF.current = requestAnimationFrame(step);
1249
+ };
1250
+ scrollRAF.current = requestAnimationFrame(step);
1251
+ }
1252
+ }
1253
+ if (event.type !== "touchmove") {
1254
+ event.preventDefault();
1255
+ }
1256
+ handleMove({
1257
+ event,
1258
+ notDragCallback: ({ x: x2, y: y2 }) => {
1259
+ if (clonedNodeRef.current) clonedNodeRef.current.remove();
1260
+ },
1261
+ dragStartCallback: ({ x: x2, y: y2 }) => {
1262
+ if (!clonedNodeRef.current) return;
1263
+ navigator.vibrate(100);
1264
+ clonedNodeRef.current.style.left = `${x2 - (clonedWidth.current || 0) / 2}px`;
1265
+ clonedNodeRef.current.style.top = `${y2 - (clonedHeight.current || 0) / 2}px`;
1266
+ },
1267
+ moveingCallback: ({ x: x2, y: y2 }) => {
1268
+ if (clonedNodeRef.current?.isConnected) {
1269
+ clonedNodeRef.current.style.left = `${x2 - (clonedWidth.current || 0) / 2}px`;
1270
+ clonedNodeRef.current.style.top = `${y2 - (clonedHeight.current || 0) / 2}px`;
1271
+ }
1272
+ dragState.next({
1273
+ isDragging: true,
1274
+ isDrop: false,
1275
+ navigationTitle,
1276
+ children: targetComponent,
1277
+ x: x2,
1278
+ y: y2,
1279
+ containerName,
1280
+ dropDocumentOutsideOption,
1281
+ customData
1282
+ });
1283
+ }
1284
+ });
1285
+ };
1286
+ const handleEndWrapper = (event) => {
1287
+ if (scrollRAF.current !== null) {
1288
+ cancelAnimationFrame(scrollRAF.current);
1289
+ scrollRAF.current = null;
1290
+ }
1291
+ velocity.current = { vx: 0, vy: 0 };
1292
+ handleEnd({
1293
+ event,
1294
+ dragEndCallback: ({ x, y }) => {
1295
+ const href = hrefUrlRef.current;
1296
+ if (clonedNodeRef.current) clonedNodeRef.current.remove();
1297
+ if (dropDocumentOutsideOption && isDocumentOut({ x, y })) {
1298
+ if (dropDocumentOutsideOption.isNewTap || !dropDocumentOutsideOption.widthRatio && !dropDocumentOutsideOption.heightRatio) {
1299
+ window.open(href, "_blank");
1300
+ } else {
1301
+ const width = window.innerWidth * (dropDocumentOutsideOption.widthRatio || 1);
1302
+ const height = window.innerHeight * (dropDocumentOutsideOption.heightRatio || 1);
1303
+ window.open(
1304
+ href,
1305
+ "_blank",
1306
+ `width=${width},height=${height},left=${window.screenLeft - x * -1 - width},top=${window.screenTop + y}`
1307
+ );
1308
+ }
1309
+ }
1310
+ dragState.next({
1311
+ isDragging: false,
1312
+ isDrop: true,
1313
+ navigationTitle,
1314
+ children: targetComponent,
1315
+ x,
1316
+ y,
1317
+ containerName,
1318
+ dropDocumentOutsideOption,
1319
+ dropEndCallback,
1320
+ screenKey,
1321
+ customData
1322
+ });
1323
+ }
1324
+ });
1325
+ };
1326
+ useEffect(() => {
1327
+ if (ref.current) {
1328
+ const clone = ref.current.cloneNode(true);
1329
+ const originRect = ref.current.getBoundingClientRect();
1330
+ clone.style.width = originRect.width + "px";
1331
+ clone.style.height = originRect.height + "px";
1332
+ clone.style.opacity = "0.3";
1333
+ clone.style.backdropFilter = "blur(6px)";
1334
+ clonedWidth.current = originRect.width;
1335
+ clonedHeight.current = originRect.height;
1336
+ if (dropDocumentOutsideOption?.openUrl) {
1337
+ hrefUrlRef.current = dropDocumentOutsideOption.openUrl;
1338
+ const href = document.createElement("span");
1339
+ href.textContent = hrefUrlRef.current;
1340
+ clone.prepend(href);
1341
+ }
1342
+ if (navigationTitle) {
1343
+ const title = document.createElement("span");
1344
+ title.textContent = navigationTitle;
1345
+ clone.prepend(title);
1346
+ }
1347
+ clone.style.position = "fixed";
1348
+ clonedNodeRef.current = clone;
1349
+ clonedNodeRef.current.classList.add(
1350
+ FlexLayout_default["flex-split-screen-drag-box-clone"]
1351
+ );
1352
+ }
1353
+ }, []);
1354
+ useEffect(() => {
1355
+ const moveEvents = [
1356
+ "mousemove",
1357
+ "touchmove"
1358
+ ];
1359
+ const endEvents = ["mouseup", "touchend"];
1360
+ moveEvents.forEach((eventName) => {
1361
+ window.addEventListener(eventName, handleMoveWrapper, {
1362
+ passive: false
1363
+ });
1364
+ });
1365
+ endEvents.forEach((eventName) => {
1366
+ window.addEventListener(eventName, handleEndWrapper);
1367
+ });
1368
+ return () => {
1369
+ moveEvents.forEach((eventName) => {
1370
+ window.removeEventListener(eventName, handleMoveWrapper);
1371
+ });
1372
+ endEvents.forEach((eventName) => {
1373
+ window.removeEventListener(eventName, handleEndWrapper);
1374
+ });
1375
+ };
1376
+ }, [
1377
+ customData,
1378
+ targetComponent,
1379
+ dropDocumentOutsideOption,
1380
+ screenKey,
1381
+ isBlockingActiveInput,
1382
+ containerName,
1383
+ navigationTitle,
1384
+ dropEndCallback
1385
+ ]);
1386
+ useEffect(() => {
1387
+ const el = ref.current;
1388
+ if (!el) return;
1389
+ const onCtx = (e) => e.preventDefault();
1390
+ el.addEventListener("contextmenu", onCtx);
1391
+ return () => {
1392
+ el.removeEventListener("contextmenu", onCtx);
1393
+ };
1394
+ }, []);
1395
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
1396
+ "div",
1397
+ {
1398
+ className: `${className || ""} ${FlexLayout_default["flex-split-screen-drag-box"]}`,
1399
+ ref,
1400
+ onContextMenu: (e) => e.preventDefault(),
1401
+ onMouseDown: (ev) => {
1402
+ if (onMouseDown) {
1403
+ Promise.resolve().then(() => onMouseDown(ev));
1404
+ }
1405
+ handleStart({
1406
+ event: ev,
1407
+ dragStartCallback: ({ x, y }) => {
1408
+ if (clonedNodeRef.current) {
1409
+ document.body.appendChild(
1410
+ clonedNodeRef.current
1411
+ );
1412
+ if (ref.current) {
1413
+ const originRect = ref.current.getBoundingClientRect();
1414
+ clonedNodeRef.current.style.width = originRect.width + "px";
1415
+ clonedNodeRef.current.style.height = originRect.height + "px";
1416
+ clonedWidth.current = originRect.width;
1417
+ clonedHeight.current = originRect.height;
1418
+ }
1419
+ }
1420
+ if (clonedNodeRef.current?.isConnected) {
1421
+ navigator.vibrate(100);
1422
+ clonedNodeRef.current.style.left = `${x - (clonedWidth.current || 0) / 2}px`;
1423
+ clonedNodeRef.current.style.top = `${y - (clonedHeight.current || 0) / 2}px`;
1424
+ }
1425
+ dragState.next({
1426
+ isDragging: true,
1427
+ isDrop: false,
1428
+ navigationTitle,
1429
+ children: targetComponent,
1430
+ x,
1431
+ y,
1432
+ containerName,
1433
+ dropDocumentOutsideOption,
1434
+ customData
1435
+ });
1436
+ }
1437
+ });
1438
+ },
1439
+ onTouchStart: (ev) => {
1440
+ if (onTouchStart) {
1441
+ Promise.resolve().then(() => onTouchStart(ev));
1442
+ }
1443
+ handleStart({
1444
+ event: ev,
1445
+ dragStartCallback: ({ x, y }) => {
1446
+ if (clonedNodeRef.current) {
1447
+ document.body.appendChild(
1448
+ clonedNodeRef.current
1449
+ );
1450
+ if (ref.current) {
1451
+ const originRect = ref.current.getBoundingClientRect();
1452
+ clonedNodeRef.current.style.width = originRect.width + "px";
1453
+ clonedNodeRef.current.style.height = originRect.height + "px";
1454
+ clonedWidth.current = originRect.width;
1455
+ clonedHeight.current = originRect.height;
1456
+ }
1457
+ }
1458
+ if (clonedNodeRef.current?.isConnected) {
1459
+ navigator.vibrate(100);
1460
+ clonedNodeRef.current.style.left = `${x - (clonedWidth.current || 0) / 2}px`;
1461
+ clonedNodeRef.current.style.top = `${y - (clonedHeight.current || 0) / 2}px`;
1462
+ }
1463
+ dragState.next({
1464
+ isDragging: true,
1465
+ isDrop: false,
1466
+ navigationTitle,
1467
+ children: targetComponent,
1468
+ x,
1469
+ y,
1470
+ containerName,
1471
+ dropDocumentOutsideOption,
1472
+ customData
1473
+ });
1474
+ }
1475
+ });
1476
+ },
1477
+ style: { ...style },
1478
+ ...props,
1479
+ children
1480
+ }
1481
+ ) });
1482
+ }
1483
+
1484
+ // src/flex-layout/styles/listScroll.module.css
1485
+ var listScroll_default = {};
1486
+ var FlexLayoutSplitScreenScrollBox = ({
1487
+ className,
1488
+ children,
1489
+ keyName,
1490
+ direction,
1491
+ isDefaultScrollStyle = false,
1492
+ ...props
1493
+ }) => {
1494
+ const scrollRef = useRef(null);
1495
+ const [isMouseDown, setIsMouseDown] = useState(false);
1496
+ const scrollEventSubject = useRef(new Subject());
1497
+ useEffect(() => {
1498
+ const mouseUpSubscribe = fromEvent(
1499
+ window,
1500
+ "mouseup"
1501
+ ).subscribe(() => {
1502
+ setIsMouseDown(false);
1503
+ });
1504
+ const scrollEventSubscribe = scrollEventSubject.current.pipe(throttleTime(70)).subscribe((position) => {
1505
+ setScrollPosition(keyName, position);
1506
+ });
1507
+ const scrollSubscribe = getScrollPosition(keyName).pipe(take(1)).subscribe((position) => {
1508
+ if (scrollRef.current && position) {
1509
+ scrollRef.current.scrollLeft = position.x;
1510
+ scrollRef.current.scrollTop = position.y;
1511
+ }
1512
+ });
1513
+ return () => {
1514
+ removeScrollPosition(keyName);
1515
+ mouseUpSubscribe.unsubscribe();
1516
+ scrollSubscribe.unsubscribe();
1517
+ scrollEventSubscribe.unsubscribe();
1518
+ };
1519
+ }, [keyName]);
1520
+ useEffect(() => {
1521
+ if (!scrollRef.current) return;
1522
+ let animationFrameId = null;
1523
+ const handleWheel = (event) => {
1524
+ if (!scrollRef.current || direction !== "x") return;
1525
+ if (scrollRef.current.matches(":hover")) {
1526
+ event.preventDefault();
1527
+ const { deltaY } = event;
1528
+ const newScrollLeft = scrollRef.current.scrollLeft + deltaY;
1529
+ if (animationFrameId) {
1530
+ cancelAnimationFrame(animationFrameId);
1531
+ }
1532
+ animationFrameId = requestAnimationFrame(() => {
1533
+ scrollRef.current.scrollLeft = newScrollLeft;
1534
+ scrollEventSubject.current.next({
1535
+ x: newScrollLeft,
1536
+ y: scrollRef.current.scrollTop
1537
+ });
1538
+ animationFrameId = null;
1539
+ });
1540
+ }
1541
+ };
1542
+ scrollRef.current.addEventListener("wheel", handleWheel, {
1543
+ passive: false
1544
+ });
1545
+ return () => {
1546
+ scrollRef.current?.removeEventListener("wheel", handleWheel);
1547
+ };
1548
+ }, []);
1549
+ return /* @__PURE__ */ jsx(
1550
+ "div",
1551
+ {
1552
+ ref: scrollRef,
1553
+ onMouseUp: () => setIsMouseDown(false),
1554
+ onMouseDown: () => setIsMouseDown(true),
1555
+ onMouseMove: (event) => {
1556
+ if (!scrollRef.current || !isMouseDown || direction !== "x")
1557
+ return;
1558
+ scrollRef.current.scrollLeft += event.movementX * -1;
1559
+ scrollEventSubject.current.next({
1560
+ x: scrollRef.current.scrollLeft,
1561
+ y: scrollRef.current.scrollTop
1562
+ });
1563
+ },
1564
+ onScroll: () => {
1565
+ if (!scrollRef.current) return;
1566
+ scrollEventSubject.current.next({
1567
+ x: scrollRef.current.scrollLeft,
1568
+ y: scrollRef.current.scrollTop
1569
+ });
1570
+ },
1571
+ className: `${className || ""} ${isDefaultScrollStyle ? listScroll_default["default-scroll"] : listScroll_default["list-scroll"]} ${direction ? listScroll_default[direction] : ""}`,
1572
+ ...props,
1573
+ children
1574
+ }
1575
+ );
1576
+ };
1577
+ var FlexLayoutSplitScreenScrollBox_default = memo(FlexLayoutSplitScreenScrollBox);
1578
+ function FlexLayoutSplitScreenDragBoxContainer({
1579
+ className,
1580
+ children,
1581
+ layoutName,
1582
+ ...props
1583
+ }) {
1584
+ return /* @__PURE__ */ jsx(
1585
+ FlexLayoutSplitScreenScrollBox_default,
1586
+ {
1587
+ keyName: layoutName,
1588
+ className: `${FlexLayout_default["flex-split-screen-drag-box-title-container"]} ${className && className !== "" && className || ""}`,
1589
+ direction: "x",
1590
+ ...props,
1591
+ children
1592
+ }
1593
+ );
1594
+ }
1595
+ function FlexLayoutSplitScreenDragBoxItem({
1596
+ children,
1597
+ onClose,
1598
+ isActive,
1599
+ ...props
1600
+ }) {
1601
+ useEffect(() => {
1602
+ allSplitScreenCount.next(allSplitScreenCount.value + 1);
1603
+ return () => {
1604
+ if (allSplitScreenCount.value <= 1) return;
1605
+ allSplitScreenCount.next(allSplitScreenCount.value - 1);
1606
+ };
1607
+ }, []);
1608
+ return /* @__PURE__ */ jsxs(
1609
+ "div",
1610
+ {
1611
+ className: `${FlexLayout_default["flex-split-screen-drag-box-title-item"]} ${isActive ? FlexLayout_default["active"] : ""}`,
1612
+ ...props,
1613
+ children: [
1614
+ children,
1615
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: (ev) => onClose(ev), children: "X" })
1616
+ ]
1617
+ }
1618
+ );
1619
+ }
1620
+ function FlexLayoutSplitScreenDragBoxTitleMore({
1621
+ className,
1622
+ ...props
1623
+ }) {
1624
+ return /* @__PURE__ */ jsxs(
1625
+ "button",
1626
+ {
1627
+ ...props,
1628
+ className: `${FlexLayout_default["flex-split-screen-drag-box-title-more"]} ${className || ""}`,
1629
+ children: [
1630
+ /* @__PURE__ */ jsx("span", { children: "." }),
1631
+ /* @__PURE__ */ jsx("span", { children: "." }),
1632
+ /* @__PURE__ */ jsx("span", { children: "." })
1633
+ ]
1634
+ }
1635
+ );
1636
+ }
1637
+ function isOverDrop({
1638
+ x,
1639
+ y,
1640
+ element
1641
+ }) {
1642
+ const {
1643
+ x: elementX,
1644
+ y: elementY,
1645
+ right: elementRight,
1646
+ bottom: elementBottom
1647
+ } = element.getBoundingClientRect();
1648
+ const isElementOver = x < elementX || x > elementRight || y < elementY || y > elementBottom;
1649
+ return isElementOver;
1650
+ }
1651
+ function isInnerDrop({
1652
+ x,
1653
+ y,
1654
+ element
1655
+ }) {
1656
+ const {
1657
+ x: elementX,
1658
+ y: elementY,
1659
+ right: elementRight,
1660
+ bottom: elementBottom
1661
+ } = element.getBoundingClientRect();
1662
+ const isElementInner = x >= elementX && x <= elementRight && y >= elementY && y <= elementBottom;
1663
+ return isElementInner;
1664
+ }
1665
+ var handleUpdateDropTargetComponents = ({
1666
+ orderName,
1667
+ parentOrderName,
1668
+ containerName,
1669
+ parentLayoutName,
1670
+ layoutName,
1671
+ dropComponent,
1672
+ navigationTitle,
1673
+ nextContainerName,
1674
+ isUsePrefix = true,
1675
+ beforeDropTargetComponent,
1676
+ afterDropTargetComponent,
1677
+ centerDropTargetComponent,
1678
+ dropDocumentOutsideOption,
1679
+ screenKey = Array.from(
1680
+ window.crypto.getRandomValues(new Uint32Array(16)),
1681
+ (e) => e.toString(32).padStart(2, "0")
1682
+ ).join("")
1683
+ }) => {
1684
+ const nextContainerNameOrderName = parentOrderName ? parentOrderName : orderName;
1685
+ let listMap;
1686
+ let list;
1687
+ let key;
1688
+ if (nextContainerNameOrderName === orderName || nextContainerNameOrderName === "center") {
1689
+ listMap = orderName === "before" ? { beforeDropTargetComponent } : orderName === "after" ? { afterDropTargetComponent } : {
1690
+ centerDropTargetComponent: centerDropTargetComponent.filter(
1691
+ (e) => !e.containerName.split("_").at(0).startsWith(
1692
+ containerName.split("_").at(0)
1693
+ )
1694
+ )
1695
+ };
1696
+ } else {
1697
+ listMap = nextContainerNameOrderName === "before" ? { beforeDropTargetComponent } : { afterDropTargetComponent };
1698
+ }
1699
+ const entries = Object.entries(listMap)[0];
1700
+ key = entries[0];
1701
+ list = entries[1];
1702
+ const newComponent = {
1703
+ containerName: `${containerName + "_" + layoutName}${isUsePrefix ? "_" + orderName + "-" + list.length : ""}`,
1704
+ component: cloneElement(
1705
+ dropComponent,
1706
+ { key: screenKey, screenKey }
1707
+ ),
1708
+ navigationTitle,
1709
+ dropDocumentOutsideOption,
1710
+ screenKey: screenKey || Array.from(
1711
+ window.crypto.getRandomValues(new Uint32Array(16)),
1712
+ (e) => e.toString(32).padStart(2, "0")
1713
+ ).join("")
1714
+ };
1715
+ let allComponents;
1716
+ if (nextContainerName) {
1717
+ const index = list.findIndex(
1718
+ (item) => item.containerName === nextContainerName
1719
+ );
1720
+ if (index !== -1) {
1721
+ if (nextContainerNameOrderName === orderName) {
1722
+ if (orderName === "before") {
1723
+ allComponents = [
1724
+ ...list.slice(0, index),
1725
+ newComponent,
1726
+ ...list.slice(index)
1727
+ ];
1728
+ } else {
1729
+ allComponents = [
1730
+ ...list.slice(0, index + 1),
1731
+ newComponent,
1732
+ ...list.slice(index + 1)
1733
+ ];
1734
+ }
1735
+ } else {
1736
+ if (nextContainerNameOrderName === "after" && orderName === "before") {
1737
+ allComponents = [
1738
+ ...list.slice(0, index),
1739
+ newComponent,
1740
+ ...list.slice(index)
1741
+ ];
1742
+ } else if (nextContainerNameOrderName === "before" && orderName === "after") {
1743
+ allComponents = [
1744
+ ...list.slice(0, index + 1),
1745
+ newComponent,
1746
+ ...list.slice(index + 1)
1747
+ ];
1748
+ } else {
1749
+ if (orderName === "before") {
1750
+ allComponents = [
1751
+ ...list.slice(0, index),
1752
+ newComponent,
1753
+ ...list.slice(index)
1754
+ ];
1755
+ } else {
1756
+ allComponents = [
1757
+ ...list.slice(0, index + 1),
1758
+ newComponent,
1759
+ ...list.slice(index + 1)
1760
+ ];
1761
+ }
1762
+ }
1763
+ }
1764
+ } else {
1765
+ if (nextContainerNameOrderName === "center" && orderName === "after") {
1766
+ allComponents = [newComponent, ...list];
1767
+ } else if (nextContainerNameOrderName === "center" && orderName === "before") {
1768
+ allComponents = [...list, newComponent];
1769
+ } else {
1770
+ allComponents = orderName === "before" ? [newComponent, ...list] : [...list, newComponent];
1771
+ }
1772
+ }
1773
+ } else {
1774
+ allComponents = orderName === "before" ? [newComponent, ...list] : [...list, newComponent];
1775
+ }
1776
+ const seen = /* @__PURE__ */ new Set();
1777
+ const result = allComponents.filter((item) => {
1778
+ if (seen.has(item.containerName)) {
1779
+ return false;
1780
+ }
1781
+ seen.add(item.containerName);
1782
+ return true;
1783
+ });
1784
+ dropMovementEventSubject.next({
1785
+ state: "append",
1786
+ targetParentLayoutName: parentLayoutName,
1787
+ targetLayoutName: layoutName,
1788
+ targetContainerName: containerName,
1789
+ orderName
1790
+ });
1791
+ return { [key]: result };
1792
+ };
1793
+ var handleRemove = (list, targetContainerName, orderNameSetter) => {
1794
+ const result = list.filter((e) => e.containerName !== targetContainerName);
1795
+ if (result.length != list.length)
1796
+ orderNameSetter(list.length - result.length);
1797
+ return result;
1798
+ };
1799
+ function getAdjacentItem(items, currentIndex) {
1800
+ if (currentIndex + 1 < items.length) {
1801
+ return {
1802
+ adjacentItem: items[currentIndex + 1],
1803
+ adjacentIndex: currentIndex + 1
1804
+ };
1805
+ } else if (currentIndex - 1 >= 0) {
1806
+ return {
1807
+ adjacentItem: items[currentIndex - 1],
1808
+ adjacentIndex: currentIndex - 1
1809
+ };
1810
+ }
1811
+ return { adjacentItem: null, adjacentIndex: currentIndex };
1812
+ }
1813
+ var getSelfOrderName = (containerName) => {
1814
+ const result = containerName.split("_").at(-1)?.split("-").at(0)?.split("=").at(0);
1815
+ if (["before", "center", "after"].some((e) => e === result)) {
1816
+ return result;
1817
+ } else {
1818
+ return;
1819
+ }
1820
+ };
1821
+ function FlexLayoutSplitScreen({
1822
+ children,
1823
+ containerName,
1824
+ layoutName,
1825
+ navigationTitle,
1826
+ dropDocumentOutsideOption,
1827
+ screenKey
1828
+ }) {
1829
+ const {
1830
+ direction,
1831
+ isSplit,
1832
+ boundaryContainerSize,
1833
+ afterDropTargetComponent,
1834
+ beforeDropTargetComponent,
1835
+ centerDropTargetComponent,
1836
+ setAfterDropTargetComponent,
1837
+ setBeforeDropTargetComponent,
1838
+ setCenterDropTargetComponent,
1839
+ layoutRef,
1840
+ setIsSplit,
1841
+ setDirection
1842
+ } = useFlexLayoutSplitScreen({
1843
+ isSplitInitial: false,
1844
+ directionInitial: "row",
1845
+ selfContainerName: containerName,
1846
+ parentLayoutName: "",
1847
+ layoutName
1848
+ });
1849
+ useEffect(() => {
1850
+ resetRootSplitScreen(layoutName);
1851
+ const subscribe = getSplitScreen(layoutName, layoutName).subscribe((layoutInfo) => {
1852
+ if (layoutInfo) {
1853
+ setBeforeDropTargetComponent([
1854
+ ...layoutInfo.beforeDropTargetComponent
1855
+ ]);
1856
+ setAfterDropTargetComponent([
1857
+ ...layoutInfo.afterDropTargetComponent
1858
+ ]);
1859
+ setCenterDropTargetComponent([
1860
+ ...layoutInfo.centerDropTargetComponent
1861
+ ]);
1862
+ setDirection(layoutInfo.direction);
1863
+ if (layoutInfo.beforeDropTargetComponent.length !== 0 || layoutInfo.afterDropTargetComponent.length !== 0) {
1864
+ setIsSplit(true);
1865
+ }
1866
+ } else {
1867
+ setSplitScreen(layoutName, layoutName, {
1868
+ afterDropTargetComponent: [],
1869
+ beforeDropTargetComponent: [],
1870
+ centerDropTargetComponent: [
1871
+ {
1872
+ containerName,
1873
+ component: children,
1874
+ navigationTitle,
1875
+ dropDocumentOutsideOption,
1876
+ screenKey: screenKey ? screenKey : Array.from(
1877
+ window.crypto.getRandomValues(
1878
+ new Uint32Array(16)
1879
+ ),
1880
+ (e) => e.toString(32).padStart(2, "0")
1881
+ ).join("")
1882
+ }
1883
+ ],
1884
+ direction
1885
+ });
1886
+ }
1887
+ });
1888
+ return () => {
1889
+ subscribe.unsubscribe();
1890
+ resetRootSplitScreen(layoutName);
1891
+ };
1892
+ }, [layoutName]);
1893
+ useEffect(() => {
1894
+ const subscribe = dropMovementEventSubject.pipe(
1895
+ distinctUntilChanged$1((prev, curr) => {
1896
+ const filterChildren2 = (obj) => {
1897
+ const {
1898
+ children: children2,
1899
+ component,
1900
+ targetComponent,
1901
+ x,
1902
+ y,
1903
+ ...rest
1904
+ } = obj || {};
1905
+ return rest;
1906
+ };
1907
+ return equal(filterChildren2(prev), filterChildren2(curr));
1908
+ })
1909
+ ).subscribe((event) => {
1910
+ if (event.state === "remove") {
1911
+ if (event.targetParentLayoutName === layoutName || event.targetParentLayoutName === "" && event.targetLayoutName === layoutName) {
1912
+ requestAnimationFrame(() => {
1913
+ let removeCallback = (removeOrderName) => {
1914
+ if (event.nextContainerName && event.dropTargetComponentEvent && event.targetComponent) {
1915
+ const targetComponentsMap = handleUpdateDropTargetComponents({
1916
+ orderName: removeOrderName,
1917
+ containerName: event.nextContainerName,
1918
+ parentLayoutName: "",
1919
+ layoutName,
1920
+ dropComponent: event.targetComponent,
1921
+ navigationTitle: event.dropTargetComponentEvent.navigationTitle,
1922
+ isUsePrefix: true,
1923
+ afterDropTargetComponent,
1924
+ beforeDropTargetComponent,
1925
+ centerDropTargetComponent,
1926
+ dropDocumentOutsideOption,
1927
+ screenKey: event.dropTargetComponentEvent.screenKey
1928
+ });
1929
+ setSplitScreen(layoutName, layoutName, {
1930
+ ...getCurrentSplitScreenComponents(
1931
+ layoutName,
1932
+ layoutName
1933
+ ) || {
1934
+ afterDropTargetComponent,
1935
+ beforeDropTargetComponent,
1936
+ centerDropTargetComponent,
1937
+ direction
1938
+ },
1939
+ ...targetComponentsMap
1940
+ });
1941
+ Promise.resolve().then(
1942
+ () => event.dropEndCallback && event.dropEndCallback({
1943
+ x: event.x,
1944
+ y: event.y,
1945
+ containerName
1946
+ })
1947
+ );
1948
+ }
1949
+ };
1950
+ const currentComponents = getCurrentSplitScreenComponents(
1951
+ layoutName,
1952
+ layoutName
1953
+ );
1954
+ const afterList = handleRemove(
1955
+ currentComponents?.afterDropTargetComponent || afterDropTargetComponent,
1956
+ event.targetContainerName,
1957
+ () => removeCallback("after")
1958
+ );
1959
+ const beforList = handleRemove(
1960
+ currentComponents?.beforeDropTargetComponent || beforeDropTargetComponent,
1961
+ event.targetContainerName,
1962
+ () => removeCallback("before")
1963
+ );
1964
+ const centerList = handleRemove(
1965
+ currentComponents?.centerDropTargetComponent || centerDropTargetComponent,
1966
+ event.targetContainerName,
1967
+ () => removeCallback("center")
1968
+ );
1969
+ setSplitScreen(layoutName, layoutName, {
1970
+ afterDropTargetComponent: afterList,
1971
+ beforeDropTargetComponent: beforList,
1972
+ centerDropTargetComponent: centerList,
1973
+ direction
1974
+ });
1975
+ });
1976
+ }
1977
+ } else if (event.state === "append") {
1978
+ const {
1979
+ x,
1980
+ y,
1981
+ dropEndCallback,
1982
+ dropTargetComponentEvent,
1983
+ orderName,
1984
+ parentOrderName,
1985
+ targetLayoutName,
1986
+ targetParentLayoutName,
1987
+ targetContainerName,
1988
+ targetComponent,
1989
+ nextContainerName
1990
+ } = event;
1991
+ if (layoutRef.current && orderName && x && y && targetComponent && dropTargetComponentEvent && targetLayoutName === layoutName && isInnerDrop({ x, y, element: layoutRef.current })) {
1992
+ const {
1993
+ direction: dropDirection,
1994
+ navigationTitle: navigationTitle2,
1995
+ dropDocumentOutsideOption: dropDocumentOutsideOption2
1996
+ } = dropTargetComponentEvent;
1997
+ const isOrderNameNotCenter = orderName !== "center";
1998
+ const isOrderNameCenterAndFirstScreen = orderName === "center" && centerDropTargetComponent.length <= 1;
1999
+ if (isOrderNameNotCenter || isOrderNameCenterAndFirstScreen) {
2000
+ setIsSplit(true);
2001
+ if (isOrderNameNotCenter) {
2002
+ setDirection(dropDirection);
2003
+ const targetComponentsMap = handleUpdateDropTargetComponents({
2004
+ orderName,
2005
+ parentOrderName,
2006
+ containerName: targetContainerName,
2007
+ nextContainerName,
2008
+ dropComponent: targetComponent,
2009
+ parentLayoutName: "",
2010
+ layoutName,
2011
+ navigationTitle: navigationTitle2,
2012
+ isUsePrefix: true,
2013
+ afterDropTargetComponent,
2014
+ beforeDropTargetComponent,
2015
+ centerDropTargetComponent,
2016
+ dropDocumentOutsideOption: dropDocumentOutsideOption2
2017
+ });
2018
+ setSplitScreen(layoutName, layoutName, {
2019
+ ...{
2020
+ afterDropTargetComponent,
2021
+ beforeDropTargetComponent,
2022
+ centerDropTargetComponent,
2023
+ direction: dropDirection
2024
+ },
2025
+ ...targetComponentsMap,
2026
+ ...{ direction: dropDirection }
2027
+ });
2028
+ Promise.resolve().then(
2029
+ () => dropEndCallback && dropEndCallback({
2030
+ x: event.x,
2031
+ y: event.y,
2032
+ containerName
2033
+ })
2034
+ );
2035
+ } else {
2036
+ const childScreenInfo = getCurrentSplitScreenComponents(
2037
+ layoutName,
2038
+ `${layoutName}_center=${centerDropTargetComponent[0].screenKey}`
2039
+ ) || {
2040
+ afterDropTargetComponent: [],
2041
+ beforeDropTargetComponent: [],
2042
+ centerDropTargetComponent: [],
2043
+ direction
2044
+ };
2045
+ setSplitScreen(
2046
+ layoutName,
2047
+ `${layoutName}_center=${centerDropTargetComponent[0].screenKey}`,
2048
+ {
2049
+ ...childScreenInfo,
2050
+ ...{
2051
+ centerDropTargetComponent: [
2052
+ centerDropTargetComponent[0],
2053
+ {
2054
+ containerName: `${targetContainerName}_${layoutName}_${orderName}`,
2055
+ component: targetComponent,
2056
+ dropDocumentOutsideOption: dropDocumentOutsideOption2,
2057
+ screenKey: centerDropTargetComponent[0].screenKey,
2058
+ navigationTitle: navigationTitle2
2059
+ }
2060
+ ]
2061
+ }
2062
+ }
2063
+ );
2064
+ }
2065
+ }
2066
+ }
2067
+ }
2068
+ });
2069
+ return () => {
2070
+ subscribe.unsubscribe();
2071
+ };
2072
+ }, [
2073
+ direction,
2074
+ layoutName,
2075
+ isSplit,
2076
+ beforeDropTargetComponent,
2077
+ afterDropTargetComponent,
2078
+ centerDropTargetComponent
2079
+ ]);
2080
+ return /* @__PURE__ */ jsxs("div", { className: `${FlexLayout_default["flex-split-screen"]}`, ref: layoutRef, children: [
2081
+ /* @__PURE__ */ jsxs(
2082
+ FlexLayout_default2,
2083
+ {
2084
+ direction,
2085
+ layoutName,
2086
+ "data-is_split": isSplit,
2087
+ panelMovementMode: "bulldozer",
2088
+ children: [
2089
+ beforeDropTargetComponent.length != 0 ? /* @__PURE__ */ jsx(Fragment, { children: beforeDropTargetComponent.map(
2090
+ ({
2091
+ containerName: cName,
2092
+ component,
2093
+ navigationTitle: navigationTitle2,
2094
+ dropDocumentOutsideOption: dropDocumentOutsideOption2,
2095
+ screenKey: screenKey2
2096
+ }, i) => /* @__PURE__ */ jsx(
2097
+ FlexLayoutContainer_default,
2098
+ {
2099
+ containerName: cName,
2100
+ isInitialResizable: true,
2101
+ isResizePanel: true,
2102
+ children: /* @__PURE__ */ jsx(
2103
+ FlexLayoutSplitScreenChild,
2104
+ {
2105
+ parentDirection: direction,
2106
+ layoutName: `${layoutName}_before`,
2107
+ parentLayoutName: layoutName,
2108
+ containerName: cName,
2109
+ depth: 1,
2110
+ rootRef: layoutRef,
2111
+ screenKey: screenKey2,
2112
+ initialCenterComponents: [
2113
+ {
2114
+ navigationTitle: navigationTitle2,
2115
+ component,
2116
+ containerName: cName,
2117
+ dropDocumentOutsideOption: dropDocumentOutsideOption2,
2118
+ screenKey: screenKey2
2119
+ }
2120
+ ],
2121
+ rootName: layoutName
2122
+ }
2123
+ )
2124
+ },
2125
+ cName
2126
+ )
2127
+ ) }) : /* @__PURE__ */ jsx("div", {}),
2128
+ centerDropTargetComponent.length === 0 ? /* @__PURE__ */ jsx("div", {}) : /* @__PURE__ */ jsx(
2129
+ FlexLayoutContainer_default,
2130
+ {
2131
+ containerName: `${centerDropTargetComponent[0].containerName}`,
2132
+ isInitialResizable: true,
2133
+ isResizePanel: isSplit,
2134
+ children: isSplit ? /* @__PURE__ */ jsx(
2135
+ FlexLayoutSplitScreenChild,
2136
+ {
2137
+ parentDirection: direction,
2138
+ layoutName: `${layoutName}_center`,
2139
+ parentLayoutName: layoutName,
2140
+ containerName: `${centerDropTargetComponent[0].containerName}`,
2141
+ depth: 0,
2142
+ rootRef: layoutRef,
2143
+ screenKey: centerDropTargetComponent[0].screenKey,
2144
+ initialCenterComponents: [
2145
+ {
2146
+ navigationTitle: centerDropTargetComponent[0].navigationTitle,
2147
+ component: centerDropTargetComponent[0].component,
2148
+ containerName: centerDropTargetComponent[0].containerName,
2149
+ dropDocumentOutsideOption: centerDropTargetComponent[0].dropDocumentOutsideOption,
2150
+ screenKey: centerDropTargetComponent[0].screenKey
2151
+ }
2152
+ ],
2153
+ rootName: layoutName
2154
+ }
2155
+ ) : /* @__PURE__ */ jsx(
2156
+ FlexLayoutSplitScreenScrollBox_default,
2157
+ {
2158
+ keyName: centerDropTargetComponent[0].containerName,
2159
+ isDefaultScrollStyle: true,
2160
+ children: centerDropTargetComponent[0].component
2161
+ }
2162
+ )
2163
+ }
2164
+ ),
2165
+ afterDropTargetComponent.length != 0 ? /* @__PURE__ */ jsx(Fragment, { children: afterDropTargetComponent.map(
2166
+ ({
2167
+ containerName: cName,
2168
+ component,
2169
+ navigationTitle: navigationTitle2,
2170
+ dropDocumentOutsideOption: dropDocumentOutsideOption2,
2171
+ screenKey: screenKey2
2172
+ }, i) => /* @__PURE__ */ jsx(
2173
+ FlexLayoutContainer_default,
2174
+ {
2175
+ containerName: cName,
2176
+ isInitialResizable: true,
2177
+ isResizePanel: afterDropTargetComponent.length - 1 !== i,
2178
+ children: /* @__PURE__ */ jsx(
2179
+ FlexLayoutSplitScreenChild,
2180
+ {
2181
+ parentDirection: direction,
2182
+ layoutName: `${layoutName}_after`,
2183
+ parentLayoutName: layoutName,
2184
+ containerName: cName,
2185
+ depth: 1,
2186
+ rootRef: layoutRef,
2187
+ screenKey: screenKey2,
2188
+ initialCenterComponents: [
2189
+ {
2190
+ navigationTitle: navigationTitle2,
2191
+ component,
2192
+ containerName: cName,
2193
+ dropDocumentOutsideOption: dropDocumentOutsideOption2,
2194
+ screenKey: screenKey2
2195
+ }
2196
+ ],
2197
+ rootName: layoutName
2198
+ }
2199
+ )
2200
+ },
2201
+ cName
2202
+ )
2203
+ ) }) : /* @__PURE__ */ jsx("div", {})
2204
+ ]
2205
+ }
2206
+ ),
2207
+ boundaryContainerSize && /* @__PURE__ */ jsx(
2208
+ "div",
2209
+ {
2210
+ className: `${FlexLayout_default["flex-split-screen-boundary-container"]}`,
2211
+ style: { ...boundaryContainerSize },
2212
+ children: "\u2B07\uFE0F\uB4DC\uB86D\uD558\uBA74 \uD654\uBA74\uC774 \uBD84\uD560\uB429\uB2C8\uB2E4."
2213
+ }
2214
+ )
2215
+ ] });
2216
+ }
2217
+ function FlexLayoutSplitScreenChild({
2218
+ containerName,
2219
+ layoutName,
2220
+ parentLayoutName,
2221
+ parentDirection,
2222
+ depth,
2223
+ //isSplit: isSplitInitial,
2224
+ rootRef,
2225
+ rootName,
2226
+ initialCenterComponents,
2227
+ screenKey
2228
+ }) {
2229
+ const {
2230
+ direction,
2231
+ isSplit,
2232
+ boundaryContainerSize,
2233
+ afterDropTargetComponent,
2234
+ beforeDropTargetComponent,
2235
+ centerDropTargetComponent,
2236
+ setAfterDropTargetComponent,
2237
+ setBeforeDropTargetComponent,
2238
+ setCenterDropTargetComponent,
2239
+ layoutRef,
2240
+ setIsSplit,
2241
+ setDirection
2242
+ } = useFlexLayoutSplitScreen({
2243
+ isSplitInitial: false,
2244
+ directionInitial: "row",
2245
+ parentDirection,
2246
+ selfContainerName: containerName,
2247
+ parentLayoutName,
2248
+ layoutName
2249
+ });
2250
+ const [isEmptyContent, setIsEmptyContent] = useState(false);
2251
+ const [activeIndex, setActiveIndex] = useState(0);
2252
+ const centerDropTargetComponentRef = useRef(centerDropTargetComponent);
2253
+ const activeIndexRef = useRef(activeIndex);
2254
+ useEffect(() => {
2255
+ const subscribe = getSplitScreen(rootName, `${layoutName}=${screenKey}`).pipe(take$1(1)).subscribe((layoutInfo) => {
2256
+ setSplitScreen(rootName, `${layoutName}=${screenKey}`, {
2257
+ afterDropTargetComponent: layoutInfo?.afterDropTargetComponent || [],
2258
+ beforeDropTargetComponent: layoutInfo?.beforeDropTargetComponent || [],
2259
+ centerDropTargetComponent: layoutInfo?.centerDropTargetComponent || initialCenterComponents || [],
2260
+ direction: layoutInfo?.direction || direction
2261
+ });
2262
+ });
2263
+ return () => {
2264
+ removeSplitScreenChild(rootName, layoutName);
2265
+ subscribe.unsubscribe();
2266
+ };
2267
+ }, [rootName, layoutName, initialCenterComponents]);
2268
+ useEffect(() => {
2269
+ const subscribe = getSplitScreen(rootName, `${layoutName}=${screenKey}`).subscribe((layoutInfo) => {
2270
+ if (layoutInfo) {
2271
+ setBeforeDropTargetComponent([
2272
+ ...layoutInfo.beforeDropTargetComponent
2273
+ ]);
2274
+ setAfterDropTargetComponent([
2275
+ ...layoutInfo.afterDropTargetComponent
2276
+ ]);
2277
+ setCenterDropTargetComponent([
2278
+ ...layoutInfo.centerDropTargetComponent
2279
+ ]);
2280
+ setDirection(layoutInfo.direction);
2281
+ if (layoutInfo.beforeDropTargetComponent.length !== 0 || layoutInfo.afterDropTargetComponent.length !== 0) {
2282
+ setIsSplit(true);
2283
+ } else if (layoutInfo.beforeDropTargetComponent.length === 0 && layoutInfo.centerDropTargetComponent.length === 0 && layoutInfo.afterDropTargetComponent.length === 0) {
2284
+ dropMovementEventSubject.next({
2285
+ state: "remove",
2286
+ targetContainerName: containerName,
2287
+ targetParentLayoutName: "",
2288
+ targetLayoutName: parentLayoutName
2289
+ });
2290
+ setIsEmptyContent(true);
2291
+ }
2292
+ }
2293
+ });
2294
+ return () => {
2295
+ subscribe.unsubscribe();
2296
+ };
2297
+ }, [rootName, layoutName]);
2298
+ useEffect(() => {
2299
+ const subscribe = dropMovementEventSubject.pipe(
2300
+ distinctUntilChanged$1((prev, curr) => {
2301
+ const filterChildren2 = (obj) => {
2302
+ const {
2303
+ children,
2304
+ component,
2305
+ targetComponent,
2306
+ x,
2307
+ y,
2308
+ ...rest
2309
+ } = obj || {};
2310
+ return rest;
2311
+ };
2312
+ return equal(filterChildren2(prev), filterChildren2(curr));
2313
+ })
2314
+ ).subscribe((event) => {
2315
+ if (event.state === "remove") {
2316
+ if (event.targetParentLayoutName === layoutName || event.targetParentLayoutName === "" && event.targetLayoutName === layoutName) {
2317
+ requestAnimationFrame(() => {
2318
+ let removeCallback = (removeOrderName) => {
2319
+ if (event.nextContainerName && event.dropTargetComponentEvent && event.targetComponent) {
2320
+ const targetComponentsMap = handleUpdateDropTargetComponents({
2321
+ orderName: removeOrderName,
2322
+ containerName: event.nextContainerName,
2323
+ parentLayoutName,
2324
+ layoutName,
2325
+ dropComponent: event.targetComponent,
2326
+ navigationTitle: event.dropTargetComponentEvent.navigationTitle,
2327
+ isUsePrefix: true,
2328
+ afterDropTargetComponent,
2329
+ beforeDropTargetComponent,
2330
+ centerDropTargetComponent,
2331
+ dropDocumentOutsideOption: event.dropTargetComponentEvent?.dropDocumentOutsideOption,
2332
+ screenKey: event.dropTargetComponentEvent.screenKey
2333
+ });
2334
+ setSplitScreen(
2335
+ rootName,
2336
+ `${layoutName}=${screenKey}`,
2337
+ {
2338
+ ...getCurrentSplitScreenComponents(
2339
+ rootName,
2340
+ `${layoutName}=${screenKey}`
2341
+ ) || {
2342
+ afterDropTargetComponent,
2343
+ beforeDropTargetComponent,
2344
+ centerDropTargetComponent,
2345
+ direction
2346
+ },
2347
+ ...targetComponentsMap
2348
+ }
2349
+ );
2350
+ Promise.resolve().then(
2351
+ () => event.dropEndCallback && event.dropEndCallback({
2352
+ x: event.x,
2353
+ y: event.y,
2354
+ containerName
2355
+ })
2356
+ );
2357
+ }
2358
+ };
2359
+ const currentComponents = getCurrentSplitScreenComponents(
2360
+ rootName,
2361
+ `${layoutName}=${screenKey}`
2362
+ );
2363
+ const afterList = handleRemove(
2364
+ currentComponents?.afterDropTargetComponent || afterDropTargetComponent,
2365
+ event.targetContainerName,
2366
+ () => removeCallback("after")
2367
+ );
2368
+ const beforList = handleRemove(
2369
+ currentComponents?.beforeDropTargetComponent || beforeDropTargetComponent,
2370
+ event.targetContainerName,
2371
+ () => removeCallback("before")
2372
+ );
2373
+ const centerList = handleRemove(
2374
+ currentComponents?.centerDropTargetComponent || centerDropTargetComponent,
2375
+ event.targetContainerName,
2376
+ () => removeCallback("center")
2377
+ );
2378
+ setSplitScreen(
2379
+ rootName,
2380
+ `${layoutName}=${screenKey}`,
2381
+ {
2382
+ afterDropTargetComponent: afterList,
2383
+ beforeDropTargetComponent: beforList,
2384
+ centerDropTargetComponent: centerList,
2385
+ direction
2386
+ }
2387
+ );
2388
+ });
2389
+ }
2390
+ } else if (event.state === "append") {
2391
+ const {
2392
+ x,
2393
+ y,
2394
+ dropEndCallback,
2395
+ dropTargetComponentEvent,
2396
+ orderName,
2397
+ targetLayoutName,
2398
+ targetParentLayoutName,
2399
+ targetContainerName,
2400
+ targetComponent,
2401
+ nextContainerName,
2402
+ parentOrderName
2403
+ } = event;
2404
+ if (layoutRef.current && orderName && x && y && dropTargetComponentEvent && isInnerDrop({ x, y, element: layoutRef.current })) {
2405
+ const {
2406
+ direction: dropDirection,
2407
+ navigationTitle,
2408
+ dropDocumentOutsideOption,
2409
+ screenKey: containerScreenKey
2410
+ } = dropTargetComponentEvent;
2411
+ if (
2412
+ //orderName !== 'center' &&
2413
+ targetLayoutName === layoutName && targetComponent
2414
+ ) {
2415
+ if (dropDirection === parentDirection && orderName !== "center") {
2416
+ dropMovementEventSubject.next({
2417
+ state: "append",
2418
+ targetContainerName,
2419
+ targetParentLayoutName: "",
2420
+ targetLayoutName: parentLayoutName,
2421
+ targetComponent,
2422
+ nextContainerName: containerName,
2423
+ parentOrderName: getSelfOrderName(layoutName) || orderName,
2424
+ orderName,
2425
+ x,
2426
+ y,
2427
+ dropEndCallback,
2428
+ dropTargetComponentEvent: {
2429
+ navigationTitle,
2430
+ dropDocumentOutsideOption,
2431
+ direction: parentDirection,
2432
+ screenKey
2433
+ }
2434
+ });
2435
+ } else {
2436
+ if (orderName !== "center") {
2437
+ setDirection(dropDirection);
2438
+ setIsSplit(true);
2439
+ }
2440
+ const targetComponentsMap = handleUpdateDropTargetComponents({
2441
+ orderName,
2442
+ parentOrderName,
2443
+ containerName: targetContainerName,
2444
+ nextContainerName,
2445
+ parentLayoutName,
2446
+ layoutName,
2447
+ dropComponent: targetComponent,
2448
+ navigationTitle,
2449
+ isUsePrefix: orderName !== "center",
2450
+ afterDropTargetComponent,
2451
+ beforeDropTargetComponent,
2452
+ centerDropTargetComponent,
2453
+ dropDocumentOutsideOption
2454
+ });
2455
+ setSplitScreen(
2456
+ rootName,
2457
+ `${layoutName}=${screenKey}`,
2458
+ {
2459
+ ...getCurrentSplitScreenComponents(
2460
+ rootName,
2461
+ `${layoutName}=${screenKey}`
2462
+ ) || {
2463
+ afterDropTargetComponent,
2464
+ beforeDropTargetComponent,
2465
+ centerDropTargetComponent,
2466
+ direction
2467
+ },
2468
+ ...targetComponentsMap,
2469
+ ...{ direction: dropDirection }
2470
+ }
2471
+ );
2472
+ Promise.resolve().then(
2473
+ () => event.dropEndCallback && event.dropEndCallback({
2474
+ x: event.x,
2475
+ y: event.y,
2476
+ containerName
2477
+ })
2478
+ );
2479
+ }
2480
+ }
2481
+ }
2482
+ }
2483
+ });
2484
+ return () => {
2485
+ subscribe.unsubscribe();
2486
+ };
2487
+ }, [
2488
+ direction,
2489
+ parentDirection,
2490
+ parentLayoutName,
2491
+ layoutName,
2492
+ beforeDropTargetComponent,
2493
+ afterDropTargetComponent,
2494
+ centerDropTargetComponent
2495
+ ]);
2496
+ useEffect(() => {
2497
+ centerDropTargetComponentRef.current = centerDropTargetComponent;
2498
+ }, [centerDropTargetComponent]);
2499
+ useEffect(() => {
2500
+ activeIndexRef.current = activeIndex;
2501
+ }, [activeIndex]);
2502
+ const [isOnlyOneScreen, setIsOnlyOneScreen] = useState(false);
2503
+ return /* @__PURE__ */ jsx(Fragment, { children: !isEmptyContent && /* @__PURE__ */ jsxs(
2504
+ "div",
2505
+ {
2506
+ className: `${FlexLayout_default["flex-split-screen"]}`,
2507
+ ref: layoutRef,
2508
+ children: [
2509
+ /* @__PURE__ */ jsxs(
2510
+ FlexLayout_default2,
2511
+ {
2512
+ direction,
2513
+ layoutName: `${layoutName}`,
2514
+ panelMovementMode: "bulldozer",
2515
+ children: [
2516
+ beforeDropTargetComponent.length != 0 ? /* @__PURE__ */ jsx(Fragment, { children: beforeDropTargetComponent.map(
2517
+ ({
2518
+ containerName: cName,
2519
+ component,
2520
+ navigationTitle,
2521
+ dropDocumentOutsideOption,
2522
+ screenKey: screenKey2
2523
+ }, i) => /* @__PURE__ */ jsx(
2524
+ FlexLayoutContainer_default,
2525
+ {
2526
+ containerName: cName,
2527
+ isInitialResizable: true,
2528
+ isResizePanel: true,
2529
+ children: /* @__PURE__ */ jsx(
2530
+ FlexLayoutSplitScreenChild,
2531
+ {
2532
+ parentDirection: direction,
2533
+ layoutName: `${layoutName}_before-${depth}`,
2534
+ parentLayoutName: layoutName,
2535
+ containerName: cName,
2536
+ depth: depth + 1,
2537
+ rootRef,
2538
+ screenKey: screenKey2,
2539
+ initialCenterComponents: [
2540
+ {
2541
+ navigationTitle,
2542
+ component,
2543
+ containerName: cName,
2544
+ dropDocumentOutsideOption,
2545
+ screenKey: screenKey2
2546
+ }
2547
+ ],
2548
+ rootName
2549
+ }
2550
+ )
2551
+ },
2552
+ cName
2553
+ )
2554
+ ) }) : /* @__PURE__ */ jsx("div", {}),
2555
+ centerDropTargetComponent.length != 0 ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2556
+ FlexLayoutContainer_default,
2557
+ {
2558
+ containerName: `${(centerDropTargetComponent[activeIndex] || centerDropTargetComponent[0]).containerName}`,
2559
+ isInitialResizable: true,
2560
+ isResizePanel: isSplit,
2561
+ children: isSplit ? /* @__PURE__ */ jsx("div", { "data-key": screenKey, children: /* @__PURE__ */ jsx(
2562
+ FlexLayoutSplitScreenChild,
2563
+ {
2564
+ parentDirection: direction,
2565
+ layoutName: `${layoutName}_center-${depth}`,
2566
+ parentLayoutName: layoutName,
2567
+ containerName: `${(centerDropTargetComponent[activeIndex] || centerDropTargetComponent[0]).containerName}`,
2568
+ depth: depth + 1,
2569
+ rootRef,
2570
+ initialCenterComponents: centerDropTargetComponent.map(
2571
+ ({
2572
+ navigationTitle,
2573
+ component,
2574
+ containerName: cName,
2575
+ dropDocumentOutsideOption,
2576
+ screenKey: centerScreenKey
2577
+ }) => ({
2578
+ navigationTitle,
2579
+ component,
2580
+ containerName: cName,
2581
+ dropDocumentOutsideOption,
2582
+ screenKey: centerScreenKey
2583
+ })
2584
+ ),
2585
+ screenKey,
2586
+ rootName
2587
+ }
2588
+ ) }) : /* @__PURE__ */ jsxs(
2589
+ FlexLayoutSplitScreenScrollBox_default,
2590
+ {
2591
+ keyName: (centerDropTargetComponent[activeIndex] || centerDropTargetComponent[0]).containerName,
2592
+ isDefaultScrollStyle: true,
2593
+ children: [
2594
+ !isOnlyOneScreen && /* @__PURE__ */ jsx(
2595
+ "div",
2596
+ {
2597
+ className: `${FlexLayout_default["flex-split-screen-drag-box-title-wrapper-sticky"]}`,
2598
+ children: /* @__PURE__ */ jsxs(
2599
+ "div",
2600
+ {
2601
+ "data-is_split": isSplit,
2602
+ "data-layout_name": layoutName,
2603
+ "data-parent_layout_name": parentLayoutName,
2604
+ "data-container_name": `${(centerDropTargetComponent[activeIndex] || centerDropTargetComponent[0]).containerName}`,
2605
+ className: `${FlexLayout_default["flex-split-screen-drag-box-title-wrapper"]}`,
2606
+ children: [
2607
+ /* @__PURE__ */ jsx(
2608
+ FlexLayoutSplitScreenDragBoxContainer,
2609
+ {
2610
+ "data-layout_name": layoutName,
2611
+ layoutName,
2612
+ children: centerDropTargetComponent.map(
2613
+ (item, index) => /* @__PURE__ */ jsx(
2614
+ FlexLayoutSplitScreenDragBoxItem,
2615
+ {
2616
+ onClose: (ev) => {
2617
+ if (activeIndexRef.current === index && centerDropTargetComponent.length === 1) {
2618
+ dropMovementEventSubject.next(
2619
+ {
2620
+ state: "remove",
2621
+ targetContainerName: containerName,
2622
+ targetParentLayoutName: parentLayoutName,
2623
+ targetLayoutName: layoutName
2624
+ }
2625
+ );
2626
+ } else {
2627
+ if (centerDropTargetComponent.length === activeIndexRef.current + 1) {
2628
+ setActiveIndex(
2629
+ activeIndexRef.current - 1
2630
+ );
2631
+ }
2632
+ setCenterDropTargetComponent(
2633
+ (prev) => {
2634
+ const result = handleRemove(
2635
+ prev,
2636
+ item.containerName,
2637
+ () => {
2638
+ }
2639
+ );
2640
+ return result;
2641
+ }
2642
+ );
2643
+ }
2644
+ },
2645
+ isActive: activeIndex === index,
2646
+ children: /* @__PURE__ */ jsx(
2647
+ FlexLayoutSplitScreenDragBox,
2648
+ {
2649
+ onClick: () => {
2650
+ setActiveIndex(
2651
+ index
2652
+ );
2653
+ },
2654
+ containerName: item.containerName,
2655
+ dropDocumentOutsideOption: item.dropDocumentOutsideOption,
2656
+ targetComponent: item.component,
2657
+ navigationTitle: item.navigationTitle,
2658
+ "data-container-name": item.containerName,
2659
+ "data-layout-name": layoutName,
2660
+ "data-parent-layout-name": parentLayoutName,
2661
+ dropEndCallback: ({
2662
+ x,
2663
+ y,
2664
+ containerName: appendContainerName
2665
+ }) => {
2666
+ if (!rootRef.current || !layoutRef.current)
2667
+ return;
2668
+ const isRootOver = isOverDrop(
2669
+ {
2670
+ x,
2671
+ y,
2672
+ element: rootRef.current
2673
+ }
2674
+ );
2675
+ const isLayoutInner = isInnerDrop(
2676
+ {
2677
+ x,
2678
+ y,
2679
+ element: layoutRef.current
2680
+ }
2681
+ );
2682
+ if (!isRootOver && !isLayoutInner || !isRootOver && isLayoutInner && centerDropTargetComponentRef.current.length > 1) {
2683
+ const option = {};
2684
+ if (centerDropTargetComponentRef.current.length > 1) {
2685
+ const {
2686
+ adjacentItem,
2687
+ adjacentIndex
2688
+ } = getAdjacentItem(
2689
+ centerDropTargetComponentRef.current,
2690
+ activeIndexRef.current
2691
+ );
2692
+ if (adjacentItem && activeIndexRef.current === index) {
2693
+ Object.assign(
2694
+ option,
2695
+ {
2696
+ x,
2697
+ y,
2698
+ targetComponent: adjacentItem.component,
2699
+ nextContainerName: adjacentItem.containerName,
2700
+ orderName: "center",
2701
+ dropTargetComponentEvent: {
2702
+ navigationTitle: adjacentItem.navigationTitle,
2703
+ dropDocumentOutsideOption: adjacentItem.dropDocumentOutsideOption,
2704
+ direction,
2705
+ screenKey
2706
+ }
2707
+ }
2708
+ );
2709
+ }
2710
+ }
2711
+ if (index === 0) {
2712
+ dropMovementEventSubject.next(
2713
+ {
2714
+ state: "remove",
2715
+ targetContainerName: item.containerName,
2716
+ targetParentLayoutName: parentLayoutName,
2717
+ targetLayoutName: layoutName,
2718
+ ...option
2719
+ }
2720
+ );
2721
+ } else {
2722
+ dropMovementEventSubject.next(
2723
+ {
2724
+ state: "remove",
2725
+ targetContainerName: item.containerName,
2726
+ targetParentLayoutName: "",
2727
+ targetLayoutName: layoutName,
2728
+ ...option
2729
+ }
2730
+ );
2731
+ }
2732
+ }
2733
+ },
2734
+ children: item.navigationTitle
2735
+ }
2736
+ )
2737
+ },
2738
+ item.navigationTitle + layoutName + item.containerName
2739
+ )
2740
+ )
2741
+ },
2742
+ layoutName
2743
+ ),
2744
+ /* @__PURE__ */ jsx(FlexLayoutSplitScreenDragBoxTitleMore, {})
2745
+ ]
2746
+ }
2747
+ )
2748
+ }
2749
+ ),
2750
+ (() => {
2751
+ const target = centerDropTargetComponent[activeIndex] || centerDropTargetComponent[0];
2752
+ return target.component;
2753
+ })()
2754
+ ]
2755
+ }
2756
+ )
2757
+ },
2758
+ (centerDropTargetComponent[activeIndex] || centerDropTargetComponent[0]).containerName
2759
+ ) }) : /* @__PURE__ */ jsx("div", {}),
2760
+ afterDropTargetComponent.length != 0 ? /* @__PURE__ */ jsx(Fragment, { children: afterDropTargetComponent.map(
2761
+ ({
2762
+ containerName: cName,
2763
+ component,
2764
+ navigationTitle,
2765
+ dropDocumentOutsideOption,
2766
+ screenKey: screenKey2
2767
+ }, i) => /* @__PURE__ */ jsx(
2768
+ FlexLayoutContainer_default,
2769
+ {
2770
+ containerName: cName,
2771
+ isInitialResizable: true,
2772
+ isResizePanel: i !== afterDropTargetComponent.length - 1,
2773
+ children: /* @__PURE__ */ jsx(
2774
+ FlexLayoutSplitScreenChild,
2775
+ {
2776
+ parentDirection: direction,
2777
+ layoutName: `${layoutName}_after-${depth}`,
2778
+ parentLayoutName: layoutName,
2779
+ containerName: cName,
2780
+ depth: depth + 1,
2781
+ rootRef,
2782
+ screenKey: screenKey2,
2783
+ initialCenterComponents: [
2784
+ {
2785
+ navigationTitle,
2786
+ component,
2787
+ containerName: cName,
2788
+ dropDocumentOutsideOption,
2789
+ screenKey: screenKey2
2790
+ }
2791
+ ],
2792
+ rootName
2793
+ }
2794
+ )
2795
+ },
2796
+ cName
2797
+ )
2798
+ ) }) : /* @__PURE__ */ jsx("div", {})
2799
+ ]
2800
+ }
2801
+ ),
2802
+ boundaryContainerSize && /* @__PURE__ */ jsx(
2803
+ "div",
2804
+ {
2805
+ className: `${FlexLayout_default["flex-split-screen-boundary-container"]}`,
2806
+ style: { ...boundaryContainerSize },
2807
+ children: "\u2B07\uFE0F\uB4DC\uB86D\uD558\uBA74 \uD654\uBA74\uC774 \uBD84\uD560\uB429\uB2C8\uB2E4."
2808
+ }
2809
+ )
2810
+ ]
2811
+ }
2812
+ ) });
2813
+ }
2814
+ FlexLayoutSplitScreen.displayName = "FlexLayoutSplitScreen";
2815
+ var FlexLayoutSplitScreen_default = FlexLayoutSplitScreen;
2816
+ function clamp(n, min, max) {
2817
+ return Math.max(min, Math.min(max, n));
2818
+ }
2819
+ function pickDefaultScrollRoot() {
2820
+ if (typeof document === "undefined") return null;
2821
+ let el = document.body;
2822
+ while (el && el !== document.documentElement && el !== document.body) {
2823
+ const style = getComputedStyle(el);
2824
+ const oy = style.overflowY;
2825
+ const ox = style.overflowX;
2826
+ const scrollable = oy === "auto" || oy === "scroll" || ox === "auto" || ox === "scroll";
2827
+ if (scrollable) return el;
2828
+ el = el.parentElement;
2829
+ }
2830
+ return null;
2831
+ }
2832
+ function isVerticalScroll(root) {
2833
+ if (typeof window == "undefined") return true;
2834
+ if (!root) {
2835
+ return document.documentElement.scrollHeight > window.innerHeight + 1;
2836
+ }
2837
+ const el = root;
2838
+ return el.scrollHeight > el.clientHeight + 1;
2839
+ }
2840
+ var dpr = typeof window != "undefined" ? window.devicePixelRatio || 1 : 1;
2841
+ function quantizeToDevicePixel(n) {
2842
+ return Math.round(n * dpr) / dpr;
2843
+ }
2844
+ var FlexLayoutStickyBox = ({
2845
+ edge = "auto",
2846
+ offset = 16,
2847
+ scrollRoot = null,
2848
+ debug = false,
2849
+ children,
2850
+ style,
2851
+ className,
2852
+ onTranslateChange = () => {
2853
+ },
2854
+ ...rest
2855
+ }) => {
2856
+ const offsetRef = useRef(offset);
2857
+ const rootRef = useRef(null);
2858
+ const contentRef = useRef(null);
2859
+ const mutatingRef = useRef(false);
2860
+ const lastOffsetRef = useRef(0);
2861
+ const [resolvedEdge, setResolvedEdge] = useState("top");
2862
+ const rafId = useRef(null);
2863
+ const [contentDynamicStyle, setContentDynamicStyle] = useState({});
2864
+ useEffect(() => {
2865
+ setContentDynamicStyle({
2866
+ willChange: "transform",
2867
+ transition: "transform 50ms linear"
2868
+ });
2869
+ }, []);
2870
+ useEffect(() => {
2871
+ offsetRef.current = offset;
2872
+ scheduleUpdate();
2873
+ }, [offset]);
2874
+ const [ioRoot, setIoRoot] = useState(null);
2875
+ useEffect(() => {
2876
+ const root = scrollRoot ?? pickDefaultScrollRoot();
2877
+ setResolvedEdge(
2878
+ edge === "auto" ? isVerticalScroll(root) ? "top" : "left" : edge
2879
+ );
2880
+ setIoRoot(root);
2881
+ }, [edge, scrollRoot]);
2882
+ useEffect(() => {
2883
+ if (edge !== "auto") {
2884
+ setResolvedEdge(edge);
2885
+ return;
2886
+ }
2887
+ const vertical = isVerticalScroll(ioRoot);
2888
+ setResolvedEdge(vertical ? "top" : "left");
2889
+ }, [edge, ioRoot]);
2890
+ useEffect(() => {
2891
+ }, []);
2892
+ const scheduleUpdate = () => {
2893
+ if (rafId.current != null) return;
2894
+ rafId.current = requestAnimationFrame(() => {
2895
+ rafId.current = null;
2896
+ doUpdate();
2897
+ });
2898
+ };
2899
+ const doUpdate = () => {
2900
+ if (mutatingRef.current) return;
2901
+ mutatingRef.current = true;
2902
+ const rootEl = rootRef.current;
2903
+ const contentEl = contentRef.current;
2904
+ if (!rootEl || !contentEl) {
2905
+ mutatingRef.current = false;
2906
+ return;
2907
+ }
2908
+ const parentEl = rootEl.parentElement;
2909
+ if (!parentEl) {
2910
+ mutatingRef.current = false;
2911
+ return;
2912
+ }
2913
+ const rootBounds = ioRoot && "getBoundingClientRect" in ioRoot ? ioRoot.getBoundingClientRect() : new DOMRect(0, 0, window.innerWidth, window.innerHeight);
2914
+ const parentRect = parentEl.getBoundingClientRect();
2915
+ const contentRect = contentEl.getBoundingClientRect();
2916
+ let newOffset = 0;
2917
+ if (resolvedEdge === "top" || resolvedEdge === "bottom") {
2918
+ const maxTranslate = Math.max(
2919
+ 0,
2920
+ parentRect.height - contentRect.height
2921
+ );
2922
+ let desiredTop = 0;
2923
+ if (resolvedEdge === "top") {
2924
+ desiredTop = rootBounds.top + offsetRef.current - parentRect.top;
2925
+ } else {
2926
+ const targetBottomFromParentTop = Math.min(
2927
+ parentRect.bottom,
2928
+ rootBounds.bottom - offsetRef.current
2929
+ ) - parentRect.top;
2930
+ desiredTop = targetBottomFromParentTop - contentRect.height;
2931
+ }
2932
+ newOffset = clamp(desiredTop, 0, maxTranslate);
2933
+ } else {
2934
+ const maxTranslate = Math.max(
2935
+ 0,
2936
+ parentRect.width - contentRect.width
2937
+ );
2938
+ let desiredLeft = 0;
2939
+ if (resolvedEdge === "left") {
2940
+ desiredLeft = rootBounds.left + offsetRef.current - parentRect.left;
2941
+ } else {
2942
+ const targetRightFromParentLeft = Math.min(
2943
+ parentRect.right,
2944
+ rootBounds.right - offsetRef.current
2945
+ ) - parentRect.left;
2946
+ desiredLeft = targetRightFromParentLeft - contentRect.width;
2947
+ }
2948
+ newOffset = clamp(desiredLeft, 0, maxTranslate);
2949
+ }
2950
+ const nextOffset = quantizeToDevicePixel(newOffset);
2951
+ if (Math.abs(lastOffsetRef.current - nextOffset) > 0.5) {
2952
+ if (resolvedEdge === "top" || resolvedEdge === "bottom") {
2953
+ contentEl.style.transform = `translateY(${nextOffset}px)`;
2954
+ } else {
2955
+ contentEl.style.transform = `translateX(${nextOffset}px)`;
2956
+ }
2957
+ lastOffsetRef.current = nextOffset;
2958
+ onTranslateChange(nextOffset, rootRef, contentRef);
2959
+ }
2960
+ if (debug) {
2961
+ rootEl.style.outline = "1px dashed rgba(0,0,0,.2)";
2962
+ contentEl.style.outline = "1px solid rgba(0,128,255,.35)";
2963
+ }
2964
+ queueMicrotask(() => {
2965
+ mutatingRef.current = false;
2966
+ });
2967
+ };
2968
+ useEffect(() => {
2969
+ if (typeof window == "undefined") return;
2970
+ const rootEl = rootRef.current;
2971
+ if (!rootEl) return;
2972
+ const parentEl = rootEl.parentElement;
2973
+ console.log(parentEl);
2974
+ if (!parentEl) return;
2975
+ const targets = [parentEl];
2976
+ const observerCallback = () => {
2977
+ if (!mutatingRef.current) scheduleUpdate();
2978
+ };
2979
+ const io = new IntersectionObserver(observerCallback, {
2980
+ root: ioRoot instanceof Element ? ioRoot : null,
2981
+ threshold: 0,
2982
+ rootMargin: "1px"
2983
+ });
2984
+ const ro = new ResizeObserver(observerCallback);
2985
+ targets.forEach((t) => io.observe(t));
2986
+ ro.observe(parentEl);
2987
+ if (contentRef.current) {
2988
+ ro.observe(contentRef.current);
2989
+ }
2990
+ const scrollTarget = ioRoot || window;
2991
+ scrollTarget.addEventListener("scroll", scheduleUpdate, {
2992
+ passive: true
2993
+ });
2994
+ window.addEventListener("resize", scheduleUpdate);
2995
+ scheduleUpdate();
2996
+ return () => {
2997
+ io.disconnect();
2998
+ ro.disconnect();
2999
+ scrollTarget.removeEventListener("scroll", scheduleUpdate);
3000
+ window.removeEventListener("resize", scheduleUpdate);
3001
+ if (rafId.current != null) {
3002
+ cancelAnimationFrame(rafId.current);
3003
+ rafId.current = null;
3004
+ }
3005
+ };
3006
+ }, [ioRoot, resolvedEdge, offset, debug]);
3007
+ return /* @__PURE__ */ jsx(
3008
+ "div",
3009
+ {
3010
+ ref: rootRef,
3011
+ className,
3012
+ style: {
3013
+ display: "block",
3014
+ minWidth: 0,
3015
+ minHeight: 0,
3016
+ height: "100%",
3017
+ // 부모 높이를 채우도록 설정
3018
+ ...style
3019
+ },
3020
+ ...rest,
3021
+ children: /* @__PURE__ */ jsx(
3022
+ "div",
3023
+ {
3024
+ ref: contentRef,
3025
+ style: contentDynamicStyle,
3026
+ children
3027
+ }
3028
+ )
3029
+ }
3030
+ );
3031
+ };
3032
+ var FlexLayoutStickyBox_default = FlexLayoutStickyBox;
3033
+
3034
+ export { FlexLayout_default2 as FlexLayout, FlexLayoutContainer_default as FlexLayoutContainer, FlexLayoutResizePanel_default as FlexLayoutResizePanel, FlexLayoutSplitScreen_default as FlexLayoutSplitScreen, FlexLayoutSplitScreenDragBox, FlexLayoutSplitScreenScrollBox_default as FlexLayoutSplitScreenScrollBox, FlexLayoutStickyBox_default as FlexLayoutStickyBox };
6
3035
  //# sourceMappingURL=components.js.map
7
3036
  //# sourceMappingURL=components.js.map