@nodehive/nextjs 0.1.3 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (762) 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/space.d.ts +0 -1
  128. package/dist/puck-editor/internal/api/type-segment.d.ts +2 -0
  129. package/dist/puck-editor/internal/api/type-segment.js +9 -0
  130. package/dist/puck-editor/internal/api/type-segment.js.map +1 -0
  131. package/dist/puck-editor/internal/content-model.d.ts +31 -3
  132. package/dist/puck-editor/internal/content-model.js +76 -6
  133. package/dist/puck-editor/internal/content-model.js.map +1 -1
  134. package/dist/puck-editor/internal/dictionaries.d.ts +225 -0
  135. package/dist/puck-editor/internal/dictionaries.js +673 -0
  136. package/dist/puck-editor/internal/dictionaries.js.map +1 -0
  137. package/dist/puck-editor/internal/editor/allowed-types.d.ts +1 -2
  138. package/dist/puck-editor/internal/editor/allowed-types.js +2 -2
  139. package/dist/puck-editor/internal/editor/allowed-types.js.map +1 -1
  140. package/dist/puck-editor/internal/editor/canvas-add-picker.d.ts +0 -1
  141. package/dist/puck-editor/internal/editor/canvas-add-picker.js +5 -5
  142. package/dist/puck-editor/internal/editor/canvas-add-picker.js.map +1 -1
  143. package/dist/puck-editor/internal/editor/canvas-empty-state.d.ts +0 -1
  144. package/dist/puck-editor/internal/editor/canvas-empty-state.js +4 -4
  145. package/dist/puck-editor/internal/editor/canvas-empty-state.js.map +1 -1
  146. package/dist/puck-editor/internal/editor/canvas-quick-add.d.ts +0 -1
  147. package/dist/puck-editor/internal/editor/canvas-quick-add.js +8 -8
  148. package/dist/puck-editor/internal/editor/canvas-quick-add.js.map +1 -1
  149. package/dist/puck-editor/internal/editor/canvas-scroll.d.ts +0 -1
  150. package/dist/puck-editor/internal/editor/component-icons.d.ts +1 -2
  151. package/dist/puck-editor/internal/editor/component-icons.js.map +1 -1
  152. package/dist/puck-editor/internal/editor/component-item.d.ts +0 -1
  153. package/dist/puck-editor/internal/editor/component-item.js +2 -2
  154. package/dist/puck-editor/internal/editor/component-item.js.map +1 -1
  155. package/dist/puck-editor/internal/editor/compose-save-issues.d.ts +15 -0
  156. package/dist/puck-editor/internal/editor/compose-save-issues.js +16 -0
  157. package/dist/puck-editor/internal/editor/compose-save-issues.js.map +1 -0
  158. package/dist/puck-editor/internal/editor/dirty-state.d.ts +3 -0
  159. package/dist/puck-editor/internal/editor/dirty-state.js +7 -0
  160. package/dist/puck-editor/internal/editor/dirty-state.js.map +1 -0
  161. package/dist/puck-editor/internal/editor/draft-restore-banner.d.ts +9 -0
  162. package/dist/puck-editor/internal/editor/draft-restore-banner.js +289 -0
  163. package/dist/puck-editor/internal/editor/draft-restore-banner.js.map +1 -0
  164. package/dist/puck-editor/internal/editor/draft-storage.d.ts +41 -0
  165. package/dist/puck-editor/internal/editor/draft-storage.js +129 -0
  166. package/dist/puck-editor/internal/editor/draft-storage.js.map +1 -0
  167. package/dist/puck-editor/internal/editor/editor-action-bar.d.ts +0 -1
  168. package/dist/puck-editor/internal/editor/editor-action-bar.js +4 -4
  169. package/dist/puck-editor/internal/editor/editor-action-bar.js.map +1 -1
  170. package/dist/puck-editor/internal/editor/editor-header-actions.d.ts +6 -4
  171. package/dist/puck-editor/internal/editor/editor-header-actions.js +119 -60
  172. package/dist/puck-editor/internal/editor/editor-header-actions.js.map +1 -1
  173. package/dist/puck-editor/internal/editor/find-missing-required-fields.d.ts +0 -1
  174. package/dist/puck-editor/internal/editor/grouped-drawer-panel.d.ts +1 -2
  175. package/dist/puck-editor/internal/editor/grouped-drawer-panel.js +6 -6
  176. package/dist/puck-editor/internal/editor/grouped-drawer-panel.js.map +1 -1
  177. package/dist/puck-editor/internal/editor/grouped-entry-list.d.ts +1 -2
  178. package/dist/puck-editor/internal/editor/grouped-entry-list.js +7 -6
  179. package/dist/puck-editor/internal/editor/grouped-entry-list.js.map +1 -1
  180. package/dist/puck-editor/internal/editor/header-save-button.d.ts +4 -4
  181. package/dist/puck-editor/internal/editor/header-save-button.js +66 -27
  182. package/dist/puck-editor/internal/editor/header-save-button.js.map +1 -1
  183. package/dist/puck-editor/internal/editor/leave-confirm-dialog.d.ts +5 -0
  184. package/dist/puck-editor/internal/editor/leave-confirm-dialog.js +140 -0
  185. package/dist/puck-editor/internal/editor/leave-confirm-dialog.js.map +1 -0
  186. package/dist/puck-editor/internal/editor/page-template-picker.d.ts +0 -1
  187. package/dist/puck-editor/internal/editor/page-template-picker.js +5 -5
  188. package/dist/puck-editor/internal/editor/page-template-picker.js.map +1 -1
  189. package/dist/puck-editor/internal/editor/picker-entry-item.d.ts +1 -2
  190. package/dist/puck-editor/internal/editor/picker-entry-item.js +4 -4
  191. package/dist/puck-editor/internal/editor/picker-entry-item.js.map +1 -1
  192. package/dist/puck-editor/internal/editor/picker-model.d.ts +14 -5
  193. package/dist/puck-editor/internal/editor/picker-model.js +157 -132
  194. package/dist/puck-editor/internal/editor/picker-model.js.map +1 -1
  195. package/dist/puck-editor/internal/editor/publish-puck-data.d.ts +18 -4
  196. package/dist/puck-editor/internal/editor/publish-puck-data.js +25 -4
  197. package/dist/puck-editor/internal/editor/publish-puck-data.js.map +1 -1
  198. package/dist/puck-editor/internal/editor/puck-editor.d.ts +6 -4
  199. package/dist/puck-editor/internal/editor/puck-editor.js +270 -209
  200. package/dist/puck-editor/internal/editor/puck-editor.js.map +1 -1
  201. package/dist/puck-editor/internal/editor/save-guard.d.ts +15 -0
  202. package/dist/puck-editor/internal/editor/save-guard.js +30 -0
  203. package/dist/puck-editor/internal/editor/save-guard.js.map +1 -0
  204. package/dist/puck-editor/internal/editor/save-page-context.d.ts +8 -0
  205. package/dist/puck-editor/internal/editor/save-page-context.js +34 -0
  206. package/dist/puck-editor/internal/editor/save-page-context.js.map +1 -0
  207. package/dist/puck-editor/internal/editor/section-template-modal.d.ts +0 -1
  208. package/dist/puck-editor/internal/editor/section-template-modal.js +2 -2
  209. package/dist/puck-editor/internal/editor/section-template-modal.js.map +1 -1
  210. package/dist/puck-editor/internal/editor/use-draft-recovery.d.ts +16 -0
  211. package/dist/puck-editor/internal/editor/use-draft-recovery.js +194 -0
  212. package/dist/puck-editor/internal/editor/use-draft-recovery.js.map +1 -0
  213. package/dist/puck-editor/internal/editor/use-frame-zoom.d.ts +0 -1
  214. package/dist/puck-editor/internal/editor/use-is-dirty.d.ts +1 -0
  215. package/dist/puck-editor/internal/editor/use-is-dirty.js +32 -0
  216. package/dist/puck-editor/internal/editor/use-is-dirty.js.map +1 -0
  217. package/dist/puck-editor/internal/editor/use-scroll-lock-outside.d.ts +0 -1
  218. package/dist/puck-editor/internal/editor-config.d.ts +16 -3
  219. package/dist/puck-editor/internal/editor-config.js +8 -1
  220. package/dist/puck-editor/internal/editor-config.js.map +1 -1
  221. package/dist/puck-editor/internal/editor-query-client.d.ts +0 -1
  222. package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.d.ts +0 -1
  223. package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.js +2 -2
  224. package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.js.map +1 -1
  225. package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.d.ts +0 -1
  226. package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.js +1 -1
  227. package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.js.map +1 -1
  228. package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.d.ts +0 -1
  229. package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.js +1 -1
  230. package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.js.map +1 -1
  231. package/dist/puck-editor/internal/fields/date-picker/date-picker.d.ts +0 -1
  232. package/dist/puck-editor/internal/fields/date-picker/date-picker.js +90 -73
  233. package/dist/puck-editor/internal/fields/date-picker/date-picker.js.map +1 -1
  234. package/dist/puck-editor/internal/fields/index.d.ts +10 -10
  235. package/dist/puck-editor/internal/fields/index.js +10 -9
  236. package/dist/puck-editor/internal/fields/index.js.map +1 -1
  237. package/dist/puck-editor/internal/fields/link-picker/anchor.d.ts +0 -1
  238. package/dist/puck-editor/internal/fields/link-picker/anchor.js +1 -1
  239. package/dist/puck-editor/internal/fields/link-picker/anchor.js.map +1 -1
  240. package/dist/puck-editor/internal/fields/link-picker/create-link-field.d.ts +1 -2
  241. package/dist/puck-editor/internal/fields/link-picker/create-link-field.js +1 -1
  242. package/dist/puck-editor/internal/fields/link-picker/create-link-field.js.map +1 -1
  243. package/dist/puck-editor/internal/fields/link-picker/humanize.d.ts +0 -1
  244. package/dist/puck-editor/internal/fields/link-picker/link-picker-control.d.ts +0 -1
  245. package/dist/puck-editor/internal/fields/link-picker/link-picker-control.js +208 -140
  246. package/dist/puck-editor/internal/fields/link-picker/link-picker-control.js.map +1 -1
  247. package/dist/puck-editor/internal/fields/link-picker/link-picker-field.d.ts +1 -2
  248. package/dist/puck-editor/internal/fields/link-picker/link-picker-field.js +6 -6
  249. package/dist/puck-editor/internal/fields/link-picker/link-picker-field.js.map +1 -1
  250. package/dist/puck-editor/internal/fields/link-picker/link-value.d.ts +25 -5
  251. package/dist/puck-editor/internal/fields/link-picker/link-value.js +56 -6
  252. package/dist/puck-editor/internal/fields/link-picker/link-value.js.map +1 -1
  253. package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.d.ts +0 -1
  254. package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.js +4 -4
  255. package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.js.map +1 -1
  256. package/dist/puck-editor/internal/fields/link-picker/richtext-extensions.d.ts +0 -1
  257. package/dist/puck-editor/internal/fields/link-picker/segmented-control.d.ts +0 -1
  258. package/dist/puck-editor/internal/fields/link-picker/segmented-control.js +3 -3
  259. package/dist/puck-editor/internal/fields/link-picker/segmented-control.js.map +1 -1
  260. package/dist/puck-editor/internal/fields/link-picker/types.d.ts +0 -1
  261. package/dist/puck-editor/internal/fields/media-array/create-media-array-field.d.ts +2 -3
  262. package/dist/puck-editor/internal/fields/media-array/create-media-array-field.js +1 -1
  263. package/dist/puck-editor/internal/fields/media-array/create-media-array-field.js.map +1 -1
  264. package/dist/puck-editor/internal/fields/media-array/media-array-field.d.ts +2 -3
  265. package/dist/puck-editor/internal/fields/media-array/media-array-field.js +100 -88
  266. package/dist/puck-editor/internal/fields/media-array/media-array-field.js.map +1 -1
  267. package/dist/puck-editor/internal/fields/media-array/reorder.d.ts +0 -1
  268. package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.d.ts +2 -3
  269. package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.js +1 -1
  270. package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.js.map +1 -1
  271. package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.d.ts +1 -2
  272. package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.js +4 -4
  273. package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.js.map +1 -1
  274. package/dist/puck-editor/internal/fields/media-selector/crop-types.d.ts +0 -1
  275. package/dist/puck-editor/internal/fields/media-selector/extract-fields.d.ts +0 -1
  276. package/dist/puck-editor/internal/fields/media-selector/image-upload-form.d.ts +0 -1
  277. package/dist/puck-editor/internal/fields/media-selector/image-upload-form.js +19 -10
  278. package/dist/puck-editor/internal/fields/media-selector/image-upload-form.js.map +1 -1
  279. package/dist/puck-editor/internal/fields/media-selector/media-selector-field.d.ts +7 -3
  280. package/dist/puck-editor/internal/fields/media-selector/media-selector-field.js +29 -22
  281. package/dist/puck-editor/internal/fields/media-selector/media-selector-field.js.map +1 -1
  282. package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.d.ts +1 -2
  283. package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.js +281 -255
  284. package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.js.map +1 -1
  285. package/dist/puck-editor/internal/fields/media-selector/use-debounced-value.d.ts +0 -1
  286. package/dist/puck-editor/internal/fields/media-selector/use-media-library.d.ts +15 -2
  287. package/dist/puck-editor/internal/fields/media-selector/use-media-library.js +23 -18
  288. package/dist/puck-editor/internal/fields/media-selector/use-media-library.js.map +1 -1
  289. package/dist/puck-editor/internal/fields/media-selector/video-upload-form.d.ts +0 -1
  290. package/dist/puck-editor/internal/fields/media-selector/video-upload-form.js +12 -6
  291. package/dist/puck-editor/internal/fields/media-selector/video-upload-form.js.map +1 -1
  292. package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.d.ts +0 -1
  293. package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.js +2 -2
  294. package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.js.map +1 -1
  295. package/dist/puck-editor/internal/fields/required-field-label.d.ts +0 -1
  296. package/dist/puck-editor/internal/fields/required-field-label.js +1 -1
  297. package/dist/puck-editor/internal/fields/required-field-label.js.map +1 -1
  298. package/dist/puck-editor/internal/fields/required.d.ts +0 -1
  299. package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.d.ts +13 -3
  300. package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.js +32 -22
  301. package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.js.map +1 -1
  302. package/dist/puck-editor/internal/i18n.d.ts +2 -181
  303. package/dist/puck-editor/internal/i18n.js +2 -358
  304. package/dist/puck-editor/internal/i18n.js.map +1 -1
  305. package/dist/puck-editor/internal/locale.d.ts +0 -1
  306. package/dist/puck-editor/internal/localize.d.ts +1 -2
  307. package/dist/puck-editor/internal/localize.js.map +1 -1
  308. package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.d.ts +3 -3
  309. package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.js +41 -32
  310. package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.js.map +1 -1
  311. package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.d.ts +0 -1
  312. package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.js +2 -2
  313. package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.js.map +1 -1
  314. package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.d.ts +3 -3
  315. package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.js.map +1 -1
  316. package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.d.ts +0 -1
  317. package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.js +1 -1
  318. package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.js.map +1 -1
  319. package/dist/puck-editor/internal/plugins/agent-plugin/catalog.d.ts +0 -1
  320. package/dist/puck-editor/internal/plugins/agent-plugin/constants.d.ts +0 -1
  321. package/dist/puck-editor/internal/plugins/agent-plugin/create-page.d.ts +0 -1
  322. package/dist/puck-editor/internal/plugins/agent-plugin/find-component-location.d.ts +0 -1
  323. package/dist/puck-editor/internal/plugins/agent-plugin/help.d.ts +0 -1
  324. package/dist/puck-editor/internal/plugins/agent-plugin/index.d.ts +1 -2
  325. package/dist/puck-editor/internal/plugins/agent-plugin/index.js +1 -1
  326. package/dist/puck-editor/internal/plugins/agent-plugin/index.js.map +1 -1
  327. package/dist/puck-editor/internal/plugins/agent-plugin/list-media.d.ts +2 -2
  328. package/dist/puck-editor/internal/plugins/agent-plugin/list-media.js +4 -3
  329. package/dist/puck-editor/internal/plugins/agent-plugin/list-media.js.map +1 -1
  330. package/dist/puck-editor/internal/plugins/agent-plugin/templates.d.ts +5 -6
  331. package/dist/puck-editor/internal/plugins/agent-plugin/templates.js +2 -2
  332. package/dist/puck-editor/internal/plugins/agent-plugin/templates.js.map +1 -1
  333. package/dist/puck-editor/internal/plugins/agent-plugin/upload-media.d.ts +1 -2
  334. package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.d.ts +0 -1
  335. package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.js +2 -2
  336. package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.js.map +1 -1
  337. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.d.ts +0 -1
  338. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.js +3 -3
  339. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.js.map +1 -1
  340. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.d.ts +0 -1
  341. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.js +1 -1
  342. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.js.map +1 -1
  343. package/dist/puck-editor/internal/plugins/blocks-plugin/index.d.ts +1 -2
  344. package/dist/puck-editor/internal/plugins/blocks-plugin/index.js +1 -1
  345. package/dist/puck-editor/internal/plugins/blocks-plugin/index.js.map +1 -1
  346. package/dist/puck-editor/internal/plugins/outline-plugin/index.d.ts +1 -2
  347. package/dist/puck-editor/internal/plugins/outline-plugin/index.js +1 -1
  348. package/dist/puck-editor/internal/plugins/outline-plugin/index.js.map +1 -1
  349. package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.d.ts +0 -1
  350. package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.js +46 -31
  351. package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.js.map +1 -1
  352. package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.d.ts +0 -1
  353. package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.js +1 -1
  354. package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.js.map +1 -1
  355. package/dist/puck-editor/internal/plugins/outline-plugin/outline-tree.d.ts +0 -1
  356. package/dist/puck-editor/internal/plugins/sections-plugin/index.d.ts +1 -2
  357. package/dist/puck-editor/internal/plugins/sections-plugin/index.js +1 -1
  358. package/dist/puck-editor/internal/plugins/sections-plugin/index.js.map +1 -1
  359. package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.d.ts +0 -1
  360. package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.js +5 -5
  361. package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.js.map +1 -1
  362. package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.d.ts +0 -1
  363. package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.js +1 -1
  364. package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.js.map +1 -1
  365. package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.d.ts +0 -1
  366. package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.js +2 -2
  367. package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.js.map +1 -1
  368. package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.d.ts +0 -1
  369. package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.js +1 -1
  370. package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.js.map +1 -1
  371. package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.d.ts +1 -2
  372. package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.js +3 -3
  373. package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.js.map +1 -1
  374. package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.d.ts +1 -2
  375. package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.js +224 -219
  376. package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.js.map +1 -1
  377. package/dist/puck-editor/internal/plugins/templates-plugin/index.d.ts +5 -6
  378. package/dist/puck-editor/internal/plugins/templates-plugin/index.js +5 -5
  379. package/dist/puck-editor/internal/plugins/templates-plugin/index.js.map +1 -1
  380. package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.d.ts +0 -1
  381. package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.js +3 -3
  382. package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.js.map +1 -1
  383. package/dist/puck-editor/internal/plugins/templates-plugin/template-form.d.ts +1 -2
  384. package/dist/puck-editor/internal/plugins/templates-plugin/template-form.js +17 -16
  385. package/dist/puck-editor/internal/plugins/templates-plugin/template-form.js.map +1 -1
  386. package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.d.ts +1 -2
  387. package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.js +1 -1
  388. package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.js.map +1 -1
  389. package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.d.ts +0 -1
  390. package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.js +171 -161
  391. package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.js.map +1 -1
  392. package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.d.ts +0 -1
  393. package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.js +1 -1
  394. package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.js.map +1 -1
  395. package/dist/puck-editor/internal/plugins/templates-plugin/templates.d.ts +2 -3
  396. package/dist/puck-editor/internal/plugins/templates-plugin/templates.js +9 -2
  397. package/dist/puck-editor/internal/plugins/templates-plugin/templates.js.map +1 -1
  398. package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.d.ts +0 -1
  399. package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.js +22 -20
  400. package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.js.map +1 -1
  401. package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.d.ts +14 -5
  402. package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.js +23 -15
  403. package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.js.map +1 -1
  404. package/dist/puck-editor/internal/puck-augmentation.d.ts +0 -1
  405. package/dist/puck-editor/internal/puck-editor-provider.d.ts +0 -1
  406. package/dist/puck-editor/internal/puck-node.d.ts +0 -1
  407. package/dist/puck-editor/internal/puck-props.d.ts +13 -0
  408. package/dist/puck-editor/internal/puck-props.js +2 -0
  409. package/dist/puck-editor/internal/puck-props.js.map +1 -0
  410. package/dist/puck-editor/internal/puck-wrapper.d.ts +25 -6
  411. package/dist/puck-editor/internal/puck-wrapper.js +124 -115
  412. package/dist/puck-editor/internal/puck-wrapper.js.map +1 -1
  413. package/dist/puck-editor/internal/render/cropped-image.d.ts +1 -2
  414. package/dist/puck-editor/internal/render/cropped-image.js.map +1 -1
  415. package/dist/puck-editor/internal/smart-actions/action-selection.d.ts +8 -0
  416. package/dist/puck-editor/internal/smart-actions/action-selection.js +10 -0
  417. package/dist/puck-editor/internal/smart-actions/action-selection.js.map +1 -0
  418. package/dist/puck-editor/internal/smart-actions/index.d.ts +10 -4
  419. package/dist/puck-editor/internal/smart-actions/index.js +27 -12
  420. package/dist/puck-editor/internal/smart-actions/index.js.map +1 -1
  421. package/dist/puck-editor/internal/smart-actions/new-page.d.ts +3 -2
  422. package/dist/puck-editor/internal/smart-actions/new-page.js +6 -6
  423. package/dist/puck-editor/internal/smart-actions/new-page.js.map +1 -1
  424. package/dist/puck-editor/internal/smart-actions/open-puck-editor.d.ts +3 -2
  425. package/dist/puck-editor/internal/smart-actions/open-puck-editor.js +49 -37
  426. package/dist/puck-editor/internal/smart-actions/open-puck-editor.js.map +1 -1
  427. package/dist/puck-editor/internal/ui/calendar.d.ts +0 -1
  428. package/dist/puck-editor/internal/ui/calendar.js +1 -1
  429. package/dist/puck-editor/internal/ui/calendar.js.map +1 -1
  430. package/dist/puck-editor/internal/ui/component-list-accordion.d.ts +0 -1
  431. package/dist/puck-editor/internal/ui/dialog.d.ts +0 -1
  432. package/dist/puck-editor/internal/ui/dialog.js +33 -20
  433. package/dist/puck-editor/internal/ui/dialog.js.map +1 -1
  434. package/dist/puck-editor/internal/ui/drawer-item-content.d.ts +0 -1
  435. package/dist/puck-editor/internal/ui/icon-button.d.ts +0 -1
  436. package/dist/puck-editor/internal/ui/icon-button.js +1 -1
  437. package/dist/puck-editor/internal/ui/icon-button.js.map +1 -1
  438. package/dist/puck-editor/internal/ui/load-error-notice.d.ts +6 -0
  439. package/dist/puck-editor/internal/ui/load-error-notice.js +81 -0
  440. package/dist/puck-editor/internal/ui/load-error-notice.js.map +1 -0
  441. package/dist/puck-editor/internal/ui/popover.d.ts +0 -1
  442. package/dist/puck-editor/internal/ui/popover.js +1 -1
  443. package/dist/puck-editor/internal/ui/popover.js.map +1 -1
  444. package/dist/puck-editor/internal/ui/required-mark.d.ts +0 -1
  445. package/dist/puck-editor/internal/ui/scroll-area.d.ts +8 -0
  446. package/dist/puck-editor/internal/ui/scroll-area.js +160 -0
  447. package/dist/puck-editor/internal/ui/scroll-area.js.map +1 -0
  448. package/dist/puck-editor/internal/ui/search-control.d.ts +0 -1
  449. package/dist/puck-editor/internal/ui/search-control.js +3 -3
  450. package/dist/puck-editor/internal/ui/search-control.js.map +1 -1
  451. package/dist/puck-editor/internal/ui/use-panel-search-focus.d.ts +0 -1
  452. package/dist/puck-editor/internal/use-puck-overlay.d.ts +1 -2
  453. package/dist/puck-editor/internal/use-puck-overlay.js +6 -5
  454. package/dist/puck-editor/internal/use-puck-overlay.js.map +1 -1
  455. package/dist/puck-editor/internal/utils.d.ts +0 -1
  456. package/dist/puck-editor/render.d.ts +2 -3
  457. package/dist/puck-editor/render.js +1 -1
  458. package/dist/puck-editor/render.js.map +1 -1
  459. package/dist/puck-editor/server.d.ts +3 -4
  460. package/dist/puck-editor/server.js +1 -1
  461. package/dist/puck-editor/server.js.map +1 -1
  462. package/dist/puck-editor/smart-actions.d.ts +1 -2
  463. package/dist/puck-editor/smart-actions.js +1 -1
  464. package/dist/puck-editor/smart-actions.js.map +1 -1
  465. package/dist/shared/cn.d.ts +0 -1
  466. package/dist/shared/i18n.d.ts +0 -1
  467. package/dist/shared/revalidate-path.d.ts +1 -0
  468. package/dist/shared/revalidate-path.js +2 -0
  469. package/dist/shared/revalidate-path.js.map +1 -0
  470. package/dist/shared/toolbar-action.d.ts +0 -1
  471. package/dist/shared/use-is-hydrated.d.ts +0 -1
  472. package/dist/shared/use-is-in-iframe.d.ts +0 -1
  473. package/dist/shared/use-is-in-iframe.js +1 -1
  474. package/dist/shared/use-is-in-iframe.js.map +1 -1
  475. package/dist/smart-actions/internal/backend-edit-link.d.ts +6 -0
  476. package/dist/smart-actions/internal/backend-edit-link.js +60 -0
  477. package/dist/smart-actions/internal/backend-edit-link.js.map +1 -0
  478. package/dist/smart-actions/internal/get-smart-actions-context.d.ts +1 -2
  479. package/dist/smart-actions/internal/get-smart-actions-context.js +2 -2
  480. package/dist/smart-actions/internal/get-smart-actions-context.js.map +1 -1
  481. package/dist/smart-actions/internal/i18n.d.ts +1 -2
  482. package/dist/smart-actions/internal/i18n.js +16 -2
  483. package/dist/smart-actions/internal/i18n.js.map +1 -1
  484. package/dist/smart-actions/internal/logout-form.d.ts +2 -2
  485. package/dist/smart-actions/internal/logout-form.js +47 -40
  486. package/dist/smart-actions/internal/logout-form.js.map +1 -1
  487. package/dist/smart-actions/internal/refresh-page.d.ts +3 -2
  488. package/dist/smart-actions/internal/refresh-page.js +60 -53
  489. package/dist/smart-actions/internal/refresh-page.js.map +1 -1
  490. package/dist/smart-actions/internal/smart-actions-button.d.ts +22 -4
  491. package/dist/smart-actions/internal/smart-actions-button.js +36 -13
  492. package/dist/smart-actions/internal/smart-actions-button.js.map +1 -1
  493. package/dist/smart-actions/internal/smart-actions-config.d.ts +12 -4
  494. package/dist/smart-actions/internal/smart-actions-config.js +36 -80
  495. package/dist/smart-actions/internal/smart-actions-config.js.map +1 -1
  496. package/dist/smart-actions/internal/smart-actions-toolbar-client.d.ts +5 -11
  497. package/dist/smart-actions/internal/smart-actions-toolbar-client.js +13 -53
  498. package/dist/smart-actions/internal/smart-actions-toolbar-client.js.map +1 -1
  499. package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.d.ts +1 -2
  500. package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.js +4 -4
  501. package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.js.map +1 -1
  502. package/dist/smart-actions/internal/toolbar/storage.d.ts +1 -2
  503. package/dist/smart-actions/internal/toolbar/storage.js.map +1 -1
  504. package/dist/smart-actions/internal/toolbar/types.d.ts +1 -2
  505. package/dist/smart-actions/internal/toolbar/types.js.map +1 -1
  506. package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.d.ts +1 -2
  507. package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.js +1 -1
  508. package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.js.map +1 -1
  509. package/dist/smart-actions/internal/ui/tooltip.d.ts +0 -1
  510. package/dist/smart-actions/internal/ui/tooltip.js +1 -1
  511. package/dist/smart-actions/internal/ui/tooltip.js.map +1 -1
  512. package/dist/smart-actions/internal/user-profile.d.ts +0 -1
  513. package/dist/smart-actions/internal/user-profile.js +71 -24
  514. package/dist/smart-actions/internal/user-profile.js.map +1 -1
  515. package/dist/smart-actions/server.d.ts +5 -4
  516. package/dist/smart-actions/server.js +2 -2
  517. package/dist/smart-actions/server.js.map +1 -1
  518. package/dist/theme.css +1 -1
  519. package/dist/visual-editor/index.d.ts +3 -4
  520. package/dist/visual-editor/index.js +3 -3
  521. package/dist/visual-editor/index.js.map +1 -1
  522. package/dist/visual-editor/internal/bridge/connector.d.ts +4 -3
  523. package/dist/visual-editor/internal/bridge/connector.js +22 -21
  524. package/dist/visual-editor/internal/bridge/connector.js.map +1 -1
  525. package/dist/visual-editor/internal/bridge/draft-mode-self-heal.d.ts +0 -1
  526. package/dist/visual-editor/internal/bridge/editor-auth-gate-server.d.ts +5 -3
  527. package/dist/visual-editor/internal/bridge/editor-auth-gate-server.js +7 -8
  528. package/dist/visual-editor/internal/bridge/editor-auth-gate-server.js.map +1 -1
  529. package/dist/visual-editor/internal/bridge/editor-auth-gate.d.ts +3 -3
  530. package/dist/visual-editor/internal/bridge/editor-auth-gate.js +4 -2
  531. package/dist/visual-editor/internal/bridge/editor-auth-gate.js.map +1 -1
  532. package/dist/visual-editor/internal/i18n.d.ts +3 -2
  533. package/dist/visual-editor/internal/i18n.js +32 -4
  534. package/dist/visual-editor/internal/i18n.js.map +1 -1
  535. package/dist/visual-editor/internal/overlays/drupal-origin.d.ts +1 -7
  536. package/dist/visual-editor/internal/overlays/drupal-origin.js +16 -3
  537. package/dist/visual-editor/internal/overlays/drupal-origin.js.map +1 -1
  538. package/dist/visual-editor/internal/overlays/edit-button.d.ts +5 -4
  539. package/dist/visual-editor/internal/overlays/edit-button.js +46 -44
  540. package/dist/visual-editor/internal/overlays/edit-button.js.map +1 -1
  541. package/dist/visual-editor/internal/overlays/edit-icon.d.ts +0 -1
  542. package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.d.ts +11 -2
  543. package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.js +18 -7
  544. package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.js.map +1 -1
  545. package/dist/visual-editor/internal/overlays/iframe-wrapper.d.ts +0 -1
  546. package/dist/visual-editor/internal/overlays/iframe-wrapper.js +1 -1
  547. package/dist/visual-editor/internal/overlays/iframe-wrapper.js.map +1 -1
  548. package/dist/visual-editor/internal/overlays/menu/menu-wrapper.d.ts +12 -3
  549. package/dist/visual-editor/internal/overlays/menu/menu-wrapper.js +14 -5
  550. package/dist/visual-editor/internal/overlays/menu/menu-wrapper.js.map +1 -1
  551. package/dist/visual-editor/internal/overlays/node/node-metadata.d.ts +4 -2
  552. package/dist/visual-editor/internal/overlays/node/node-metadata.js +10 -4
  553. package/dist/visual-editor/internal/overlays/node/node-metadata.js.map +1 -1
  554. package/dist/visual-editor/internal/overlays/node/node-wrapper.d.ts +5 -3
  555. package/dist/visual-editor/internal/overlays/node/node-wrapper.js +4 -2
  556. package/dist/visual-editor/internal/overlays/node/node-wrapper.js.map +1 -1
  557. package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.d.ts +11 -2
  558. package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.js +18 -7
  559. package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.js.map +1 -1
  560. package/dist/visual-editor/internal/revalidate-route.d.ts +0 -1
  561. package/dist/visual-editor/internal/revalidate-route.js +1 -1
  562. package/dist/visual-editor/internal/revalidate-route.js.map +1 -1
  563. package/dist/visual-editor/server.d.ts +6 -7
  564. package/dist/visual-editor/server.js +6 -6
  565. package/dist/visual-editor/server.js.map +1 -1
  566. package/package.json +20 -3
  567. package/dist/auth/index.d.ts.map +0 -1
  568. package/dist/auth/internal/config.d.ts.map +0 -1
  569. package/dist/auth/internal/draft-mode.d.ts.map +0 -1
  570. package/dist/auth/internal/editor-locale.d.ts.map +0 -1
  571. package/dist/auth/internal/handoff.d.ts.map +0 -1
  572. package/dist/auth/internal/has-session.d.ts.map +0 -1
  573. package/dist/auth/internal/logout.d.ts.map +0 -1
  574. package/dist/auth/internal/next-cookie-storage.d.ts.map +0 -1
  575. package/dist/auth/internal/nodehive-client.d.ts.map +0 -1
  576. package/dist/auth/internal/oauth-config.d.ts.map +0 -1
  577. package/dist/auth/internal/proxy-helpers.d.ts.map +0 -1
  578. package/dist/auth/internal/refresh.d.ts.map +0 -1
  579. package/dist/auth/internal/require-auth.d.ts.map +0 -1
  580. package/dist/auth/internal/return-to.d.ts.map +0 -1
  581. package/dist/auth/internal/routes/callback.d.ts.map +0 -1
  582. package/dist/auth/internal/routes/chips-exchange.d.ts.map +0 -1
  583. package/dist/auth/internal/routes/draft.d.ts.map +0 -1
  584. package/dist/auth/internal/routes/index.d.ts.map +0 -1
  585. package/dist/auth/internal/routes/login.d.ts.map +0 -1
  586. package/dist/auth/internal/routes/popup-done.d.ts.map +0 -1
  587. package/dist/auth/internal/routes/refresh.d.ts.map +0 -1
  588. package/dist/auth/internal/same-origin.d.ts.map +0 -1
  589. package/dist/auth/internal/session-gates.d.ts.map +0 -1
  590. package/dist/auth/internal/update-session.d.ts.map +0 -1
  591. package/dist/auth/internal/use-editor-login.d.ts.map +0 -1
  592. package/dist/auth/proxy.d.ts.map +0 -1
  593. package/dist/auth/react.d.ts.map +0 -1
  594. package/dist/auth/routes.d.ts.map +0 -1
  595. package/dist/auth/server.d.ts.map +0 -1
  596. package/dist/puck-editor/fields.d.ts.map +0 -1
  597. package/dist/puck-editor/index.d.ts.map +0 -1
  598. package/dist/puck-editor/internal/api/client.d.ts.map +0 -1
  599. package/dist/puck-editor/internal/api/config.d.ts.map +0 -1
  600. package/dist/puck-editor/internal/api/create-puck-api.d.ts.map +0 -1
  601. package/dist/puck-editor/internal/api/handlers/create-page.d.ts.map +0 -1
  602. package/dist/puck-editor/internal/api/handlers/entities.d.ts.map +0 -1
  603. package/dist/puck-editor/internal/api/handlers/publish.d.ts.map +0 -1
  604. package/dist/puck-editor/internal/api/handlers/template.d.ts.map +0 -1
  605. package/dist/puck-editor/internal/api/handlers/upload.d.ts.map +0 -1
  606. package/dist/puck-editor/internal/api/media-params.d.ts.map +0 -1
  607. package/dist/puck-editor/internal/api/media-upload.d.ts.map +0 -1
  608. package/dist/puck-editor/internal/api/space.d.ts.map +0 -1
  609. package/dist/puck-editor/internal/content-model.d.ts.map +0 -1
  610. package/dist/puck-editor/internal/editor/allowed-types.d.ts.map +0 -1
  611. package/dist/puck-editor/internal/editor/canvas-add-picker.d.ts.map +0 -1
  612. package/dist/puck-editor/internal/editor/canvas-empty-state.d.ts.map +0 -1
  613. package/dist/puck-editor/internal/editor/canvas-quick-add.d.ts.map +0 -1
  614. package/dist/puck-editor/internal/editor/canvas-scroll.d.ts.map +0 -1
  615. package/dist/puck-editor/internal/editor/component-icons.d.ts.map +0 -1
  616. package/dist/puck-editor/internal/editor/component-item.d.ts.map +0 -1
  617. package/dist/puck-editor/internal/editor/editor-action-bar.d.ts.map +0 -1
  618. package/dist/puck-editor/internal/editor/editor-header-actions.d.ts.map +0 -1
  619. package/dist/puck-editor/internal/editor/find-missing-required-fields.d.ts.map +0 -1
  620. package/dist/puck-editor/internal/editor/grouped-drawer-panel.d.ts.map +0 -1
  621. package/dist/puck-editor/internal/editor/grouped-entry-list.d.ts.map +0 -1
  622. package/dist/puck-editor/internal/editor/header-save-button.d.ts.map +0 -1
  623. package/dist/puck-editor/internal/editor/page-template-picker.d.ts.map +0 -1
  624. package/dist/puck-editor/internal/editor/picker-entry-item.d.ts.map +0 -1
  625. package/dist/puck-editor/internal/editor/picker-model.d.ts.map +0 -1
  626. package/dist/puck-editor/internal/editor/publish-puck-data.d.ts.map +0 -1
  627. package/dist/puck-editor/internal/editor/puck-editor.d.ts.map +0 -1
  628. package/dist/puck-editor/internal/editor/section-template-modal.d.ts.map +0 -1
  629. package/dist/puck-editor/internal/editor/use-frame-zoom.d.ts.map +0 -1
  630. package/dist/puck-editor/internal/editor/use-scroll-lock-outside.d.ts.map +0 -1
  631. package/dist/puck-editor/internal/editor-config.d.ts.map +0 -1
  632. package/dist/puck-editor/internal/editor-query-client.d.ts.map +0 -1
  633. package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.d.ts.map +0 -1
  634. package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.d.ts.map +0 -1
  635. package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.d.ts.map +0 -1
  636. package/dist/puck-editor/internal/fields/date-picker/date-picker.d.ts.map +0 -1
  637. package/dist/puck-editor/internal/fields/index.d.ts.map +0 -1
  638. package/dist/puck-editor/internal/fields/link-picker/anchor.d.ts.map +0 -1
  639. package/dist/puck-editor/internal/fields/link-picker/create-link-field.d.ts.map +0 -1
  640. package/dist/puck-editor/internal/fields/link-picker/humanize.d.ts.map +0 -1
  641. package/dist/puck-editor/internal/fields/link-picker/link-picker-control.d.ts.map +0 -1
  642. package/dist/puck-editor/internal/fields/link-picker/link-picker-field.d.ts.map +0 -1
  643. package/dist/puck-editor/internal/fields/link-picker/link-value.d.ts.map +0 -1
  644. package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.d.ts.map +0 -1
  645. package/dist/puck-editor/internal/fields/link-picker/richtext-extensions.d.ts.map +0 -1
  646. package/dist/puck-editor/internal/fields/link-picker/segmented-control.d.ts.map +0 -1
  647. package/dist/puck-editor/internal/fields/link-picker/types.d.ts.map +0 -1
  648. package/dist/puck-editor/internal/fields/media-array/create-media-array-field.d.ts.map +0 -1
  649. package/dist/puck-editor/internal/fields/media-array/media-array-field.d.ts.map +0 -1
  650. package/dist/puck-editor/internal/fields/media-array/reorder.d.ts.map +0 -1
  651. package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.d.ts.map +0 -1
  652. package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.d.ts.map +0 -1
  653. package/dist/puck-editor/internal/fields/media-selector/crop-types.d.ts.map +0 -1
  654. package/dist/puck-editor/internal/fields/media-selector/extract-fields.d.ts.map +0 -1
  655. package/dist/puck-editor/internal/fields/media-selector/image-upload-form.d.ts.map +0 -1
  656. package/dist/puck-editor/internal/fields/media-selector/media-selector-field.d.ts.map +0 -1
  657. package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.d.ts.map +0 -1
  658. package/dist/puck-editor/internal/fields/media-selector/use-debounced-value.d.ts.map +0 -1
  659. package/dist/puck-editor/internal/fields/media-selector/use-media-library.d.ts.map +0 -1
  660. package/dist/puck-editor/internal/fields/media-selector/video-upload-form.d.ts.map +0 -1
  661. package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.d.ts.map +0 -1
  662. package/dist/puck-editor/internal/fields/required-field-label.d.ts.map +0 -1
  663. package/dist/puck-editor/internal/fields/required.d.ts.map +0 -1
  664. package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.d.ts.map +0 -1
  665. package/dist/puck-editor/internal/i18n.d.ts.map +0 -1
  666. package/dist/puck-editor/internal/locale.d.ts.map +0 -1
  667. package/dist/puck-editor/internal/localize.d.ts.map +0 -1
  668. package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.d.ts.map +0 -1
  669. package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.d.ts.map +0 -1
  670. package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.d.ts.map +0 -1
  671. package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.d.ts.map +0 -1
  672. package/dist/puck-editor/internal/plugins/agent-plugin/catalog.d.ts.map +0 -1
  673. package/dist/puck-editor/internal/plugins/agent-plugin/constants.d.ts.map +0 -1
  674. package/dist/puck-editor/internal/plugins/agent-plugin/create-page.d.ts.map +0 -1
  675. package/dist/puck-editor/internal/plugins/agent-plugin/find-component-location.d.ts.map +0 -1
  676. package/dist/puck-editor/internal/plugins/agent-plugin/help.d.ts.map +0 -1
  677. package/dist/puck-editor/internal/plugins/agent-plugin/index.d.ts.map +0 -1
  678. package/dist/puck-editor/internal/plugins/agent-plugin/list-media.d.ts.map +0 -1
  679. package/dist/puck-editor/internal/plugins/agent-plugin/templates.d.ts.map +0 -1
  680. package/dist/puck-editor/internal/plugins/agent-plugin/upload-media.d.ts.map +0 -1
  681. package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.d.ts.map +0 -1
  682. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.d.ts.map +0 -1
  683. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.d.ts.map +0 -1
  684. package/dist/puck-editor/internal/plugins/blocks-plugin/index.d.ts.map +0 -1
  685. package/dist/puck-editor/internal/plugins/outline-plugin/index.d.ts.map +0 -1
  686. package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.d.ts.map +0 -1
  687. package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.d.ts.map +0 -1
  688. package/dist/puck-editor/internal/plugins/outline-plugin/outline-tree.d.ts.map +0 -1
  689. package/dist/puck-editor/internal/plugins/sections-plugin/index.d.ts.map +0 -1
  690. package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.d.ts.map +0 -1
  691. package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.d.ts.map +0 -1
  692. package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.d.ts.map +0 -1
  693. package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.d.ts.map +0 -1
  694. package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.d.ts.map +0 -1
  695. package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.d.ts.map +0 -1
  696. package/dist/puck-editor/internal/plugins/templates-plugin/index.d.ts.map +0 -1
  697. package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.d.ts.map +0 -1
  698. package/dist/puck-editor/internal/plugins/templates-plugin/template-form.d.ts.map +0 -1
  699. package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.d.ts.map +0 -1
  700. package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.d.ts.map +0 -1
  701. package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.d.ts.map +0 -1
  702. package/dist/puck-editor/internal/plugins/templates-plugin/templates.d.ts.map +0 -1
  703. package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.d.ts.map +0 -1
  704. package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.d.ts.map +0 -1
  705. package/dist/puck-editor/internal/puck-augmentation.d.ts.map +0 -1
  706. package/dist/puck-editor/internal/puck-editor-provider.d.ts.map +0 -1
  707. package/dist/puck-editor/internal/puck-node.d.ts.map +0 -1
  708. package/dist/puck-editor/internal/puck-wrapper.d.ts.map +0 -1
  709. package/dist/puck-editor/internal/render/cropped-image.d.ts.map +0 -1
  710. package/dist/puck-editor/internal/smart-actions/index.d.ts.map +0 -1
  711. package/dist/puck-editor/internal/smart-actions/new-page.d.ts.map +0 -1
  712. package/dist/puck-editor/internal/smart-actions/open-puck-editor.d.ts.map +0 -1
  713. package/dist/puck-editor/internal/ui/calendar.d.ts.map +0 -1
  714. package/dist/puck-editor/internal/ui/component-list-accordion.d.ts.map +0 -1
  715. package/dist/puck-editor/internal/ui/dialog.d.ts.map +0 -1
  716. package/dist/puck-editor/internal/ui/drawer-item-content.d.ts.map +0 -1
  717. package/dist/puck-editor/internal/ui/icon-button.d.ts.map +0 -1
  718. package/dist/puck-editor/internal/ui/popover.d.ts.map +0 -1
  719. package/dist/puck-editor/internal/ui/required-mark.d.ts.map +0 -1
  720. package/dist/puck-editor/internal/ui/search-control.d.ts.map +0 -1
  721. package/dist/puck-editor/internal/ui/use-panel-search-focus.d.ts.map +0 -1
  722. package/dist/puck-editor/internal/use-puck-overlay.d.ts.map +0 -1
  723. package/dist/puck-editor/internal/utils.d.ts.map +0 -1
  724. package/dist/puck-editor/render.d.ts.map +0 -1
  725. package/dist/puck-editor/server.d.ts.map +0 -1
  726. package/dist/puck-editor/smart-actions.d.ts.map +0 -1
  727. package/dist/shared/cn.d.ts.map +0 -1
  728. package/dist/shared/i18n.d.ts.map +0 -1
  729. package/dist/shared/toolbar-action.d.ts.map +0 -1
  730. package/dist/shared/use-is-hydrated.d.ts.map +0 -1
  731. package/dist/shared/use-is-in-iframe.d.ts.map +0 -1
  732. package/dist/smart-actions/internal/get-smart-actions-context.d.ts.map +0 -1
  733. package/dist/smart-actions/internal/i18n.d.ts.map +0 -1
  734. package/dist/smart-actions/internal/logout-form.d.ts.map +0 -1
  735. package/dist/smart-actions/internal/refresh-page.d.ts.map +0 -1
  736. package/dist/smart-actions/internal/smart-actions-button.d.ts.map +0 -1
  737. package/dist/smart-actions/internal/smart-actions-config.d.ts.map +0 -1
  738. package/dist/smart-actions/internal/smart-actions-toolbar-client.d.ts.map +0 -1
  739. package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.d.ts.map +0 -1
  740. package/dist/smart-actions/internal/toolbar/storage.d.ts.map +0 -1
  741. package/dist/smart-actions/internal/toolbar/types.d.ts.map +0 -1
  742. package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.d.ts.map +0 -1
  743. package/dist/smart-actions/internal/ui/tooltip.d.ts.map +0 -1
  744. package/dist/smart-actions/internal/user-profile.d.ts.map +0 -1
  745. package/dist/smart-actions/server.d.ts.map +0 -1
  746. package/dist/visual-editor/index.d.ts.map +0 -1
  747. package/dist/visual-editor/internal/bridge/connector.d.ts.map +0 -1
  748. package/dist/visual-editor/internal/bridge/draft-mode-self-heal.d.ts.map +0 -1
  749. package/dist/visual-editor/internal/bridge/editor-auth-gate-server.d.ts.map +0 -1
  750. package/dist/visual-editor/internal/bridge/editor-auth-gate.d.ts.map +0 -1
  751. package/dist/visual-editor/internal/i18n.d.ts.map +0 -1
  752. package/dist/visual-editor/internal/overlays/drupal-origin.d.ts.map +0 -1
  753. package/dist/visual-editor/internal/overlays/edit-button.d.ts.map +0 -1
  754. package/dist/visual-editor/internal/overlays/edit-icon.d.ts.map +0 -1
  755. package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.d.ts.map +0 -1
  756. package/dist/visual-editor/internal/overlays/iframe-wrapper.d.ts.map +0 -1
  757. package/dist/visual-editor/internal/overlays/menu/menu-wrapper.d.ts.map +0 -1
  758. package/dist/visual-editor/internal/overlays/node/node-metadata.d.ts.map +0 -1
  759. package/dist/visual-editor/internal/overlays/node/node-wrapper.d.ts.map +0 -1
  760. package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.d.ts.map +0 -1
  761. package/dist/visual-editor/internal/revalidate-route.d.ts.map +0 -1
  762. package/dist/visual-editor/server.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"component-icons.js","names":["BlocksIcon","BoxIcon","LayoutTemplateIcon","PanelsTopLeftIcon","DynamicIcon","jsx","_jsx","CATEGORY_ICONS","page","className","section","block","componentIcon","config","name","components","icon","entryIcon","entry","iconNode","template","templateIcon","category","primaryType"],"sources":["../../../../src/puck-editor/internal/editor/component-icons.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { Config } from '@puckeditor/core';\nimport {\n BlocksIcon,\n BoxIcon,\n LayoutTemplateIcon,\n PanelsTopLeftIcon,\n} from 'lucide-react';\nimport { DynamicIcon, type IconName } from 'lucide-react/dynamic';\n\nimport type { TemplateCategory } from '../plugins/templates-plugin/templates';\n\nconst CATEGORY_ICONS: Record<TemplateCategory, ReactNode> = {\n page: <LayoutTemplateIcon className=\"nh:size-4\" />,\n section: <PanelsTopLeftIcon className=\"nh:size-4\" />,\n block: <BlocksIcon className=\"nh:size-4\" />,\n};\n\nexport function componentIcon(config: Config, name: string): ReactNode {\n return config.components[name]?.icon ?? <BoxIcon className=\"nh:size-4\" />;\n}\n\nexport function entryIcon(\n config: Config,\n entry: {\n icon?: string;\n iconNode?: ReactNode;\n template?: { category?: TemplateCategory };\n primaryType: string;\n }\n): ReactNode {\n if (entry.iconNode) return entry.iconNode;\n return entry.icon || entry.template\n ? templateIcon(entry.icon, entry.template?.category)\n : componentIcon(config, entry.primaryType);\n}\n\nexport function templateIcon(\n icon?: string,\n category?: TemplateCategory\n): ReactNode {\n if (icon) {\n return <DynamicIcon name={icon as IconName} className=\"nh:size-4\" />;\n }\n return (\n (category && CATEGORY_ICONS[category]) ?? (\n <LayoutTemplateIcon className=\"nh:size-4\" />\n )\n );\n}\n"],"mappings":"AAEA,SACEA,UAAU,EACVC,OAAO,EACPC,kBAAkB,EAClBC,iBAAiB,QACZ,cAAc;AACrB,SAASC,WAAW,QAAuB,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAIlE,MAAMC,cAAmD,GAAG;EAC1DC,IAAI,eAAEF,IAAA,CAACJ,kBAAkB;IAACO,SAAS,EAAC;EAAW,CAAE,CAAC;EAClDC,OAAO,eAAEJ,IAAA,CAACH,iBAAiB;IAACM,SAAS,EAAC;EAAW,CAAE,CAAC;EACpDE,KAAK,eAAEL,IAAA,CAACN,UAAU;IAACS,SAAS,EAAC;EAAW,CAAE;AAC5C,CAAC;AAED,OAAO,SAASG,aAAaA,CAACC,MAAc,EAAEC,IAAY,EAAa;EACrE,OAAOD,MAAM,CAACE,UAAU,CAACD,IAAI,CAAC,EAAEE,IAAI,iBAAIV,IAAA,CAACL,OAAO;IAACQ,SAAS,EAAC;EAAW,CAAE,CAAC;AAC3E;AAEA,OAAO,SAASQ,SAASA,CACvBJ,MAAc,EACdK,KAKC,EACU;EACX,IAAIA,KAAK,CAACC,QAAQ,EAAE,OAAOD,KAAK,CAACC,QAAQ;EACzC,OAAOD,KAAK,CAACF,IAAI,IAAIE,KAAK,CAACE,QAAQ,GAC/BC,YAAY,CAACH,KAAK,CAACF,IAAI,EAAEE,KAAK,CAACE,QAAQ,EAAEE,QAAQ,CAAC,GAClDV,aAAa,CAACC,MAAM,EAAEK,KAAK,CAACK,WAAW,CAAC;AAC9C;AAEA,OAAO,SAASF,YAAYA,CAC1BL,IAAa,EACbM,QAA2B,EAChB;EACX,IAAIN,IAAI,EAAE;IACR,oBAAOV,IAAA,CAACF,WAAW;MAACU,IAAI,EAAEE,IAAiB;MAACP,SAAS,EAAC;IAAW,CAAE,CAAC;EACtE;EACA,OACE,CAACa,QAAQ,IAAIf,cAAc,CAACe,QAAQ,CAAC,kBACnChB,IAAA,CAACJ,kBAAkB;IAACO,SAAS,EAAC;EAAW,CAAE,CAC5C;AAEL","ignoreList":[]}
