@os-design/drag-sort 1.0.13 → 1.0.15
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/cjs/DragAndDrop.js +50 -72
- package/dist/cjs/DragAndDrop.js.map +1 -1
- package/dist/cjs/Draggable.js +19 -36
- package/dist/cjs/Draggable.js.map +1 -1
- package/dist/cjs/Droppable.js +24 -33
- package/dist/cjs/Droppable.js.map +1 -1
- package/dist/cjs/index.js +0 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils/ListStore.js +4 -13
- package/dist/cjs/utils/ListStore.js.map +1 -1
- package/dist/cjs/utils/NodeList.js +25 -56
- package/dist/cjs/utils/NodeList.js.map +1 -1
- package/dist/cjs/utils/getElementOffset.js +0 -4
- package/dist/cjs/utils/getElementOffset.js.map +1 -1
- package/dist/cjs/utils/getElementScroll.js +0 -4
- package/dist/cjs/utils/getElementScroll.js.map +1 -1
- package/dist/cjs/utils/getNodeRect.js +9 -18
- package/dist/cjs/utils/getNodeRect.js.map +1 -1
- package/dist/cjs/utils/useAppendClassName.js +0 -3
- package/dist/cjs/utils/useAppendClassName.js.map +1 -1
- package/dist/cjs/utils/useBlankNode.js +17 -26
- package/dist/cjs/utils/useBlankNode.js.map +1 -1
- package/dist/cjs/utils/useDragAndDrop.js +0 -8
- package/dist/cjs/utils/useDragAndDrop.js.map +1 -1
- package/dist/cjs/utils/useDragEffect.js +104 -163
- package/dist/cjs/utils/useDragEffect.js.map +1 -1
- package/dist/cjs/utils/useDroppable.js +0 -8
- package/dist/cjs/utils/useDroppable.js.map +1 -1
- package/dist/cjs/utils/useGeneratedId.js +0 -3
- package/dist/cjs/utils/useGeneratedId.js.map +1 -1
- package/dist/cjs/utils/useGetNodeStyle.js +0 -3
- package/dist/cjs/utils/useGetNodeStyle.js.map +1 -1
- package/dist/cjs/utils/useInitRect.js +0 -3
- package/dist/cjs/utils/useInitRect.js.map +1 -1
- package/dist/cjs/utils/useInitScrollOffset.js +0 -5
- package/dist/cjs/utils/useInitScrollOffset.js.map +1 -1
- package/dist/cjs/utils/useMoveNode.js +23 -48
- package/dist/cjs/utils/useMoveNode.js.map +1 -1
- package/dist/cjs/utils/useScrollEventByPoint.js +2 -10
- package/dist/cjs/utils/useScrollEventByPoint.js.map +1 -1
- package/dist/cjs/utils/useTargetList.js +8 -21
- package/dist/cjs/utils/useTargetList.js.map +1 -1
- package/dist/cjs/utils/useTransitionStyle.js +2 -5
- package/dist/cjs/utils/useTransitionStyle.js.map +1 -1
- package/dist/esm/DragAndDrop.js +19 -12
- package/dist/esm/DragAndDrop.js.map +1 -1
- package/dist/esm/Draggable.js +10 -9
- package/dist/esm/Draggable.js.map +1 -1
- package/dist/esm/Droppable.js +17 -14
- package/dist/esm/Droppable.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/ListStore.js +3 -8
- package/dist/esm/utils/ListStore.js.map +1 -1
- package/dist/esm/utils/NodeList.js +17 -36
- package/dist/esm/utils/NodeList.js.map +1 -1
- package/dist/esm/utils/getElementOffset.js +0 -3
- package/dist/esm/utils/getElementOffset.js.map +1 -1
- package/dist/esm/utils/getElementScroll.js +0 -3
- package/dist/esm/utils/getElementScroll.js.map +1 -1
- package/dist/esm/utils/getNodeRect.js +1 -2
- package/dist/esm/utils/getNodeRect.js.map +1 -1
- package/dist/esm/utils/useAppendClassName.js +1 -2
- package/dist/esm/utils/useAppendClassName.js.map +1 -1
- package/dist/esm/utils/useBlankNode.js +10 -9
- package/dist/esm/utils/useBlankNode.js.map +1 -1
- package/dist/esm/utils/useDragAndDrop.js +0 -2
- package/dist/esm/utils/useDragAndDrop.js.map +1 -1
- package/dist/esm/utils/useDragEffect.js +57 -60
- package/dist/esm/utils/useDragEffect.js.map +1 -1
- package/dist/esm/utils/useDroppable.js +0 -2
- package/dist/esm/utils/useDroppable.js.map +1 -1
- package/dist/esm/utils/useGeneratedId.js +0 -2
- package/dist/esm/utils/useGeneratedId.js.map +1 -1
- package/dist/esm/utils/useGetNodeStyle.js +0 -2
- package/dist/esm/utils/useGetNodeStyle.js.map +1 -1
- package/dist/esm/utils/useInitRect.js +0 -2
- package/dist/esm/utils/useInitRect.js.map +1 -1
- package/dist/esm/utils/useInitScrollOffset.js +0 -2
- package/dist/esm/utils/useInitScrollOffset.js.map +1 -1
- package/dist/esm/utils/useMoveNode.js +1 -11
- package/dist/esm/utils/useMoveNode.js.map +1 -1
- package/dist/esm/utils/useScrollEventByPoint.js +0 -5
- package/dist/esm/utils/useScrollEventByPoint.js.map +1 -1
- package/dist/esm/utils/useTargetList.js +2 -3
- package/dist/esm/utils/useTargetList.js.map +1 -1
- package/dist/esm/utils/useTransitionStyle.js +0 -2
- package/dist/esm/utils/useTransitionStyle.js.map +1 -1
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDragEffect.js","names":["HIDDEN_NODE_STYLE","opacity","pointerEvents","createEmptyNode","prev","next","current","useDragEffect","props","draggedNode","cursorPosition","listStoreRef","onDragEnd","targetRef","useRef","targetNodeRef","useEffect","onDragEndRef","initDraggedNodeRect","useInitRect","node","undefined","initDraggedNodeListScrollOffset","useInitScrollOffset","list","ref","position","useMemo","x","y","initWidth","initHeight","targetList","useTargetList","getNodeStyle","useGetNodeStyle","moveNode","useMoveNode","setTargetNode","useCallback","nodeIndex","nodeId","listId","id","index","clearTargetNode","getDraggedNodePos","initX","initY","initScrollLeft","initScrollTop","getElementScroll","scrollLeft","scrollTop","getDraggedNodePosRef","draggedNodeSetStyle","removeBlankNode","useBlankNode","updateTargetNode","prevTargetNode","startNode","direction","destination","isAnotherList","tail","getTail","axis","horizontal","prevTargetNodeRef","draggedNodePos","isDraggingUp","head","getHead","prevTargetNodeRect","getNodeRect","startRectProp","isMoveUp","useThrottle","throttledUpdateTargetNode","useEvent","window","draggedNodeIndex","targetNode","nodeSetStyle","targetNodeIndex","targetNodeSetStyle","update","nodeProps","setStyle","addListener","removeListener","target","draggedNodeId","dragged"],"sources":["../../../src/utils/useDragEffect.ts"],"sourcesContent":["import { Position } from '@os-design/use-drag';\nimport {\n CSSProperties,\n RefObject,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\nimport useThrottle from '@os-design/use-throttle';\nimport useEvent from '@os-design/use-event';\nimport NodeList, { ExistingNode, Node, NodeProps } from './NodeList';\nimport ListStore from './ListStore';\nimport getElementScroll from './getElementScroll';\nimport useTargetList from './useTargetList';\nimport useInitRect from './useInitRect';\nimport useInitScrollOffset from './useInitScrollOffset';\nimport useGetNodeStyle from './useGetNodeStyle';\nimport useMoveNode from './useMoveNode';\nimport getNodeRect from './getNodeRect';\nimport useBlankNode from './useBlankNode';\n\nexport interface DraggedNode {\n list: NodeList;\n node: ExistingNode;\n position: Position;\n}\n\ninterface TargetNode {\n list: NodeList;\n node: ExistingNode;\n}\n\nexport interface ItemLocation {\n listId: string;\n index: number;\n id: string;\n}\n\nexport type DragEndHandler = (\n dragged: ItemLocation,\n target: ItemLocation\n) => void;\n\ninterface UseDragEffectProps {\n draggedNode: DraggedNode | null;\n cursorPosition: Position;\n listStoreRef: RefObject<ListStore>;\n onDragEnd: DragEndHandler;\n}\n\nconst HIDDEN_NODE_STYLE: CSSProperties = {\n opacity: 0,\n pointerEvents: 'none',\n};\n\nconst createEmptyNode = ({\n prev = null,\n next = null,\n}: {\n prev?: Node;\n next?: Node;\n}): ExistingNode => [prev, next, { current: null }, () => {}, -1, 'id'];\n\n/* eslint-disable no-constant-condition */\n\nconst useDragEffect = (props: UseDragEffectProps) => {\n const { draggedNode, cursorPosition, listStoreRef, onDragEnd } = props;\n\n const targetRef = useRef<ItemLocation | null>(null);\n const targetNodeRef = useRef<TargetNode | null>(draggedNode);\n\n useEffect(() => {\n targetNodeRef.current = draggedNode;\n }, [draggedNode]);\n\n const onDragEndRef = useRef(onDragEnd);\n useEffect(() => {\n onDragEndRef.current = onDragEnd;\n }, [onDragEnd]);\n\n // The initial bounds of the dragged node.\n // We can't read the bounds of the dragged node on the fly because the node can be unmounted in the virtual list.\n const initDraggedNodeRect = useInitRect(\n draggedNode ? draggedNode.node[2] : undefined\n );\n\n // The initial scroll position of the list where the dragged node is located.\n // Used to detect the actual position of the dragged node. The purpose is the same as with initDraggedNodeRect.\n const initDraggedNodeListScrollOffset = useInitScrollOffset(\n draggedNode ? draggedNode.list.ref : undefined\n );\n\n // The central position of the dragged node\n const position = useMemo(() => {\n if (!draggedNode || !initDraggedNodeRect) return null;\n const { x, y } = cursorPosition;\n const { initWidth, initHeight } = initDraggedNodeRect;\n return {\n x: x - draggedNode.position.x + initWidth / 2,\n y: y - draggedNode.position.y + initHeight / 2,\n };\n }, [cursorPosition, draggedNode, initDraggedNodeRect]);\n\n // The list in which the cursor is located\n const targetList = useTargetList(position, listStoreRef);\n\n // Returns the style for moving the node in the specified direction\n const getNodeStyle = useGetNodeStyle(initDraggedNodeRect);\n\n // Moves the node up or down\n const moveNode = useMoveNode({ position, draggedNode, getNodeStyle });\n\n const setTargetNode = useCallback((list: NodeList, node: ExistingNode) => {\n const [, , , , nodeIndex, nodeId] = node;\n targetNodeRef.current = { list, node };\n targetRef.current = {\n listId: list.id,\n index: nodeIndex,\n id: nodeId,\n };\n }, []);\n\n const clearTargetNode = useCallback(() => {\n targetNodeRef.current = null;\n targetRef.current = null;\n }, []);\n\n // Returns the central position of the dragged node in the list\n const getDraggedNodePos = useCallback(() => {\n if (\n !targetList ||\n !targetList.ref.current ||\n !initDraggedNodeRect ||\n !initDraggedNodeListScrollOffset\n ) {\n return null;\n }\n const { initX, initY, initWidth, initHeight } = initDraggedNodeRect;\n const { initScrollLeft, initScrollTop } = initDraggedNodeListScrollOffset;\n const { scrollLeft, scrollTop } = getElementScroll(targetList.ref.current);\n return {\n x: initX + initWidth / 2 + initScrollLeft - scrollLeft,\n y: initY + initHeight / 2 + initScrollTop - scrollTop,\n };\n }, [initDraggedNodeListScrollOffset, initDraggedNodeRect, targetList]);\n\n const getDraggedNodePosRef = useRef(getDraggedNodePos);\n useEffect(() => {\n getDraggedNodePosRef.current = getDraggedNodePos;\n }, [getDraggedNodePos]);\n\n // Hide the dragged node\n useEffect(() => {\n if (!draggedNode) return () => {};\n const [, , , draggedNodeSetStyle] = draggedNode.node;\n draggedNodeSetStyle(HIDDEN_NODE_STYLE);\n return () => draggedNodeSetStyle({});\n }, [draggedNode]);\n\n // Append the blank node to the list to increase the height of it.\n // Used when the dragged node is located inside another list.\n const removeBlankNode = useBlankNode({\n draggedNode,\n targetList,\n initDraggedNodeRect,\n });\n\n const updateTargetNode = useCallback(() => {\n if (!draggedNode) return;\n const prevTargetNode = targetNodeRef.current; // The last updated node\n\n // Dragging outside the origin list\n if (\n prevTargetNode &&\n prevTargetNode.list === draggedNode.list &&\n targetList !== draggedNode.list\n ) {\n moveNode({\n list: prevTargetNode.list,\n startNode: prevTargetNode.node,\n direction: 'down',\n destination: 'end',\n });\n clearTargetNode();\n }\n\n // Dragging outside another list\n if (\n prevTargetNode &&\n prevTargetNode.list !== draggedNode.list &&\n targetList !== prevTargetNode.list\n ) {\n moveNode({\n list: prevTargetNode.list,\n startNode: prevTargetNode.node,\n direction: 'down',\n destination: 'end',\n isAnotherList: true,\n });\n removeBlankNode();\n clearTargetNode();\n }\n\n // Dragging inside the origin list\n if (!prevTargetNode && targetList === draggedNode.list) {\n const tail = targetList.getTail();\n if (!tail) return;\n const node = moveNode({\n list: targetList,\n startNode: tail,\n direction: 'up',\n destination: 'cursor',\n });\n setTargetNode(targetList, node);\n return;\n }\n\n // Dragging inside another list\n if (\n targetList &&\n targetList !== draggedNode.list &&\n (!prevTargetNode || prevTargetNode.list !== targetList)\n ) {\n const tail = targetList.getTail();\n if (!tail) return;\n const node = moveNode({\n list: targetList,\n startNode: tail,\n direction: 'up',\n destination: 'cursor',\n isAnotherList: true,\n });\n setTargetNode(targetList, node);\n return;\n }\n\n // Dragging in the origin list\n if (\n prevTargetNode &&\n prevTargetNode.list === draggedNode.list &&\n targetList === draggedNode.list\n ) {\n const axis = targetList.horizontal ? 'x' : 'y';\n const [, , prevTargetNodeRef, ,] = prevTargetNode.node;\n if (!prevTargetNodeRef.current) {\n // The target node was unmounted. It happens when the virtual list is used.\n // If the cursor is above the dragged node, we need to move the nodes down from the tail to the node where\n // the cursor is located. Otherwise, we need to move the nodes up from the head to the node where the cursor\n // is located.\n const draggedNodePos = getDraggedNodePosRef.current();\n if (!position || !draggedNodePos) return;\n const isDraggingUp = position[axis] < draggedNodePos[axis];\n if (isDraggingUp) {\n const tail = targetList.getTail();\n if (!tail || !tail[2].current) return;\n const node = moveNode({\n list: targetList,\n startNode: createEmptyNode({ prev: tail }),\n direction: 'up',\n destination: 'cursor',\n });\n setTargetNode(targetList, node);\n } else {\n const head = targetList.getHead();\n if (!head || !head[2].current) return;\n const node = moveNode({\n list: targetList,\n startNode: createEmptyNode({ next: head }),\n direction: 'down',\n destination: 'cursor',\n });\n setTargetNode(targetList, node);\n }\n return;\n }\n const prevTargetNodeRect = getNodeRect(prevTargetNode.node[2]);\n const startRectProp = targetList.horizontal ? 'left' : 'top';\n if (!position || !prevTargetNodeRect) return;\n const isMoveUp = position[axis] < prevTargetNodeRect[startRectProp];\n const node = isMoveUp\n ? moveNode({\n list: targetList,\n startNode: prevTargetNode.node,\n direction: 'up',\n destination: 'cursor',\n })\n : moveNode({\n list: targetList,\n startNode: prevTargetNode.node,\n direction: 'down',\n destination: 'cursor',\n });\n setTargetNode(targetList, node);\n return;\n }\n\n // Dragging in another list\n if (\n targetList &&\n targetList !== draggedNode.list &&\n prevTargetNode &&\n prevTargetNode.list === targetList\n ) {\n const axis = targetList.horizontal ? 'x' : 'y';\n const prevTargetNodeRect = getNodeRect(prevTargetNode.node[2]);\n const startRectProp = targetList.horizontal ? 'left' : 'top';\n if (!position || !prevTargetNodeRect) return;\n const isMoveUp = position[axis] < prevTargetNodeRect[startRectProp];\n const node = isMoveUp\n ? moveNode({\n list: targetList,\n startNode: prevTargetNode.node,\n direction: 'up',\n destination: 'cursor',\n isAnotherList: true,\n })\n : moveNode({\n list: targetList,\n startNode: prevTargetNode.node,\n direction: 'down',\n destination: 'cursor',\n isAnotherList: true,\n });\n setTargetNode(targetList, node);\n }\n }, [\n draggedNode,\n targetList,\n moveNode,\n clearTargetNode,\n removeBlankNode,\n setTargetNode,\n position,\n ]);\n\n // Update the target node if either the position or the target list has been changed\n useEffect(() => {\n updateTargetNode();\n }, [updateTargetNode]);\n\n // Update the target node if the target list has been scrolled\n const [throttledUpdateTargetNode] = useThrottle(updateTargetNode, 100);\n useEvent(\n (targetList ? targetList.ref : undefined) as unknown as EventTarget,\n 'scroll',\n throttledUpdateTargetNode\n );\n useEvent(window, 'scroll', throttledUpdateTargetNode);\n\n // Reset styles of the affected nodes when the dragged node was dropped\n useEffect(() => {\n if (!draggedNode) return () => {};\n const [, , , , draggedNodeIndex] = draggedNode.node;\n return () => {\n const targetNode = targetNodeRef.current;\n\n // If the dragged node was outside the origin list, reset the styles for the nodes,\n // starting at the tail and ending with the dragged node in the origin list.\n if (!targetNode || targetNode.list !== draggedNode.list) {\n const tail = draggedNode.list.getTail();\n if (tail) {\n let node = tail;\n while (true) {\n const [prev, , , nodeSetStyle, nodeIndex] = node;\n nodeSetStyle({});\n if (!prev || nodeIndex <= draggedNodeIndex) break;\n node = prev;\n }\n }\n }\n\n // If the dragged node was inside another list, reset the styles for the nodes,\n // starting at the tail and ending with the dragged node in the target list.\n if (targetNode && targetNode.list !== draggedNode.list) {\n const tail = targetNode.list.getTail();\n const [, , , , targetNodeIndex] = targetNode.node;\n if (tail) {\n let node = tail;\n while (true) {\n const [prev, , , nodeSetStyle, nodeIndex] = node;\n nodeSetStyle({});\n if (!prev || nodeIndex <= targetNodeIndex) break;\n node = prev;\n }\n }\n }\n\n // If the dragged node was moved inside the origin list, reset the styles for the nodes,\n // starting with target node and ending with the dragged node.\n if (targetNode && targetNode.list === draggedNode.list) {\n const [, , , targetNodeSetStyle, targetNodeIndex] = targetNode.node;\n if (targetNodeIndex > draggedNodeIndex) {\n let { node } = targetNode;\n while (true) {\n const [prev, , , nodeSetStyle, nodeIndex] = node;\n nodeSetStyle({});\n if (!prev || nodeIndex <= draggedNodeIndex) break;\n node = prev;\n }\n } else if (targetNodeIndex < draggedNodeIndex) {\n let { node } = targetNode;\n while (true) {\n const [, next, , nodeSetStyle, nodeIndex] = node;\n nodeSetStyle({});\n if (!next || nodeIndex >= draggedNodeIndex) break;\n node = next;\n }\n } else if (targetNodeIndex === draggedNodeIndex) {\n targetNodeSetStyle({});\n }\n }\n };\n }, [draggedNode]);\n\n // Update the position of the newly mounted nodes in the origin list (used in the virtual list)\n useEffect(() => {\n if (!draggedNode) return () => {};\n const [, , , , draggedNodeIndex] = draggedNode.node;\n\n const update = (nodeProps: NodeProps) => {\n const { setStyle, index } = nodeProps;\n const targetNode = targetNodeRef.current;\n\n // Set the hidden style, if the mounted node is the dragged node\n if (index === draggedNodeIndex) {\n setStyle(HIDDEN_NODE_STYLE);\n return;\n }\n\n // If the dragged node is inside the origin list\n if (targetNode && targetNode.list === draggedNode.list) {\n // Move the mounted node up/down, if it is located between the dragged and target node\n const [, , , , targetNodeIndex] = targetNode.node;\n if (index > draggedNodeIndex && index < targetNodeIndex) {\n setStyle(getNodeStyle('up', targetNode.list.horizontal));\n } else if (index < draggedNodeIndex && index > targetNodeIndex) {\n setStyle(getNodeStyle('down', targetNode.list.horizontal));\n }\n } else if (index > draggedNodeIndex) {\n // Otherwise, move the mounted node up, if it is located below the dragged node\n setStyle(getNodeStyle('up', draggedNode.list.horizontal));\n }\n };\n\n draggedNode.list.addListener(update);\n return () => draggedNode.list.removeListener(update);\n }, [draggedNode, getNodeStyle]);\n\n // Update the position of the newly mounted nodes in the target list (used in the virtual list)\n useEffect(() => {\n if (!draggedNode || !targetList || targetList === draggedNode.list) {\n return () => {};\n }\n\n const update = (nodeProps: NodeProps) => {\n const { setStyle, index } = nodeProps;\n const targetNode = targetNodeRef.current;\n if (!targetNode) return;\n const [, , , , targetNodeIndex] = targetNode.node;\n if (index >= targetNodeIndex) {\n // Move the mounted node down, if it is located below the target node or if it is the target node\n setStyle(getNodeStyle('down', targetList.horizontal));\n }\n };\n\n targetList.addListener(update);\n return () => targetList.removeListener(update);\n }, [draggedNode, getNodeStyle, targetList]);\n\n // Call the onDragEnd callback if the draggedNode was changed to null\n useEffect(() => {\n if (!draggedNode) return () => {};\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const target = targetRef.current;\n if (!target) return;\n const [, , , , draggedNodeIndex, draggedNodeId] = draggedNode.node;\n const dragged = {\n listId: draggedNode.list.id,\n index: draggedNodeIndex,\n id: draggedNodeId,\n };\n if (dragged.id === target.id && dragged.index === target.index) return;\n onDragEndRef.current(dragged, target);\n };\n }, [draggedNode]);\n};\n\nexport default useDragEffect;\n"],"mappings":";;;;;;;AACA;;AAQA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;AA+BA,IAAMA,iBAAgC,GAAG;EACvCC,OAAO,EAAE,CAD8B;EAEvCC,aAAa,EAAE;AAFwB,CAAzC;;AAKA,IAAMC,eAAe,GAAG,SAAlBA,eAAkB;EAAA,qBACtBC,IADsB;EAAA,IACtBA,IADsB,0BACf,IADe;EAAA,qBAEtBC,IAFsB;EAAA,IAEtBA,IAFsB,0BAEf,IAFe;EAAA,OAMJ,CAACD,IAAD,EAAOC,IAAP,EAAa;IAAEC,OAAO,EAAE;EAAX,CAAb,EAAgC,YAAM,CAAE,CAAxC,EAA0C,CAAC,CAA3C,EAA8C,IAA9C,CANI;AAAA,CAAxB;AAQA;;;AAEA,IAAMC,aAAa,GAAG,SAAhBA,aAAgB,CAACC,KAAD,EAA+B;EACnD,IAAQC,WAAR,GAAiED,KAAjE,CAAQC,WAAR;EAAA,IAAqBC,cAArB,GAAiEF,KAAjE,CAAqBE,cAArB;EAAA,IAAqCC,YAArC,GAAiEH,KAAjE,CAAqCG,YAArC;EAAA,IAAmDC,SAAn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1B,CAAN;IAAA,CAAP;EACD,CAlBD,EAkBG,CAAC7E,WAAD,EAAcyB,YAAd,EAA4BF,UAA5B,CAlBH,EAhYmD,CAoZnD;;EACA,IAAAhB,gBAAA,EAAU,YAAM;IACd,IAAI,CAACP,WAAL,EAAkB,OAAO,YAAM,CAAE,CAAf;IAClB,OAAO,YAAM;MACX;MACA,IAAMkF,MAAM,GAAG9E,SAAS,CAACP,OAAzB;MACA,IAAI,CAACqF,MAAL,EAAa;;MACb,wCAAkDlF,WAAW,CAACW,IAA9D;MAAA,IAAe6D,gBAAf;MAAA,IAAiCW,aAAjC;;MACA,IAAMC,OAAO,GAAG;QACdnD,MAAM,EAAEjC,WAAW,CAACe,IAAZ,CAAiBmB,EADX;QAEdC,KAAK,EAAEqC,gBAFO;QAGdtC,EAAE,EAAEiD;MAHU,CAAhB;MAKA,IAAIC,OAAO,CAAClD,EAAR,KAAegD,MAAM,CAAChD,EAAtB,IAA4BkD,OAAO,CAACjD,KAAR,KAAkB+C,MAAM,CAAC/C,KAAzD,EAAgE;MAChE3B,YAAY,CAACX,OAAb,CAAqBuF,OAArB,EAA8BF,MAA9B;IACD,CAZD;EAaD,CAfD,EAeG,CAAClF,WAAD,CAfH;AAgBD,CAraD;;eAuaeF,a"}
|
|
1
|
+
{"version":3,"file":"useDragEffect.js","names":["HIDDEN_NODE_STYLE","opacity","pointerEvents","createEmptyNode","prev","next","current","useDragEffect","props","draggedNode","cursorPosition","listStoreRef","onDragEnd","targetRef","useRef","targetNodeRef","useEffect","onDragEndRef","initDraggedNodeRect","useInitRect","node","undefined","initDraggedNodeListScrollOffset","useInitScrollOffset","list","ref","position","useMemo","x","y","initWidth","initHeight","targetList","useTargetList","getNodeStyle","useGetNodeStyle","moveNode","useMoveNode","setTargetNode","useCallback","nodeIndex","nodeId","listId","id","index","clearTargetNode","getDraggedNodePos","initX","initY","initScrollLeft","initScrollTop","getElementScroll","scrollLeft","scrollTop","getDraggedNodePosRef","draggedNodeSetStyle","removeBlankNode","useBlankNode","updateTargetNode","prevTargetNode","startNode","direction","destination","isAnotherList","tail","getTail","axis","horizontal","prevTargetNodeRef","draggedNodePos","isDraggingUp","head","getHead","prevTargetNodeRect","getNodeRect","startRectProp","isMoveUp","useThrottle","throttledUpdateTargetNode","useEvent","window","draggedNodeIndex","targetNode","nodeSetStyle","targetNodeIndex","targetNodeSetStyle","update","nodeProps","setStyle","addListener","removeListener","target","draggedNodeId","dragged"],"sources":["../../../src/utils/useDragEffect.ts"],"sourcesContent":["import { Position } from '@os-design/use-drag';\nimport {\n CSSProperties,\n RefObject,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\nimport useThrottle from '@os-design/use-throttle';\nimport useEvent from '@os-design/use-event';\nimport NodeList, { ExistingNode, Node, NodeProps } from './NodeList';\nimport ListStore from './ListStore';\nimport getElementScroll from './getElementScroll';\nimport useTargetList from './useTargetList';\nimport useInitRect from './useInitRect';\nimport useInitScrollOffset from './useInitScrollOffset';\nimport useGetNodeStyle from './useGetNodeStyle';\nimport useMoveNode from './useMoveNode';\nimport getNodeRect from './getNodeRect';\nimport useBlankNode from './useBlankNode';\n\nexport interface DraggedNode {\n list: NodeList;\n node: ExistingNode;\n position: Position;\n}\n\ninterface TargetNode {\n list: NodeList;\n node: ExistingNode;\n}\n\nexport interface ItemLocation {\n listId: string;\n index: number;\n id: string;\n}\n\nexport type DragEndHandler = (\n dragged: ItemLocation,\n target: ItemLocation\n) => void;\n\ninterface UseDragEffectProps {\n draggedNode: DraggedNode | null;\n cursorPosition: Position;\n listStoreRef: RefObject<ListStore>;\n onDragEnd: DragEndHandler;\n}\n\nconst HIDDEN_NODE_STYLE: CSSProperties = {\n opacity: 0,\n pointerEvents: 'none',\n};\n\nconst createEmptyNode = ({\n prev = null,\n next = null,\n}: {\n prev?: Node;\n next?: Node;\n}): ExistingNode => [prev, next, { current: null }, () => {}, -1, 'id'];\n\n/* eslint-disable no-constant-condition */\n\nconst useDragEffect = (props: UseDragEffectProps) => {\n const { draggedNode, cursorPosition, listStoreRef, onDragEnd } = props;\n\n const targetRef = useRef<ItemLocation | null>(null);\n const targetNodeRef = useRef<TargetNode | null>(draggedNode);\n\n useEffect(() => {\n targetNodeRef.current = draggedNode;\n }, [draggedNode]);\n\n const onDragEndRef = useRef(onDragEnd);\n useEffect(() => {\n onDragEndRef.current = onDragEnd;\n }, [onDragEnd]);\n\n // The initial bounds of the dragged node.\n // We can't read the bounds of the dragged node on the fly because the node can be unmounted in the virtual list.\n const initDraggedNodeRect = useInitRect(\n draggedNode ? draggedNode.node[2] : undefined\n );\n\n // The initial scroll position of the list where the dragged node is located.\n // Used to detect the actual position of the dragged node. The purpose is the same as with initDraggedNodeRect.\n const initDraggedNodeListScrollOffset = useInitScrollOffset(\n draggedNode ? draggedNode.list.ref : undefined\n );\n\n // The central position of the dragged node\n const position = useMemo(() => {\n if (!draggedNode || !initDraggedNodeRect) return null;\n const { x, y } = cursorPosition;\n const { initWidth, initHeight } = initDraggedNodeRect;\n return {\n x: x - draggedNode.position.x + initWidth / 2,\n y: y - draggedNode.position.y + initHeight / 2,\n };\n }, [cursorPosition, draggedNode, initDraggedNodeRect]);\n\n // The list in which the cursor is located\n const targetList = useTargetList(position, listStoreRef);\n\n // Returns the style for moving the node in the specified direction\n const getNodeStyle = useGetNodeStyle(initDraggedNodeRect);\n\n // Moves the node up or down\n const moveNode = useMoveNode({ position, draggedNode, getNodeStyle });\n\n const setTargetNode = useCallback((list: NodeList, node: ExistingNode) => {\n const [, , , , nodeIndex, nodeId] = node;\n targetNodeRef.current = { list, node };\n targetRef.current = {\n listId: list.id,\n index: nodeIndex,\n id: nodeId,\n };\n }, []);\n\n const clearTargetNode = useCallback(() => {\n targetNodeRef.current = null;\n targetRef.current = null;\n }, []);\n\n // Returns the central position of the dragged node in the list\n const getDraggedNodePos = useCallback(() => {\n if (\n !targetList ||\n !targetList.ref.current ||\n !initDraggedNodeRect ||\n !initDraggedNodeListScrollOffset\n ) {\n return null;\n }\n const { initX, initY, initWidth, initHeight } = initDraggedNodeRect;\n const { initScrollLeft, initScrollTop } = initDraggedNodeListScrollOffset;\n const { scrollLeft, scrollTop } = getElementScroll(targetList.ref.current);\n return {\n x: initX + initWidth / 2 + initScrollLeft - scrollLeft,\n y: initY + initHeight / 2 + initScrollTop - scrollTop,\n };\n }, [initDraggedNodeListScrollOffset, initDraggedNodeRect, targetList]);\n\n const getDraggedNodePosRef = useRef(getDraggedNodePos);\n useEffect(() => {\n getDraggedNodePosRef.current = getDraggedNodePos;\n }, [getDraggedNodePos]);\n\n // Hide the dragged node\n useEffect(() => {\n if (!draggedNode) return () => {};\n const [, , , draggedNodeSetStyle] = draggedNode.node;\n draggedNodeSetStyle(HIDDEN_NODE_STYLE);\n return () => draggedNodeSetStyle({});\n }, [draggedNode]);\n\n // Append the blank node to the list to increase the height of it.\n // Used when the dragged node is located inside another list.\n const removeBlankNode = useBlankNode({\n draggedNode,\n targetList,\n initDraggedNodeRect,\n });\n\n const updateTargetNode = useCallback(() => {\n if (!draggedNode) return;\n const prevTargetNode = targetNodeRef.current; // The last updated node\n\n // Dragging outside the origin list\n if (\n prevTargetNode &&\n prevTargetNode.list === draggedNode.list &&\n targetList !== draggedNode.list\n ) {\n moveNode({\n list: prevTargetNode.list,\n startNode: prevTargetNode.node,\n direction: 'down',\n destination: 'end',\n });\n clearTargetNode();\n }\n\n // Dragging outside another list\n if (\n prevTargetNode &&\n prevTargetNode.list !== draggedNode.list &&\n targetList !== prevTargetNode.list\n ) {\n moveNode({\n list: prevTargetNode.list,\n startNode: prevTargetNode.node,\n direction: 'down',\n destination: 'end',\n isAnotherList: true,\n });\n removeBlankNode();\n clearTargetNode();\n }\n\n // Dragging inside the origin list\n if (!prevTargetNode && targetList === draggedNode.list) {\n const tail = targetList.getTail();\n if (!tail) return;\n const node = moveNode({\n list: targetList,\n startNode: tail,\n direction: 'up',\n destination: 'cursor',\n });\n setTargetNode(targetList, node);\n return;\n }\n\n // Dragging inside another list\n if (\n targetList &&\n targetList !== draggedNode.list &&\n (!prevTargetNode || prevTargetNode.list !== targetList)\n ) {\n const tail = targetList.getTail();\n if (!tail) return;\n const node = moveNode({\n list: targetList,\n startNode: tail,\n direction: 'up',\n destination: 'cursor',\n isAnotherList: true,\n });\n setTargetNode(targetList, node);\n return;\n }\n\n // Dragging in the origin list\n if (\n prevTargetNode &&\n prevTargetNode.list === draggedNode.list &&\n targetList === draggedNode.list\n ) {\n const axis = targetList.horizontal ? 'x' : 'y';\n const [, , prevTargetNodeRef, ,] = prevTargetNode.node;\n if (!prevTargetNodeRef.current) {\n // The target node was unmounted. It happens when the virtual list is used.\n // If the cursor is above the dragged node, we need to move the nodes down from the tail to the node where\n // the cursor is located. Otherwise, we need to move the nodes up from the head to the node where the cursor\n // is located.\n const draggedNodePos = getDraggedNodePosRef.current();\n if (!position || !draggedNodePos) return;\n const isDraggingUp = position[axis] < draggedNodePos[axis];\n if (isDraggingUp) {\n const tail = targetList.getTail();\n if (!tail || !tail[2].current) return;\n const node = moveNode({\n list: targetList,\n startNode: createEmptyNode({ prev: tail }),\n direction: 'up',\n destination: 'cursor',\n });\n setTargetNode(targetList, node);\n } else {\n const head = targetList.getHead();\n if (!head || !head[2].current) return;\n const node = moveNode({\n list: targetList,\n startNode: createEmptyNode({ next: head }),\n direction: 'down',\n destination: 'cursor',\n });\n setTargetNode(targetList, node);\n }\n return;\n }\n const prevTargetNodeRect = getNodeRect(prevTargetNode.node[2]);\n const startRectProp = targetList.horizontal ? 'left' : 'top';\n if (!position || !prevTargetNodeRect) return;\n const isMoveUp = position[axis] < prevTargetNodeRect[startRectProp];\n const node = isMoveUp\n ? moveNode({\n list: targetList,\n startNode: prevTargetNode.node,\n direction: 'up',\n destination: 'cursor',\n })\n : moveNode({\n list: targetList,\n startNode: prevTargetNode.node,\n direction: 'down',\n destination: 'cursor',\n });\n setTargetNode(targetList, node);\n return;\n }\n\n // Dragging in another list\n if (\n targetList &&\n targetList !== draggedNode.list &&\n prevTargetNode &&\n prevTargetNode.list === targetList\n ) {\n const axis = targetList.horizontal ? 'x' : 'y';\n const prevTargetNodeRect = getNodeRect(prevTargetNode.node[2]);\n const startRectProp = targetList.horizontal ? 'left' : 'top';\n if (!position || !prevTargetNodeRect) return;\n const isMoveUp = position[axis] < prevTargetNodeRect[startRectProp];\n const node = isMoveUp\n ? moveNode({\n list: targetList,\n startNode: prevTargetNode.node,\n direction: 'up',\n destination: 'cursor',\n isAnotherList: true,\n })\n : moveNode({\n list: targetList,\n startNode: prevTargetNode.node,\n direction: 'down',\n destination: 'cursor',\n isAnotherList: true,\n });\n setTargetNode(targetList, node);\n }\n }, [\n draggedNode,\n targetList,\n moveNode,\n clearTargetNode,\n removeBlankNode,\n setTargetNode,\n position,\n ]);\n\n // Update the target node if either the position or the target list has been changed\n useEffect(() => {\n updateTargetNode();\n }, [updateTargetNode]);\n\n // Update the target node if the target list has been scrolled\n const [throttledUpdateTargetNode] = useThrottle(updateTargetNode, 100);\n useEvent(\n (targetList ? targetList.ref : undefined) as unknown as EventTarget,\n 'scroll',\n throttledUpdateTargetNode\n );\n useEvent(window, 'scroll', throttledUpdateTargetNode);\n\n // Reset styles of the affected nodes when the dragged node was dropped\n useEffect(() => {\n if (!draggedNode) return () => {};\n const [, , , , draggedNodeIndex] = draggedNode.node;\n return () => {\n const targetNode = targetNodeRef.current;\n\n // If the dragged node was outside the origin list, reset the styles for the nodes,\n // starting at the tail and ending with the dragged node in the origin list.\n if (!targetNode || targetNode.list !== draggedNode.list) {\n const tail = draggedNode.list.getTail();\n if (tail) {\n let node = tail;\n while (true) {\n const [prev, , , nodeSetStyle, nodeIndex] = node;\n nodeSetStyle({});\n if (!prev || nodeIndex <= draggedNodeIndex) break;\n node = prev;\n }\n }\n }\n\n // If the dragged node was inside another list, reset the styles for the nodes,\n // starting at the tail and ending with the dragged node in the target list.\n if (targetNode && targetNode.list !== draggedNode.list) {\n const tail = targetNode.list.getTail();\n const [, , , , targetNodeIndex] = targetNode.node;\n if (tail) {\n let node = tail;\n while (true) {\n const [prev, , , nodeSetStyle, nodeIndex] = node;\n nodeSetStyle({});\n if (!prev || nodeIndex <= targetNodeIndex) break;\n node = prev;\n }\n }\n }\n\n // If the dragged node was moved inside the origin list, reset the styles for the nodes,\n // starting with target node and ending with the dragged node.\n if (targetNode && targetNode.list === draggedNode.list) {\n const [, , , targetNodeSetStyle, targetNodeIndex] = targetNode.node;\n if (targetNodeIndex > draggedNodeIndex) {\n let { node } = targetNode;\n while (true) {\n const [prev, , , nodeSetStyle, nodeIndex] = node;\n nodeSetStyle({});\n if (!prev || nodeIndex <= draggedNodeIndex) break;\n node = prev;\n }\n } else if (targetNodeIndex < draggedNodeIndex) {\n let { node } = targetNode;\n while (true) {\n const [, next, , nodeSetStyle, nodeIndex] = node;\n nodeSetStyle({});\n if (!next || nodeIndex >= draggedNodeIndex) break;\n node = next;\n }\n } else if (targetNodeIndex === draggedNodeIndex) {\n targetNodeSetStyle({});\n }\n }\n };\n }, [draggedNode]);\n\n // Update the position of the newly mounted nodes in the origin list (used in the virtual list)\n useEffect(() => {\n if (!draggedNode) return () => {};\n const [, , , , draggedNodeIndex] = draggedNode.node;\n\n const update = (nodeProps: NodeProps) => {\n const { setStyle, index } = nodeProps;\n const targetNode = targetNodeRef.current;\n\n // Set the hidden style, if the mounted node is the dragged node\n if (index === draggedNodeIndex) {\n setStyle(HIDDEN_NODE_STYLE);\n return;\n }\n\n // If the dragged node is inside the origin list\n if (targetNode && targetNode.list === draggedNode.list) {\n // Move the mounted node up/down, if it is located between the dragged and target node\n const [, , , , targetNodeIndex] = targetNode.node;\n if (index > draggedNodeIndex && index < targetNodeIndex) {\n setStyle(getNodeStyle('up', targetNode.list.horizontal));\n } else if (index < draggedNodeIndex && index > targetNodeIndex) {\n setStyle(getNodeStyle('down', targetNode.list.horizontal));\n }\n } else if (index > draggedNodeIndex) {\n // Otherwise, move the mounted node up, if it is located below the dragged node\n setStyle(getNodeStyle('up', draggedNode.list.horizontal));\n }\n };\n\n draggedNode.list.addListener(update);\n return () => draggedNode.list.removeListener(update);\n }, [draggedNode, getNodeStyle]);\n\n // Update the position of the newly mounted nodes in the target list (used in the virtual list)\n useEffect(() => {\n if (!draggedNode || !targetList || targetList === draggedNode.list) {\n return () => {};\n }\n\n const update = (nodeProps: NodeProps) => {\n const { setStyle, index } = nodeProps;\n const targetNode = targetNodeRef.current;\n if (!targetNode) return;\n const [, , , , targetNodeIndex] = targetNode.node;\n if (index >= targetNodeIndex) {\n // Move the mounted node down, if it is located below the target node or if it is the target node\n setStyle(getNodeStyle('down', targetList.horizontal));\n }\n };\n\n targetList.addListener(update);\n return () => targetList.removeListener(update);\n }, [draggedNode, getNodeStyle, targetList]);\n\n // Call the onDragEnd callback if the draggedNode was changed to null\n useEffect(() => {\n if (!draggedNode) return () => {};\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const target = targetRef.current;\n if (!target) return;\n const [, , , , draggedNodeIndex, draggedNodeId] = draggedNode.node;\n const dragged = {\n listId: draggedNode.list.id,\n index: draggedNodeIndex,\n id: draggedNodeId,\n };\n if (dragged.id === target.id && dragged.index === target.index) return;\n onDragEndRef.current(dragged, target);\n };\n }, [draggedNode]);\n};\n\nexport default useDragEffect;\n"],"mappings":";;;;;;AACA;AAQA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAA0C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+B1C,IAAMA,iBAAgC,GAAG;EACvCC,OAAO,EAAE,CAAC;EACVC,aAAa,EAAE;AACjB,CAAC;AAED,IAAMC,eAAe,GAAG,SAAlBA,eAAe;EAAA,qBACnBC,IAAI;IAAJA,IAAI,0BAAG,IAAI;IAAA,iBACXC,IAAI;IAAJA,IAAI,0BAAG,IAAI;EAAA,OAIO,CAACD,IAAI,EAAEC,IAAI,EAAE;IAAEC,OAAO,EAAE;EAAK,CAAC,EAAE,YAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC;AAAA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AI,CAACmB,EAAE;QAC3BC,KAAK,EAAEqC,gBAAgB;QACvBtC,EAAE,EAAEiD;MACN,CAAC;MACD,IAAIC,OAAO,CAAClD,EAAE,KAAKgD,MAAM,CAAChD,EAAE,IAAIkD,OAAO,CAACjD,KAAK,KAAK+C,MAAM,CAAC/C,KAAK,EAAE;MAChE3B,YAAY,CAACX,OAAO,CAACuF,OAAO,EAAEF,MAAM,CAAC;IACvC,CAAC;EACH,CAAC,EAAE,CAAClF,WAAW,CAAC,CAAC;AACnB,CAAC;AAAC,eAEaF,aAAa;AAAA"}
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = exports.DroppableContext = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
-
|
|
14
10
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
-
|
|
16
11
|
var DroppableContext = /*#__PURE__*/_react["default"].createContext({
|
|
17
12
|
registerNode: function registerNode() {
|
|
18
13
|
return [null, null, {
|
|
@@ -23,13 +18,10 @@ var DroppableContext = /*#__PURE__*/_react["default"].createContext({
|
|
|
23
18
|
onMouseDown: function onMouseDown() {},
|
|
24
19
|
onTouchStart: function onTouchStart() {}
|
|
25
20
|
});
|
|
26
|
-
|
|
27
21
|
exports.DroppableContext = DroppableContext;
|
|
28
|
-
|
|
29
22
|
var useDroppable = function useDroppable() {
|
|
30
23
|
return (0, _react.useContext)(DroppableContext);
|
|
31
24
|
};
|
|
32
|
-
|
|
33
25
|
var _default = useDroppable;
|
|
34
26
|
exports["default"] = _default;
|
|
35
27
|
//# sourceMappingURL=useDroppable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDroppable.js","names":["DroppableContext","React","createContext","registerNode","current","deregisterNode","onMouseDown","onTouchStart","useDroppable","useContext"],"sources":["../../../src/utils/useDroppable.ts"],"sourcesContent":["import React, { useContext, MouseEvent, TouchEvent } from 'react';\nimport { ExistingNode, NodeProps } from './NodeList';\n\ninterface DroppableContextProps {\n registerNode: (props: NodeProps) => ExistingNode;\n deregisterNode: (node: ExistingNode) => void;\n onMouseDown: (e: MouseEvent, node: ExistingNode) => void;\n onTouchStart: (e: TouchEvent, node: ExistingNode) => void;\n}\n\nexport const DroppableContext = React.createContext<DroppableContextProps>({\n registerNode: () =>\n [null, null, { current: null }, () => {}, -1, 'id'] as ExistingNode,\n deregisterNode: () => {},\n onMouseDown: () => {},\n onTouchStart: () => {},\n});\n\nconst useDroppable = (): DroppableContextProps => useContext(DroppableContext);\n\nexport default useDroppable;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDroppable.js","names":["DroppableContext","React","createContext","registerNode","current","deregisterNode","onMouseDown","onTouchStart","useDroppable","useContext"],"sources":["../../../src/utils/useDroppable.ts"],"sourcesContent":["import React, { useContext, MouseEvent, TouchEvent } from 'react';\nimport { ExistingNode, NodeProps } from './NodeList';\n\ninterface DroppableContextProps {\n registerNode: (props: NodeProps) => ExistingNode;\n deregisterNode: (node: ExistingNode) => void;\n onMouseDown: (e: MouseEvent, node: ExistingNode) => void;\n onTouchStart: (e: TouchEvent, node: ExistingNode) => void;\n}\n\nexport const DroppableContext = React.createContext<DroppableContextProps>({\n registerNode: () =>\n [null, null, { current: null }, () => {}, -1, 'id'] as ExistingNode,\n deregisterNode: () => {},\n onMouseDown: () => {},\n onTouchStart: () => {},\n});\n\nconst useDroppable = (): DroppableContextProps => useContext(DroppableContext);\n\nexport default useDroppable;\n"],"mappings":";;;;;;;AAAA;AAAkE;AAAA;AAU3D,IAAMA,gBAAgB,gBAAGC,iBAAK,CAACC,aAAa,CAAwB;EACzEC,YAAY,EAAE;IAAA,OACZ,CAAC,IAAI,EAAE,IAAI,EAAE;MAAEC,OAAO,EAAE;IAAK,CAAC,EAAE,YAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC;EAAA,CAAgB;EACrEC,cAAc,EAAE,0BAAM,CAAC,CAAC;EACxBC,WAAW,EAAE,uBAAM,CAAC,CAAC;EACrBC,YAAY,EAAE,wBAAM,CAAC;AACvB,CAAC,CAAC;AAAC;AAEH,IAAMC,YAAY,GAAG,SAAfA,YAAY;EAAA,OAAgC,IAAAC,iBAAU,EAACT,gBAAgB,CAAC;AAAA;AAAC,eAEhEQ,YAAY;AAAA"}
|
|
@@ -4,15 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var useGeneratedId = function useGeneratedId() {
|
|
11
9
|
return (0, _react.useMemo)(function () {
|
|
12
10
|
return Math.random().toString(16).slice(2);
|
|
13
11
|
}, []);
|
|
14
12
|
};
|
|
15
|
-
|
|
16
13
|
var _default = useGeneratedId;
|
|
17
14
|
exports["default"] = _default;
|
|
18
15
|
//# sourceMappingURL=useGeneratedId.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGeneratedId.js","names":["useGeneratedId","useMemo","Math","random","toString","slice"],"sources":["../../../src/utils/useGeneratedId.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nconst useGeneratedId = () =>\n useMemo(() => Math.random().toString(16).slice(2), []);\n\nexport default useGeneratedId;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useGeneratedId.js","names":["useGeneratedId","useMemo","Math","random","toString","slice"],"sources":["../../../src/utils/useGeneratedId.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nconst useGeneratedId = () =>\n useMemo(() => Math.random().toString(16).slice(2), []);\n\nexport default useGeneratedId;\n"],"mappings":";;;;;;AAAA;AAEA,IAAMA,cAAc,GAAG,SAAjBA,cAAc;EAAA,OAClB,IAAAC,cAAO,EAAC;IAAA,OAAMC,IAAI,CAACC,MAAM,EAAE,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,KAAK,CAAC,CAAC,CAAC;EAAA,GAAE,EAAE,CAAC;AAAA;AAAC,eAE1CL,cAAc;AAAA"}
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var useGetNodeStyle = function useGetNodeStyle(size) {
|
|
11
9
|
var sizeRef = (0, _react.useRef)(size);
|
|
12
10
|
(0, _react.useEffect)(function () {
|
|
@@ -22,7 +20,6 @@ var useGetNodeStyle = function useGetNodeStyle(size) {
|
|
|
22
20
|
return style;
|
|
23
21
|
}, []);
|
|
24
22
|
};
|
|
25
|
-
|
|
26
23
|
var _default = useGetNodeStyle;
|
|
27
24
|
exports["default"] = _default;
|
|
28
25
|
//# sourceMappingURL=useGetNodeStyle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetNodeStyle.js","names":["useGetNodeStyle","size","sizeRef","useRef","useEffect","current","useCallback","type","horizontal","translateFn","sizeProp","sign","style","transform"],"sources":["../../../src/utils/useGetNodeStyle.ts"],"sourcesContent":["import { CSSProperties, useCallback, useEffect, useRef } from 'react';\n\ninterface InitSize {\n initWidth: number;\n initHeight: number;\n}\n\nexport type NodeStyleGetter = (\n type: 'up' | 'down' | 'init',\n horizontal: boolean\n) => CSSProperties;\n\nconst useGetNodeStyle = (size: InitSize | null): NodeStyleGetter => {\n const sizeRef = useRef(size);\n\n useEffect(() => {\n sizeRef.current = size;\n }, [size]);\n\n return useCallback<NodeStyleGetter>((type, horizontal) => {\n if (type === 'init' || !sizeRef.current) return {};\n\n const translateFn = horizontal ? 'translateX' : 'translateY';\n const sizeProp = horizontal ? 'initWidth' : 'initHeight';\n const sign = type === 'down' ? 1 : -1;\n\n const style: CSSProperties = {};\n style.transform = `${translateFn}(${sign * sizeRef.current[sizeProp]}px)`;\n\n return style;\n }, []);\n};\n\nexport default useGetNodeStyle;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useGetNodeStyle.js","names":["useGetNodeStyle","size","sizeRef","useRef","useEffect","current","useCallback","type","horizontal","translateFn","sizeProp","sign","style","transform"],"sources":["../../../src/utils/useGetNodeStyle.ts"],"sourcesContent":["import { CSSProperties, useCallback, useEffect, useRef } from 'react';\n\ninterface InitSize {\n initWidth: number;\n initHeight: number;\n}\n\nexport type NodeStyleGetter = (\n type: 'up' | 'down' | 'init',\n horizontal: boolean\n) => CSSProperties;\n\nconst useGetNodeStyle = (size: InitSize | null): NodeStyleGetter => {\n const sizeRef = useRef(size);\n\n useEffect(() => {\n sizeRef.current = size;\n }, [size]);\n\n return useCallback<NodeStyleGetter>((type, horizontal) => {\n if (type === 'init' || !sizeRef.current) return {};\n\n const translateFn = horizontal ? 'translateX' : 'translateY';\n const sizeProp = horizontal ? 'initWidth' : 'initHeight';\n const sign = type === 'down' ? 1 : -1;\n\n const style: CSSProperties = {};\n style.transform = `${translateFn}(${sign * sizeRef.current[sizeProp]}px)`;\n\n return style;\n }, []);\n};\n\nexport default useGetNodeStyle;\n"],"mappings":";;;;;;AAAA;AAYA,IAAMA,eAAe,GAAG,SAAlBA,eAAe,CAAIC,IAAqB,EAAsB;EAClE,IAAMC,OAAO,GAAG,IAAAC,aAAM,EAACF,IAAI,CAAC;EAE5B,IAAAG,gBAAS,EAAC,YAAM;IACdF,OAAO,CAACG,OAAO,GAAGJ,IAAI;EACxB,CAAC,EAAE,CAACA,IAAI,CAAC,CAAC;EAEV,OAAO,IAAAK,kBAAW,EAAkB,UAACC,IAAI,EAAEC,UAAU,EAAK;IACxD,IAAID,IAAI,KAAK,MAAM,IAAI,CAACL,OAAO,CAACG,OAAO,EAAE,OAAO,CAAC,CAAC;IAElD,IAAMI,WAAW,GAAGD,UAAU,GAAG,YAAY,GAAG,YAAY;IAC5D,IAAME,QAAQ,GAAGF,UAAU,GAAG,WAAW,GAAG,YAAY;IACxD,IAAMG,IAAI,GAAGJ,IAAI,KAAK,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;IAErC,IAAMK,KAAoB,GAAG,CAAC,CAAC;IAC/BA,KAAK,CAACC,SAAS,aAAMJ,WAAW,cAAIE,IAAI,GAAGT,OAAO,CAACG,OAAO,CAACK,QAAQ,CAAC,QAAK;IAEzE,OAAOE,KAAK;EACd,CAAC,EAAE,EAAE,CAAC;AACR,CAAC;AAAC,eAEaZ,eAAe;AAAA"}
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var useInitRect = function useInitRect(ref) {
|
|
11
9
|
return (0, _react.useMemo)(function () {
|
|
12
10
|
if (!ref || !ref.current) return null;
|
|
@@ -19,7 +17,6 @@ var useInitRect = function useInitRect(ref) {
|
|
|
19
17
|
};
|
|
20
18
|
}, [ref]);
|
|
21
19
|
};
|
|
22
|
-
|
|
23
20
|
var _default = useInitRect;
|
|
24
21
|
exports["default"] = _default;
|
|
25
22
|
//# sourceMappingURL=useInitRect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInitRect.js","names":["useInitRect","ref","useMemo","current","rect","getBoundingClientRect","initX","x","initY","y","initWidth","width","initHeight","height"],"sources":["../../../src/utils/useInitRect.ts"],"sourcesContent":["import { RefObject, useMemo } from 'react';\n\nconst useInitRect = (ref?: RefObject<HTMLElement>) =>\n useMemo(() => {\n if (!ref || !ref.current) return null;\n\n const rect = ref.current.getBoundingClientRect();\n\n return {\n initX: rect.x,\n initY: rect.y,\n initWidth: rect.width,\n initHeight: rect.height,\n };\n }, [ref]);\n\nexport default useInitRect;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useInitRect.js","names":["useInitRect","ref","useMemo","current","rect","getBoundingClientRect","initX","x","initY","y","initWidth","width","initHeight","height"],"sources":["../../../src/utils/useInitRect.ts"],"sourcesContent":["import { RefObject, useMemo } from 'react';\n\nconst useInitRect = (ref?: RefObject<HTMLElement>) =>\n useMemo(() => {\n if (!ref || !ref.current) return null;\n\n const rect = ref.current.getBoundingClientRect();\n\n return {\n initX: rect.x,\n initY: rect.y,\n initWidth: rect.width,\n initHeight: rect.height,\n };\n }, [ref]);\n\nexport default useInitRect;\n"],"mappings":";;;;;;AAAA;AAEA,IAAMA,WAAW,GAAG,SAAdA,WAAW,CAAIC,GAA4B;EAAA,OAC/C,IAAAC,cAAO,EAAC,YAAM;IACZ,IAAI,CAACD,GAAG,IAAI,CAACA,GAAG,CAACE,OAAO,EAAE,OAAO,IAAI;IAErC,IAAMC,IAAI,GAAGH,GAAG,CAACE,OAAO,CAACE,qBAAqB,EAAE;IAEhD,OAAO;MACLC,KAAK,EAAEF,IAAI,CAACG,CAAC;MACbC,KAAK,EAAEJ,IAAI,CAACK,CAAC;MACbC,SAAS,EAAEN,IAAI,CAACO,KAAK;MACrBC,UAAU,EAAER,IAAI,CAACS;IACnB,CAAC;EACH,CAAC,EAAE,CAACZ,GAAG,CAAC,CAAC;AAAA;AAAC,eAEGD,WAAW;AAAA"}
|
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _getElementScroll = _interopRequireDefault(require("./getElementScroll"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
10
|
var useInitScrollOffset = function useInitScrollOffset(ref) {
|
|
15
11
|
return (0, _react.useMemo)(function () {
|
|
16
12
|
if (!ref || !ref.current) return null;
|
|
@@ -21,7 +17,6 @@ var useInitScrollOffset = function useInitScrollOffset(ref) {
|
|
|
21
17
|
};
|
|
22
18
|
}, [ref]);
|
|
23
19
|
};
|
|
24
|
-
|
|
25
20
|
var _default = useInitScrollOffset;
|
|
26
21
|
exports["default"] = _default;
|
|
27
22
|
//# sourceMappingURL=useInitScrollOffset.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInitScrollOffset.js","names":["useInitScrollOffset","ref","useMemo","current","scrollOffset","getElementScroll","initScrollLeft","scrollLeft","initScrollTop","scrollTop"],"sources":["../../../src/utils/useInitScrollOffset.ts"],"sourcesContent":["import { RefObject, useMemo } from 'react';\nimport getElementScroll from './getElementScroll';\n\nconst useInitScrollOffset = (ref?: RefObject<HTMLElement>) =>\n useMemo(() => {\n if (!ref || !ref.current) return null;\n\n const scrollOffset = getElementScroll(ref.current);\n\n return {\n initScrollLeft: scrollOffset.scrollLeft,\n initScrollTop: scrollOffset.scrollTop,\n };\n }, [ref]);\n\nexport default useInitScrollOffset;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useInitScrollOffset.js","names":["useInitScrollOffset","ref","useMemo","current","scrollOffset","getElementScroll","initScrollLeft","scrollLeft","initScrollTop","scrollTop"],"sources":["../../../src/utils/useInitScrollOffset.ts"],"sourcesContent":["import { RefObject, useMemo } from 'react';\nimport getElementScroll from './getElementScroll';\n\nconst useInitScrollOffset = (ref?: RefObject<HTMLElement>) =>\n useMemo(() => {\n if (!ref || !ref.current) return null;\n\n const scrollOffset = getElementScroll(ref.current);\n\n return {\n initScrollLeft: scrollOffset.scrollLeft,\n initScrollTop: scrollOffset.scrollTop,\n };\n }, [ref]);\n\nexport default useInitScrollOffset;\n"],"mappings":";;;;;;AAAA;AACA;AAAkD;AAElD,IAAMA,mBAAmB,GAAG,SAAtBA,mBAAmB,CAAIC,GAA4B;EAAA,OACvD,IAAAC,cAAO,EAAC,YAAM;IACZ,IAAI,CAACD,GAAG,IAAI,CAACA,GAAG,CAACE,OAAO,EAAE,OAAO,IAAI;IAErC,IAAMC,YAAY,GAAG,IAAAC,4BAAgB,EAACJ,GAAG,CAACE,OAAO,CAAC;IAElD,OAAO;MACLG,cAAc,EAAEF,YAAY,CAACG,UAAU;MACvCC,aAAa,EAAEJ,YAAY,CAACK;IAC9B,CAAC;EACH,CAAC,EAAE,CAACR,GAAG,CAAC,CAAC;AAAA;AAAC,eAEGD,mBAAmB;AAAA"}
|
|
@@ -4,113 +4,88 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _getNodeRect = _interopRequireDefault(require("./getNodeRect"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
10
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
|
-
|
|
16
11
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
-
|
|
18
12
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
19
|
-
|
|
20
13
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
21
|
-
|
|
22
14
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
23
|
-
|
|
24
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
25
|
-
|
|
26
16
|
/* eslint-disable no-constant-condition */
|
|
17
|
+
|
|
27
18
|
var useMoveNode = function useMoveNode(props) {
|
|
28
19
|
var position = props.position,
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
draggedNode = props.draggedNode,
|
|
21
|
+
getNodeStyle = props.getNodeStyle;
|
|
31
22
|
return (0, _react.useCallback)(function (options) {
|
|
32
23
|
var list = options.list,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
startNode = options.startNode,
|
|
25
|
+
direction = options.direction,
|
|
26
|
+
destination = options.destination,
|
|
27
|
+
_options$isAnotherLis = options.isAnotherList,
|
|
28
|
+
isAnotherList = _options$isAnotherLis === void 0 ? false : _options$isAnotherLis;
|
|
38
29
|
if (!draggedNode || !position) return startNode;
|
|
39
|
-
|
|
40
30
|
var _draggedNode$node = _slicedToArray(draggedNode.node, 5),
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
draggedNodeIndex = _draggedNode$node[4];
|
|
43
32
|
var axis = list.horizontal ? 'x' : 'y';
|
|
44
33
|
var startRectProp = list.horizontal ? 'left' : 'top';
|
|
45
34
|
var endRectProp = list.horizontal ? 'right' : 'bottom';
|
|
46
35
|
var node = startNode;
|
|
47
|
-
|
|
48
36
|
if (direction === 'up') {
|
|
49
37
|
while (true) {
|
|
50
38
|
var _node = node,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
39
|
+
_node2 = _slicedToArray(_node, 5),
|
|
40
|
+
prev = _node2[0],
|
|
41
|
+
nodeSetStyle = _node2[3],
|
|
42
|
+
nodeIndex = _node2[4];
|
|
56
43
|
if (!prev) return node;
|
|
57
|
-
|
|
58
44
|
var _prev = _slicedToArray(prev, 5),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
45
|
+
prevNodeRef = _prev[2],
|
|
46
|
+
prevNodeSetStyle = _prev[3],
|
|
47
|
+
prevNodeIndex = _prev[4];
|
|
63
48
|
if (destination === 'cursor') {
|
|
64
49
|
var prevNodeRect = (0, _getNodeRect["default"])(prevNodeRef);
|
|
65
|
-
|
|
66
50
|
if (prevNodeRect && position[axis] > prevNodeRect[endRectProp]) {
|
|
67
51
|
return node;
|
|
68
52
|
}
|
|
69
53
|
}
|
|
70
|
-
|
|
71
54
|
if (isAnotherList || prevNodeIndex < draggedNodeIndex) {
|
|
72
55
|
prevNodeSetStyle(getNodeStyle('down', list.horizontal));
|
|
73
56
|
} else if (nodeIndex > draggedNodeIndex) {
|
|
74
57
|
nodeSetStyle(getNodeStyle('init', list.horizontal));
|
|
75
58
|
}
|
|
76
|
-
|
|
77
59
|
node = prev;
|
|
78
60
|
}
|
|
79
61
|
} else {
|
|
80
62
|
while (true) {
|
|
81
63
|
var _node3 = node,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
64
|
+
_node4 = _slicedToArray(_node3, 5),
|
|
65
|
+
next = _node4[1],
|
|
66
|
+
_nodeSetStyle = _node4[3],
|
|
67
|
+
_nodeIndex = _node4[4];
|
|
87
68
|
if (!next) return node;
|
|
88
|
-
|
|
89
69
|
var _next = _slicedToArray(next, 5),
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
70
|
+
nextNodeRef = _next[2],
|
|
71
|
+
nextNodeSetStyle = _next[3],
|
|
72
|
+
nextNodeIndex = _next[4];
|
|
94
73
|
if (destination === 'cursor') {
|
|
95
74
|
var nextNodeRect = (0, _getNodeRect["default"])(nextNodeRef);
|
|
96
|
-
|
|
97
75
|
if (nextNodeRect && position[axis] < nextNodeRect[startRectProp]) {
|
|
98
76
|
return node;
|
|
99
77
|
}
|
|
100
78
|
}
|
|
101
|
-
|
|
102
79
|
if (isAnotherList || _nodeIndex < draggedNodeIndex) {
|
|
103
80
|
_nodeSetStyle(getNodeStyle('init', list.horizontal));
|
|
104
81
|
} else if (nextNodeIndex > draggedNodeIndex) {
|
|
105
82
|
nextNodeSetStyle(getNodeStyle('up', list.horizontal));
|
|
106
83
|
}
|
|
107
|
-
|
|
108
84
|
node = next;
|
|
109
85
|
}
|
|
110
86
|
}
|
|
111
87
|
}, [draggedNode, getNodeStyle, position]);
|
|
112
88
|
};
|
|
113
|
-
|
|
114
89
|
var _default = useMoveNode;
|
|
115
90
|
exports["default"] = _default;
|
|
116
91
|
//# sourceMappingURL=useMoveNode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMoveNode.js","names":["useMoveNode","props","position","draggedNode","getNodeStyle","useCallback","options","list","startNode","direction","destination","isAnotherList","node","draggedNodeIndex","axis","horizontal","startRectProp","endRectProp","prev","nodeSetStyle","nodeIndex","prevNodeRef","prevNodeSetStyle","prevNodeIndex","prevNodeRect","getNodeRect","next","nextNodeRef","nextNodeSetStyle","nextNodeIndex","nextNodeRect"],"sources":["../../../src/utils/useMoveNode.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { Position } from '@os-design/use-drag';\nimport NodeList, { ExistingNode } from './NodeList';\nimport getNodeRect from './getNodeRect';\nimport { NodeStyleGetter } from './useGetNodeStyle';\n\ninterface DraggedNode {\n node: ExistingNode;\n}\n\ninterface UseMoveNodeProps {\n position: Position | null;\n draggedNode: DraggedNode | null;\n getNodeStyle: NodeStyleGetter;\n}\n\ninterface MoveProps {\n list: NodeList;\n startNode: ExistingNode;\n direction: 'up' | 'down';\n destination: 'cursor' | 'end';\n isAnotherList?: boolean;\n}\n\n/* eslint-disable no-constant-condition */\n\nconst useMoveNode = (props: UseMoveNodeProps) => {\n const { position, draggedNode, getNodeStyle } = props;\n\n return useCallback(\n (options: MoveProps) => {\n const {\n list,\n startNode,\n direction,\n destination,\n isAnotherList = false,\n } = options;\n\n if (!draggedNode || !position) return startNode;\n const [, , , , draggedNodeIndex] = draggedNode.node;\n const axis = list.horizontal ? 'x' : 'y';\n const startRectProp = list.horizontal ? 'left' : 'top';\n const endRectProp = list.horizontal ? 'right' : 'bottom';\n let node = startNode;\n\n if (direction === 'up') {\n while (true) {\n const [prev, , , nodeSetStyle, nodeIndex] = node;\n if (!prev) return node;\n\n const [, , prevNodeRef, prevNodeSetStyle, prevNodeIndex] = prev;\n\n if (destination === 'cursor') {\n const prevNodeRect = getNodeRect(prevNodeRef);\n if (prevNodeRect && position[axis] > prevNodeRect[endRectProp]) {\n return node;\n }\n }\n\n if (isAnotherList || prevNodeIndex < draggedNodeIndex) {\n prevNodeSetStyle(getNodeStyle('down', list.horizontal));\n } else if (nodeIndex > draggedNodeIndex) {\n nodeSetStyle(getNodeStyle('init', list.horizontal));\n }\n\n node = prev;\n }\n } else {\n while (true) {\n const [, next, , nodeSetStyle, nodeIndex] = node;\n if (!next) return node;\n\n const [, , nextNodeRef, nextNodeSetStyle, nextNodeIndex] = next;\n\n if (destination === 'cursor') {\n const nextNodeRect = getNodeRect(nextNodeRef);\n if (nextNodeRect && position[axis] < nextNodeRect[startRectProp]) {\n return node;\n }\n }\n\n if (isAnotherList || nodeIndex < draggedNodeIndex) {\n nodeSetStyle(getNodeStyle('init', list.horizontal));\n } else if (nextNodeIndex > draggedNodeIndex) {\n nextNodeSetStyle(getNodeStyle('up', list.horizontal));\n }\n\n node = next;\n }\n }\n },\n [draggedNode, getNodeStyle, position]\n );\n};\n\nexport default useMoveNode;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useMoveNode.js","names":["useMoveNode","props","position","draggedNode","getNodeStyle","useCallback","options","list","startNode","direction","destination","isAnotherList","node","draggedNodeIndex","axis","horizontal","startRectProp","endRectProp","prev","nodeSetStyle","nodeIndex","prevNodeRef","prevNodeSetStyle","prevNodeIndex","prevNodeRect","getNodeRect","next","nextNodeRef","nextNodeSetStyle","nextNodeIndex","nextNodeRect"],"sources":["../../../src/utils/useMoveNode.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { Position } from '@os-design/use-drag';\nimport NodeList, { ExistingNode } from './NodeList';\nimport getNodeRect from './getNodeRect';\nimport { NodeStyleGetter } from './useGetNodeStyle';\n\ninterface DraggedNode {\n node: ExistingNode;\n}\n\ninterface UseMoveNodeProps {\n position: Position | null;\n draggedNode: DraggedNode | null;\n getNodeStyle: NodeStyleGetter;\n}\n\ninterface MoveProps {\n list: NodeList;\n startNode: ExistingNode;\n direction: 'up' | 'down';\n destination: 'cursor' | 'end';\n isAnotherList?: boolean;\n}\n\n/* eslint-disable no-constant-condition */\n\nconst useMoveNode = (props: UseMoveNodeProps) => {\n const { position, draggedNode, getNodeStyle } = props;\n\n return useCallback(\n (options: MoveProps) => {\n const {\n list,\n startNode,\n direction,\n destination,\n isAnotherList = false,\n } = options;\n\n if (!draggedNode || !position) return startNode;\n const [, , , , draggedNodeIndex] = draggedNode.node;\n const axis = list.horizontal ? 'x' : 'y';\n const startRectProp = list.horizontal ? 'left' : 'top';\n const endRectProp = list.horizontal ? 'right' : 'bottom';\n let node = startNode;\n\n if (direction === 'up') {\n while (true) {\n const [prev, , , nodeSetStyle, nodeIndex] = node;\n if (!prev) return node;\n\n const [, , prevNodeRef, prevNodeSetStyle, prevNodeIndex] = prev;\n\n if (destination === 'cursor') {\n const prevNodeRect = getNodeRect(prevNodeRef);\n if (prevNodeRect && position[axis] > prevNodeRect[endRectProp]) {\n return node;\n }\n }\n\n if (isAnotherList || prevNodeIndex < draggedNodeIndex) {\n prevNodeSetStyle(getNodeStyle('down', list.horizontal));\n } else if (nodeIndex > draggedNodeIndex) {\n nodeSetStyle(getNodeStyle('init', list.horizontal));\n }\n\n node = prev;\n }\n } else {\n while (true) {\n const [, next, , nodeSetStyle, nodeIndex] = node;\n if (!next) return node;\n\n const [, , nextNodeRef, nextNodeSetStyle, nextNodeIndex] = next;\n\n if (destination === 'cursor') {\n const nextNodeRect = getNodeRect(nextNodeRef);\n if (nextNodeRect && position[axis] < nextNodeRect[startRectProp]) {\n return node;\n }\n }\n\n if (isAnotherList || nodeIndex < draggedNodeIndex) {\n nodeSetStyle(getNodeStyle('init', list.horizontal));\n } else if (nextNodeIndex > draggedNodeIndex) {\n nextNodeSetStyle(getNodeStyle('up', list.horizontal));\n }\n\n node = next;\n }\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AAC,EACD,CAACvB,WAAW,EAAEC,YAAY,EAAEF,QAAQ,CAAC,CACtC;AACH,CAAC;AAAC,eAEaF,WAAW;AAAA"}
|
|
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _useAutoScroll = require("@os-design/use-auto-scroll");
|
|
11
|
-
|
|
12
9
|
var compare = function compare(prevArr, nextArr) {
|
|
13
10
|
var remove = [];
|
|
14
11
|
var add = [];
|
|
@@ -23,7 +20,6 @@ var compare = function compare(prevArr, nextArr) {
|
|
|
23
20
|
add: add
|
|
24
21
|
};
|
|
25
22
|
};
|
|
26
|
-
|
|
27
23
|
/**
|
|
28
24
|
* Sets the listener that will be called whenever the scroll event occurs
|
|
29
25
|
* in one of the elements located under the specified point.
|
|
@@ -40,15 +36,12 @@ var useScrollEventByPoint = function useScrollEventByPoint(point, listener) {
|
|
|
40
36
|
(0, _react.useEffect)(function () {
|
|
41
37
|
if (!point) return;
|
|
42
38
|
var scrollableElements = (0, _useAutoScroll.getScrollableElements)(point.x, point.y);
|
|
43
|
-
|
|
44
39
|
var _compare = compare(elementsRef.current, scrollableElements),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
remove = _compare.remove,
|
|
41
|
+
add = _compare.add;
|
|
48
42
|
var getTarget = function getTarget(item) {
|
|
49
43
|
return item === document.body ? window : item;
|
|
50
44
|
};
|
|
51
|
-
|
|
52
45
|
remove.forEach(function (item) {
|
|
53
46
|
var index = elementsRef.current.indexOf(item);
|
|
54
47
|
if (index >= 0) elementsRef.current.splice(index, 1);
|
|
@@ -60,7 +53,6 @@ var useScrollEventByPoint = function useScrollEventByPoint(point, listener) {
|
|
|
60
53
|
});
|
|
61
54
|
}, [eventListener, point]);
|
|
62
55
|
};
|
|
63
|
-
|
|
64
56
|
var _default = useScrollEventByPoint;
|
|
65
57
|
exports["default"] = _default;
|
|
66
58
|
//# sourceMappingURL=useScrollEventByPoint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScrollEventByPoint.js","names":["compare","prevArr","nextArr","remove","add","forEach","item","includes","push","useScrollEventByPoint","point","listener","listenerRef","useRef","useEffect","current","eventListener","useCallback","e","elementsRef","scrollableElements","getScrollableElements","x","y","getTarget","document","body","window","index","indexOf","splice","removeEventListener","addEventListener"],"sources":["../../../src/utils/useScrollEventByPoint.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react';\nimport { getScrollableElements } from '@os-design/use-auto-scroll';\n\nconst compare = <T>(prevArr: T[], nextArr: T[]) => {\n const remove: T[] = [];\n const add: T[] = [];\n prevArr.forEach((item) => {\n if (!nextArr.includes(item)) remove.push(item);\n });\n nextArr.forEach((item) => {\n if (!prevArr.includes(item)) add.push(item);\n });\n return { remove, add };\n};\n\nexport interface Point {\n x: number;\n y: number;\n}\n\n/**\n * Sets the listener that will be called whenever the scroll event occurs\n * in one of the elements located under the specified point.\n */\nconst useScrollEventByPoint = (\n point: Point | null,\n listener: (e: Event) => void\n) => {\n const listenerRef = useRef(listener);\n useEffect(() => {\n listenerRef.current = listener;\n }, [listener]);\n\n const eventListener = useCallback((e: Event) => listenerRef.current(e), []);\n const elementsRef = useRef<Element[]>([]);\n\n useEffect(() => {\n if (!point) return;\n const scrollableElements = getScrollableElements(point.x, point.y);\n const { remove, add } = compare(elementsRef.current, scrollableElements);\n const getTarget = (item: Element) =>\n item === document.body ? window : item;\n\n remove.forEach((item) => {\n const index = elementsRef.current.indexOf(item);\n if (index >= 0) elementsRef.current.splice(index, 1);\n getTarget(item).removeEventListener('scroll', eventListener);\n });\n add.forEach((item) => {\n elementsRef.current.push(item);\n getTarget(item).addEventListener('scroll', eventListener);\n });\n }, [eventListener, point]);\n};\n\nexport default useScrollEventByPoint;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useScrollEventByPoint.js","names":["compare","prevArr","nextArr","remove","add","forEach","item","includes","push","useScrollEventByPoint","point","listener","listenerRef","useRef","useEffect","current","eventListener","useCallback","e","elementsRef","scrollableElements","getScrollableElements","x","y","getTarget","document","body","window","index","indexOf","splice","removeEventListener","addEventListener"],"sources":["../../../src/utils/useScrollEventByPoint.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react';\nimport { getScrollableElements } from '@os-design/use-auto-scroll';\n\nconst compare = <T>(prevArr: T[], nextArr: T[]) => {\n const remove: T[] = [];\n const add: T[] = [];\n prevArr.forEach((item) => {\n if (!nextArr.includes(item)) remove.push(item);\n });\n nextArr.forEach((item) => {\n if (!prevArr.includes(item)) add.push(item);\n });\n return { remove, add };\n};\n\nexport interface Point {\n x: number;\n y: number;\n}\n\n/**\n * Sets the listener that will be called whenever the scroll event occurs\n * in one of the elements located under the specified point.\n */\nconst useScrollEventByPoint = (\n point: Point | null,\n listener: (e: Event) => void\n) => {\n const listenerRef = useRef(listener);\n useEffect(() => {\n listenerRef.current = listener;\n }, [listener]);\n\n const eventListener = useCallback((e: Event) => listenerRef.current(e), []);\n const elementsRef = useRef<Element[]>([]);\n\n useEffect(() => {\n if (!point) return;\n const scrollableElements = getScrollableElements(point.x, point.y);\n const { remove, add } = compare(elementsRef.current, scrollableElements);\n const getTarget = (item: Element) =>\n item === document.body ? window : item;\n\n remove.forEach((item) => {\n const index = elementsRef.current.indexOf(item);\n if (index >= 0) elementsRef.current.splice(index, 1);\n getTarget(item).removeEventListener('scroll', eventListener);\n });\n add.forEach((item) => {\n elementsRef.current.push(item);\n getTarget(item).addEventListener('scroll', eventListener);\n });\n }, [eventListener, point]);\n};\n\nexport default useScrollEventByPoint;\n"],"mappings":";;;;;;AAAA;AACA;AAEA,IAAMA,OAAO,GAAG,SAAVA,OAAO,CAAOC,OAAY,EAAEC,OAAY,EAAK;EACjD,IAAMC,MAAW,GAAG,EAAE;EACtB,IAAMC,GAAQ,GAAG,EAAE;EACnB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