@byeolnaerim/flex-layout 0.0.9 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/flex-layout/components/FlexLayout.cjs +1 -110
- package/dist/flex-layout/components/FlexLayout.d.ts +2 -1
- package/dist/flex-layout/components/FlexLayout.js +1 -85
- package/dist/flex-layout/components/FlexLayoutContainer.cjs +1 -262
- package/dist/flex-layout/components/FlexLayoutContainer.d.ts +1 -1
- package/dist/flex-layout/components/FlexLayoutContainer.js +1 -232
- package/dist/flex-layout/components/FlexLayoutDynamicHeight.cjs +1 -0
- package/dist/flex-layout/components/FlexLayoutDynamicHeight.d.ts +6 -0
- package/dist/flex-layout/components/FlexLayoutDynamicHeight.js +1 -0
- package/dist/flex-layout/components/FlexLayoutIFramePane.cjs +1 -68
- package/dist/flex-layout/components/FlexLayoutIFramePane.js +1 -44
- package/dist/flex-layout/components/FlexLayoutResizePanel.cjs +1 -246
- package/dist/flex-layout/components/FlexLayoutResizePanel.js +1 -216
- package/dist/flex-layout/components/FlexLayoutSplitScreen.cjs +1 -1252
- package/dist/flex-layout/components/FlexLayoutSplitScreen.d.ts +14 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreen.js +1 -1236
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBox.cjs +1 -532
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBox.js +1 -509
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.cjs +1 -55
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.js +1 -25
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxItem.cjs +1 -63
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxItem.js +1 -33
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxTitleMore.cjs +1 -53
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxTitleMore.js +1 -23
- package/dist/flex-layout/components/FlexLayoutSplitScreenScrollBox.cjs +1 -133
- package/dist/flex-layout/components/FlexLayoutSplitScreenScrollBox.js +1 -107
- package/dist/flex-layout/components/FlexLayoutStickyBox.cjs +1 -245
- package/dist/flex-layout/components/FlexLayoutStickyBox.js +1 -229
- package/dist/flex-layout/components/index.cjs +1 -57
- package/dist/flex-layout/components/index.d.ts +1 -0
- package/dist/flex-layout/components/index.js +1 -17
- package/dist/flex-layout/hooks/index.cjs +1 -25
- package/dist/flex-layout/hooks/index.js +1 -3
- package/dist/flex-layout/hooks/useDrag.cjs +1 -289
- package/dist/flex-layout/hooks/useDrag.d.ts +15 -0
- package/dist/flex-layout/hooks/useDrag.js +1 -258
- package/dist/flex-layout/hooks/useFlexLayoutSplitScreen.cjs +1 -139
- package/dist/flex-layout/hooks/useFlexLayoutSplitScreen.js +1 -118
- package/dist/flex-layout/hooks/useListPaging.cjs +1 -212
- package/dist/flex-layout/hooks/useListPaging.js +1 -191
- package/dist/flex-layout/hooks/useSizes.cjs +1 -126
- package/dist/flex-layout/hooks/useSizes.d.ts +6 -3
- package/dist/flex-layout/hooks/useSizes.js +1 -101
- package/dist/flex-layout/index.cjs +1 -31
- package/dist/flex-layout/index.js +1 -6
- package/dist/flex-layout/providers/FlexLayoutContext.cjs +1 -49
- package/dist/flex-layout/providers/FlexLayoutContext.js +1 -24
- package/dist/flex-layout/providers/FlexLayoutHooks.cjs +1 -276
- package/dist/flex-layout/providers/FlexLayoutHooks.d.ts +5 -1
- package/dist/flex-layout/providers/FlexLayoutHooks.js +1 -263
- package/dist/flex-layout/providers/index.cjs +1 -23
- package/dist/flex-layout/providers/index.js +1 -2
- package/dist/flex-layout/store/FlexLayoutContainerStore.cjs +1 -257
- package/dist/flex-layout/store/FlexLayoutContainerStore.js +1 -206
- package/dist/flex-layout/store/index.cjs +1 -23
- package/dist/flex-layout/store/index.js +1 -2
- package/dist/flex-layout/styles/FlexLayout.module.css +499 -416
- package/dist/flex-layout/styles/sentinelStyle.module.css +11 -0
- package/dist/flex-layout/types/FlexDirectionTypes.cjs +1 -17
- package/dist/flex-layout/types/FlexDirectionTypes.js +0 -1
- package/dist/flex-layout/types/FlexLayoutTypes.cjs +1 -17
- package/dist/flex-layout/types/FlexLayoutTypes.d.ts +38 -2
- package/dist/flex-layout/types/FlexLayoutTypes.js +0 -1
- package/dist/flex-layout/utils/FlexLayoutUtils.cjs +1 -245
- package/dist/flex-layout/utils/FlexLayoutUtils.js +1 -211
- package/dist/flex-layout/utils/index.cjs +1 -23
- package/dist/flex-layout/utils/index.js +1 -2
- package/dist/index.cjs +1 -23
- package/dist/index.js +1 -2
- package/dist/types/css.d.cjs +0 -1
- package/dist/types/css.d.js +0 -1
- package/package.json +116 -113
- package/dist/flex-layout/components/FlexLayout.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayout.js.map +0 -1
- package/dist/flex-layout/components/FlexLayoutContainer.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayoutContainer.js.map +0 -1
- package/dist/flex-layout/components/FlexLayoutIFramePane.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayoutIFramePane.js.map +0 -1
- package/dist/flex-layout/components/FlexLayoutResizePanel.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayoutResizePanel.js.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreen.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreen.js.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBox.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBox.js.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.js.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxItem.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxItem.js.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxTitleMore.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxTitleMore.js.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenScrollBox.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenScrollBox.js.map +0 -1
- package/dist/flex-layout/components/FlexLayoutStickyBox.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayoutStickyBox.js.map +0 -1
- package/dist/flex-layout/components/index.cjs.map +0 -1
- package/dist/flex-layout/components/index.js.map +0 -1
- package/dist/flex-layout/hooks/index.cjs.map +0 -1
- package/dist/flex-layout/hooks/index.js.map +0 -1
- package/dist/flex-layout/hooks/useDrag.cjs.map +0 -1
- package/dist/flex-layout/hooks/useDrag.js.map +0 -1
- package/dist/flex-layout/hooks/useFlexLayoutSplitScreen.cjs.map +0 -1
- package/dist/flex-layout/hooks/useFlexLayoutSplitScreen.js.map +0 -1
- package/dist/flex-layout/hooks/useListPaging.cjs.map +0 -1
- package/dist/flex-layout/hooks/useListPaging.js.map +0 -1
- package/dist/flex-layout/hooks/useSizes.cjs.map +0 -1
- package/dist/flex-layout/hooks/useSizes.js.map +0 -1
- package/dist/flex-layout/index.cjs.map +0 -1
- package/dist/flex-layout/index.js.map +0 -1
- package/dist/flex-layout/providers/FlexLayoutContext.cjs.map +0 -1
- package/dist/flex-layout/providers/FlexLayoutContext.js.map +0 -1
- package/dist/flex-layout/providers/FlexLayoutHooks.cjs.map +0 -1
- package/dist/flex-layout/providers/FlexLayoutHooks.js.map +0 -1
- package/dist/flex-layout/providers/index.cjs.map +0 -1
- package/dist/flex-layout/providers/index.js.map +0 -1
- package/dist/flex-layout/store/FlexLayoutContainerStore.cjs.map +0 -1
- package/dist/flex-layout/store/FlexLayoutContainerStore.js.map +0 -1
- package/dist/flex-layout/store/index.cjs.map +0 -1
- package/dist/flex-layout/store/index.js.map +0 -1
- package/dist/flex-layout/types/FlexDirectionTypes.cjs.map +0 -1
- package/dist/flex-layout/types/FlexDirectionTypes.js.map +0 -1
- package/dist/flex-layout/types/FlexLayoutTypes.cjs.map +0 -1
- package/dist/flex-layout/types/FlexLayoutTypes.js.map +0 -1
- package/dist/flex-layout/utils/FlexLayoutUtils.cjs.map +0 -1
- package/dist/flex-layout/utils/FlexLayoutUtils.js.map +0 -1
- package/dist/flex-layout/utils/index.cjs.map +0 -1
- package/dist/flex-layout/utils/index.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/metafile-cjs.json +0 -1
- package/dist/metafile-esm.json +0 -1
- package/dist/types/css.d.cjs.map +0 -1
- package/dist/types/css.d.js.map +0 -1
|
@@ -1,263 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import {
|
|
4
|
-
flexContainerStore,
|
|
5
|
-
getLayoutInfos,
|
|
6
|
-
getResizePanelRef
|
|
7
|
-
} from "../store/FlexLayoutContainerStore";
|
|
8
|
-
import {
|
|
9
|
-
closeFlex,
|
|
10
|
-
getGrow,
|
|
11
|
-
mathGrow,
|
|
12
|
-
openFlex
|
|
13
|
-
} from "../utils/FlexLayoutUtils";
|
|
14
|
-
import {
|
|
15
|
-
buffer,
|
|
16
|
-
debounceTime,
|
|
17
|
-
EMPTY,
|
|
18
|
-
filter,
|
|
19
|
-
fromEvent,
|
|
20
|
-
map,
|
|
21
|
-
Subject,
|
|
22
|
-
switchMap
|
|
23
|
-
} from "rxjs";
|
|
24
|
-
const g = globalThis;
|
|
25
|
-
g.__FLEX_SUBJECTS__ ?? (g.__FLEX_SUBJECTS__ = { openClose: {}, spread: {} });
|
|
26
|
-
const containerOpenCloseSubjectMap = g.__FLEX_SUBJECTS__.openClose;
|
|
27
|
-
const containerSpreadSubjectMap = g.__FLEX_SUBJECTS__.spread;
|
|
28
|
-
const ContainerOpenCloseProvider = ({
|
|
29
|
-
layoutName,
|
|
30
|
-
containerName,
|
|
31
|
-
sizeName
|
|
32
|
-
}) => {
|
|
33
|
-
if (!containerOpenCloseSubjectMap[containerName]) {
|
|
34
|
-
containerOpenCloseSubjectMap[containerName] = new Subject();
|
|
35
|
-
}
|
|
36
|
-
if (!containerSpreadSubjectMap[containerName]) {
|
|
37
|
-
containerSpreadSubjectMap[containerName] = new Subject();
|
|
38
|
-
}
|
|
39
|
-
const [containers, setContainers] = useState([]);
|
|
40
|
-
const [container, setContainer] = useState();
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
const subscription = getLayoutInfos(layoutName).subscribe(
|
|
43
|
-
(layout) => {
|
|
44
|
-
if (!layout || !layout.container[containerName] || !layout.container[containerName].current)
|
|
45
|
-
return;
|
|
46
|
-
setContainers(
|
|
47
|
-
Object.values(layout.container).filter(
|
|
48
|
-
(e) => e.current !== null
|
|
49
|
-
).map((e) => e.current)
|
|
50
|
-
);
|
|
51
|
-
setContainer(layout.container[containerName].current);
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
return () => subscription.unsubscribe();
|
|
55
|
-
}, [containerName, layoutName]);
|
|
56
|
-
useEffect(() => {
|
|
57
|
-
const styleName = `${sizeName.charAt(0).toUpperCase() + sizeName.substring(1)}`;
|
|
58
|
-
const clientSize = "client" + styleName;
|
|
59
|
-
const outerSize = "outer" + styleName;
|
|
60
|
-
const maxSize = "max" + styleName;
|
|
61
|
-
const subscribe = containerOpenCloseSubjectMap[containerName].subscribe(
|
|
62
|
-
({
|
|
63
|
-
mode,
|
|
64
|
-
initOpenState: isOpenState,
|
|
65
|
-
onClose,
|
|
66
|
-
onOpen,
|
|
67
|
-
openOption = {},
|
|
68
|
-
closeOption = {}
|
|
69
|
-
}) => {
|
|
70
|
-
if (!container || containers.length === 0) return;
|
|
71
|
-
const currentGrow = getGrow(container);
|
|
72
|
-
const styleMap = window.getComputedStyle(container);
|
|
73
|
-
const maxSizeGrow = mathGrow(
|
|
74
|
-
parseInt(styleMap[maxSize]),
|
|
75
|
-
container.parentElement && container.parentElement[clientSize] || window[outerSize],
|
|
76
|
-
containers.length
|
|
77
|
-
);
|
|
78
|
-
const open = () => openFlex(container, containers, {
|
|
79
|
-
sizeName,
|
|
80
|
-
...isNaN(maxSizeGrow) ? {} : {
|
|
81
|
-
openGrowImportant: maxSizeGrow
|
|
82
|
-
},
|
|
83
|
-
...openOption
|
|
84
|
-
}).then((openTargetGrow) => {
|
|
85
|
-
if (onOpen) onOpen();
|
|
86
|
-
containerSpreadSubjectMap[containerName].next({
|
|
87
|
-
isOpen: true,
|
|
88
|
-
grow: openTargetGrow,
|
|
89
|
-
targetContainer: container
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
const close = () => closeFlex(container, containers, {
|
|
93
|
-
sizeName,
|
|
94
|
-
...closeOption
|
|
95
|
-
}).then(() => {
|
|
96
|
-
if (onClose) onClose();
|
|
97
|
-
containerSpreadSubjectMap[containerName].next({
|
|
98
|
-
isOpen: false,
|
|
99
|
-
grow: 0,
|
|
100
|
-
targetContainer: container
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
if (mode === "toggle") {
|
|
104
|
-
if (currentGrow === 0) {
|
|
105
|
-
open();
|
|
106
|
-
} else {
|
|
107
|
-
close();
|
|
108
|
-
}
|
|
109
|
-
} else if (mode === "open") {
|
|
110
|
-
if (currentGrow === 0) {
|
|
111
|
-
open();
|
|
112
|
-
}
|
|
113
|
-
} else if (mode === "close") {
|
|
114
|
-
if (currentGrow !== 0) {
|
|
115
|
-
close();
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
);
|
|
120
|
-
return () => {
|
|
121
|
-
subscribe.unsubscribe();
|
|
122
|
-
};
|
|
123
|
-
}, [containerName, container, containers, sizeName]);
|
|
124
|
-
return null;
|
|
125
|
-
};
|
|
126
|
-
const useContainers = (layoutName) => {
|
|
127
|
-
const [containers, setContainers] = useState([]);
|
|
128
|
-
useEffect(() => {
|
|
129
|
-
const subscription = getLayoutInfos(layoutName).subscribe(
|
|
130
|
-
(layout) => {
|
|
131
|
-
setContainers(
|
|
132
|
-
Object.values(layout.container).filter(
|
|
133
|
-
(e) => e.current !== null
|
|
134
|
-
).map((e) => e.current)
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
);
|
|
138
|
-
return () => subscription.unsubscribe();
|
|
139
|
-
}, [layoutName]);
|
|
140
|
-
return containers;
|
|
141
|
-
};
|
|
142
|
-
const useLayoutName = (containerName) => {
|
|
143
|
-
const [layoutName, setLayoutName] = useState();
|
|
144
|
-
useEffect(() => {
|
|
145
|
-
const subscribe = flexContainerStore.pipe(
|
|
146
|
-
map(
|
|
147
|
-
(layouts) => Object.entries(layouts).filter(([_, v]) => v[containerName]).map(([k]) => k)[0]
|
|
148
|
-
// 첫 번째 결과 가져오기
|
|
149
|
-
)
|
|
150
|
-
).subscribe(setLayoutName);
|
|
151
|
-
return () => subscribe.unsubscribe();
|
|
152
|
-
}, [containerName]);
|
|
153
|
-
return layoutName;
|
|
154
|
-
};
|
|
155
|
-
const useDecompositionLayout = ({
|
|
156
|
-
layoutName: initialLayoutName,
|
|
157
|
-
containerName
|
|
158
|
-
}) => {
|
|
159
|
-
const derivedLayoutName = useLayoutName(containerName);
|
|
160
|
-
const finalLayoutName = initialLayoutName || derivedLayoutName;
|
|
161
|
-
const [containers, setContainers] = useState([]);
|
|
162
|
-
const [container, setContainer] = useState();
|
|
163
|
-
const [resizePanel, setResizePanel] = useState();
|
|
164
|
-
useEffect(() => {
|
|
165
|
-
if (!finalLayoutName) return;
|
|
166
|
-
const subscription = getLayoutInfos(finalLayoutName).subscribe(
|
|
167
|
-
(layout) => {
|
|
168
|
-
if (!layout) return;
|
|
169
|
-
setContainers(
|
|
170
|
-
Object.values(layout.container).filter(
|
|
171
|
-
(e) => e.current !== null
|
|
172
|
-
).map((e) => e.current)
|
|
173
|
-
);
|
|
174
|
-
if (containerName && layout.container[containerName] && layout.container[containerName].current) {
|
|
175
|
-
setContainer(layout.container[containerName].current);
|
|
176
|
-
if (layout.resizePanel[containerName] && layout.resizePanel[containerName].current) {
|
|
177
|
-
setResizePanel(
|
|
178
|
-
layout.resizePanel[containerName].current
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
);
|
|
184
|
-
return () => subscription.unsubscribe();
|
|
185
|
-
}, [containerName, finalLayoutName]);
|
|
186
|
-
return { layout: containers, container, resizePanel };
|
|
187
|
-
};
|
|
188
|
-
const useContainerSize = (containerName) => {
|
|
189
|
-
const { layout, container, resizePanel } = useDecompositionLayout({
|
|
190
|
-
containerName
|
|
191
|
-
});
|
|
192
|
-
const [size, setSize] = useState();
|
|
193
|
-
useEffect(() => {
|
|
194
|
-
if (!container) return;
|
|
195
|
-
const observer = new ResizeObserver((entries) => {
|
|
196
|
-
for (const entry of entries) {
|
|
197
|
-
setSize({
|
|
198
|
-
width: entry.contentRect.width,
|
|
199
|
-
height: entry.contentRect.height
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
observer.observe(container);
|
|
204
|
-
return () => observer.disconnect();
|
|
205
|
-
}, [container]);
|
|
206
|
-
return { size };
|
|
207
|
-
};
|
|
208
|
-
const useDoubleClick = (containerName, opt) => {
|
|
209
|
-
const [isOpen, setIsOpen] = useState();
|
|
210
|
-
const [isDoubleClick, setIsDoubleClick] = useState();
|
|
211
|
-
useEffect(() => {
|
|
212
|
-
const resizePanelClickEvent = getResizePanelRef({
|
|
213
|
-
containerName
|
|
214
|
-
}).pipe(
|
|
215
|
-
filter(
|
|
216
|
-
(resizePanelref) => resizePanelref != void 0 && resizePanelref.current != void 0
|
|
217
|
-
),
|
|
218
|
-
//take(1),
|
|
219
|
-
switchMap((resizePanelref) => {
|
|
220
|
-
if (!resizePanelref || !resizePanelref.current) return EMPTY;
|
|
221
|
-
return fromEvent(resizePanelref.current, "click");
|
|
222
|
-
})
|
|
223
|
-
);
|
|
224
|
-
const subscribe = resizePanelClickEvent.pipe(
|
|
225
|
-
buffer(resizePanelClickEvent.pipe(debounceTime(500))),
|
|
226
|
-
filter((clickEventArray) => clickEventArray.length >= 2),
|
|
227
|
-
map((events) => {
|
|
228
|
-
containerOpenCloseSubjectMap[containerName].next({
|
|
229
|
-
...opt,
|
|
230
|
-
openOption: {
|
|
231
|
-
...opt.openOption,
|
|
232
|
-
isPrevSizeOpen: false
|
|
233
|
-
},
|
|
234
|
-
onClose: () => {
|
|
235
|
-
if (opt.onClose) opt.onClose();
|
|
236
|
-
setIsOpen(false);
|
|
237
|
-
setIsDoubleClick(true);
|
|
238
|
-
},
|
|
239
|
-
onOpen: () => {
|
|
240
|
-
if (opt.onOpen) opt.onOpen();
|
|
241
|
-
setIsOpen(true);
|
|
242
|
-
setIsDoubleClick(true);
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
})
|
|
246
|
-
).subscribe();
|
|
247
|
-
return () => {
|
|
248
|
-
subscribe.unsubscribe();
|
|
249
|
-
};
|
|
250
|
-
}, [containerName]);
|
|
251
|
-
return { isOpen, isDoubleClick, setIsDoubleClick };
|
|
252
|
-
};
|
|
253
|
-
export {
|
|
254
|
-
ContainerOpenCloseProvider,
|
|
255
|
-
containerOpenCloseSubjectMap,
|
|
256
|
-
containerSpreadSubjectMap,
|
|
257
|
-
useContainerSize,
|
|
258
|
-
useContainers,
|
|
259
|
-
useDecompositionLayout,
|
|
260
|
-
useDoubleClick,
|
|
261
|
-
useLayoutName
|
|
262
|
-
};
|
|
263
|
-
//# sourceMappingURL=FlexLayoutHooks.js.map
|
|
1
|
+
"use client";import{useEffect as a,useState as l}from"react";import{flexContainerStore as k,getLayoutInfos as E,getResizePanelRef as D}from"../store/FlexLayoutContainerStore";import{closeFlex as I,getGrow as y,mathGrow as G,openFlex as F}from"../utils/FlexLayoutUtils";import{buffer as M,debounceTime as z,EMPTY as q,filter as O,fromEvent as U,map as B,Subject as v,switchMap as J}from"rxjs";const g=globalThis;g.__FLEX_SUBJECTS__??(g.__FLEX_SUBJECTS__={openClose:{},spread:{}});const C=g.__FLEX_SUBJECTS__.openClose,S=g.__FLEX_SUBJECTS__.spread,V=({layoutName:n,containerName:e,sizeName:r})=>{C[e]||(C[e]=new v),S[e]||(S[e]=new v);const[s,o]=l([]),[t,c]=l();return a(()=>{const u=E(n).subscribe(i=>{!i||!i.container[e]||!i.container[e].current||(o(Object.values(i.container).filter(b=>b.current!==null).map(b=>b.current)),c(i.container[e].current))});return()=>u.unsubscribe()},[e,n]),a(()=>{const u=`${r.charAt(0).toUpperCase()+r.substring(1)}`,i="client"+u,b="outer"+u,h="max"+u,p=C[e].subscribe(({mode:f,initOpenState:$,onClose:m,onOpen:w,openOption:R={},closeOption:H={}})=>{if(!t||s.length===0)return;const d=y(t),P=window.getComputedStyle(t),x=G(parseInt(P[h]),t.parentElement&&t.parentElement[i]||window[b],s.length),L=()=>F(t,s,{sizeName:r,...isNaN(x)?{}:{openGrowImportant:x},...R}).then(j=>{w&&w(),S[e].next({isOpen:!0,grow:j,targetContainer:t})}),T=()=>I(t,s,{sizeName:r,...H}).then(()=>{m&&m(),S[e].next({isOpen:!1,grow:0,targetContainer:t})});f==="toggle"?d===0?L():T():f==="open"?d===0&&L():f==="close"&&d!==0&&T()});return()=>{p.unsubscribe()}},[e,t,s,r]),null},Z=n=>{const[e,r]=l([]);return a(()=>{const s=E(n).subscribe(o=>{r(Object.values(o.container).filter(t=>t.current!==null).map(t=>t.current))});return()=>s.unsubscribe()},[n]),e},W=n=>{const[e,r]=l();return a(()=>{const s=k.pipe(B(o=>Object.entries(o).filter(([t,c])=>c[n]).map(([t])=>t)[0])).subscribe(r);return()=>s.unsubscribe()},[n]),e},X=({layoutName:n,containerName:e})=>{const r=W(e),s=n||r,[o,t]=l([]),[c,u]=l(),[i,b]=l();return a(()=>{if(!s)return;const h=E(s).subscribe(p=>{p&&(t(Object.values(p.container).filter(f=>f.current!==null).map(f=>f.current)),e&&p.container[e]&&p.container[e].current&&(u(p.container[e].current),p.resizePanel[e]&&p.resizePanel[e].current&&b(p.resizePanel[e].current)))});return()=>h.unsubscribe()},[e,s]),{layout:o,container:c,resizePanel:i}},N=n=>{const{layout:e,container:r,resizePanel:s}=X({containerName:n}),[o,t]=l();return a(()=>{if(!r)return;const c=new ResizeObserver(u=>{for(const i of u)t({width:i.contentRect.width,height:i.contentRect.height})});return c.observe(r),()=>c.disconnect()},[r]),{size:o}},_=n=>D({containerName:n}).pipe(O(e=>e!=null&&e.current!=null),J(e=>!e||!e.current?q:U(e.current,"click"))),ee=(n,e)=>{const[r,s]=l(),[o,t]=l();return a(()=>{const c=_(n),u=c.pipe(M(c.pipe(z(500))),O(i=>i.length>=2)).subscribe(()=>{C[n].next({...e,openOption:{...e.openOption,isPrevSizeOpen:!1},onClose:()=>{e.onClose&&e.onClose(),s(!1),t(!0)},onOpen:()=>{e.onOpen&&e.onOpen(),s(!0),t(!0)}})});return()=>{u.unsubscribe()}},[n]),{isOpen:r,isDoubleClick:o,setIsDoubleClick:t}},te=n=>{const[e,r]=l();return a(()=>{const s=_(n),o=s.pipe(M(s.pipe(z(500))),O(t=>t.length>=2)).subscribe(()=>{r(!0)});return()=>{o.unsubscribe()}},[n]),{isDoubleClick:e,setIsDoubleClick:r}};export{V as ContainerOpenCloseProvider,C as containerOpenCloseSubjectMap,S as containerSpreadSubjectMap,N as useContainerSize,Z as useContainers,X as useDecompositionLayout,te as useDoubleClick,ee as useDoubleClickToggle,W as useLayoutName};
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
-
var providers_exports = {};
|
|
17
|
-
module.exports = __toCommonJS(providers_exports);
|
|
18
|
-
__reExport(providers_exports, require("./FlexLayoutHooks"), module.exports);
|
|
19
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
20
|
-
0 && (module.exports = {
|
|
21
|
-
...require("./FlexLayoutHooks")
|
|
22
|
-
});
|
|
23
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
"use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var p=(r,o,f,x)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of c(o))!d.call(r,e)&&e!==f&&a(r,e,{get:()=>o[e],enumerable:!(x=b(o,e))||x.enumerable});return r},t=(r,o,f)=>(p(r,o,"default"),f&&p(f,o,"default"));var g=r=>p(a({},"__esModule",{value:!0}),r);var m={};module.exports=g(m);t(m,require("./FlexLayoutHooks"),module.exports);0&&(module.exports={...require("./FlexLayoutHooks")});
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export*from"./FlexLayoutHooks";
|
|
@@ -1,257 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
"use client";
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all)
|
|
11
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from))
|
|
16
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
-
}
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
-
var FlexLayoutContainerStore_exports = {};
|
|
31
|
-
__export(FlexLayoutContainerStore_exports, {
|
|
32
|
-
flexContainerStore: () => flexContainerStore,
|
|
33
|
-
flexResizePanelStore: () => flexResizePanelStore,
|
|
34
|
-
getContainerRef: () => getContainerRef,
|
|
35
|
-
getCurrentSplitScreenComponents: () => getCurrentSplitScreenComponents,
|
|
36
|
-
getLayoutInfos: () => getLayoutInfos,
|
|
37
|
-
getResizePanelRef: () => getResizePanelRef,
|
|
38
|
-
getScrollPosition: () => getScrollPosition,
|
|
39
|
-
getSplitScreen: () => getSplitScreen,
|
|
40
|
-
layoutSplitScreenStore: () => layoutSplitScreenStore,
|
|
41
|
-
removeRootSplitScreen: () => removeRootSplitScreen,
|
|
42
|
-
removeScrollPosition: () => removeScrollPosition,
|
|
43
|
-
removeSplitScreenChild: () => removeSplitScreenChild,
|
|
44
|
-
resetRootSplitScreen: () => resetRootSplitScreen,
|
|
45
|
-
scrollPositions: () => scrollPositions,
|
|
46
|
-
setContainerRef: () => setContainerRef,
|
|
47
|
-
setResizePanelRef: () => setResizePanelRef,
|
|
48
|
-
setScrollPosition: () => setScrollPosition,
|
|
49
|
-
setSplitScreen: () => setSplitScreen
|
|
50
|
-
});
|
|
51
|
-
module.exports = __toCommonJS(FlexLayoutContainerStore_exports);
|
|
52
|
-
var import_fast_deep_equal = __toESM(require("fast-deep-equal"), 1);
|
|
53
|
-
var import_rxjs = require("rxjs");
|
|
54
|
-
var import_operators = require("rxjs/operators");
|
|
55
|
-
function updateScrollStore(subject, newValue) {
|
|
56
|
-
const currentValue = subject.getValue();
|
|
57
|
-
if (!(0, import_fast_deep_equal.default)(currentValue, newValue)) {
|
|
58
|
-
subject.next(newValue);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
function updateSplitScreenStore(newValue) {
|
|
62
|
-
layoutSplitScreenStore.next(newValue);
|
|
63
|
-
}
|
|
64
|
-
const scrollPositions = {};
|
|
65
|
-
const scrollPositionsSubject = new import_rxjs.BehaviorSubject(scrollPositions);
|
|
66
|
-
const setScrollPosition = (layoutName, position) => {
|
|
67
|
-
const current = scrollPositionsSubject.getValue();
|
|
68
|
-
const prevPos = current[layoutName];
|
|
69
|
-
if (prevPos && prevPos.x === position.x && prevPos.y === position.y) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
const newPositions = {
|
|
73
|
-
...current,
|
|
74
|
-
[layoutName]: position
|
|
75
|
-
};
|
|
76
|
-
updateScrollStore(scrollPositionsSubject, newPositions);
|
|
77
|
-
};
|
|
78
|
-
const getScrollPosition = (layoutName) => {
|
|
79
|
-
return scrollPositionsSubject.pipe(
|
|
80
|
-
// 해당 layoutName이 정의되지 않았을 때는 제외
|
|
81
|
-
(0, import_operators.filter)((e) => e[layoutName] !== void 0),
|
|
82
|
-
(0, import_operators.map)((positions) => positions[layoutName]),
|
|
83
|
-
(0, import_operators.distinctUntilChanged)(
|
|
84
|
-
(prev, curr) => prev?.x === curr?.x && prev?.y === curr?.y
|
|
85
|
-
)
|
|
86
|
-
);
|
|
87
|
-
};
|
|
88
|
-
const removeScrollPosition = (layoutName) => {
|
|
89
|
-
const current = scrollPositionsSubject.getValue();
|
|
90
|
-
const { [layoutName]: _, ...rest } = current;
|
|
91
|
-
updateScrollStore(scrollPositionsSubject, rest);
|
|
92
|
-
};
|
|
93
|
-
const layoutSplitScreenStore = new import_rxjs.BehaviorSubject({});
|
|
94
|
-
const setSplitScreen = (rootName, layoutName, newComponents) => {
|
|
95
|
-
const current = layoutSplitScreenStore.getValue();
|
|
96
|
-
const updatedLayout = { ...current[rootName] || {} };
|
|
97
|
-
updatedLayout[layoutName] = newComponents;
|
|
98
|
-
const newStoreValue = {
|
|
99
|
-
...current,
|
|
100
|
-
[rootName]: updatedLayout
|
|
101
|
-
};
|
|
102
|
-
updateSplitScreenStore(newStoreValue);
|
|
103
|
-
};
|
|
104
|
-
const resetRootSplitScreen = (rootName) => {
|
|
105
|
-
const current = layoutSplitScreenStore.getValue();
|
|
106
|
-
const newStoreValue = {
|
|
107
|
-
...current,
|
|
108
|
-
[rootName]: {}
|
|
109
|
-
};
|
|
110
|
-
updateSplitScreenStore(newStoreValue);
|
|
111
|
-
};
|
|
112
|
-
const removeRootSplitScreen = (rootName) => {
|
|
113
|
-
const current = layoutSplitScreenStore.getValue();
|
|
114
|
-
if (!current[rootName]) return;
|
|
115
|
-
const { [rootName]: _, ...rest } = current;
|
|
116
|
-
updateSplitScreenStore(rest);
|
|
117
|
-
};
|
|
118
|
-
const removeSplitScreenChild = (rootName, layoutName) => {
|
|
119
|
-
const current = layoutSplitScreenStore.getValue();
|
|
120
|
-
if (!current[rootName]) return;
|
|
121
|
-
const updatedLayout = { ...current[rootName] };
|
|
122
|
-
delete updatedLayout[layoutName];
|
|
123
|
-
const newStoreValue = {
|
|
124
|
-
...current,
|
|
125
|
-
[rootName]: updatedLayout
|
|
126
|
-
};
|
|
127
|
-
updateSplitScreenStore(newStoreValue);
|
|
128
|
-
};
|
|
129
|
-
const getCurrentSplitScreenComponents = (rootName, layoutName) => {
|
|
130
|
-
const current = layoutSplitScreenStore.getValue();
|
|
131
|
-
if (!current[rootName]) return;
|
|
132
|
-
return current[rootName][layoutName];
|
|
133
|
-
};
|
|
134
|
-
const getSplitScreen = (rootName, layoutName) => {
|
|
135
|
-
return layoutSplitScreenStore.pipe(
|
|
136
|
-
(0, import_operators.map)((splitScreen) => splitScreen[rootName]?.[layoutName]),
|
|
137
|
-
(0, import_operators.distinctUntilChanged)((prev, curr) => {
|
|
138
|
-
const filterChildren = (obj) => {
|
|
139
|
-
const { children, component, targetComponent, x, y, ...rest } = obj || {};
|
|
140
|
-
return rest;
|
|
141
|
-
};
|
|
142
|
-
return (0, import_fast_deep_equal.default)(filterChildren(prev), filterChildren(curr));
|
|
143
|
-
})
|
|
144
|
-
);
|
|
145
|
-
};
|
|
146
|
-
const flexContainerStore = new import_rxjs.BehaviorSubject({});
|
|
147
|
-
const flexResizePanelStore = new import_rxjs.BehaviorSubject({});
|
|
148
|
-
const setContainerRef = (layoutName, containerName, ref) => {
|
|
149
|
-
const currentRefs = flexContainerStore.getValue();
|
|
150
|
-
const layoutRefs = currentRefs[layoutName] || {};
|
|
151
|
-
if (ref === null) {
|
|
152
|
-
if (!(containerName in layoutRefs)) return;
|
|
153
|
-
const { [containerName]: _, ...restLayout } = layoutRefs;
|
|
154
|
-
const next = Object.keys(restLayout).length === 0 ? (() => {
|
|
155
|
-
const { [layoutName]: __, ...rest } = currentRefs;
|
|
156
|
-
return rest;
|
|
157
|
-
})() : { ...currentRefs, [layoutName]: restLayout };
|
|
158
|
-
flexContainerStore.next(next);
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
if (layoutRefs[containerName] === ref) return;
|
|
162
|
-
flexContainerStore.next({
|
|
163
|
-
...currentRefs,
|
|
164
|
-
[layoutName]: { ...layoutRefs, [containerName]: ref }
|
|
165
|
-
});
|
|
166
|
-
};
|
|
167
|
-
const setResizePanelRef = (layoutName, containerName, ref) => {
|
|
168
|
-
const currentRefs = flexResizePanelStore.getValue();
|
|
169
|
-
const layoutRefs = currentRefs[layoutName] || {};
|
|
170
|
-
if (ref === null) {
|
|
171
|
-
if (!(containerName in layoutRefs)) return;
|
|
172
|
-
const { [containerName]: _, ...restLayout } = layoutRefs;
|
|
173
|
-
const next = Object.keys(restLayout).length === 0 ? (() => {
|
|
174
|
-
const { [layoutName]: __, ...rest } = currentRefs;
|
|
175
|
-
return rest;
|
|
176
|
-
})() : { ...currentRefs, [layoutName]: restLayout };
|
|
177
|
-
flexResizePanelStore.next(next);
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
if (layoutRefs[containerName] === ref) return;
|
|
181
|
-
flexResizePanelStore.next({
|
|
182
|
-
...currentRefs,
|
|
183
|
-
[layoutName]: { ...layoutRefs, [containerName]: ref }
|
|
184
|
-
});
|
|
185
|
-
};
|
|
186
|
-
const getLayoutInfos = (layoutName) => {
|
|
187
|
-
return (0, import_rxjs.combineLatest)([flexContainerStore, flexResizePanelStore]).pipe(
|
|
188
|
-
(0, import_operators.map)(([containerRefs, resizePanelRefs]) => {
|
|
189
|
-
const containerData = containerRefs[layoutName] || {};
|
|
190
|
-
const resizePanelData = resizePanelRefs[layoutName] || {};
|
|
191
|
-
return {
|
|
192
|
-
container: containerData,
|
|
193
|
-
resizePanel: resizePanelData
|
|
194
|
-
};
|
|
195
|
-
}),
|
|
196
|
-
(0, import_operators.filter)(
|
|
197
|
-
(result) => result.container !== null && Object.keys(result.container).length > 0
|
|
198
|
-
)
|
|
199
|
-
// 빈 객체 제외
|
|
200
|
-
);
|
|
201
|
-
};
|
|
202
|
-
const getContainerRef = ({
|
|
203
|
-
containerName,
|
|
204
|
-
layoutName
|
|
205
|
-
}) => {
|
|
206
|
-
return flexContainerStore.pipe(
|
|
207
|
-
(0, import_operators.map)((refs) => {
|
|
208
|
-
if (layoutName) {
|
|
209
|
-
return refs[layoutName]?.[containerName] || null;
|
|
210
|
-
} else {
|
|
211
|
-
return Object.entries(refs).find(
|
|
212
|
-
([key, value]) => refs[key][containerName]
|
|
213
|
-
)?.[1][containerName];
|
|
214
|
-
}
|
|
215
|
-
}),
|
|
216
|
-
(0, import_operators.filter)((ref) => ref !== null)
|
|
217
|
-
);
|
|
218
|
-
};
|
|
219
|
-
const getResizePanelRef = ({
|
|
220
|
-
containerName,
|
|
221
|
-
layoutName
|
|
222
|
-
}) => {
|
|
223
|
-
return flexResizePanelStore.pipe(
|
|
224
|
-
(0, import_operators.map)((refs) => {
|
|
225
|
-
if (layoutName) {
|
|
226
|
-
return refs[layoutName]?.[containerName] || null;
|
|
227
|
-
} else {
|
|
228
|
-
return Object.entries(refs).find(
|
|
229
|
-
([key, value]) => refs[key][containerName]
|
|
230
|
-
)?.[1][containerName];
|
|
231
|
-
}
|
|
232
|
-
}),
|
|
233
|
-
(0, import_operators.filter)((ref) => ref !== null)
|
|
234
|
-
);
|
|
235
|
-
};
|
|
236
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
237
|
-
0 && (module.exports = {
|
|
238
|
-
flexContainerStore,
|
|
239
|
-
flexResizePanelStore,
|
|
240
|
-
getContainerRef,
|
|
241
|
-
getCurrentSplitScreenComponents,
|
|
242
|
-
getLayoutInfos,
|
|
243
|
-
getResizePanelRef,
|
|
244
|
-
getScrollPosition,
|
|
245
|
-
getSplitScreen,
|
|
246
|
-
layoutSplitScreenStore,
|
|
247
|
-
removeRootSplitScreen,
|
|
248
|
-
removeScrollPosition,
|
|
249
|
-
removeSplitScreenChild,
|
|
250
|
-
resetRootSplitScreen,
|
|
251
|
-
scrollPositions,
|
|
252
|
-
setContainerRef,
|
|
253
|
-
setResizePanelRef,
|
|
254
|
-
setScrollPosition,
|
|
255
|
-
setSplitScreen
|
|
256
|
-
});
|
|
257
|
-
//# sourceMappingURL=FlexLayoutContainerStore.cjs.map
|
|
1
|
+
"use strict";"use client";var m=Object.create;var a=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var V=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var w=(t,e)=>{for(var n in e)a(t,n,{get:e[n],enumerable:!0})},C=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of L(e))!h.call(t,o)&&o!==n&&a(t,o,{get:()=>e[o],enumerable:!(r=j(e,o))||r.enumerable});return t};var D=(t,e,n)=>(n=t!=null?m(V(t)):{},C(e||!t||!t.__esModule?a(n,"default",{value:t,enumerable:!0}):n,t)),O=t=>C(a({},"__esModule",{value:!0}),t);var J={};w(J,{flexContainerStore:()=>u,flexResizePanelStore:()=>p,getContainerRef:()=>F,getCurrentSplitScreenComponents:()=>B,getLayoutInfos:()=>A,getResizePanelRef:()=>G,getScrollPosition:()=>v,getSplitScreen:()=>q,layoutSplitScreenStore:()=>i,removeRootSplitScreen:()=>H,removeScrollPosition:()=>z,removeSplitScreenChild:()=>M,resetRootSplitScreen:()=>E,scrollPositions:()=>y,setContainerRef:()=>I,setResizePanelRef:()=>U,setScrollPosition:()=>_,setSplitScreen:()=>k});module.exports=O(J);var b=D(require("fast-deep-equal/react"),1),c=require("rxjs"),s=require("rxjs/operators");function T(t,e){t.next(e)}function R(t){i.next(t)}const y={},S=new c.BehaviorSubject(y),_=(t,e)=>{const n=S.getValue(),r=n[t];if(r&&r.x===e.x&&r.y===e.y)return;const o={...n,[t]:e};T(S,o)},v=t=>S.pipe((0,s.filter)(e=>e[t]!==void 0),(0,s.map)(e=>e[t]),(0,s.distinctUntilChanged)((e,n)=>e?.x===n?.x&&e?.y===n?.y)),z=t=>{const e=S.getValue(),{[t]:n,...r}=e;T(S,r)},i=new c.BehaviorSubject({}),k=(t,e,n)=>{const r=i.getValue(),o={...r[t]||{}};o[e]=n;const g={...r,[t]:o};R(g)},E=t=>{const n={...i.getValue(),[t]:{}};R(n)},H=t=>{const e=i.getValue();if(!e[t])return;const{[t]:n,...r}=e;R(r)},M=(t,e)=>{const n=i.getValue();if(!n[t])return;const r={...n[t]};delete r[e];const o={...n,[t]:r};R(o)},B=(t,e)=>{const n=i.getValue();if(n[t])return n[t][e]},q=(t,e)=>i.pipe((0,s.map)(n=>n[t]?.[e]),(0,s.distinctUntilChanged)((n,r)=>{const o=g=>{const{children:l,component:f,targetComponent:d,x,y:K,...P}=g||{};return P};return(0,b.default)(o(n),o(r))})),u=new c.BehaviorSubject({}),p=new c.BehaviorSubject({}),I=(t,e,n)=>{const r=u.getValue(),o=r[t]||{};if(n===null){if(!(e in o))return;const{[e]:g,...l}=o,f=Object.keys(l).length===0?(()=>{const{[t]:d,...x}=r;return x})():{...r,[t]:l};u.next(f);return}o[e]!==n&&u.next({...r,[t]:{...o,[e]:n}})},U=(t,e,n)=>{const r=p.getValue(),o=r[t]||{};if(n===null){if(!(e in o))return;const{[e]:g,...l}=o,f=Object.keys(l).length===0?(()=>{const{[t]:d,...x}=r;return x})():{...r,[t]:l};p.next(f);return}o[e]!==n&&p.next({...r,[t]:{...o,[e]:n}})},A=t=>(0,c.combineLatest)([u,p]).pipe((0,s.map)(([e,n])=>{const r=e[t]||{},o=n[t]||{};return{container:r,resizePanel:o}}),(0,s.filter)(e=>e.container!==null&&Object.keys(e.container).length>0)),F=({containerName:t,layoutName:e})=>u.pipe((0,s.map)(n=>e?n[e]?.[t]||null:Object.entries(n).find(([r,o])=>n[r][t])?.[1][t]),(0,s.filter)(n=>n!==null)),G=({containerName:t,layoutName:e})=>p.pipe((0,s.map)(n=>e?n[e]?.[t]||null:Object.entries(n).find(([r,o])=>n[r][t])?.[1][t]),(0,s.filter)(n=>n!==null));0&&(module.exports={flexContainerStore,flexResizePanelStore,getContainerRef,getCurrentSplitScreenComponents,getLayoutInfos,getResizePanelRef,getScrollPosition,getSplitScreen,layoutSplitScreenStore,removeRootSplitScreen,removeScrollPosition,removeSplitScreenChild,resetRootSplitScreen,scrollPositions,setContainerRef,setResizePanelRef,setScrollPosition,setSplitScreen});
|