1
+ {"version":3,"file":"component-icons.js","names":["BlocksIcon","BoxIcon","LayoutTemplateIcon","PanelsTopLeftIcon","DynamicIcon","jsx","_jsx","CATEGORY_ICONS","page","className","section","block","componentIcon","config","name","components","icon","entryIcon","entry","iconNode","template","templateIcon","category","primaryType"],"sources":["../../../../src/puck-editor/internal/editor/component-icons.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { Config } from '@puckeditor/core';\nimport {\n BlocksIcon,\n BoxIcon,\n LayoutTemplateIcon,\n PanelsTopLeftIcon,\n} from 'lucide-react';\nimport { DynamicIcon, type IconName } from 'lucide-react/dynamic';\n\nimport type { TemplateCategory } from '../plugins/templates-plugin/templates.ts';\n\nconst CATEGORY_ICONS: Record<TemplateCategory, ReactNode> = {\n page: <LayoutTemplateIcon className=\"nh:size-4\" />,\n section: <PanelsTopLeftIcon className=\"nh:size-4\" />,\n block: <BlocksIcon className=\"nh:size-4\" />,\n};\n\nexport function componentIcon(config: Config, name: string): ReactNode {\n return config.components[name]?.icon ?? <BoxIcon className=\"nh:size-4\" />;\n}\n\nexport function entryIcon(\n config: Config,\n entry: {\n icon?: string;\n iconNode?: ReactNode;\n template?: { category?: TemplateCategory };\n primaryType: string;\n }\n): ReactNode {\n if (entry.iconNode) return entry.iconNode;\n return entry.icon || entry.template\n ? templateIcon(entry.icon, entry.template?.category)\n : componentIcon(config, entry.primaryType);\n}\n\nexport function templateIcon(\n icon?: string,\n category?: TemplateCategory\n): ReactNode {\n if (icon) {\n return <DynamicIcon name={icon as IconName} className=\"nh:size-4\" />;\n }\n return (\n (category && CATEGORY_ICONS[category]) ?? (\n <LayoutTemplateIcon className=\"nh:size-4\" />\n )\n );\n}\n"],"mappings":"AAEA,SACEA,UAAU,EACVC,OAAO,EACPC,kBAAkB,EAClBC,iBAAiB,QACZ,cAAc;AACrB,SAASC,WAAW,QAAuB,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAIlE,MAAMC,cAAmD,GAAG;EAC1DC,IAAI,eAAEF,IAAA,CAACJ,kBAAkB;IAACO,SAAS,EAAC;EAAW,CAAE,CAAC;EAClDC,OAAO,eAAEJ,IAAA,CAACH,iBAAiB;IAACM,SAAS,EAAC;EAAW,CAAE,CAAC;EACpDE,KAAK,eAAEL,IAAA,CAACN,UAAU;IAACS,SAAS,EAAC;EAAW,CAAE;AAC5C,CAAC;AAED,OAAO,SAASG,aAAaA,CAACC,MAAc,EAAEC,IAAY,EAAa;EACrE,OAAOD,MAAM,CAACE,UAAU,CAACD,IAAI,CAAC,EAAEE,IAAI,iBAAIV,IAAA,CAACL,OAAO;IAACQ,SAAS,EAAC;EAAW,CAAE,CAAC;AAC3E;AAEA,OAAO,SAASQ,SAASA,CACvBJ,MAAc,EACdK,KAKC,EACU;EACX,IAAIA,KAAK,CAACC,QAAQ,EAAE,OAAOD,KAAK,CAACC,QAAQ;EACzC,OAAOD,KAAK,CAACF,IAAI,IAAIE,KAAK,CAACE,QAAQ,GAC/BC,YAAY,CAACH,KAAK,CAACF,IAAI,EAAEE,KAAK,CAACE,QAAQ,EAAEE,QAAQ,CAAC,GAClDV,aAAa,CAACC,MAAM,EAAEK,KAAK,CAACK,WAAW,CAAC;AAC9C;AAEA,OAAO,SAASF,YAAYA,CAC1BL,IAAa,EACbM,QAA2B,EAChB;EACX,IAAIN,IAAI,EAAE;IACR,oBAAOV,IAAA,CAACF,WAAW;MAACU,IAAI,EAAEE,IAAiB;MAACP,SAAS,EAAC;IAAW,CAAE,CAAC;EACtE;EACA,OACE,CAACa,QAAQ,IAAIf,cAAc,CAACe,QAAQ,CAAC,kBACnChB,IAAA,CAACJ,kBAAkB;IAACO,SAAS,EAAC;EAAW,CAAE,CAC5C;AAEL","ignoreList":[]}
@@ -3,4 +3,3 @@ type ComponentItemProps = {
3
3
  };
