@new-black/lyra 1.3.0 → 1.3.1
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/components/inputs/search-list-field/search-list-field.d.ts.map +1 -1
- package/dist/lyra103.cjs +1 -1
- package/dist/lyra103.js +1 -1
- package/dist/lyra104.cjs +1 -1
- package/dist/lyra104.cjs.map +1 -1
- package/dist/lyra104.js +31 -14
- package/dist/lyra104.js.map +1 -1
- package/dist/lyra105.cjs +1 -1
- package/dist/lyra105.cjs.map +1 -1
- package/dist/lyra105.js +90 -12
- package/dist/lyra105.js.map +1 -1
- package/dist/lyra106.cjs +1 -1
- package/dist/lyra106.cjs.map +1 -1
- package/dist/lyra106.js +44 -15
- package/dist/lyra106.js.map +1 -1
- package/dist/lyra107.cjs +1 -1
- package/dist/lyra107.cjs.map +1 -1
- package/dist/lyra107.js +52 -572
- package/dist/lyra107.js.map +1 -1
- package/dist/lyra108.cjs +1 -1
- package/dist/lyra108.cjs.map +1 -1
- package/dist/lyra108.js +40 -77
- package/dist/lyra108.js.map +1 -1
- package/dist/lyra109.cjs +1 -1
- package/dist/lyra109.cjs.map +1 -1
- package/dist/lyra109.js +7 -44
- package/dist/lyra109.js.map +1 -1
- package/dist/lyra110.cjs +1 -1
- package/dist/lyra110.cjs.map +1 -1
- package/dist/lyra110.js +61 -30
- package/dist/lyra110.js.map +1 -1
- package/dist/lyra111.cjs +1 -1
- package/dist/lyra111.cjs.map +1 -1
- package/dist/lyra111.js +37 -52
- package/dist/lyra111.js.map +1 -1
- package/dist/lyra112.cjs +5 -1
- package/dist/lyra112.cjs.map +1 -1
- package/dist/lyra112.js +2557 -52
- package/dist/lyra112.js.map +1 -1
- package/dist/lyra113.cjs +1 -1
- package/dist/lyra113.cjs.map +1 -1
- package/dist/lyra113.js +50 -6
- package/dist/lyra113.js.map +1 -1
- package/dist/lyra114.cjs +1 -1
- package/dist/lyra114.cjs.map +1 -1
- package/dist/lyra114.js +569 -59
- package/dist/lyra114.js.map +1 -1
- package/dist/lyra115.cjs +1 -1
- package/dist/lyra115.cjs.map +1 -1
- package/dist/lyra115.js +14 -37
- package/dist/lyra115.js.map +1 -1
- package/dist/lyra116.cjs +1 -5
- package/dist/lyra116.cjs.map +1 -1
- package/dist/lyra116.js +10 -2556
- package/dist/lyra116.js.map +1 -1
- package/dist/lyra117.cjs +1 -1
- package/dist/lyra117.cjs.map +1 -1
- package/dist/lyra117.js +14 -50
- package/dist/lyra117.js.map +1 -1
- package/dist/lyra119.cjs +1 -1
- package/dist/lyra119.js +1 -1
- package/dist/lyra120.cjs +1 -1
- package/dist/lyra120.js +1 -1
- package/dist/lyra121.cjs +1 -1
- package/dist/lyra121.js +1 -1
- package/dist/lyra122.cjs +1 -1
- package/dist/lyra122.js +1 -1
- package/dist/lyra159.cjs +1 -1
- package/dist/lyra159.js +1 -1
- package/dist/lyra160.cjs +1 -1
- package/dist/lyra160.js +1 -1
- package/dist/lyra162.cjs +1 -1
- package/dist/lyra162.js +1 -1
- package/dist/lyra163.cjs +1 -1
- package/dist/lyra163.js +1 -1
- package/dist/lyra165.cjs +1 -1
- package/dist/lyra165.js +1 -1
- package/dist/lyra201.cjs +1 -1
- package/dist/lyra201.js +1 -1
- package/dist/lyra202.cjs +1 -1
- package/dist/lyra202.js +1 -1
- package/dist/lyra203.cjs +1 -1
- package/dist/lyra203.js +1 -1
- package/dist/lyra204.cjs +1 -1
- package/dist/lyra204.js +1 -1
- package/dist/lyra243.cjs +1 -1
- package/dist/lyra243.js +1 -1
- package/dist/lyra244.cjs +1 -1
- package/dist/lyra244.js +1 -1
- package/dist/lyra245.cjs +1 -1
- package/dist/lyra245.js +1 -1
- package/dist/lyra246.cjs +1 -1
- package/dist/lyra246.js +1 -1
- package/dist/lyra247.cjs +1 -1
- package/dist/lyra247.js +1 -1
- package/dist/lyra249.cjs +1 -1
- package/dist/lyra249.js +1 -1
- package/dist/lyra26.cjs +1 -1
- package/dist/lyra26.js +1 -1
- package/dist/lyra284.cjs +1 -1
- package/dist/lyra284.js +1 -1
- package/dist/lyra29.cjs +1 -1
- package/dist/lyra29.js +1 -1
- package/dist/lyra319.cjs +1 -1
- package/dist/lyra319.js +1 -1
- package/dist/lyra33.cjs +1 -1
- package/dist/lyra33.js +1 -1
- package/dist/lyra354.cjs +1 -1
- package/dist/lyra354.js +1 -1
- package/dist/lyra356.cjs +1 -1
- package/dist/lyra356.js +1 -1
- package/dist/lyra357.cjs +1 -1
- package/dist/lyra357.js +1 -1
- package/dist/lyra358.cjs +1 -1
- package/dist/lyra358.js +1 -1
- package/dist/lyra36.cjs +1 -1
- package/dist/lyra36.js +6 -6
- package/dist/lyra37.cjs +1 -1
- package/dist/lyra37.cjs.map +1 -1
- package/dist/lyra37.js +600 -586
- package/dist/lyra37.js.map +1 -1
- package/dist/lyra393.cjs +1 -1
- package/dist/lyra393.js +1 -1
- package/dist/lyra395.cjs +1 -1
- package/dist/lyra395.js +1 -1
- package/dist/lyra43.cjs +1 -1
- package/dist/lyra43.js +5 -5
- package/dist/lyra431.cjs +1 -1
- package/dist/lyra431.js +1 -1
- package/dist/lyra432.cjs +1 -1
- package/dist/lyra432.js +1 -1
- package/dist/lyra44.cjs +1 -1
- package/dist/lyra44.js +1 -1
- package/dist/lyra45.cjs +1 -1
- package/dist/lyra45.js +2 -2
- package/dist/lyra467.cjs +1 -1
- package/dist/lyra467.js +1 -1
- package/dist/lyra469.cjs +1 -1
- package/dist/lyra469.js +1 -1
- package/dist/lyra470.cjs +1 -1
- package/dist/lyra470.js +4 -4
- package/dist/lyra471.cjs +1 -1
- package/dist/lyra471.js +5 -5
- package/dist/lyra474.cjs +1 -1
- package/dist/lyra474.js +4 -4
- package/dist/lyra48.cjs +1 -1
- package/dist/lyra48.js +1 -1
- package/dist/lyra51.cjs +1 -1
- package/dist/lyra51.js +3 -3
- package/dist/lyra52.cjs +1 -1
- package/dist/lyra52.js +2 -2
- package/dist/lyra534.cjs +1 -1
- package/dist/lyra534.js +4 -4
- package/dist/lyra541.cjs +1 -1
- package/dist/lyra541.cjs.map +1 -1
- package/dist/lyra541.js +7 -26
- package/dist/lyra541.js.map +1 -1
- package/dist/lyra542.cjs +1 -1
- package/dist/lyra542.cjs.map +1 -1
- package/dist/lyra542.js +233 -7
- package/dist/lyra542.js.map +1 -1
- package/dist/lyra543.cjs +1 -1
- package/dist/lyra543.cjs.map +1 -1
- package/dist/lyra543.js +15 -232
- package/dist/lyra543.js.map +1 -1
- package/dist/lyra544.cjs +1 -1
- package/dist/lyra544.cjs.map +1 -1
- package/dist/lyra544.js +478 -12
- package/dist/lyra544.js.map +1 -1
- package/dist/lyra545.cjs +1 -1
- package/dist/lyra545.cjs.map +1 -1
- package/dist/lyra545.js +60 -476
- package/dist/lyra545.js.map +1 -1
- package/dist/lyra546.cjs +1 -1
- package/dist/lyra546.cjs.map +1 -1
- package/dist/lyra546.js +13 -66
- package/dist/lyra546.js.map +1 -1
- package/dist/lyra547.cjs +1 -1
- package/dist/lyra547.cjs.map +1 -1
- package/dist/lyra547.js +26 -13
- package/dist/lyra547.js.map +1 -1
- package/dist/lyra56.cjs +1 -1
- package/dist/lyra56.js +1 -1
- package/dist/lyra60.cjs +1 -1
- package/dist/lyra60.js +7 -7
- package/dist/lyra61.cjs +1 -1
- package/dist/lyra61.js +3 -3
- package/dist/lyra62.cjs +1 -1
- package/dist/lyra62.js +9 -9
- package/dist/lyra63.cjs +1 -1
- package/dist/lyra63.js +5 -5
- package/dist/lyra69.cjs +1 -1
- package/dist/lyra69.js +5 -5
- package/dist/lyra725.cjs +1 -1
- package/dist/lyra725.js +4 -4
- package/dist/lyra735.cjs +1 -1
- package/dist/lyra735.js +1 -1
- package/dist/lyra736.cjs +1 -1
- package/dist/lyra736.js +1 -1
- package/dist/lyra737.cjs +1 -1
- package/dist/lyra737.js +1 -1
- package/dist/lyra76.cjs +1 -1
- package/dist/lyra76.js +3 -3
- package/dist/lyra798.cjs +1 -1
- package/dist/lyra798.js +2 -2
- package/dist/lyra802.cjs +1 -1
- package/dist/lyra802.js +1 -1
- package/dist/lyra806.cjs +1 -1
- package/dist/lyra806.cjs.map +1 -1
- package/dist/lyra806.js +3 -584
- package/dist/lyra806.js.map +1 -1
- package/dist/lyra807.cjs +1 -1
- package/dist/lyra807.cjs.map +1 -1
- package/dist/lyra807.js +585 -11
- package/dist/lyra807.js.map +1 -1
- package/dist/lyra808.cjs +1 -1
- package/dist/lyra808.cjs.map +1 -1
- package/dist/lyra808.js +11 -4
- package/dist/lyra808.js.map +1 -1
- package/dist/lyra809.cjs +1 -1
- package/dist/lyra809.cjs.map +1 -1
- package/dist/lyra809.js +14 -2
- package/dist/lyra809.js.map +1 -1
- package/dist/lyra810.cjs +1 -1
- package/dist/lyra810.cjs.map +1 -1
- package/dist/lyra810.js +2 -29
- package/dist/lyra810.js.map +1 -1
- package/dist/lyra811.cjs +1 -1
- package/dist/lyra811.cjs.map +1 -1
- package/dist/lyra811.js +29 -6
- package/dist/lyra811.js.map +1 -1
- package/dist/lyra812.cjs +1 -1
- package/dist/lyra812.cjs.map +1 -1
- package/dist/lyra812.js +5 -3
- package/dist/lyra812.js.map +1 -1
- package/dist/lyra813.cjs +1 -1
- package/dist/lyra813.cjs.map +1 -1
- package/dist/lyra813.js +4 -14
- package/dist/lyra813.js.map +1 -1
- package/dist/lyra91.cjs +1 -1
- package/dist/lyra91.js +1 -1
- package/dist/lyra92.cjs +1 -1
- package/dist/lyra92.js +1 -1
- package/package.json +1 -1
package/dist/lyra544.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lyra544.cjs","sources":["../node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js"],"sourcesContent":["import { getEventCoordinates } from '@dnd-kit/utilities';\n\nfunction createSnapModifier(gridSize) {\n return _ref => {\n let {\n transform\n } = _ref;\n return { ...transform,\n x: Math.ceil(transform.x / gridSize) * gridSize,\n y: Math.ceil(transform.y / gridSize) * gridSize\n };\n };\n}\n\nconst restrictToHorizontalAxis = _ref => {\n let {\n transform\n } = _ref;\n return { ...transform,\n y: 0\n };\n};\n\nfunction restrictToBoundingRect(transform, rect, boundingRect) {\n const value = { ...transform\n };\n\n if (rect.top + transform.y <= boundingRect.top) {\n value.y = boundingRect.top - rect.top;\n } else if (rect.bottom + transform.y >= boundingRect.top + boundingRect.height) {\n value.y = boundingRect.top + boundingRect.height - rect.bottom;\n }\n\n if (rect.left + transform.x <= boundingRect.left) {\n value.x = boundingRect.left - rect.left;\n } else if (rect.right + transform.x >= boundingRect.left + boundingRect.width) {\n value.x = boundingRect.left + boundingRect.width - rect.right;\n }\n\n return value;\n}\n\nconst restrictToParentElement = _ref => {\n let {\n containerNodeRect,\n draggingNodeRect,\n transform\n } = _ref;\n\n if (!draggingNodeRect || !containerNodeRect) {\n return transform;\n }\n\n return restrictToBoundingRect(transform, draggingNodeRect, containerNodeRect);\n};\n\nconst restrictToFirstScrollableAncestor = _ref => {\n let {\n draggingNodeRect,\n transform,\n scrollableAncestorRects\n } = _ref;\n const firstScrollableAncestorRect = scrollableAncestorRects[0];\n\n if (!draggingNodeRect || !firstScrollableAncestorRect) {\n return transform;\n }\n\n return restrictToBoundingRect(transform, draggingNodeRect, firstScrollableAncestorRect);\n};\n\nconst restrictToVerticalAxis = _ref => {\n let {\n transform\n } = _ref;\n return { ...transform,\n x: 0\n };\n};\n\nconst restrictToWindowEdges = _ref => {\n let {\n transform,\n draggingNodeRect,\n windowRect\n } = _ref;\n\n if (!draggingNodeRect || !windowRect) {\n return transform;\n }\n\n return restrictToBoundingRect(transform, draggingNodeRect, windowRect);\n};\n\nconst snapCenterToCursor = _ref => {\n let {\n activatorEvent,\n draggingNodeRect,\n transform\n } = _ref;\n\n if (draggingNodeRect && activatorEvent) {\n const activatorCoordinates = getEventCoordinates(activatorEvent);\n\n if (!activatorCoordinates) {\n return transform;\n }\n\n const offsetX = activatorCoordinates.x - draggingNodeRect.left;\n const offsetY = activatorCoordinates.y - draggingNodeRect.top;\n return { ...transform,\n x: transform.x + offsetX - draggingNodeRect.width / 2,\n y: transform.y + offsetY - draggingNodeRect.height / 2\n };\n }\n\n return transform;\n};\n\nexport { createSnapModifier, restrictToFirstScrollableAncestor, restrictToHorizontalAxis, restrictToParentElement, restrictToVerticalAxis, restrictToWindowEdges, snapCenterToCursor };\n//# sourceMappingURL=modifiers.esm.js.map\n"],"names":["restrictToBoundingRect","transform","rect","boundingRect","value","restrictToParentElement","_ref","containerNodeRect","draggingNodeRect"],"mappings":"iGAuBA,SAASA,EAAuBC,EAAWC,EAAMC,EAAc,CAC7D,MAAMC,EAAQ,CAAE,GAAGH,CAClB,EAED,OAAIC,EAAK,IAAMD,EAAU,GAAKE,EAAa,IACzCC,EAAM,EAAID,EAAa,IAAMD,EAAK,IACzBA,EAAK,OAASD,EAAU,GAAKE,EAAa,IAAMA,EAAa,SACtEC,EAAM,EAAID,EAAa,IAAMA,EAAa,OAASD,EAAK,QAGtDA,EAAK,KAAOD,EAAU,GAAKE,EAAa,KAC1CC,EAAM,EAAID,EAAa,KAAOD,EAAK,KAC1BA,EAAK,MAAQD,EAAU,GAAKE,EAAa,KAAOA,EAAa,QACtEC,EAAM,EAAID,EAAa,KAAOA,EAAa,MAAQD,EAAK,OAGnDE,CACT,CAEK,MAACC,EAA0BC,GAAQ,CACtC,GAAI,CACF,kBAAAC,EACA,iBAAAC,EACA,UAAAP,CACJ,EAAMK,EAEJ,MAAI,CAACE,GAAoB,CAACD,EACjBN,EAGFD,EAAuBC,EAAWO,EAAkBD,CAAiB,CAC9E","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"lyra544.cjs","sources":["../node_modules/@dnd-kit/sortable/dist/sortable.esm.js"],"sourcesContent":["import React, { useMemo, useRef, useEffect, useState, useContext } from 'react';\nimport { useDndContext, getClientRect, useDroppable, useDraggable, closestCorners, getFirstCollision, getScrollableAncestors, KeyboardCode } from '@dnd-kit/core';\nimport { useUniqueId, useIsomorphicLayoutEffect, CSS, useCombinedRefs, isKeyboardEvent, subtract } from '@dnd-kit/utilities';\n\n/**\r\n * Move an array item to a different position. Returns a new array with the item moved to the new position.\r\n */\nfunction arrayMove(array, from, to) {\n const newArray = array.slice();\n newArray.splice(to < 0 ? newArray.length + to : to, 0, newArray.splice(from, 1)[0]);\n return newArray;\n}\n\n/**\r\n * Swap an array item to a different position. Returns a new array with the item swapped to the new position.\r\n */\nfunction arraySwap(array, from, to) {\n const newArray = array.slice();\n newArray[from] = array[to];\n newArray[to] = array[from];\n return newArray;\n}\n\nfunction getSortedRects(items, rects) {\n return items.reduce((accumulator, id, index) => {\n const rect = rects.get(id);\n\n if (rect) {\n accumulator[index] = rect;\n }\n\n return accumulator;\n }, Array(items.length));\n}\n\nfunction isValidIndex(index) {\n return index !== null && index >= 0;\n}\n\nfunction itemsEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (a.length !== b.length) {\n return false;\n }\n\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction normalizeDisabled(disabled) {\n if (typeof disabled === 'boolean') {\n return {\n draggable: disabled,\n droppable: disabled\n };\n }\n\n return disabled;\n}\n\n// To-do: We should be calculating scale transformation\nconst defaultScale = {\n scaleX: 1,\n scaleY: 1\n};\nconst horizontalListSortingStrategy = _ref => {\n var _rects$activeIndex;\n\n let {\n rects,\n activeNodeRect: fallbackActiveRect,\n activeIndex,\n overIndex,\n index\n } = _ref;\n const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;\n\n if (!activeNodeRect) {\n return null;\n }\n\n const itemGap = getItemGap(rects, index, activeIndex);\n\n if (index === activeIndex) {\n const newIndexRect = rects[overIndex];\n\n if (!newIndexRect) {\n return null;\n }\n\n return {\n x: activeIndex < overIndex ? newIndexRect.left + newIndexRect.width - (activeNodeRect.left + activeNodeRect.width) : newIndexRect.left - activeNodeRect.left,\n y: 0,\n ...defaultScale\n };\n }\n\n if (index > activeIndex && index <= overIndex) {\n return {\n x: -activeNodeRect.width - itemGap,\n y: 0,\n ...defaultScale\n };\n }\n\n if (index < activeIndex && index >= overIndex) {\n return {\n x: activeNodeRect.width + itemGap,\n y: 0,\n ...defaultScale\n };\n }\n\n return {\n x: 0,\n y: 0,\n ...defaultScale\n };\n};\n\nfunction getItemGap(rects, index, activeIndex) {\n const currentRect = rects[index];\n const previousRect = rects[index - 1];\n const nextRect = rects[index + 1];\n\n if (!currentRect || !previousRect && !nextRect) {\n return 0;\n }\n\n if (activeIndex < index) {\n return previousRect ? currentRect.left - (previousRect.left + previousRect.width) : nextRect.left - (currentRect.left + currentRect.width);\n }\n\n return nextRect ? nextRect.left - (currentRect.left + currentRect.width) : currentRect.left - (previousRect.left + previousRect.width);\n}\n\nconst rectSortingStrategy = _ref => {\n let {\n rects,\n activeIndex,\n overIndex,\n index\n } = _ref;\n const newRects = arrayMove(rects, overIndex, activeIndex);\n const oldRect = rects[index];\n const newRect = newRects[index];\n\n if (!newRect || !oldRect) {\n return null;\n }\n\n return {\n x: newRect.left - oldRect.left,\n y: newRect.top - oldRect.top,\n scaleX: newRect.width / oldRect.width,\n scaleY: newRect.height / oldRect.height\n };\n};\n\nconst rectSwappingStrategy = _ref => {\n let {\n activeIndex,\n index,\n rects,\n overIndex\n } = _ref;\n let oldRect;\n let newRect;\n\n if (index === activeIndex) {\n oldRect = rects[index];\n newRect = rects[overIndex];\n }\n\n if (index === overIndex) {\n oldRect = rects[index];\n newRect = rects[activeIndex];\n }\n\n if (!newRect || !oldRect) {\n return null;\n }\n\n return {\n x: newRect.left - oldRect.left,\n y: newRect.top - oldRect.top,\n scaleX: newRect.width / oldRect.width,\n scaleY: newRect.height / oldRect.height\n };\n};\n\n// To-do: We should be calculating scale transformation\nconst defaultScale$1 = {\n scaleX: 1,\n scaleY: 1\n};\nconst verticalListSortingStrategy = _ref => {\n var _rects$activeIndex;\n\n let {\n activeIndex,\n activeNodeRect: fallbackActiveRect,\n index,\n rects,\n overIndex\n } = _ref;\n const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;\n\n if (!activeNodeRect) {\n return null;\n }\n\n if (index === activeIndex) {\n const overIndexRect = rects[overIndex];\n\n if (!overIndexRect) {\n return null;\n }\n\n return {\n x: 0,\n y: activeIndex < overIndex ? overIndexRect.top + overIndexRect.height - (activeNodeRect.top + activeNodeRect.height) : overIndexRect.top - activeNodeRect.top,\n ...defaultScale$1\n };\n }\n\n const itemGap = getItemGap$1(rects, index, activeIndex);\n\n if (index > activeIndex && index <= overIndex) {\n return {\n x: 0,\n y: -activeNodeRect.height - itemGap,\n ...defaultScale$1\n };\n }\n\n if (index < activeIndex && index >= overIndex) {\n return {\n x: 0,\n y: activeNodeRect.height + itemGap,\n ...defaultScale$1\n };\n }\n\n return {\n x: 0,\n y: 0,\n ...defaultScale$1\n };\n};\n\nfunction getItemGap$1(clientRects, index, activeIndex) {\n const currentRect = clientRects[index];\n const previousRect = clientRects[index - 1];\n const nextRect = clientRects[index + 1];\n\n if (!currentRect) {\n return 0;\n }\n\n if (activeIndex < index) {\n return previousRect ? currentRect.top - (previousRect.top + previousRect.height) : nextRect ? nextRect.top - (currentRect.top + currentRect.height) : 0;\n }\n\n return nextRect ? nextRect.top - (currentRect.top + currentRect.height) : previousRect ? currentRect.top - (previousRect.top + previousRect.height) : 0;\n}\n\nconst ID_PREFIX = 'Sortable';\nconst Context = /*#__PURE__*/React.createContext({\n activeIndex: -1,\n containerId: ID_PREFIX,\n disableTransforms: false,\n items: [],\n overIndex: -1,\n useDragOverlay: false,\n sortedRects: [],\n strategy: rectSortingStrategy,\n disabled: {\n draggable: false,\n droppable: false\n }\n});\nfunction SortableContext(_ref) {\n let {\n children,\n id,\n items: userDefinedItems,\n strategy = rectSortingStrategy,\n disabled: disabledProp = false\n } = _ref;\n const {\n active,\n dragOverlay,\n droppableRects,\n over,\n measureDroppableContainers\n } = useDndContext();\n const containerId = useUniqueId(ID_PREFIX, id);\n const useDragOverlay = Boolean(dragOverlay.rect !== null);\n const items = useMemo(() => userDefinedItems.map(item => typeof item === 'object' && 'id' in item ? item.id : item), [userDefinedItems]);\n const isDragging = active != null;\n const activeIndex = active ? items.indexOf(active.id) : -1;\n const overIndex = over ? items.indexOf(over.id) : -1;\n const previousItemsRef = useRef(items);\n const itemsHaveChanged = !itemsEqual(items, previousItemsRef.current);\n const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged;\n const disabled = normalizeDisabled(disabledProp);\n useIsomorphicLayoutEffect(() => {\n if (itemsHaveChanged && isDragging) {\n measureDroppableContainers(items);\n }\n }, [itemsHaveChanged, items, isDragging, measureDroppableContainers]);\n useEffect(() => {\n previousItemsRef.current = items;\n }, [items]);\n const contextValue = useMemo(() => ({\n activeIndex,\n containerId,\n disabled,\n disableTransforms,\n items,\n overIndex,\n useDragOverlay,\n sortedRects: getSortedRects(items, droppableRects),\n strategy\n }), // eslint-disable-next-line react-hooks/exhaustive-deps\n [activeIndex, containerId, disabled.draggable, disabled.droppable, disableTransforms, items, overIndex, droppableRects, useDragOverlay, strategy]);\n return React.createElement(Context.Provider, {\n value: contextValue\n }, children);\n}\n\nconst defaultNewIndexGetter = _ref => {\n let {\n id,\n items,\n activeIndex,\n overIndex\n } = _ref;\n return arrayMove(items, activeIndex, overIndex).indexOf(id);\n};\nconst defaultAnimateLayoutChanges = _ref2 => {\n let {\n containerId,\n isSorting,\n wasDragging,\n index,\n items,\n newIndex,\n previousItems,\n previousContainerId,\n transition\n } = _ref2;\n\n if (!transition || !wasDragging) {\n return false;\n }\n\n if (previousItems !== items && index === newIndex) {\n return false;\n }\n\n if (isSorting) {\n return true;\n }\n\n return newIndex !== index && containerId === previousContainerId;\n};\nconst defaultTransition = {\n duration: 200,\n easing: 'ease'\n};\nconst transitionProperty = 'transform';\nconst disabledTransition = /*#__PURE__*/CSS.Transition.toString({\n property: transitionProperty,\n duration: 0,\n easing: 'linear'\n});\nconst defaultAttributes = {\n roleDescription: 'sortable'\n};\n\n/*\r\n * When the index of an item changes while sorting,\r\n * we need to temporarily disable the transforms\r\n */\n\nfunction useDerivedTransform(_ref) {\n let {\n disabled,\n index,\n node,\n rect\n } = _ref;\n const [derivedTransform, setDerivedtransform] = useState(null);\n const previousIndex = useRef(index);\n useIsomorphicLayoutEffect(() => {\n if (!disabled && index !== previousIndex.current && node.current) {\n const initial = rect.current;\n\n if (initial) {\n const current = getClientRect(node.current, {\n ignoreTransform: true\n });\n const delta = {\n x: initial.left - current.left,\n y: initial.top - current.top,\n scaleX: initial.width / current.width,\n scaleY: initial.height / current.height\n };\n\n if (delta.x || delta.y) {\n setDerivedtransform(delta);\n }\n }\n }\n\n if (index !== previousIndex.current) {\n previousIndex.current = index;\n }\n }, [disabled, index, node, rect]);\n useEffect(() => {\n if (derivedTransform) {\n setDerivedtransform(null);\n }\n }, [derivedTransform]);\n return derivedTransform;\n}\n\nfunction useSortable(_ref) {\n let {\n animateLayoutChanges = defaultAnimateLayoutChanges,\n attributes: userDefinedAttributes,\n disabled: localDisabled,\n data: customData,\n getNewIndex = defaultNewIndexGetter,\n id,\n strategy: localStrategy,\n resizeObserverConfig,\n transition = defaultTransition\n } = _ref;\n const {\n items,\n containerId,\n activeIndex,\n disabled: globalDisabled,\n disableTransforms,\n sortedRects,\n overIndex,\n useDragOverlay,\n strategy: globalStrategy\n } = useContext(Context);\n const disabled = normalizeLocalDisabled(localDisabled, globalDisabled);\n const index = items.indexOf(id);\n const data = useMemo(() => ({\n sortable: {\n containerId,\n index,\n items\n },\n ...customData\n }), [containerId, customData, index, items]);\n const itemsAfterCurrentSortable = useMemo(() => items.slice(items.indexOf(id)), [items, id]);\n const {\n rect,\n node,\n isOver,\n setNodeRef: setDroppableNodeRef\n } = useDroppable({\n id,\n data,\n disabled: disabled.droppable,\n resizeObserverConfig: {\n updateMeasurementsFor: itemsAfterCurrentSortable,\n ...resizeObserverConfig\n }\n });\n const {\n active,\n activatorEvent,\n activeNodeRect,\n attributes,\n setNodeRef: setDraggableNodeRef,\n listeners,\n isDragging,\n over,\n setActivatorNodeRef,\n transform\n } = useDraggable({\n id,\n data,\n attributes: { ...defaultAttributes,\n ...userDefinedAttributes\n },\n disabled: disabled.draggable\n });\n const setNodeRef = useCombinedRefs(setDroppableNodeRef, setDraggableNodeRef);\n const isSorting = Boolean(active);\n const displaceItem = isSorting && !disableTransforms && isValidIndex(activeIndex) && isValidIndex(overIndex);\n const shouldDisplaceDragSource = !useDragOverlay && isDragging;\n const dragSourceDisplacement = shouldDisplaceDragSource && displaceItem ? transform : null;\n const strategy = localStrategy != null ? localStrategy : globalStrategy;\n const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : strategy({\n rects: sortedRects,\n activeNodeRect,\n activeIndex,\n overIndex,\n index\n }) : null;\n const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({\n id,\n items,\n activeIndex,\n overIndex\n }) : index;\n const activeId = active == null ? void 0 : active.id;\n const previous = useRef({\n activeId,\n items,\n newIndex,\n containerId\n });\n const itemsHaveChanged = items !== previous.current.items;\n const shouldAnimateLayoutChanges = animateLayoutChanges({\n active,\n containerId,\n isDragging,\n isSorting,\n id,\n index,\n items,\n newIndex: previous.current.newIndex,\n previousItems: previous.current.items,\n previousContainerId: previous.current.containerId,\n transition,\n wasDragging: previous.current.activeId != null\n });\n const derivedTransform = useDerivedTransform({\n disabled: !shouldAnimateLayoutChanges,\n index,\n node,\n rect\n });\n useEffect(() => {\n if (isSorting && previous.current.newIndex !== newIndex) {\n previous.current.newIndex = newIndex;\n }\n\n if (containerId !== previous.current.containerId) {\n previous.current.containerId = containerId;\n }\n\n if (items !== previous.current.items) {\n previous.current.items = items;\n }\n }, [isSorting, newIndex, containerId, items]);\n useEffect(() => {\n if (activeId === previous.current.activeId) {\n return;\n }\n\n if (activeId && !previous.current.activeId) {\n previous.current.activeId = activeId;\n return;\n }\n\n const timeoutId = setTimeout(() => {\n previous.current.activeId = activeId;\n }, 50);\n return () => clearTimeout(timeoutId);\n }, [activeId]);\n return {\n active,\n activeIndex,\n attributes,\n data,\n rect,\n index,\n newIndex,\n items,\n isOver,\n isSorting,\n isDragging,\n listeners,\n node,\n overIndex,\n over,\n setNodeRef,\n setActivatorNodeRef,\n setDroppableNodeRef,\n setDraggableNodeRef,\n transform: derivedTransform != null ? derivedTransform : finalTransform,\n transition: getTransition()\n };\n\n function getTransition() {\n if ( // Temporarily disable transitions for a single frame to set up derived transforms\n derivedTransform || // Or to prevent items jumping to back to their \"new\" position when items change\n itemsHaveChanged && previous.current.newIndex === index) {\n return disabledTransition;\n }\n\n if (shouldDisplaceDragSource && !isKeyboardEvent(activatorEvent) || !transition) {\n return undefined;\n }\n\n if (isSorting || shouldAnimateLayoutChanges) {\n return CSS.Transition.toString({ ...transition,\n property: transitionProperty\n });\n }\n\n return undefined;\n }\n}\n\nfunction normalizeLocalDisabled(localDisabled, globalDisabled) {\n var _localDisabled$dragga, _localDisabled$droppa;\n\n if (typeof localDisabled === 'boolean') {\n return {\n draggable: localDisabled,\n // Backwards compatibility\n droppable: false\n };\n }\n\n return {\n draggable: (_localDisabled$dragga = localDisabled == null ? void 0 : localDisabled.draggable) != null ? _localDisabled$dragga : globalDisabled.draggable,\n droppable: (_localDisabled$droppa = localDisabled == null ? void 0 : localDisabled.droppable) != null ? _localDisabled$droppa : globalDisabled.droppable\n };\n}\n\nfunction hasSortableData(entry) {\n if (!entry) {\n return false;\n }\n\n const data = entry.data.current;\n\n if (data && 'sortable' in data && typeof data.sortable === 'object' && 'containerId' in data.sortable && 'items' in data.sortable && 'index' in data.sortable) {\n return true;\n }\n\n return false;\n}\n\nconst directions = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left];\nconst sortableKeyboardCoordinates = (event, _ref) => {\n let {\n context: {\n active,\n collisionRect,\n droppableRects,\n droppableContainers,\n over,\n scrollableAncestors\n }\n } = _ref;\n\n if (directions.includes(event.code)) {\n event.preventDefault();\n\n if (!active || !collisionRect) {\n return;\n }\n\n const filteredContainers = [];\n droppableContainers.getEnabled().forEach(entry => {\n if (!entry || entry != null && entry.disabled) {\n return;\n }\n\n const rect = droppableRects.get(entry.id);\n\n if (!rect) {\n return;\n }\n\n switch (event.code) {\n case KeyboardCode.Down:\n if (collisionRect.top < rect.top) {\n filteredContainers.push(entry);\n }\n\n break;\n\n case KeyboardCode.Up:\n if (collisionRect.top > rect.top) {\n filteredContainers.push(entry);\n }\n\n break;\n\n case KeyboardCode.Left:\n if (collisionRect.left > rect.left) {\n filteredContainers.push(entry);\n }\n\n break;\n\n case KeyboardCode.Right:\n if (collisionRect.left < rect.left) {\n filteredContainers.push(entry);\n }\n\n break;\n }\n });\n const collisions = closestCorners({\n active,\n collisionRect: collisionRect,\n droppableRects,\n droppableContainers: filteredContainers,\n pointerCoordinates: null\n });\n let closestId = getFirstCollision(collisions, 'id');\n\n if (closestId === (over == null ? void 0 : over.id) && collisions.length > 1) {\n closestId = collisions[1].id;\n }\n\n if (closestId != null) {\n const activeDroppable = droppableContainers.get(active.id);\n const newDroppable = droppableContainers.get(closestId);\n const newRect = newDroppable ? droppableRects.get(newDroppable.id) : null;\n const newNode = newDroppable == null ? void 0 : newDroppable.node.current;\n\n if (newNode && newRect && activeDroppable && newDroppable) {\n const newScrollAncestors = getScrollableAncestors(newNode);\n const hasDifferentScrollAncestors = newScrollAncestors.some((element, index) => scrollableAncestors[index] !== element);\n const hasSameContainer = isSameContainer(activeDroppable, newDroppable);\n const isAfterActive = isAfter(activeDroppable, newDroppable);\n const offset = hasDifferentScrollAncestors || !hasSameContainer ? {\n x: 0,\n y: 0\n } : {\n x: isAfterActive ? collisionRect.width - newRect.width : 0,\n y: isAfterActive ? collisionRect.height - newRect.height : 0\n };\n const rectCoordinates = {\n x: newRect.left,\n y: newRect.top\n };\n const newCoordinates = offset.x && offset.y ? rectCoordinates : subtract(rectCoordinates, offset);\n return newCoordinates;\n }\n }\n }\n\n return undefined;\n};\n\nfunction isSameContainer(a, b) {\n if (!hasSortableData(a) || !hasSortableData(b)) {\n return false;\n }\n\n return a.data.current.sortable.containerId === b.data.current.sortable.containerId;\n}\n\nfunction isAfter(a, b) {\n if (!hasSortableData(a) || !hasSortableData(b)) {\n return false;\n }\n\n if (!isSameContainer(a, b)) {\n return false;\n }\n\n return a.data.current.sortable.index < b.data.current.sortable.index;\n}\n\nexport { SortableContext, arrayMove, arraySwap, defaultAnimateLayoutChanges, defaultNewIndexGetter, hasSortableData, horizontalListSortingStrategy, rectSortingStrategy, rectSwappingStrategy, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy };\n//# sourceMappingURL=sortable.esm.js.map\n"],"names":["arrayMove","array","from","to","newArray","getSortedRects","items","rects","accumulator","id","index","rect","isValidIndex","itemsEqual","a","b","i","normalizeDisabled","disabled","defaultScale","horizontalListSortingStrategy","_ref","_rects$activeIndex","fallbackActiveRect","activeIndex","overIndex","activeNodeRect","itemGap","getItemGap","newIndexRect","currentRect","previousRect","nextRect","rectSortingStrategy","newRects","oldRect","newRect","defaultScale$1","verticalListSortingStrategy","overIndexRect","getItemGap$1","clientRects","ID_PREFIX","Context","React","SortableContext","children","userDefinedItems","strategy","disabledProp","active","dragOverlay","droppableRects","over","measureDroppableContainers","useDndContext","containerId","useUniqueId","useDragOverlay","useMemo","item","isDragging","previousItemsRef","useRef","itemsHaveChanged","disableTransforms","useIsomorphicLayoutEffect","useEffect","contextValue","defaultNewIndexGetter","defaultAnimateLayoutChanges","_ref2","isSorting","wasDragging","newIndex","previousItems","previousContainerId","transition","defaultTransition","transitionProperty","disabledTransition","CSS","defaultAttributes","useDerivedTransform","node","derivedTransform","setDerivedtransform","useState","previousIndex","initial","current","getClientRect","delta","useSortable","animateLayoutChanges","userDefinedAttributes","localDisabled","customData","getNewIndex","localStrategy","resizeObserverConfig","globalDisabled","sortedRects","globalStrategy","useContext","normalizeLocalDisabled","data","itemsAfterCurrentSortable","isOver","setDroppableNodeRef","useDroppable","activatorEvent","attributes","setDraggableNodeRef","listeners","setActivatorNodeRef","transform","useDraggable","setNodeRef","useCombinedRefs","displaceItem","shouldDisplaceDragSource","dragSourceDisplacement","finalTransform","activeId","previous","shouldAnimateLayoutChanges","timeoutId","getTransition","isKeyboardEvent","_localDisabled$dragga","_localDisabled$droppa","hasSortableData","entry","directions","KeyboardCode","sortableKeyboardCoordinates","event","collisionRect","droppableContainers","scrollableAncestors","filteredContainers","collisions","closestCorners","closestId","getFirstCollision","activeDroppable","newDroppable","newNode","hasDifferentScrollAncestors","getScrollableAncestors","element","hasSameContainer","isSameContainer","isAfterActive","isAfter","offset","rectCoordinates","subtract"],"mappings":"+JAOA,SAASA,EAAUC,EAAOC,EAAMC,EAAI,CAClC,MAAMC,EAAWH,EAAM,MAAO,EAC9B,OAAAG,EAAS,OAAOD,EAAK,EAAIC,EAAS,OAASD,EAAKA,EAAI,EAAGC,EAAS,OAAOF,EAAM,CAAC,EAAE,CAAC,CAAC,EAC3EE,CACT,CAYA,SAASC,GAAeC,EAAOC,EAAO,CACpC,OAAOD,EAAM,OAAO,CAACE,EAAaC,EAAIC,IAAU,CAC9C,MAAMC,EAAOJ,EAAM,IAAIE,CAAE,EAEzB,OAAIE,IACFH,EAAYE,CAAK,EAAIC,GAGhBH,CACX,EAAK,MAAMF,EAAM,MAAM,CAAC,CACxB,CAEA,SAASM,EAAaF,EAAO,CAC3B,OAAOA,IAAU,MAAQA,GAAS,CACpC,CAEA,SAASG,GAAWC,EAAGC,EAAG,CACxB,GAAID,IAAMC,EACR,MAAO,GAGT,GAAID,EAAE,SAAWC,EAAE,OACjB,MAAO,GAGT,QAASC,EAAI,EAAGA,EAAIF,EAAE,OAAQE,IAC5B,GAAIF,EAAEE,CAAC,IAAMD,EAAEC,CAAC,EACd,MAAO,GAIX,MAAO,EACT,CAEA,SAASC,GAAkBC,EAAU,CACnC,OAAI,OAAOA,GAAa,UACf,CACL,UAAWA,EACX,UAAWA,CACZ,EAGIA,CACT,CAGA,MAAM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ACG,EAAS7I,IAAUkI,EAAoBlI,CAAK,IAAM6I,CAAO,EAChHC,EAAmBC,EAAgBP,EAAiBC,CAAY,EAChEO,EAAgBC,GAAQT,EAAiBC,CAAY,EACrDS,EAASP,GAA+B,CAACG,EAAmB,CAChE,EAAG,EACH,EAAG,CACb,EAAY,CACF,EAAGE,EAAgBhB,EAAc,MAAQtG,EAAQ,MAAQ,EACzD,EAAGsH,EAAgBhB,EAAc,OAAStG,EAAQ,OAAS,CAC5D,EACKyH,EAAkB,CACtB,EAAGzH,EAAQ,KACX,EAAGA,EAAQ,GACZ,EAED,OADuBwH,EAAO,GAAKA,EAAO,EAAIC,EAAkBC,EAAAA,SAASD,EAAiBD,CAAM,CAExG,CACA,CACA,CAGA,EAEA,SAASH,EAAgB3I,EAAGC,EAAG,CAC7B,MAAI,CAACqH,EAAgBtH,CAAC,GAAK,CAACsH,EAAgBrH,CAAC,EACpC,GAGFD,EAAE,KAAK,QAAQ,SAAS,cAAgBC,EAAE,KAAK,QAAQ,SAAS,WACzE,CAEA,SAAS4I,GAAQ7I,EAAGC,EAAG,CAKrB,MAJI,CAACqH,EAAgBtH,CAAC,GAAK,CAACsH,EAAgBrH,CAAC,GAIzC,CAAC0I,EAAgB3I,EAAGC,CAAC,EAChB,GAGFD,EAAE,KAAK,QAAQ,SAAS,MAAQC,EAAE,KAAK,QAAQ,SAAS,KACjE","x_google_ignoreList":[0]}
|
package/dist/lyra544.js
CHANGED
|
@@ -1,18 +1,484 @@
|
|
|
1
|
-
import "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import q, { useMemo as _, useRef as X, useEffect as k, useContext as pe, useState as be } from "react";
|
|
2
|
+
import { KeyboardCode as m, useDndContext as ve, useDroppable as he, useDraggable as xe, getClientRect as Ie, closestCorners as me, getFirstCollision as we, getScrollableAncestors as ye } from "./lyra112.js";
|
|
3
|
+
import { useUniqueId as Re, useIsomorphicLayoutEffect as B, useCombinedRefs as Ce, isKeyboardEvent as Se, CSS as H, subtract as De } from "./lyra542.js";
|
|
4
|
+
function V(e, t, o) {
|
|
5
|
+
const r = e.slice();
|
|
6
|
+
return r.splice(o < 0 ? r.length + o : o, 0, r.splice(t, 1)[0]), r;
|
|
7
|
+
}
|
|
8
|
+
function Ae(e, t) {
|
|
9
|
+
return e.reduce((o, r, n) => {
|
|
10
|
+
const s = t.get(r);
|
|
11
|
+
return s && (o[n] = s), o;
|
|
12
|
+
}, Array(e.length));
|
|
13
|
+
}
|
|
14
|
+
function O(e) {
|
|
15
|
+
return e !== null && e >= 0;
|
|
16
|
+
}
|
|
17
|
+
function Te(e, t) {
|
|
18
|
+
if (e === t)
|
|
19
|
+
return !0;
|
|
20
|
+
if (e.length !== t.length)
|
|
21
|
+
return !1;
|
|
22
|
+
for (let o = 0; o < e.length; o++)
|
|
23
|
+
if (e[o] !== t[o])
|
|
24
|
+
return !1;
|
|
25
|
+
return !0;
|
|
26
|
+
}
|
|
27
|
+
function Ne(e) {
|
|
28
|
+
return typeof e == "boolean" ? {
|
|
29
|
+
draggable: e,
|
|
30
|
+
droppable: e
|
|
31
|
+
} : e;
|
|
32
|
+
}
|
|
33
|
+
const E = {
|
|
34
|
+
scaleX: 1,
|
|
35
|
+
scaleY: 1
|
|
36
|
+
}, je = (e) => {
|
|
37
|
+
var t;
|
|
38
|
+
let {
|
|
39
|
+
rects: o,
|
|
40
|
+
activeNodeRect: r,
|
|
41
|
+
activeIndex: n,
|
|
42
|
+
overIndex: s,
|
|
43
|
+
index: i
|
|
44
|
+
} = e;
|
|
45
|
+
const a = (t = o[n]) != null ? t : r;
|
|
46
|
+
if (!a)
|
|
47
|
+
return null;
|
|
48
|
+
const d = Oe(o, i, n);
|
|
49
|
+
if (i === n) {
|
|
50
|
+
const c = o[s];
|
|
51
|
+
return c ? {
|
|
52
|
+
x: n < s ? c.left + c.width - (a.left + a.width) : c.left - a.left,
|
|
53
|
+
y: 0,
|
|
54
|
+
...E
|
|
55
|
+
} : null;
|
|
56
|
+
}
|
|
57
|
+
return i > n && i <= s ? {
|
|
58
|
+
x: -a.width - d,
|
|
59
|
+
y: 0,
|
|
60
|
+
...E
|
|
61
|
+
} : i < n && i >= s ? {
|
|
62
|
+
x: a.width + d,
|
|
63
|
+
y: 0,
|
|
64
|
+
...E
|
|
65
|
+
} : {
|
|
66
|
+
x: 0,
|
|
67
|
+
y: 0,
|
|
68
|
+
...E
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
function Oe(e, t, o) {
|
|
72
|
+
const r = e[t], n = e[t - 1], s = e[t + 1];
|
|
73
|
+
return !r || !n && !s ? 0 : o < t ? n ? r.left - (n.left + n.width) : s.left - (r.left + r.width) : s ? s.left - (r.left + r.width) : r.left - (n.left + n.width);
|
|
74
|
+
}
|
|
75
|
+
const J = (e) => {
|
|
76
|
+
let {
|
|
77
|
+
rects: t,
|
|
78
|
+
activeIndex: o,
|
|
79
|
+
overIndex: r,
|
|
80
|
+
index: n
|
|
81
|
+
} = e;
|
|
82
|
+
const s = V(t, r, o), i = t[n], a = s[n];
|
|
83
|
+
return !a || !i ? null : {
|
|
84
|
+
x: a.left - i.left,
|
|
85
|
+
y: a.top - i.top,
|
|
86
|
+
scaleX: a.width / i.width,
|
|
87
|
+
scaleY: a.height / i.height
|
|
88
|
+
};
|
|
89
|
+
}, L = {
|
|
90
|
+
scaleX: 1,
|
|
91
|
+
scaleY: 1
|
|
92
|
+
}, qe = (e) => {
|
|
93
|
+
var t;
|
|
94
|
+
let {
|
|
95
|
+
activeIndex: o,
|
|
96
|
+
activeNodeRect: r,
|
|
97
|
+
index: n,
|
|
98
|
+
rects: s,
|
|
99
|
+
overIndex: i
|
|
100
|
+
} = e;
|
|
101
|
+
const a = (t = s[o]) != null ? t : r;
|
|
102
|
+
if (!a)
|
|
103
|
+
return null;
|
|
104
|
+
if (n === o) {
|
|
105
|
+
const c = s[i];
|
|
106
|
+
return c ? {
|
|
107
|
+
x: 0,
|
|
108
|
+
y: o < i ? c.top + c.height - (a.top + a.height) : c.top - a.top,
|
|
109
|
+
...L
|
|
110
|
+
} : null;
|
|
111
|
+
}
|
|
112
|
+
const d = Ee(s, n, o);
|
|
113
|
+
return n > o && n <= i ? {
|
|
114
|
+
x: 0,
|
|
115
|
+
y: -a.height - d,
|
|
116
|
+
...L
|
|
117
|
+
} : n < o && n >= i ? {
|
|
118
|
+
x: 0,
|
|
119
|
+
y: a.height + d,
|
|
120
|
+
...L
|
|
121
|
+
} : {
|
|
122
|
+
x: 0,
|
|
123
|
+
y: 0,
|
|
124
|
+
...L
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
function Ee(e, t, o) {
|
|
128
|
+
const r = e[t], n = e[t - 1], s = e[t + 1];
|
|
129
|
+
return r ? o < t ? n ? r.top - (n.top + n.height) : s ? s.top - (r.top + r.height) : 0 : s ? s.top - (r.top + r.height) : n ? r.top - (n.top + n.height) : 0 : 0;
|
|
130
|
+
}
|
|
131
|
+
const Q = "Sortable", W = /* @__PURE__ */ q.createContext({
|
|
132
|
+
activeIndex: -1,
|
|
133
|
+
containerId: Q,
|
|
134
|
+
disableTransforms: !1,
|
|
135
|
+
items: [],
|
|
136
|
+
overIndex: -1,
|
|
137
|
+
useDragOverlay: !1,
|
|
138
|
+
sortedRects: [],
|
|
139
|
+
strategy: J,
|
|
140
|
+
disabled: {
|
|
141
|
+
draggable: !1,
|
|
142
|
+
droppable: !1
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
function Be(e) {
|
|
146
|
+
let {
|
|
147
|
+
children: t,
|
|
148
|
+
id: o,
|
|
149
|
+
items: r,
|
|
150
|
+
strategy: n = J,
|
|
151
|
+
disabled: s = !1
|
|
152
|
+
} = e;
|
|
153
|
+
const {
|
|
154
|
+
active: i,
|
|
155
|
+
dragOverlay: a,
|
|
156
|
+
droppableRects: d,
|
|
157
|
+
over: c,
|
|
158
|
+
measureDroppableContainers: l
|
|
159
|
+
} = ve(), u = Re(Q, o), f = a.rect !== null, g = _(() => r.map((I) => typeof I == "object" && "id" in I ? I.id : I), [r]), w = i != null, y = i ? g.indexOf(i.id) : -1, v = c ? g.indexOf(c.id) : -1, R = X(g), x = !Te(g, R.current), h = v !== -1 && y === -1 || x, b = Ne(s);
|
|
160
|
+
B(() => {
|
|
161
|
+
x && w && l(g);
|
|
162
|
+
}, [x, g, w, l]), k(() => {
|
|
163
|
+
R.current = g;
|
|
164
|
+
}, [g]);
|
|
165
|
+
const C = _(
|
|
166
|
+
() => ({
|
|
167
|
+
activeIndex: y,
|
|
168
|
+
containerId: u,
|
|
169
|
+
disabled: b,
|
|
170
|
+
disableTransforms: h,
|
|
171
|
+
items: g,
|
|
172
|
+
overIndex: v,
|
|
173
|
+
useDragOverlay: f,
|
|
174
|
+
sortedRects: Ae(g, d),
|
|
175
|
+
strategy: n
|
|
176
|
+
}),
|
|
177
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
178
|
+
[y, u, b.draggable, b.droppable, h, g, v, d, f, n]
|
|
179
|
+
);
|
|
180
|
+
return q.createElement(W.Provider, {
|
|
181
|
+
value: C
|
|
182
|
+
}, t);
|
|
183
|
+
}
|
|
184
|
+
const Le = (e) => {
|
|
185
|
+
let {
|
|
186
|
+
id: t,
|
|
187
|
+
items: o,
|
|
188
|
+
activeIndex: r,
|
|
189
|
+
overIndex: n
|
|
190
|
+
} = e;
|
|
191
|
+
return V(o, r, n).indexOf(t);
|
|
192
|
+
}, _e = (e) => {
|
|
193
|
+
let {
|
|
194
|
+
containerId: t,
|
|
195
|
+
isSorting: o,
|
|
196
|
+
wasDragging: r,
|
|
197
|
+
index: n,
|
|
198
|
+
items: s,
|
|
199
|
+
newIndex: i,
|
|
200
|
+
previousItems: a,
|
|
201
|
+
previousContainerId: d,
|
|
202
|
+
transition: c
|
|
203
|
+
} = e;
|
|
204
|
+
return !c || !r || a !== s && n === i ? !1 : o ? !0 : i !== n && t === d;
|
|
205
|
+
}, ke = {
|
|
206
|
+
duration: 200,
|
|
207
|
+
easing: "ease"
|
|
208
|
+
}, Z = "transform", $e = /* @__PURE__ */ H.Transition.toString({
|
|
209
|
+
property: Z,
|
|
210
|
+
duration: 0,
|
|
211
|
+
easing: "linear"
|
|
212
|
+
}), ze = {
|
|
213
|
+
roleDescription: "sortable"
|
|
214
|
+
};
|
|
215
|
+
function Ge(e) {
|
|
216
|
+
let {
|
|
217
|
+
disabled: t,
|
|
218
|
+
index: o,
|
|
219
|
+
node: r,
|
|
220
|
+
rect: n
|
|
221
|
+
} = e;
|
|
222
|
+
const [s, i] = be(null), a = X(o);
|
|
223
|
+
return B(() => {
|
|
224
|
+
if (!t && o !== a.current && r.current) {
|
|
225
|
+
const d = n.current;
|
|
226
|
+
if (d) {
|
|
227
|
+
const c = Ie(r.current, {
|
|
228
|
+
ignoreTransform: !0
|
|
229
|
+
}), l = {
|
|
230
|
+
x: d.left - c.left,
|
|
231
|
+
y: d.top - c.top,
|
|
232
|
+
scaleX: d.width / c.width,
|
|
233
|
+
scaleY: d.height / c.height
|
|
234
|
+
};
|
|
235
|
+
(l.x || l.y) && i(l);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
o !== a.current && (a.current = o);
|
|
239
|
+
}, [t, o, r, n]), k(() => {
|
|
240
|
+
s && i(null);
|
|
241
|
+
}, [s]), s;
|
|
242
|
+
}
|
|
243
|
+
function He(e) {
|
|
244
|
+
let {
|
|
245
|
+
animateLayoutChanges: t = _e,
|
|
246
|
+
attributes: o,
|
|
247
|
+
disabled: r,
|
|
248
|
+
data: n,
|
|
249
|
+
getNewIndex: s = Le,
|
|
250
|
+
id: i,
|
|
251
|
+
strategy: a,
|
|
252
|
+
resizeObserverConfig: d,
|
|
253
|
+
transition: c = ke
|
|
254
|
+
} = e;
|
|
255
|
+
const {
|
|
256
|
+
items: l,
|
|
257
|
+
containerId: u,
|
|
258
|
+
activeIndex: f,
|
|
259
|
+
disabled: g,
|
|
260
|
+
disableTransforms: w,
|
|
261
|
+
sortedRects: y,
|
|
262
|
+
overIndex: v,
|
|
263
|
+
useDragOverlay: R,
|
|
264
|
+
strategy: x
|
|
265
|
+
} = pe(W), h = Xe(r, g), b = l.indexOf(i), C = _(() => ({
|
|
266
|
+
sortable: {
|
|
267
|
+
containerId: u,
|
|
268
|
+
index: b,
|
|
269
|
+
items: l
|
|
270
|
+
},
|
|
271
|
+
...n
|
|
272
|
+
}), [u, n, b, l]), I = _(() => l.slice(l.indexOf(i)), [l, i]), {
|
|
273
|
+
rect: N,
|
|
274
|
+
node: P,
|
|
275
|
+
isOver: te,
|
|
276
|
+
setNodeRef: Y
|
|
277
|
+
} = he({
|
|
278
|
+
id: i,
|
|
279
|
+
data: C,
|
|
280
|
+
disabled: h.droppable,
|
|
281
|
+
resizeObserverConfig: {
|
|
282
|
+
updateMeasurementsFor: I,
|
|
283
|
+
...d
|
|
284
|
+
}
|
|
285
|
+
}), {
|
|
286
|
+
active: A,
|
|
287
|
+
activatorEvent: re,
|
|
288
|
+
activeNodeRect: ne,
|
|
289
|
+
attributes: oe,
|
|
290
|
+
setNodeRef: F,
|
|
291
|
+
listeners: ie,
|
|
292
|
+
isDragging: z,
|
|
293
|
+
over: se,
|
|
294
|
+
setActivatorNodeRef: ae,
|
|
295
|
+
transform: ce
|
|
296
|
+
} = xe({
|
|
297
|
+
id: i,
|
|
298
|
+
data: C,
|
|
299
|
+
attributes: {
|
|
300
|
+
...ze,
|
|
301
|
+
...o
|
|
302
|
+
},
|
|
303
|
+
disabled: h.draggable
|
|
304
|
+
}), le = Ce(Y, F), S = !!A, K = S && !w && O(f) && O(v), M = !R && z, U = M && K ? ce : null, de = K ? U ?? (a ?? x)({
|
|
305
|
+
rects: y,
|
|
306
|
+
activeNodeRect: ne,
|
|
307
|
+
activeIndex: f,
|
|
308
|
+
overIndex: v,
|
|
309
|
+
index: b
|
|
310
|
+
}) : null, T = O(f) && O(v) ? s({
|
|
311
|
+
id: i,
|
|
312
|
+
items: l,
|
|
313
|
+
activeIndex: f,
|
|
314
|
+
overIndex: v
|
|
315
|
+
}) : b, D = A == null ? void 0 : A.id, p = X({
|
|
316
|
+
activeId: D,
|
|
317
|
+
items: l,
|
|
318
|
+
newIndex: T,
|
|
319
|
+
containerId: u
|
|
320
|
+
}), ue = l !== p.current.items, j = t({
|
|
321
|
+
active: A,
|
|
322
|
+
containerId: u,
|
|
323
|
+
isDragging: z,
|
|
324
|
+
isSorting: S,
|
|
325
|
+
id: i,
|
|
326
|
+
index: b,
|
|
327
|
+
items: l,
|
|
328
|
+
newIndex: p.current.newIndex,
|
|
329
|
+
previousItems: p.current.items,
|
|
330
|
+
previousContainerId: p.current.containerId,
|
|
331
|
+
transition: c,
|
|
332
|
+
wasDragging: p.current.activeId != null
|
|
333
|
+
}), G = Ge({
|
|
334
|
+
disabled: !j,
|
|
335
|
+
index: b,
|
|
336
|
+
node: P,
|
|
337
|
+
rect: N
|
|
338
|
+
});
|
|
339
|
+
return k(() => {
|
|
340
|
+
S && p.current.newIndex !== T && (p.current.newIndex = T), u !== p.current.containerId && (p.current.containerId = u), l !== p.current.items && (p.current.items = l);
|
|
341
|
+
}, [S, T, u, l]), k(() => {
|
|
342
|
+
if (D === p.current.activeId)
|
|
343
|
+
return;
|
|
344
|
+
if (D && !p.current.activeId) {
|
|
345
|
+
p.current.activeId = D;
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
const ge = setTimeout(() => {
|
|
349
|
+
p.current.activeId = D;
|
|
350
|
+
}, 50);
|
|
351
|
+
return () => clearTimeout(ge);
|
|
352
|
+
}, [D]), {
|
|
353
|
+
active: A,
|
|
354
|
+
activeIndex: f,
|
|
355
|
+
attributes: oe,
|
|
356
|
+
data: C,
|
|
357
|
+
rect: N,
|
|
358
|
+
index: b,
|
|
359
|
+
newIndex: T,
|
|
360
|
+
items: l,
|
|
361
|
+
isOver: te,
|
|
362
|
+
isSorting: S,
|
|
363
|
+
isDragging: z,
|
|
364
|
+
listeners: ie,
|
|
365
|
+
node: P,
|
|
366
|
+
overIndex: v,
|
|
367
|
+
over: se,
|
|
368
|
+
setNodeRef: le,
|
|
369
|
+
setActivatorNodeRef: ae,
|
|
370
|
+
setDroppableNodeRef: Y,
|
|
371
|
+
setDraggableNodeRef: F,
|
|
372
|
+
transform: G ?? de,
|
|
373
|
+
transition: fe()
|
|
374
|
+
};
|
|
375
|
+
function fe() {
|
|
376
|
+
if (
|
|
377
|
+
// Temporarily disable transitions for a single frame to set up derived transforms
|
|
378
|
+
G || // Or to prevent items jumping to back to their "new" position when items change
|
|
379
|
+
ue && p.current.newIndex === b
|
|
380
|
+
)
|
|
381
|
+
return $e;
|
|
382
|
+
if (!(M && !Se(re) || !c) && (S || j))
|
|
383
|
+
return H.Transition.toString({
|
|
384
|
+
...c,
|
|
385
|
+
property: Z
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
function Xe(e, t) {
|
|
390
|
+
var o, r;
|
|
391
|
+
return typeof e == "boolean" ? {
|
|
392
|
+
draggable: e,
|
|
393
|
+
// Backwards compatibility
|
|
394
|
+
droppable: !1
|
|
395
|
+
} : {
|
|
396
|
+
draggable: (o = e == null ? void 0 : e.draggable) != null ? o : t.draggable,
|
|
397
|
+
droppable: (r = e == null ? void 0 : e.droppable) != null ? r : t.droppable
|
|
5
398
|
};
|
|
6
|
-
return e.top + f.y <= t.top ? l.y = t.top - e.top : e.bottom + f.y >= t.top + t.height && (l.y = t.top + t.height - e.bottom), e.left + f.x <= t.left ? l.x = t.left - e.left : e.right + f.x >= t.left + t.width && (l.x = t.left + t.width - e.right), l;
|
|
7
399
|
}
|
|
8
|
-
|
|
400
|
+
function $(e) {
|
|
401
|
+
if (!e)
|
|
402
|
+
return !1;
|
|
403
|
+
const t = e.data.current;
|
|
404
|
+
return !!(t && "sortable" in t && typeof t.sortable == "object" && "containerId" in t.sortable && "items" in t.sortable && "index" in t.sortable);
|
|
405
|
+
}
|
|
406
|
+
const Pe = [m.Down, m.Right, m.Up, m.Left], Ve = (e, t) => {
|
|
9
407
|
let {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
408
|
+
context: {
|
|
409
|
+
active: o,
|
|
410
|
+
collisionRect: r,
|
|
411
|
+
droppableRects: n,
|
|
412
|
+
droppableContainers: s,
|
|
413
|
+
over: i,
|
|
414
|
+
scrollableAncestors: a
|
|
415
|
+
}
|
|
416
|
+
} = t;
|
|
417
|
+
if (Pe.includes(e.code)) {
|
|
418
|
+
if (e.preventDefault(), !o || !r)
|
|
419
|
+
return;
|
|
420
|
+
const d = [];
|
|
421
|
+
s.getEnabled().forEach((u) => {
|
|
422
|
+
if (!u || u != null && u.disabled)
|
|
423
|
+
return;
|
|
424
|
+
const f = n.get(u.id);
|
|
425
|
+
if (f)
|
|
426
|
+
switch (e.code) {
|
|
427
|
+
case m.Down:
|
|
428
|
+
r.top < f.top && d.push(u);
|
|
429
|
+
break;
|
|
430
|
+
case m.Up:
|
|
431
|
+
r.top > f.top && d.push(u);
|
|
432
|
+
break;
|
|
433
|
+
case m.Left:
|
|
434
|
+
r.left > f.left && d.push(u);
|
|
435
|
+
break;
|
|
436
|
+
case m.Right:
|
|
437
|
+
r.left < f.left && d.push(u);
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
const c = me({
|
|
442
|
+
active: o,
|
|
443
|
+
collisionRect: r,
|
|
444
|
+
droppableRects: n,
|
|
445
|
+
droppableContainers: d,
|
|
446
|
+
pointerCoordinates: null
|
|
447
|
+
});
|
|
448
|
+
let l = we(c, "id");
|
|
449
|
+
if (l === (i == null ? void 0 : i.id) && c.length > 1 && (l = c[1].id), l != null) {
|
|
450
|
+
const u = s.get(o.id), f = s.get(l), g = f ? n.get(f.id) : null, w = f == null ? void 0 : f.node.current;
|
|
451
|
+
if (w && g && u && f) {
|
|
452
|
+
const v = ye(w).some((I, N) => a[N] !== I), R = ee(u, f), x = Ye(u, f), h = v || !R ? {
|
|
453
|
+
x: 0,
|
|
454
|
+
y: 0
|
|
455
|
+
} : {
|
|
456
|
+
x: x ? r.width - g.width : 0,
|
|
457
|
+
y: x ? r.height - g.height : 0
|
|
458
|
+
}, b = {
|
|
459
|
+
x: g.left,
|
|
460
|
+
y: g.top
|
|
461
|
+
};
|
|
462
|
+
return h.x && h.y ? b : De(b, h);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}
|
|
15
466
|
};
|
|
467
|
+
function ee(e, t) {
|
|
468
|
+
return !$(e) || !$(t) ? !1 : e.data.current.sortable.containerId === t.data.current.sortable.containerId;
|
|
469
|
+
}
|
|
470
|
+
function Ye(e, t) {
|
|
471
|
+
return !$(e) || !$(t) || !ee(e, t) ? !1 : e.data.current.sortable.index < t.data.current.sortable.index;
|
|
472
|
+
}
|
|
16
473
|
export {
|
|
17
|
-
|
|
474
|
+
Be as SortableContext,
|
|
475
|
+
V as arrayMove,
|
|
476
|
+
_e as defaultAnimateLayoutChanges,
|
|
477
|
+
Le as defaultNewIndexGetter,
|
|
478
|
+
$ as hasSortableData,
|
|
479
|
+
je as horizontalListSortingStrategy,
|
|
480
|
+
J as rectSortingStrategy,
|
|
481
|
+
Ve as sortableKeyboardCoordinates,
|
|
482
|
+
He as useSortable,
|
|
483
|
+
qe as verticalListSortingStrategy
|
|
18
484
|
};
|