dune-react 0.0.21 → 0.0.23

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 (249) hide show
  1. package/dist/components/index.d.ts +1 -0
  2. package/dist/components/puck-base/button.d.ts +1 -1
  3. package/dist/components/puck-base/button.js +5 -6
  4. package/dist/components/puck-base/card.d.ts +1 -1
  5. package/dist/components/puck-base/container.js +1 -1
  6. package/dist/components/puck-base/content.d.ts +1 -1
  7. package/dist/components/puck-base/image.js +16 -16
  8. package/dist/components/puck-base/index.d.ts +1 -13
  9. package/dist/components/puck-block/banner-sections/css-marquee-banner/css-marquee-banner.js +13 -13
  10. package/dist/components/puck-block/banner-sections/dismissible-banner/index.d.ts +3 -25
  11. package/dist/components/puck-block/banner-sections/dual-row-marquee/dual-row-marquee.js +8 -8
  12. package/dist/components/puck-block/banner-sections/scroll-driven-marquee/scroll-driven-marquee.js +8 -6
  13. package/dist/components/puck-block/banner-sections/scroll-parallax-text/scroll-parallax-text.js +3 -1
  14. package/dist/components/puck-block/contact-sections/centered-form/index.d.ts +1 -1
  15. package/dist/components/puck-block/contact-sections/contact-cards-grid/contact-cards-grid.js +1 -1
  16. package/dist/components/puck-block/contact-sections/contact-modal/contact-modal.js +1 -1
  17. package/dist/components/puck-block/contact-sections/contact-modal/index.d.ts +1 -1
  18. package/dist/components/puck-block/contact-sections/form-with-media/form-with-media.js +1 -1
  19. package/dist/components/puck-block/contact-sections/form-with-media/index.d.ts +1 -1
  20. package/dist/components/puck-block/contact-sections/header-form-cards/header-form-cards.js +1 -1
  21. package/dist/components/puck-block/contact-sections/header-form-cards/index.d.ts +1 -1
  22. package/dist/components/puck-block/contact-sections/header-info-fullwidth/header-info-fullwidth.js +2 -2
  23. package/dist/components/puck-block/contact-sections/info-cards-media/info-cards-media.js +2 -2
  24. package/dist/components/puck-block/contact-sections/location-cards-grid/index.d.ts +1 -1
  25. package/dist/components/puck-block/contact-sections/split-info-form/index.d.ts +1 -1
  26. package/dist/components/puck-block/contact-sections/split-info-form/split-info-form.js +1 -1
  27. package/dist/components/puck-block/cta-sections/feature-card-cta/index.d.ts +1 -1
  28. package/dist/components/puck-block/cta-sections/index.d.ts +2 -0
  29. package/dist/components/puck-block/cta-sections/mouse-track-cta/index.d.ts +1 -1
  30. package/dist/components/puck-block/cta-sections/mouse-track-cta/mouse-track-cta.js +92 -63
  31. package/dist/components/puck-block/cta-sections/props.js +46 -0
  32. package/dist/components/puck-block/cta-sections/side-media-cta/index.d.ts +1 -73
  33. package/dist/components/puck-block/cta-sections/side-media-cta/index.js +35 -0
  34. package/dist/components/puck-block/cta-sections/side-media-cta/side-media-cta.js +84 -0
  35. package/dist/components/puck-block/cta-sections/text-block-cta/index.d.ts +2 -74
  36. package/dist/components/puck-block/cta-sections/text-block-cta/index.js +38 -0
  37. package/dist/components/puck-block/cta-sections/text-block-cta/text-block-cta.d.ts +1 -1
  38. package/dist/components/puck-block/cta-sections/text-block-cta/text-block-cta.js +165 -0
  39. package/dist/components/puck-block/faq-sections/dual-column-accordion-faq/index.d.ts +1 -1
  40. package/dist/components/puck-block/faq-sections/icon-card-faq/index.d.ts +1 -1
  41. package/dist/components/puck-block/faq-sections/stacked-accordion-faq/index.d.ts +1 -1
  42. package/dist/components/puck-block/faq-sections/stacked-static-faq/index.d.ts +1 -1
  43. package/dist/components/puck-block/faq-sections/two-column-accordion-faq/index.d.ts +1 -1
  44. package/dist/components/puck-block/faq-sections/two-column-static-faq/index.d.ts +1 -1
  45. package/dist/components/puck-block/feature-sections/feature-cards-grid/component.js +1 -1
  46. package/dist/components/puck-block/feature-sections/feature-cards-grid/index.d.ts +2 -2
  47. package/dist/components/puck-block/feature-sections/feature-list-split/component.js +1 -1
  48. package/dist/components/puck-block/feature-sections/feature-list-split/index.d.ts +2 -2
  49. package/dist/components/puck-block/feature-sections/tab-feature/component.js +80 -64
  50. package/dist/components/puck-block/feature-sections/text-media-split/component.js +1 -1
  51. package/dist/components/puck-block/feature-sections/text-media-split/index.d.ts +1 -1
  52. package/dist/components/puck-block/feature-sections/text-only-section/index.d.ts +1 -1
  53. package/dist/components/puck-block/footer-sections/centered-minimal-footer/centered-minimal-footer.js +72 -18
  54. package/dist/components/puck-block/footer-sections/centered-minimal-footer/index.d.ts +79 -0
  55. package/dist/components/puck-block/footer-sections/centered-minimal-footer/index.js +43 -1
  56. package/dist/components/puck-block/footer-sections/compact-newsletter-footer/index.d.ts +42 -1
  57. package/dist/components/puck-block/footer-sections/contact-links-footer/contact-links-footer.js +4 -3
  58. package/dist/components/puck-block/footer-sections/contact-links-footer/index.d.ts +86 -0
  59. package/dist/components/puck-block/footer-sections/contact-links-footer/index.js +1 -1
  60. package/dist/components/puck-block/footer-sections/cta-links-footer/cta-links-footer.js +3 -2
  61. package/dist/components/puck-block/footer-sections/cta-links-footer/index.d.ts +38 -1
  62. package/dist/components/puck-block/footer-sections/cta-links-footer/index.js +1 -1
  63. package/dist/components/puck-block/footer-sections/links-newsletter-footer/index.d.ts +55 -1
  64. package/dist/components/puck-block/footer-sections/newsletter-links-footer/index.d.ts +42 -1
  65. package/dist/components/puck-block/footer-sections/newsletter-top-links-footer/index.d.ts +55 -1
  66. package/dist/components/puck-block/footer-sections/props.d.ts +3 -0
  67. package/dist/components/puck-block/gallery-sections/fullscreen-portfolio/fullscreen-portfolio.js +1 -1
  68. package/dist/components/puck-block/gallery-sections/fullscreen-portfolio/index.d.ts +25 -28
  69. package/dist/components/puck-block/gallery-sections/fullscreen-portfolio/index.js +3 -2
  70. package/dist/components/puck-block/gallery-sections/interactive-portfolio/interactive-portfolio.js +1 -1
  71. package/dist/components/puck-block/gallery-sections/portfolio-cards/index.d.ts +2 -2
  72. package/dist/components/puck-block/gallery-sections/portfolio-cards/portfolio-cards.js +1 -1
  73. package/dist/components/puck-block/gallery-sections/portfolio-divider/index.d.ts +2 -2
  74. package/dist/components/puck-block/gallery-sections/portfolio-divider/portfolio-divider.js +68 -65
  75. package/dist/components/puck-block/gallery-sections/props.d.ts +11 -1
  76. package/dist/components/puck-block/gallery-sections/props.js +7 -2
  77. package/dist/components/puck-block/gallery-sections/scroll-parallax/scroll-parallax.js +18 -0
  78. package/dist/components/puck-block/gallery-sections/scroll-parallax-portfolio/index.d.ts +24 -27
  79. package/dist/components/puck-block/gallery-sections/scroll-parallax-portfolio/index.js +3 -2
  80. package/dist/components/puck-block/gallery-sections/scroll-parallax-portfolio/scroll-parallax-portfolio.js +25 -22
  81. package/dist/components/puck-block/gallery-sections/split-carousel/index.d.ts +11 -1
  82. package/dist/components/puck-block/header-sections/centered-navbar/centered-navbar.js +3 -2
  83. package/dist/components/puck-block/header-sections/centered-navbar/index.d.ts +1 -1
  84. package/dist/components/puck-block/header-sections/drawer-navbar/drawer-navbar.js +119 -17
  85. package/dist/components/puck-block/header-sections/drawer-navbar/index.d.ts +1 -1
  86. package/dist/components/puck-block/header-sections/floating-bordered-navbar/floating-bordered-navbar.js +162 -22
  87. package/dist/components/puck-block/header-sections/floating-bordered-navbar/index.d.ts +1 -1
  88. package/dist/components/puck-block/header-sections/fullscreen-overlay-navbar/fullscreen-overlay-navbar.js +143 -19
  89. package/dist/components/puck-block/header-sections/fullscreen-overlay-navbar/index.d.ts +1 -1
  90. package/dist/components/puck-block/header-sections/mega-menu-navbar/index.d.ts +1 -1
  91. package/dist/components/puck-block/header-sections/mega-menu-navbar/mega-menu-navbar.js +3 -2
  92. package/dist/components/puck-block/header-sections/props.d.ts +3 -0
  93. package/dist/components/puck-block/header-sections/standard-navbar/index.d.ts +1 -1
  94. package/dist/components/puck-block/header-sections/standard-navbar/standard-navbar.js +3 -2
  95. package/dist/components/puck-block/hero-sections/carousel-hero/component.js +50 -9
  96. package/dist/components/puck-block/hero-sections/carousel-hero/index.d.ts +1 -1
  97. package/dist/components/puck-block/hero-sections/centered-hero/index.d.ts +2 -2
  98. package/dist/components/puck-block/hero-sections/column-scroll-hero/component.js +8 -8
  99. package/dist/components/puck-block/hero-sections/column-scroll-hero/index.d.ts +1 -1
  100. package/dist/components/puck-block/hero-sections/dual-marquee-hero/component.js +6 -6
  101. package/dist/components/puck-block/hero-sections/dual-marquee-hero/index.d.ts +1 -1
  102. package/dist/components/puck-block/hero-sections/fullscreen-hero/index.d.ts +2 -2
  103. package/dist/components/puck-block/hero-sections/fullscreen-video-hero/component.js +5 -3
  104. package/dist/components/puck-block/hero-sections/fullscreen-video-hero/index.d.ts +1 -1
  105. package/dist/components/puck-block/hero-sections/grid-expand-hero/component.js +26 -17
  106. package/dist/components/puck-block/hero-sections/grid-expand-hero/index.d.ts +1 -1
  107. package/dist/components/puck-block/hero-sections/horizontal-marquee-hero/component.js +3 -3
  108. package/dist/components/puck-block/hero-sections/horizontal-marquee-hero/index.d.ts +1 -1
  109. package/dist/components/puck-block/hero-sections/inline-image-hero/index.d.ts +1 -1
  110. package/dist/components/puck-block/hero-sections/media-text-hero/index.d.ts +26 -29
  111. package/dist/components/puck-block/hero-sections/mouse-track-hero/component.js +60 -19
  112. package/dist/components/puck-block/hero-sections/mouse-track-hero/index.d.ts +1 -1
  113. package/dist/components/puck-block/hero-sections/multi-image-grid-hero/index.d.ts +25 -28
  114. package/dist/components/puck-block/hero-sections/multi-image-grid-hero/index.js +3 -2
  115. package/dist/components/puck-block/hero-sections/multi-image-grid-hero/multi-image-grid-hero.js +2 -2
  116. package/dist/components/puck-block/hero-sections/overlapping-image-hero/index.d.ts +1 -1
  117. package/dist/components/puck-block/hero-sections/overlapping-image-hero/overlapping-image-hero.js +3 -3
  118. package/dist/components/puck-block/hero-sections/parallax-images-hero/component.js +18 -6
  119. package/dist/components/puck-block/hero-sections/parallax-images-hero/index.d.ts +1 -1
  120. package/dist/components/puck-block/hero-sections/scatter-parallax-hero/component.js +9 -7
  121. package/dist/components/puck-block/hero-sections/scatter-parallax-hero/index.d.ts +1 -1
  122. package/dist/components/puck-block/hero-sections/scroll-expand-video-hero/component.js +7 -5
  123. package/dist/components/puck-block/hero-sections/scroll-expand-video-hero/index.d.ts +1 -1
  124. package/dist/components/puck-block/hero-sections/scroll-zoom-hero/component.js +93 -44
  125. package/dist/components/puck-block/hero-sections/scroll-zoom-hero/index.d.ts +1 -1
  126. package/dist/components/puck-block/hero-sections/split-hero/index.d.ts +2 -2
  127. package/dist/components/puck-block/hero-sections/stacked-hero/index.d.ts +2 -2
  128. package/dist/components/puck-block/hero-sections/sticky-expand-hero/component.js +1 -1
  129. package/dist/components/puck-block/hero-sections/sticky-expand-hero/index.d.ts +14 -6
  130. package/dist/components/puck-block/hero-sections/sticky-expand-hero/index.js +2 -2
  131. package/dist/components/puck-block/hero-sections/sticky-video-hero/component.js +2 -2
  132. package/dist/components/puck-block/hero-sections/sticky-video-hero/index.d.ts +1 -1
  133. package/dist/components/puck-block/hero-sections/tab-hero/component.js +4 -4
  134. package/dist/components/puck-block/hero-sections/tab-hero/index.d.ts +28 -44
  135. package/dist/components/puck-block/hero-sections/tab-hero/index.js +7 -2
  136. package/dist/components/puck-block/hero-sections/three-image-parallax-hero/component.js +96 -46
  137. package/dist/components/puck-block/hero-sections/three-image-parallax-hero/index.d.ts +1 -1
  138. package/dist/components/puck-block/hero-sections/vertical-gallery-hero/component.js +33 -10
  139. package/dist/components/puck-block/hero-sections/vertical-gallery-hero/index.d.ts +1 -1
  140. package/dist/components/puck-block/hero-sections/zoom-grid-hero/component.js +14 -12
  141. package/dist/components/puck-block/hero-sections/zoom-grid-hero/index.d.ts +1 -1
  142. package/dist/components/puck-block/index.d.ts +2 -0
  143. package/dist/components/puck-block/location-sections/location-1/location.d.ts +1 -1
  144. package/dist/components/puck-block/location-sections/location-2/location.d.ts +1 -1
  145. package/dist/components/puck-block/location-sections/location-3/location.d.ts +2 -2
  146. package/dist/components/puck-block/location-sections/props.d.ts +1 -1
  147. package/dist/components/puck-block/metrics-sections/center-media-stats/center-media-stats.js +1 -1
  148. package/dist/components/puck-block/metrics-sections/header-stats-row/header-stats-row.js +1 -1
  149. package/dist/components/puck-block/metrics-sections/header-stats-row/index.d.ts +1 -1
  150. package/dist/components/puck-block/metrics-sections/mixed-grid-stats/index.d.ts +1 -1
  151. package/dist/components/puck-block/metrics-sections/mixed-grid-stats/mixed-grid-stats.js +2 -2
  152. package/dist/components/puck-block/metrics-sections/split-stats/index.d.ts +1 -1
  153. package/dist/components/puck-block/metrics-sections/split-stats/split-stats.js +1 -1
  154. package/dist/components/puck-block/metrics-sections/tab-stats/index.d.ts +0 -22
  155. package/dist/components/puck-block/metrics-sections/tab-stats/index.js +1 -1
  156. package/dist/components/puck-block/metrics-sections/tab-stats/tab-stats.js +39 -26
  157. package/dist/components/puck-block/pricing-sections/pricing-comparison-table/index.d.ts +47 -0
  158. package/dist/components/puck-block/pricing-sections/pricing-comparison-table/index.js +34 -0
  159. package/dist/components/puck-block/pricing-sections/single-pricing-card/index.d.ts +0 -22
  160. package/dist/components/puck-block/pricing-sections/single-pricing-card/index.js +1 -1
  161. package/dist/components/puck-block/pricing-sections/split-pricing/component.js +3 -3
  162. package/dist/components/puck-block/pricing-sections/split-pricing/index.d.ts +28 -22
  163. package/dist/components/puck-block/pricing-sections/split-pricing/index.js +8 -1
  164. package/dist/components/puck-block/registry.generated.d.ts +13408 -0
  165. package/dist/components/puck-block/registry.generated.js +558 -0
  166. package/dist/components/puck-block/showcase-sections/compact-timeline/index.d.ts +1 -1
  167. package/dist/components/puck-block/showcase-sections/horizontal-timeline/index.d.ts +1 -1
  168. package/dist/components/puck-block/showcase-sections/single-column-timeline/index.d.ts +2 -2
  169. package/dist/components/puck-block/showcase-sections/sticky-scroll-timeline/index.d.ts +2 -2
  170. package/dist/components/puck-block/showcase-sections/tab-timeline/component.js +1 -1
  171. package/dist/components/puck-block/showcase-sections/tab-timeline/index.d.ts +1 -23
  172. package/dist/components/puck-block/showcase-sections/tab-timeline/index.js +1 -1
  173. package/dist/components/puck-block/showcase-sections/zigzag-timeline/index.d.ts +2 -2
  174. package/dist/components/puck-block/team-sections/team-carousel/index.d.ts +1 -23
  175. package/dist/components/puck-block/team-sections/team-carousel/index.js +1 -2
  176. package/dist/components/puck-block/team-sections/team-grid/index.d.ts +1 -23
  177. package/dist/components/puck-block/team-sections/team-grid/index.js +1 -2
  178. package/dist/components/puck-block/team-sections/team-inline-card/index.d.ts +1 -23
  179. package/dist/components/puck-block/team-sections/team-inline-card/index.js +1 -2
  180. package/dist/components/puck-block/team-sections/team-two-column/index.d.ts +1 -1
  181. package/dist/components/puck-block/testimonial-sections/bento-testimonial/component.js +2 -2
  182. package/dist/components/puck-block/testimonial-sections/sticky-testimonial/index.d.ts +1 -1
  183. package/dist/components/puck-block/testimonial-sections/tab-testimonial/component.js +2 -2
  184. package/dist/components/puck-block/text-sections/aside-nav-content/index.d.ts +0 -22
  185. package/dist/components/puck-block/text-sections/aside-nav-content/index.js +1 -1
  186. package/dist/components/puck-block/text-sections/blog-article/index.d.ts +0 -22
  187. package/dist/components/puck-block/text-sections/blog-article/index.js +1 -1
  188. package/dist/components/puck-block/text-sections/prose-content/component.js +1 -1
  189. package/dist/components/puck-block/text-sections/prose-sidebar/index.d.ts +1 -23
  190. package/dist/components/puck-block/text-sections/side-media-content/component.js +1 -1
  191. package/dist/components/puck-block/text-sections/sticky-text-multi-image/component.js +3 -3
  192. package/dist/components/puck-block/text-sections/text-header/index.d.ts +2 -2
  193. package/dist/components/puck-core/core/props/content.js +41 -1
  194. package/dist/components/puck-core/core/props/form.js +76 -0
  195. package/dist/components/puck-core/core/props/index.js +34 -0
  196. package/dist/components/puck-core/core/props/interactive.js +17 -0
  197. package/dist/components/puck-core/core/props/media.js +14 -5
  198. package/dist/components/puck-core/core/styles.d.ts +1 -1
  199. package/dist/components/{puck-base → puck-core}/core/styles.js +3 -1
  200. package/dist/components/{puck-base → puck-core}/core/with-editable.js +1 -1
  201. package/dist/components/puck-core/fields/action-field.js +1 -1
  202. package/dist/components/puck-core/fields/array-field.d.ts +7 -0
  203. package/dist/components/puck-core/fields/array-field.js +229 -0
  204. package/dist/components/{puck-base → puck-core}/fields/auto-field.js +11 -0
  205. package/dist/components/{puck-base → puck-core/fields}/image-upload-field.js +5 -5
  206. package/dist/components/puck-core/fields/index.d.ts +1 -0
  207. package/dist/components/{puck-base → puck-core}/fields/location-field.js +1 -1
  208. package/dist/components/{puck-base → puck-core}/fields/object-field.js +1 -1
  209. package/dist/components/puck-core/index.d.ts +1 -0
  210. package/dist/components/{puck-base → puck-core}/inline-editable.js +1 -1
  211. package/dist/index.js +121 -104
  212. package/dist/node_modules/.pnpm/@dnd-kit_accessibility@3.1.1_react@19.2.4/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +59 -0
  213. package/dist/node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@dnd-kit/core/dist/core.esm.js +3093 -0
  214. package/dist/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.2.4_react@19.2.4__react@19.2.4__react@19.2.4/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +592 -0
  215. package/dist/node_modules/.pnpm/@dnd-kit_utilities@3.2.2_react@19.2.4/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +301 -0
  216. package/package.json +4 -1
  217. package/dist/components/puck-base/core/fields.d.ts +0 -827
  218. package/dist/components/puck-base/core/fields.js +0 -267
  219. package/dist/components/puck-base/core/hooks.d.ts +0 -19
  220. package/dist/components/puck-base/core/icon-catalog.d.ts +0 -14
  221. package/dist/components/puck-base/core/icon-catalog.js +0 -193
  222. package/dist/components/puck-base/core/styles.d.ts +0 -1942
  223. package/dist/components/puck-base/core/types.d.ts +0 -20
  224. package/dist/components/puck-base/core/types.js +0 -26
  225. package/dist/components/puck-base/core/utils.d.ts +0 -5
  226. package/dist/components/puck-base/core/with-editable.d.ts +0 -16
  227. package/dist/components/puck-base/error-boundary.d.ts +0 -4
  228. package/dist/components/puck-base/fields/action-field.d.ts +0 -30
  229. package/dist/components/puck-base/fields/action-field.js +0 -265
  230. package/dist/components/puck-base/fields/auto-field.d.ts +0 -2
  231. package/dist/components/puck-base/fields/color-field.d.ts +0 -6
  232. package/dist/components/puck-base/fields/index.d.ts +0 -8
  233. package/dist/components/puck-base/fields/location-field.d.ts +0 -44
  234. package/dist/components/puck-base/fields/object-field.d.ts +0 -8
  235. package/dist/components/puck-base/fields/radio-toggle-field.d.ts +0 -10
  236. package/dist/components/puck-base/fields/types.d.ts +0 -29
  237. package/dist/components/puck-base/fields/virtualized-select-field.d.ts +0 -13
  238. package/dist/components/puck-base/icon-picker-field.d.ts +0 -8
  239. package/dist/components/puck-base/icon-picker-field.js +0 -153
  240. package/dist/components/puck-base/image-upload-field.d.ts +0 -7
  241. package/dist/components/puck-base/inline-editable.d.ts +0 -14
  242. package/dist/components/puck-base/use-upload.d.ts +0 -42
  243. /package/dist/components/{puck-base → puck-core}/core/hooks.js +0 -0
  244. /package/dist/components/{puck-base → puck-core}/core/utils.js +0 -0
  245. /package/dist/components/{puck-base → puck-core}/error-boundary.js +0 -0
  246. /package/dist/components/{puck-base → puck-core}/fields/color-field.js +0 -0
  247. /package/dist/components/{puck-base → puck-core}/fields/radio-toggle-field.js +0 -0
  248. /package/dist/components/{puck-base → puck-core}/fields/virtualized-select-field.js +0 -0
  249. /package/dist/components/{puck-base → puck-core}/use-upload.js +0 -0
