@helpdice/draggable 0.0.0-stage → 0.0.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.
Files changed (472) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +164 -2
  3. package/dist/draggable.cjs.js +9915 -0
  4. package/dist/draggable.cjs.js.map +1 -0
  5. package/dist/draggable.esm.js +9889 -0
  6. package/dist/draggable.esm.js.map +1 -0
  7. package/dist/types/animation.d.ts +31 -0
  8. package/dist/types/debug/middleware/action-timing-average.d.ts +3 -0
  9. package/dist/types/debug/middleware/action-timing.d.ts +3 -0
  10. package/dist/types/debug/middleware/log.d.ts +4 -0
  11. package/dist/types/debug/middleware/user-timing.d.ts +3 -0
  12. package/dist/types/debug/timings.d.ts +3 -0
  13. package/dist/types/dev-warning.d.ts +4 -0
  14. package/dist/types/empty.d.ts +2 -0
  15. package/dist/types/index.d.ts +8 -0
  16. package/dist/types/invariant.d.ts +4 -0
  17. package/dist/types/native-with-fallback.d.ts +10 -0
  18. package/dist/types/screen-reader-message-preset.d.ts +9 -0
  19. package/dist/types/state/action-creators.d.ts +158 -0
  20. package/dist/types/state/auto-scroller/auto-scroller-types.d.ts +6 -0
  21. package/dist/types/state/auto-scroller/can-scroll.d.ts +19 -0
  22. package/dist/types/state/auto-scroller/fluid-scroller/config.d.ts +11 -0
  23. package/dist/types/state/auto-scroller/fluid-scroller/did-start-in-scrollable-area.d.ts +0 -0
  24. package/dist/types/state/auto-scroller/fluid-scroller/get-best-scrollable-droppable.d.ts +9 -0
  25. package/dist/types/state/auto-scroller/fluid-scroller/get-droppable-scroll-change.d.ts +11 -0
  26. package/dist/types/state/auto-scroller/fluid-scroller/get-percentage.d.ts +7 -0
  27. package/dist/types/state/auto-scroller/fluid-scroller/get-scroll/adjust-for-size-limits.d.ts +8 -0
  28. package/dist/types/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/dampen-value-by-time.d.ts +2 -0
  29. package/dist/types/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/get-distance-thresholds.d.ts +8 -0
  30. package/dist/types/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/get-value-from-distance.d.ts +3 -0
  31. package/dist/types/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/get-value.d.ts +9 -0
  32. package/dist/types/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/index.d.ts +11 -0
  33. package/dist/types/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/min-scroll.d.ts +2 -0
  34. package/dist/types/state/auto-scroller/fluid-scroller/get-scroll/index.d.ts +10 -0
  35. package/dist/types/state/auto-scroller/fluid-scroller/get-window-scroll-change.d.ts +11 -0
  36. package/dist/types/state/auto-scroller/fluid-scroller/index.d.ts +13 -0
  37. package/dist/types/state/auto-scroller/fluid-scroller/scroll.d.ts +11 -0
  38. package/dist/types/state/auto-scroller/index.d.ts +11 -0
  39. package/dist/types/state/auto-scroller/jump-scroller.d.ts +11 -0
  40. package/dist/types/state/axis.d.ts +3 -0
  41. package/dist/types/state/calculate-drag-impact/calculate-reorder-impact.d.ts +13 -0
  42. package/dist/types/state/can-start-drag.d.ts +3 -0
  43. package/dist/types/state/create-store.d.ts +16 -0
  44. package/dist/types/state/did-start-after-critical.d.ts +2 -0
  45. package/dist/types/state/dimension-marshal/dimension-marshal-types.d.ts +23 -0
  46. package/dist/types/state/dimension-marshal/dimension-marshal.d.ts +4 -0
  47. package/dist/types/state/dimension-marshal/get-initial-publish.d.ts +10 -0
  48. package/dist/types/state/dimension-marshal/while-dragging-publisher.d.ts +17 -0
  49. package/dist/types/state/dimension-structures.d.ts +5 -0
  50. package/dist/types/state/droppable/get-droppable.d.ts +21 -0
  51. package/dist/types/state/droppable/is-home-of.d.ts +3 -0
  52. package/dist/types/state/droppable/scroll-droppable.d.ts +4 -0
  53. package/dist/types/state/droppable/should-use-placeholder.d.ts +3 -0
  54. package/dist/types/state/droppable/util/clip.d.ts +3 -0
  55. package/dist/types/state/droppable/util/get-subject.d.ts +10 -0
  56. package/dist/types/state/droppable/what-is-dragged-over-from-result.d.ts +3 -0
  57. package/dist/types/state/droppable/what-is-dragged-over.d.ts +3 -0
  58. package/dist/types/state/droppable/with-placeholder.d.ts +3 -0
  59. package/dist/types/state/get-center-from-impact/get-client-border-box-center/get-client-from-page-border-box-center.d.ts +9 -0
  60. package/dist/types/state/get-center-from-impact/get-client-border-box-center/index.d.ts +12 -0
  61. package/dist/types/state/get-center-from-impact/get-page-border-box-center/index.d.ts +11 -0
  62. package/dist/types/state/get-center-from-impact/get-page-border-box-center/when-combining.d.ts +9 -0
  63. package/dist/types/state/get-center-from-impact/get-page-border-box-center/when-reordering.d.ts +11 -0
  64. package/dist/types/state/get-center-from-impact/move-relative-to.d.ts +16 -0
  65. package/dist/types/state/get-combined-item-displacement.d.ts +10 -0
  66. package/dist/types/state/get-displaced-by.d.ts +4 -0
  67. package/dist/types/state/get-displacement-groups.d.ts +12 -0
  68. package/dist/types/state/get-drag-impact/get-combine-impact.d.ts +13 -0
  69. package/dist/types/state/get-drag-impact/get-reorder-impact.d.ts +13 -0
  70. package/dist/types/state/get-drag-impact/index.d.ts +13 -0
  71. package/dist/types/state/get-draggables-inside-droppable.d.ts +3 -0
  72. package/dist/types/state/get-droppable-over.d.ts +9 -0
  73. package/dist/types/state/get-frame.d.ts +3 -0
  74. package/dist/types/state/get-home-location.d.ts +3 -0
  75. package/dist/types/state/get-impact-location.d.ts +3 -0
  76. package/dist/types/state/get-is-displaced.d.ts +7 -0
  77. package/dist/types/state/get-lift-effect.d.ts +13 -0
  78. package/dist/types/state/get-max-scroll.d.ts +9 -0
  79. package/dist/types/state/is-movement-allowed.d.ts +2 -0
  80. package/dist/types/state/is-within.d.ts +2 -0
  81. package/dist/types/state/middleware/auto-scroll.d.ts +4 -0
  82. package/dist/types/state/middleware/dimension-marshal-stopper.d.ts +4 -0
  83. package/dist/types/state/middleware/drop/drop-animation-finish-middleware.d.ts +3 -0
  84. package/dist/types/state/middleware/drop/drop-animation-flush-on-scroll-middleware.d.ts +3 -0
  85. package/dist/types/state/middleware/drop/drop-middleware.d.ts +3 -0
  86. package/dist/types/state/middleware/drop/get-drop-duration.d.ts +9 -0
  87. package/dist/types/state/middleware/drop/get-drop-impact.d.ts +16 -0
  88. package/dist/types/state/middleware/drop/get-new-home-client-offset.d.ts +11 -0
  89. package/dist/types/state/middleware/drop/index.d.ts +1 -0
  90. package/dist/types/state/middleware/focus.d.ts +4 -0
  91. package/dist/types/state/middleware/lift.d.ts +4 -0
  92. package/dist/types/state/middleware/pending-drop.d.ts +3 -0
  93. package/dist/types/state/middleware/responders/async-marshal.d.ts +9 -0
  94. package/dist/types/state/middleware/responders/expiring-announce.d.ts +6 -0
  95. package/dist/types/state/middleware/responders/index.d.ts +1 -0
  96. package/dist/types/state/middleware/responders/is-equal.d.ts +4 -0
  97. package/dist/types/state/middleware/responders/publisher.d.ts +17 -0
  98. package/dist/types/state/middleware/responders/responders-middleware.d.ts +4 -0
  99. package/dist/types/state/middleware/scroll-listener.d.ts +3 -0
  100. package/dist/types/state/middleware/style.d.ts +4 -0
  101. package/dist/types/state/middleware/util/validate-dimensions.d.ts +2 -0
  102. package/dist/types/state/move-in-direction/index.d.ts +8 -0
  103. package/dist/types/state/move-in-direction/move-cross-axis/get-best-cross-axis-droppable.d.ts +11 -0
  104. package/dist/types/state/move-in-direction/move-cross-axis/get-closest-draggable.d.ts +11 -0
  105. package/dist/types/state/move-in-direction/move-cross-axis/index.d.ts +15 -0
  106. package/dist/types/state/move-in-direction/move-cross-axis/move-to-new-droppable.d.ts +14 -0
  107. package/dist/types/state/move-in-direction/move-cross-axis/without-starting-displacement.d.ts +4 -0
  108. package/dist/types/state/move-in-direction/move-in-direction-types.d.ts +7 -0
  109. package/dist/types/state/move-in-direction/move-to-next-place/index.d.ts +16 -0
  110. package/dist/types/state/move-in-direction/move-to-next-place/is-totally-visible-in-new-location.d.ts +12 -0
  111. package/dist/types/state/move-in-direction/move-to-next-place/move-to-next-combine/index.d.ts +10 -0
  112. package/dist/types/state/move-in-direction/move-to-next-place/move-to-next-index/from-combine.d.ts +11 -0
  113. package/dist/types/state/move-in-direction/move-to-next-place/move-to-next-index/from-reorder.d.ts +9 -0
  114. package/dist/types/state/move-in-direction/move-to-next-place/move-to-next-index/index.d.ts +14 -0
  115. package/dist/types/state/no-impact.d.ts +6 -0
  116. package/dist/types/state/patch-dimension-map.d.ts +3 -0
  117. package/dist/types/state/patch-droppable-map.d.ts +3 -0
  118. package/dist/types/state/position.d.ts +10 -0
  119. package/dist/types/state/post-reducer/when-moving/refresh-snap.d.ts +8 -0
  120. package/dist/types/state/post-reducer/when-moving/update.d.ts +12 -0
  121. package/dist/types/state/publish-while-dragging-in-virtual/adjust-additions-for-scroll-changes.d.ts +8 -0
  122. package/dist/types/state/publish-while-dragging-in-virtual/index.d.ts +7 -0
  123. package/dist/types/state/publish-while-dragging-in-virtual/offset-draggable.d.ts +9 -0
  124. package/dist/types/state/recompute-placeholders.d.ts +10 -0
  125. package/dist/types/state/rect.d.ts +2 -0
  126. package/dist/types/state/reducer.d.ts +5 -0
  127. package/dist/types/state/registry/create-registry.d.ts +2 -0
  128. package/dist/types/state/registry/registry-types.d.ts +62 -0
  129. package/dist/types/state/registry/use-registry.d.ts +2 -0
  130. package/dist/types/state/remove-draggable-from-list.d.ts +3 -0
  131. package/dist/types/state/scroll-viewport.d.ts +4 -0
  132. package/dist/types/state/spacing.d.ts +6 -0
  133. package/dist/types/state/store-types.d.ts +10 -0
  134. package/dist/types/state/update-displacement-visibility/recompute.d.ts +10 -0
  135. package/dist/types/state/update-displacement-visibility/speculatively-increase.d.ts +11 -0
  136. package/dist/types/state/visibility/is-partially-visible-through-frame.d.ts +3 -0
  137. package/dist/types/state/visibility/is-position-in-frame.d.ts +2 -0
  138. package/dist/types/state/visibility/is-totally-visible-through-frame-on-axis.d.ts +4 -0
  139. package/dist/types/state/visibility/is-totally-visible-through-frame.d.ts +3 -0
  140. package/dist/types/state/visibility/is-visible.d.ts +13 -0
  141. package/dist/types/state/with-scroll-change/with-all-displacement.d.ts +4 -0
  142. package/dist/types/state/with-scroll-change/with-droppable-displacement.d.ts +4 -0
  143. package/dist/types/state/with-scroll-change/with-droppable-scroll.d.ts +4 -0
  144. package/dist/types/state/with-scroll-change/with-viewport-displacement.d.ts +4 -0
  145. package/dist/types/types.d.ts +323 -0
  146. package/dist/types/view/animate-in-out/animate-in-out.d.ts +24 -0
  147. package/dist/types/view/animate-in-out/index.d.ts +1 -0
  148. package/dist/types/view/check-is-valid-inner-ref.d.ts +1 -0
  149. package/dist/types/view/context/app-context.d.ts +16 -0
  150. package/dist/types/view/context/droppable-context.d.ts +9 -0
  151. package/dist/types/view/context/hooks.d.ts +3 -0
  152. package/dist/types/view/context/store-context.d.ts +4 -0
  153. package/dist/types/view/data-attributes.d.ts +22 -0
  154. package/dist/types/view/drag-drop-context/app.d.ts +13 -0
  155. package/dist/types/view/drag-drop-context/check-doctype.d.ts +2 -0
  156. package/dist/types/view/drag-drop-context/check-react-version.d.ts +2 -0
  157. package/dist/types/view/drag-drop-context/drag-drop-context-types.d.ts +5 -0
  158. package/dist/types/view/drag-drop-context/drag-drop-context.d.ts +12 -0
  159. package/dist/types/view/drag-drop-context/error-boundary.d.ts +20 -0
  160. package/dist/types/view/drag-drop-context/index.d.ts +1 -0
  161. package/dist/types/view/drag-drop-context/use-startup-validation.d.ts +1 -0
  162. package/dist/types/view/drag-drop-context/use-unique-context-id.d.ts +3 -0
  163. package/dist/types/view/draggable/connected-draggable.d.ts +5 -0
  164. package/dist/types/view/draggable/draggable-api.d.ts +3 -0
  165. package/dist/types/view/draggable/draggable-types.d.ts +106 -0
  166. package/dist/types/view/draggable/draggable.d.ts +2 -0
  167. package/dist/types/view/draggable/get-style.d.ts +3 -0
  168. package/dist/types/view/draggable/index.d.ts +1 -0
  169. package/dist/types/view/draggable/use-validation.d.ts +4 -0
  170. package/dist/types/view/droppable/connected-droppable.d.ts +7 -0
  171. package/dist/types/view/droppable/droppable-types.d.ts +50 -0
  172. package/dist/types/view/droppable/droppable.d.ts +2 -0
  173. package/dist/types/view/droppable/index.d.ts +1 -0
  174. package/dist/types/view/droppable/use-validation.d.ts +8 -0
  175. package/dist/types/view/event-bindings/bind-events.d.ts +2 -0
  176. package/dist/types/view/event-bindings/event-types.d.ts +10 -0
  177. package/dist/types/view/get-body-element.d.ts +2 -0
  178. package/dist/types/view/get-border-box-center-position.d.ts +3 -0
  179. package/dist/types/view/get-document-element.d.ts +2 -0
  180. package/dist/types/view/get-elements/find-drag-handle.d.ts +2 -0
  181. package/dist/types/view/get-elements/find-draggable.d.ts +2 -0
  182. package/dist/types/view/is-strict-equal.d.ts +2 -0
  183. package/dist/types/view/is-type-of-element/is-element.d.ts +1 -0
  184. package/dist/types/view/is-type-of-element/is-html-element.d.ts +1 -0
  185. package/dist/types/view/is-type-of-element/is-svg-element.d.ts +1 -0
  186. package/dist/types/view/key-codes.d.ts +12 -0
  187. package/dist/types/view/placeholder/index.d.ts +1 -0
  188. package/dist/types/view/placeholder/placeholder-types.d.ts +14 -0
  189. package/dist/types/view/placeholder/placeholder.d.ts +28 -0
  190. package/dist/types/view/scroll-listener.d.ts +12 -0
  191. package/dist/types/view/throw-if-invalid-inner-ref.d.ts +2 -0
  192. package/dist/types/view/use-announcer/index.d.ts +1 -0
  193. package/dist/types/view/use-announcer/use-announcer.d.ts +3 -0
  194. package/dist/types/view/use-dev-setup-warning.d.ts +1 -0
  195. package/dist/types/view/use-dev.d.ts +1 -0
  196. package/dist/types/view/use-draggable-publisher/get-dimension.d.ts +3 -0
  197. package/dist/types/view/use-draggable-publisher/index.d.ts +1 -0
  198. package/dist/types/view/use-draggable-publisher/use-draggable-publisher.d.ts +8 -0
  199. package/dist/types/view/use-droppable-publisher/check-for-nested-scroll-container.d.ts +2 -0
  200. package/dist/types/view/use-droppable-publisher/get-closest-scrollable.d.ts +2 -0
  201. package/dist/types/view/use-droppable-publisher/get-dimension.d.ts +15 -0
  202. package/dist/types/view/use-droppable-publisher/get-env.d.ts +6 -0
  203. package/dist/types/view/use-droppable-publisher/get-listener-options.d.ts +5 -0
  204. package/dist/types/view/use-droppable-publisher/get-scroll.d.ts +3 -0
  205. package/dist/types/view/use-droppable-publisher/index.d.ts +1 -0
  206. package/dist/types/view/use-droppable-publisher/is-in-fixed-container.d.ts +2 -0
  207. package/dist/types/view/use-droppable-publisher/use-droppable-publisher.d.ts +13 -0
  208. package/dist/types/view/use-focus-marshal/focus-marshal-types.d.ts +9 -0
  209. package/dist/types/view/use-focus-marshal/index.d.ts +1 -0
  210. package/dist/types/view/use-focus-marshal/use-focus-marshal.d.ts +3 -0
  211. package/dist/types/view/use-hidden-text-element/index.d.ts +1 -0
  212. package/dist/types/view/use-hidden-text-element/use-hidden-text-element.d.ts +12 -0
  213. package/dist/types/view/use-isomorphic-layout-effect.d.ts +3 -0
  214. package/dist/types/view/use-previous-ref.d.ts +1 -0
  215. package/dist/types/view/use-required-context.d.ts +2 -0
  216. package/dist/types/view/use-sensor-marshal/closest.d.ts +1 -0
  217. package/dist/types/view/use-sensor-marshal/find-closest-draggable-id-from-event.d.ts +2 -0
  218. package/dist/types/view/use-sensor-marshal/index.d.ts +4 -0
  219. package/dist/types/view/use-sensor-marshal/is-event-in-interactive-element.d.ts +5 -0
  220. package/dist/types/view/use-sensor-marshal/lock.d.ts +11 -0
  221. package/dist/types/view/use-sensor-marshal/sensors/use-keyboard-sensor.d.ts +2 -0
  222. package/dist/types/view/use-sensor-marshal/sensors/use-mouse-sensor.d.ts +4 -0
  223. package/dist/types/view/use-sensor-marshal/sensors/use-touch-sensor.d.ts +4 -0
  224. package/dist/types/view/use-sensor-marshal/sensors/util/prevent-standard-key-events.d.ts +2 -0
  225. package/dist/types/view/use-sensor-marshal/sensors/util/supported-page-visibility-event-name.d.ts +2 -0
  226. package/dist/types/view/use-sensor-marshal/use-sensor-marshal.d.ts +12 -0
  227. package/dist/types/view/use-sensor-marshal/use-validate-sensor-hooks.d.ts +2 -0
  228. package/dist/types/view/use-style-marshal/get-styles.d.ts +10 -0
  229. package/dist/types/view/use-style-marshal/index.d.ts +1 -0
  230. package/dist/types/view/use-style-marshal/style-marshal-types.d.ts +6 -0
  231. package/dist/types/view/use-style-marshal/use-style-marshal.d.ts +3 -0
  232. package/dist/types/view/use-unique-id.d.ts +7 -0
  233. package/dist/types/view/visually-hidden-style.d.ts +2 -0
  234. package/dist/types/view/window/get-max-window-scroll.d.ts +3 -0
  235. package/dist/types/view/window/get-viewport.d.ts +3 -0
  236. package/dist/types/view/window/get-window-from-el.d.ts +2 -0
  237. package/dist/types/view/window/get-window-scroll.d.ts +3 -0
  238. package/dist/types/view/window/scroll-window.d.ts +3 -0
  239. package/package.json +157 -4
  240. package/src/animation.ts +75 -0
  241. package/src/debug/middleware/action-timing-average.ts +52 -0
  242. package/src/debug/middleware/action-timing.ts +16 -0
  243. package/src/debug/middleware/log.ts +26 -0
  244. package/src/debug/middleware/user-timing.ts +16 -0
  245. package/src/debug/timings.ts +87 -0
  246. package/src/dev-warning.ts +50 -0
  247. package/src/empty.ts +6 -0
  248. package/src/index.ts +67 -0
  249. package/src/invariant.ts +64 -0
  250. package/src/native-with-fallback.ts +69 -0
  251. package/src/screen-reader-message-preset.ts +135 -0
  252. package/src/state/action-creators.ts +358 -0
  253. package/src/state/auto-scroller/auto-scroller-types.ts +8 -0
  254. package/src/state/auto-scroller/can-scroll.ts +320 -0
  255. package/src/state/auto-scroller/fluid-scroller/config.ts +25 -0
  256. package/src/state/auto-scroller/fluid-scroller/did-start-in-scrollable-area.ts +1 -0
  257. package/src/state/auto-scroller/fluid-scroller/get-best-scrollable-droppable.ts +77 -0
  258. package/src/state/auto-scroller/fluid-scroller/get-droppable-scroll-change.ts +39 -0
  259. package/src/state/auto-scroller/fluid-scroller/get-percentage.ts +25 -0
  260. package/src/state/auto-scroller/fluid-scroller/get-scroll/adjust-for-size-limits.ts +30 -0
  261. package/src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/dampen-value-by-time.ts +37 -0
  262. package/src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/get-distance-thresholds.ts +25 -0
  263. package/src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/get-value-from-distance.ts +61 -0
  264. package/src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/get-value.ts +39 -0
  265. package/src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/index.ts +46 -0
  266. package/src/state/auto-scroller/fluid-scroller/get-scroll/get-scroll-on-axis/min-scroll.ts +4 -0
  267. package/src/state/auto-scroller/fluid-scroller/get-scroll/index.ts +76 -0
  268. package/src/state/auto-scroller/fluid-scroller/get-window-scroll-change.ts +31 -0
  269. package/src/state/auto-scroller/fluid-scroller/index.ts +91 -0
  270. package/src/state/auto-scroller/fluid-scroller/scroll.ts +72 -0
  271. package/src/state/auto-scroller/index.ts +56 -0
  272. package/src/state/auto-scroller/jump-scroller.ts +140 -0
  273. package/src/state/axis.ts +26 -0
  274. package/src/state/calculate-drag-impact/calculate-reorder-impact.ts +138 -0
  275. package/src/state/can-start-drag.ts +29 -0
  276. package/src/state/create-store.ts +98 -0
  277. package/src/state/did-start-after-critical.ts +9 -0
  278. package/src/state/dimension-marshal/dimension-marshal-types.ts +49 -0
  279. package/src/state/dimension-marshal/dimension-marshal.ts +219 -0
  280. package/src/state/dimension-marshal/get-initial-publish.ts +66 -0
  281. package/src/state/dimension-marshal/while-dragging-publisher.ts +146 -0
  282. package/src/state/dimension-structures.ts +35 -0
  283. package/src/state/droppable/get-droppable.ts +103 -0
  284. package/src/state/droppable/is-home-of.ts +7 -0
  285. package/src/state/droppable/scroll-droppable.ts +53 -0
  286. package/src/state/droppable/should-use-placeholder.ts +7 -0
  287. package/src/state/droppable/util/clip.ts +17 -0
  288. package/src/state/droppable/util/get-subject.ts +63 -0
  289. package/src/state/droppable/what-is-dragged-over-from-result.ts +16 -0
  290. package/src/state/droppable/what-is-dragged-over.ts +16 -0
  291. package/src/state/droppable/with-placeholder.ts +174 -0
  292. package/src/state/get-center-from-impact/get-client-border-box-center/get-client-from-page-border-box-center.ts +30 -0
  293. package/src/state/get-center-from-impact/get-client-border-box-center/index.ts +45 -0
  294. package/src/state/get-center-from-impact/get-page-border-box-center/index.ts +71 -0
  295. package/src/state/get-center-from-impact/get-page-border-box-center/when-combining.ts +40 -0
  296. package/src/state/get-center-from-impact/get-page-border-box-center/when-reordering.ts +113 -0
  297. package/src/state/get-center-from-impact/move-relative-to.ts +68 -0
  298. package/src/state/get-combined-item-displacement.ts +35 -0
  299. package/src/state/get-displaced-by.ts +17 -0
  300. package/src/state/get-displacement-groups.ts +131 -0
  301. package/src/state/get-drag-impact/get-combine-impact.ts +131 -0
  302. package/src/state/get-drag-impact/get-reorder-impact.ts +145 -0
  303. package/src/state/get-drag-impact/index.ts +94 -0
  304. package/src/state/get-draggables-inside-droppable.ts +31 -0
  305. package/src/state/get-droppable-over.ts +161 -0
  306. package/src/state/get-frame.ts +10 -0
  307. package/src/state/get-home-location.ts +7 -0
  308. package/src/state/get-impact-location.ts +16 -0
  309. package/src/state/get-is-displaced.ts +12 -0
  310. package/src/state/get-lift-effect.ts +84 -0
  311. package/src/state/get-max-scroll.ts +32 -0
  312. package/src/state/is-movement-allowed.ts +13 -0
  313. package/src/state/is-within.ts +9 -0
  314. package/src/state/middleware/auto-scroll.ts +38 -0
  315. package/src/state/middleware/dimension-marshal-stopper.ts +20 -0
  316. package/src/state/middleware/drop/drop-animation-finish-middleware.ts +21 -0
  317. package/src/state/middleware/drop/drop-animation-flush-on-scroll-middleware.ts +63 -0
  318. package/src/state/middleware/drop/drop-middleware.ts +146 -0
  319. package/src/state/middleware/drop/get-drop-duration.ts +48 -0
  320. package/src/state/middleware/drop/get-drop-impact.ts +79 -0
  321. package/src/state/middleware/drop/get-new-home-client-offset.ts +55 -0
  322. package/src/state/middleware/drop/index.ts +2 -0
  323. package/src/state/middleware/focus.ts +42 -0
  324. package/src/state/middleware/lift.ts +66 -0
  325. package/src/state/middleware/pending-drop.ts +37 -0
  326. package/src/state/middleware/responders/async-marshal.ts +58 -0
  327. package/src/state/middleware/responders/expiring-announce.ts +44 -0
  328. package/src/state/middleware/responders/index.ts +2 -0
  329. package/src/state/middleware/responders/is-equal.ts +57 -0
  330. package/src/state/middleware/responders/publisher.ts +255 -0
  331. package/src/state/middleware/responders/responders-middleware.ts +81 -0
  332. package/src/state/middleware/scroll-listener.ts +31 -0
  333. package/src/state/middleware/style.ts +22 -0
  334. package/src/state/middleware/util/validate-dimensions.ts +71 -0
  335. package/src/state/move-in-direction/index.ts +85 -0
  336. package/src/state/move-in-direction/move-cross-axis/get-best-cross-axis-droppable.ts +169 -0
  337. package/src/state/move-in-direction/move-cross-axis/get-closest-draggable.ts +80 -0
  338. package/src/state/move-in-direction/move-cross-axis/index.ts +110 -0
  339. package/src/state/move-in-direction/move-cross-axis/move-to-new-droppable.ts +122 -0
  340. package/src/state/move-in-direction/move-cross-axis/without-starting-displacement.ts +31 -0
  341. package/src/state/move-in-direction/move-in-direction-types.ts +10 -0
  342. package/src/state/move-in-direction/move-to-next-place/index.ts +133 -0
  343. package/src/state/move-in-direction/move-to-next-place/is-totally-visible-in-new-location.ts +53 -0
  344. package/src/state/move-in-direction/move-to-next-place/move-to-next-combine/index.ts +98 -0
  345. package/src/state/move-in-direction/move-to-next-place/move-to-next-index/from-combine.ts +53 -0
  346. package/src/state/move-in-direction/move-to-next-place/move-to-next-index/from-reorder.ts +44 -0
  347. package/src/state/move-in-direction/move-to-next-place/move-to-next-index/index.ts +87 -0
  348. package/src/state/no-impact.ts +33 -0
  349. package/src/state/patch-dimension-map.ts +11 -0
  350. package/src/state/patch-droppable-map.ts +10 -0
  351. package/src/state/position.ts +65 -0
  352. package/src/state/post-reducer/when-moving/refresh-snap.ts +68 -0
  353. package/src/state/post-reducer/when-moving/update.ts +121 -0
  354. package/src/state/publish-while-dragging-in-virtual/adjust-additions-for-scroll-changes.ts +59 -0
  355. package/src/state/publish-while-dragging-in-virtual/index.ts +159 -0
  356. package/src/state/publish-while-dragging-in-virtual/offset-draggable.ts +36 -0
  357. package/src/state/recompute-placeholders.ts +101 -0
  358. package/src/state/rect.ts +7 -0
  359. package/src/state/reducer.ts +467 -0
  360. package/src/state/registry/create-registry.ts +162 -0
  361. package/src/state/registry/registry-types.ts +106 -0
  362. package/src/state/registry/use-registry.ts +20 -0
  363. package/src/state/remove-draggable-from-list.ts +13 -0
  364. package/src/state/scroll-viewport.ts +34 -0
  365. package/src/state/spacing.ts +45 -0
  366. package/src/state/store-types.ts +19 -0
  367. package/src/state/update-displacement-visibility/recompute.ts +55 -0
  368. package/src/state/update-displacement-visibility/speculatively-increase.ts +112 -0
  369. package/src/state/visibility/is-partially-visible-through-frame.ts +60 -0
  370. package/src/state/visibility/is-position-in-frame.ts +12 -0
  371. package/src/state/visibility/is-totally-visible-through-frame-on-axis.ts +19 -0
  372. package/src/state/visibility/is-totally-visible-through-frame.ts +18 -0
  373. package/src/state/visibility/is-visible.ts +102 -0
  374. package/src/state/with-scroll-change/with-all-displacement.ts +15 -0
  375. package/src/state/with-scroll-change/with-droppable-displacement.ts +13 -0
  376. package/src/state/with-scroll-change/with-droppable-scroll.ts +13 -0
  377. package/src/state/with-scroll-change/with-viewport-displacement.ts +7 -0
  378. package/src/types/redux-devtools.d.ts +17 -0
  379. package/src/types.ts +495 -0
  380. package/src/view/animate-in-out/animate-in-out.tsx +98 -0
  381. package/src/view/animate-in-out/index.ts +2 -0
  382. package/src/view/check-is-valid-inner-ref.ts +15 -0
  383. package/src/view/context/app-context.ts +19 -0
  384. package/src/view/context/droppable-context.ts +12 -0
  385. package/src/view/context/hooks.ts +21 -0
  386. package/src/view/context/store-context.ts +8 -0
  387. package/src/view/data-attributes.ts +37 -0
  388. package/src/view/drag-drop-context/app.tsx +300 -0
  389. package/src/view/drag-drop-context/check-doctype.ts +39 -0
  390. package/src/view/drag-drop-context/check-react-version.ts +72 -0
  391. package/src/view/drag-drop-context/drag-drop-context-types.ts +8 -0
  392. package/src/view/drag-drop-context/drag-drop-context.tsx +60 -0
  393. package/src/view/drag-drop-context/error-boundary.tsx +89 -0
  394. package/src/view/drag-drop-context/index.ts +2 -0
  395. package/src/view/drag-drop-context/use-startup-validation.ts +13 -0
  396. package/src/view/drag-drop-context/use-unique-context-id.ts +13 -0
  397. package/src/view/draggable/connected-draggable.tsx +420 -0
  398. package/src/view/draggable/draggable-api.tsx +48 -0
  399. package/src/view/draggable/draggable-types.ts +204 -0
  400. package/src/view/draggable/draggable.tsx +167 -0
  401. package/src/view/draggable/get-style.ts +109 -0
  402. package/src/view/draggable/index.ts +2 -0
  403. package/src/view/draggable/use-validation.ts +70 -0
  404. package/src/view/droppable/connected-droppable.tsx +597 -0
  405. package/src/view/droppable/droppable-types.ts +96 -0
  406. package/src/view/droppable/droppable.tsx +167 -0
  407. package/src/view/droppable/index.ts +2 -0
  408. package/src/view/droppable/use-validation.ts +102 -0
  409. package/src/view/event-bindings/bind-events.ts +39 -0
  410. package/src/view/event-bindings/event-types.ts +15 -0
  411. package/src/view/get-body-element.ts +8 -0
  412. package/src/view/get-border-box-center-position.ts +5 -0
  413. package/src/view/get-document-element.ts +8 -0
  414. package/src/view/get-elements/find-drag-handle.ts +38 -0
  415. package/src/view/get-elements/find-draggable.ts +30 -0
  416. package/src/view/is-strict-equal.ts +2 -0
  417. package/src/view/is-type-of-element/is-element.ts +10 -0
  418. package/src/view/is-type-of-element/is-html-element.ts +10 -0
  419. package/src/view/is-type-of-element/is-svg-element.ts +22 -0
  420. package/src/view/key-codes.ts +13 -0
  421. package/src/view/placeholder/index.ts +2 -0
  422. package/src/view/placeholder/placeholder-types.ts +16 -0
  423. package/src/view/placeholder/placeholder.tsx +204 -0
  424. package/src/view/scroll-listener.ts +74 -0
  425. package/src/view/throw-if-invalid-inner-ref.ts +15 -0
  426. package/src/view/use-announcer/index.ts +2 -0
  427. package/src/view/use-announcer/use-announcer.ts +80 -0
  428. package/src/view/use-dev-setup-warning.ts +22 -0
  429. package/src/view/use-dev.ts +9 -0
  430. package/src/view/use-draggable-publisher/get-dimension.ts +44 -0
  431. package/src/view/use-draggable-publisher/index.ts +2 -0
  432. package/src/view/use-draggable-publisher/use-draggable-publisher.ts +87 -0
  433. package/src/view/use-droppable-publisher/check-for-nested-scroll-container.ts +27 -0
  434. package/src/view/use-droppable-publisher/get-closest-scrollable.ts +96 -0
  435. package/src/view/use-droppable-publisher/get-dimension.ts +140 -0
  436. package/src/view/use-droppable-publisher/get-env.ts +32 -0
  437. package/src/view/use-droppable-publisher/get-listener-options.ts +12 -0
  438. package/src/view/use-droppable-publisher/get-scroll.ts +7 -0
  439. package/src/view/use-droppable-publisher/index.ts +2 -0
  440. package/src/view/use-droppable-publisher/is-in-fixed-container.ts +21 -0
  441. package/src/view/use-droppable-publisher/use-droppable-publisher.ts +288 -0
  442. package/src/view/use-focus-marshal/focus-marshal-types.ts +14 -0
  443. package/src/view/use-focus-marshal/index.ts +2 -0
  444. package/src/view/use-focus-marshal/use-focus-marshal.ts +128 -0
  445. package/src/view/use-hidden-text-element/index.ts +2 -0
  446. package/src/view/use-hidden-text-element/use-hidden-text-element.ts +62 -0
  447. package/src/view/use-isomorphic-layout-effect.ts +18 -0
  448. package/src/view/use-previous-ref.ts +26 -0
  449. package/src/view/use-required-context.ts +22 -0
  450. package/src/view/use-sensor-marshal/closest.ts +89 -0
  451. package/src/view/use-sensor-marshal/find-closest-draggable-id-from-event.ts +50 -0
  452. package/src/view/use-sensor-marshal/index.ts +5 -0
  453. package/src/view/use-sensor-marshal/is-event-in-interactive-element.ts +67 -0
  454. package/src/view/use-sensor-marshal/lock.ts +50 -0
  455. package/src/view/use-sensor-marshal/sensors/use-keyboard-sensor.ts +243 -0
  456. package/src/view/use-sensor-marshal/sensors/use-mouse-sensor.ts +391 -0
  457. package/src/view/use-sensor-marshal/sensors/use-touch-sensor.ts +481 -0
  458. package/src/view/use-sensor-marshal/sensors/util/prevent-standard-key-events.ts +19 -0
  459. package/src/view/use-sensor-marshal/sensors/util/supported-page-visibility-event-name.ts +29 -0
  460. package/src/view/use-sensor-marshal/use-sensor-marshal.ts +504 -0
  461. package/src/view/use-sensor-marshal/use-validate-sensor-hooks.ts +20 -0
  462. package/src/view/use-style-marshal/get-styles.ts +173 -0
  463. package/src/view/use-style-marshal/index.ts +2 -0
  464. package/src/view/use-style-marshal/style-marshal-types.ts +9 -0
  465. package/src/view/use-style-marshal/use-style-marshal.ts +126 -0
  466. package/src/view/use-unique-id.ts +25 -0
  467. package/src/view/visually-hidden-style.ts +16 -0
  468. package/src/view/window/get-max-window-scroll.ts +19 -0
  469. package/src/view/window/get-viewport.ts +49 -0
  470. package/src/view/window/get-window-from-el.ts +12 -0
  471. package/src/view/window/get-window-scroll.ts +30 -0
  472. package/src/view/window/scroll-window.ts +7 -0
