@nodehive/nextjs 0.1.2 → 0.2.0

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 (772) hide show
  1. package/README.md +1 -1
  2. package/dist/auth/index.d.ts +2 -3
  3. package/dist/auth/index.js.map +1 -1
  4. package/dist/auth/internal/config.d.ts +15 -5
  5. package/dist/auth/internal/config.js.map +1 -1
  6. package/dist/auth/internal/draft-mode.d.ts +2 -3
  7. package/dist/auth/internal/draft-mode.js +3 -20
  8. package/dist/auth/internal/draft-mode.js.map +1 -1
  9. package/dist/auth/internal/editor-locale.d.ts +0 -1
  10. package/dist/auth/internal/handoff.d.ts +0 -1
  11. package/dist/auth/internal/has-session.d.ts +0 -1
  12. package/dist/auth/internal/has-session.js +1 -1
  13. package/dist/auth/internal/has-session.js.map +1 -1
  14. package/dist/auth/internal/i18n.d.ts +10 -0
  15. package/dist/auth/internal/i18n.js +25 -0
  16. package/dist/auth/internal/i18n.js.map +1 -0
  17. package/dist/auth/internal/logout.d.ts +1 -2
  18. package/dist/auth/internal/logout.js +3 -3
  19. package/dist/auth/internal/logout.js.map +1 -1
  20. package/dist/auth/internal/next-cookie-storage.d.ts +5 -2
  21. package/dist/auth/internal/next-cookie-storage.js +8 -1
  22. package/dist/auth/internal/next-cookie-storage.js.map +1 -1
  23. package/dist/auth/internal/nodehive-client.d.ts +6 -4
  24. package/dist/auth/internal/nodehive-client.js +6 -4
  25. package/dist/auth/internal/nodehive-client.js.map +1 -1
  26. package/dist/auth/internal/oauth-config.d.ts +0 -1
  27. package/dist/auth/internal/proxy-helpers.d.ts +0 -1
  28. package/dist/auth/internal/proxy-helpers.js +4 -4
  29. package/dist/auth/internal/proxy-helpers.js.map +1 -1
  30. package/dist/auth/internal/refresh.d.ts +1 -2
  31. package/dist/auth/internal/refresh.js +4 -4
  32. package/dist/auth/internal/refresh.js.map +1 -1
  33. package/dist/auth/internal/require-auth.d.ts +0 -1
  34. package/dist/auth/internal/require-auth.js +1 -1
  35. package/dist/auth/internal/require-auth.js.map +1 -1
  36. package/dist/auth/internal/return-to.d.ts +0 -1
  37. package/dist/auth/internal/roles.d.ts +17 -0
  38. package/dist/auth/internal/roles.js +39 -0
  39. package/dist/auth/internal/roles.js.map +1 -0
  40. package/dist/auth/internal/routes/callback.d.ts +1 -2
  41. package/dist/auth/internal/routes/callback.js +6 -6
  42. package/dist/auth/internal/routes/callback.js.map +1 -1
  43. package/dist/auth/internal/routes/chips-exchange.d.ts +1 -2
  44. package/dist/auth/internal/routes/chips-exchange.js +5 -5
  45. package/dist/auth/internal/routes/chips-exchange.js.map +1 -1
  46. package/dist/auth/internal/routes/draft.d.ts +1 -2
  47. package/dist/auth/internal/routes/draft.js +3 -3
  48. package/dist/auth/internal/routes/draft.js.map +1 -1
  49. package/dist/auth/internal/routes/index.d.ts +4 -2
  50. package/dist/auth/internal/routes/index.js +7 -7
  51. package/dist/auth/internal/routes/index.js.map +1 -1
  52. package/dist/auth/internal/routes/login.d.ts +0 -1
  53. package/dist/auth/internal/routes/login.js +3 -3
  54. package/dist/auth/internal/routes/login.js.map +1 -1
  55. package/dist/auth/internal/routes/popup-done.d.ts +2 -2
  56. package/dist/auth/internal/routes/popup-done.js +9 -7
  57. package/dist/auth/internal/routes/popup-done.js.map +1 -1
  58. package/dist/auth/internal/routes/refresh.d.ts +2 -5
  59. package/dist/auth/internal/routes/refresh.js +8 -2
  60. package/dist/auth/internal/routes/refresh.js.map +1 -1
  61. package/dist/auth/internal/same-origin.d.ts +0 -1
  62. package/dist/auth/internal/session-gates.d.ts +27 -3
  63. package/dist/auth/internal/session-gates.js +35 -3
  64. package/dist/auth/internal/session-gates.js.map +1 -1
  65. package/dist/auth/internal/update-session.d.ts +1 -2
  66. package/dist/auth/internal/update-session.js +1 -1
  67. package/dist/auth/internal/update-session.js.map +1 -1
  68. package/dist/auth/internal/use-editor-login.d.ts +0 -1
  69. package/dist/auth/internal/use-editor-login.js +2 -3
  70. package/dist/auth/internal/use-editor-login.js.map +1 -1
  71. package/dist/auth/proxy.d.ts +7 -8
  72. package/dist/auth/proxy.js +6 -6
  73. package/dist/auth/proxy.js.map +1 -1
  74. package/dist/auth/react.d.ts +1 -2
  75. package/dist/auth/react.js +1 -1
  76. package/dist/auth/react.js.map +1 -1
  77. package/dist/auth/routes.d.ts +3 -3
  78. package/dist/auth/routes.js +1 -1
  79. package/dist/auth/routes.js.map +1 -1
  80. package/dist/auth/server.d.ts +14 -12
  81. package/dist/auth/server.js +14 -9
  82. package/dist/auth/server.js.map +1 -1
  83. package/dist/bridge-protocol/index.d.ts +50 -0
  84. package/dist/bridge-protocol/index.js +25 -0
  85. package/dist/bridge-protocol/index.js.map +1 -0
  86. package/dist/puck-editor/editor.d.ts +8 -0
  87. package/dist/puck-editor/editor.js +9 -0
  88. package/dist/puck-editor/editor.js.map +1 -0
  89. package/dist/puck-editor/fields.d.ts +6 -7
  90. package/dist/puck-editor/fields.js +3 -3
  91. package/dist/puck-editor/fields.js.map +1 -1
  92. package/dist/puck-editor/index.d.ts +17 -14
  93. package/dist/puck-editor/index.js +13 -11
  94. package/dist/puck-editor/index.js.map +1 -1
  95. package/dist/puck-editor/internal/api/client.d.ts +19 -4
  96. package/dist/puck-editor/internal/api/client.js +56 -19
  97. package/dist/puck-editor/internal/api/client.js.map +1 -1
  98. package/dist/puck-editor/internal/api/config.d.ts +36 -3
  99. package/dist/puck-editor/internal/api/config.js.map +1 -1
  100. package/dist/puck-editor/internal/api/create-puck-api.d.ts +1 -2
  101. package/dist/puck-editor/internal/api/create-puck-api.js +10 -13
  102. package/dist/puck-editor/internal/api/create-puck-api.js.map +1 -1
  103. package/dist/puck-editor/internal/api/handlers/create-page.d.ts +1 -2
  104. package/dist/puck-editor/internal/api/handlers/create-page.js +6 -4
  105. package/dist/puck-editor/internal/api/handlers/create-page.js.map +1 -1
  106. package/dist/puck-editor/internal/api/handlers/entities.d.ts +6 -5
  107. package/dist/puck-editor/internal/api/handlers/entities.js +60 -15
  108. package/dist/puck-editor/internal/api/handlers/entities.js.map +1 -1
  109. package/dist/puck-editor/internal/api/handlers/publish.d.ts +3 -6
  110. package/dist/puck-editor/internal/api/handlers/publish.js +57 -14
  111. package/dist/puck-editor/internal/api/handlers/publish.js.map +1 -1
  112. package/dist/puck-editor/internal/api/handlers/template.d.ts +5 -2
  113. package/dist/puck-editor/internal/api/handlers/template.js +28 -60
  114. package/dist/puck-editor/internal/api/handlers/template.js.map +1 -1
  115. package/dist/puck-editor/internal/api/handlers/upload.d.ts +10 -2
  116. package/dist/puck-editor/internal/api/handlers/upload.js +93 -28
  117. package/dist/puck-editor/internal/api/handlers/upload.js.map +1 -1
  118. package/dist/puck-editor/internal/api/localize-message.d.ts +15 -0
  119. package/dist/puck-editor/internal/api/localize-message.js +15 -0
  120. package/dist/puck-editor/internal/api/localize-message.js.map +1 -0
  121. package/dist/puck-editor/internal/api/media-params.d.ts +3 -3
  122. package/dist/puck-editor/internal/api/media-params.js +23 -19
  123. package/dist/puck-editor/internal/api/media-params.js.map +1 -1
  124. package/dist/puck-editor/internal/api/media-upload.d.ts +5 -3
  125. package/dist/puck-editor/internal/api/media-upload.js +33 -22
  126. package/dist/puck-editor/internal/api/media-upload.js.map +1 -1
  127. package/dist/puck-editor/internal/api/message-codes.d.ts +2 -0
  128. package/dist/puck-editor/internal/api/message-codes.js +2 -0
  129. package/dist/puck-editor/internal/api/message-codes.js.map +1 -0
  130. package/dist/puck-editor/internal/api/space.d.ts +0 -1
  131. package/dist/puck-editor/internal/api/type-segment.d.ts +2 -0
  132. package/dist/puck-editor/internal/api/type-segment.js +9 -0
  133. package/dist/puck-editor/internal/api/type-segment.js.map +1 -0
  134. package/dist/puck-editor/internal/content-model.d.ts +31 -3
  135. package/dist/puck-editor/internal/content-model.js +76 -6
  136. package/dist/puck-editor/internal/content-model.js.map +1 -1
  137. package/dist/puck-editor/internal/dictionaries.d.ts +225 -0
  138. package/dist/puck-editor/internal/dictionaries.js +673 -0
  139. package/dist/puck-editor/internal/dictionaries.js.map +1 -0
  140. package/dist/puck-editor/internal/editor/allowed-types.d.ts +1 -2
  141. package/dist/puck-editor/internal/editor/allowed-types.js +2 -2
  142. package/dist/puck-editor/internal/editor/allowed-types.js.map +1 -1
  143. package/dist/puck-editor/internal/editor/canvas-add-picker.d.ts +0 -1
  144. package/dist/puck-editor/internal/editor/canvas-add-picker.js +108 -135
  145. package/dist/puck-editor/internal/editor/canvas-add-picker.js.map +1 -1
  146. package/dist/puck-editor/internal/editor/canvas-empty-state.d.ts +0 -1
  147. package/dist/puck-editor/internal/editor/canvas-empty-state.js +4 -4
  148. package/dist/puck-editor/internal/editor/canvas-empty-state.js.map +1 -1
  149. package/dist/puck-editor/internal/editor/canvas-quick-add.d.ts +0 -1
  150. package/dist/puck-editor/internal/editor/canvas-quick-add.js +28 -41
  151. package/dist/puck-editor/internal/editor/canvas-quick-add.js.map +1 -1
  152. package/dist/puck-editor/internal/editor/canvas-scroll.d.ts +0 -1
  153. package/dist/puck-editor/internal/editor/component-icons.d.ts +1 -2
  154. package/dist/puck-editor/internal/editor/component-icons.js.map +1 -1
  155. package/dist/puck-editor/internal/editor/component-item.d.ts +0 -1
  156. package/dist/puck-editor/internal/editor/component-item.js +2 -2
  157. package/dist/puck-editor/internal/editor/component-item.js.map +1 -1
  158. package/dist/puck-editor/internal/editor/compose-save-issues.d.ts +15 -0
  159. package/dist/puck-editor/internal/editor/compose-save-issues.js +16 -0
  160. package/dist/puck-editor/internal/editor/compose-save-issues.js.map +1 -0
  161. package/dist/puck-editor/internal/editor/dirty-state.d.ts +3 -0
  162. package/dist/puck-editor/internal/editor/dirty-state.js +7 -0
  163. package/dist/puck-editor/internal/editor/dirty-state.js.map +1 -0
  164. package/dist/puck-editor/internal/editor/draft-restore-banner.d.ts +9 -0
  165. package/dist/puck-editor/internal/editor/draft-restore-banner.js +289 -0
  166. package/dist/puck-editor/internal/editor/draft-restore-banner.js.map +1 -0
  167. package/dist/puck-editor/internal/editor/draft-storage.d.ts +41 -0
  168. package/dist/puck-editor/internal/editor/draft-storage.js +129 -0
  169. package/dist/puck-editor/internal/editor/draft-storage.js.map +1 -0
  170. package/dist/puck-editor/internal/editor/editor-action-bar.d.ts +0 -1
  171. package/dist/puck-editor/internal/editor/editor-action-bar.js +4 -4
  172. package/dist/puck-editor/internal/editor/editor-action-bar.js.map +1 -1
  173. package/dist/puck-editor/internal/editor/editor-header-actions.d.ts +6 -4
  174. package/dist/puck-editor/internal/editor/editor-header-actions.js +119 -60
  175. package/dist/puck-editor/internal/editor/editor-header-actions.js.map +1 -1
  176. package/dist/puck-editor/internal/editor/find-missing-required-fields.d.ts +0 -1
  177. package/dist/puck-editor/internal/editor/grouped-drawer-panel.d.ts +1 -2
  178. package/dist/puck-editor/internal/editor/grouped-drawer-panel.js +6 -6
  179. package/dist/puck-editor/internal/editor/grouped-drawer-panel.js.map +1 -1
  180. package/dist/puck-editor/internal/editor/grouped-entry-list.d.ts +7 -5
  181. package/dist/puck-editor/internal/editor/grouped-entry-list.js +85 -56
  182. package/dist/puck-editor/internal/editor/grouped-entry-list.js.map +1 -1
  183. package/dist/puck-editor/internal/editor/header-save-button.d.ts +4 -4
  184. package/dist/puck-editor/internal/editor/header-save-button.js +66 -27
  185. package/dist/puck-editor/internal/editor/header-save-button.js.map +1 -1
  186. package/dist/puck-editor/internal/editor/leave-confirm-dialog.d.ts +5 -0
  187. package/dist/puck-editor/internal/editor/leave-confirm-dialog.js +140 -0
  188. package/dist/puck-editor/internal/editor/leave-confirm-dialog.js.map +1 -0
  189. package/dist/puck-editor/internal/editor/page-template-picker.d.ts +0 -1
  190. package/dist/puck-editor/internal/editor/page-template-picker.js +5 -5
  191. package/dist/puck-editor/internal/editor/page-template-picker.js.map +1 -1
  192. package/dist/puck-editor/internal/editor/picker-entry-item.d.ts +1 -2
  193. package/dist/puck-editor/internal/editor/picker-entry-item.js +4 -4
  194. package/dist/puck-editor/internal/editor/picker-entry-item.js.map +1 -1
  195. package/dist/puck-editor/internal/editor/picker-model.d.ts +14 -5
  196. package/dist/puck-editor/internal/editor/picker-model.js +157 -132
  197. package/dist/puck-editor/internal/editor/picker-model.js.map +1 -1
  198. package/dist/puck-editor/internal/editor/publish-puck-data.d.ts +18 -4
  199. package/dist/puck-editor/internal/editor/publish-puck-data.js +25 -4
  200. package/dist/puck-editor/internal/editor/publish-puck-data.js.map +1 -1
  201. package/dist/puck-editor/internal/editor/puck-editor.d.ts +6 -4
  202. package/dist/puck-editor/internal/editor/puck-editor.js +270 -209
  203. package/dist/puck-editor/internal/editor/puck-editor.js.map +1 -1
  204. package/dist/puck-editor/internal/editor/save-guard.d.ts +15 -0
  205. package/dist/puck-editor/internal/editor/save-guard.js +30 -0
  206. package/dist/puck-editor/internal/editor/save-guard.js.map +1 -0
  207. package/dist/puck-editor/internal/editor/save-page-context.d.ts +8 -0
  208. package/dist/puck-editor/internal/editor/save-page-context.js +34 -0
  209. package/dist/puck-editor/internal/editor/save-page-context.js.map +1 -0
  210. package/dist/puck-editor/internal/editor/section-template-modal.d.ts +0 -1
  211. package/dist/puck-editor/internal/editor/section-template-modal.js +2 -2
  212. package/dist/puck-editor/internal/editor/section-template-modal.js.map +1 -1
  213. package/dist/puck-editor/internal/editor/unsaved-changes-guard.d.ts +3 -0
  214. package/dist/puck-editor/internal/editor/unsaved-changes-guard.js +38 -0
  215. package/dist/puck-editor/internal/editor/unsaved-changes-guard.js.map +1 -0
  216. package/dist/puck-editor/internal/editor/use-dirty-baseline.d.ts +5 -0
  217. package/dist/puck-editor/internal/editor/use-dirty-baseline.js +72 -0
  218. package/dist/puck-editor/internal/editor/use-dirty-baseline.js.map +1 -0
  219. package/dist/puck-editor/internal/editor/use-draft-recovery.d.ts +16 -0
  220. package/dist/puck-editor/internal/editor/use-draft-recovery.js +194 -0
  221. package/dist/puck-editor/internal/editor/use-draft-recovery.js.map +1 -0
  222. package/dist/puck-editor/internal/editor/use-frame-zoom.d.ts +1 -0
  223. package/dist/puck-editor/internal/editor/use-frame-zoom.js +59 -0
  224. package/dist/puck-editor/internal/editor/use-frame-zoom.js.map +1 -0
  225. package/dist/puck-editor/internal/editor/use-is-dirty.d.ts +1 -0
  226. package/dist/puck-editor/internal/editor/use-is-dirty.js +32 -0
  227. package/dist/puck-editor/internal/editor/use-is-dirty.js.map +1 -0
  228. package/dist/puck-editor/internal/editor/use-scroll-lock-outside.d.ts +0 -1
  229. package/dist/puck-editor/internal/editor-config.d.ts +16 -3
  230. package/dist/puck-editor/internal/editor-config.js +8 -1
  231. package/dist/puck-editor/internal/editor-config.js.map +1 -1
  232. package/dist/puck-editor/internal/editor-query-client.d.ts +0 -1
  233. package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.d.ts +0 -1
  234. package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.js +2 -2
  235. package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.js.map +1 -1
  236. package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.d.ts +0 -1
  237. package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.js +1 -1
  238. package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.js.map +1 -1
  239. package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.d.ts +0 -1
  240. package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.js +1 -1
  241. package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.js.map +1 -1
  242. package/dist/puck-editor/internal/fields/date-picker/date-picker.d.ts +0 -1
  243. package/dist/puck-editor/internal/fields/date-picker/date-picker.js +90 -73
  244. package/dist/puck-editor/internal/fields/date-picker/date-picker.js.map +1 -1
  245. package/dist/puck-editor/internal/fields/index.d.ts +10 -10
  246. package/dist/puck-editor/internal/fields/index.js +10 -9
  247. package/dist/puck-editor/internal/fields/index.js.map +1 -1
  248. package/dist/puck-editor/internal/fields/link-picker/anchor.d.ts +0 -1
  249. package/dist/puck-editor/internal/fields/link-picker/anchor.js +1 -1
  250. package/dist/puck-editor/internal/fields/link-picker/anchor.js.map +1 -1
  251. package/dist/puck-editor/internal/fields/link-picker/create-link-field.d.ts +1 -2
  252. package/dist/puck-editor/internal/fields/link-picker/create-link-field.js +1 -1
  253. package/dist/puck-editor/internal/fields/link-picker/create-link-field.js.map +1 -1
  254. package/dist/puck-editor/internal/fields/link-picker/humanize.d.ts +0 -1
  255. package/dist/puck-editor/internal/fields/link-picker/link-picker-control.d.ts +0 -1
  256. package/dist/puck-editor/internal/fields/link-picker/link-picker-control.js +208 -140
  257. package/dist/puck-editor/internal/fields/link-picker/link-picker-control.js.map +1 -1
  258. package/dist/puck-editor/internal/fields/link-picker/link-picker-field.d.ts +1 -2
  259. package/dist/puck-editor/internal/fields/link-picker/link-picker-field.js +6 -6
  260. package/dist/puck-editor/internal/fields/link-picker/link-picker-field.js.map +1 -1
  261. package/dist/puck-editor/internal/fields/link-picker/link-value.d.ts +25 -5
  262. package/dist/puck-editor/internal/fields/link-picker/link-value.js +56 -6
  263. package/dist/puck-editor/internal/fields/link-picker/link-value.js.map +1 -1
  264. package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.d.ts +0 -1
  265. package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.js +4 -4
  266. package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.js.map +1 -1
  267. package/dist/puck-editor/internal/fields/link-picker/richtext-extensions.d.ts +0 -1
  268. package/dist/puck-editor/internal/fields/link-picker/segmented-control.d.ts +0 -1
  269. package/dist/puck-editor/internal/fields/link-picker/segmented-control.js +3 -3
  270. package/dist/puck-editor/internal/fields/link-picker/segmented-control.js.map +1 -1
  271. package/dist/puck-editor/internal/fields/link-picker/types.d.ts +0 -1
  272. package/dist/puck-editor/internal/fields/media-array/create-media-array-field.d.ts +2 -3
  273. package/dist/puck-editor/internal/fields/media-array/create-media-array-field.js +1 -1
  274. package/dist/puck-editor/internal/fields/media-array/create-media-array-field.js.map +1 -1
  275. package/dist/puck-editor/internal/fields/media-array/media-array-field.d.ts +2 -3
  276. package/dist/puck-editor/internal/fields/media-array/media-array-field.js +124 -115
  277. package/dist/puck-editor/internal/fields/media-array/media-array-field.js.map +1 -1
  278. package/dist/puck-editor/internal/fields/media-array/reorder.d.ts +0 -1
  279. package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.d.ts +2 -3
  280. package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.js +1 -1
  281. package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.js.map +1 -1
  282. package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.d.ts +1 -2
  283. package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.js +4 -4
  284. package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.js.map +1 -1
  285. package/dist/puck-editor/internal/fields/media-selector/crop-types.d.ts +0 -1
  286. package/dist/puck-editor/internal/fields/media-selector/extract-fields.d.ts +0 -1
  287. package/dist/puck-editor/internal/fields/media-selector/image-upload-form.d.ts +0 -1
  288. package/dist/puck-editor/internal/fields/media-selector/image-upload-form.js +19 -10
  289. package/dist/puck-editor/internal/fields/media-selector/image-upload-form.js.map +1 -1
  290. package/dist/puck-editor/internal/fields/media-selector/media-selector-field.d.ts +8 -3
  291. package/dist/puck-editor/internal/fields/media-selector/media-selector-field.js +59 -61
  292. package/dist/puck-editor/internal/fields/media-selector/media-selector-field.js.map +1 -1
  293. package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.d.ts +1 -2
  294. package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.js +281 -255
  295. package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.js.map +1 -1
  296. package/dist/puck-editor/internal/fields/media-selector/use-debounced-value.d.ts +0 -1
  297. package/dist/puck-editor/internal/fields/media-selector/use-media-library.d.ts +15 -2
  298. package/dist/puck-editor/internal/fields/media-selector/use-media-library.js +23 -18
  299. package/dist/puck-editor/internal/fields/media-selector/use-media-library.js.map +1 -1
  300. package/dist/puck-editor/internal/fields/media-selector/video-upload-form.d.ts +0 -1
  301. package/dist/puck-editor/internal/fields/media-selector/video-upload-form.js +12 -6
  302. package/dist/puck-editor/internal/fields/media-selector/video-upload-form.js.map +1 -1
  303. package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.d.ts +0 -1
  304. package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.js +2 -2
  305. package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.js.map +1 -1
  306. package/dist/puck-editor/internal/fields/required-field-label.d.ts +0 -1
  307. package/dist/puck-editor/internal/fields/required-field-label.js +1 -1
  308. package/dist/puck-editor/internal/fields/required-field-label.js.map +1 -1
  309. package/dist/puck-editor/internal/fields/required.d.ts +0 -1
  310. package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.d.ts +13 -3
  311. package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.js +32 -22
  312. package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.js.map +1 -1
  313. package/dist/puck-editor/internal/i18n.d.ts +2 -181
  314. package/dist/puck-editor/internal/i18n.js +2 -358
  315. package/dist/puck-editor/internal/i18n.js.map +1 -1
  316. package/dist/puck-editor/internal/locale.d.ts +0 -1
  317. package/dist/puck-editor/internal/localize.d.ts +1 -2
  318. package/dist/puck-editor/internal/localize.js.map +1 -1
  319. package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.d.ts +3 -3
  320. package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.js +41 -32
  321. package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.js.map +1 -1
  322. package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.d.ts +0 -1
  323. package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.js +2 -2
  324. package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.js.map +1 -1
  325. package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.d.ts +3 -3
  326. package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.js.map +1 -1
  327. package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.d.ts +0 -1
  328. package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.js +1 -1
  329. package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.js.map +1 -1
  330. package/dist/puck-editor/internal/plugins/agent-plugin/catalog.d.ts +0 -1
  331. package/dist/puck-editor/internal/plugins/agent-plugin/constants.d.ts +0 -1
  332. package/dist/puck-editor/internal/plugins/agent-plugin/create-page.d.ts +0 -1
  333. package/dist/puck-editor/internal/plugins/agent-plugin/find-component-location.d.ts +0 -1
  334. package/dist/puck-editor/internal/plugins/agent-plugin/help.d.ts +0 -1
  335. package/dist/puck-editor/internal/plugins/agent-plugin/index.d.ts +1 -2
  336. package/dist/puck-editor/internal/plugins/agent-plugin/index.js +1 -1
  337. package/dist/puck-editor/internal/plugins/agent-plugin/index.js.map +1 -1
  338. package/dist/puck-editor/internal/plugins/agent-plugin/list-media.d.ts +2 -2
  339. package/dist/puck-editor/internal/plugins/agent-plugin/list-media.js +4 -3
  340. package/dist/puck-editor/internal/plugins/agent-plugin/list-media.js.map +1 -1
  341. package/dist/puck-editor/internal/plugins/agent-plugin/templates.d.ts +5 -6
  342. package/dist/puck-editor/internal/plugins/agent-plugin/templates.js +2 -2
  343. package/dist/puck-editor/internal/plugins/agent-plugin/templates.js.map +1 -1
  344. package/dist/puck-editor/internal/plugins/agent-plugin/upload-media.d.ts +1 -2
  345. package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.d.ts +0 -1
  346. package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.js +2 -2
  347. package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.js.map +1 -1
  348. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.d.ts +0 -1
  349. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.js +3 -3
  350. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.js.map +1 -1
  351. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.d.ts +0 -1
  352. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.js +1 -1
  353. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.js.map +1 -1
  354. package/dist/puck-editor/internal/plugins/blocks-plugin/index.d.ts +1 -2
  355. package/dist/puck-editor/internal/plugins/blocks-plugin/index.js +1 -1
  356. package/dist/puck-editor/internal/plugins/blocks-plugin/index.js.map +1 -1
  357. package/dist/puck-editor/internal/plugins/outline-plugin/index.d.ts +1 -2
  358. package/dist/puck-editor/internal/plugins/outline-plugin/index.js +1 -1
  359. package/dist/puck-editor/internal/plugins/outline-plugin/index.js.map +1 -1
  360. package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.d.ts +0 -1
  361. package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.js +8 -8
  362. package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.js.map +1 -1
  363. package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.d.ts +0 -1
  364. package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.js +1 -1
  365. package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.js.map +1 -1
  366. package/dist/puck-editor/internal/plugins/outline-plugin/outline-tree.d.ts +0 -1
  367. package/dist/puck-editor/internal/plugins/sections-plugin/index.d.ts +1 -2
  368. package/dist/puck-editor/internal/plugins/sections-plugin/index.js +1 -1
  369. package/dist/puck-editor/internal/plugins/sections-plugin/index.js.map +1 -1
  370. package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.d.ts +0 -1
  371. package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.js +5 -5
  372. package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.js.map +1 -1
  373. package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.d.ts +0 -1
  374. package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.js +1 -1
  375. package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.js.map +1 -1
  376. package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.d.ts +0 -1
  377. package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.js +2 -2
  378. package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.js.map +1 -1
  379. package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.d.ts +0 -1
  380. package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.js +1 -1
  381. package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.js.map +1 -1
  382. package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.d.ts +1 -2
  383. package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.js +3 -3
  384. package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.js.map +1 -1
  385. package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.d.ts +1 -2
  386. package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.js +224 -219
  387. package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.js.map +1 -1
  388. package/dist/puck-editor/internal/plugins/templates-plugin/index.d.ts +5 -6
  389. package/dist/puck-editor/internal/plugins/templates-plugin/index.js +5 -5
  390. package/dist/puck-editor/internal/plugins/templates-plugin/index.js.map +1 -1
  391. package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.d.ts +0 -1
  392. package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.js +3 -3
  393. package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.js.map +1 -1
  394. package/dist/puck-editor/internal/plugins/templates-plugin/template-form.d.ts +1 -2
  395. package/dist/puck-editor/internal/plugins/templates-plugin/template-form.js +17 -16
  396. package/dist/puck-editor/internal/plugins/templates-plugin/template-form.js.map +1 -1
  397. package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.d.ts +1 -2
  398. package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.js +1 -1
  399. package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.js.map +1 -1
  400. package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.d.ts +0 -1
  401. package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.js +171 -161
  402. package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.js.map +1 -1
  403. package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.d.ts +0 -1
  404. package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.js +1 -1
  405. package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.js.map +1 -1
  406. package/dist/puck-editor/internal/plugins/templates-plugin/templates.d.ts +2 -3
  407. package/dist/puck-editor/internal/plugins/templates-plugin/templates.js +9 -2
  408. package/dist/puck-editor/internal/plugins/templates-plugin/templates.js.map +1 -1
  409. package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.d.ts +0 -1
  410. package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.js +22 -20
  411. package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.js.map +1 -1
  412. package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.d.ts +14 -5
  413. package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.js +23 -15
  414. package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.js.map +1 -1
  415. package/dist/puck-editor/internal/puck-augmentation.d.ts +0 -1
  416. package/dist/puck-editor/internal/puck-editor-provider.d.ts +0 -1
  417. package/dist/puck-editor/internal/puck-node.d.ts +0 -1
  418. package/dist/puck-editor/internal/puck-props.d.ts +13 -0
  419. package/dist/puck-editor/internal/puck-props.js +2 -0
  420. package/dist/puck-editor/internal/puck-props.js.map +1 -0
  421. package/dist/puck-editor/internal/puck-wrapper.d.ts +25 -6
  422. package/dist/puck-editor/internal/puck-wrapper.js +124 -115
  423. package/dist/puck-editor/internal/puck-wrapper.js.map +1 -1
  424. package/dist/puck-editor/internal/render/cropped-image.d.ts +1 -2
  425. package/dist/puck-editor/internal/render/cropped-image.js.map +1 -1
  426. package/dist/puck-editor/internal/smart-actions/action-selection.d.ts +8 -0
  427. package/dist/puck-editor/internal/smart-actions/action-selection.js +10 -0
  428. package/dist/puck-editor/internal/smart-actions/action-selection.js.map +1 -0
  429. package/dist/puck-editor/internal/smart-actions/index.d.ts +10 -4
  430. package/dist/puck-editor/internal/smart-actions/index.js +27 -12
  431. package/dist/puck-editor/internal/smart-actions/index.js.map +1 -1
  432. package/dist/puck-editor/internal/smart-actions/new-page.d.ts +3 -2
  433. package/dist/puck-editor/internal/smart-actions/new-page.js +6 -6
  434. package/dist/puck-editor/internal/smart-actions/new-page.js.map +1 -1
  435. package/dist/puck-editor/internal/smart-actions/open-puck-editor.d.ts +3 -2
  436. package/dist/puck-editor/internal/smart-actions/open-puck-editor.js +49 -37
  437. package/dist/puck-editor/internal/smart-actions/open-puck-editor.js.map +1 -1
  438. package/dist/puck-editor/internal/ui/calendar.d.ts +0 -1
  439. package/dist/puck-editor/internal/ui/calendar.js +1 -1
  440. package/dist/puck-editor/internal/ui/calendar.js.map +1 -1
  441. package/dist/puck-editor/internal/ui/component-list-accordion.d.ts +0 -1
  442. package/dist/puck-editor/internal/ui/dialog.d.ts +0 -1
  443. package/dist/puck-editor/internal/ui/dialog.js +33 -20
  444. package/dist/puck-editor/internal/ui/dialog.js.map +1 -1
  445. package/dist/puck-editor/internal/ui/drawer-item-content.d.ts +0 -1
  446. package/dist/puck-editor/internal/ui/icon-button.d.ts +0 -1
  447. package/dist/puck-editor/internal/ui/icon-button.js +1 -1
  448. package/dist/puck-editor/internal/ui/icon-button.js.map +1 -1
  449. package/dist/puck-editor/internal/ui/load-error-notice.d.ts +6 -0
  450. package/dist/puck-editor/internal/ui/load-error-notice.js +81 -0
  451. package/dist/puck-editor/internal/ui/load-error-notice.js.map +1 -0
  452. package/dist/puck-editor/internal/ui/popover.d.ts +0 -1
  453. package/dist/puck-editor/internal/ui/popover.js +1 -1
  454. package/dist/puck-editor/internal/ui/popover.js.map +1 -1
  455. package/dist/puck-editor/internal/ui/required-mark.d.ts +0 -1
  456. package/dist/puck-editor/internal/ui/search-control.d.ts +3 -3
  457. package/dist/puck-editor/internal/ui/search-control.js +29 -26
  458. package/dist/puck-editor/internal/ui/search-control.js.map +1 -1
  459. package/dist/puck-editor/internal/ui/use-panel-search-focus.d.ts +0 -1
  460. package/dist/puck-editor/internal/use-puck-overlay.d.ts +1 -2
  461. package/dist/puck-editor/internal/use-puck-overlay.js +6 -5
  462. package/dist/puck-editor/internal/use-puck-overlay.js.map +1 -1
  463. package/dist/puck-editor/internal/utils.d.ts +0 -1
  464. package/dist/puck-editor/render.d.ts +2 -3
  465. package/dist/puck-editor/render.js +1 -1
  466. package/dist/puck-editor/render.js.map +1 -1
  467. package/dist/puck-editor/server.d.ts +3 -4
  468. package/dist/puck-editor/server.js +1 -1
  469. package/dist/puck-editor/server.js.map +1 -1
  470. package/dist/puck-editor/smart-actions.d.ts +1 -2
  471. package/dist/puck-editor/smart-actions.js +1 -1
  472. package/dist/puck-editor/smart-actions.js.map +1 -1
  473. package/dist/shared/cn.d.ts +0 -1
  474. package/dist/shared/i18n.d.ts +0 -1
  475. package/dist/shared/revalidate-path.d.ts +1 -0
  476. package/dist/shared/revalidate-path.js +2 -0
  477. package/dist/shared/revalidate-path.js.map +1 -0
  478. package/dist/shared/toolbar-action.d.ts +0 -1
  479. package/dist/shared/use-is-hydrated.d.ts +0 -1
  480. package/dist/shared/use-is-in-iframe.d.ts +0 -1
  481. package/dist/shared/use-is-in-iframe.js +1 -1
  482. package/dist/shared/use-is-in-iframe.js.map +1 -1
  483. package/dist/smart-actions/internal/assemble-smart-actions.d.ts +14 -0
  484. package/dist/smart-actions/internal/assemble-smart-actions.js +11 -0
  485. package/dist/smart-actions/internal/assemble-smart-actions.js.map +1 -0
  486. package/dist/smart-actions/internal/backend-edit-link.d.ts +6 -0
  487. package/dist/smart-actions/internal/backend-edit-link.js +60 -0
  488. package/dist/smart-actions/internal/backend-edit-link.js.map +1 -0
  489. package/dist/smart-actions/internal/get-smart-actions-context.d.ts +1 -2
  490. package/dist/smart-actions/internal/get-smart-actions-context.js +2 -2
  491. package/dist/smart-actions/internal/get-smart-actions-context.js.map +1 -1
  492. package/dist/smart-actions/internal/i18n.d.ts +1 -2
  493. package/dist/smart-actions/internal/i18n.js +16 -2
  494. package/dist/smart-actions/internal/i18n.js.map +1 -1
  495. package/dist/smart-actions/internal/logout-form.d.ts +2 -2
  496. package/dist/smart-actions/internal/logout-form.js +47 -40
  497. package/dist/smart-actions/internal/logout-form.js.map +1 -1
  498. package/dist/smart-actions/internal/refresh-page.d.ts +3 -2
  499. package/dist/smart-actions/internal/refresh-page.js +60 -53
  500. package/dist/smart-actions/internal/refresh-page.js.map +1 -1
  501. package/dist/smart-actions/internal/smart-actions-button.d.ts +22 -4
  502. package/dist/smart-actions/internal/smart-actions-button.js +36 -13
  503. package/dist/smart-actions/internal/smart-actions-button.js.map +1 -1
  504. package/dist/smart-actions/internal/smart-actions-config.d.ts +12 -4
  505. package/dist/smart-actions/internal/smart-actions-config.js +36 -80
  506. package/dist/smart-actions/internal/smart-actions-config.js.map +1 -1
  507. package/dist/smart-actions/internal/smart-actions-toolbar-client.d.ts +5 -11
  508. package/dist/smart-actions/internal/smart-actions-toolbar-client.js +13 -53
  509. package/dist/smart-actions/internal/smart-actions-toolbar-client.js.map +1 -1
  510. package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.d.ts +1 -2
  511. package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.js +4 -4
  512. package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.js.map +1 -1
  513. package/dist/smart-actions/internal/toolbar/storage.d.ts +1 -2
  514. package/dist/smart-actions/internal/toolbar/storage.js.map +1 -1
  515. package/dist/smart-actions/internal/toolbar/types.d.ts +1 -2
  516. package/dist/smart-actions/internal/toolbar/types.js.map +1 -1
  517. package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.d.ts +1 -2
  518. package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.js +1 -1
  519. package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.js.map +1 -1
  520. package/dist/smart-actions/internal/ui/tooltip.d.ts +0 -1
  521. package/dist/smart-actions/internal/ui/tooltip.js +1 -1
  522. package/dist/smart-actions/internal/ui/tooltip.js.map +1 -1
  523. package/dist/smart-actions/internal/user-profile.d.ts +0 -1
  524. package/dist/smart-actions/internal/user-profile.js +71 -24
  525. package/dist/smart-actions/internal/user-profile.js.map +1 -1
  526. package/dist/smart-actions/server.d.ts +5 -4
  527. package/dist/smart-actions/server.js +2 -2
  528. package/dist/smart-actions/server.js.map +1 -1
  529. package/dist/theme.css +1 -1
  530. package/dist/visual-editor/index.d.ts +3 -4
  531. package/dist/visual-editor/index.js +3 -3
  532. package/dist/visual-editor/index.js.map +1 -1
  533. package/dist/visual-editor/internal/bridge/connector.d.ts +4 -3
  534. package/dist/visual-editor/internal/bridge/connector.js +22 -21
  535. package/dist/visual-editor/internal/bridge/connector.js.map +1 -1
  536. package/dist/visual-editor/internal/bridge/draft-mode-self-heal.d.ts +0 -1
  537. package/dist/visual-editor/internal/bridge/editor-auth-gate-server.d.ts +5 -3
  538. package/dist/visual-editor/internal/bridge/editor-auth-gate-server.js +7 -8
  539. package/dist/visual-editor/internal/bridge/editor-auth-gate-server.js.map +1 -1
  540. package/dist/visual-editor/internal/bridge/editor-auth-gate.d.ts +3 -3
  541. package/dist/visual-editor/internal/bridge/editor-auth-gate.js +4 -2
  542. package/dist/visual-editor/internal/bridge/editor-auth-gate.js.map +1 -1
  543. package/dist/visual-editor/internal/i18n.d.ts +3 -2
  544. package/dist/visual-editor/internal/i18n.js +32 -4
  545. package/dist/visual-editor/internal/i18n.js.map +1 -1
  546. package/dist/visual-editor/internal/overlays/drupal-origin.d.ts +1 -7
  547. package/dist/visual-editor/internal/overlays/drupal-origin.js +16 -3
  548. package/dist/visual-editor/internal/overlays/drupal-origin.js.map +1 -1
  549. package/dist/visual-editor/internal/overlays/edit-button.d.ts +5 -4
  550. package/dist/visual-editor/internal/overlays/edit-button.js +46 -44
  551. package/dist/visual-editor/internal/overlays/edit-button.js.map +1 -1
  552. package/dist/visual-editor/internal/overlays/edit-icon.d.ts +0 -1
  553. package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.d.ts +11 -2
  554. package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.js +18 -7
  555. package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.js.map +1 -1
  556. package/dist/visual-editor/internal/overlays/iframe-wrapper.d.ts +0 -1
  557. package/dist/visual-editor/internal/overlays/iframe-wrapper.js +1 -1
  558. package/dist/visual-editor/internal/overlays/iframe-wrapper.js.map +1 -1
  559. package/dist/visual-editor/internal/overlays/menu/menu-wrapper.d.ts +12 -3
  560. package/dist/visual-editor/internal/overlays/menu/menu-wrapper.js +14 -5
  561. package/dist/visual-editor/internal/overlays/menu/menu-wrapper.js.map +1 -1
  562. package/dist/visual-editor/internal/overlays/node/node-metadata.d.ts +4 -2
  563. package/dist/visual-editor/internal/overlays/node/node-metadata.js +10 -4
  564. package/dist/visual-editor/internal/overlays/node/node-metadata.js.map +1 -1
  565. package/dist/visual-editor/internal/overlays/node/node-wrapper.d.ts +5 -3
  566. package/dist/visual-editor/internal/overlays/node/node-wrapper.js +4 -2
  567. package/dist/visual-editor/internal/overlays/node/node-wrapper.js.map +1 -1
  568. package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.d.ts +11 -2
  569. package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.js +18 -7
  570. package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.js.map +1 -1
  571. package/dist/visual-editor/internal/revalidate-route.d.ts +0 -1
  572. package/dist/visual-editor/internal/revalidate-route.js +1 -1
  573. package/dist/visual-editor/internal/revalidate-route.js.map +1 -1
  574. package/dist/visual-editor/server.d.ts +6 -7
  575. package/dist/visual-editor/server.js +6 -6
  576. package/dist/visual-editor/server.js.map +1 -1
  577. package/package.json +19 -3
  578. package/dist/auth/index.d.ts.map +0 -1
  579. package/dist/auth/internal/config.d.ts.map +0 -1
  580. package/dist/auth/internal/draft-mode.d.ts.map +0 -1
  581. package/dist/auth/internal/editor-locale.d.ts.map +0 -1
  582. package/dist/auth/internal/handoff.d.ts.map +0 -1
  583. package/dist/auth/internal/has-session.d.ts.map +0 -1
  584. package/dist/auth/internal/logout.d.ts.map +0 -1
  585. package/dist/auth/internal/next-cookie-storage.d.ts.map +0 -1
  586. package/dist/auth/internal/nodehive-client.d.ts.map +0 -1
  587. package/dist/auth/internal/oauth-config.d.ts.map +0 -1
  588. package/dist/auth/internal/proxy-helpers.d.ts.map +0 -1
  589. package/dist/auth/internal/refresh.d.ts.map +0 -1
  590. package/dist/auth/internal/require-auth.d.ts.map +0 -1
  591. package/dist/auth/internal/return-to.d.ts.map +0 -1
  592. package/dist/auth/internal/routes/callback.d.ts.map +0 -1
  593. package/dist/auth/internal/routes/chips-exchange.d.ts.map +0 -1
  594. package/dist/auth/internal/routes/draft.d.ts.map +0 -1
  595. package/dist/auth/internal/routes/index.d.ts.map +0 -1
  596. package/dist/auth/internal/routes/login.d.ts.map +0 -1
  597. package/dist/auth/internal/routes/popup-done.d.ts.map +0 -1
  598. package/dist/auth/internal/routes/refresh.d.ts.map +0 -1
  599. package/dist/auth/internal/same-origin.d.ts.map +0 -1
  600. package/dist/auth/internal/session-gates.d.ts.map +0 -1
  601. package/dist/auth/internal/update-session.d.ts.map +0 -1
  602. package/dist/auth/internal/use-editor-login.d.ts.map +0 -1
  603. package/dist/auth/proxy.d.ts.map +0 -1
  604. package/dist/auth/react.d.ts.map +0 -1
  605. package/dist/auth/routes.d.ts.map +0 -1
  606. package/dist/auth/server.d.ts.map +0 -1
  607. package/dist/puck-editor/fields.d.ts.map +0 -1
  608. package/dist/puck-editor/index.d.ts.map +0 -1
  609. package/dist/puck-editor/internal/api/client.d.ts.map +0 -1
  610. package/dist/puck-editor/internal/api/config.d.ts.map +0 -1
  611. package/dist/puck-editor/internal/api/create-puck-api.d.ts.map +0 -1
  612. package/dist/puck-editor/internal/api/handlers/create-page.d.ts.map +0 -1
  613. package/dist/puck-editor/internal/api/handlers/entities.d.ts.map +0 -1
  614. package/dist/puck-editor/internal/api/handlers/publish.d.ts.map +0 -1
  615. package/dist/puck-editor/internal/api/handlers/template.d.ts.map +0 -1
  616. package/dist/puck-editor/internal/api/handlers/upload.d.ts.map +0 -1
  617. package/dist/puck-editor/internal/api/media-params.d.ts.map +0 -1
  618. package/dist/puck-editor/internal/api/media-upload.d.ts.map +0 -1
  619. package/dist/puck-editor/internal/api/space.d.ts.map +0 -1
  620. package/dist/puck-editor/internal/content-model.d.ts.map +0 -1
  621. package/dist/puck-editor/internal/editor/allowed-types.d.ts.map +0 -1
  622. package/dist/puck-editor/internal/editor/canvas-add-picker.d.ts.map +0 -1
  623. package/dist/puck-editor/internal/editor/canvas-empty-state.d.ts.map +0 -1
  624. package/dist/puck-editor/internal/editor/canvas-quick-add.d.ts.map +0 -1
  625. package/dist/puck-editor/internal/editor/canvas-scroll.d.ts.map +0 -1
  626. package/dist/puck-editor/internal/editor/component-icons.d.ts.map +0 -1
  627. package/dist/puck-editor/internal/editor/component-item.d.ts.map +0 -1
  628. package/dist/puck-editor/internal/editor/editor-action-bar.d.ts.map +0 -1
  629. package/dist/puck-editor/internal/editor/editor-header-actions.d.ts.map +0 -1
  630. package/dist/puck-editor/internal/editor/find-missing-required-fields.d.ts.map +0 -1
  631. package/dist/puck-editor/internal/editor/grouped-drawer-panel.d.ts.map +0 -1
  632. package/dist/puck-editor/internal/editor/grouped-entry-list.d.ts.map +0 -1
  633. package/dist/puck-editor/internal/editor/header-save-button.d.ts.map +0 -1
  634. package/dist/puck-editor/internal/editor/page-template-picker.d.ts.map +0 -1
  635. package/dist/puck-editor/internal/editor/picker-entry-item.d.ts.map +0 -1
  636. package/dist/puck-editor/internal/editor/picker-model.d.ts.map +0 -1
  637. package/dist/puck-editor/internal/editor/publish-puck-data.d.ts.map +0 -1
  638. package/dist/puck-editor/internal/editor/puck-editor.d.ts.map +0 -1
  639. package/dist/puck-editor/internal/editor/section-template-modal.d.ts.map +0 -1
  640. package/dist/puck-editor/internal/editor/use-scroll-lock-outside.d.ts.map +0 -1
  641. package/dist/puck-editor/internal/editor-config.d.ts.map +0 -1
  642. package/dist/puck-editor/internal/editor-query-client.d.ts.map +0 -1
  643. package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.d.ts.map +0 -1
  644. package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.d.ts.map +0 -1
  645. package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.d.ts.map +0 -1
  646. package/dist/puck-editor/internal/fields/date-picker/date-picker.d.ts.map +0 -1
  647. package/dist/puck-editor/internal/fields/index.d.ts.map +0 -1
  648. package/dist/puck-editor/internal/fields/link-picker/anchor.d.ts.map +0 -1
  649. package/dist/puck-editor/internal/fields/link-picker/create-link-field.d.ts.map +0 -1
  650. package/dist/puck-editor/internal/fields/link-picker/humanize.d.ts.map +0 -1
  651. package/dist/puck-editor/internal/fields/link-picker/link-picker-control.d.ts.map +0 -1
  652. package/dist/puck-editor/internal/fields/link-picker/link-picker-field.d.ts.map +0 -1
  653. package/dist/puck-editor/internal/fields/link-picker/link-value.d.ts.map +0 -1
  654. package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.d.ts.map +0 -1
  655. package/dist/puck-editor/internal/fields/link-picker/richtext-extensions.d.ts.map +0 -1
  656. package/dist/puck-editor/internal/fields/link-picker/segmented-control.d.ts.map +0 -1
  657. package/dist/puck-editor/internal/fields/link-picker/types.d.ts.map +0 -1
  658. package/dist/puck-editor/internal/fields/media-array/create-media-array-field.d.ts.map +0 -1
  659. package/dist/puck-editor/internal/fields/media-array/media-array-field.d.ts.map +0 -1
  660. package/dist/puck-editor/internal/fields/media-array/reorder.d.ts.map +0 -1
  661. package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.d.ts.map +0 -1
  662. package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.d.ts.map +0 -1
  663. package/dist/puck-editor/internal/fields/media-selector/crop-types.d.ts.map +0 -1
  664. package/dist/puck-editor/internal/fields/media-selector/extract-fields.d.ts.map +0 -1
  665. package/dist/puck-editor/internal/fields/media-selector/image-upload-form.d.ts.map +0 -1
  666. package/dist/puck-editor/internal/fields/media-selector/media-selector-field.d.ts.map +0 -1
  667. package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.d.ts.map +0 -1
  668. package/dist/puck-editor/internal/fields/media-selector/use-debounced-value.d.ts.map +0 -1
  669. package/dist/puck-editor/internal/fields/media-selector/use-media-library.d.ts.map +0 -1
  670. package/dist/puck-editor/internal/fields/media-selector/video-upload-form.d.ts.map +0 -1
  671. package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.d.ts.map +0 -1
  672. package/dist/puck-editor/internal/fields/required-field-label.d.ts.map +0 -1
  673. package/dist/puck-editor/internal/fields/required.d.ts.map +0 -1
  674. package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.d.ts.map +0 -1
  675. package/dist/puck-editor/internal/i18n.d.ts.map +0 -1
  676. package/dist/puck-editor/internal/locale.d.ts.map +0 -1
  677. package/dist/puck-editor/internal/localize.d.ts.map +0 -1
  678. package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.d.ts.map +0 -1
  679. package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.d.ts.map +0 -1
  680. package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.d.ts.map +0 -1
  681. package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.d.ts.map +0 -1
  682. package/dist/puck-editor/internal/plugins/agent-plugin/catalog.d.ts.map +0 -1
  683. package/dist/puck-editor/internal/plugins/agent-plugin/constants.d.ts.map +0 -1
  684. package/dist/puck-editor/internal/plugins/agent-plugin/create-page.d.ts.map +0 -1
  685. package/dist/puck-editor/internal/plugins/agent-plugin/find-component-location.d.ts.map +0 -1
  686. package/dist/puck-editor/internal/plugins/agent-plugin/help.d.ts.map +0 -1
  687. package/dist/puck-editor/internal/plugins/agent-plugin/index.d.ts.map +0 -1
  688. package/dist/puck-editor/internal/plugins/agent-plugin/list-media.d.ts.map +0 -1
  689. package/dist/puck-editor/internal/plugins/agent-plugin/templates.d.ts.map +0 -1
  690. package/dist/puck-editor/internal/plugins/agent-plugin/upload-media.d.ts.map +0 -1
  691. package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.d.ts.map +0 -1
  692. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.d.ts.map +0 -1
  693. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.d.ts.map +0 -1
  694. package/dist/puck-editor/internal/plugins/blocks-plugin/index.d.ts.map +0 -1
  695. package/dist/puck-editor/internal/plugins/outline-plugin/index.d.ts.map +0 -1
  696. package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.d.ts.map +0 -1
  697. package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.d.ts.map +0 -1
  698. package/dist/puck-editor/internal/plugins/outline-plugin/outline-tree.d.ts.map +0 -1
  699. package/dist/puck-editor/internal/plugins/sections-plugin/index.d.ts.map +0 -1
  700. package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.d.ts.map +0 -1
  701. package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.d.ts.map +0 -1
  702. package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.d.ts.map +0 -1
  703. package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.d.ts.map +0 -1
  704. package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.d.ts.map +0 -1
  705. package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.d.ts.map +0 -1
  706. package/dist/puck-editor/internal/plugins/templates-plugin/index.d.ts.map +0 -1
  707. package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.d.ts.map +0 -1
  708. package/dist/puck-editor/internal/plugins/templates-plugin/template-form.d.ts.map +0 -1
  709. package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.d.ts.map +0 -1
  710. package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.d.ts.map +0 -1
  711. package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.d.ts.map +0 -1
  712. package/dist/puck-editor/internal/plugins/templates-plugin/templates.d.ts.map +0 -1
  713. package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.d.ts.map +0 -1
  714. package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.d.ts.map +0 -1
  715. package/dist/puck-editor/internal/puck-augmentation.d.ts.map +0 -1
  716. package/dist/puck-editor/internal/puck-editor-provider.d.ts.map +0 -1
  717. package/dist/puck-editor/internal/puck-node.d.ts.map +0 -1
  718. package/dist/puck-editor/internal/puck-wrapper.d.ts.map +0 -1
  719. package/dist/puck-editor/internal/render/cropped-image.d.ts.map +0 -1
  720. package/dist/puck-editor/internal/smart-actions/index.d.ts.map +0 -1
  721. package/dist/puck-editor/internal/smart-actions/new-page.d.ts.map +0 -1
  722. package/dist/puck-editor/internal/smart-actions/open-puck-editor.d.ts.map +0 -1
  723. package/dist/puck-editor/internal/ui/calendar.d.ts.map +0 -1
  724. package/dist/puck-editor/internal/ui/component-list-accordion.d.ts.map +0 -1
  725. package/dist/puck-editor/internal/ui/dialog.d.ts.map +0 -1
  726. package/dist/puck-editor/internal/ui/drawer-item-content.d.ts.map +0 -1
  727. package/dist/puck-editor/internal/ui/icon-button.d.ts.map +0 -1
  728. package/dist/puck-editor/internal/ui/popover.d.ts.map +0 -1
  729. package/dist/puck-editor/internal/ui/required-mark.d.ts.map +0 -1
  730. package/dist/puck-editor/internal/ui/search-control.d.ts.map +0 -1
  731. package/dist/puck-editor/internal/ui/use-panel-search-focus.d.ts.map +0 -1
  732. package/dist/puck-editor/internal/use-puck-overlay.d.ts.map +0 -1
  733. package/dist/puck-editor/internal/utils.d.ts.map +0 -1
  734. package/dist/puck-editor/render.d.ts.map +0 -1
  735. package/dist/puck-editor/server.d.ts.map +0 -1
  736. package/dist/puck-editor/smart-actions.d.ts.map +0 -1
  737. package/dist/shared/cn.d.ts.map +0 -1
  738. package/dist/shared/i18n.d.ts.map +0 -1
  739. package/dist/shared/toolbar-action.d.ts.map +0 -1
  740. package/dist/shared/use-is-hydrated.d.ts.map +0 -1
  741. package/dist/shared/use-is-in-iframe.d.ts.map +0 -1
  742. package/dist/smart-actions/internal/get-smart-actions-context.d.ts.map +0 -1
  743. package/dist/smart-actions/internal/i18n.d.ts.map +0 -1
  744. package/dist/smart-actions/internal/logout-form.d.ts.map +0 -1
  745. package/dist/smart-actions/internal/refresh-page.d.ts.map +0 -1
  746. package/dist/smart-actions/internal/smart-actions-button.d.ts.map +0 -1
  747. package/dist/smart-actions/internal/smart-actions-config.d.ts.map +0 -1
  748. package/dist/smart-actions/internal/smart-actions-toolbar-client.d.ts.map +0 -1
  749. package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.d.ts.map +0 -1
  750. package/dist/smart-actions/internal/toolbar/storage.d.ts.map +0 -1
  751. package/dist/smart-actions/internal/toolbar/types.d.ts.map +0 -1
  752. package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.d.ts.map +0 -1
  753. package/dist/smart-actions/internal/ui/tooltip.d.ts.map +0 -1
  754. package/dist/smart-actions/internal/user-profile.d.ts.map +0 -1
  755. package/dist/smart-actions/server.d.ts.map +0 -1
  756. package/dist/visual-editor/index.d.ts.map +0 -1
  757. package/dist/visual-editor/internal/bridge/connector.d.ts.map +0 -1
  758. package/dist/visual-editor/internal/bridge/draft-mode-self-heal.d.ts.map +0 -1
  759. package/dist/visual-editor/internal/bridge/editor-auth-gate-server.d.ts.map +0 -1
  760. package/dist/visual-editor/internal/bridge/editor-auth-gate.d.ts.map +0 -1
  761. package/dist/visual-editor/internal/i18n.d.ts.map +0 -1
  762. package/dist/visual-editor/internal/overlays/drupal-origin.d.ts.map +0 -1
  763. package/dist/visual-editor/internal/overlays/edit-button.d.ts.map +0 -1
  764. package/dist/visual-editor/internal/overlays/edit-icon.d.ts.map +0 -1
  765. package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.d.ts.map +0 -1
  766. package/dist/visual-editor/internal/overlays/iframe-wrapper.d.ts.map +0 -1
  767. package/dist/visual-editor/internal/overlays/menu/menu-wrapper.d.ts.map +0 -1
  768. package/dist/visual-editor/internal/overlays/node/node-metadata.d.ts.map +0 -1
  769. package/dist/visual-editor/internal/overlays/node/node-wrapper.d.ts.map +0 -1
  770. package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.d.ts.map +0 -1
  771. package/dist/visual-editor/internal/revalidate-route.d.ts.map +0 -1
  772. package/dist/visual-editor/server.d.ts.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import { type ReactNode } from 'react';