4
4
  export default function ComponentItem({ name }: ComponentItemProps): import("react").JSX.Element;
5
5
  export {};
6
- //# sourceMappingURL=component-item.d.ts.map
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { c as _c } from "react/compiler-runtime";
4
4
  import { createUsePuck } from '@puckeditor/core';
5
- import { DrawerItemContent } from '../ui/drawer-item-content';
6
- import { componentIcon } from './component-icons';
5
+ import { DrawerItemContent } from "../ui/drawer-item-content.js";
6
+ import { componentIcon } from "./component-icons.js";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  const usePuck = createUsePuck();
9
9
  export default function ComponentItem(t0) {
@@ -1 +1 @@
1
- {"version":3,"file":"component-item.js","names":["c","_c","createUsePuck","DrawerItemContent","componentIcon","jsx","_jsx","usePuck","ComponentItem","t0","$","name","config","_temp","label","components","t1","t2","icon","s"],"sources":["../../../../src/puck-editor/internal/editor/component-item.tsx"],"sourcesContent":["'use client';\n\nimport { createUsePuck } from '@puckeditor/core';\n\nimport { DrawerItemContent } from '../ui/drawer-item-content';\nimport { componentIcon } from './component-icons';\n\ntype ComponentItemProps = {\n name: string;\n};\n\nconst usePuck = createUsePuck();\n\nexport default function ComponentItem({ name }: ComponentItemProps) {\n const config = usePuck((s) => s.config);\n const label = config.components?.[name]?.label || name;\n\n return <DrawerItemContent icon={componentIcon(config, name)} label={label} />;\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAEb,SAASC,aAAa,QAAQ,kBAAkB;AAEhD,SAASC,iBAAiB,QAAQ,2BAA2B;AAC7D,SAASC,aAAa,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAMlD,MAAMC,OAAO,GAAGL,aAAa,CAAC,CAAC;AAE/B,eAAe,SAAAM,cAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAT,EAAA;EAAuB;IAAAU;EAAA,IAAAF,EAA4B;EAChE,MAAAG,MAAA,GAAeL,OAAO,CAACM,KAAe,CAAC;EACvC,MAAAC,KAAA,GAAcF,MAAM,CAAAG,UAAmB,GAALJ,IAAI,CAAQ,EAAAG,KAAQ,IAAxCH,IAAwC;EAAC,IAAAK,EAAA;EAAA,IAAAN,CAAA,QAAAE,MAAA,IAAAF,CAAA,QAAAC,IAAA;IAEvBK,EAAA,GAAAZ,aAAa,CAACQ,MAAM,EAAED,IAAI,CAAC;IAAAD,CAAA,MAAAE,MAAA;IAAAF,CAAA,MAAAC,IAAA;IAAAD,CAAA,MAAAM,EAAA;EAAA;IAAAA,EAAA,GAAAN,CAAA;EAAA;EAAA,IAAAO,EAAA;EAAA,IAAAP,CAAA,QAAAI,KAAA,IAAAJ,CAAA,QAAAM,EAAA;IAApDC,EAAA,gBAAAX,IAAA,CAACH,iBAAiB;MAAOe,IAA2B,EAA3BF,EAA2B;MAASF,KAAK,EAALA;IAAK,CAAG,CAAC;IAAAJ,CAAA,MAAAI,KAAA;IAAAJ,CAAA,MAAAM,EAAA;IAAAN,CAAA,MAAAO,EAAA;EAAA;IAAAA,EAAA,GAAAP,CAAA;EAAA;EAAA,OAAtEO,EAAsE;AAAA;AAJhE,SAAAJ,MAAAM,CAAA;EAAA,OACiBA,CAAC,CAAAP,MAAO;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"component-item.js","names":["c","_c","createUsePuck","DrawerItemContent","componentIcon","jsx","_jsx","usePuck","ComponentItem","t0","$","name","config","_temp","label","components","t1","t2","icon","s"],"sources":["../../../../src/puck-editor/internal/editor/component-item.tsx"],"sourcesContent":["'use client';\n\nimport { createUsePuck } from '@puckeditor/core';\n\nimport { DrawerItemContent } from '../ui/drawer-item-content.tsx';\nimport { componentIcon } from './component-icons.tsx';\n\ntype ComponentItemProps = {\n name: string;\n};\n\nconst usePuck = createUsePuck();\n\nexport default function ComponentItem({ name }: ComponentItemProps) {\n const config = usePuck((s) => s.config);\n const label = config.components?.[name]?.label || name;\n\n return <DrawerItemContent icon={componentIcon(config, name)} label={label} />;\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAEb,SAASC,aAAa,QAAQ,kBAAkB;AAEhD,SAASC,iBAAiB,QAAQ,8BAA+B;AACjE,SAASC,aAAa,QAAQ,sBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAMtD,MAAMC,OAAO,GAAGL,aAAa,CAAC,CAAC;AAE/B,eAAe,SAAAM,cAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAT,EAAA;EAAuB;IAAAU;EAAA,IAAAF,EAA4B;EAChE,MAAAG,MAAA,GAAeL,OAAO,CAACM,KAAe,CAAC;EACvC,MAAAC,KAAA,GAAcF,MAAM,CAAAG,UAAmB,GAALJ,IAAI,CAAQ,EAAAG,KAAQ,IAAxCH,IAAwC;EAAC,IAAAK,EAAA;EAAA,IAAAN,CAAA,QAAAE,MAAA,IAAAF,CAAA,QAAAC,IAAA;IAEvBK,EAAA,GAAAZ,aAAa,CAACQ,MAAM,EAAED,IAAI,CAAC;IAAAD,CAAA,MAAAE,MAAA;IAAAF,CAAA,MAAAC,IAAA;IAAAD,CAAA,MAAAM,EAAA;EAAA;IAAAA,EAAA,GAAAN,CAAA;EAAA;EAAA,IAAAO,EAAA;EAAA,IAAAP,CAAA,QAAAI,KAAA,IAAAJ,CAAA,QAAAM,EAAA;IAApDC,EAAA,gBAAAX,IAAA,CAACH,iBAAiB;MAAOe,IAA2B,EAA3BF,EAA2B;MAASF,KAAK,EAALA;IAAK,CAAG,CAAC;IAAAJ,CAAA,MAAAI,KAAA;IAAAJ,CAAA,MAAAM,EAAA;IAAAN,CAAA,MAAAO,EAAA;EAAA;IAAAA,EAAA,GAAAP,CAAA;EAAA;EAAA,OAAtEO,EAAsE;AAAA;AAJhE,SAAAJ,MAAAM,CAAA;EAAA,OACiBA,CAAC,CAAAP,MAAO;AAAA","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ import type { Config, Data } from '@puckeditor/core';
2
+ import type { PuckContentModel } from '../content-model.js';
3
+ import type { PuckValidate, PuckValidationIssue } from '../puck-props.js';
4
+ import { type MissingRequiredField } from './find-missing-required-fields.js';
5
+ export type ComposedSaveIssues = {
6
+ requiredIssues: MissingRequiredField[];
7
+ customIssues: PuckValidationIssue[];
8
+ blocked: boolean;
9
+ };
10
+ export declare function composeSaveIssues({ config, data, model, validate, }: {
11
+ config: Config;
12
+ data: Partial<Data>;
13
+ model: PuckContentModel;
14
+ validate?: PuckValidate;
15
+ }): ComposedSaveIssues;
@@ -0,0 +1,16 @@
1
+ import { findMissingRequiredFields } from "./find-missing-required-fields.js";
2
+ export function composeSaveIssues({
3
+ config,
4
+ data,
5
+ model,
6
+ validate
7
+ }) {
8
+ const requiredIssues = findMissingRequiredFields(config, data);
9
+ const customIssues = validate?.(data, config, model) ?? [];
10
+ return {
11
+ requiredIssues,
12
+ customIssues,
13
+ blocked: requiredIssues.length > 0 || customIssues.length > 0
14
+ };
15
+ }
16
+ //# sourceMappingURL=compose-save-issues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compose-save-issues.js","names":["findMissingRequiredFields","composeSaveIssues","config","data","model","validate","requiredIssues","customIssues","blocked","length"],"sources":["../../../../src/puck-editor/internal/editor/compose-save-issues.ts"],"sourcesContent":["import type { Config, Data } from '@puckeditor/core';\n\nimport type { PuckContentModel } from '../content-model.ts';\nimport type { PuckValidate, PuckValidationIssue } from '../puck-props.ts';\nimport {\n findMissingRequiredFields,\n type MissingRequiredField,\n} from './find-missing-required-fields.ts';\n\nexport type ComposedSaveIssues = {\n requiredIssues: MissingRequiredField[];\n customIssues: PuckValidationIssue[];\n blocked: boolean;\n};\n\nexport function composeSaveIssues({\n config,\n data,\n model,\n validate,\n}: {\n config: Config;\n data: Partial<Data>;\n model: PuckContentModel;\n validate?: PuckValidate;\n}): ComposedSaveIssues {\n const requiredIssues = findMissingRequiredFields(config, data);\n const customIssues = validate?.(data, config, model) ?? [];\n return {\n requiredIssues,\n customIssues,\n blocked: requiredIssues.length > 0 || customIssues.length > 0,\n };\n}\n"],"mappings":"AAIA,SACEA,yBAAyB,QAEpB,mCAAmC;AAQ1C,OAAO,SAASC,iBAAiBA,CAAC;EAChCC,MAAM;EACNC,IAAI;EACJC,KAAK;EACLC;AAMF,CAAC,EAAsB;EACrB,MAAMC,cAAc,GAAGN,yBAAyB,CAACE,MAAM,EAAEC,IAAI,CAAC;EAC9D,MAAMI,YAAY,GAAGF,QAAQ,GAAGF,IAAI,EAAED,MAAM,EAAEE,KAAK,CAAC,IAAI,EAAE;EAC1D,OAAO;IACLE,cAAc;IACdC,YAAY;IACZC,OAAO,EAAEF,cAAc,CAACG,MAAM,GAAG,CAAC,IAAIF,YAAY,CAACE,MAAM,GAAG;EAC9D,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import type { Data } from '@puckeditor/core';
2
+ export declare function serializePuckData(data: Partial<Data> | null | undefined): string;
3
+ export declare function isDirty(current: Partial<Data> | null | undefined, lastSaved: Partial<Data> | null | undefined): boolean;
@@ -0,0 +1,7 @@
1
+ export function serializePuckData(data) {
2
+ return JSON.stringify(data ?? {});
3
+ }
4
+ export function isDirty(current, lastSaved) {
5
+ return serializePuckData(current) !== serializePuckData(lastSaved);
6
+ }
7
+ //# sourceMappingURL=dirty-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dirty-state.js","names":["serializePuckData","data","JSON","stringify","isDirty","current","lastSaved"],"sources":["../../../../src/puck-editor/internal/editor/dirty-state.ts"],"sourcesContent":["import type { Data } from '@puckeditor/core';\n\nexport function serializePuckData(\n data: Partial<Data> | null | undefined\n): string {\n return JSON.stringify(data ?? {});\n}\n\nexport function isDirty(\n current: Partial<Data> | null | undefined,\n lastSaved: Partial<Data> | null | undefined\n): boolean {\n return serializePuckData(current) !== serializePuckData(lastSaved);\n}\n"],"mappings":"AAEA,OAAO,SAASA,iBAAiBA,CAC/BC,IAAsC,EAC9B;EACR,OAAOC,IAAI,CAACC,SAAS,CAACF,IAAI,IAAI,CAAC,CAAC,CAAC;AACnC;AAEA,OAAO,SAASG,OAAOA,CACrBC,OAAyC,EACzCC,SAA2C,EAClC;EACT,OAAON,iBAAiB,CAACK,OAAO,CAAC,KAAKL,iBAAiB,CAACM,SAAS,CAAC;AACpE","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ import { type Config, type Data } from '@puckeditor/core';
2
+ import { type PuckPropTransforms } from '../content-model.js';
3
+ import { type DraftIdentity } from './draft-storage.js';
4
+ export declare function DraftRestoreBanner({ identity, serverData, config, propTransforms, }: {
5
+ identity: DraftIdentity;
6
+ serverData: Partial<Data>;
7
+ config: Config;
8
+ propTransforms?: PuckPropTransforms;
9
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,289 @@
1
+ 'use client';
2
+
3
+ import { c as _c } from "react/compiler-runtime";
4
+ import { useEffect } from 'react';
5
+ import { AlertTriangleIcon, HistoryIcon } from 'lucide-react';
6
+ import { toast } from 'sonner';
7
+ import { cn } from "../../../shared/cn.js";
8
+ import { usePuckDictionary, usePuckLocale } from "../i18n.js";
9
+ import { useDraftRecovery } from "./use-draft-recovery.js";
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ function formatTimestamp(timestamp, locale) {
12
+ try {
13
+ return new Intl.DateTimeFormat(locale, {
14
+ dateStyle: 'medium',
15
+ timeStyle: 'short'
16
+ }).format(new Date(timestamp));
17
+ } catch {
18
+ return new Date(timestamp).toLocaleString();
19
+ }
20
+ }
21
+ export function DraftRestoreBanner(t0) {
22
+ const $ = _c(67);
23
+ const {
24
+ identity,
25
+ serverData,
26
+ config,
27
+ propTransforms
28
+ } = t0;
29
+ const t = usePuckDictionary().editor;
30
+ const locale = usePuckLocale();
31
+ let t1;
32
+ if ($[0] !== config || $[1] !== identity || $[2] !== propTransforms || $[3] !== serverData) {
33
+ t1 = {
34
+ identity,
35
+ serverData,
36
+ config,
37
+ propTransforms
38
+ };
39
+ $[0] = config;
40
+ $[1] = identity;
41
+ $[2] = propTransforms;
42
+ $[3] = serverData;
43
+ $[4] = t1;
44
+ } else {
45
+ t1 = $[4];
46
+ }
47
+ const {
48
+ decision,
49
+ restore,
50
+ discard,
51
+ quotaExceeded,
52
+ concurrentTab
53
+ } = useDraftRecovery(t1);
54
+ let t2;
55
+ let t3;
56
+ if ($[5] !== quotaExceeded || $[6] !== t.draftQuotaExceeded) {
57
+ t2 = () => {
58
+ if (quotaExceeded) {
59
+ toast.warning(t.draftQuotaExceeded);
60
+ }
61
+ };
62
+ t3 = [quotaExceeded, t.draftQuotaExceeded];
63
+ $[5] = quotaExceeded;
64
+ $[6] = t.draftQuotaExceeded;
65
+ $[7] = t2;
66
+ $[8] = t3;
67
+ } else {
68
+ t2 = $[7];
69
+ t3 = $[8];
70
+ }
71
+ useEffect(t2, t3);
72
+ let t4;
73
+ let t5;
74
+ if ($[9] !== concurrentTab || $[10] !== t.draftConcurrentTab) {
75
+ t4 = () => {
76
+ if (concurrentTab) {
77
+ toast.warning(t.draftConcurrentTab);
78
+ }
79
+ };
80
+ t5 = [concurrentTab, t.draftConcurrentTab];
81
+ $[9] = concurrentTab;
82
+ $[10] = t.draftConcurrentTab;
83
+ $[11] = t4;
84
+ $[12] = t5;
85
+ } else {
86
+ t4 = $[11];
87
+ t5 = $[12];
88
+ }
89
+ useEffect(t4, t5);
90
+ if (!decision.restorable) {
91
+ return null;
92
+ }
93
+ const {
94
+ conflict,
95
+ record
96
+ } = decision;
97
+ let t10;
98
+ let t11;
99
+ let t12;
100
+ let t13;
101
+ let t14;
102
+ let t15;
103
+ let t6;
104
+ let t7;
105
+ let t8;
106
+ let t9;
107
+ if ($[13] !== conflict || $[14] !== locale || $[15] !== record.updatedAt || $[16] !== t.draftAvailableBody || $[17] !== t.draftAvailableTitle || $[18] !== t.draftBannerLabel || $[19] !== t.draftConflictBody || $[20] !== t.draftConflictTitle) {
108
+ const savedAt = formatTimestamp(record.updatedAt, locale);
109
+ t13 = "region";
110
+ t14 = t.draftBannerLabel;
111
+ t15 = "nh:pointer-events-none nh:fixed nh:inset-x-0 nh:top-16 nh:z-[60] nh:flex nh:justify-center nh:px-4";
112
+ const t16 = !conflict;
113
+ if ($[31] !== conflict || $[32] !== t16) {
114
+ t11 = cn("nh:pointer-events-auto nh:flex nh:w-full nh:max-w-xl nh:items-start nh:gap-3 nh:rounded-lg nh:border nh:bg-white nh:px-4 nh:py-3 nh:shadow-lg", {
115
+ "nh:border-amber-300": conflict,
116
+ "nh:border-gray-200": t16
117
+ });
118
+ $[31] = conflict;
119
+ $[32] = t16;
120
+ $[33] = t11;
121
+ } else {
122
+ t11 = $[33];
123
+ }
124
+ if ($[34] !== conflict) {
125
+ t12 = conflict ? /*#__PURE__*/_jsx(AlertTriangleIcon, {
126
+ className: "nh:mt-0.5 nh:size-5 nh:shrink-0 nh:text-amber-500"
127
+ }) : /*#__PURE__*/_jsx(HistoryIcon, {
128
+ className: "nh:mt-0.5 nh:size-5 nh:shrink-0 nh:text-gray-500"
129
+ });
130
+ $[34] = conflict;
131
+ $[35] = t12;
132
+ } else {
133
+ t12 = $[35];
134
+ }
135
+ t10 = "nh:flex nh:flex-1 nh:flex-col nh:gap-2";
136
+ t8 = "nh:flex nh:flex-col nh:gap-0.5";
137
+ const t17 = conflict ? t.draftConflictTitle : t.draftAvailableTitle;
138
+ if ($[36] !== t17) {
139
+ t9 = /*#__PURE__*/_jsx("p", {
140
+ className: "nh:text-sm nh:font-medium nh:text-gray-900",
141
+ children: t17
142
+ });
143
+ $[36] = t17;
144
+ $[37] = t9;
145
+ } else {
146
+ t9 = $[37];
147
+ }
148
+ t6 = "nh:text-sm nh:text-gray-600";
149
+ t7 = (conflict ? t.draftConflictBody : t.draftAvailableBody).replace("{time}", savedAt);
150
+ $[13] = conflict;
151
+ $[14] = locale;
152
+ $[15] = record.updatedAt;
153
+ $[16] = t.draftAvailableBody;
154
+ $[17] = t.draftAvailableTitle;
155
+ $[18] = t.draftBannerLabel;
156
+ $[19] = t.draftConflictBody;
157
+ $[20] = t.draftConflictTitle;
158
+ $[21] = t10;
159
+ $[22] = t11;
160
+ $[23] = t12;
161
+ $[24] = t13;
162
+ $[25] = t14;
163
+ $[26] = t15;
164
+ $[27] = t6;
165
+ $[28] = t7;
166
+ $[29] = t8;
167
+ $[30] = t9;
168
+ } else {
169
+ t10 = $[21];
170
+ t11 = $[22];
171
+ t12 = $[23];
172
+ t13 = $[24];
173
+ t14 = $[25];
174
+ t15 = $[26];
175
+ t6 = $[27];
176
+ t7 = $[28];
177
+ t8 = $[29];
178
+ t9 = $[30];
179
+ }
180
+ let t16;
181
+ if ($[38] !== t6 || $[39] !== t7) {
182
+ t16 = /*#__PURE__*/_jsx("p", {
183
+ className: t6,
184
+ children: t7
185
+ });
186
+ $[38] = t6;
187
+ $[39] = t7;
188
+ $[40] = t16;
189
+ } else {
190
+ t16 = $[40];
191
+ }
192
+ let t17;
193
+ if ($[41] !== t16 || $[42] !== t8 || $[43] !== t9) {
194
+ t17 = /*#__PURE__*/_jsxs("div", {
195
+ className: t8,
196
+ children: [t9, t16]
197
+ });
198
+ $[41] = t16;
199
+ $[42] = t8;
200
+ $[43] = t9;
201
+ $[44] = t17;
202
+ } else {
203
+ t17 = $[44];
204
+ }
205
+ let t18;
206
+ if ($[45] !== restore || $[46] !== t.draftRestore) {
207
+ t18 = /*#__PURE__*/_jsx("button", {
208
+ type: "button",
209
+ onClick: restore,
210
+ className: "nh:cursor-pointer nh:rounded-md nh:bg-gray-900 nh:px-3 nh:py-1.5 nh:text-sm nh:font-medium nh:text-white nh:transition-colors nh:hover:bg-gray-700",
211
+ children: t.draftRestore
212
+ });
213
+ $[45] = restore;
214
+ $[46] = t.draftRestore;
215
+ $[47] = t18;
216
+ } else {
217
+ t18 = $[47];
218
+ }
219
+ let t19;
220
+ if ($[48] !== discard || $[49] !== t.draftDiscard) {
221
+ t19 = /*#__PURE__*/_jsx("button", {
222
+ type: "button",
223
+ onClick: discard,
224
+ className: "nh:cursor-pointer nh:rounded-md nh:border nh:border-gray-200 nh:bg-white nh:px-3 nh:py-1.5 nh:text-sm nh:text-gray-700 nh:transition-colors nh:hover:bg-gray-50",
225
+ children: t.draftDiscard
226
+ });
227
+ $[48] = discard;
228
+ $[49] = t.draftDiscard;
229
+ $[50] = t19;
230
+ } else {
231
+ t19 = $[50];
232
+ }
233
+ let t20;
234
+ if ($[51] !== t18 || $[52] !== t19) {
235
+ t20 = /*#__PURE__*/_jsxs("div", {
236
+ className: "nh:flex nh:gap-2",
237
+ children: [t18, t19]
238
+ });
239
+ $[51] = t18;
240
+ $[52] = t19;
241
+ $[53] = t20;
242
+ } else {
243
+ t20 = $[53];
244
+ }
245
+ let t21;
246
+ if ($[54] !== t10 || $[55] !== t17 || $[56] !== t20) {
247
+ t21 = /*#__PURE__*/_jsxs("div", {
248
+ className: t10,
249
+ children: [t17, t20]
250
+ });
251
+ $[54] = t10;
252
+ $[55] = t17;
253
+ $[56] = t20;
254
+ $[57] = t21;
255
+ } else {
256
+ t21 = $[57];
257
+ }
258
+ let t22;
259
+ if ($[58] !== t11 || $[59] !== t12 || $[60] !== t21) {
260
+ t22 = /*#__PURE__*/_jsxs("div", {
261
+ className: t11,
262
+ children: [t12, t21]
263
+ });
264
+ $[58] = t11;
265
+ $[59] = t12;
266
+ $[60] = t21;
267
+ $[61] = t22;
268
+ } else {
269
+ t22 = $[61];
270
+ }
271
+ let t23;
272
+ if ($[62] !== t13 || $[63] !== t14 || $[64] !== t15 || $[65] !== t22) {
273
+ t23 = /*#__PURE__*/_jsx("div", {
274
+ role: t13,
275
+ "aria-label": t14,
276
+ className: t15,
277
+ children: t22
278
+ });
279
+ $[62] = t13;
280
+ $[63] = t14;
281
+ $[64] = t15;
282
+ $[65] = t22;
283
+ $[66] = t23;
284
+ } else {
285
+ t23 = $[66];
286
+ }
287
+ return t23;
288
+ }
289
+ //# sourceMappingURL=draft-restore-banner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-restore-banner.js","names":["c","_c","useEffect","AlertTriangleIcon","HistoryIcon","toast","cn","usePuckDictionary","usePuckLocale","useDraftRecovery","jsx","_jsx","jsxs","_jsxs","formatTimestamp","timestamp","locale","Intl","DateTimeFormat","dateStyle","timeStyle","format","Date","toLocaleString","DraftRestoreBanner","t0","$","identity","serverData","config","propTransforms","t","editor","t1","decision","restore","discard","quotaExceeded","concurrentTab","t2","t3","draftQuotaExceeded","warning","t4","t5","draftConcurrentTab","restorable","conflict","record","t10","t11","t12","t13","t14","t15","t6","t7","t8","t9","updatedAt","draftAvailableBody","draftAvailableTitle","draftBannerLabel","draftConflictBody","draftConflictTitle","savedAt","t16","className","t17","children","replace","t18","draftRestore","type","t19","draftDiscard","t20","t21","t22","t23","role"],"sources":["../../../../src/puck-editor/internal/editor/draft-restore-banner.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect } from 'react';\nimport { type Config, type Data } from '@puckeditor/core';\nimport { AlertTriangleIcon, HistoryIcon } from 'lucide-react';\nimport { toast } from 'sonner';\n\nimport { cn } from '../../../shared/cn.ts';\nimport { type PuckPropTransforms } from '../content-model.ts';\nimport { usePuckDictionary, usePuckLocale } from '../i18n.tsx';\nimport { type DraftIdentity } from './draft-storage.ts';\nimport { useDraftRecovery } from './use-draft-recovery.ts';\n\nfunction formatTimestamp(timestamp: number, locale: string): string {\n try {\n return new Intl.DateTimeFormat(locale, {\n dateStyle: 'medium',\n timeStyle: 'short',\n }).format(new Date(timestamp));\n } catch {\n return new Date(timestamp).toLocaleString();\n }\n}\n\nexport function DraftRestoreBanner({\n identity,\n serverData,\n config,\n propTransforms,\n}: {\n identity: DraftIdentity;\n serverData: Partial<Data>;\n config: Config;\n propTransforms?: PuckPropTransforms;\n}) {\n const t = usePuckDictionary().editor;\n const locale = usePuckLocale();\n const { decision, restore, discard, quotaExceeded, concurrentTab } =\n useDraftRecovery({\n identity,\n serverData,\n config,\n propTransforms,\n });\n\n useEffect(() => {\n if (quotaExceeded) toast.warning(t.draftQuotaExceeded);\n }, [quotaExceeded, t.draftQuotaExceeded]);\n\n useEffect(() => {\n if (concurrentTab) toast.warning(t.draftConcurrentTab);\n }, [concurrentTab, t.draftConcurrentTab]);\n\n if (!decision.restorable) return null;\n\n const { conflict, record } = decision;\n const savedAt = formatTimestamp(record.updatedAt, locale);\n\n return (\n <div\n role=\"region\"\n aria-label={t.draftBannerLabel}\n className=\"nh:pointer-events-none nh:fixed nh:inset-x-0 nh:top-16 nh:z-[60] nh:flex nh:justify-center nh:px-4\"\n >\n <div\n className={cn(\n 'nh:pointer-events-auto nh:flex nh:w-full nh:max-w-xl nh:items-start nh:gap-3 nh:rounded-lg nh:border nh:bg-white nh:px-4 nh:py-3 nh:shadow-lg',\n {\n 'nh:border-amber-300': conflict,\n 'nh:border-gray-200': !conflict,\n }\n )}\n >\n {conflict ? (\n <AlertTriangleIcon className=\"nh:mt-0.5 nh:size-5 nh:shrink-0 nh:text-amber-500\" />\n ) : (\n <HistoryIcon className=\"nh:mt-0.5 nh:size-5 nh:shrink-0 nh:text-gray-500\" />\n )}\n <div className=\"nh:flex nh:flex-1 nh:flex-col nh:gap-2\">\n <div className=\"nh:flex nh:flex-col nh:gap-0.5\">\n <p className=\"nh:text-sm nh:font-medium nh:text-gray-900\">\n {conflict ? t.draftConflictTitle : t.draftAvailableTitle}\n </p>\n <p className=\"nh:text-sm nh:text-gray-600\">\n {(conflict ? t.draftConflictBody : t.draftAvailableBody).replace(\n '{time}',\n savedAt\n )}\n </p>\n </div>\n <div className=\"nh:flex nh:gap-2\">\n <button\n type=\"button\"\n onClick={restore}\n className=\"nh:cursor-pointer nh:rounded-md nh:bg-gray-900 nh:px-3 nh:py-1.5 nh:text-sm nh:font-medium nh:text-white nh:transition-colors nh:hover:bg-gray-700\"\n >\n {t.draftRestore}\n </button>\n <button\n type=\"button\"\n onClick={discard}\n className=\"nh:cursor-pointer nh:rounded-md nh:border nh:border-gray-200 nh:bg-white nh:px-3 nh:py-1.5 nh:text-sm nh:text-gray-700 nh:transition-colors nh:hover:bg-gray-50\"\n >\n {t.draftDiscard}\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAEb,SAASC,SAAS,QAAQ,OAAO;AAEjC,SAASC,iBAAiB,EAAEC,WAAW,QAAQ,cAAc;AAC7D,SAASC,KAAK,QAAQ,QAAQ;AAE9B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,GAAA;EAAA,IAAApD,CAAA,SAAAwB,GAAA,IAAAxB,CAAA,SAAAyB,GAAA,IAAAzB,CAAA,SAAAmD,GAAA;IA1CRC,GAAA,gBAAAjE,KAAA;MACasD,SAMV,EANUjB,GAMV;MAAAmB,QAAA,GAEAlB,GAIA,EACD0B,GA4BM;IAAA,CACH,CAAC;IAAAnD,CAAA,OAAAwB,GAAA;IAAAxB,CAAA,OAAAyB,GAAA;IAAAzB,CAAA,OAAAmD,GAAA;IAAAnD,CAAA,OAAAoD,GAAA;EAAA;IAAAA,GAAA,GAAApD,CAAA;EAAA;EAAA,IAAAqD,GAAA;EAAA,IAAArD,CAAA,SAAA0B,GAAA,IAAA1B,CAAA,SAAA2B,GAAA,IAAA3B,CAAA,SAAA4B,GAAA,IAAA5B,CAAA,SAAAoD,GAAA;IAhDRC,GAAA,gBAAApE,IAAA;MACOqE,IAAQ,EAAR5B,GAAQ;MACD,cAAAC,GAAkB;MACpBc,SAAoG,EAApGb,GAAoG;MAAAe,QAAA,EAE9GS;IA2CM,CACH,CAAC;IAAApD,CAAA,OAAA0B,GAAA;IAAA1B,CAAA,OAAA2B,GAAA;IAAA3B,CAAA,OAAA4B,GAAA;IAAA5B,CAAA,OAAAoD,GAAA;IAAApD,CAAA,OAAAqD,GAAA;EAAA;IAAAA,GAAA,GAAArD,CAAA;EAAA;EAAA,OAjDNqD,GAiDM;AAAA","ignoreList":[]}
@@ -0,0 +1,41 @@
1
+ import type { Data } from '@puckeditor/core';
2
+ export declare const DRAFT_KEY_PREFIX = "nodehive:puck-draft:";
3
+ declare const DRAFT_RECORD_VERSION: 1;
4
+ export type DraftIdentity = {
5
+ nodeId: string;
6
+ fieldName: string;
7
+ lang: string;
8
+ };
9
+ export type PuckDraftRecord = {
10
+ version: typeof DRAFT_RECORD_VERSION;
11
+ nodeId: string;
12
+ fieldName: string;
13
+ lang: string;
14
+ updatedAt: number;
15
+ baselineHash: string;
16
+ data: Partial<Data>;
17
+ };
18
+ export type RestoreDecision = {
19
+ restorable: false;
20
+ } | {
21
+ restorable: true;
22
+ conflict: boolean;
23
+ record: PuckDraftRecord;
24
+ };
25
+ export declare function buildDraftKey({ nodeId, fieldName, lang, }: DraftIdentity): string;
26
+ export declare function hashSerialized(str: string): string;
27
+ export declare function createDraftRecord({ identity, data, baselineHash, now, }: {
28
+ identity: DraftIdentity;
29
+ data: Partial<Data>;
30
+ baselineHash: string;
31
+ now?: number;
32
+ }): PuckDraftRecord;
33
+ export declare function readDraft(storage: Storage | null, key: string): PuckDraftRecord | null;
34
+ export declare function clearDraft(storage: Storage | null, key: string): void;
35
+ export type WriteDraftResult = {
36
+ ok: boolean;
37
+ };
38
+ export declare function writeDraft(storage: Storage | null, record: PuckDraftRecord): WriteDraftResult;
39
+ export declare function evaluateDraft(draft: PuckDraftRecord | null, serverData: Partial<Data>): RestoreDecision;
40
+ export declare function getLocalStorage(): Storage | null;
41
+ export {};
@@ -0,0 +1,129 @@
1
+ import { serializePuckData } from "./dirty-state.js";
2
+ export const DRAFT_KEY_PREFIX = 'nodehive:puck-draft:';
3
+ const DRAFT_RECORD_VERSION = 1;
4
+ export function buildDraftKey({
5
+ nodeId,
6
+ fieldName,
7
+ lang
8
+ }) {
9
+ return `${DRAFT_KEY_PREFIX}${nodeId}:${fieldName}:${lang || 'und'}`;
10
+ }
11
+ export function hashSerialized(str) {
12
+ let h1 = 0xdeadbeef;
13
+ let h2 = 0x41c6ce57;
14
+ for (let i = 0; i < str.length; i++) {
15
+ const ch = str.charCodeAt(i);
16
+ h1 = Math.imul(h1 ^ ch, 2654435761);
17
+ h2 = Math.imul(h2 ^ ch, 1597334677);
18
+ }
19
+ h1 = Math.imul(h1 ^ h1 >>> 16, 2246822507) ^ Math.imul(h2 ^ h2 >>> 13, 3266489909);
20
+ h2 = Math.imul(h2 ^ h2 >>> 16, 2246822507) ^ Math.imul(h1 ^ h1 >>> 13, 3266489909);
21
+ return (4294967296 * (2097151 & h2) + (h1 >>> 0)).toString(36);
22
+ }
23
+ export function createDraftRecord({
24
+ identity,
25
+ data,
26
+ baselineHash,
27
+ now = Date.now()
28
+ }) {
29
+ return {
30
+ version: DRAFT_RECORD_VERSION,
31
+ nodeId: identity.nodeId,
32
+ fieldName: identity.fieldName,
33
+ lang: identity.lang,
34
+ updatedAt: now,
35
+ baselineHash,
36
+ data
37
+ };
38
+ }
39
+ function isDraftRecord(value) {
40
+ if (typeof value !== 'object' || value === null) return false;
41
+ const record = value;
42
+ return record.version === DRAFT_RECORD_VERSION && typeof record.updatedAt === 'number' && typeof record.baselineHash === 'string' && typeof record.data === 'object' && record.data !== null;
43
+ }
44
+ export function readDraft(storage, key) {
45
+ if (!storage) return null;
46
+ try {
47
+ const raw = storage.getItem(key);
48
+ if (!raw) return null;
49
+ const parsed = JSON.parse(raw);
50
+ return isDraftRecord(parsed) ? parsed : null;
51
+ } catch {
52
+ return null;
53
+ }
54
+ }
55
+ export function clearDraft(storage, key) {
56
+ if (!storage) return;
57
+ try {
58
+ storage.removeItem(key);
59
+ } catch {
60
+ // Nothing to recover from: a stale draft is preferable to a crash.
61
+ }
62
+ }
63
+ function otherDraftKeys(storage, currentKey) {
64
+ const keys = [];
65
+ for (let i = 0; i < storage.length; i++) {
66
+ const key = storage.key(i);
67
+ if (key && key !== currentKey && key.startsWith(DRAFT_KEY_PREFIX)) {
68
+ keys.push(key);
69
+ }
70
+ }
71
+ return keys;
72
+ }
73
+ export function writeDraft(storage, record) {
74
+ if (!storage) return {
75
+ ok: false
76
+ };
77
+ const key = buildDraftKey(record);
78
+ const payload = JSON.stringify(record);
79
+ try {
80
+ storage.setItem(key, payload);
81
+ return {
82
+ ok: true
83
+ };
84
+ } catch {
85
+ const victims = otherDraftKeys(storage, key).map(evictKey => ({
86
+ key: evictKey,
87
+ updatedAt: readDraft(storage, evictKey)?.updatedAt ?? 0
88
+ })).sort((a, b) => a.updatedAt - b.updatedAt);
89
+ for (const victim of victims) {
90
+ clearDraft(storage, victim.key);
91
+ try {
92
+ storage.setItem(key, payload);
93
+ return {
94
+ ok: true
95
+ };
96
+ } catch {
97
+ continue;
98
+ }
99
+ }
100
+ return {
101
+ ok: false
102
+ };
103
+ }
104
+ }
105
+ export function evaluateDraft(draft, serverData) {
106
+ if (!draft) return {
107
+ restorable: false
108
+ };
109
+ const serverSerialized = serializePuckData(serverData);
110
+ if (serializePuckData(draft.data) === serverSerialized) {
111
+ return {
112
+ restorable: false
113
+ };
114
+ }
115
+ return {
116
+ restorable: true,
117
+ conflict: draft.baselineHash !== hashSerialized(serverSerialized),
118
+ record: draft
119
+ };
120
+ }
121
+ export function getLocalStorage() {
122
+ try {
123
+ if (typeof window === 'undefined') return null;
124
+ return window.localStorage;
125
+ } catch {
126
+ return null;
127
+ }
128
+ }
129
+ //# sourceMappingURL=draft-storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-storage.js","names":["serializePuckData","DRAFT_KEY_PREFIX","DRAFT_RECORD_VERSION","buildDraftKey","nodeId","fieldName","lang","hashSerialized","str","h1","h2","i","length","ch","charCodeAt","Math","imul","toString","createDraftRecord","identity","data","baselineHash","now","Date","version","updatedAt","isDraftRecord","value","record","readDraft","storage","key","raw","getItem","parsed","JSON","parse","clearDraft","removeItem","otherDraftKeys","currentKey","keys","startsWith","push","writeDraft","ok","payload","stringify","setItem","victims","map","evictKey","sort","a","b","victim","evaluateDraft","draft","serverData","restorable","serverSerialized","conflict","getLocalStorage","window","localStorage"],"sources":["../../../../src/puck-editor/internal/editor/draft-storage.ts"],"sourcesContent":["import type { Data } from '@puckeditor/core';\n\nimport { serializePuckData } from './dirty-state.ts';\n\nexport const DRAFT_KEY_PREFIX = 'nodehive:puck-draft:';\n\nconst DRAFT_RECORD_VERSION = 1 as const;\n\nexport type DraftIdentity = {\n nodeId: string;\n fieldName: string;\n lang: string;\n};\n\nexport type PuckDraftRecord = {\n version: typeof DRAFT_RECORD_VERSION;\n nodeId: string;\n fieldName: string;\n lang: string;\n updatedAt: number;\n baselineHash: string;\n data: Partial<Data>;\n};\n\nexport type RestoreDecision =\n | { restorable: false }\n | { restorable: true; conflict: boolean; record: PuckDraftRecord };\n\nexport function buildDraftKey({\n nodeId,\n fieldName,\n lang,\n}: DraftIdentity): string {\n return `${DRAFT_KEY_PREFIX}${nodeId}:${fieldName}:${lang || 'und'}`;\n}\n\nexport function hashSerialized(str: string): string {\n let h1 = 0xdeadbeef;\n let h2 = 0x41c6ce57;\n for (let i = 0; i < str.length; i++) {\n const ch = str.charCodeAt(i);\n h1 = Math.imul(h1 ^ ch, 2654435761);\n h2 = Math.imul(h2 ^ ch, 1597334677);\n }\n h1 =\n Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^\n Math.imul(h2 ^ (h2 >>> 13), 3266489909);\n h2 =\n Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^\n Math.imul(h1 ^ (h1 >>> 13), 3266489909);\n return (4294967296 * (2097151 & h2) + (h1 >>> 0)).toString(36);\n}\n\nexport function createDraftRecord({\n identity,\n data,\n baselineHash,\n now = Date.now(),\n}: {\n identity: DraftIdentity;\n data: Partial<Data>;\n baselineHash: string;\n now?: number;\n}): PuckDraftRecord {\n return {\n version: DRAFT_RECORD_VERSION,\n nodeId: identity.nodeId,\n fieldName: identity.fieldName,\n lang: identity.lang,\n updatedAt: now,\n baselineHash,\n data,\n };\n}\n\nfunction isDraftRecord(value: unknown): value is PuckDraftRecord {\n if (typeof value !== 'object' || value === null) return false;\n const record = value as Record<string, unknown>;\n return (\n record.version === DRAFT_RECORD_VERSION &&\n typeof record.updatedAt === 'number' &&\n typeof record.baselineHash === 'string' &&\n typeof record.data === 'object' &&\n record.data !== null\n );\n}\n\nexport function readDraft(\n storage: Storage | null,\n key: string\n): PuckDraftRecord | null {\n if (!storage) return null;\n try {\n const raw = storage.getItem(key);\n if (!raw) return null;\n const parsed = JSON.parse(raw) as unknown;\n return isDraftRecord(parsed) ? parsed : null;\n } catch {\n return null;\n }\n}\n\nexport function clearDraft(storage: Storage | null, key: string): void {\n if (!storage) return;\n try {\n storage.removeItem(key);\n } catch {\n // Nothing to recover from: a stale draft is preferable to a crash.\n }\n}\n\nfunction otherDraftKeys(storage: Storage, currentKey: string): string[] {\n const keys: string[] = [];\n for (let i = 0; i < storage.length; i++) {\n const key = storage.key(i);\n if (key && key !== currentKey && key.startsWith(DRAFT_KEY_PREFIX)) {\n keys.push(key);\n }\n }\n return keys;\n}\n\nexport type WriteDraftResult = { ok: boolean };\n\nexport function writeDraft(\n storage: Storage | null,\n record: PuckDraftRecord\n): WriteDraftResult {\n if (!storage) return { ok: false };\n const key = buildDraftKey(record);\n const payload = JSON.stringify(record);\n try {\n storage.setItem(key, payload);\n return { ok: true };\n } catch {\n const victims = otherDraftKeys(storage, key)\n .map((evictKey) => ({\n key: evictKey,\n updatedAt: readDraft(storage, evictKey)?.updatedAt ?? 0,\n }))\n .sort((a, b) => a.updatedAt - b.updatedAt);\n for (const victim of victims) {\n clearDraft(storage, victim.key);\n try {\n storage.setItem(key, payload);\n return { ok: true };\n } catch {\n continue;\n }\n }\n return { ok: false };\n }\n}\n\nexport function evaluateDraft(\n draft: PuckDraftRecord | null,\n serverData: Partial<Data>\n): RestoreDecision {\n if (!draft) return { restorable: false };\n const serverSerialized = serializePuckData(serverData);\n if (serializePuckData(draft.data) === serverSerialized) {\n return { restorable: false };\n }\n return {\n restorable: true,\n conflict: draft.baselineHash !== hashSerialized(serverSerialized),\n record: draft,\n };\n}\n\nexport function getLocalStorage(): Storage | null {\n try {\n if (typeof window === 'undefined') return null;\n return window.localStorage;\n } catch {\n return null;\n }\n}\n"],"mappings":"AAEA,SAASA,iBAAiB,QAAQ,kBAAkB;AAEpD,OAAO,MAAMC,gBAAgB,GAAG,sBAAsB;AAEtD,MAAMC,oBAAoB,GAAG,CAAU;AAsBvC,OAAO,SAASC,aAAaA,CAAC;EAC5BC,MAAM;EACNC,SAAS;EACTC;AACa,CAAC,EAAU;EACxB,OAAO,GAAGL,gBAAgB,GAAGG,MAAM,IAAIC,SAAS,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AAEA,EAAE,EAAE;IAAM,CAAC;EACtB;AACF;AAEA,OAAO,SAASW,aAAaA,CAC3BC,KAA6B,EAC7BC,UAAyB,EACR;EACjB,IAAI,CAACD,KAAK,EAAE,OAAO;IAAEE,UAAU,EAAE;EAAM,CAAC;EACxC,MAAMC,gBAAgB,GAAG5D,iBAAiB,CAAC0D,UAAU,CAAC;EACtD,IAAI1D,iBAAiB,CAACyD,KAAK,CAACrC,IAAI,CAAC,KAAKwC,gBAAgB,EAAE;IACtD,OAAO;MAAED,UAAU,EAAE;IAAM,CAAC;EAC9B;EACA,OAAO;IACLA,UAAU,EAAE,IAAI;IAChBE,QAAQ,EAAEJ,KAAK,CAACpC,YAAY,KAAKd,cAAc,CAACqD,gBAAgB,CAAC;IACjEhC,MAAM,EAAE6B;EACV,CAAC;AACH;AAEA,OAAO,SAASK,eAAeA,CAAA,EAAmB;EAChD,IAAI;IACF,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE,OAAO,IAAI;IAC9C,OAAOA,MAAM,CAACC,YAAY;EAC5B,CAAC,CAAC,MAAM;IACN,OAAO,IAAI;EACb;AACF","ignoreList":[]}
@@ -3,4 +3,3 @@ export declare function EditorActionBar({ label, children, }: {
3
3
  label?: string;
4
4
  children?: ReactNode;
5
5
  }): import("react").JSX.Element;
6
- //# sourceMappingURL=editor-action-bar.d.ts.map
@@ -4,10 +4,10 @@ import { c as _c } from "react/compiler-runtime";
4
4
  import { Children } from 'react';
5
5
  import { ActionBar, createUsePuck } from '@puckeditor/core';
6
6
  import { ChevronDownIcon, ChevronUpIcon, SaveIcon } from 'lucide-react';
7
- import { usePuckDictionary } from '../i18n';
8
- import { isSectionType, outlineLabelOf } from '../plugins/outline-plugin/outline-tree';
9
- import { scrollToCanvas } from './canvas-scroll';
10
- import { openSectionTemplateModal } from './section-template-modal';
7
+ import { usePuckDictionary } from "../i18n.js";
8
+ import { isSectionType, outlineLabelOf } from "../plugins/outline-plugin/outline-tree.js";
9
+ import { scrollToCanvas } from "./canvas-scroll.js";
10
+ import { openSectionTemplateModal } from "./section-template-modal.js";
11
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
12
  const usePuck = createUsePuck();
13
13
  export function EditorActionBar(t0) {