@@ -0,0 +1,31 @@
1
+ import type { Position } from 'css-box-model';
2
+ export declare const curves: {
3
+ outOfTheWay: string;
4
+ drop: string;
5
+ };
6
+ export declare const combine: {
7
+ opacity: {
8
+ drop: number;
9
+ combining: number;
10
+ };
11
+ scale: {
12
+ drop: number;
13
+ };
14
+ };
15
+ export declare const timings: {
16
+ outOfTheWay: number;
17
+ minDropTime: number;
18
+ maxDropTime: number;
19
+ };
20
+ export declare const placeholderTransitionDelayTime: number;
21
+ export declare const transitions: {
22
+ fluid: string;
23
+ snap: string;
24
+ drop: (duration: number) => string;
25
+ outOfTheWay: string;
26
+ placeholder: string;
27
+ };
28
+ export declare const transforms: {
29
+ moveTo: (offset: Position) => string | null;
30
+ drop: (offset: Position, isCombining: boolean) => string | null;
31
+ };
@@ -0,0 +1,3 @@
1
+ import type { Action } from '../../state/store-types';
2
+ declare const _default: (groupSize: number) => () => (next: (arg: Action) => unknown) => (action: Action) => any;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import type { Action } from '../../state/store-types';
2
+ declare const _default: () => (next: (arg: Action) => unknown) => (action: Action) => any;
3
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import type { Action, Store } from '../../state/store-types';
2
+ type Mode = 'verbose' | 'light';
3
+ declare const _default: (mode?: Mode) => (store: Store) => (next: (arg: Action) => unknown) => (action: Action) => any;
4
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import type { Action } from '../../state/store-types';
2
+ declare const _default: () => (next: (arg: Action) => unknown) => (action: Action) => any;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ export declare const forceEnable: () => void;
2
+ export declare const start: (key: string) => void;
3
+ export declare const finish: (key: string) => void;
@@ -0,0 +1,4 @@
1
+ export declare const getFormattedMessage: (message: string) => string[];
2
+ export declare function log(type: 'error' | 'warn', message: string): void;
3
+ export declare const warning: any;
4
+ export declare const error: any;
@@ -0,0 +1,2 @@
1
+ export declare function noop(): void;
2
+ export declare function identity<T>(value: T): T;
@@ -0,0 +1,8 @@
1
+ export { default as DragDropContext } from './view/drag-drop-context';
2
+ export { default as Droppable } from './view/droppable';
3
+ export { default as Draggable } from './view/draggable';
4
+ export { useMouseSensor, useTouchSensor, useKeyboardSensor, } from './view/use-sensor-marshal';
5
+ export { resetServerContext } from './view/drag-drop-context';
6
+ export type { Id, TypeId, DraggableId, DroppableId, DraggableRubric, MovementMode, BeforeCapture, DragStart, DragUpdate, DropResult, Direction, ResponderProvided, Announce, DraggableLocation, OnBeforeCaptureResponder, OnBeforeDragStartResponder, OnDragStartResponder, OnDragUpdateResponder, OnDragEndResponder, SensorAPI, Sensor, TryGetLock, TryGetLockOptions, } from './types';
7
+ export type { Provided as DroppableProvided, StateSnapshot as DroppableStateSnapshot, DroppableProps, } from './view/droppable/droppable-types';
8
+ export type { Provided as DraggableProvided, StateSnapshot as DraggableStateSnapshot, DragHandleProps, DropAnimation, DraggableProps, DraggableStyle, DraggingStyle, NotDraggingStyle, ChildrenFn as DraggableChildrenFn, } from './view/draggable/draggable-types';
@@ -0,0 +1,4 @@
1
+ export declare class RbdInvariant extends Error {
2
+ constructor(message: string);
3
+ }
4
+ export declare function invariant(condition: unknown, message?: string): asserts condition;
@@ -0,0 +1,10 @@
1
+ type Map<T> = {
2
+ [key: string]: T;
3
+ };
4
+ export declare function isInteger(value: unknown): boolean;
5
+ export declare function values<T>(map: Map<T>): T[];
6
+ type PredicateFn<T> = (value: T) => boolean;
7
+ export declare function findIndex<T>(list: Array<T>, predicate: PredicateFn<T>): number;
8
+ export declare function find<T>(list: Array<T>, predicate: PredicateFn<T>): T | undefined;
9
+ export declare function toArray(list: NodeListOf<HTMLElement>): Element[];
10
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { DragStart, DragUpdate, DropResult } from './types';
2
+ export type MessagePreset = {
3
+ dragHandleUsageInstructions: string;
4
+ onDragStart: (start: DragStart) => string;
5
+ onDragUpdate: (update: DragUpdate) => string;
6
+ onDragEnd: (result: DropResult) => string;
7
+ };
8
+ declare const preset: MessagePreset;
9
+ export default preset;
@@ -0,0 +1,158 @@
1
+ import type { Position } from 'css-box-model';
2
+ import type { Critical, DraggableId, DroppableId, CompletedDrag, MovementMode, Viewport, DimensionMap, DropReason, Published } from '../types';
3
+ export type BeforeInitialCaptureArgs = {
4
+ draggableId: DraggableId;
5
+ movementMode: MovementMode;
6
+ };
7
+ export type BeforeInitialCaptureAction = {
8
+ type: 'BEFORE_INITIAL_CAPTURE';
9
+ payload: BeforeInitialCaptureArgs;
10
+ };
11
+ export declare const beforeInitialCapture: (args: BeforeInitialCaptureArgs) => BeforeInitialCaptureAction;
12
+ export type LiftArgs = {
13
+ id: DraggableId;
14
+ clientSelection: Position;
15
+ movementMode: MovementMode;
16
+ };
17
+ export type LiftAction = {
18
+ type: 'LIFT';
19
+ payload: LiftArgs;
20
+ };
21
+ export declare const lift: (args: LiftArgs) => LiftAction;
22
+ export type InitialPublishArgs = {
23
+ critical: Critical;
24
+ dimensions: DimensionMap;
25
+ clientSelection: Position;
26
+ viewport: Viewport;
27
+ movementMode: MovementMode;
28
+ };
29
+ export type InitialPublishAction = {
30
+ type: 'INITIAL_PUBLISH';
31
+ payload: InitialPublishArgs;
32
+ };
33
+ export declare const initialPublish: (args: InitialPublishArgs) => InitialPublishAction;
34
+ export type WhileDraggingPublishAction = {
35
+ type: 'PUBLISH_WHILE_DRAGGING';
36
+ payload: Published;
37
+ };
38
+ export declare const publishWhileDragging: (args: Published) => WhileDraggingPublishAction;
39
+ export type CollectionStartingAction = {
40
+ type: 'COLLECTION_STARTING';
41
+ payload: null;
42
+ };
43
+ export declare const collectionStarting: () => CollectionStartingAction;
44
+ export type UpdateDroppableScrollArgs = {
45
+ id: DroppableId;
46
+ newScroll: Position;
47
+ };
48
+ export type UpdateDroppableScrollAction = {
49
+ type: 'UPDATE_DROPPABLE_SCROLL';
50
+ payload: UpdateDroppableScrollArgs;
51
+ };
52
+ export declare const updateDroppableScroll: (args: UpdateDroppableScrollArgs) => UpdateDroppableScrollAction;
53
+ export type UpdateDroppableIsEnabledArgs = {
54
+ id: DroppableId;
55
+ isEnabled: boolean;
56
+ };
57
+ export type UpdateDroppableIsEnabledAction = {
58
+ type: 'UPDATE_DROPPABLE_IS_ENABLED';
59
+ payload: UpdateDroppableIsEnabledArgs;
60
+ };
61
+ export declare const updateDroppableIsEnabled: (args: UpdateDroppableIsEnabledArgs) => UpdateDroppableIsEnabledAction;
62
+ export type UpdateDroppableIsCombineEnabledArgs = {
63
+ id: DroppableId;
64
+ isCombineEnabled: boolean;
65
+ };
66
+ export type UpdateDroppableIsCombineEnabledAction = {
67
+ type: 'UPDATE_DROPPABLE_IS_COMBINE_ENABLED';
68
+ payload: UpdateDroppableIsCombineEnabledArgs;
69
+ };
70
+ export declare const updateDroppableIsCombineEnabled: (args: UpdateDroppableIsCombineEnabledArgs) => UpdateDroppableIsCombineEnabledAction;
71
+ export type MoveArgs = {
72
+ client: Position;
73
+ };
74
+ export type MoveAction = {
75
+ type: 'MOVE';
76
+ payload: MoveArgs;
77
+ };
78
+ export declare const move: (args: MoveArgs) => MoveAction;
79
+ type MoveByWindowScrollArgs = {
80
+ newScroll: Position;
81
+ };
82
+ export type MoveByWindowScrollAction = {
83
+ type: 'MOVE_BY_WINDOW_SCROLL';
84
+ payload: MoveByWindowScrollArgs;
85
+ };
86
+ export declare const moveByWindowScroll: (args: MoveByWindowScrollArgs) => MoveByWindowScrollAction;
87
+ export type UpdateViewportMaxScrollArgs = {
88
+ maxScroll: Position;
89
+ };
90
+ type UpdateViewportMaxScrollAction = {
91
+ type: 'UPDATE_VIEWPORT_MAX_SCROLL';
92
+ payload: UpdateViewportMaxScrollArgs;
93
+ };
94
+ export declare const updateViewportMaxScroll: (args: UpdateViewportMaxScrollArgs) => UpdateViewportMaxScrollAction;
95
+ export type MoveUpAction = {
96
+ type: 'MOVE_UP';
97
+ payload: null;
98
+ };
99
+ export declare const moveUp: () => MoveUpAction;
100
+ export type MoveDownAction = {
101
+ type: 'MOVE_DOWN';
102
+ payload: null;
103
+ };
104
+ export declare const moveDown: () => MoveDownAction;
105
+ export type MoveRightAction = {
106
+ type: 'MOVE_RIGHT';
107
+ payload: null;
108
+ };
109
+ export declare const moveRight: () => MoveRightAction;
110
+ export type MoveLeftAction = {
111
+ type: 'MOVE_LEFT';
112
+ payload: null;
113
+ };
114
+ export declare const moveLeft: () => MoveLeftAction;
115
+ type FlushAction = {
116
+ type: 'FLUSH';
117
+ payload: null;
118
+ };
119
+ export declare const flush: () => FlushAction;
120
+ export type AnimateDropArgs = {
121
+ completed: CompletedDrag;
122
+ newHomeClientOffset: Position;
123
+ dropDuration: number;
124
+ };
125
+ export type DropAnimateAction = {
126
+ type: 'DROP_ANIMATE';
127
+ payload: AnimateDropArgs;
128
+ };
129
+ export declare const animateDrop: (args: AnimateDropArgs) => DropAnimateAction;
130
+ export type DropCompleteArgs = {
131
+ completed: CompletedDrag;
132
+ };
133
+ export type DropCompleteAction = {
134
+ type: 'DROP_COMPLETE';
135
+ payload: DropCompleteArgs;
136
+ };
137
+ export declare const completeDrop: (args: DropCompleteArgs) => DropCompleteAction;
138
+ type DropArgs = {
139
+ reason: DropReason;
140
+ };
141
+ export type DropAction = {
142
+ type: 'DROP';
143
+ payload: DropArgs;
144
+ };
145
+ export declare const drop: (args: DropArgs) => DropAction;
146
+ export declare const cancel: () => DropAction;
147
+ export type DropPendingAction = {
148
+ type: 'DROP_PENDING';
149
+ payload: DropArgs;
150
+ };
151
+ export declare const dropPending: (args: DropArgs) => DropPendingAction;
152
+ export type DropAnimationFinishedAction = {
153
+ type: 'DROP_ANIMATION_FINISHED';
154
+ payload: null;
155
+ };
156
+ export declare const dropAnimationFinished: () => DropAnimationFinishedAction;
157
+ export type Action = BeforeInitialCaptureAction | LiftAction | InitialPublishAction | WhileDraggingPublishAction | CollectionStartingAction | UpdateDroppableScrollAction | UpdateDroppableIsEnabledAction | UpdateDroppableIsCombineEnabledAction | MoveByWindowScrollAction | UpdateViewportMaxScrollAction | MoveAction | MoveUpAction | MoveDownAction | MoveRightAction | MoveLeftAction | DropPendingAction | DropAction | DropAnimateAction | DropAnimationFinishedAction | DropCompleteAction | FlushAction;
158
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { State, DraggingState } from '../../types';
2
+ export type AutoScroller = {
3
+ start: (state: DraggingState) => void;
4
+ stop: () => void;
5
+ scroll: (state: State) => void;
6
+ };
@@ -0,0 +1,19 @@
1
+ import type { Position } from 'css-box-model';
2
+ import type { DroppableDimension, Viewport } from '../../types';
3
+ type CanPartiallyScrollArgs = {
4
+ max: Position;
5
+ current: Position;
6
+ change: Position;
7
+ };
8
+ type GetRemainderArgs = {
9
+ current: Position;
10
+ max: Position;
11
+ change: Position;
12
+ };
13
+ export declare const getOverlap: ({ current, max, change }: GetRemainderArgs) => Position | null;
14
+ export declare const canPartiallyScroll: ({ max: rawMax, current, change, }: CanPartiallyScrollArgs) => boolean;
15
+ export declare const canScrollWindow: (viewport: Viewport, change: Position) => boolean;
16
+ export declare const getWindowOverlap: (viewport: Viewport, change: Position) => Position | null;
17
+ export declare const canScrollDroppable: (droppable: DroppableDimension, change: Position) => boolean;
18
+ export declare const getDroppableOverlap: (droppable: DroppableDimension, change: Position) => Position | null;
19
+ export {};
@@ -0,0 +1,11 @@
1
+ declare const config: {
2
+ startFromPercentage: number;
3
+ maxScrollAtPercentage: number;
4
+ maxPixelScroll: number;
5
+ ease: (percentage: number) => number;
6
+ durationDampening: {
7
+ stopDampeningAt: number;
8
+ accelerateAt: number;
9
+ };
10
+ };
11
+ export default config;
@@ -0,0 +1,9 @@
1
+ import { type Position } from 'css-box-model';
2
+ import type { DroppableDimension, DroppableDimensionMap, DroppableId } from '../../../types';
3
+ type Api = {
4
+ center: Position;
5
+ destination: DroppableId | null;
6
+ droppables: DroppableDimensionMap;
7
+ };
8
+ declare const _default: ({ center, destination, droppables, }: Api) => DroppableDimension | null | undefined;
9
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import type { Position, Rect } from 'css-box-model';
2
+ import type { DroppableDimension } from '../../../types';
3
+ type Args = {
4
+ droppable: DroppableDimension;
5
+ subject: Rect;
6
+ center: Position;
7
+ dragStartTime: number;
8
+ shouldUseTimeDampening: boolean;
9
+ };
10
+ declare const _default: ({ droppable, subject, center, dragStartTime, shouldUseTimeDampening, }: Args) => Position | null;
11
+ export default _default;
@@ -0,0 +1,7 @@
1
+ type Args = {
2
+ startOfRange: number;
3
+ endOfRange: number;
4
+ current: number;
5
+ };
6
+ declare const _default: ({ startOfRange, endOfRange, current }: Args) => number;
7
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import type { Rect, Position } from 'css-box-model';
2
+ type Args = {
3
+ container: Rect;
4
+ subject: Rect;
5
+ proposedScroll: Position;
6
+ };
7
+ declare const _default: ({ container, subject, proposedScroll }: Args) => Position | null | undefined;
8
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: (proposedScroll: number, dragStartTime: number) => number;
2
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import type { Rect } from 'css-box-model';
2
+ import type { Axis } from '../../../../../types';
3
+ export type DistanceThresholds = {
4
+ startScrollingFrom: number;
5
+ maxScrollValueAt: number;
6
+ };
7
+ declare const _default: (container: Rect, axis: Axis) => DistanceThresholds;
8
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { type DistanceThresholds } from './get-distance-thresholds';
2
+ declare const _default: (distanceToEdge: number, thresholds: DistanceThresholds) => number;
3
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { type DistanceThresholds } from './get-distance-thresholds';
2
+ type Args = {
3
+ distanceToEdge: number;
4
+ thresholds: DistanceThresholds;
5
+ dragStartTime: number;
6
+ shouldUseTimeDampening: boolean;
7
+ };
8
+ declare const _default: ({ distanceToEdge, thresholds, dragStartTime, shouldUseTimeDampening, }: Args) => number;
9
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import type { Rect, Spacing } from 'css-box-model';
2
+ import type { Axis } from '../../../../../types';
3
+ type GetOnAxisArgs = {
4
+ container: Rect;
5
+ distanceToEdges: Spacing;
6
+ dragStartTime: number;
7
+ axis: Axis;
8
+ shouldUseTimeDampening: boolean;
9
+ };
10
+ declare const _default: ({ container, distanceToEdges, dragStartTime, axis, shouldUseTimeDampening, }: GetOnAxisArgs) => number;
11
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: 1;
2
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import type { Position, Rect } from 'css-box-model';
2
+ type Args = {
3
+ dragStartTime: number;
4
+ container: Rect;
5
+ subject: Rect;
6
+ center: Position;
7
+ shouldUseTimeDampening: boolean;
8
+ };
9
+ declare const _default: ({ dragStartTime, container, subject, center, shouldUseTimeDampening, }: Args) => Position | null;
10
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import type { Position, Rect } from 'css-box-model';
2
+ import type { Viewport } from '../../../types';
3
+ type Args = {
4
+ viewport: Viewport;
5
+ subject: Rect;
6
+ center: Position;
7
+ dragStartTime: number;
8
+ shouldUseTimeDampening: boolean;
9
+ };
10
+ declare const _default: ({ viewport, subject, center, dragStartTime, shouldUseTimeDampening, }: Args) => Position | null;
11
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import { type Position } from 'css-box-model';
2
+ import type { DraggingState, DroppableId } from '../../../types';
3
+ export type PublicArgs = {
4
+ scrollWindow: (change: Position) => void;
5
+ scrollDroppable: (id: DroppableId, change: Position) => void;
6
+ };
7
+ export type FluidScroller = {
8
+ scroll: (state: DraggingState) => void;
9
+ start: (state: DraggingState) => void;
10
+ stop: () => void;
11
+ };
12
+ declare const _default: ({ scrollWindow, scrollDroppable, }: PublicArgs) => FluidScroller;
13
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type Position } from 'css-box-model';
2
+ import type { DraggingState, DroppableId } from '../../../types';
3
+ type Args = {
4
+ state: DraggingState;
5
+ dragStartTime: number;
6
+ shouldUseTimeDampening: boolean;
7
+ scrollWindow: (scroll: Position) => void;
8
+ scrollDroppable: (id: DroppableId, scroll: Position) => void;
9
+ };
10
+ declare const _default: ({ state, dragStartTime, shouldUseTimeDampening, scrollWindow, scrollDroppable, }: Args) => void;
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type Position } from 'css-box-model';
2
+ import type { AutoScroller } from './auto-scroller-types';
3
+ import type { DroppableId } from '../../types';
4
+ import type { MoveArgs } from '../action-creators';
5
+ export type Args = {
6
+ scrollWindow: (offset: Position) => void;
7
+ scrollDroppable: (id: DroppableId, change: Position) => void;
8
+ move: (args: MoveArgs) => unknown;
9
+ };
10
+ declare const _default: ({ scrollDroppable, scrollWindow, move, }: Args) => AutoScroller;
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { type Position } from 'css-box-model';
2
+ import { type MoveArgs } from '../action-creators';
3
+ import type { DraggingState, DroppableId } from '../../types';
4
+ type Args = {
5
+ scrollDroppable: (id: DroppableId, change: Position) => void;
6
+ scrollWindow: (offset: Position) => void;
7
+ move: (args: MoveArgs) => unknown;
8
+ };
9
+ export type JumpScroller = (state: DraggingState) => void;
10
+ declare const _default: ({ move, scrollDroppable, scrollWindow, }: Args) => JumpScroller;
11
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import type { HorizontalAxis, VerticalAxis } from '../types';
2
+ export declare const vertical: VerticalAxis;
3
+ export declare const horizontal: HorizontalAxis;
@@ -0,0 +1,13 @@
1
+ import type { DraggableDimension, DroppableDimension, DragImpact, DisplacementGroups, Viewport, DisplacedBy } from '../../types';
2
+ type Args = {
3
+ draggable: DraggableDimension;
4
+ insideDestination: DraggableDimension[];
5
+ destination: DroppableDimension;
6
+ viewport: Viewport;
7
+ displacedBy: DisplacedBy;
8
+ last: DisplacementGroups;
9
+ index: number | null;
10
+ forceShouldAnimate?: boolean;
11
+ };
12
+ export default function calculateReorderImpact({ draggable, insideDestination, destination, viewport, displacedBy, last, index, forceShouldAnimate, }: Args): DragImpact;
13
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { State, DraggableId } from '../types';
2
+ declare const _default: (state: State, id: DraggableId) => boolean;
3
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import type { DimensionMarshal } from './dimension-marshal/dimension-marshal-types';
2
+ import type { FocusMarshal } from '../view/use-focus-marshal/focus-marshal-types';
3
+ import type { StyleMarshal } from '../view/use-style-marshal/style-marshal-types';
4
+ import type { AutoScroller } from './auto-scroller/auto-scroller-types';
5
+ import type { Responders, Announce } from '../types';
6
+ import type { Store } from './store-types';
7
+ type Args = {
8
+ dimensionMarshal: DimensionMarshal;
9
+ focusMarshal: FocusMarshal;
10
+ styleMarshal: StyleMarshal;
11
+ getResponders: () => Responders;
12
+ announce: Announce;
13
+ autoScroller: AutoScroller;
14
+ };
15
+ declare const _default: ({ dimensionMarshal, focusMarshal, styleMarshal, getResponders, announce, autoScroller, }: Args) => Store;
16
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import type { DraggableId, LiftEffect } from '../types';
2
+ export default function didStartAfterCritical(draggableId: DraggableId, afterCritical: LiftEffect): boolean;
@@ -0,0 +1,23 @@
1
+ import type { Position } from 'css-box-model';
2
+ import type { UpdateDroppableScrollArgs, UpdateDroppableIsEnabledArgs, UpdateDroppableIsCombineEnabledArgs } from '../action-creators';
3
+ import type { DroppableId, Critical, DimensionMap, LiftRequest, Published, Viewport } from '../../types';
4
+ export type StartPublishingResult = {
5
+ critical: Critical;
6
+ dimensions: DimensionMap;
7
+ viewport: Viewport;
8
+ };
9
+ export type DimensionMarshal = {
10
+ updateDroppableIsEnabled: (id: DroppableId, isEnabled: boolean) => void;
11
+ updateDroppableIsCombineEnabled: (id: DroppableId, isEnabled: boolean) => void;
12
+ updateDroppableScroll: (id: DroppableId, newScroll: Position) => void;
13
+ scrollDroppable: (id: DroppableId, change: Position) => void;
14
+ startPublishing: (request: LiftRequest) => StartPublishingResult;
15
+ stopPublishing: () => void;
16
+ };
17
+ export type Callbacks = {
18
+ collectionStarting: () => unknown;
19
+ publishWhileDragging: (args: Published) => unknown;
20
+ updateDroppableScroll: (args: UpdateDroppableScrollArgs) => unknown;
21
+ updateDroppableIsEnabled: (args: UpdateDroppableIsEnabledArgs) => unknown;
22
+ updateDroppableIsCombineEnabled: (args: UpdateDroppableIsCombineEnabledArgs) => unknown;
23
+ };
@@ -0,0 +1,4 @@
1
+ import type { DimensionMarshal, Callbacks } from './dimension-marshal-types';
2
+ import type { Registry } from '../registry/registry-types';
3
+ declare const _default: (registry: Registry, callbacks: Callbacks) => DimensionMarshal;
4
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import type { StartPublishingResult } from './dimension-marshal-types';
2
+ import type { Registry } from '../registry/registry-types';
3
+ import type { ScrollOptions, Critical } from '../../types';
4
+ type Args = {
5
+ critical: Critical;
6
+ scrollOptions: ScrollOptions;
7
+ registry: Registry;
8
+ };
9
+ declare const _default: ({ critical, scrollOptions, registry, }: Args) => StartPublishingResult;
10
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import type { Published } from '../../types';
2
+ import type { Registry, DraggableEntry } from '../registry/registry-types';
3
+ export type WhileDraggingPublisher = {
4
+ add: (entry: DraggableEntry) => void;
5
+ remove: (entry: DraggableEntry) => void;
6
+ stop: () => void;
7
+ };
8
+ type Callbacks = {
9
+ publish: (args: Published) => unknown;
10
+ collectionStarting: () => unknown;
11
+ };
12
+ type Args = {
13
+ registry: Registry;
14
+ callbacks: Callbacks;
15
+ };
16
+ export default function createPublisher({ registry, callbacks, }: Args): WhileDraggingPublisher;
17
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { DroppableDimension, DroppableDimensionMap, DraggableDimension, DraggableDimensionMap } from '../types';
2
+ export declare const toDroppableMap: import("memoize-one").MemoizedFn<(droppables: DroppableDimension[]) => DroppableDimensionMap>;
3
+ export declare const toDraggableMap: import("memoize-one").MemoizedFn<(draggables: DraggableDimension[]) => DraggableDimensionMap>;
4
+ export declare const toDroppableList: import("memoize-one").MemoizedFn<(droppables: DroppableDimensionMap) => DroppableDimension[]>;
5
+ export declare const toDraggableList: import("memoize-one").MemoizedFn<(draggables: DraggableDimensionMap) => DraggableDimension[]>;
@@ -0,0 +1,21 @@
1
+ import { type BoxModel, type Position } from 'css-box-model';
2
+ import type { DroppableDimension, DroppableDescriptor, ScrollSize } from '../../types';
3
+ export type Closest = {
4
+ client: BoxModel;
5
+ page: BoxModel;
6
+ scroll: Position;
7
+ scrollSize: ScrollSize;
8
+ shouldClipSubject: boolean;
9
+ };
10
+ type Args = {
11
+ descriptor: DroppableDescriptor;
12
+ isEnabled: boolean;
13
+ isCombineEnabled: boolean;
14
+ isFixedOnPage: boolean;
15
+ direction: 'vertical' | 'horizontal';
16
+ client: BoxModel;
17
+ page: BoxModel;
18
+ closest?: Closest | null;
19
+ };
20
+ declare const _default: ({ descriptor, isEnabled, isCombineEnabled, isFixedOnPage, direction, client, page, closest, }: Args) => DroppableDimension;
21
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import type { DraggableDimension, DroppableDimension } from '../../types';
2
+ declare const _default: (draggable: DraggableDimension, destination: DroppableDimension) => boolean;
3
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import { type Position } from 'css-box-model';
2
+ import type { DroppableDimension } from '../../types';
3
+ declare const _default: (droppable: DroppableDimension, newScroll: Position) => DroppableDimension;
4
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import type { DraggableDescriptor, DragImpact } from '../../types';
2
+ declare const _default: (descriptor: DraggableDescriptor, impact: DragImpact) => boolean;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { type Rect, type Spacing } from 'css-box-model';
2
+ declare const _default: (frame: Spacing, subject: Spacing) => Rect | null;
3
+ export default _default;