2
- import { type PuckDictionaryOverrides } from './i18n';
3
- import '../puck-theme.css';
2
+ import { type PuckDictionaryOverrides } from './i18n.js';
4
3
  import { Config, Overrides, Plugin } from '@puckeditor/core';
5
- import { type PuckEditorConfig } from './editor-config';
6
- import { PuckNode } from './puck-node';
4
+ import { type PuckEditorConfig } from './editor-config.js';
5
+ import { PuckNode } from './puck-node.js';
6
+ import type { PuckOnAction, PuckPassthroughProps, PuckValidate } from './puck-props.js';
7
7
  type PuckWrapperProps = {
8
8
  node: PuckNode;
9
9
  config: Config;
@@ -12,8 +12,27 @@ type PuckWrapperProps = {
12
12
  dictionaryOverrides?: PuckDictionaryOverrides;
13
13
  plugins?: (defaultPlugins: Plugin[]) => Plugin[];
14
14
  overrides?: Partial<Overrides>;
15
+ /** Called after the module's internal action handling. */
16
+ onAction?: PuckOnAction;
17
+ /**
18
+ * Custom validation run on save, composed after the built-in required-field
19
+ * check. Returning one or more issues blocks the publish and surfaces them in
20
+ * the editor toast.
21
+ */
22
+ validate?: PuckValidate;
23
+ /**
24
+ * Remaining <Puck> props, spread before the module-managed ones (managed
25
+ * props always win). Managed and therefore excluded: config, data, plugins,
26
+ * overrides, onAction, onPublish, renderHeader, renderHeaderActions.
27
+ */
28
+ puckProps?: PuckPassthroughProps;
15
29
  children: ReactNode;
16
30
  } & PuckEditorConfig;
17
- export default function PuckWrapper({ node, config, isLoggedIn, editorLocale, dictionaryOverrides, plugins, overrides, drupalBaseUrl, contentModel, builtinTemplates, children, }: PuckWrapperProps): import("react").JSX.Element | null;
31
+ /**
32
+ * Editor overlay shell for a Puck page.
33
+ *
34
+ * Requires the `sonner` (save/upload/template toasts) and `motion` (overlay
35
+ * animation) peers, alongside `@puckeditor/core`; see the module README.
36
+ */
37
+ export default function PuckWrapper({ node, config, isLoggedIn, editorLocale, dictionaryOverrides, plugins, overrides, onAction, validate, puckProps, drupalBaseUrl, contentModel, builtinTemplates, propTransforms, api, children, }: PuckWrapperProps): import("react").JSX.Element;
18
38
  export {};
19
- //# sourceMappingURL=puck-wrapper.d.ts.map
@@ -1,46 +1,28 @@
1
1
  'use client';
2
2
 
3
- function __transformExtension(filepath, extMapping) {
4
- if (!filepath.startsWith('./') && !filepath.startsWith('../')) {
5
- // Package import
6
- return filepath;
7
- }
8
- const idx = filepath.lastIndexOf('.');
9
- if (idx === -1 || filepath.includes('/', idx)) {
10
- // No extension
11
- const newExt = extMapping[''];
12
- if (newExt) {
13
- return filepath + newExt;
14
- }
15
- return filepath;
16
- }
17
- for (let [origExt, newExt] of Object.entries(extMapping).sort((a, b) => b[0].length - a[0].length)) {
18
- if (filepath.endsWith(origExt)) {
19
- return filepath.slice(0, -origExt.length) + newExt;
20
- }
21
- }
22
- return filepath;
23
- }
24
3
  import { c as _c } from "react/compiler-runtime";
25
4
  import dynamic from 'next/dynamic';
26
- import { PuckI18nProvider } from './i18n';
27
- import { usePuckOverlay } from './use-puck-overlay';
5
+ import { PuckI18nProvider } from "./i18n.js";
6
+ import { usePuckOverlay } from "./use-puck-overlay.js";
28
7
  import '../puck-theme.css';
29
8
  import { QueryClientProvider } from '@tanstack/react-query';
30
9
  import { motion } from 'motion/react';
31
- import { cn } from '../../shared/cn';
32
- import { getBundle, parsePuckData, resolveContentModel } from './content-model';
33
- import { PuckEditorConfigProvider } from './editor-config';
34
- import { getEditorQueryClient } from './editor-query-client';
35
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
36
- const LazyPuckEditor = dynamic(() => import(__transformExtension('./editor/puck-editor', {
37
- ".ts": ".js",
38
- ".tsx": ".js"
39
- })), {
10
+ import { cn } from "../../shared/cn.js";
11
+ import { getBundle, parsePuckData, resolveContentModel } from "./content-model.js";
12
+ import { PuckEditorConfigProvider } from "./editor-config.js";
13
+ import { getEditorQueryClient } from "./editor-query-client.js";
14
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
+ const LazyPuckEditor = dynamic(() => import("./editor/puck-editor.js"), {
40
16
  ssr: false
41
17
  });
18
+ /**
19
+ * Editor overlay shell for a Puck page.
20
+ *
21
+ * Requires the `sonner` (save/upload/template toasts) and `motion` (overlay
22
+ * animation) peers, alongside `@puckeditor/core`; see the module README.
23
+ */
42
24
  export default function PuckWrapper(t0) {
43
- const $ = _c(50);
25
+ const $ = _c(59);
44
26
  const {
45
27
  node,
46
28
  config,
@@ -49,9 +31,14 @@ export default function PuckWrapper(t0) {
49
31
  dictionaryOverrides,
50
32
  plugins,
51
33
  overrides,
34
+ onAction,
35
+ validate,
36
+ puckProps,
52
37
  drupalBaseUrl,
53
38
  contentModel,
54
39
  builtinTemplates,
40
+ propTransforms,
41
+ api,
55
42
  children
56
43
  } = t0;
57
44
  const editorLocale = t1 === undefined ? "en" : t1;
@@ -68,28 +55,30 @@ export default function PuckWrapper(t0) {
68
55
  const fieldName = bundle?.dataField ?? "";
69
56
  const puckField = bundle ? node[fieldName] : "";
70
57
  let t3;
71
- if ($[3] !== node.id || $[4] !== puckField) {
72
- t3 = parsePuckData(puckField, node.id);
73
- $[3] = node.id;
74
- $[4] = puckField;
75
- $[5] = t3;
58
+ if ($[3] !== config || $[4] !== node.id || $[5] !== propTransforms || $[6] !== puckField) {
59
+ t3 = parsePuckData(puckField, node.id, propTransforms, config);
60
+ $[3] = config;
61
+ $[4] = node.id;
62
+ $[5] = propTransforms;
63
+ $[6] = puckField;
64
+ $[7] = t3;
76
65
  } else {
77
- t3 = $[5];
66
+ t3 = $[7];
78
67
  }
79
68
  const puckData = t3;
80
69
  let t4;
81
- if ($[6] !== fieldName || $[7] !== isLoggedIn || $[8] !== node) {
70
+ if ($[8] !== fieldName || $[9] !== isLoggedIn || $[10] !== node) {
82
71
  t4 = {
83
72
  node,
84
73
  fieldName,
85
74
  isLoggedIn
86
75
  };
87
- $[6] = fieldName;
88
- $[7] = isLoggedIn;
89
- $[8] = node;
90
- $[9] = t4;
76
+ $[8] = fieldName;
77
+ $[9] = isLoggedIn;
78
+ $[10] = node;
79
+ $[11] = t4;
91
80
  } else {
92
- t4 = $[9];
81
+ t4 = $[11];
93
82
  }
94
83
  const {
95
84
  isEditMode,
@@ -99,93 +88,107 @@ export default function PuckWrapper(t0) {
99
88
  isHighlighted
100
89
  } = usePuckOverlay(t4);
101
90
  if (!bundle) {
102
- console.error(`puck-editor: no bundle configured for node type "${node.type}"`);
103
- return null;
91
+ console.error(`puck-editor: no bundle configured for node type "${node.type}"; rendering page without editor`);
92
+ let t5;
93
+ if ($[12] !== children) {
94
+ t5 = /*#__PURE__*/_jsx(_Fragment, {
95
+ children: children
96
+ });
97
+ $[12] = children;
98
+ $[13] = t5;
99
+ } else {
100
+ t5 = $[13];
101
+ }
102
+ return t5;
104
103
  }
105
104
  let t5;
106
- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
105
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
107
106
  t5 = getEditorQueryClient();
108
- $[10] = t5;
107
+ $[14] = t5;
109
108
  } else {
110
- t5 = $[10];
109
+ t5 = $[14];
111
110
  }
112
111
  let t6;
113
- if ($[11] !== builtinTemplates || $[12] !== contentModel || $[13] !== drupalBaseUrl) {
112
+ if ($[15] !== api || $[16] !== builtinTemplates || $[17] !== contentModel || $[18] !== drupalBaseUrl || $[19] !== propTransforms) {
114
113
  t6 = {
115
114
  drupalBaseUrl,
116
115
  contentModel,
117
- builtinTemplates
116
+ builtinTemplates,
117
+ propTransforms,
118
+ api
118
119
  };
119
- $[11] = builtinTemplates;
120
- $[12] = contentModel;
121
- $[13] = drupalBaseUrl;
122
- $[14] = t6;
120
+ $[15] = api;
121
+ $[16] = builtinTemplates;
122
+ $[17] = contentModel;
123
+ $[18] = drupalBaseUrl;
124
+ $[19] = propTransforms;
125
+ $[20] = t6;
123
126
  } else {
124
- t6 = $[14];
127
+ t6 = $[20];
125
128
  }
126
129
  let t7;
127
- if ($[15] !== isHighlighted) {
130
+ if ($[21] !== isHighlighted) {
128
131
  t7 = cn("nh:relative nh:-outline-offset-1", {
129
132
  "nh:outline-1 nh:outline-(--nh-primary) nh:outline-dashed": isHighlighted
130
133
  });
131
- $[15] = isHighlighted;
132
- $[16] = t7;
134
+ $[21] = isHighlighted;
135
+ $[22] = t7;
133
136
  } else {
134
- t7 = $[16];
137
+ t7 = $[22];
135
138
  }
136
139
  let t8;
137
- if ($[17] !== children || $[18] !== t7) {
140
+ if ($[23] !== children || $[24] !== t7) {
138
141
  t8 = /*#__PURE__*/_jsx("div", {
139
142
  className: t7,
140
143
  children: children
141
144
  });
142
- $[17] = children;
143
- $[18] = t7;
144
- $[19] = t8;
145
+ $[23] = children;
146
+ $[24] = t7;
147
+ $[25] = t8;
145
148
  } else {
146
- t8 = $[19];
149
+ t8 = $[25];
147
150
  }
148
151
  let t9;
149
- if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
152
+ if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
150
153
  t9 = {
151
154
  y: "100%"
152
155
  };
153
- $[20] = t9;
156
+ $[26] = t9;
154
157
  } else {
155
- t9 = $[20];
158
+ t9 = $[26];
156
159
  }
157
160
  const t10 = isEditMode ? 0 : "100%";
158
161
  let t11;
159
- if ($[21] !== t10) {
162
+ if ($[27] !== t10) {
160
163
  t11 = {
161
164
  y: t10
162
165
  };
163
- $[21] = t10;
164
- $[22] = t11;
166
+ $[27] = t10;
167
+ $[28] = t11;
165
168
  } else {
166
- t11 = $[22];
169
+ t11 = $[28];
167
170
  }
168
171
  let t12;
169
- if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
172
+ if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
170
173
  t12 = {
171
174
  duration: 0.3,
172
175
  ease: "easeInOut"
173
176
  };
174
- $[23] = t12;
177
+ $[29] = t12;
175
178
  } else {
176
- t12 = $[23];
179
+ t12 = $[29];
177
180
  }
178
181
  let t13;
179
- if ($[24] !== isEditMode || $[25] !== setIsEditorReady) {
182
+ if ($[30] !== isEditMode || $[31] !== setIsEditorReady) {
180
183
  t13 = () => setIsEditorReady(isEditMode);
181
- $[24] = isEditMode;
182
- $[25] = setIsEditorReady;
183
- $[26] = t13;
184
+ $[30] = isEditMode;
185
+ $[31] = setIsEditorReady;
186
+ $[32] = t13;
184
187
  } else {
185
- t13 = $[26];
188
+ t13 = $[32];
186
189
  }
187
190
  let t14;
188
- if ($[27] !== closeEditor || $[28] !== config || $[29] !== fieldName || $[30] !== isEditorReady || $[31] !== node || $[32] !== overrides || $[33] !== plugins || $[34] !== puckData) {
191
+ if ($[33] !== closeEditor || $[34] !== config || $[35] !== fieldName || $[36] !== isEditorReady || $[37] !== node || $[38] !== onAction || $[39] !== overrides || $[40] !== plugins || $[41] !== puckData || $[42] !== puckProps || $[43] !== validate) {
189
192
  t14 = isEditorReady && /*#__PURE__*/_jsx(LazyPuckEditor, {
190
193
  fieldName: fieldName,
191
194
  node: node,
@@ -193,22 +196,28 @@ export default function PuckWrapper(t0) {
193
196
  config: config,
194
197
  closePuckEditor: closeEditor,
195
198
  plugins: plugins,
196
- overrides: overrides
199
+ overrides: overrides,
200
+ onAction: onAction,
201
+ validate: validate,
202
+ puckProps: puckProps
197
203
  }, `puck-editor-${fieldName}`);
198
- $[27] = closeEditor;
199
- $[28] = config;
200
- $[29] = fieldName;
201
- $[30] = isEditorReady;
202
- $[31] = node;
203
- $[32] = overrides;
204
- $[33] = plugins;
205
- $[34] = puckData;
206
- $[35] = t14;
204
+ $[33] = closeEditor;
205
+ $[34] = config;
206
+ $[35] = fieldName;
207
+ $[36] = isEditorReady;
208
+ $[37] = node;
209
+ $[38] = onAction;
210
+ $[39] = overrides;
211
+ $[40] = plugins;
212
+ $[41] = puckData;
213
+ $[42] = puckProps;
214
+ $[43] = validate;
215
+ $[44] = t14;
207
216
  } else {
208
- t14 = $[35];
217
+ t14 = $[44];
209
218
  }
210
219
  let t15;
211
- if ($[36] !== t11 || $[37] !== t13 || $[38] !== t14) {
220
+ if ($[45] !== t11 || $[46] !== t13 || $[47] !== t14) {
212
221
  t15 = /*#__PURE__*/_jsx(motion.div, {
213
222
  "data-puck-editor-overlay": true,
214
223
  className: "nh-root nh:fixed nh:inset-0 nh:z-50 nh:border nh:border-t nh:border-b nh:border-gray-300 nh:bg-white",
@@ -218,40 +227,40 @@ export default function PuckWrapper(t0) {
218
227
  onAnimationComplete: t13,
219
228
  children: t14
220
229
  });
221
- $[36] = t11;
222
- $[37] = t13;
223
- $[38] = t14;
224
- $[39] = t15;
230
+ $[45] = t11;
231
+ $[46] = t13;
232
+ $[47] = t14;
233
+ $[48] = t15;
225
234
  } else {
226
- t15 = $[39];
235
+ t15 = $[48];
227
236
  }
228
237
  let t16;
229
- if ($[40] !== t15 || $[41] !== t8) {
238
+ if ($[49] !== t15 || $[50] !== t8) {
230
239
  t16 = /*#__PURE__*/_jsxs("div", {
231
240
  children: [t8, t15]
232
241
  });
233
- $[40] = t15;
234
- $[41] = t8;
235
- $[42] = t16;
242
+ $[49] = t15;
243
+ $[50] = t8;
244
+ $[51] = t16;
236
245
  } else {
237
- t16 = $[42];
246
+ t16 = $[51];
238
247
  }
239
248
  let t17;
240
- if ($[43] !== dictionaryOverrides || $[44] !== editorLocale || $[45] !== t16) {
249
+ if ($[52] !== dictionaryOverrides || $[53] !== editorLocale || $[54] !== t16) {
241
250
  t17 = /*#__PURE__*/_jsx(PuckI18nProvider, {
242
251
  locale: editorLocale,
243
252
  overrides: dictionaryOverrides,
244
253
  children: t16
245
254
  });
246
- $[43] = dictionaryOverrides;
247
- $[44] = editorLocale;
248
- $[45] = t16;
249
- $[46] = t17;
255
+ $[52] = dictionaryOverrides;
256
+ $[53] = editorLocale;
257
+ $[54] = t16;
258
+ $[55] = t17;
250
259
  } else {
251
- t17 = $[46];
260
+ t17 = $[55];
252
261
  }
253
262
  let t18;
254
- if ($[47] !== t17 || $[48] !== t6) {
263
+ if ($[56] !== t17 || $[57] !== t6) {
255
264
  t18 = /*#__PURE__*/_jsx(QueryClientProvider, {
256
265
  client: t5,
257
266
  children: /*#__PURE__*/_jsx(PuckEditorConfigProvider, {
@@ -259,11 +268,11 @@ export default function PuckWrapper(t0) {
259
268
  children: t17
260
269
  })
261
270
  });
262
- $[47] = t17;
263
- $[48] = t6;
264
- $[49] = t18;
271
+ $[56] = t17;
272
+ $[57] = t6;
273
+ $[58] = t18;
265
274
  } else {
266
- t18 = $[49];
275
+ t18 = $[58];
267
276
  }
268
277
  return t18;
269
278
  }
@@ -1 +1 @@
1
- {"version":3,"file":"puck-wrapper.js","names":["__transformExtension","filepath","extMapping","startsWith","idx","lastIndexOf","includes","newExt","origExt","Object","entries","sort","a","b","length","endsWith","slice","c","_c","dynamic","PuckI18nProvider","usePuckOverlay","QueryClientProvider","motion","cn","getBundle","parsePuckData","resolveContentModel","PuckEditorConfigProvider","getEditorQueryClient","jsx","_jsx","jsxs","_jsxs","LazyPuckEditor","ssr","PuckWrapper","t0","$","node","config","isLoggedIn","editorLocale","t1","dictionaryOverrides","plugins","overrides","drupalBaseUrl","contentModel","builtinTemplates","children","undefined","t2","type","bundle","fieldName","dataField","puckField","t3","id","puckData","t4","isEditMode","isEditorReady","setIsEditorReady","closeEditor","isHighlighted","console","error","t5","Symbol","for","t6","t7","t8","className","t9","y","t10","t11","t12","duration","ease","t13","t14","t15","div","initial","animate","transition","onAnimationComplete","t16","t17","t18","client"],"sources":["../../../src/puck-editor/internal/puck-wrapper.tsx"],"sourcesContent":["'use client';\n\nimport { type ReactNode } from 'react';\nimport dynamic from 'next/dynamic';\n\nimport { PuckI18nProvider, type PuckDictionaryOverrides } from './i18n';\nimport { usePuckOverlay } from './use-puck-overlay';\n\nimport '../puck-theme.css';\n\nimport { Config, Overrides, Plugin } from '@puckeditor/core';\nimport { QueryClientProvider } from '@tanstack/react-query';\nimport { motion } from 'motion/react';\n\nimport { cn } from '../../shared/cn';\nimport { getBundle, parsePuckData, resolveContentModel } from './content-model';\nimport {\n PuckEditorConfigProvider,\n type PuckEditorConfig,\n} from './editor-config';\nimport { getEditorQueryClient } from './editor-query-client';\nimport { PuckNode } from './puck-node';\n\nconst LazyPuckEditor = dynamic(() => import('./editor/puck-editor'), {\n ssr: false,\n});\n\ntype PuckWrapperProps = {\n node: PuckNode;\n config: Config;\n isLoggedIn: boolean;\n editorLocale?: string;\n dictionaryOverrides?: PuckDictionaryOverrides;\n plugins?: (defaultPlugins: Plugin[]) => Plugin[];\n overrides?: Partial<Overrides>;\n children: ReactNode;\n} & PuckEditorConfig;\n\nexport default function PuckWrapper({\n node,\n config,\n isLoggedIn,\n editorLocale = 'en',\n dictionaryOverrides,\n plugins,\n overrides,\n drupalBaseUrl,\n contentModel,\n builtinTemplates,\n children,\n}: PuckWrapperProps) {\n const bundle = getBundle(resolveContentModel(contentModel), node.type);\n const fieldName = bundle?.dataField ?? '';\n const puckField = bundle ? (node[fieldName] as string) : '';\n const puckData = parsePuckData(puckField, node.id);\n const {\n isEditMode,\n isEditorReady,\n setIsEditorReady,\n closeEditor,\n isHighlighted,\n } = usePuckOverlay({ node, fieldName, isLoggedIn });\n\n if (!bundle) {\n console.error(\n `puck-editor: no bundle configured for node type \"${node.type}\"`\n );\n return null;\n }\n\n return (\n <QueryClientProvider client={getEditorQueryClient()}>\n <PuckEditorConfigProvider\n config={{ drupalBaseUrl, contentModel, builtinTemplates }}\n >\n <PuckI18nProvider locale={editorLocale} overrides={dictionaryOverrides}>\n <div>\n <div\n className={cn('nh:relative nh:-outline-offset-1', {\n 'nh:outline-1 nh:outline-(--nh-primary) nh:outline-dashed':\n isHighlighted,\n })}\n >\n {children}\n </div>\n <motion.div\n data-puck-editor-overlay\n className=\"nh-root nh:fixed nh:inset-0 nh:z-50 nh:border nh:border-t nh:border-b nh:border-gray-300 nh:bg-white\"\n initial={{ y: '100%' }}\n animate={{ y: isEditMode ? 0 : '100%' }}\n transition={{\n duration: 0.3,\n ease: 'easeInOut',\n }}\n onAnimationComplete={() => setIsEditorReady(isEditMode)}\n >\n {isEditorReady && (\n <LazyPuckEditor\n key={`puck-editor-${fieldName}`}\n fieldName={fieldName}\n node={node}\n data={puckData}\n config={config}\n closePuckEditor={closeEditor}\n plugins={plugins}\n overrides={overrides}\n />\n )}\n </motion.div>\n </div>\n </PuckI18nProvider>\n </PuckEditorConfigProvider>\n </QueryClientProvider>\n );\n}\n"],"mappings":"AAAA,YAAY;;AAAX,SAASA,oBAAoBA,CAACC,QAAQ,EAAEC,UAAU,EAAE;EACnD,IAAG,CAACD,QAAQ,CAACE,UAAU,CAAC,IAAI,CAAC,IAAI,CAACF,QAAQ,CAACE,UAAU,CAAC,KAAK,CAAC,EAAE;IAC5D;IACA,OAAOF,QAAQ;EACjB;EAEA,MAAMG,GAAG,GAAGH,QAAQ,CAACI,WAAW,CAAC,GAAG,CAAC;EACrC,IAAGD,GAAG,KAAK,CAAC,CAAC,IAAIH,QAAQ,CAACK,QAAQ,CAAC,GAAG,EAAEF,GAAG,CAAC,EAAE;IAC5C;IACA,MAAMG,MAAM,GAAGL,UAAU,CAAC,EAAE,CAAC;IAC7B,IAAGK,MAAM,EAAE;MACT,OAAON,QAAQ,GAAGM,MAAM;IAC1B;IACA,OAAON,QAAQ;EACjB;EAEA,KAAI,IAAI,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EAOM,EACNW,GAuBa;IAAA,CACV,CAAC;IAAA/C,CAAA,OAAA+C,GAAA;IAAA/C,CAAA,OAAAoC,EAAA;IAAApC,CAAA,OAAAqD,GAAA;EAAA;IAAAA,GAAA,GAAArD,CAAA;EAAA;EAAA,IAAAsD,GAAA;EAAA,IAAAtD,CAAA,SAAAM,mBAAA,IAAAN,CAAA,SAAAI,YAAA,IAAAJ,CAAA,SAAAqD,GAAA;IAlCRC,GAAA,gBAAA7D,IAAA,CAACX,gBAAgB;MAASsB,MAAY,EAAZA,YAAY;MAAaE,SAAmB,EAAnBA,mBAAmB;MAAAM,QAAA,EACpEyC;IAiCM,CACU,CAAC;IAAArD,CAAA,OAAAM,mBAAA;IAAAN,CAAA,OAAAI,YAAA;IAAAJ,CAAA,OAAAqD,GAAA;IAAArD,CAAA,OAAAsD,GAAA;EAAA;IAAAA,GAAA,GAAAtD,CAAA;EAAA;EAAA,IAAAuD,GAAA;EAAA,IAAAvD,CAAA,SAAAsD,GAAA,IAAAtD,CAAA,SAAAkC,EAAA;IAvCvBqB,GAAA,gBAAA9D,IAAA,CAACT,mBAAmB;MAASwE,MAAsB,EAAtBzB,EAAsB;MAAAnB,QAAA,eACjDnB,IAAA,CAACH,wBAAwB;QACfY,MAAiD,EAAjDgC,EAAiD;QAAAtB,QAAA,EAEzD0C;MAmCmB,CACK;IAAC,CACR,CAAC;IAAAtD,CAAA,OAAAsD,GAAA;IAAAtD,CAAA,OAAAkC,EAAA;IAAAlC,CAAA,OAAAuD,GAAA;EAAA;IAAAA,GAAA,GAAAvD,CAAA;EAAA;EAAA,OAzCtBuD,GAyCsB;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"puck-wrapper.js","names":["c","_c","dynamic","PuckI18nProvider","usePuckOverlay","QueryClientProvider","motion","cn","getBundle","parsePuckData","resolveContentModel","PuckEditorConfigProvider","getEditorQueryClient","Fragment","_Fragment","jsx","_jsx","jsxs","_jsxs","LazyPuckEditor","ssr","PuckWrapper","t0","$","node","config","isLoggedIn","editorLocale","t1","dictionaryOverrides","plugins","overrides","onAction","validate","puckProps","drupalBaseUrl","contentModel","builtinTemplates","propTransforms","api","children","undefined","t2","type","bundle","fieldName","dataField","puckField","t3","id","puckData","t4","isEditMode","isEditorReady","setIsEditorReady","closeEditor","isHighlighted","console","error","t5","Symbol","for","t6","t7","t8","className","t9","y","t10","t11","t12","duration","ease","t13","t14","t15","div","initial","animate","transition","onAnimationComplete","t16","t17","t18","client"],"sources":["../../../src/puck-editor/internal/puck-wrapper.tsx"],"sourcesContent":["'use client';\n\nimport { type ReactNode } from 'react';\nimport dynamic from 'next/dynamic';\n\nimport { PuckI18nProvider, type PuckDictionaryOverrides } from './i18n.tsx';\nimport { usePuckOverlay } from './use-puck-overlay.ts';\n\nimport '../puck-theme.css';\n\nimport { Config, Overrides, Plugin } from '@puckeditor/core';\nimport { QueryClientProvider } from '@tanstack/react-query';\nimport { motion } from 'motion/react';\n\nimport { cn } from '../../shared/cn.ts';\nimport {\n getBundle,\n parsePuckData,\n resolveContentModel,\n} from './content-model.ts';\nimport {\n PuckEditorConfigProvider,\n type PuckEditorConfig,\n} from './editor-config.tsx';\nimport { getEditorQueryClient } from './editor-query-client.ts';\nimport { PuckNode } from './puck-node.ts';\nimport type {\n PuckOnAction,\n PuckPassthroughProps,\n PuckValidate,\n} from './puck-props.ts';\n\nconst LazyPuckEditor = dynamic(() => import('./editor/puck-editor.tsx'), {\n ssr: false,\n});\n\ntype PuckWrapperProps = {\n node: PuckNode;\n config: Config;\n isLoggedIn: boolean;\n editorLocale?: string;\n dictionaryOverrides?: PuckDictionaryOverrides;\n plugins?: (defaultPlugins: Plugin[]) => Plugin[];\n overrides?: Partial<Overrides>;\n /** Called after the module's internal action handling. */\n onAction?: PuckOnAction;\n /**\n * Custom validation run on save, composed after the built-in required-field\n * check. Returning one or more issues blocks the publish and surfaces them in\n * the editor toast.\n */\n validate?: PuckValidate;\n /**\n * Remaining <Puck> props, spread before the module-managed ones (managed\n * props always win). Managed and therefore excluded: config, data, plugins,\n * overrides, onAction, onPublish, renderHeader, renderHeaderActions.\n */\n puckProps?: PuckPassthroughProps;\n children: ReactNode;\n} & PuckEditorConfig;\n\n/**\n * Editor overlay shell for a Puck page.\n *\n * Requires the `sonner` (save/upload/template toasts) and `motion` (overlay\n * animation) peers, alongside `@puckeditor/core`; see the module README.\n */\nexport default function PuckWrapper({\n node,\n config,\n isLoggedIn,\n editorLocale = 'en',\n dictionaryOverrides,\n plugins,\n overrides,\n onAction,\n validate,\n puckProps,\n drupalBaseUrl,\n contentModel,\n builtinTemplates,\n propTransforms,\n api,\n children,\n}: PuckWrapperProps) {\n const bundle = getBundle(resolveContentModel(contentModel), node.type);\n const fieldName = bundle?.dataField ?? '';\n const puckField = bundle ? (node[fieldName] as string) : '';\n const puckData = parsePuckData(puckField, node.id, propTransforms, config);\n const {\n isEditMode,\n isEditorReady,\n setIsEditorReady,\n closeEditor,\n isHighlighted,\n } = usePuckOverlay({ node, fieldName, isLoggedIn });\n\n if (!bundle) {\n console.error(\n `puck-editor: no bundle configured for node type \"${node.type}\"; rendering page without editor`\n );\n return <>{children}</>;\n }\n\n return (\n <QueryClientProvider client={getEditorQueryClient()}>\n <PuckEditorConfigProvider\n config={{\n drupalBaseUrl,\n contentModel,\n builtinTemplates,\n propTransforms,\n api,\n }}\n >\n <PuckI18nProvider locale={editorLocale} overrides={dictionaryOverrides}>\n <div>\n <div\n className={cn('nh:relative nh:-outline-offset-1', {\n 'nh:outline-1 nh:outline-(--nh-primary) nh:outline-dashed':\n isHighlighted,\n })}\n >\n {children}\n </div>\n <motion.div\n data-puck-editor-overlay\n className=\"nh-root nh:fixed nh:inset-0 nh:z-50 nh:border nh:border-t nh:border-b nh:border-gray-300 nh:bg-white\"\n initial={{ y: '100%' }}\n animate={{ y: isEditMode ? 0 : '100%' }}\n transition={{\n duration: 0.3,\n ease: 'easeInOut',\n }}\n onAnimationComplete={() => setIsEditorReady(isEditMode)}\n >\n {isEditorReady && (\n <LazyPuckEditor\n key={`puck-editor-${fieldName}`}\n fieldName={fieldName}\n node={node}\n data={puckData}\n config={config}\n closePuckEditor={closeEditor}\n plugins={plugins}\n overrides={overrides}\n onAction={onAction}\n validate={validate}\n puckProps={puckProps}\n />\n )}\n </motion.div>\n </div>\n </PuckI18nProvider>\n </PuckEditorConfigProvider>\n </QueryClientProvider>\n );\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAGb,OAAOC,OAAO,MAAM,cAAc;AAElC,SAASC,gBAAgB,QAAsC,WAAY;AAC3E,SAASC,cAAc,QAAQ,uBAAuB;AAEtD,OAAO,mBAAmB;AAG1B,SAASC,mBAAmB,QAAQ,uBAAuB;AAC3D,SAASC,MAAM,QAAQ,cAAc;AAErC,SAASC,EAAE,QAAQ,oBAAoB;AACvC,SACEC,SAAS,EACTC,aAAa,EACbC,mBAAmB,QACd,oBAAoB;AAC3B,SACEC,wBAAwB,QAEnB,oBAAqB;AAC5B,SAASC,oBAAoB,QAAQ,0BAA0B;AAAC,SAAAC,QAAA,IAAAC,SAAA,EAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAQhE,MAAMC,cAAc,GAAGjB,OAAO,CAAC,MAAM,MAAM,CAAC,yBAA0B,CAAC,EAAE;EACvEkB,GAAG,EAAE;AACP,CAAC,CAAC;AA2BF;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAAC,YAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAtB,EAAA;EAAqB;IAAAuB,IAAA;IAAAC,MAAA;IAAAC,UAAA;IAAAC,YAAA,EAAAC,EAAA;IAAAC,mBAAA;IAAAC,OAAA;IAAAC,SAAA;IAAAC,QAAA;IAAAC,QAAA;IAAAC,SAAA;IAAAC,aAAA;IAAAC,YAAA;IAAAC,gBAAA;IAAAC,cAAA;IAAAC,GAAA;IAAAC;EAAA,IAAAlB,EAiBjB;EAbjB,MAAAK,YAAA,GAAAC,EAAmB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GAAA;EAAA;IAAAA,GAAA,GAAA3D,CAAA;EAAA;EAAA,IAAA4D,GAAA;EAAA,IAAA5D,CAAA,SAAA2D,GAAA,IAAA3D,CAAA,SAAAuC,EAAA;IAhDvBqB,GAAA,gBAAAnE,IAAA,CAACX,mBAAmB;MAAS+E,MAAsB,EAAtBzB,EAAsB;MAAAnB,QAAA,eACjDxB,IAAA,CAACL,wBAAwB;QACfc,MAMP,EANOqC,EAMP;QAAAtB,QAAA,EAED0C;MAsCmB,CACK;IAAC,CACR,CAAC;IAAA3D,CAAA,OAAA2D,GAAA;IAAA3D,CAAA,OAAAuC,EAAA;IAAAvC,CAAA,OAAA4D,GAAA;EAAA;IAAAA,GAAA,GAAA5D,CAAA;EAAA;EAAA,OAlDtB4D,GAkDsB;AAAA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { CropBreakpoint, MediaCrop } from '../fields/media-selector/crop-types';
1
+ import type { CropBreakpoint, MediaCrop } from '../fields/media-selector/crop-types.js';
2
2
  export declare function cropSizes(crop: MediaCrop, breakpoints?: CropBreakpoint[]): string;
3
3
  export declare function cropFocusPosition(crop?: MediaCrop | null): string | undefined;
4
4
  export type CroppedImageProps = {
@@ -16,4 +16,3 @@ export type CroppedImageProps = {
16
16
  fillContainer?: boolean;
17
17
  };
18
18
  export declare function CroppedImage({ src, alt, scopeId, crop, breakpoints, fallbackAspectRatio, sizes, priority, className, imgClassName, objectFit, fillContainer, }: CroppedImageProps): import("react").JSX.Element;
19
- //# sourceMappingURL=cropped-image.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cropped-image.js","names":["NextImage","jsx","_jsx","jsxs","_jsxs","round","n","Math","sanitizeScopeId","id","replace","cropVars","region","aspect","width","height","x","y","join","overridesFor","crop","breakpoints","filter","bp","overrides","key","map","cropSizes","entries","sort","a","b","maxWidth","ceil","base","cropFocusPosition","undefined","CroppedImage","src","alt","scopeId","fallbackAspectRatio","sizes","priority","className","imgClassName","objectFit","fillContainer","style","position","inset","overflow","aspectRatio","children","fill","css","left","top","containerType","transform"],"sources":["../../../../src/puck-editor/internal/render/cropped-image.tsx"],"sourcesContent":["import NextImage from 'next/image';\n\nimport type {\n CropBreakpoint,\n CropRegion,\n MediaCrop,\n} from '../fields/media-selector/crop-types';\n\nconst round = (n: number) => Math.round(n * 10000) / 10000;\n\nconst sanitizeScopeId = (id: string) => id.replace(/[^a-zA-Z0-9_-]/g, '');\n\nfunction cropVars(region: CropRegion): string {\n return [\n `--nh-crop-ar:${round(region.aspect)}`,\n `--nh-crop-w:${round(100 / region.width)}%`,\n `--nh-crop-h:${round(100 / region.height)}%`,\n `--nh-crop-l:${round((-region.x / region.width) * 100)}%`,\n `--nh-crop-t:${round((-region.y / region.height) * 100)}%`,\n ].join(';');\n}\n\nfunction overridesFor(\n crop: MediaCrop,\n breakpoints?: CropBreakpoint[]\n): Array<CropBreakpoint & { region: CropRegion }> {\n return (breakpoints ?? [])\n .filter((bp) => crop.overrides?.[bp.key])\n .map((bp) => ({ ...bp, region: crop.overrides![bp.key] }));\n}\n\nexport function cropSizes(\n crop: MediaCrop,\n breakpoints?: CropBreakpoint[]\n): string {\n const entries = overridesFor(crop, breakpoints)\n .sort((a, b) => a.maxWidth - b.maxWidth)\n .map(\n (bp) =>\n `(max-width: ${bp.maxWidth}px) ${Math.ceil(100 / bp.region.width)}vw`\n );\n return [...entries, `${Math.ceil(100 / crop.base.width)}vw`].join(', ');\n}\n\nexport function cropFocusPosition(crop?: MediaCrop | null): string | undefined {\n if (!crop) return undefined;\n const { x, y, width, height } = crop.base;\n return `${round((x + width / 2) * 100)}% ${round((y + height / 2) * 100)}%`;\n}\n\nexport type CroppedImageProps = {\n src: string;\n alt: string;\n scopeId: string;\n crop?: MediaCrop | null;\n breakpoints?: CropBreakpoint[];\n fallbackAspectRatio?: string;\n sizes?: string;\n priority?: boolean;\n className?: string;\n imgClassName?: string;\n objectFit?: 'cover' | 'contain';\n fillContainer?: boolean;\n};\n\nexport function CroppedImage({\n src,\n alt,\n scopeId,\n crop,\n breakpoints,\n fallbackAspectRatio,\n sizes,\n priority,\n className,\n imgClassName,\n objectFit = 'cover',\n fillContainer,\n}: CroppedImageProps) {\n if (!crop) {\n return (\n <div\n className={className}\n style={\n fillContainer\n ? { position: 'absolute', inset: 0, overflow: 'hidden' }\n : {\n position: 'relative',\n aspectRatio: fallbackAspectRatio ?? '16/9',\n }\n }\n >\n <NextImage\n src={src}\n alt={alt}\n fill\n priority={priority}\n sizes={sizes ?? (priority ? '100vw' : 'auto')}\n className={imgClassName}\n style={{ objectFit }}\n />\n </div>\n );\n }\n\n const id = sanitizeScopeId(scopeId);\n const css = [\n `[data-nh-crop=\"${id}\"]{${cropVars(crop.base)}}`,\n ...overridesFor(crop, breakpoints)\n .sort((a, b) => b.maxWidth - a.maxWidth)\n .map(\n (bp) =>\n `@media (max-width:${bp.maxWidth}px){[data-nh-crop=\"${id}\"]{${cropVars(bp.region)}}}`\n ),\n ].join('');\n\n const region = (\n <div\n style={{\n position: 'absolute',\n width: 'var(--nh-crop-w)',\n height: 'var(--nh-crop-h)',\n left: 'var(--nh-crop-l)',\n top: 'var(--nh-crop-t)',\n }}\n >\n <NextImage\n src={src}\n alt={alt}\n fill\n priority={priority}\n sizes={sizes ?? (priority ? cropSizes(crop, breakpoints) : 'auto')}\n className={imgClassName}\n style={{ objectFit }}\n />\n </div>\n );\n\n if (fillContainer) {\n return (\n <div\n data-nh-crop={id}\n className={className}\n style={{\n position: 'absolute',\n inset: 0,\n overflow: 'hidden',\n containerType: 'size',\n }}\n >\n <style>{css}</style>\n <div\n style={{\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n width: 'max(100cqw, calc(100cqh * var(--nh-crop-ar)))',\n height: 'max(100cqh, calc(100cqw / var(--nh-crop-ar)))',\n }}\n >\n {region}\n </div>\n </div>\n );\n }\n\n return (\n <div\n data-nh-crop={id}\n className={className}\n style={{\n position: 'relative',\n overflow: 'hidden',\n aspectRatio: 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,GAAGhB,SAAS,CAACP,IAAI,EAAEC,WAAW,CAAC,GAAG,MAAM,CAAE;MACnEuB,SAAS,EAAEC,YAAa;MACxBG,KAAK,EAAE;QAAEF;MAAU;IAAE,CACtB;EAAC,CACC,CACN;EAED,IAAIC,aAAa,EAAE;IACjB,oBACE3C,KAAA;MACE,gBAAcK,EAAG;MACjBmC,SAAS,EAAEA,SAAU;MACrBI,KAAK,EAAE;QACLC,QAAQ,EAAE,UAAU;QACpBC,KAAK,EAAE,CAAC;QACRC,QAAQ,EAAE,QAAQ;QAClBO,aAAa,EAAE;MACjB,CAAE;MAAAL,QAAA,gBAEFnD,IAAA;QAAAmD,QAAA,EAAQE;MAAG,CAAQ,CAAC,eACpBrD,IAAA;QACE8C,KAAK,EAAE;UACLC,QAAQ,EAAE,UAAU;UACpBQ,GAAG,EAAE,KAAK;UACVD,IAAI,EAAE,KAAK;UACXG,SAAS,EAAE,uBAAuB;UAClC7C,KAAK,EAAE,+CAA+C;UACtDC,MAAM,EAAE;QACV,CAAE;QAAAsC,QAAA,EAEDzC;MAAM,CACJ,CAAC;IAAA,CACH,CAAC;EAEV;EAEA,oBACER,KAAA;IACE,gBAAcK,EAAG;IACjBmC,SAAS,EAAEA,SAAU;IACrBI,KAAK,EAAE;MACLC,QAAQ,EAAE,UAAU;MACpBE,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAE;IACf,CAAE;IAAAC,QAAA,gBAEFnD,IAAA;MAAAmD,QAAA,EAAQE;IAAG,CAAQ,CAAC,EACnB3C,MAAM;EAAA,CACJ,CAAC;AAEV","ignoreList":[]}
1
+ {"version":3,"file":"cropped-image.js","names":["NextImage","jsx","_jsx","jsxs","_jsxs","round","n","Math","sanitizeScopeId","id","replace","cropVars","region","aspect","width","height","x","y","join","overridesFor","crop","breakpoints","filter","bp","overrides","key","map","cropSizes","entries","sort","a","b","maxWidth","ceil","base","cropFocusPosition","undefined","CroppedImage","src","alt","scopeId","fallbackAspectRatio","sizes","priority","className","imgClassName","objectFit","fillContainer","style","position","inset","overflow","aspectRatio","children","fill","css","left","top","containerType","transform"],"sources":["../../../../src/puck-editor/internal/render/cropped-image.tsx"],"sourcesContent":["import NextImage from 'next/image';\n\nimport type {\n CropBreakpoint,\n CropRegion,\n MediaCrop,\n} from '../fields/media-selector/crop-types.ts';\n\nconst round = (n: number) => Math.round(n * 10000) / 10000;\n\nconst sanitizeScopeId = (id: string) => id.replace(/[^a-zA-Z0-9_-]/g, '');\n\nfunction cropVars(region: CropRegion): string {\n return [\n `--nh-crop-ar:${round(region.aspect)}`,\n `--nh-crop-w:${round(100 / region.width)}%`,\n `--nh-crop-h:${round(100 / region.height)}%`,\n `--nh-crop-l:${round((-region.x / region.width) * 100)}%`,\n `--nh-crop-t:${round((-region.y / region.height) * 100)}%`,\n ].join(';');\n}\n\nfunction overridesFor(\n crop: MediaCrop,\n breakpoints?: CropBreakpoint[]\n): Array<CropBreakpoint & { region: CropRegion }> {\n return (breakpoints ?? [])\n .filter((bp) => crop.overrides?.[bp.key])\n .map((bp) => ({ ...bp, region: crop.overrides![bp.key] }));\n}\n\nexport function cropSizes(\n crop: MediaCrop,\n breakpoints?: CropBreakpoint[]\n): string {\n const entries = overridesFor(crop, breakpoints)\n .sort((a, b) => a.maxWidth - b.maxWidth)\n .map(\n (bp) =>\n `(max-width: ${bp.maxWidth}px) ${Math.ceil(100 / bp.region.width)}vw`\n );\n return [...entries, `${Math.ceil(100 / crop.base.width)}vw`].join(', ');\n}\n\nexport function cropFocusPosition(crop?: MediaCrop | null): string | undefined {\n if (!crop) return undefined;\n const { x, y, width, height } = crop.base;\n return `${round((x + width / 2) * 100)}% ${round((y + height / 2) * 100)}%`;\n}\n\nexport type CroppedImageProps = {\n src: string;\n alt: string;\n scopeId: string;\n crop?: MediaCrop | null;\n breakpoints?: CropBreakpoint[];\n fallbackAspectRatio?: string;\n sizes?: string;\n priority?: boolean;\n className?: string;\n imgClassName?: string;\n objectFit?: 'cover' | 'contain';\n fillContainer?: boolean;\n};\n\nexport function CroppedImage({\n src,\n alt,\n scopeId,\n crop,\n breakpoints,\n fallbackAspectRatio,\n sizes,\n priority,\n className,\n imgClassName,\n objectFit = 'cover',\n fillContainer,\n}: CroppedImageProps) {\n if (!crop) {\n return (\n <div\n className={className}\n style={\n fillContainer\n ? { position: 'absolute', inset: 0, overflow: 'hidden' }\n : {\n position: 'relative',\n aspectRatio: fallbackAspectRatio ?? '16/9',\n }\n }\n >\n <NextImage\n src={src}\n alt={alt}\n fill\n priority={priority}\n sizes={sizes ?? (priority ? '100vw' : 'auto')}\n className={imgClassName}\n style={{ objectFit }}\n />\n </div>\n );\n }\n\n const id = sanitizeScopeId(scopeId);\n const css = [\n `[data-nh-crop=\"${id}\"]{${cropVars(crop.base)}}`,\n ...overridesFor(crop, breakpoints)\n .sort((a, b) => b.maxWidth - a.maxWidth)\n .map(\n (bp) =>\n `@media (max-width:${bp.maxWidth}px){[data-nh-crop=\"${id}\"]{${cropVars(bp.region)}}}`\n ),\n ].join('');\n\n const region = (\n <div\n style={{\n position: 'absolute',\n width: 'var(--nh-crop-w)',\n height: 'var(--nh-crop-h)',\n left: 'var(--nh-crop-l)',\n top: 'var(--nh-crop-t)',\n }}\n >\n <NextImage\n src={src}\n alt={alt}\n fill\n priority={priority}\n sizes={sizes ?? (priority ? cropSizes(crop, breakpoints) : 'auto')}\n className={imgClassName}\n style={{ objectFit }}\n />\n </div>\n );\n\n if (fillContainer) {\n return (\n <div\n data-nh-crop={id}\n className={className}\n style={{\n position: 'absolute',\n inset: 0,\n overflow: 'hidden',\n containerType: 'size',\n }}\n >\n <style>{css}</style>\n <div\n style={{\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n width: 'max(100cqw, calc(100cqh * var(--nh-crop-ar)))',\n height: 'max(100cqh, calc(100cqw / var(--nh-crop-ar)))',\n }}\n >\n {region}\n </div>\n </div>\n );\n }\n\n return (\n <div\n data-nh-crop={id}\n className={className}\n style={{\n position: 'relative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,EAAEA,KAAK,KAAKC,QAAQ,GAAGhB,SAAS,CAACP,IAAI,EAAEC,WAAW,CAAC,GAAG,MAAM,CAAE;MACnEuB,SAAS,EAAEC,YAAa;MACxBG,KAAK,EAAE;QAAEF;MAAU;IAAE,CACtB;EAAC,CACC,CACN;EAED,IAAIC,aAAa,EAAE;IACjB,oBACE3C,KAAA;MACE,gBAAcK,EAAG;MACjBmC,SAAS,EAAEA,SAAU;MACrBI,KAAK,EAAE;QACLC,QAAQ,EAAE,UAAU;QACpBC,KAAK,EAAE,CAAC;QACRC,QAAQ,EAAE,QAAQ;QAClBO,aAAa,EAAE;MACjB,CAAE;MAAAL,QAAA,gBAEFnD,IAAA;QAAAmD,QAAA,EAAQE;MAAG,CAAQ,CAAC,eACpBrD,IAAA;QACE8C,KAAK,EAAE;UACLC,QAAQ,EAAE,UAAU;UACpBQ,GAAG,EAAE,KAAK;UACVD,IAAI,EAAE,KAAK;UACXG,SAAS,EAAE,uBAAuB;UAClC7C,KAAK,EAAE,+CAA+C;UACtDC,MAAM,EAAE;QACV,CAAE;QAAAsC,QAAA,EAEDzC;MAAM,CACJ,CAAC;IAAA,CACH,CAAC;EAEV;EAEA,oBACER,KAAA;IACE,gBAAcK,EAAG;IACjBmC,SAAS,EAAEA,SAAU;IACrBI,KAAK,EAAE;MACLC,QAAQ,EAAE,UAAU;MACpBE,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAE;IACf,CAAE;IAAAC,QAAA,gBAEFnD,IAAA;MAAAmD,QAAA,EAAQE;IAAG,CAAQ,CAAC,EACnB3C,MAAM;EAAA,CACJ,CAAC;AAEV","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ import { type PuckContentModel } from '../content-model.js';
2
+ export type PuckSmartActionId = 'open-puck-editor' | 'new-page';
3
+ export declare function selectPuckSmartActionIds({ contentModel, nodeType, hasCreatableBundles, }: {
4
+ contentModel: PuckContentModel;
5
+ /** Undefined preserves the legacy edit action; null means no current node. */
6
+ nodeType?: string | null;
7
+ hasCreatableBundles: boolean;
8
+ }): PuckSmartActionId[];
@@ -0,0 +1,10 @@
1
+ import { getBundle } from "../content-model.js";
2
+ export function selectPuckSmartActionIds({
3
+ contentModel,
4
+ nodeType,
5
+ hasCreatableBundles
6
+ }) {
7
+ const canEdit = nodeType === undefined || Boolean(nodeType && getBundle(contentModel, nodeType));
8
+ return [...(canEdit ? ['open-puck-editor'] : []), ...(hasCreatableBundles ? ['new-page'] : [])];
9
+ }
10
+ //# sourceMappingURL=action-selection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-selection.js","names":["getBundle","selectPuckSmartActionIds","contentModel","nodeType","hasCreatableBundles","canEdit","undefined","Boolean"],"sources":["../../../../src/puck-editor/internal/smart-actions/action-selection.ts"],"sourcesContent":["import {\n getBundle,\n type PuckContentModel,\n} from '../content-model.ts';\n\nexport type PuckSmartActionId = 'open-puck-editor' | 'new-page';\n\nexport function selectPuckSmartActionIds({\n contentModel,\n nodeType,\n hasCreatableBundles,\n}: {\n contentModel: PuckContentModel;\n /** Undefined preserves the legacy edit action; null means no current node. */\n nodeType?: string | null;\n hasCreatableBundles: boolean;\n}): PuckSmartActionId[] {\n const canEdit =\n nodeType === undefined ||\n Boolean(nodeType && getBundle(contentModel, nodeType));\n\n return [\n ...(canEdit ? (['open-puck-editor'] as const) : []),\n ...(hasCreatableBundles ? (['new-page'] as const) : []),\n ];\n}\n"],"mappings":"AAAA,SACEA,SAAS,QAEJ,qBAAqB;AAI5B,OAAO,SAASC,wBAAwBA,CAAC;EACvCC,YAAY;EACZC,QAAQ;EACRC;AAMF,CAAC,EAAuB;EACtB,MAAMC,OAAO,GACXF,QAAQ,KAAKG,SAAS,IACtBC,OAAO,CAACJ,QAAQ,IAAIH,SAAS,CAACE,YAAY,EAAEC,QAAQ,CAAC,CAAC;EAExD,OAAO,CACL,IAAIE,OAAO,GAAI,CAAC,kBAAkB,CAAC,GAAa,EAAE,CAAC,EACnD,IAAID,mBAAmB,GAAI,CAAC,UAAU,CAAC,GAAa,EAAE,CAAC,CACxD;AACH","ignoreList":[]}
@@ -1,5 +1,6 @@
1
- import type { ToolbarAction } from '../../../shared/toolbar-action';
2
- import { type PuckContentModelInput } from '../content-model';
1
+ import type { ToolbarAction } from '../../../shared/toolbar-action.js';
2
+ import { type PuckContentModelInput } from '../content-model.js';
3
+ import { type PuckDictionaryOverrides } from '../dictionaries.js';
3
4
  type PuckSmartActionsContext = {
4
5
  lang: string;
5
6
  labels: {
@@ -7,7 +8,12 @@ type PuckSmartActionsContext = {
7
8
  newPage: string;
8
9
  };
9
10
  contentModel?: PuckContentModelInput;
11
+ /** Current JSON:API resource type; null means there is no current node. */
12
+ nodeType?: string | null;
13
+ /** Editor UI locale for the action messages; falls back to lang. */
14
+ editorLocale?: string;
15
+ /** Per-section overrides merged over the resolved Puck dictionary. */
16
+ dictionaryOverrides?: PuckDictionaryOverrides;
10
17
  };
11
- export declare function createPuckSmartActions({ lang, labels, contentModel, }: PuckSmartActionsContext): ToolbarAction[];
18
+ export declare function createPuckSmartActions({ lang, labels, contentModel, nodeType, editorLocale, dictionaryOverrides, }: PuckSmartActionsContext): ToolbarAction[];
12
19
  export {};
13
- //# sourceMappingURL=index.d.ts.map