@byeolnaerim/flex-layout 0.0.3 → 0.0.4

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.
Files changed (59) hide show
  1. package/dist/FlexLayoutSplitScreenDragBox-eCtq4kLd.d.cts +31 -0
  2. package/dist/FlexLayoutSplitScreenDragBox-eCtq4kLd.d.ts +31 -0
  3. package/dist/chunk-3EDKZTM3.js +3 -0
  4. package/dist/chunk-3EDKZTM3.js.map +1 -0
  5. package/dist/chunk-5HWEFTNQ.js +176 -0
  6. package/dist/chunk-5HWEFTNQ.js.map +1 -0
  7. package/dist/chunk-7J5JUVZK.js +3 -0
  8. package/dist/chunk-7J5JUVZK.js.map +1 -0
  9. package/dist/chunk-CFQQ6ZDC.js +182 -0
  10. package/dist/chunk-CFQQ6ZDC.js.map +1 -0
  11. package/dist/chunk-JM3CZ5DU.js +238 -0
  12. package/dist/chunk-JM3CZ5DU.js.map +1 -0
  13. package/dist/chunk-PMTZFSP4.js +219 -0
  14. package/dist/chunk-PMTZFSP4.js.map +1 -0
  15. package/dist/chunk-UYI4Z27V.js +2432 -0
  16. package/dist/chunk-UYI4Z27V.js.map +1 -0
  17. package/dist/chunk-W4CNFJTK.js +197 -0
  18. package/dist/chunk-W4CNFJTK.js.map +1 -0
  19. package/dist/chunk-YIHCWXKY.js +3 -0
  20. package/dist/chunk-YIHCWXKY.js.map +1 -0
  21. package/dist/components.cjs +3048 -0
  22. package/dist/components.cjs.map +1 -0
  23. package/dist/components.css +471 -0
  24. package/dist/components.css.map +1 -0
  25. package/dist/components.d.cts +122 -0
  26. package/dist/components.d.ts +122 -0
  27. package/dist/components.js +7 -0
  28. package/dist/components.js.map +1 -0
  29. package/dist/hooks.cjs +425 -0
  30. package/dist/hooks.cjs.map +1 -0
  31. package/dist/hooks.d.cts +37 -0
  32. package/dist/hooks.d.ts +37 -0
  33. package/dist/hooks.js +5 -0
  34. package/dist/hooks.js.map +1 -0
  35. package/dist/index.d.cts +10 -418
  36. package/dist/index.d.ts +10 -418
  37. package/dist/index.js +9 -3403
  38. package/dist/index.js.map +1 -1
  39. package/dist/providers.cjs +411 -0
  40. package/dist/providers.cjs.map +1 -0
  41. package/dist/providers.d.cts +54 -0
  42. package/dist/providers.d.ts +54 -0
  43. package/dist/providers.js +6 -0
  44. package/dist/providers.js.map +1 -0
  45. package/dist/store.cjs +204 -0
  46. package/dist/store.cjs.map +1 -0
  47. package/dist/store.d.cts +67 -0
  48. package/dist/store.d.ts +67 -0
  49. package/dist/store.js +4 -0
  50. package/dist/store.js.map +1 -0
  51. package/dist/useDrag-CYQnhUFk.d.cts +108 -0
  52. package/dist/useDrag-DR01Ob3s.d.ts +108 -0
  53. package/dist/utils.cjs +209 -0
  54. package/dist/utils.cjs.map +1 -0
  55. package/dist/utils.d.cts +28 -0
  56. package/dist/utils.d.ts +28 -0
  57. package/dist/utils.js +4 -0
  58. package/dist/utils.js.map +1 -0
  59. package/package.json +25 -5
