@byeolnaerim/flex-layout 0.0.2 → 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.
- package/dist/FlexLayoutSplitScreenDragBox-eCtq4kLd.d.cts +31 -0
- package/dist/FlexLayoutSplitScreenDragBox-eCtq4kLd.d.ts +31 -0
- package/dist/chunk-3EDKZTM3.js +3 -0
- package/dist/chunk-3EDKZTM3.js.map +1 -0
- package/dist/chunk-5HWEFTNQ.js +176 -0
- package/dist/chunk-5HWEFTNQ.js.map +1 -0
- package/dist/chunk-7J5JUVZK.js +3 -0
- package/dist/chunk-7J5JUVZK.js.map +1 -0
- package/dist/chunk-CFQQ6ZDC.js +182 -0
- package/dist/chunk-CFQQ6ZDC.js.map +1 -0
- package/dist/chunk-JM3CZ5DU.js +238 -0
- package/dist/chunk-JM3CZ5DU.js.map +1 -0
- package/dist/chunk-PMTZFSP4.js +219 -0
- package/dist/chunk-PMTZFSP4.js.map +1 -0
- package/dist/chunk-UYI4Z27V.js +2432 -0
- package/dist/chunk-UYI4Z27V.js.map +1 -0
- package/dist/chunk-W4CNFJTK.js +197 -0
- package/dist/chunk-W4CNFJTK.js.map +1 -0
- package/dist/chunk-YIHCWXKY.js +3 -0
- package/dist/chunk-YIHCWXKY.js.map +1 -0
- package/dist/components.cjs +3048 -0
- package/dist/components.cjs.map +1 -0
- package/dist/components.css +471 -0
- package/dist/components.css.map +1 -0
- package/dist/components.d.cts +122 -0
- package/dist/components.d.ts +122 -0
- package/dist/components.js +7 -0
- package/dist/components.js.map +1 -0
- package/dist/hooks.cjs +425 -0
- package/dist/hooks.cjs.map +1 -0
- package/dist/hooks.d.cts +37 -0
- package/dist/hooks.d.ts +37 -0
- package/dist/hooks.js +5 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.cjs +2600 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -287
- package/dist/index.d.ts +10 -287
- package/dist/index.js +9 -814
- package/dist/index.js.map +1 -1
- package/dist/providers.cjs +411 -0
- package/dist/providers.cjs.map +1 -0
- package/dist/providers.d.cts +54 -0
- package/dist/providers.d.ts +54 -0
- package/dist/providers.js +6 -0
- package/dist/providers.js.map +1 -0
- package/dist/store.cjs +204 -0
- package/dist/store.cjs.map +1 -0
- package/dist/store.d.cts +67 -0
- package/dist/store.d.ts +67 -0
- package/dist/store.js +4 -0
- package/dist/store.js.map +1 -0
- package/dist/useDrag-CYQnhUFk.d.cts +108 -0
- package/dist/useDrag-DR01Ob3s.d.ts +108 -0
- package/dist/utils.cjs +209 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +28 -0
- package/dist/utils.d.ts +28 -0
- package/dist/utils.js +4 -0
- package/dist/utils.js.map +1 -0
- package/package.json +25 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/flex-layout/store/FlexLayoutContainerStore.ts","../src/flex-layout/utils/FlexLayoutUtils.ts","../src/flex-layout/providers/FlexLayoutHooks.tsx"],"names":["BehaviorSubject","combineLatest","map","filter","e","Subject","useState","useEffect","switchMap","EMPTY","fromEvent","buffer","debounceTime"],"mappings":";;;;;;;;AA2CO,IAAM,kBAAkD,EAAC;AAEjC,IAAIA,oBAAA,CAEjC,eAAe;AAgEhB,IAAIA,oBAAA,CAAwC,EAAE;AA8ExC,IAAM,kBAAA,GAAqB,IAAIA,oBAAA,CAA0B,EAAE,CAAA;AAE3D,IAAM,oBAAA,GAAuB,IAAIA,oBAAA,CAA0B,EAAE,CAAA;AAiD7D,IAAM,cAAA,GAAiB,CAAC,UAAA,KAAuB;AACrD,EAAA,OAAOC,kBAAA,CAAc,CAAC,kBAAA,EAAoB,oBAAoB,CAAC,CAAA,CAAE,IAAA;AAAA,IAChEC,aAAA,CAAI,CAAC,CAAC,aAAA,EAAe,eAAe,CAAA,KAAM;AAEzC,MAAA,MAAM,aAAA,GAAgB,aAAA,CAAc,UAAU,CAAA,IAAK,EAAC;AACpD,MAA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YAAA,IAAI,GAAA,CAAI,MAAA,EAAQ,GAAA,CAAI,MAAA,EAAO;AAC3B,YAAA,SAAA,CAAU,IAAI,CAAA;AACd,YAAA,gBAAA,CAAiB,IAAI,CAAA;AAAA,UACtB;AAAA,SACA,CAAA;AAAA,MACF,CAAC;AAAA,MAED,SAAA,EAAU;AACZ,IAAA,OAAO,MAAM;AACZ,MAAA,SAAA,CAAU,WAAA,EAAY;AAAA,IACvB,CAAA;AAAA,EACD,CAAA,EAAG,CAAC,aAAa,CAAC,CAAA;AAClB,EAAA,OAAO,EAAE,MAAA,EAAQ,aAAA,EAAe,gBAAA,EAAiB;AAClD","file":"providers.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","export function isDocumentOut({ x, y }: { x: number; y: number }) {\r\n if (typeof window == 'undefined') return;\r\n const { innerWidth, innerHeight, scrollX, scrollY } = window;\r\n\r\n return (\r\n x < 0 || y < 0 || x > innerWidth + scrollX || y > innerHeight + scrollY\r\n );\r\n}\r\n\r\nlet lastTouchEvent: globalThis.TouchEvent;\r\nexport function getClientXy(event: Event) {\r\n let clientX: number;\r\n let clientY: number;\r\n if (window.MouseEvent && event instanceof window.MouseEvent) {\r\n clientX = event.clientX;\r\n clientY = event.clientY;\r\n } else if (window.TouchEvent && event instanceof window.TouchEvent) {\r\n const _event = event.touches.length == 0 ? lastTouchEvent : event;\r\n clientX = _event!.touches[0].clientX;\r\n clientY = _event!.touches[0].clientY;\r\n lastTouchEvent = event;\r\n } else {\r\n return; // 해당 이벤트 타입이 MouseEvent나 TouchEvent가 아니라면 무시\r\n }\r\n return { clientX, clientY };\r\n}\r\n\r\nexport function isOverMove(elementSize: number, elementMinSize: number) {\r\n return (\r\n Math.floor(elementSize) <= 0 ||\r\n (isNaN(elementMinSize)\r\n ? false\r\n : elementMinSize >= Math.floor(elementSize))\r\n );\r\n}\r\n\r\nexport function findNotCloseFlexContent(\r\n target: HTMLElement | Element | null,\r\n direction: 'previousElementSibling' | 'nextElementSibling'\r\n) {\r\n if (!target) return target;\r\n let _target = target as HTMLElement;\r\n const isCloseCheck = () => {\r\n let grow =\r\n parseFloat(window.getComputedStyle(_target).flex.split(' ')[0]) ||\r\n 0;\r\n if (grow == 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n };\r\n while (isCloseCheck()) {\r\n let nextTarget = _target[direction]?.[direction];\r\n _target = nextTarget as HTMLElement;\r\n if (!_target) {\r\n break;\r\n }\r\n }\r\n return _target as HTMLElement | HTMLDivElement | null;\r\n}\r\n\r\nexport function remain(flexContainerList: Array<HTMLElement>) {\r\n return new Promise(resolve => {\r\n let notGrowList: Array<HTMLElement> = [];\r\n let totalGrow = flexContainerList.reduce((t, e, i) => {\r\n if (e.hasAttribute('data-grow') == false) {\r\n notGrowList.push(e);\r\n return t;\r\n }\r\n let grow = parseFloat(e.dataset.grow || '');\r\n e.style.flex = `${grow} 1 0%`;\r\n t -= grow;\r\n return t;\r\n }, flexContainerList.length);\r\n\r\n if (notGrowList.length != 0) {\r\n resize(notGrowList, totalGrow);\r\n }\r\n\r\n resolve(flexContainerList);\r\n });\r\n}\r\n\r\nexport function resize(list: Array<HTMLElement>, totalGrow: number) {\r\n return new Promise(resolve => {\r\n // totalGrow 값을 리스트의 개수로 나누어 균등 할당\r\n let resizeWeight = totalGrow / list.length;\r\n list.forEach(e => {\r\n e.dataset.grow = resizeWeight.toString();\r\n e.style.flex = `${resizeWeight} 1 0%`;\r\n });\r\n resolve(resizeWeight);\r\n });\r\n}\r\n\r\nexport function mathWeight(totalCount: number, totalGrow: number) {\r\n return 1 + (totalGrow - totalCount) / totalCount;\r\n}\r\nexport function mathGrow(\r\n childSize: number,\r\n parentSize: number,\r\n containerCount: number\r\n) {\r\n return containerCount * (childSize / parentSize);\r\n}\r\n\r\nexport function getGrow(growTarget: HTMLElement | Element) {\r\n const target =\r\n growTarget instanceof Element\r\n ? (growTarget as HTMLElement)\r\n : growTarget;\r\n return (\r\n parseFloat(target.style.flex.split(' ')[0]) ||\r\n parseFloat(target.dataset.grow || '')\r\n );\r\n}\r\n\r\nexport function closeFlex(\r\n resizeTarget: HTMLElement,\r\n containers: HTMLElement[],\r\n {\r\n isResize = false,\r\n isDsiabledResizePanel = false,\r\n sizeName,\r\n }: {\r\n isResize?: boolean;\r\n isDsiabledResizePanel?: boolean;\r\n sizeName: 'width' | 'height';\r\n }\r\n) {\r\n return new Promise(resolve => {\r\n if (!resizeTarget.hasAttribute('data-is_resize_panel')) {\r\n // resolve(resizeTarget);\r\n // return;\r\n } else if (isDsiabledResizePanel) {\r\n resizeTarget.dataset.is_resize_panel = 'false';\r\n }\r\n\r\n resizeTarget.dataset.prev_grow = getGrow(resizeTarget).toString();\r\n\r\n let notCloseList = containers.filter(\r\n e => e.style.flex != '0 1 0%' && e != resizeTarget\r\n );\r\n let notCloseAndOpenTargetList = [...notCloseList, resizeTarget];\r\n //let resizeWeight = this.mathWeight(notCloseList, this.#forResizeList.length);\r\n notCloseAndOpenTargetList.forEach(e => {\r\n e.style.transition = 'flex 0.5s';\r\n e.ontransitionend = event => {\r\n if (event.propertyName != 'flex-grow') {\r\n return;\r\n }\r\n notCloseAndOpenTargetList.forEach(\r\n e => (e.style.transition = '')\r\n );\r\n //e.style.transition = '';\r\n e.ontransitionend = () => {};\r\n };\r\n\r\n if (e == resizeTarget) {\r\n e.dataset.grow = '0';\r\n e.style.flex = `0 1 0%`;\r\n return;\r\n }\r\n\r\n if (isResize) {\r\n return;\r\n }\r\n\r\n let percent = getGrow(e) / containers.length;\r\n //let percentWeight = this.#forResizeList.length * percent;\r\n //let remainWeight = resizeWeight * percent;\r\n if (notCloseList.length == 1) {\r\n e.dataset.grow = containers.length.toString();\r\n e.style.flex = `${containers.length} 1 0%`;\r\n return;\r\n }\r\n e.dataset.grow = (containers.length * percent).toString();\r\n e.style.flex = `${containers.length * percent} 1 0%`;\r\n });\r\n\r\n if (isResize) {\r\n resize(notCloseList, containers.length);\r\n }\r\n\r\n resolve(resizeTarget);\r\n });\r\n}\r\n\r\nexport function openFlex(\r\n resizeTarget: HTMLElement,\r\n containers: HTMLElement[],\r\n {\r\n isPrevSizeOpen = false,\r\n isResize = false,\r\n openGrowImportant = 0,\r\n sizeName,\r\n }: {\r\n isPrevSizeOpen?: boolean;\r\n isResize?: boolean;\r\n openGrowImportant?: number;\r\n sizeName?: 'width' | 'height'; // 유니언 타입으로 수정\r\n }\r\n) {\r\n return new Promise(resolve => {\r\n if (!resizeTarget.hasAttribute('data-is_resize_panel')) {\r\n // resolve(resizeTarget);\r\n // return;\r\n } else if (\r\n resizeTarget.hasAttribute('data-is_resize_panel') &&\r\n resizeTarget.dataset.is_resize_panel == 'false'\r\n ) {\r\n resizeTarget.dataset.is_resize_panel = 'true';\r\n }\r\n\r\n let notCloseList = containers.filter(\r\n e => e.style.flex != '0 1 0%' && e != resizeTarget\r\n );\r\n let notCloseAndOpenTargetList = [...notCloseList, resizeTarget];\r\n //let resizeWeight = this.mathWeight(notCloseAndOpenTargetList, this.#forResizeList.length);\r\n let openTargetGrow = 1;\r\n const sizeStyleName = ('client' +\r\n sizeName!.charAt(0).toUpperCase() +\r\n sizeName!.substring(1)) as 'clientHeight' | 'clientWidth';\r\n const parentSize =\r\n (sizeName &&\r\n resizeTarget.parentElement &&\r\n resizeTarget.parentElement[sizeStyleName]) ||\r\n 0;\r\n if (isPrevSizeOpen && resizeTarget.hasAttribute('data-prev_grow')) {\r\n openTargetGrow =\r\n parseFloat(resizeTarget.dataset.prev_grow || '1') || 1;\r\n //resizeTarget.removeAttribute('data-prev_grow');\r\n } else if (parentSize && parentSize !== 0) {\r\n openTargetGrow =\r\n (parentSize / notCloseList.length / (parentSize - 1)) *\r\n containers.length;\r\n } else {\r\n openTargetGrow = 1;\r\n }\r\n if (openGrowImportant) {\r\n openTargetGrow = openGrowImportant;\r\n }\r\n openTargetGrow = openTargetGrow === Infinity ? 1 : openTargetGrow;\r\n //notCloseList.forEach(e=>{\r\n notCloseAndOpenTargetList.forEach(e => {\r\n e.style.transition = 'flex 0.5s';\r\n e.ontransitionend = event => {\r\n if (event.propertyName != 'flex-grow') {\r\n return;\r\n }\r\n notCloseAndOpenTargetList.forEach(\r\n e => (e.style.transition = '')\r\n );\r\n //e.style.transition = '';\r\n e.ontransitionend = () => {};\r\n };\r\n\r\n if (e == resizeTarget) {\r\n resizeTarget.dataset.grow = openTargetGrow.toString();\r\n resizeTarget.style.flex = `${openTargetGrow} 1 0%`;\r\n return;\r\n }\r\n\r\n if (isResize) {\r\n return;\r\n }\r\n\r\n let grow =\r\n (parentSize / notCloseList.length / (parentSize - 1)) *\r\n (containers.length - openTargetGrow);\r\n grow = grow === Infinity ? 1 : grow;\r\n //let percent = getGrow(e) / totalGrow - openTargetGrow / totalGrow;\r\n e.dataset.grow = grow.toString();\r\n\r\n e.style.flex = `${grow} 1 0%`;\r\n });\r\n\r\n if (isResize) {\r\n resize(notCloseAndOpenTargetList, containers.length);\r\n }\r\n\r\n resolve(openTargetGrow);\r\n });\r\n}\r\n","\"use client\";\r\n\r\nimport { useEffect, useState } from \"react\";\r\nimport {\r\n\tflexContainerStore,\r\n\tgetLayoutInfos,\r\n\tgetResizePanelRef,\r\n} from \"../store/FlexLayoutContainerStore\";\r\nimport {\r\n\tcloseFlex,\r\n\tgetGrow,\r\n\tmathGrow,\r\n\topenFlex,\r\n} from \"../utils/FlexLayoutUtils\";\r\n\r\nimport {\r\n\tbuffer,\r\n\tdebounceTime,\r\n\tEMPTY,\r\n\tfilter,\r\n\tfromEvent,\r\n\tmap,\r\n\tSubject,\r\n\tswitchMap,\r\n} from \"rxjs\";\r\nconst g = globalThis as any;\r\ng.__FLEX_SUBJECTS__ ??= { openClose: {}, spread: {} };\r\n\r\nexport type SubjectMap<T> = Record<string, Subject<T>>;\r\n\r\n// 컨테이너 상태 타입 정의\r\ninterface ContainerStateRequest {\r\n\tmode: \"toggle\" | \"open\" | \"close\";\r\n\tinitOpenState?: boolean;\r\n\tonOpen?: () => void;\r\n\tonClose?: () => void;\r\n\topenOption?: {\r\n\t\tisPrevSizeOpen?: boolean;\r\n\t\tisResize?: boolean;\r\n\t\topenGrowImportant?: number;\r\n\t};\r\n\tcloseOption?: { isResize?: boolean; isDsiabledResizePanel?: boolean };\r\n}\r\n\r\ninterface ContainerState {\r\n\tisOpen: boolean;\r\n\ttargetContainer: HTMLElement;\r\n\tgrow: number;\r\n}\r\nexport const containerOpenCloseSubjectMap: SubjectMap<ContainerStateRequest> =\r\n\tg.__FLEX_SUBJECTS__.openClose;\r\nexport const containerSpreadSubjectMap: SubjectMap<ContainerState> =\r\n\tg.__FLEX_SUBJECTS__.spread;\r\n\r\n// export const containerOpenCloseSubjectMap: SubjectMap<ContainerStateRequest> = (\r\n// Object.keys({}) as Array<string>\r\n// ).reduce((total, key) => {\r\n// total[key] = new Subject<ContainerStateRequest>();\r\n// return total;\r\n// }, {} as SubjectMap<ContainerStateRequest>);\r\n\r\n// export const containerSpreadSubjectMap: SubjectMap<ContainerState> = (\r\n// Object.keys({}) as Array<string>\r\n// ).reduce((total, key) => {\r\n// total[key] = new Subject<ContainerState>();\r\n// return total;\r\n// }, {} as SubjectMap<ContainerState>);\r\n\r\nexport const ContainerOpenCloseProvider = ({\r\n\tlayoutName,\r\n\tcontainerName,\r\n\tsizeName,\r\n}: {\r\n\tlayoutName: string;\r\n\tcontainerName: string;\r\n\tsizeName: \"width\" | \"height\";\r\n}) => {\r\n\t// SubjectMap에 중복 체크 후 Subject 추가\r\n\tif (!containerOpenCloseSubjectMap[containerName]) {\r\n\t\tcontainerOpenCloseSubjectMap[containerName] =\r\n\t\t\tnew Subject<ContainerStateRequest>();\r\n\t}\r\n\tif (!containerSpreadSubjectMap[containerName]) {\r\n\t\tcontainerSpreadSubjectMap[containerName] =\r\n\t\t\tnew Subject<ContainerState>();\r\n\t}\r\n\r\n\tconst [containers, setContainers] = useState<HTMLElement[]>([]);\r\n\tconst [container, setContainer] = useState<HTMLElement>();\r\n\r\n\tuseEffect(() => {\r\n\t\t// 특정 layoutName과 containerName을 통해 ref를 구독\r\n\t\tconst subscription = getLayoutInfos(layoutName as string).subscribe(\r\n\t\t\t(layout) => {\r\n\t\t\t\tif (\r\n\t\t\t\t\t!layout ||\r\n\t\t\t\t\t!layout.container[containerName] ||\r\n\t\t\t\t\t!layout.container[containerName].current\r\n\t\t\t\t)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tsetContainers(\r\n\t\t\t\t\tObject.values(layout.container)\r\n\t\t\t\t\t\t.filter(\r\n\t\t\t\t\t\t\t(e): e is { current: HTMLElement } =>\r\n\t\t\t\t\t\t\t\te.current !== null,\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t\t.map((e) => e.current),\r\n\t\t\t\t);\r\n\t\t\t\tsetContainer(layout.container[containerName].current);\r\n\t\t\t},\r\n\t\t);\r\n\r\n\t\t// 구독 해제\r\n\t\treturn () => subscription.unsubscribe();\r\n\t}, [containerName, layoutName]);\r\n\tuseEffect(() => {\r\n\t\tconst styleName = `${sizeName.charAt(0).toUpperCase() + sizeName.substring(1)}`;\r\n\t\tconst clientSize = (\"client\" + styleName) as\r\n\t\t\t| \"clientWidth\"\r\n\t\t\t| \"clientHeight\";\r\n\t\tconst outerSize = (\"outer\" + styleName) as \"outerWidth\" | \"outerHeight\";\r\n\t\tconst maxSize = (\"max\" + styleName) as \"maxWidth\" | \"maxHeight\";\r\n\t\tconst subscribe = containerOpenCloseSubjectMap[containerName].subscribe(\r\n\t\t\t({\r\n\t\t\t\tmode,\r\n\t\t\t\tinitOpenState: isOpenState,\r\n\t\t\t\tonClose,\r\n\t\t\t\tonOpen,\r\n\t\t\t\topenOption = {},\r\n\t\t\t\tcloseOption = {},\r\n\t\t\t}) => {\r\n\t\t\t\tif (!container || containers.length === 0) return;\r\n\t\t\t\tconst currentGrow = getGrow(container);\r\n\t\t\t\tconst styleMap = window.getComputedStyle(container);\r\n\t\t\t\tconst maxSizeGrow = mathGrow(\r\n\t\t\t\t\tparseInt(styleMap[maxSize]),\r\n\t\t\t\t\t(container.parentElement &&\r\n\t\t\t\t\t\tcontainer.parentElement[clientSize]) ||\r\n\t\t\t\t\t\twindow[outerSize],\r\n\t\t\t\t\tcontainers.length,\r\n\t\t\t\t);\r\n\t\t\t\tconst open = () =>\r\n\t\t\t\t\topenFlex(container, containers, {\r\n\t\t\t\t\t\tsizeName,\r\n\t\t\t\t\t\t...(isNaN(maxSizeGrow)\r\n\t\t\t\t\t\t\t? {}\r\n\t\t\t\t\t\t\t: {\r\n\t\t\t\t\t\t\t\t\topenGrowImportant: maxSizeGrow,\r\n\t\t\t\t\t\t\t\t}),\r\n\t\t\t\t\t\t...openOption,\r\n\t\t\t\t\t}).then((openTargetGrow) => {\r\n\t\t\t\t\t\tif (onOpen) onOpen();\r\n\t\t\t\t\t\tcontainerSpreadSubjectMap[containerName].next({\r\n\t\t\t\t\t\t\tisOpen: true,\r\n\t\t\t\t\t\t\tgrow: openTargetGrow as any,\r\n\t\t\t\t\t\t\ttargetContainer: container,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\tconst close = () =>\r\n\t\t\t\t\tcloseFlex(container, containers, {\r\n\t\t\t\t\t\tsizeName,\r\n\t\t\t\t\t\t...closeOption,\r\n\t\t\t\t\t}).then(() => {\r\n\t\t\t\t\t\tif (onClose) onClose();\r\n\t\t\t\t\t\tcontainerSpreadSubjectMap[containerName].next({\r\n\t\t\t\t\t\t\tisOpen: false,\r\n\t\t\t\t\t\t\tgrow: 0,\r\n\t\t\t\t\t\t\ttargetContainer: container,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\tif (mode === \"toggle\") {\r\n\t\t\t\t\tif (currentGrow === 0) {\r\n\t\t\t\t\t\topen();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tclose();\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (mode === \"open\") {\r\n\t\t\t\t\tif (currentGrow === 0) {\r\n\t\t\t\t\t\topen();\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (mode === \"close\") {\r\n\t\t\t\t\tif (currentGrow !== 0) {\r\n\t\t\t\t\t\tclose();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t);\r\n\r\n\t\treturn () => {\r\n\t\t\tsubscribe.unsubscribe();\r\n\t\t};\r\n\t}, [containerName, container, containers, sizeName]);\r\n\r\n\treturn null;\r\n};\r\n\r\nexport const useContainers = (layoutName: string) => {\r\n\tconst [containers, setContainers] = useState<HTMLElement[]>([]);\r\n\r\n\tuseEffect(() => {\r\n\t\t// 특정 layoutName과 containerName을 통해 ref를 구독\r\n\t\tconst subscription = getLayoutInfos(layoutName as string).subscribe(\r\n\t\t\t(layout) => {\r\n\t\t\t\tsetContainers(\r\n\t\t\t\t\tObject.values(layout.container)\r\n\t\t\t\t\t\t.filter(\r\n\t\t\t\t\t\t\t(e): e is { current: HTMLElement } =>\r\n\t\t\t\t\t\t\t\te.current !== null,\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t\t.map((e) => e.current),\r\n\t\t\t\t);\r\n\t\t\t},\r\n\t\t);\r\n\r\n\t\t// 구독 해제\r\n\t\treturn () => subscription.unsubscribe();\r\n\t}, [layoutName]);\r\n\treturn containers;\r\n};\r\n\r\nexport const useLayoutName = (containerName: string) => {\r\n\tconst [layoutName, setLayoutName] = useState<string>();\r\n\tuseEffect(() => {\r\n\t\tconst subscribe = flexContainerStore\r\n\t\t\t.pipe(\r\n\t\t\t\tmap(\r\n\t\t\t\t\t(layouts) =>\r\n\t\t\t\t\t\tObject.entries(layouts)\r\n\t\t\t\t\t\t\t.filter(([_, v]) => v[containerName])\r\n\t\t\t\t\t\t\t.map(([k]) => k)[0] as string, // 첫 번째 결과 가져오기\r\n\t\t\t\t),\r\n\t\t\t)\r\n\t\t\t.subscribe(setLayoutName);\r\n\r\n\t\t// 컴포넌트 언마운트 시 구독 해제\r\n\t\treturn () => subscribe.unsubscribe();\r\n\t}, [containerName]);\r\n\r\n\treturn layoutName;\r\n};\r\n\r\nexport const useDecompositionLayout = ({\r\n\tlayoutName: initialLayoutName,\r\n\tcontainerName,\r\n}: {\r\n\tlayoutName?: string;\r\n\tcontainerName: string;\r\n}) => {\r\n\tconst derivedLayoutName = useLayoutName(containerName);\r\n\tconst finalLayoutName = initialLayoutName || derivedLayoutName;\r\n\r\n\tconst [containers, setContainers] = useState<HTMLElement[]>([]);\r\n\tconst [container, setContainer] = useState<HTMLElement>();\r\n\tconst [resizePanel, setResizePanel] = useState<HTMLElement>();\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!finalLayoutName) return; // layoutName이 준비될 때까지 대기\r\n\t\t// 특정 layoutName과 containerName을 통해 ref를 구독\r\n\t\tconst subscription = getLayoutInfos(finalLayoutName).subscribe(\r\n\t\t\t(layout) => {\r\n\t\t\t\tif (!layout) return;\r\n\t\t\t\tsetContainers(\r\n\t\t\t\t\tObject.values(layout.container)\r\n\t\t\t\t\t\t.filter(\r\n\t\t\t\t\t\t\t(e): e is { current: HTMLElement } =>\r\n\t\t\t\t\t\t\t\te.current !== null,\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t\t.map((e) => e.current),\r\n\t\t\t\t);\r\n\t\t\t\tif (\r\n\t\t\t\t\tcontainerName &&\r\n\t\t\t\t\tlayout.container[containerName] &&\r\n\t\t\t\t\tlayout.container[containerName].current\r\n\t\t\t\t) {\r\n\t\t\t\t\tsetContainer(layout.container[containerName].current);\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\tlayout.resizePanel[containerName] &&\r\n\t\t\t\t\t\tlayout.resizePanel[containerName].current\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tsetResizePanel(\r\n\t\t\t\t\t\t\tlayout.resizePanel[containerName].current,\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t);\r\n\r\n\t\t// 구독 해제\r\n\t\treturn () => subscription.unsubscribe();\r\n\t}, [containerName, finalLayoutName]);\r\n\r\n\treturn { layout: containers, container, resizePanel };\r\n};\r\n\r\nexport const useContainerSize = (containerName: string) => {\r\n\tconst { layout, container, resizePanel } = useDecompositionLayout({\r\n\t\tcontainerName,\r\n\t});\r\n\tconst [size, setSize] = useState<{ width: number; height: number }>();\r\n\tuseEffect(() => {\r\n\t\tif (!container) return;\r\n\t\tconst observer = new ResizeObserver((entries) => {\r\n\t\t\tfor (const entry of entries) {\r\n\t\t\t\tsetSize({\r\n\t\t\t\t\twidth: entry.contentRect.width,\r\n\t\t\t\t\theight: entry.contentRect.height,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\tobserver.observe(container);\r\n\t\treturn () => observer.disconnect();\r\n\t}, [container]);\r\n\treturn { size };\r\n};\r\n\r\nexport const useDoubleClick = (\r\n\tcontainerName: string,\r\n\topt: ContainerStateRequest,\r\n) => {\r\n\tconst [isOpen, setIsOpen] = useState<boolean>();\r\n\tconst [isDoubleClick, setIsDoubleClick] = useState<boolean>();\r\n\tuseEffect(() => {\r\n\t\tconst resizePanelClickEvent = getResizePanelRef({\r\n\t\t\tcontainerName,\r\n\t\t}).pipe(\r\n\t\t\tfilter(\r\n\t\t\t\t(resizePanelref) =>\r\n\t\t\t\t\tresizePanelref != undefined &&\r\n\t\t\t\t\tresizePanelref.current != undefined,\r\n\t\t\t),\r\n\t\t\t//take(1),\r\n\t\t\tswitchMap((resizePanelref) => {\r\n\t\t\t\tif (!resizePanelref || !resizePanelref.current) return EMPTY;\r\n\t\t\t\treturn fromEvent(resizePanelref.current, \"click\");\r\n\t\t\t}),\r\n\t\t);\r\n\t\tconst subscribe = resizePanelClickEvent\r\n\t\t\t.pipe(\r\n\t\t\t\tbuffer(resizePanelClickEvent.pipe(debounceTime(500))),\r\n\t\t\t\tfilter((clickEventArray) => clickEventArray.length >= 2),\r\n\t\t\t\tmap((events) => {\r\n\t\t\t\t\tcontainerOpenCloseSubjectMap[containerName].next({\r\n\t\t\t\t\t\t...opt,\r\n\t\t\t\t\t\topenOption: {\r\n\t\t\t\t\t\t\t...opt.openOption,\r\n\t\t\t\t\t\t\tisPrevSizeOpen: false,\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tonClose: () => {\r\n\t\t\t\t\t\t\tif (opt.onClose) opt.onClose();\r\n\t\t\t\t\t\t\tsetIsOpen(false);\r\n\t\t\t\t\t\t\tsetIsDoubleClick(true);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tonOpen: () => {\r\n\t\t\t\t\t\t\tif (opt.onOpen) opt.onOpen();\r\n\t\t\t\t\t\t\tsetIsOpen(true);\r\n\t\t\t\t\t\t\tsetIsDoubleClick(true);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t});\r\n\t\t\t\t}),\r\n\t\t\t)\r\n\t\t\t.subscribe();\r\n\t\treturn () => {\r\n\t\t\tsubscribe.unsubscribe();\r\n\t\t};\r\n\t}, [containerName]);\r\n\treturn { isOpen, isDoubleClick, setIsDoubleClick };\r\n};\r\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Subject } from 'rxjs';
|
|
3
|
+
|
|
4
|
+
type SubjectMap<T> = Record<string, Subject<T>>;
|
|
5
|
+
interface ContainerStateRequest {
|
|
6
|
+
mode: "toggle" | "open" | "close";
|
|
7
|
+
initOpenState?: boolean;
|
|
8
|
+
onOpen?: () => void;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
openOption?: {
|
|
11
|
+
isPrevSizeOpen?: boolean;
|
|
12
|
+
isResize?: boolean;
|
|
13
|
+
openGrowImportant?: number;
|
|
14
|
+
};
|
|
15
|
+
closeOption?: {
|
|
16
|
+
isResize?: boolean;
|
|
17
|
+
isDsiabledResizePanel?: boolean;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
interface ContainerState {
|
|
21
|
+
isOpen: boolean;
|
|
22
|
+
targetContainer: HTMLElement;
|
|
23
|
+
grow: number;
|
|
24
|
+
}
|
|
25
|
+
declare const containerOpenCloseSubjectMap: SubjectMap<ContainerStateRequest>;
|
|
26
|
+
declare const containerSpreadSubjectMap: SubjectMap<ContainerState>;
|
|
27
|
+
declare const ContainerOpenCloseProvider: ({ layoutName, containerName, sizeName, }: {
|
|
28
|
+
layoutName: string;
|
|
29
|
+
containerName: string;
|
|
30
|
+
sizeName: "width" | "height";
|
|
31
|
+
}) => null;
|
|
32
|
+
declare const useContainers: (layoutName: string) => HTMLElement[];
|
|
33
|
+
declare const useLayoutName: (containerName: string) => string | undefined;
|
|
34
|
+
declare const useDecompositionLayout: ({ layoutName: initialLayoutName, containerName, }: {
|
|
35
|
+
layoutName?: string;
|
|
36
|
+
containerName: string;
|
|
37
|
+
}) => {
|
|
38
|
+
layout: HTMLElement[];
|
|
39
|
+
container: HTMLElement | undefined;
|
|
40
|
+
resizePanel: HTMLElement | undefined;
|
|
41
|
+
};
|
|
42
|
+
declare const useContainerSize: (containerName: string) => {
|
|
43
|
+
size: {
|
|
44
|
+
width: number;
|
|
45
|
+
height: number;
|
|
46
|
+
} | undefined;
|
|
47
|
+
};
|
|
48
|
+
declare const useDoubleClick: (containerName: string, opt: ContainerStateRequest) => {
|
|
49
|
+
isOpen: boolean | undefined;
|
|
50
|
+
isDoubleClick: boolean | undefined;
|
|
51
|
+
setIsDoubleClick: React.Dispatch<React.SetStateAction<boolean | undefined>>;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { ContainerOpenCloseProvider, type SubjectMap, containerOpenCloseSubjectMap, containerSpreadSubjectMap, useContainerSize, useContainers, useDecompositionLayout, useDoubleClick, useLayoutName };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Subject } from 'rxjs';
|
|
3
|
+
|
|
4
|
+
type SubjectMap<T> = Record<string, Subject<T>>;
|
|
5
|
+
interface ContainerStateRequest {
|
|
6
|
+
mode: "toggle" | "open" | "close";
|
|
7
|
+
initOpenState?: boolean;
|
|
8
|
+
onOpen?: () => void;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
openOption?: {
|
|
11
|
+
isPrevSizeOpen?: boolean;
|
|
12
|
+
isResize?: boolean;
|
|
13
|
+
openGrowImportant?: number;
|
|
14
|
+
};
|
|
15
|
+
closeOption?: {
|
|
16
|
+
isResize?: boolean;
|
|
17
|
+
isDsiabledResizePanel?: boolean;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
interface ContainerState {
|
|
21
|
+
isOpen: boolean;
|
|
22
|
+
targetContainer: HTMLElement;
|
|
23
|
+
grow: number;
|
|
24
|
+
}
|
|
25
|
+
declare const containerOpenCloseSubjectMap: SubjectMap<ContainerStateRequest>;
|
|
26
|
+
declare const containerSpreadSubjectMap: SubjectMap<ContainerState>;
|
|
27
|
+
declare const ContainerOpenCloseProvider: ({ layoutName, containerName, sizeName, }: {
|
|
28
|
+
layoutName: string;
|
|
29
|
+
containerName: string;
|
|
30
|
+
sizeName: "width" | "height";
|
|
31
|
+
}) => null;
|
|
32
|
+
declare const useContainers: (layoutName: string) => HTMLElement[];
|
|
33
|
+
declare const useLayoutName: (containerName: string) => string | undefined;
|
|
34
|
+
declare const useDecompositionLayout: ({ layoutName: initialLayoutName, containerName, }: {
|
|
35
|
+
layoutName?: string;
|
|
36
|
+
containerName: string;
|
|
37
|
+
}) => {
|
|
38
|
+
layout: HTMLElement[];
|
|
39
|
+
container: HTMLElement | undefined;
|
|
40
|
+
resizePanel: HTMLElement | undefined;
|
|
41
|
+
};
|
|
42
|
+
declare const useContainerSize: (containerName: string) => {
|
|
43
|
+
size: {
|
|
44
|
+
width: number;
|
|
45
|
+
height: number;
|
|
46
|
+
} | undefined;
|
|
47
|
+
};
|
|
48
|
+
declare const useDoubleClick: (containerName: string, opt: ContainerStateRequest) => {
|
|
49
|
+
isOpen: boolean | undefined;
|
|
50
|
+
isDoubleClick: boolean | undefined;
|
|
51
|
+
setIsDoubleClick: React.Dispatch<React.SetStateAction<boolean | undefined>>;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { ContainerOpenCloseProvider, type SubjectMap, containerOpenCloseSubjectMap, containerSpreadSubjectMap, useContainerSize, useContainers, useDecompositionLayout, useDoubleClick, useLayoutName };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import './chunk-3EDKZTM3.js';
|
|
2
|
+
export { ContainerOpenCloseProvider, containerOpenCloseSubjectMap, containerSpreadSubjectMap, useContainerSize, useContainers, useDecompositionLayout, useDoubleClick, useLayoutName } from './chunk-JM3CZ5DU.js';
|
|
3
|
+
import './chunk-W4CNFJTK.js';
|
|
4
|
+
import './chunk-CFQQ6ZDC.js';
|
|
5
|
+
//# sourceMappingURL=providers.js.map
|
|
6
|
+
//# sourceMappingURL=providers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"providers.js"}
|
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,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,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"]}
|
package/dist/store.d.cts
ADDED
|
@@ -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 };
|
package/dist/store.d.ts
ADDED
|
@@ -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"}
|