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
@@ -4,7 +4,7 @@ import { useRef, useEffect, useCallback } from "react";
4
4
  import { registerOverlayPortal } from "@puckeditor/core";
5
5
  import { usePuckDispatch, usePuckAppState } from "./hooks.js";
6
6
  import { Pencil } from "lucide-react";
7
- import { useEditorContext } from "../../puck-core/core/context/editor-context.js";
7
+ import { useEditorContext } from "./context/editor-context.js";
8
8
  import set from "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/set.js";
9
9
  const BLOCK_LEVEL_TYPES = /* @__PURE__ */ new Set(["image"]);
10
10
  function getComponentIdFromDOM(el) {
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
3
- import { useCallback, memo } from "react";
3
+ import { memo, useCallback } from "react";
4
4
  import { Input } from "../../shadcn/input.js";
5
5
  import { Label } from "../../shadcn/label.js";
6
6
  import { Tabs, TabsList, TabsTrigger } from "../../shadcn/tabs.js";
@@ -0,0 +1,7 @@
1
+ import type { FieldDef } from "./types";
2
+ export declare const ArrayField: import("react").NamedExoticComponent<{
3
+ field: FieldDef;
4
+ name: string;
5
+ value: any;
6
+ onChange: (value: any) => void;
7
+ }>;
@@ -0,0 +1,229 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { memo, useState, useRef, useMemo, useCallback } from "react";
3
+ import { ChevronLeft, Plus, GripVertical, Pencil, Trash2 } from "lucide-react";
4
+ import { useSensors, useSensor, DndContext, closestCenter, KeyboardSensor, PointerSensor } from "../../../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";
5
+ import { arrayMove, SortableContext, verticalListSortingStrategy, sortableKeyboardCoordinates, useSortable } from "../../../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";
6
+ import { CSS } from "../../../node_modules/.pnpm/@dnd-kit_utilities@3.2.2_react@19.2.4/node_modules/@dnd-kit/utilities/dist/utilities.esm.js";
7
+ import { Label } from "../../shadcn/label.js";
8
+ import { Button } from "../../shadcn/button.js";
9
+ import { AutoField } from "./auto-field.js";
10
+ const POINTER_SENSOR_OPTIONS = { activationConstraint: { distance: 5 } };
11
+ const KEYBOARD_SENSOR_OPTIONS = {
12
+ coordinateGetter: sortableKeyboardCoordinates
13
+ };
14
+ const SortableItem = memo(function SortableItem2({
15
+ id,
16
+ summary,
17
+ canDelete,
18
+ onEdit,
19
+ onDelete
20
+ }) {
21
+ const {
22
+ attributes,
23
+ listeners,
24
+ setNodeRef,
25
+ transform,
26
+ transition,
27
+ isDragging
28
+ } = useSortable({ id });
29
+ const style = {
30
+ transform: CSS.Transform.toString(transform),
31
+ transition,
32
+ opacity: isDragging ? 0.5 : 1
33
+ };
34
+ return /* @__PURE__ */ jsxs(
35
+ "div",
36
+ {
37
+ ref: setNodeRef,
38
+ style,
39
+ className: "bg-muted/50 group flex items-center gap-2 rounded-xl p-3",
40
+ children: [
41
+ /* @__PURE__ */ jsx(
42
+ "div",
43
+ {
44
+ className: "text-muted-foreground/40 hover:text-muted-foreground cursor-grab active:cursor-grabbing",
45
+ ...attributes,
46
+ ...listeners,
47
+ children: /* @__PURE__ */ jsx(GripVertical, { className: "h-4 w-4" })
48
+ }
49
+ ),
50
+ /* @__PURE__ */ jsx("span", { className: "text-foreground flex-1 truncate text-sm", children: summary }),
51
+ /* @__PURE__ */ jsxs(
52
+ Button,
53
+ {
54
+ type: "button",
55
+ variant: "ghost",
56
+ size: "sm",
57
+ className: "h-7 gap-1 px-2",
58
+ onClick: onEdit,
59
+ children: [
60
+ /* @__PURE__ */ jsx(Pencil, { className: "h-3.5 w-3.5" }),
61
+ "Edit"
62
+ ]
63
+ }
64
+ ),
65
+ canDelete && /* @__PURE__ */ jsx(
66
+ Button,
67
+ {
68
+ type: "button",
69
+ variant: "ghost",
70
+ size: "icon",
71
+ className: "text-muted-foreground hover:text-destructive h-7 w-7",
72
+ onClick: onDelete,
73
+ children: /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4" })
74
+ }
75
+ )
76
+ ]
77
+ }
78
+ );
79
+ });
80
+ const ArrayField = memo(function ArrayField2({
81
+ field,
82
+ name,
83
+ value,
84
+ onChange
85
+ }) {
86
+ const arrayFields = field.arrayFields || {};
87
+ const label = field.label || name;
88
+ const items = Array.isArray(value) ? value : [];
89
+ const [editingIndex, setEditingIndex] = useState(null);
90
+ const idCounterRef = useRef(0);
91
+ const itemIdMapRef = useRef(/* @__PURE__ */ new WeakMap());
92
+ const itemIds = useMemo(() => {
93
+ return items.map((item) => {
94
+ if (item && typeof item === "object") {
95
+ let id = itemIdMapRef.current.get(item);
96
+ if (!id) {
97
+ id = `${name}-${idCounterRef.current++}`;
98
+ itemIdMapRef.current.set(item, id);
99
+ }
100
+ return id;
101
+ }
102
+ return `${name}-${idCounterRef.current++}`;
103
+ });
104
+ }, [items, name]);
105
+ const sensors = useSensors(
106
+ useSensor(PointerSensor, POINTER_SENSOR_OPTIONS),
107
+ useSensor(KeyboardSensor, KEYBOARD_SENSOR_OPTIONS)
108
+ );
109
+ const handleDragEnd = useCallback(
110
+ (event) => {
111
+ const { active, over } = event;
112
+ if (!over || active.id === over.id) return;
113
+ const oldIndex = itemIds.indexOf(String(active.id));
114
+ const newIndex = itemIds.indexOf(String(over.id));
115
+ if (oldIndex !== -1 && newIndex !== -1) {
116
+ onChange(arrayMove(items, oldIndex, newIndex));
117
+ }
118
+ },
119
+ [itemIds, items, onChange]
120
+ );
121
+ const handleAdd = useCallback(() => {
122
+ if (field.defaultItemProps) {
123
+ onChange([...items, { ...field.defaultItemProps }]);
124
+ return;
125
+ }
126
+ const newItem = {};
127
+ for (const key of Object.keys(arrayFields)) {
128
+ newItem[key] = "";
129
+ }
130
+ onChange([...items, newItem]);
131
+ }, [items, onChange, field.defaultItemProps, arrayFields]);
132
+ const handleDelete = useCallback(
133
+ (index) => {
134
+ onChange(items.filter((_, i) => i !== index));
135
+ if (editingIndex === index) setEditingIndex(null);
136
+ },
137
+ [items, onChange, editingIndex]
138
+ );
139
+ const handleItemFieldChange = useCallback(
140
+ (index, key, val) => {
141
+ const newItems = items.map(
142
+ (item, i) => i === index ? { ...item, [key]: val } : item
143
+ );
144
+ onChange(newItems);
145
+ },
146
+ [items, onChange]
147
+ );
148
+ const canAdd = field.max == null || items.length < field.max;
149
+ const canDelete = field.min == null || items.length > field.min;
150
+ const getSummary = useCallback(
151
+ (item, index) => {
152
+ if (field.getItemSummary) return field.getItemSummary(item, index);
153
+ return item.label || item.heading || item.name || item.title || `Item ${index + 1}`;
154
+ },
155
+ [field]
156
+ );
157
+ if (editingIndex !== null && items[editingIndex]) {
158
+ const item = items[editingIndex];
159
+ return /* @__PURE__ */ jsxs("div", { className: "mb-4 space-y-1.5", children: [
160
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
161
+ /* @__PURE__ */ jsx(
162
+ Button,
163
+ {
164
+ type: "button",
165
+ variant: "ghost",
166
+ size: "icon-sm",
167
+ onClick: () => setEditingIndex(null),
168
+ children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" })
169
+ }
170
+ ),
171
+ /* @__PURE__ */ jsxs(Label, { children: [
172
+ label,
173
+ " / ",
174
+ getSummary(item, editingIndex)
175
+ ] })
176
+ ] }),
177
+ /* @__PURE__ */ jsx("div", { className: "rounded-lg bg-muted/30 p-3", children: Object.entries(arrayFields).map(([key, subField]) => /* @__PURE__ */ jsx(
178
+ AutoField,
179
+ {
180
+ field: subField,
181
+ name: key,
182
+ value: item[key],
183
+ onChange: (val) => handleItemFieldChange(editingIndex, key, val)
184
+ },
185
+ key
186
+ )) })
187
+ ] });
188
+ }
189
+ return /* @__PURE__ */ jsxs("div", { className: "mb-4 space-y-1.5", children: [
190
+ /* @__PURE__ */ jsx(Label, { children: label }),
191
+ /* @__PURE__ */ jsx(
192
+ DndContext,
193
+ {
194
+ sensors,
195
+ collisionDetection: closestCenter,
196
+ onDragEnd: handleDragEnd,
197
+ children: /* @__PURE__ */ jsx(SortableContext, { items: itemIds, strategy: verticalListSortingStrategy, children: /* @__PURE__ */ jsx("div", { className: "space-y-2", children: items.map((item, i) => /* @__PURE__ */ jsx(
198
+ SortableItem,
199
+ {
200
+ id: itemIds[i],
201
+ summary: getSummary(item, i),
202
+ canDelete,
203
+ onEdit: () => setEditingIndex(i),
204
+ onDelete: () => handleDelete(i)
205
+ },
206
+ itemIds[i]
207
+ )) }) })
208
+ }
209
+ ),
210
+ canAdd && /* @__PURE__ */ jsxs(
211
+ Button,
212
+ {
213
+ type: "button",
214
+ variant: "ghost",
215
+ size: "sm",
216
+ className: "mt-2 gap-1.5 text-primary",
217
+ onClick: handleAdd,
218
+ children: [
219
+ /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" }),
220
+ "Add ",
221
+ label.replace(/s$/, "").toLowerCase()
222
+ ]
223
+ }
224
+ )
225
+ ] });
226
+ });
227
+ export {
228
+ ArrayField
229
+ };
@@ -7,6 +7,7 @@ import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from ".
7
7
  import { ColorField } from "./color-field.js";