package/dist/store.cjs ADDED
@@ -0,0 +1,204 @@
1
+ 'use strict';
2
+
3
+ var equal = require('fast-deep-equal');
4
+ var rxjs = require('rxjs');
5
+ var operators = require('rxjs/operators');
6
+
7
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
+
9
+ var equal__default = /*#__PURE__*/_interopDefault(equal);
10
+
11
+ // src/flex-layout/store/FlexLayoutContainerStore.ts
12
+ function updateScrollStore(subject, newValue) {
13
+ const currentValue = subject.getValue();
14
+ if (!equal__default.default(currentValue, newValue)) {
15
+ subject.next(newValue);
16
+ }
17
+ }
18
+ function updateRefStore(store, newState) {
19
+ const prevState = store.getValue();
20
+ if (!equal__default.default(prevState, newState)) {
21
+ store.next(newState);
22
+ }
23
+ }
24
+ function updateSplitScreenStore(newValue) {
25
+ const prevValue = layoutSplitScreenStore.getValue();
26
+ if (!equal__default.default(prevValue, newValue)) {
27
+ layoutSplitScreenStore.next(newValue);
28
+ }
29
+ }
30
+ var scrollPositions = {};
31
+ var scrollPositionsSubject = new rxjs.BehaviorSubject(scrollPositions);
32
+ var setScrollPosition = (layoutName, position) => {
33
+ const current = scrollPositionsSubject.getValue();
34
+ const prevPos = current[layoutName];
35
+ if (prevPos && prevPos.x === position.x && prevPos.y === position.y) {
36
+ return;
37
+ }
38
+ const newPositions = {
39
+ ...current,
40
+ [layoutName]: position
41
+ };
42
+ updateScrollStore(scrollPositionsSubject, newPositions);
43
+ };
44
+ var getScrollPosition = (layoutName) => {
45
+ return scrollPositionsSubject.pipe(
46
+ // 해당 layoutName이 정의되지 않았을 때는 제외
47
+ operators.filter((e) => e[layoutName] !== void 0),
48
+ operators.map((positions) => positions[layoutName]),
49
+ operators.distinctUntilChanged(
50
+ (prev, curr) => prev?.x === curr?.x && prev?.y === curr?.y
51
+ )
52
+ );
53
+ };
54
+ var removeScrollPosition = (layoutName) => {
55
+ const current = scrollPositionsSubject.getValue();
56
+ delete current[layoutName];
57
+ const newPositions = { ...current };
58
+ updateScrollStore(scrollPositionsSubject, newPositions);
59
+ };
60
+ var layoutSplitScreenStore = new rxjs.BehaviorSubject({});
61
+ var setSplitScreen = (rootName, layoutName, newComponents) => {
62
+ const current = layoutSplitScreenStore.getValue();
63
+ const updatedLayout = { ...current[rootName] || {} };
64
+ updatedLayout[layoutName] = newComponents;
65
+ const newStoreValue = {
66
+ ...current,
67
+ [rootName]: updatedLayout
68
+ };
69
+ updateSplitScreenStore(newStoreValue);
70
+ };
71
+ var resetRootSplitScreen = (rootName) => {
72
+ const current = layoutSplitScreenStore.getValue();
73
+ const newStoreValue = {
74
+ ...current,
75
+ [rootName]: {}
76
+ };
77
+ updateSplitScreenStore(newStoreValue);
78
+ };
79
+ var removeSplitScreenChild = (rootName, layoutName) => {
80
+ const current = layoutSplitScreenStore.getValue();
81
+ if (!current[rootName]) return;
82
+ const updatedLayout = { ...current[rootName] };
83
+ delete updatedLayout[layoutName];
84
+ const newStoreValue = {
85
+ ...current,
86
+ [rootName]: updatedLayout
87
+ };
88
+ updateSplitScreenStore(newStoreValue);
89
+ };
90
+ var getCurrentSplitScreenComponents = (rootName, layoutName) => {
91
+ const current = layoutSplitScreenStore.getValue();
92
+ if (!current[rootName]) return;
93
+ return current[rootName][layoutName];
94
+ };
95
+ var getSplitScreen = (rootName, layoutName) => {
96
+ return layoutSplitScreenStore.pipe(
97
+ operators.map((splitScreen) => splitScreen[rootName][layoutName]),
98
+ operators.distinctUntilChanged((prev, curr) => {
99
+ const filterChildren = (obj) => {
100
+ const { children, component, targetComponent, x, y, ...rest } = obj || {};
101
+ return rest;
102
+ };
103
+ return equal__default.default(filterChildren(prev), filterChildren(curr));
104
+ })
105
+ );
106
+ };
107
+ var flexContainerStore = new rxjs.BehaviorSubject({});
108
+ var flexResizePanelStore = new rxjs.BehaviorSubject({});
109
+ var setContainerRef = (layoutName, containerName, ref) => {
110
+ const currentRefs = flexContainerStore.getValue();
111
+ const updatedLayoutRefs = { ...currentRefs[layoutName] || {} };
112
+ if (ref === null) {
113
+ delete updatedLayoutRefs[containerName];
114
+ } else {
115
+ updatedLayoutRefs[containerName] = ref;
116
+ }
117
+ const newRefs = {
118
+ ...currentRefs,
119
+ [layoutName]: updatedLayoutRefs
120
+ };
121
+ updateRefStore(flexContainerStore, newRefs);
122
+ };
123
+ var setResizePanelRef = (layoutName, containerName, ref) => {
124
+ const currentRefs = flexResizePanelStore.getValue();
125
+ const updatedLayoutRefs = { ...currentRefs[layoutName] || {} };
126
+ if (ref === null) {
127
+ delete updatedLayoutRefs[containerName];
128
+ } else {
129
+ updatedLayoutRefs[containerName] = ref;
130
+ }
131
+ const newRefs = {
132
+ ...currentRefs,
133
+ [layoutName]: updatedLayoutRefs
134
+ };
135
+ updateRefStore(flexResizePanelStore, newRefs);
136
+ };
137
+ var getLayoutInfos = (layoutName) => {
138
+ return rxjs.combineLatest([flexContainerStore, flexResizePanelStore]).pipe(
139
+ operators.map(([containerRefs, resizePanelRefs]) => {
140
+ const containerData = containerRefs[layoutName] || {};
141
+ const resizePanelData = resizePanelRefs[layoutName] || {};
142
+ return {
143
+ container: containerData,
144
+ resizePanel: resizePanelData
145
+ };
146
+ }),
147
+ operators.filter((result) => result.container !== null)
148
+ // 빈 객체 제외
149
+ );
150
+ };
151
+ var getContainerRef = ({
152
+ containerName,
153
+ layoutName
154
+ }) => {
155
+ return flexContainerStore.pipe(
156
+ operators.map((refs) => {
157
+ if (layoutName) {
158
+ return refs[layoutName]?.[containerName] || null;
159
+ } else {
160
+ return Object.entries(refs).find(
161
+ ([key, value]) => refs[key][containerName]
162
+ )?.[1][containerName];
163
+ }
164
+ }),
165
+ operators.filter((ref) => ref !== null)
166
+ );
167
+ };
168
+ var getResizePanelRef = ({
169
+ containerName,
170
+ layoutName
171
+ }) => {
172
+ return flexResizePanelStore.pipe(
173
+ operators.map((refs) => {
174
+ if (layoutName) {
175
+ return refs[layoutName]?.[containerName] || null;
176
+ } else {
177
+ return Object.entries(refs).find(
178
+ ([key, value]) => refs[key][containerName]
179
+ )?.[1][containerName];
180
+ }
181
+ }),
182
+ operators.filter((ref) => ref !== null)
183
+ );
184
+ };
185
+
186
+ exports.flexContainerStore = flexContainerStore;
187
+ exports.flexResizePanelStore = flexResizePanelStore;
188
+ exports.getContainerRef = getContainerRef;
189
+ exports.getCurrentSplitScreenComponents = getCurrentSplitScreenComponents;
190
+ exports.getLayoutInfos = getLayoutInfos;
191
+ exports.getResizePanelRef = getResizePanelRef;
192
+ exports.getScrollPosition = getScrollPosition;
193
+ exports.getSplitScreen = getSplitScreen;
194
+ exports.layoutSplitScreenStore = layoutSplitScreenStore;
195
+ exports.removeScrollPosition = removeScrollPosition;
196
+ exports.removeSplitScreenChild = removeSplitScreenChild;
197
+ exports.resetRootSplitScreen = resetRootSplitScreen;
198
+ exports.scrollPositions = scrollPositions;
199
+ exports.setContainerRef = setContainerRef;
200
+ exports.setResizePanelRef = setResizePanelRef;
201
+ exports.setScrollPosition = setScrollPosition;
202
+ exports.setSplitScreen = setSplitScreen;
203
+ //# sourceMappingURL=store.cjs.map
204
+ //# sourceMappingURL=store.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flex-layout/store/FlexLayoutContainerStore.ts"],"names":["equal","BehaviorSubject","filter","map","distinctUntilChanged","combineLatest"],"mappings":";;;;;;;;;;;AAUA,SAAS,iBAAA,CAAqB,SAA6B,QAAA,EAAa;AACvE,EAAA,MAAM,YAAA,GAAe,QAAQ,QAAA,EAAS;AAEtC,EAAA,IAAI,CAACA,sBAAA,CAAM,YAAA,EAAc,QAAQ,CAAA,EAAG;AACnC,IAAA,OAAA,CAAQ,KAAK,QAAQ,CAAA;AAAA,EACtB;AACD;AAEA,SAAS,cAAA,CAAe,OAAkC,QAAA,EAAoB;AAC7E,EAAA,MAAM,SAAA,GAAY,MAAM,QAAA,EAAS;AACjC,EAAA,IAAI,CAACA,sBAAA,CAAM,SAAA,EAAW,QAAQ,CAAA,EAAG;AAChC,IAAA,KAAA,CAAM,KAAK,QAAQ,CAAA;AAAA,EACpB;AACD;AAEA,SAAS,uBAAuB,QAAA,EAAkC;AACjE,EAAA,MAAM,SAAA,GAAY,uBAAuB,QAAA,EAAS;AAElD,EAAA,IAAI,CAACA,sBAAA,CAAM,SAAA,EAAW,QAAQ,CAAA,EAAG;AAChC,IAAA,sBAAA,CAAuB,KAAK,QAAQ,CAAA;AAAA,EACrC;AACD;AAYO,IAAM,kBAAkD;AAE/D,IAAM,sBAAA,GAAyB,IAAIC,oBAAA,CAEjC,eAAe,CAAA;AAOV,IAAM,iBAAA,GAAoB,CAChC,UAAA,EACA,QAAA,KACI;AACJ,EAAA,MAAM,OAAA,GAAU,uBAAuB,QAAA,EAAS;AAChD,EAAA,MAAM,OAAA,GAAU,QAAQ,UAAU,CAAA;AAGlC,EAAA,IAAI,OAAA,IAAW,QAAQ,CAAA,KAAM,QAAA,CAAS,KAAK,OAAA,CAAQ,CAAA,KAAM,SAAS,CAAA,EAAG;AACpE,IAAA;AAAA,EACD;AAGA,EAAA,MAAM,YAAA,GAAe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AAAA,EACA;AACD,CAAA,KAGM;AACL,EAAA,OAAO,oBAAA,CAAqB,IAAA;AAAA,IAC3BC,aAAA,CAAI,CAAC,IAAA,KAAmB;AACvB,MAAA,IAAI,UAAA,EAAY;AAEf,QAAA,OAAO,IAAA,CAAK,UAAU,CAAA,GAAI,aAAa,CAAA,IAAK,IAAA;AAAA,MAC7C,CAAA,MAAO;AAEN,QAAA,OAAO,MAAA,CAAO,OAAA,CAAQ,IAAI,CAAA,CAAE,IAAA;AAAA,UAC3B,CAAC,CAAC,GAAA,EAAK,KAAK,MAAM,IAAA,CAAK,GAAG,EAAE,aAAa;AAAA,SAC1C,GAAI,CAAC,CAAA,CAAE,aAAa,CAAA;AAAA,MACrB;AAAA,IAUD,CAAC,CAAA;AAAA,IACDD,gBAAA,CAAO,CAAC,GAAA,KAAQ,GAAA,KAAQ,IAAI;AAAA,GAC7B;AACD","file":"store.cjs","sourcesContent":["\"use client\";\r\nimport equal from \"fast-deep-equal\";\r\nimport { RefObject } from \"react\";\r\nimport { BehaviorSubject, combineLatest } from \"rxjs\";\r\nimport { distinctUntilChanged, filter, map } from \"rxjs/operators\";\r\nimport { DropTargetComponent } from \"../hooks/useDrag\";\r\n\r\n/**\r\n * 이전 값과 새 값이 동일하지 않을 때만 store를 업데이트하는 유틸 함수\r\n */\r\nfunction updateScrollStore<T>(subject: BehaviorSubject<T>, newValue: T) {\r\n\tconst currentValue = subject.getValue();\r\n\t// deep 비교를 통해 실제 변경이 있는 경우만 next\r\n\tif (!equal(currentValue, newValue)) {\r\n\t\tsubject.next(newValue);\r\n\t}\r\n}\r\n// 동일한지 확인 후 업데이트하는 유틸\r\nfunction updateRefStore(store: BehaviorSubject<RefStore>, newState: RefStore) {\r\n\tconst prevState = store.getValue();\r\n\tif (!equal(prevState, newState)) {\r\n\t\tstore.next(newState);\r\n\t}\r\n}\r\n\r\nfunction updateSplitScreenStore(newValue: LayoutSplitScreenState) {\r\n\tconst prevValue = layoutSplitScreenStore.getValue();\r\n\t// deep-equal 로 비교\r\n\tif (!equal(prevValue, newValue)) {\r\n\t\tlayoutSplitScreenStore.next(newValue);\r\n\t}\r\n}\r\n\r\n// 구독 시 이전 상태들을 축적하여 관리\r\n// const stateWithHistory$ = flexContainerStore.pipe(\r\n// scan((acc, newState) => [...acc, newState], [] as RefStore[])\r\n// );\r\n\r\nexport interface ScrollPosition {\r\n\tx: number;\r\n\ty: number;\r\n}\r\n\r\nexport const scrollPositions: Record<string, ScrollPosition> = {};\r\n\r\nconst scrollPositionsSubject = new BehaviorSubject<\r\n\tRecord<string, ScrollPosition>\r\n>(scrollPositions);\r\n\r\n/**\r\n * 스크롤 위치 업데이트 함수\r\n *\r\n * 기존: 항상 store.next()가 호출됨 → 바뀌지 않았다면 건너뛰도록 변경\r\n */\r\nexport const setScrollPosition = (\r\n\tlayoutName: string,\r\n\tposition: ScrollPosition,\r\n) => {\r\n\tconst current = scrollPositionsSubject.getValue();\r\n\tconst prevPos = current[layoutName];\r\n\r\n\t// x, y 모두 동일하면 업데이트할 필요가 없으므로 조기 반환\r\n\tif (prevPos && prevPos.x === position.x && prevPos.y === position.y) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t// 변경사항이 있으면 새 객체를 만들어 넘김\r\n\tconst newPositions = {\r\n\t\t...current,\r\n\t\t[layoutName]: position,\r\n\t};\r\n\r\n\tupdateScrollStore(scrollPositionsSubject, newPositions);\r\n};\r\n\r\n/**\r\n * 스크롤 위치 구독\r\n */\r\nexport const getScrollPosition = (layoutName: string) => {\r\n\treturn scrollPositionsSubject.pipe(\r\n\t\t// 해당 layoutName이 정의되지 않았을 때는 제외\r\n\t\tfilter((e) => e[layoutName] !== undefined),\r\n\t\tmap((positions) => positions[layoutName]),\r\n\t\tdistinctUntilChanged(\r\n\t\t\t(prev, curr) => prev?.x === curr?.x && prev?.y === curr?.y,\r\n\t\t),\r\n\t);\r\n};\r\n\r\nexport const removeScrollPosition = (layoutName: string) => {\r\n\tconst current = scrollPositionsSubject.getValue();\r\n\tdelete current[layoutName];\r\n\r\n\t// 꼭 삭제 후에도 이전 상태와 달라졌는지 확인\r\n\tconst newPositions = { ...current };\r\n\tupdateScrollStore(scrollPositionsSubject, newPositions);\r\n};\r\n\r\nexport type SplitScreenComponents = {\r\n\tafterDropTargetComponent: DropTargetComponent[];\r\n\tbeforeDropTargetComponent: DropTargetComponent[];\r\n\tcenterDropTargetComponent: DropTargetComponent[];\r\n\tdirection: \"row\" | \"column\";\r\n};\r\n\r\nexport type LayoutSplitScreenState = Record<\r\n\tstring,\r\n\tRecord<string, SplitScreenComponents>\r\n>;\r\n\r\nexport const layoutSplitScreenStore =\r\n\tnew BehaviorSubject<LayoutSplitScreenState>({});\r\n\r\nexport const setSplitScreen = (\r\n\trootName: string,\r\n\tlayoutName: string,\r\n\tnewComponents: SplitScreenComponents,\r\n) => {\r\n\tconst current = layoutSplitScreenStore.getValue();\r\n\tconst updatedLayout = { ...(current[rootName] || {}) };\r\n\tupdatedLayout[layoutName] = newComponents;\r\n\r\n\tconst newStoreValue = {\r\n\t\t...current,\r\n\t\t[rootName]: updatedLayout,\r\n\t};\r\n\tupdateSplitScreenStore(newStoreValue);\r\n};\r\n\r\nexport const resetRootSplitScreen = (rootName: string) => {\r\n\tconst current = layoutSplitScreenStore.getValue();\r\n\t// rootName 아래만 초기화\r\n\tconst newStoreValue = {\r\n\t\t...current,\r\n\t\t[rootName]: {},\r\n\t};\r\n\tupdateSplitScreenStore(newStoreValue);\r\n};\r\n\r\nexport const removeSplitScreenChild = (\r\n\trootName: string,\r\n\tlayoutName: string,\r\n) => {\r\n\tconst current = layoutSplitScreenStore.getValue();\r\n\tif (!current[rootName]) return;\r\n\r\n\tconst updatedLayout = { ...current[rootName] };\r\n\tdelete updatedLayout[layoutName];\r\n\r\n\tconst newStoreValue = {\r\n\t\t...current,\r\n\t\t[rootName]: updatedLayout,\r\n\t};\r\n\tupdateSplitScreenStore(newStoreValue);\r\n};\r\n\r\nexport const getCurrentSplitScreenComponents = (\r\n\trootName: string,\r\n\tlayoutName: string,\r\n) => {\r\n\tconst current = layoutSplitScreenStore.getValue();\r\n\tif (!current[rootName]) return;\r\n\treturn current[rootName][layoutName];\r\n};\r\n\r\nexport const getSplitScreen = (rootName: string, layoutName: string) => {\r\n\treturn layoutSplitScreenStore.pipe(\r\n\t\tmap((splitScreen) => splitScreen[rootName][layoutName]),\r\n\t\tdistinctUntilChanged((prev, curr) => {\r\n\t\t\t// 이전 상태와 현재 상태를 비교하여 동일하면 필터링\r\n\t\t\tconst filterChildren = (obj: any) => {\r\n\t\t\t\t// 객체 복사 후 children 속성 제거\r\n\t\t\t\tconst { children, component, targetComponent, x, y, ...rest } =\r\n\t\t\t\t\tobj || {};\r\n\t\t\t\treturn rest;\r\n\t\t\t};\r\n\t\t\treturn equal(filterChildren(prev), filterChildren(curr));\r\n\t\t}),\r\n\t);\r\n};\r\n\r\n// 중첩된 객체 구조로 ref를 관리하는 타입\r\ntype RefStore = {\r\n\t[layoutName: string]: {\r\n\t\t[containerName: string]: RefObject<HTMLElement | null>;\r\n\t};\r\n};\r\n\r\n// 초기값으로 빈 객체를 설정한 BehaviorSubject 생성\r\nexport const flexContainerStore = new BehaviorSubject<RefStore>({});\r\n\r\nexport const flexResizePanelStore = new BehaviorSubject<RefStore>({});\r\n/**\r\n * ref를 업데이트하는 함수\r\n * - 기존: 무조건 next() → 새/이전 상태 비교 후 다를 경우에만 next()\r\n */\r\nexport const setContainerRef = <T extends HTMLElement>(\r\n\tlayoutName: string,\r\n\tcontainerName: string,\r\n\tref: React.RefObject<T | null> | null,\r\n) => {\r\n\tconst currentRefs = flexContainerStore.getValue();\r\n\tconst updatedLayoutRefs = { ...(currentRefs[layoutName] || {}) };\r\n\r\n\tif (ref === null) {\r\n\t\tdelete updatedLayoutRefs[containerName];\r\n\t} else {\r\n\t\tupdatedLayoutRefs[containerName] = ref;\r\n\t}\r\n\r\n\tconst newRefs: RefStore = {\r\n\t\t...currentRefs,\r\n\t\t[layoutName]: updatedLayoutRefs,\r\n\t};\r\n\r\n\tupdateRefStore(flexContainerStore, newRefs);\r\n};\r\n\r\nexport const setResizePanelRef = <T extends HTMLElement>(\r\n\tlayoutName: string,\r\n\tcontainerName: string,\r\n\tref: React.RefObject<T | null> | null,\r\n) => {\r\n\tconst currentRefs = flexResizePanelStore.getValue();\r\n\tconst updatedLayoutRefs = { ...(currentRefs[layoutName] || {}) };\r\n\r\n\tif (ref === null) {\r\n\t\tdelete updatedLayoutRefs[containerName];\r\n\t} else {\r\n\t\tupdatedLayoutRefs[containerName] = ref;\r\n\t}\r\n\r\n\tconst newRefs: RefStore = {\r\n\t\t...currentRefs,\r\n\t\t[layoutName]: updatedLayoutRefs,\r\n\t};\r\n\r\n\tupdateRefStore(flexResizePanelStore, newRefs);\r\n};\r\n\r\nexport const getLayoutInfos = (layoutName: string) => {\r\n\treturn combineLatest([flexContainerStore, flexResizePanelStore]).pipe(\r\n\t\tmap(([containerRefs, resizePanelRefs]) => {\r\n\t\t\t// 두 Store에서 layoutName에 해당하는 값을 병합\r\n\t\t\tconst containerData = containerRefs[layoutName] || {};\r\n\t\t\tconst resizePanelData = resizePanelRefs[layoutName] || {};\r\n\r\n\t\t\t// container와 resizePanel 데이터 합치기\r\n\t\t\treturn {\r\n\t\t\t\tcontainer: containerData,\r\n\t\t\t\tresizePanel: resizePanelData,\r\n\t\t\t};\r\n\t\t}),\r\n\t\tfilter((result) => result.container !== null), // 빈 객체 제외\r\n\t);\r\n};\r\n\r\n// 특정 containerName의 ref를 구독하는 함수\r\n// layoutName이 지정되지 않으면 전체 layout에서 해당하는 containerName의 ref를 찾음\r\nexport const getContainerRef = ({\r\n\tcontainerName,\r\n\tlayoutName,\r\n}: {\r\n\tcontainerName: string;\r\n\tlayoutName?: string;\r\n}) => {\r\n\treturn flexContainerStore.pipe(\r\n\t\tmap((refs: RefStore) => {\r\n\t\t\tif (layoutName) {\r\n\t\t\t\t// 지정된 layoutName에서 해당 containerName의 ref 반환\r\n\t\t\t\treturn refs[layoutName]?.[containerName] || null;\r\n\t\t\t} else {\r\n\t\t\t\t// 모든 layout에서 해당 containerName의 ref 찾기\r\n\t\t\t\treturn Object.entries(refs).find(\r\n\t\t\t\t\t([key, value]) => refs[key][containerName],\r\n\t\t\t\t)?.[1][containerName];\r\n\t\t\t}\r\n\t\t\t// else {\r\n\t\t\t// // 모든 layout에서 해당 containerName의 ref 찾기\r\n\t\t\t// for (const layout in refs) {\r\n\t\t\t// if (refs[layout][containerName]) {\r\n\t\t\t// return refs[layout][containerName];\r\n\t\t\t// }\r\n\t\t\t// }\r\n\t\t\t// return null;\r\n\t\t\t// }\r\n\t\t}),\r\n\t\tfilter((ref) => ref !== null),\r\n\t);\r\n};\r\n\r\nexport const getResizePanelRef = ({\r\n\tcontainerName,\r\n\tlayoutName,\r\n}: {\r\n\tcontainerName: string;\r\n\tlayoutName?: string;\r\n}) => {\r\n\treturn flexResizePanelStore.pipe(\r\n\t\tmap((refs: RefStore) => {\r\n\t\t\tif (layoutName) {\r\n\t\t\t\t// 지정된 layoutName에서 해당 containerName의 ref 반환\r\n\t\t\t\treturn refs[layoutName]?.[containerName] || null;\r\n\t\t\t} else {\r\n\t\t\t\t// 모든 layout에서 해당 containerName의 ref 찾기\r\n\t\t\t\treturn Object.entries(refs).find(\r\n\t\t\t\t\t([key, value]) => refs[key][containerName],\r\n\t\t\t\t)?.[1][containerName];\r\n\t\t\t}\r\n\t\t\t// else {\r\n\t\t\t// // 모든 layout에서 해당 containerName의 ref 찾기\r\n\t\t\t// for (const layout in refs) {\r\n\t\t\t// if (refs[layout][containerName]) {\r\n\t\t\t// return refs[layout][containerName];\r\n\t\t\t// }\r\n\t\t\t// }\r\n\t\t\t// return null;\r\n\t\t\t// }\r\n\t\t}),\r\n\t\tfilter((ref) => ref !== null),\r\n\t);\r\n};\r\n"]}
@@ -0,0 +1,67 @@
1
+ import * as rxjs from 'rxjs';
2
+ import { BehaviorSubject } from 'rxjs';
3
+ import { RefObject } from 'react';
4
+ import { d as DropTargetComponent } from './useDrag-CYQnhUFk.cjs';
5
+ import './FlexLayoutSplitScreenDragBox-eCtq4kLd.cjs';
6
+ import 'react/jsx-runtime';
7
+
8
+ interface ScrollPosition {
9
+ x: number;
10
+ y: number;
11
+ }
12
+ declare const scrollPositions: Record<string, ScrollPosition>;
13
+ /**
14
+ * 스크롤 위치 업데이트 함수
15
+ *
16
+ * 기존: 항상 store.next()가 호출됨 → 바뀌지 않았다면 건너뛰도록 변경
17
+ */
18
+ declare const setScrollPosition: (layoutName: string, position: ScrollPosition) => void;
19
+ /**
20
+ * 스크롤 위치 구독
21
+ */
22
+ declare const getScrollPosition: (layoutName: string) => rxjs.Observable<ScrollPosition>;
23
+ declare const removeScrollPosition: (layoutName: string) => void;
24
+ type SplitScreenComponents = {
25
+ afterDropTargetComponent: DropTargetComponent[];
26
+ beforeDropTargetComponent: DropTargetComponent[];
27
+ centerDropTargetComponent: DropTargetComponent[];
28
+ direction: "row" | "column";
29
+ };
30
+ type LayoutSplitScreenState = Record<string, Record<string, SplitScreenComponents>>;
31
+ declare const layoutSplitScreenStore: BehaviorSubject<LayoutSplitScreenState>;
32
+ declare const setSplitScreen: (rootName: string, layoutName: string, newComponents: SplitScreenComponents) => void;
33
+ declare const resetRootSplitScreen: (rootName: string) => void;
34
+ declare const removeSplitScreenChild: (rootName: string, layoutName: string) => void;
35
+ declare const getCurrentSplitScreenComponents: (rootName: string, layoutName: string) => SplitScreenComponents | undefined;
36
+ declare const getSplitScreen: (rootName: string, layoutName: string) => rxjs.Observable<SplitScreenComponents>;
37
+ type RefStore = {
38
+ [layoutName: string]: {
39
+ [containerName: string]: RefObject<HTMLElement | null>;
40
+ };
41
+ };
42
+ declare const flexContainerStore: BehaviorSubject<RefStore>;
43
+ declare const flexResizePanelStore: BehaviorSubject<RefStore>;
44
+ /**
45
+ * ref를 업데이트하는 함수
46
+ * - 기존: 무조건 next() → 새/이전 상태 비교 후 다를 경우에만 next()
47
+ */
48
+ declare const setContainerRef: <T extends HTMLElement>(layoutName: string, containerName: string, ref: React.RefObject<T | null> | null) => void;
49
+ declare const setResizePanelRef: <T extends HTMLElement>(layoutName: string, containerName: string, ref: React.RefObject<T | null> | null) => void;
50
+ declare const getLayoutInfos: (layoutName: string) => rxjs.Observable<{
51
+ container: {
52
+ [containerName: string]: RefObject<HTMLElement | null>;
53
+ };
54
+ resizePanel: {
55
+ [containerName: string]: RefObject<HTMLElement | null>;
56
+ };
57
+ }>;
58
+ declare const getContainerRef: ({ containerName, layoutName, }: {
59
+ containerName: string;
60
+ layoutName?: string;
61
+ }) => rxjs.Observable<RefObject<HTMLElement | null> | undefined>;
62
+ declare const getResizePanelRef: ({ containerName, layoutName, }: {
63
+ containerName: string;
64
+ layoutName?: string;
65
+ }) => rxjs.Observable<RefObject<HTMLElement | null> | undefined>;
66
+
67
+ export { type LayoutSplitScreenState, type ScrollPosition, type SplitScreenComponents, flexContainerStore, flexResizePanelStore, getContainerRef, getCurrentSplitScreenComponents, getLayoutInfos, getResizePanelRef, getScrollPosition, getSplitScreen, layoutSplitScreenStore, removeScrollPosition, removeSplitScreenChild, resetRootSplitScreen, scrollPositions, setContainerRef, setResizePanelRef, setScrollPosition, setSplitScreen };
@@ -0,0 +1,67 @@
1
+ import * as rxjs from 'rxjs';
2
+ import { BehaviorSubject } from 'rxjs';
3
+ import { RefObject } from 'react';
4
+ import { d as DropTargetComponent } from './useDrag-DR01Ob3s.js';
5
+ import './FlexLayoutSplitScreenDragBox-eCtq4kLd.js';
6
+ import 'react/jsx-runtime';
7
+
8
+ interface ScrollPosition {
9
+ x: number;
10
+ y: number;
11
+ }
12
+ declare const scrollPositions: Record<string, ScrollPosition>;
13
+ /**
14
+ * 스크롤 위치 업데이트 함수
15
+ *
16
+ * 기존: 항상 store.next()가 호출됨 → 바뀌지 않았다면 건너뛰도록 변경
17
+ */
18
+ declare const setScrollPosition: (layoutName: string, position: ScrollPosition) => void;
19
+ /**
20
+ * 스크롤 위치 구독
21
+ */
22
+ declare const getScrollPosition: (layoutName: string) => rxjs.Observable<ScrollPosition>;
23
+ declare const removeScrollPosition: (layoutName: string) => void;
24
+ type SplitScreenComponents = {
25
+ afterDropTargetComponent: DropTargetComponent[];
26
+ beforeDropTargetComponent: DropTargetComponent[];
27
+ centerDropTargetComponent: DropTargetComponent[];
28
+ direction: "row" | "column";
29
+ };
30
+ type LayoutSplitScreenState = Record<string, Record<string, SplitScreenComponents>>;
31
+ declare const layoutSplitScreenStore: BehaviorSubject<LayoutSplitScreenState>;
32
+ declare const setSplitScreen: (rootName: string, layoutName: string, newComponents: SplitScreenComponents) => void;
33
+ declare const resetRootSplitScreen: (rootName: string) => void;
34
+ declare const removeSplitScreenChild: (rootName: string, layoutName: string) => void;
35
+ declare const getCurrentSplitScreenComponents: (rootName: string, layoutName: string) => SplitScreenComponents | undefined;
36
+ declare const getSplitScreen: (rootName: string, layoutName: string) => rxjs.Observable<SplitScreenComponents>;
37
+ type RefStore = {
38
+ [layoutName: string]: {
39
+ [containerName: string]: RefObject<HTMLElement | null>;
40
+ };
41
+ };
42
+ declare const flexContainerStore: BehaviorSubject<RefStore>;
43
+ declare const flexResizePanelStore: BehaviorSubject<RefStore>;
44
+ /**
45
+ * ref를 업데이트하는 함수
46
+ * - 기존: 무조건 next() → 새/이전 상태 비교 후 다를 경우에만 next()
47
+ */
48
+ declare const setContainerRef: <T extends HTMLElement>(layoutName: string, containerName: string, ref: React.RefObject<T | null> | null) => void;
49
+ declare const setResizePanelRef: <T extends HTMLElement>(layoutName: string, containerName: string, ref: React.RefObject<T | null> | null) => void;
50
+ declare const getLayoutInfos: (layoutName: string) => rxjs.Observable<{
51
+ container: {
52
+ [containerName: string]: RefObject<HTMLElement | null>;
53
+ };
54
+ resizePanel: {
55
+ [containerName: string]: RefObject<HTMLElement | null>;
56
+ };
57
+ }>;
58
+ declare const getContainerRef: ({ containerName, layoutName, }: {
59
+ containerName: string;
60
+ layoutName?: string;
61
+ }) => rxjs.Observable<RefObject<HTMLElement | null> | undefined>;
62
+ declare const getResizePanelRef: ({ containerName, layoutName, }: {
63
+ containerName: string;
64
+ layoutName?: string;
65
+ }) => rxjs.Observable<RefObject<HTMLElement | null> | undefined>;
66
+
67
+ export { type LayoutSplitScreenState, type ScrollPosition, type SplitScreenComponents, flexContainerStore, flexResizePanelStore, getContainerRef, getCurrentSplitScreenComponents, getLayoutInfos, getResizePanelRef, getScrollPosition, getSplitScreen, layoutSplitScreenStore, removeScrollPosition, removeSplitScreenChild, resetRootSplitScreen, scrollPositions, setContainerRef, setResizePanelRef, setScrollPosition, setSplitScreen };
package/dist/store.js ADDED
@@ -0,0 +1,4 @@
1
+ import './chunk-YIHCWXKY.js';
2
+ export { flexContainerStore, flexResizePanelStore, getContainerRef, getCurrentSplitScreenComponents, getLayoutInfos, getResizePanelRef, getScrollPosition, getSplitScreen, layoutSplitScreenStore, removeScrollPosition, removeSplitScreenChild, resetRootSplitScreen, scrollPositions, setContainerRef, setResizePanelRef, setScrollPosition, setSplitScreen } from './chunk-CFQQ6ZDC.js';
3
+ //# sourceMappingURL=store.js.map
4
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"store.js"}
@@ -0,0 +1,108 @@
1
+ import { ReactElement, RefObject } from 'react';
2
+ import { BehaviorSubject, Subject } from 'rxjs';
3
+ import { D as DropDocumentOutsideOption } from './FlexLayoutSplitScreenDragBox-eCtq4kLd.cjs';
4
+
5
+ interface DragStateType {
6
+ isDragging: boolean;
7
+ isDrop: boolean;
8
+ navigationTitle?: string;
9
+ children?: ReactElement;
10
+ containerName: string;
11
+ x: number;
12
+ y: number;
13
+ dropDocumentOutsideOption?: DropDocumentOutsideOption;
14
+ dropEndCallback?: ({ x, y, containerName, }: {
15
+ x: number;
16
+ y: number;
17
+ containerName: string;
18
+ }) => void;
19
+ screenKey?: string;
20
+ customData?: Record<string, string | number | boolean | undefined>;
21
+ }
22
+ type PositionName = "centerBoundary" | "leftBoundary" | "rightBoundary" | "topBoundary" | "bottomBoundary";
23
+ interface DragStateResultType extends DragStateType {
24
+ positionName: PositionName;
25
+ isOver: boolean;
26
+ }
27
+ declare const dragState: Subject<DragStateType>;
28
+ declare const useDragCapture: (targetRef: RefObject<HTMLElement | null>) => DragStateResultType | null;
29
+ interface DropTargetComponent {
30
+ containerName: string;
31
+ component: ReactElement;
32
+ navigationTitle?: string;
33
+ dropDocumentOutsideOption?: DropDocumentOutsideOption;
34
+ screenKey: string;
35
+ }
36
+ type DropPositionOrderName = "before" | "center" | "after";
37
+ interface DropMovementEventType {
38
+ state: "remove" | "append" | "change";
39
+ targetParentLayoutName: string;
40
+ targetLayoutName: string;
41
+ targetContainerName: string;
42
+ targetComponent?: ReactElement;
43
+ nextContainerName?: string;
44
+ parentOrderName?: DropPositionOrderName;
45
+ orderName?: DropPositionOrderName;
46
+ x?: number;
47
+ y?: number;
48
+ dropEndCallback?: ({ x, y, containerName, }: {
49
+ x: number;
50
+ y: number;
51
+ containerName: string;
52
+ }) => void;
53
+ dropTargetComponentEvent?: DropTargetComponentEvent;
54
+ }
55
+ interface DropTargetComponentEvent extends Omit<DropTargetComponent, "containerName" | "component"> {
56
+ direction: "row" | "column";
57
+ }
58
+ declare const dropMovementEventSubject: Subject<DropMovementEventType>;
59
+ declare const allSplitScreenCount: BehaviorSubject<number>;
60
+ declare const useDragEvents: ({ isBlockingActiveInput, }: {
61
+ isBlockingActiveInput?: boolean;
62
+ }) => {
63
+ handleStart: ({ event: _event, dragStartCallback, }: {
64
+ event: React.MouseEvent | React.TouchEvent | Event;
65
+ dragStartCallback: ({ x, y }: {
66
+ x: number;
67
+ y: number;
68
+ }) => void;
69
+ }) => void;
70
+ handleMove: ({ event: _event, notDragCallback, dragStartCallback, moveingCallback, }: {
71
+ event: React.MouseEvent | React.TouchEvent | Event;
72
+ notDragCallback?: ({ x, y }: {
73
+ x: number;
74
+ y: number;
75
+ }) => void;
76
+ dragStartCallback: ({ x, y }: {
77
+ x: number;
78
+ y: number;
79
+ }) => void;
80
+ moveingCallback: ({ x, y }: {
81
+ x: number;
82
+ y: number;
83
+ }) => void;
84
+ }) => void;
85
+ handleEnd: ({ event: _event, dragEndCallback, }: {
86
+ event: React.MouseEvent | React.TouchEvent | Event;
87
+ dragEndCallback: ({ x, y }: {
88
+ x: number;
89
+ y: number;
90
+ }) => void;
91
+ }) => void;
92
+ };
93
+ type FolderEventType = {
94
+ type: "new" | "sort" | "title" | "delete" | "insert" | "update" | "next";
95
+ isFolder: boolean;
96
+ title: string;
97
+ sort?: number;
98
+ parentId?: string;
99
+ id?: string;
100
+ newData?: any;
101
+ };
102
+ declare const folderEventSubject: Subject<FolderEventType>;
103
+ declare const setFolderEvent: (newValue: FolderEventType) => void;
104
+ declare const useFolderEvent: () => {
105
+ folderEvent: FolderEventType | null;
106
+ };
107
+
108
+ export { type DragStateResultType as D, type FolderEventType as F, type PositionName as P, type DragStateType as a, type DropMovementEventType as b, type DropPositionOrderName as c, type DropTargetComponent as d, type DropTargetComponentEvent as e, allSplitScreenCount as f, dragState as g, dropMovementEventSubject as h, folderEventSubject as i, useDragEvents as j, useFolderEvent as k, setFolderEvent as s, useDragCapture as u };
@@ -0,0 +1,108 @@
1
+ import { ReactElement, RefObject } from 'react';
2
+ import { BehaviorSubject, Subject } from 'rxjs';
3
+ import { D as DropDocumentOutsideOption } from './FlexLayoutSplitScreenDragBox-eCtq4kLd.js';
4
+
5
+ interface DragStateType {
6
+ isDragging: boolean;
7
+ isDrop: boolean;
8
+ navigationTitle?: string;
9
+ children?: ReactElement;
10
+ containerName: string;
11
+ x: number;
12
+ y: number;
13
+ dropDocumentOutsideOption?: DropDocumentOutsideOption;
14
+ dropEndCallback?: ({ x, y, containerName, }: {
15
+ x: number;
16
+ y: number;
17
+ containerName: string;
18
+ }) => void;
19
+ screenKey?: string;
20
+ customData?: Record<string, string | number | boolean | undefined>;
21
+ }
22
+ type PositionName = "centerBoundary" | "leftBoundary" | "rightBoundary" | "topBoundary" | "bottomBoundary";
23
+ interface DragStateResultType extends DragStateType {
24
+ positionName: PositionName;
25
+ isOver: boolean;
26
+ }
27
+ declare const dragState: Subject<DragStateType>;
28
+ declare const useDragCapture: (targetRef: RefObject<HTMLElement | null>) => DragStateResultType | null;
29
+ interface DropTargetComponent {
30
+ containerName: string;
31
+ component: ReactElement;
32
+ navigationTitle?: string;
33
+ dropDocumentOutsideOption?: DropDocumentOutsideOption;
34
+ screenKey: string;
35
+ }
36
+ type DropPositionOrderName = "before" | "center" | "after";
37
+ interface DropMovementEventType {
38
+ state: "remove" | "append" | "change";
39
+ targetParentLayoutName: string;
40
+ targetLayoutName: string;
41
+ targetContainerName: string;
42
+ targetComponent?: ReactElement;
43
+ nextContainerName?: string;
44
+ parentOrderName?: DropPositionOrderName;
45
+ orderName?: DropPositionOrderName;
46
+ x?: number;
47
+ y?: number;
48
+ dropEndCallback?: ({ x, y, containerName, }: {
49
+ x: number;
50
+ y: number;
51
+ containerName: string;
52
+ }) => void;
53
+ dropTargetComponentEvent?: DropTargetComponentEvent;
54
+ }
55
+ interface DropTargetComponentEvent extends Omit<DropTargetComponent, "containerName" | "component"> {
56
+ direction: "row" | "column";
57
+ }
58
+ declare const dropMovementEventSubject: Subject<DropMovementEventType>;
59
+ declare const allSplitScreenCount: BehaviorSubject<number>;
60
+ declare const useDragEvents: ({ isBlockingActiveInput, }: {
61
+ isBlockingActiveInput?: boolean;
62
+ }) => {
63
+ handleStart: ({ event: _event, dragStartCallback, }: {
64
+ event: React.MouseEvent | React.TouchEvent | Event;
65
+ dragStartCallback: ({ x, y }: {
66
+ x: number;
67
+ y: number;
68
+ }) => void;
69
+ }) => void;
70
+ handleMove: ({ event: _event, notDragCallback, dragStartCallback, moveingCallback, }: {
71
+ event: React.MouseEvent | React.TouchEvent | Event;
72
+ notDragCallback?: ({ x, y }: {
73
+ x: number;
74
+ y: number;
75
+ }) => void;
76
+ dragStartCallback: ({ x, y }: {
77
+ x: number;
78
+ y: number;
79
+ }) => void;
80
+ moveingCallback: ({ x, y }: {
81
+ x: number;
82
+ y: number;
83
+ }) => void;
84
+ }) => void;
85
+ handleEnd: ({ event: _event, dragEndCallback, }: {
86
+ event: React.MouseEvent | React.TouchEvent | Event;
87
+ dragEndCallback: ({ x, y }: {
88
+ x: number;
89
+ y: number;
90
+ }) => void;
91
+ }) => void;
92
+ };
93
+ type FolderEventType = {
94
+ type: "new" | "sort" | "title" | "delete" | "insert" | "update" | "next";
95
+ isFolder: boolean;
96
+ title: string;
97
+ sort?: number;
98
+ parentId?: string;
99
+ id?: string;
100
+ newData?: any;
101
+ };
102
+ declare const folderEventSubject: Subject<FolderEventType>;
103
+ declare const setFolderEvent: (newValue: FolderEventType) => void;
104
+ declare const useFolderEvent: () => {
105
+ folderEvent: FolderEventType | null;
106
+ };
107
+
108
+ export { type DragStateResultType as D, type FolderEventType as F, type PositionName as P, type DragStateType as a, type DropMovementEventType as b, type DropPositionOrderName as c, type DropTargetComponent as d, type DropTargetComponentEvent as e, allSplitScreenCount as f, dragState as g, dropMovementEventSubject as h, folderEventSubject as i, useDragEvents as j, useFolderEvent as k, setFolderEvent as s, useDragCapture as u };