@@ -0,0 +1,592 @@
1
+ import React__default, { useMemo, useRef, useEffect, useContext, useState } from "react";
2
+ import { useDndContext, KeyboardCode, closestCorners, getFirstCollision, getScrollableAncestors, useDroppable, useDraggable, getClientRect } from "../../../../../@dnd-kit_core@6.3.1_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@dnd-kit/core/dist/core.esm.js";
3
+ import { useUniqueId, useIsomorphicLayoutEffect, subtract, useCombinedRefs, isKeyboardEvent, CSS } from "../../../../../@dnd-kit_utilities@3.2.2_react@19.2.4/node_modules/@dnd-kit/utilities/dist/utilities.esm.js";
4
+ function arrayMove(array, from, to) {
5
+ const newArray = array.slice();
6
+ newArray.splice(to < 0 ? newArray.length + to : to, 0, newArray.splice(from, 1)[0]);
7
+ return newArray;
8
+ }
9
+ function getSortedRects(items, rects) {
10
+ return items.reduce((accumulator, id, index) => {
11
+ const rect = rects.get(id);
12
+ if (rect) {
13
+ accumulator[index] = rect;
14
+ }
15
+ return accumulator;
16
+ }, Array(items.length));
17
+ }
18
+ function isValidIndex(index) {
19
+ return index !== null && index >= 0;
20
+ }
21
+ function itemsEqual(a, b) {
22
+ if (a === b) {
23
+ return true;
24
+ }
25
+ if (a.length !== b.length) {
26
+ return false;
27
+ }
28
+ for (let i = 0; i < a.length; i++) {
29
+ if (a[i] !== b[i]) {
30
+ return false;
31
+ }
32
+ }
33
+ return true;
34
+ }
35
+ function normalizeDisabled(disabled) {
36
+ if (typeof disabled === "boolean") {
37
+ return {
38
+ draggable: disabled,
39
+ droppable: disabled
40
+ };
41
+ }
42
+ return disabled;
43
+ }
44
+ const rectSortingStrategy = (_ref) => {
45
+ let {
46
+ rects,
47
+ activeIndex,
48
+ overIndex,
49
+ index
50
+ } = _ref;
51
+ const newRects = arrayMove(rects, overIndex, activeIndex);
52
+ const oldRect = rects[index];
53
+ const newRect = newRects[index];
54
+ if (!newRect || !oldRect) {
55
+ return null;
56
+ }
57
+ return {
58
+ x: newRect.left - oldRect.left,
59
+ y: newRect.top - oldRect.top,
60
+ scaleX: newRect.width / oldRect.width,
61
+ scaleY: newRect.height / oldRect.height
62
+ };
63
+ };
64
+ const defaultScale$1 = {
65
+ scaleX: 1,
66
+ scaleY: 1
67
+ };
68
+ const verticalListSortingStrategy = (_ref) => {
69
+ var _rects$activeIndex;
70
+ let {
71
+ activeIndex,
72
+ activeNodeRect: fallbackActiveRect,
73
+ index,
74
+ rects,
75
+ overIndex
76
+ } = _ref;
77
+ const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;
78
+ if (!activeNodeRect) {
79
+ return null;
80
+ }
81
+ if (index === activeIndex) {
82
+ const overIndexRect = rects[overIndex];
83
+ if (!overIndexRect) {
84
+ return null;
85
+ }
86
+ return {
87
+ x: 0,
88
+ y: activeIndex < overIndex ? overIndexRect.top + overIndexRect.height - (activeNodeRect.top + activeNodeRect.height) : overIndexRect.top - activeNodeRect.top,
89
+ ...defaultScale$1
90
+ };
91
+ }
92
+ const itemGap = getItemGap$1(rects, index, activeIndex);
93
+ if (index > activeIndex && index <= overIndex) {
94
+ return {
95
+ x: 0,
96
+ y: -activeNodeRect.height - itemGap,
97
+ ...defaultScale$1
98
+ };
99
+ }
100
+ if (index < activeIndex && index >= overIndex) {
101
+ return {
102
+ x: 0,
103
+ y: activeNodeRect.height + itemGap,
104
+ ...defaultScale$1
105
+ };
106
+ }
107
+ return {
108
+ x: 0,
109
+ y: 0,
110
+ ...defaultScale$1
111
+ };
112
+ };
113
+ function getItemGap$1(clientRects, index, activeIndex) {
114
+ const currentRect = clientRects[index];
115
+ const previousRect = clientRects[index - 1];
116
+ const nextRect = clientRects[index + 1];
117
+ if (!currentRect) {
118
+ return 0;
119
+ }
120
+ if (activeIndex < index) {
121
+ return previousRect ? currentRect.top - (previousRect.top + previousRect.height) : nextRect ? nextRect.top - (currentRect.top + currentRect.height) : 0;
122
+ }
123
+ return nextRect ? nextRect.top - (currentRect.top + currentRect.height) : previousRect ? currentRect.top - (previousRect.top + previousRect.height) : 0;
124
+ }
125
+ const ID_PREFIX = "Sortable";
126
+ const Context = /* @__PURE__ */ React__default.createContext({
127
+ activeIndex: -1,
128
+ containerId: ID_PREFIX,
129
+ disableTransforms: false,
130
+ items: [],
131
+ overIndex: -1,
132
+ useDragOverlay: false,
133
+ sortedRects: [],
134
+ strategy: rectSortingStrategy,
135
+ disabled: {
136
+ draggable: false,
137
+ droppable: false
138
+ }
139
+ });
140
+ function SortableContext(_ref) {
141
+ let {
142
+ children,
143
+ id,
144
+ items: userDefinedItems,
145
+ strategy = rectSortingStrategy,
146
+ disabled: disabledProp = false
147
+ } = _ref;
148
+ const {
149
+ active,
150
+ dragOverlay,
151
+ droppableRects,
152
+ over,
153
+ measureDroppableContainers
154
+ } = useDndContext();
155
+ const containerId = useUniqueId(ID_PREFIX, id);
156
+ const useDragOverlay = Boolean(dragOverlay.rect !== null);
157
+ const items = useMemo(() => userDefinedItems.map((item) => typeof item === "object" && "id" in item ? item.id : item), [userDefinedItems]);
158
+ const isDragging = active != null;
159
+ const activeIndex = active ? items.indexOf(active.id) : -1;
160
+ const overIndex = over ? items.indexOf(over.id) : -1;
161
+ const previousItemsRef = useRef(items);
162
+ const itemsHaveChanged = !itemsEqual(items, previousItemsRef.current);
163
+ const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged;
164
+ const disabled = normalizeDisabled(disabledProp);
165
+ useIsomorphicLayoutEffect(() => {
166
+ if (itemsHaveChanged && isDragging) {
167
+ measureDroppableContainers(items);
168
+ }
169
+ }, [itemsHaveChanged, items, isDragging, measureDroppableContainers]);
170
+ useEffect(() => {
171
+ previousItemsRef.current = items;
172
+ }, [items]);
173
+ const contextValue = useMemo(
174
+ () => ({
175
+ activeIndex,
176
+ containerId,
177
+ disabled,
178
+ disableTransforms,
179
+ items,
180
+ overIndex,
181
+ useDragOverlay,
182
+ sortedRects: getSortedRects(items, droppableRects),
183
+ strategy
184
+ }),
185
+ // eslint-disable-next-line react-hooks/exhaustive-deps
186
+ [activeIndex, containerId, disabled.draggable, disabled.droppable, disableTransforms, items, overIndex, droppableRects, useDragOverlay, strategy]
187
+ );
188
+ return React__default.createElement(Context.Provider, {
189
+ value: contextValue
190
+ }, children);
191
+ }
192
+ const defaultNewIndexGetter = (_ref) => {
193
+ let {
194
+ id,
195
+ items,
196
+ activeIndex,
197
+ overIndex
198
+ } = _ref;
199
+ return arrayMove(items, activeIndex, overIndex).indexOf(id);
200
+ };
201
+ const defaultAnimateLayoutChanges = (_ref2) => {
202
+ let {
203
+ containerId,
204
+ isSorting,
205
+ wasDragging,
206
+ index,
207
+ items,
208
+ newIndex,
209
+ previousItems,
210
+ previousContainerId,
211
+ transition
212
+ } = _ref2;
213
+ if (!transition || !wasDragging) {
214
+ return false;
215
+ }
216
+ if (previousItems !== items && index === newIndex) {
217
+ return false;
218
+ }
219
+ if (isSorting) {
220
+ return true;
221
+ }
222
+ return newIndex !== index && containerId === previousContainerId;
223
+ };
224
+ const defaultTransition = {
225
+ duration: 200,
226
+ easing: "ease"
227
+ };
228
+ const transitionProperty = "transform";
229
+ const disabledTransition = /* @__PURE__ */ CSS.Transition.toString({
230
+ property: transitionProperty,
231
+ duration: 0,
232
+ easing: "linear"
233
+ });
234
+ const defaultAttributes = {
235
+ roleDescription: "sortable"
236
+ };
237
+ function useDerivedTransform(_ref) {
238
+ let {
239
+ disabled,
240
+ index,
241
+ node,
242
+ rect
243
+ } = _ref;
244
+ const [derivedTransform, setDerivedtransform] = useState(null);
245
+ const previousIndex = useRef(index);
246
+ useIsomorphicLayoutEffect(() => {
247
+ if (!disabled && index !== previousIndex.current && node.current) {
248
+ const initial = rect.current;
249
+ if (initial) {
250
+ const current = getClientRect(node.current, {
251
+ ignoreTransform: true
252
+ });
253
+ const delta = {
254
+ x: initial.left - current.left,
255
+ y: initial.top - current.top,
256
+ scaleX: initial.width / current.width,
257
+ scaleY: initial.height / current.height
258
+ };
259
+ if (delta.x || delta.y) {
260
+ setDerivedtransform(delta);
261
+ }
262
+ }
263
+ }
264
+ if (index !== previousIndex.current) {
265
+ previousIndex.current = index;
266
+ }
267
+ }, [disabled, index, node, rect]);
268
+ useEffect(() => {
269
+ if (derivedTransform) {
270
+ setDerivedtransform(null);
271
+ }
272
+ }, [derivedTransform]);
273
+ return derivedTransform;
274
+ }
275
+ function useSortable(_ref) {
276
+ let {
277
+ animateLayoutChanges = defaultAnimateLayoutChanges,
278
+ attributes: userDefinedAttributes,
279
+ disabled: localDisabled,
280
+ data: customData,
281
+ getNewIndex = defaultNewIndexGetter,
282
+ id,
283
+ strategy: localStrategy,
284
+ resizeObserverConfig,
285
+ transition = defaultTransition
286
+ } = _ref;
287
+ const {
288
+ items,
289
+ containerId,
290
+ activeIndex,
291
+ disabled: globalDisabled,
292
+ disableTransforms,
293
+ sortedRects,
294
+ overIndex,
295
+ useDragOverlay,
296
+ strategy: globalStrategy
297
+ } = useContext(Context);
298
+ const disabled = normalizeLocalDisabled(localDisabled, globalDisabled);
299
+ const index = items.indexOf(id);
300
+ const data = useMemo(() => ({
301
+ sortable: {
302
+ containerId,
303
+ index,
304
+ items
305
+ },
306
+ ...customData
307
+ }), [containerId, customData, index, items]);
308
+ const itemsAfterCurrentSortable = useMemo(() => items.slice(items.indexOf(id)), [items, id]);
309
+ const {
310
+ rect,
311
+ node,
312
+ isOver,
313
+ setNodeRef: setDroppableNodeRef
314
+ } = useDroppable({
315
+ id,
316
+ data,
317
+ disabled: disabled.droppable,
318
+ resizeObserverConfig: {
319
+ updateMeasurementsFor: itemsAfterCurrentSortable,
320
+ ...resizeObserverConfig
321
+ }
322
+ });
323
+ const {
324
+ active,
325
+ activatorEvent,
326
+ activeNodeRect,
327
+ attributes,
328
+ setNodeRef: setDraggableNodeRef,
329
+ listeners,
330
+ isDragging,
331
+ over,
332
+ setActivatorNodeRef,
333
+ transform
334
+ } = useDraggable({
335
+ id,
336
+ data,
337
+ attributes: {
338
+ ...defaultAttributes,
339
+ ...userDefinedAttributes
340
+ },
341
+ disabled: disabled.draggable
342
+ });
343
+ const setNodeRef = useCombinedRefs(setDroppableNodeRef, setDraggableNodeRef);
344
+ const isSorting = Boolean(active);
345
+ const displaceItem = isSorting && !disableTransforms && isValidIndex(activeIndex) && isValidIndex(overIndex);
346
+ const shouldDisplaceDragSource = !useDragOverlay && isDragging;
347
+ const dragSourceDisplacement = shouldDisplaceDragSource && displaceItem ? transform : null;
348
+ const strategy = localStrategy != null ? localStrategy : globalStrategy;
349
+ const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : strategy({
350
+ rects: sortedRects,
351
+ activeNodeRect,
352
+ activeIndex,
353
+ overIndex,
354
+ index
355
+ }) : null;
356
+ const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({
357
+ id,
358
+ items,
359
+ activeIndex,
360
+ overIndex
361
+ }) : index;
362
+ const activeId = active == null ? void 0 : active.id;
363
+ const previous = useRef({
364
+ activeId,
365
+ items,
366
+ newIndex,
367
+ containerId
368
+ });
369
+ const itemsHaveChanged = items !== previous.current.items;
370
+ const shouldAnimateLayoutChanges = animateLayoutChanges({
371
+ active,
372
+ containerId,
373
+ isDragging,
374
+ isSorting,
375
+ id,
376
+ index,
377
+ items,
378
+ newIndex: previous.current.newIndex,
379
+ previousItems: previous.current.items,
380
+ previousContainerId: previous.current.containerId,
381
+ transition,
382
+ wasDragging: previous.current.activeId != null
383
+ });
384
+ const derivedTransform = useDerivedTransform({
385
+ disabled: !shouldAnimateLayoutChanges,
386
+ index,
387
+ node,
388
+ rect
389
+ });
390
+ useEffect(() => {
391
+ if (isSorting && previous.current.newIndex !== newIndex) {
392
+ previous.current.newIndex = newIndex;
393
+ }
394
+ if (containerId !== previous.current.containerId) {
395
+ previous.current.containerId = containerId;
396
+ }
397
+ if (items !== previous.current.items) {
398
+ previous.current.items = items;
399
+ }
400
+ }, [isSorting, newIndex, containerId, items]);
401
+ useEffect(() => {
402
+ if (activeId === previous.current.activeId) {
403
+ return;
404
+ }
405
+ if (activeId != null && previous.current.activeId == null) {
406
+ previous.current.activeId = activeId;
407
+ return;
408
+ }
409
+ const timeoutId = setTimeout(() => {
410
+ previous.current.activeId = activeId;
411
+ }, 50);
412
+ return () => clearTimeout(timeoutId);
413
+ }, [activeId]);
414
+ return {
415
+ active,
416
+ activeIndex,
417
+ attributes,
418
+ data,
419
+ rect,
420
+ index,
421
+ newIndex,
422
+ items,
423
+ isOver,
424
+ isSorting,
425
+ isDragging,
426
+ listeners,
427
+ node,
428
+ overIndex,
429
+ over,
430
+ setNodeRef,
431
+ setActivatorNodeRef,
432
+ setDroppableNodeRef,
433
+ setDraggableNodeRef,
434
+ transform: derivedTransform != null ? derivedTransform : finalTransform,
435
+ transition: getTransition()
436
+ };
437
+ function getTransition() {
438
+ if (
439
+ // Temporarily disable transitions for a single frame to set up derived transforms
440
+ derivedTransform || // Or to prevent items jumping to back to their "new" position when items change
441
+ itemsHaveChanged && previous.current.newIndex === index
442
+ ) {
443
+ return disabledTransition;
444
+ }
445
+ if (shouldDisplaceDragSource && !isKeyboardEvent(activatorEvent) || !transition) {
446
+ return void 0;
447
+ }
448
+ if (isSorting || shouldAnimateLayoutChanges) {
449
+ return CSS.Transition.toString({
450
+ ...transition,
451
+ property: transitionProperty
452
+ });
453
+ }
454
+ return void 0;
455
+ }
456
+ }
457
+ function normalizeLocalDisabled(localDisabled, globalDisabled) {
458
+ var _localDisabled$dragga, _localDisabled$droppa;
459
+ if (typeof localDisabled === "boolean") {
460
+ return {
461
+ draggable: localDisabled,
462
+ // Backwards compatibility
463
+ droppable: false
464
+ };
465
+ }
466
+ return {
467
+ draggable: (_localDisabled$dragga = localDisabled == null ? void 0 : localDisabled.draggable) != null ? _localDisabled$dragga : globalDisabled.draggable,
468
+ droppable: (_localDisabled$droppa = localDisabled == null ? void 0 : localDisabled.droppable) != null ? _localDisabled$droppa : globalDisabled.droppable
469
+ };
470
+ }
471
+ function hasSortableData(entry) {
472
+ if (!entry) {
473
+ return false;
474
+ }
475
+ const data = entry.data.current;
476
+ if (data && "sortable" in data && typeof data.sortable === "object" && "containerId" in data.sortable && "items" in data.sortable && "index" in data.sortable) {
477
+ return true;
478
+ }
479
+ return false;
480
+ }
481
+ const directions = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left];
482
+ const sortableKeyboardCoordinates = (event, _ref) => {
483
+ let {
484
+ context: {
485
+ active,
486
+ collisionRect,
487
+ droppableRects,
488
+ droppableContainers,
489
+ over,
490
+ scrollableAncestors
491
+ }
492
+ } = _ref;
493
+ if (directions.includes(event.code)) {
494
+ event.preventDefault();
495
+ if (!active || !collisionRect) {
496
+ return;
497
+ }
498
+ const filteredContainers = [];
499
+ droppableContainers.getEnabled().forEach((entry) => {
500
+ if (!entry || entry != null && entry.disabled) {
501
+ return;
502
+ }
503
+ const rect = droppableRects.get(entry.id);
504
+ if (!rect) {
505
+ return;
506
+ }
507
+ switch (event.code) {
508
+ case KeyboardCode.Down:
509
+ if (collisionRect.top < rect.top) {
510
+ filteredContainers.push(entry);
511
+ }
512
+ break;
513
+ case KeyboardCode.Up:
514
+ if (collisionRect.top > rect.top) {
515
+ filteredContainers.push(entry);
516
+ }
517
+ break;
518
+ case KeyboardCode.Left:
519
+ if (collisionRect.left > rect.left) {
520
+ filteredContainers.push(entry);
521
+ }
522
+ break;
523
+ case KeyboardCode.Right:
524
+ if (collisionRect.left < rect.left) {
525
+ filteredContainers.push(entry);
526
+ }
527
+ break;
528
+ }
529
+ });
530
+ const collisions = closestCorners({
531
+ collisionRect,
532
+ droppableRects,
533
+ droppableContainers: filteredContainers
534
+ });
535
+ let closestId = getFirstCollision(collisions, "id");
536
+ if (closestId === (over == null ? void 0 : over.id) && collisions.length > 1) {
537
+ closestId = collisions[1].id;
538
+ }
539
+ if (closestId != null) {
540
+ const activeDroppable = droppableContainers.get(active.id);
541
+ const newDroppable = droppableContainers.get(closestId);
542
+ const newRect = newDroppable ? droppableRects.get(newDroppable.id) : null;
543
+ const newNode = newDroppable == null ? void 0 : newDroppable.node.current;
544
+ if (newNode && newRect && activeDroppable && newDroppable) {
545
+ const newScrollAncestors = getScrollableAncestors(newNode);
546
+ const hasDifferentScrollAncestors = newScrollAncestors.some((element, index) => scrollableAncestors[index] !== element);
547
+ const hasSameContainer = isSameContainer(activeDroppable, newDroppable);
548
+ const isAfterActive = isAfter(activeDroppable, newDroppable);
549
+ const offset = hasDifferentScrollAncestors || !hasSameContainer ? {
550
+ x: 0,
551
+ y: 0
552
+ } : {
553
+ x: isAfterActive ? collisionRect.width - newRect.width : 0,
554
+ y: isAfterActive ? collisionRect.height - newRect.height : 0
555
+ };
556
+ const rectCoordinates = {
557
+ x: newRect.left,
558
+ y: newRect.top
559
+ };
560
+ const newCoordinates = offset.x && offset.y ? rectCoordinates : subtract(rectCoordinates, offset);
561
+ return newCoordinates;
562
+ }
563
+ }
564
+ }
565
+ return void 0;
566
+ };
567
+ function isSameContainer(a, b) {
568
+ if (!hasSortableData(a) || !hasSortableData(b)) {
569
+ return false;
570
+ }
571
+ return a.data.current.sortable.containerId === b.data.current.sortable.containerId;
572
+ }
573
+ function isAfter(a, b) {
574
+ if (!hasSortableData(a) || !hasSortableData(b)) {
575
+ return false;
576
+ }
577
+ if (!isSameContainer(a, b)) {
578
+ return false;
579
+ }
580
+ return a.data.current.sortable.index < b.data.current.sortable.index;
581
+ }
582
+ export {
583
+ SortableContext,
584
+ arrayMove,
585
+ defaultAnimateLayoutChanges,
586
+ defaultNewIndexGetter,
587
+ hasSortableData,
588
+ rectSortingStrategy,
589
+ sortableKeyboardCoordinates,
590
+ useSortable,
591
+ verticalListSortingStrategy
592
+ };