8
8
  import { RadioToggleField } from "./radio-toggle-field.js";
9
9
  import { ObjectField } from "./object-field.js";
10
+ import { ArrayField } from "./array-field.js";
10
11
  import { LARGE_SELECT_THRESHOLD, VirtualizedSelectField } from "./virtualized-select-field.js";
11
12
  const KEY_FIELD_MAP = {
12
13
  color: ColorField,
@@ -119,6 +120,16 @@ const AutoField = memo(function AutoField2({
119
120
  onChange
120
121
  }
121
122
  );
123
+ case "array":
124
+ return /* @__PURE__ */ jsx(
125
+ ArrayField,
126
+ {
127
+ field,
128
+ name,
129
+ value,
130
+ onChange
131
+ }
132
+ );
122
133
  case "custom":
123
134
  if (field.render) {
124
135
  const CustomRender = field.render;
@@ -2,10 +2,10 @@
2
2
  import { jsxs, jsx } from "react/jsx-runtime";
3
3
  import { useState, useCallback } from "react";
4
4
  import { X, Loader2, UploadCloud, ImageIcon } from "lucide-react";
5
- import { cn } from "../../utils/css-utils.js";
6
- import { Button } from "../shadcn/button.js";
7
- import { Input } from "../shadcn/input.js";
8
- import useUpload from "./use-upload.js";
5
+ import { cn } from "../../../utils/css-utils.js";
6
+ import { Button } from "../../shadcn/button.js";
7
+ import { Input } from "../../shadcn/input.js";
8
+ import useUpload from "../use-upload.js";
9
9
  function ImageUploadField({
10
10
  name,
11
11
  value,
@@ -32,7 +32,7 @@ function ImageUploadField({
32
32
  {
33
33
  src: value,
34
34
  alt: "preview",
35
- className: "block h-32 w-full object-cover"
35
+ className: "block h-32 w-full object-contain"
36
36
  }
37
37
  ),
38
38
  /* @__PURE__ */ jsx(
@@ -3,6 +3,7 @@ export { AutoField } from "./auto-field";
3
3
  export { ColorField } from "./color-field";
4
4
  export { RadioToggleField } from "./radio-toggle-field";
5
5
  export { ObjectField } from "./object-field";
6
+ export { ArrayField } from "./array-field";
6
7
  export { VirtualizedSelectField, LARGE_SELECT_THRESHOLD, } from "./virtualized-select-field";
7
8
  export { LocationField } from "./location-field";
8
9
  export { ActionField, ACTION_TYPE_FIELD_MAP, ACTION_TYPE_OPTIONS, PageActionFields, ExternalActionFields, EmailActionFields, PhoneActionFields, SectionActionFields, DownloadActionFields, type ActionTypeFieldProps, } from "./action-field";
@@ -4,7 +4,7 @@ import { memo, useState, useRef, useEffect, useCallback } from "react";
4
4
  import { Input } from "../../shadcn/input.js";
5
5
  import { Label } from "../../shadcn/label.js";
6
6
  import { Loader2, Search, X, MapPin } from "lucide-react";
7
- import { useEditorContext } from "../../puck-core/core/context/editor-context.js";
7
+ import { useEditorContext } from "../core/context/editor-context.js";
8
8
  let googleLoadPromise = null;
9
9
  function loadGooglePlaces(apiKey) {
10
10
  var _a, _b;
@@ -13,7 +13,7 @@ const ObjectField = memo(function ObjectField2({
13
13
  const objValue = value && typeof value === "object" ? value : {};
14
14
  return /* @__PURE__ */ jsxs("div", { className: "mb-4 space-y-1.5", children: [
15
15
  /* @__PURE__ */ jsx(Label, { children: label }),
16
- /* @__PURE__ */ jsx("div", { className: "rounded-lg border p-3", children: Object.entries(objectFields).map(([key, subField]) => /* @__PURE__ */ jsx(
16
+ /* @__PURE__ */ jsx("div", { className: "rounded-lg p-3 bg-muted/50", children: Object.entries(objectFields).map(([key, subField]) => /* @__PURE__ */ jsx(
17
17
  AutoField,
18
18
  {
19
19
  field: subField,
@@ -8,5 +8,6 @@ export { InlineEditable } from "./inline-editable";
8
8
  export { usePuckDispatch, usePuckAppState, usePuckHistory, usePuckConfig, usePuckGetSelectorForId, type PuckComponentInfo, } from "./core/hooks";
9
9
  export { SectionWrapper, type SectionWrapperProps } from "./section-wrapper";
10
10
  export { EditorContextProvider, useEditorContext } from "./core/context/editor-context";
11
+ export { SectionIdProvider, useSectionId } from "./core/context/section-id-context";
11
12
  export { default as useUpload, type UploadFileItem, type UploadStatus, type UseUploadOptions } from "./use-upload";
12
13
  export { icon, action, actionDefaults, button, buttons, badge, image, images, padding, paddingDefaults, paddingLevel, heading, description, features, contentFields, contentFieldsWithFeatures, card, cards, field, fieldDefaults, form, formDefaults, getPlaceholderImageUrl, image16x9Placeholder, image1x1Placeholder, image9x16Placeholder, sectionStyle, sectionOverlay, backgroundColor, backgroundImage, } from "./core/fields";
@@ -2,7 +2,7 @@
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { createElement, useRef, useEffect, useCallback } from "react";
4
4
  import { registerOverlayPortal } from "@puckeditor/core";
5
- import { useEditorContext } from "../puck-core/core/context/editor-context.js";
5
+ import { useEditorContext } from "./core/context/editor-context.js";
6
6
  import { usePuckDispatch } from "./core/hooks.js";
7
7
  import set from "../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/set.js";
8
8
  import { findComponentById } from "./core/utils.js";