@nodehive/nextjs 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (777) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +102 -0
  3. package/dist/auth/index.d.ts +6 -0
  4. package/dist/auth/index.d.ts.map +1 -0
  5. package/dist/auth/index.js +7 -0
  6. package/dist/auth/index.js.map +1 -0
  7. package/dist/auth/internal/config.d.ts +24 -0
  8. package/dist/auth/internal/config.d.ts.map +1 -0
  9. package/dist/auth/internal/config.js +2 -0
  10. package/dist/auth/internal/config.js.map +1 -0
  11. package/dist/auth/internal/draft-mode.d.ts +17 -0
  12. package/dist/auth/internal/draft-mode.d.ts.map +1 -0
  13. package/dist/auth/internal/draft-mode.js +73 -0
  14. package/dist/auth/internal/draft-mode.js.map +1 -0
  15. package/dist/auth/internal/editor-locale.d.ts +4 -0
  16. package/dist/auth/internal/editor-locale.d.ts.map +1 -0
  17. package/dist/auth/internal/editor-locale.js +14 -0
  18. package/dist/auth/internal/editor-locale.js.map +1 -0
  19. package/dist/auth/internal/handoff.d.ts +11 -0
  20. package/dist/auth/internal/handoff.d.ts.map +1 -0
  21. package/dist/auth/internal/handoff.js +44 -0
  22. package/dist/auth/internal/handoff.js.map +1 -0
  23. package/dist/auth/internal/has-session.d.ts +7 -0
  24. package/dist/auth/internal/has-session.d.ts.map +1 -0
  25. package/dist/auth/internal/has-session.js +11 -0
  26. package/dist/auth/internal/has-session.js.map +1 -0
  27. package/dist/auth/internal/logout.d.ts +12 -0
  28. package/dist/auth/internal/logout.d.ts.map +1 -0
  29. package/dist/auth/internal/logout.js +48 -0
  30. package/dist/auth/internal/logout.js.map +1 -0
  31. package/dist/auth/internal/next-cookie-storage.d.ts +28 -0
  32. package/dist/auth/internal/next-cookie-storage.d.ts.map +1 -0
  33. package/dist/auth/internal/next-cookie-storage.js +103 -0
  34. package/dist/auth/internal/next-cookie-storage.js.map +1 -0
  35. package/dist/auth/internal/nodehive-client.d.ts +6 -0
  36. package/dist/auth/internal/nodehive-client.d.ts.map +1 -0
  37. package/dist/auth/internal/nodehive-client.js +64 -0
  38. package/dist/auth/internal/nodehive-client.js.map +1 -0
  39. package/dist/auth/internal/oauth-config.d.ts +37 -0
  40. package/dist/auth/internal/oauth-config.d.ts.map +1 -0
  41. package/dist/auth/internal/oauth-config.js +70 -0
  42. package/dist/auth/internal/oauth-config.js.map +1 -0
  43. package/dist/auth/internal/proxy-helpers.d.ts +15 -0
  44. package/dist/auth/internal/proxy-helpers.d.ts.map +1 -0
  45. package/dist/auth/internal/proxy-helpers.js +43 -0
  46. package/dist/auth/internal/proxy-helpers.js.map +1 -0
  47. package/dist/auth/internal/refresh.d.ts +13 -0
  48. package/dist/auth/internal/refresh.d.ts.map +1 -0
  49. package/dist/auth/internal/refresh.js +170 -0
  50. package/dist/auth/internal/refresh.js.map +1 -0
  51. package/dist/auth/internal/require-auth.d.ts +2 -0
  52. package/dist/auth/internal/require-auth.d.ts.map +1 -0
  53. package/dist/auth/internal/require-auth.js +11 -0
  54. package/dist/auth/internal/require-auth.js.map +1 -0
  55. package/dist/auth/internal/return-to.d.ts +16 -0
  56. package/dist/auth/internal/return-to.d.ts.map +1 -0
  57. package/dist/auth/internal/return-to.js +31 -0
  58. package/dist/auth/internal/return-to.js.map +1 -0
  59. package/dist/auth/internal/routes/callback.d.ts +11 -0
  60. package/dist/auth/internal/routes/callback.d.ts.map +1 -0
  61. package/dist/auth/internal/routes/callback.js +93 -0
  62. package/dist/auth/internal/routes/callback.js.map +1 -0
  63. package/dist/auth/internal/routes/chips-exchange.d.ts +4 -0
  64. package/dist/auth/internal/routes/chips-exchange.d.ts.map +1 -0
  65. package/dist/auth/internal/routes/chips-exchange.js +64 -0
  66. package/dist/auth/internal/routes/chips-exchange.js.map +1 -0
  67. package/dist/auth/internal/routes/draft.d.ts +4 -0
  68. package/dist/auth/internal/routes/draft.d.ts.map +1 -0
  69. package/dist/auth/internal/routes/draft.js +34 -0
  70. package/dist/auth/internal/routes/draft.js.map +1 -0
  71. package/dist/auth/internal/routes/index.d.ts +25 -0
  72. package/dist/auth/internal/routes/index.d.ts.map +1 -0
  73. package/dist/auth/internal/routes/index.js +66 -0
  74. package/dist/auth/internal/routes/index.js.map +1 -0
  75. package/dist/auth/internal/routes/login.d.ts +3 -0
  76. package/dist/auth/internal/routes/login.d.ts.map +1 -0
  77. package/dist/auth/internal/routes/login.js +47 -0
  78. package/dist/auth/internal/routes/login.js.map +1 -0
  79. package/dist/auth/internal/routes/popup-done.d.ts +3 -0
  80. package/dist/auth/internal/routes/popup-done.d.ts.map +1 -0
  81. package/dist/auth/internal/routes/popup-done.js +24 -0
  82. package/dist/auth/internal/routes/popup-done.js.map +1 -0
  83. package/dist/auth/internal/routes/refresh.d.ts +6 -0
  84. package/dist/auth/internal/routes/refresh.d.ts.map +1 -0
  85. package/dist/auth/internal/routes/refresh.js +44 -0
  86. package/dist/auth/internal/routes/refresh.js.map +1 -0
  87. package/dist/auth/internal/same-origin.d.ts +8 -0
  88. package/dist/auth/internal/same-origin.d.ts.map +1 -0
  89. package/dist/auth/internal/same-origin.js +9 -0
  90. package/dist/auth/internal/same-origin.js.map +1 -0
  91. package/dist/auth/internal/session-gates.d.ts +7 -0
  92. package/dist/auth/internal/session-gates.d.ts.map +1 -0
  93. package/dist/auth/internal/session-gates.js +12 -0
  94. package/dist/auth/internal/session-gates.js.map +1 -0
  95. package/dist/auth/internal/update-session.d.ts +17 -0
  96. package/dist/auth/internal/update-session.d.ts.map +1 -0
  97. package/dist/auth/internal/update-session.js +39 -0
  98. package/dist/auth/internal/update-session.js.map +1 -0
  99. package/dist/auth/internal/use-editor-login.d.ts +33 -0
  100. package/dist/auth/internal/use-editor-login.d.ts.map +1 -0
  101. package/dist/auth/internal/use-editor-login.js +143 -0
  102. package/dist/auth/internal/use-editor-login.js.map +1 -0
  103. package/dist/auth/proxy.d.ts +8 -0
  104. package/dist/auth/proxy.d.ts.map +1 -0
  105. package/dist/auth/proxy.js +8 -0
  106. package/dist/auth/proxy.js.map +1 -0
  107. package/dist/auth/react.d.ts +2 -0
  108. package/dist/auth/react.d.ts.map +1 -0
  109. package/dist/auth/react.js +3 -0
  110. package/dist/auth/react.js.map +1 -0
  111. package/dist/auth/routes.d.ts +3 -0
  112. package/dist/auth/routes.d.ts.map +1 -0
  113. package/dist/auth/routes.js +3 -0
  114. package/dist/auth/routes.js.map +1 -0
  115. package/dist/auth/server.d.ts +23 -0
  116. package/dist/auth/server.d.ts.map +1 -0
  117. package/dist/auth/server.js +61 -0
  118. package/dist/auth/server.js.map +1 -0
  119. package/dist/puck-editor/fields.d.ts +7 -0
  120. package/dist/puck-editor/fields.d.ts.map +1 -0
  121. package/dist/puck-editor/fields.js +4 -0
  122. package/dist/puck-editor/fields.js.map +1 -0
  123. package/dist/puck-editor/index.d.ts +14 -0
  124. package/dist/puck-editor/index.d.ts.map +1 -0
  125. package/dist/puck-editor/index.js +12 -0
  126. package/dist/puck-editor/index.js.map +1 -0
  127. package/dist/puck-editor/internal/api/client.d.ts +32 -0
  128. package/dist/puck-editor/internal/api/client.d.ts.map +1 -0
  129. package/dist/puck-editor/internal/api/client.js +128 -0
  130. package/dist/puck-editor/internal/api/client.js.map +1 -0
  131. package/dist/puck-editor/internal/api/config.d.ts +29 -0
  132. package/dist/puck-editor/internal/api/config.d.ts.map +1 -0
  133. package/dist/puck-editor/internal/api/config.js +2 -0
  134. package/dist/puck-editor/internal/api/config.js.map +1 -0
  135. package/dist/puck-editor/internal/api/create-puck-api.d.ts +26 -0
  136. package/dist/puck-editor/internal/api/create-puck-api.d.ts.map +1 -0
  137. package/dist/puck-editor/internal/api/create-puck-api.js +124 -0
  138. package/dist/puck-editor/internal/api/create-puck-api.js.map +1 -0
  139. package/dist/puck-editor/internal/api/handlers/create-page.d.ts +13 -0
  140. package/dist/puck-editor/internal/api/handlers/create-page.d.ts.map +1 -0
  141. package/dist/puck-editor/internal/api/handlers/create-page.js +125 -0
  142. package/dist/puck-editor/internal/api/handlers/create-page.js.map +1 -0
  143. package/dist/puck-editor/internal/api/handlers/entities.d.ts +17 -0
  144. package/dist/puck-editor/internal/api/handlers/entities.d.ts.map +1 -0
  145. package/dist/puck-editor/internal/api/handlers/entities.js +166 -0
  146. package/dist/puck-editor/internal/api/handlers/entities.js.map +1 -0
  147. package/dist/puck-editor/internal/api/handlers/publish.d.ts +6 -0
  148. package/dist/puck-editor/internal/api/handlers/publish.d.ts.map +1 -0
  149. package/dist/puck-editor/internal/api/handlers/publish.js +115 -0
  150. package/dist/puck-editor/internal/api/handlers/publish.js.map +1 -0
  151. package/dist/puck-editor/internal/api/handlers/template.d.ts +15 -0
  152. package/dist/puck-editor/internal/api/handlers/template.d.ts.map +1 -0
  153. package/dist/puck-editor/internal/api/handlers/template.js +222 -0
  154. package/dist/puck-editor/internal/api/handlers/template.js.map +1 -0
  155. package/dist/puck-editor/internal/api/handlers/upload.d.ts +13 -0
  156. package/dist/puck-editor/internal/api/handlers/upload.d.ts.map +1 -0
  157. package/dist/puck-editor/internal/api/handlers/upload.js +129 -0
  158. package/dist/puck-editor/internal/api/handlers/upload.js.map +1 -0
  159. package/dist/puck-editor/internal/api/media-params.d.ts +4 -0
  160. package/dist/puck-editor/internal/api/media-params.d.ts.map +1 -0
  161. package/dist/puck-editor/internal/api/media-params.js +38 -0
  162. package/dist/puck-editor/internal/api/media-params.js.map +1 -0
  163. package/dist/puck-editor/internal/api/media-upload.d.ts +24 -0
  164. package/dist/puck-editor/internal/api/media-upload.d.ts.map +1 -0
  165. package/dist/puck-editor/internal/api/media-upload.js +171 -0
  166. package/dist/puck-editor/internal/api/media-upload.js.map +1 -0
  167. package/dist/puck-editor/internal/api/space.d.ts +4 -0
  168. package/dist/puck-editor/internal/api/space.d.ts.map +1 -0
  169. package/dist/puck-editor/internal/api/space.js +11 -0
  170. package/dist/puck-editor/internal/api/space.js.map +1 -0
  171. package/dist/puck-editor/internal/content-model.d.ts +55 -0
  172. package/dist/puck-editor/internal/content-model.d.ts.map +1 -0
  173. package/dist/puck-editor/internal/content-model.js +73 -0
  174. package/dist/puck-editor/internal/content-model.js.map +1 -0
  175. package/dist/puck-editor/internal/editor/allowed-types.d.ts +4 -0
  176. package/dist/puck-editor/internal/editor/allowed-types.d.ts.map +1 -0
  177. package/dist/puck-editor/internal/editor/allowed-types.js +6 -0
  178. package/dist/puck-editor/internal/editor/allowed-types.js.map +1 -0
  179. package/dist/puck-editor/internal/editor/canvas-add-picker.d.ts +9 -0
  180. package/dist/puck-editor/internal/editor/canvas-add-picker.d.ts.map +1 -0
  181. package/dist/puck-editor/internal/editor/canvas-add-picker.js +231 -0
  182. package/dist/puck-editor/internal/editor/canvas-add-picker.js.map +1 -0
  183. package/dist/puck-editor/internal/editor/canvas-empty-state.d.ts +6 -0
  184. package/dist/puck-editor/internal/editor/canvas-empty-state.d.ts.map +1 -0
  185. package/dist/puck-editor/internal/editor/canvas-empty-state.js +85 -0
  186. package/dist/puck-editor/internal/editor/canvas-empty-state.js.map +1 -0
  187. package/dist/puck-editor/internal/editor/canvas-quick-add.d.ts +2 -0
  188. package/dist/puck-editor/internal/editor/canvas-quick-add.d.ts.map +1 -0
  189. package/dist/puck-editor/internal/editor/canvas-quick-add.js +844 -0
  190. package/dist/puck-editor/internal/editor/canvas-quick-add.js.map +1 -0
  191. package/dist/puck-editor/internal/editor/canvas-scroll.d.ts +3 -0
  192. package/dist/puck-editor/internal/editor/canvas-scroll.d.ts.map +1 -0
  193. package/dist/puck-editor/internal/editor/canvas-scroll.js +16 -0
  194. package/dist/puck-editor/internal/editor/canvas-scroll.js.map +1 -0
  195. package/dist/puck-editor/internal/editor/component-icons.d.ts +14 -0
  196. package/dist/puck-editor/internal/editor/component-icons.d.ts.map +1 -0
  197. package/dist/puck-editor/internal/editor/component-icons.js +35 -0
  198. package/dist/puck-editor/internal/editor/component-icons.js.map +1 -0
  199. package/dist/puck-editor/internal/editor/component-item.d.ts +6 -0
  200. package/dist/puck-editor/internal/editor/component-item.d.ts.map +1 -0
  201. package/dist/puck-editor/internal/editor/component-item.js +42 -0
  202. package/dist/puck-editor/internal/editor/component-item.js.map +1 -0
  203. package/dist/puck-editor/internal/editor/editor-action-bar.d.ts +6 -0
  204. package/dist/puck-editor/internal/editor/editor-action-bar.d.ts.map +1 -0
  205. package/dist/puck-editor/internal/editor/editor-action-bar.js +249 -0
  206. package/dist/puck-editor/internal/editor/editor-action-bar.js.map +1 -0
  207. package/dist/puck-editor/internal/editor/editor-header-actions.d.ts +7 -0
  208. package/dist/puck-editor/internal/editor/editor-header-actions.d.ts.map +1 -0
  209. package/dist/puck-editor/internal/editor/editor-header-actions.js +120 -0
  210. package/dist/puck-editor/internal/editor/editor-header-actions.js.map +1 -0
  211. package/dist/puck-editor/internal/editor/find-missing-required-fields.d.ts +15 -0
  212. package/dist/puck-editor/internal/editor/find-missing-required-fields.d.ts.map +1 -0
  213. package/dist/puck-editor/internal/editor/find-missing-required-fields.js +61 -0
  214. package/dist/puck-editor/internal/editor/find-missing-required-fields.js.map +1 -0
  215. package/dist/puck-editor/internal/editor/grouped-drawer-panel.d.ts +15 -0
  216. package/dist/puck-editor/internal/editor/grouped-drawer-panel.d.ts.map +1 -0
  217. package/dist/puck-editor/internal/editor/grouped-drawer-panel.js +147 -0
  218. package/dist/puck-editor/internal/editor/grouped-drawer-panel.js.map +1 -0
  219. package/dist/puck-editor/internal/editor/grouped-entry-list.d.ts +17 -0
  220. package/dist/puck-editor/internal/editor/grouped-entry-list.d.ts.map +1 -0
  221. package/dist/puck-editor/internal/editor/grouped-entry-list.js +125 -0
  222. package/dist/puck-editor/internal/editor/grouped-entry-list.js.map +1 -0
  223. package/dist/puck-editor/internal/editor/header-save-button.d.ts +5 -0
  224. package/dist/puck-editor/internal/editor/header-save-button.d.ts.map +1 -0
  225. package/dist/puck-editor/internal/editor/header-save-button.js +60 -0
  226. package/dist/puck-editor/internal/editor/header-save-button.js.map +1 -0
  227. package/dist/puck-editor/internal/editor/page-template-picker.d.ts +4 -0
  228. package/dist/puck-editor/internal/editor/page-template-picker.d.ts.map +1 -0
  229. package/dist/puck-editor/internal/editor/page-template-picker.js +140 -0
  230. package/dist/puck-editor/internal/editor/page-template-picker.js.map +1 -0
  231. package/dist/puck-editor/internal/editor/picker-entry-item.d.ts +6 -0
  232. package/dist/puck-editor/internal/editor/picker-entry-item.d.ts.map +1 -0
  233. package/dist/puck-editor/internal/editor/picker-entry-item.js +79 -0
  234. package/dist/puck-editor/internal/editor/picker-entry-item.js.map +1 -0
  235. package/dist/puck-editor/internal/editor/picker-model.d.ts +62 -0
  236. package/dist/puck-editor/internal/editor/picker-model.d.ts.map +1 -0
  237. package/dist/puck-editor/internal/editor/picker-model.js +489 -0
  238. package/dist/puck-editor/internal/editor/picker-model.js.map +1 -0
  239. package/dist/puck-editor/internal/editor/publish-puck-data.d.ts +30 -0
  240. package/dist/puck-editor/internal/editor/publish-puck-data.d.ts.map +1 -0
  241. package/dist/puck-editor/internal/editor/publish-puck-data.js +30 -0
  242. package/dist/puck-editor/internal/editor/publish-puck-data.js.map +1 -0
  243. package/dist/puck-editor/internal/editor/puck-editor.d.ts +15 -0
  244. package/dist/puck-editor/internal/editor/puck-editor.d.ts.map +1 -0
  245. package/dist/puck-editor/internal/editor/puck-editor.js +333 -0
  246. package/dist/puck-editor/internal/editor/puck-editor.js.map +1 -0
  247. package/dist/puck-editor/internal/editor/section-template-modal.d.ts +4 -0
  248. package/dist/puck-editor/internal/editor/section-template-modal.d.ts.map +1 -0
  249. package/dist/puck-editor/internal/editor/section-template-modal.js +71 -0
  250. package/dist/puck-editor/internal/editor/section-template-modal.js.map +1 -0
  251. package/dist/puck-editor/internal/editor/use-scroll-lock-outside.d.ts +15 -0
  252. package/dist/puck-editor/internal/editor/use-scroll-lock-outside.d.ts.map +1 -0
  253. package/dist/puck-editor/internal/editor/use-scroll-lock-outside.js +93 -0
  254. package/dist/puck-editor/internal/editor/use-scroll-lock-outside.js.map +1 -0
  255. package/dist/puck-editor/internal/editor-config.d.ts +30 -0
  256. package/dist/puck-editor/internal/editor-config.d.ts.map +1 -0
  257. package/dist/puck-editor/internal/editor-config.js +57 -0
  258. package/dist/puck-editor/internal/editor-config.js.map +1 -0
  259. package/dist/puck-editor/internal/editor-query-client.d.ts +4 -0
  260. package/dist/puck-editor/internal/editor-query-client.d.ts.map +1 -0
  261. package/dist/puck-editor/internal/editor-query-client.js +8 -0
  262. package/dist/puck-editor/internal/editor-query-client.js.map +1 -0
  263. package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.d.ts +14 -0
  264. package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.d.ts.map +1 -0
  265. package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.js +120 -0
  266. package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.js.map +1 -0
  267. package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.d.ts +21 -0
  268. package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.d.ts.map +1 -0
  269. package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.js +24 -0
  270. package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.js.map +1 -0
  271. package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.d.ts +16 -0
  272. package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.d.ts.map +1 -0
  273. package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.js +20 -0
  274. package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.js.map +1 -0
  275. package/dist/puck-editor/internal/fields/date-picker/date-picker.d.ts +8 -0
  276. package/dist/puck-editor/internal/fields/date-picker/date-picker.d.ts.map +1 -0
  277. package/dist/puck-editor/internal/fields/date-picker/date-picker.js +151 -0
  278. package/dist/puck-editor/internal/fields/date-picker/date-picker.js.map +1 -0
  279. package/dist/puck-editor/internal/fields/index.d.ts +10 -0
  280. package/dist/puck-editor/internal/fields/index.d.ts.map +1 -0
  281. package/dist/puck-editor/internal/fields/index.js +10 -0
  282. package/dist/puck-editor/internal/fields/index.js.map +1 -0
  283. package/dist/puck-editor/internal/fields/link-picker/anchor.d.ts +33 -0
  284. package/dist/puck-editor/internal/fields/link-picker/anchor.d.ts.map +1 -0
  285. package/dist/puck-editor/internal/fields/link-picker/anchor.js +83 -0
  286. package/dist/puck-editor/internal/fields/link-picker/anchor.js.map +1 -0
  287. package/dist/puck-editor/internal/fields/link-picker/create-link-field.d.ts +24 -0
  288. package/dist/puck-editor/internal/fields/link-picker/create-link-field.d.ts.map +1 -0
  289. package/dist/puck-editor/internal/fields/link-picker/create-link-field.js +31 -0
  290. package/dist/puck-editor/internal/fields/link-picker/create-link-field.js.map +1 -0
  291. package/dist/puck-editor/internal/fields/link-picker/humanize.d.ts +2 -0
  292. package/dist/puck-editor/internal/fields/link-picker/humanize.d.ts.map +1 -0
  293. package/dist/puck-editor/internal/fields/link-picker/humanize.js +4 -0
  294. package/dist/puck-editor/internal/fields/link-picker/humanize.js.map +1 -0
  295. package/dist/puck-editor/internal/fields/link-picker/link-picker-control.d.ts +27 -0
  296. package/dist/puck-editor/internal/fields/link-picker/link-picker-control.d.ts.map +1 -0
  297. package/dist/puck-editor/internal/fields/link-picker/link-picker-control.js +564 -0
  298. package/dist/puck-editor/internal/fields/link-picker/link-picker-control.js.map +1 -0
  299. package/dist/puck-editor/internal/fields/link-picker/link-picker-field.d.ts +9 -0
  300. package/dist/puck-editor/internal/fields/link-picker/link-picker-field.d.ts.map +1 -0
  301. package/dist/puck-editor/internal/fields/link-picker/link-picker-field.js +189 -0
  302. package/dist/puck-editor/internal/fields/link-picker/link-picker-field.js.map +1 -0
  303. package/dist/puck-editor/internal/fields/link-picker/link-value.d.ts +72 -0
  304. package/dist/puck-editor/internal/fields/link-picker/link-value.d.ts.map +1 -0
  305. package/dist/puck-editor/internal/fields/link-picker/link-value.js +114 -0
  306. package/dist/puck-editor/internal/fields/link-picker/link-value.js.map +1 -0
  307. package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.d.ts +14 -0
  308. package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.d.ts.map +1 -0
  309. package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.js +667 -0
  310. package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.js.map +1 -0
  311. package/dist/puck-editor/internal/fields/link-picker/richtext-extensions.d.ts +11 -0
  312. package/dist/puck-editor/internal/fields/link-picker/richtext-extensions.d.ts.map +1 -0
  313. package/dist/puck-editor/internal/fields/link-picker/richtext-extensions.js +34 -0
  314. package/dist/puck-editor/internal/fields/link-picker/richtext-extensions.js.map +1 -0
  315. package/dist/puck-editor/internal/fields/link-picker/segmented-control.d.ts +40 -0
  316. package/dist/puck-editor/internal/fields/link-picker/segmented-control.d.ts.map +1 -0
  317. package/dist/puck-editor/internal/fields/link-picker/segmented-control.js +146 -0
  318. package/dist/puck-editor/internal/fields/link-picker/segmented-control.js.map +1 -0
  319. package/dist/puck-editor/internal/fields/link-picker/types.d.ts +34 -0
  320. package/dist/puck-editor/internal/fields/link-picker/types.d.ts.map +1 -0
  321. package/dist/puck-editor/internal/fields/link-picker/types.js +2 -0
  322. package/dist/puck-editor/internal/fields/link-picker/types.js.map +1 -0
  323. package/dist/puck-editor/internal/fields/media-array/create-media-array-field.d.ts +27 -0
  324. package/dist/puck-editor/internal/fields/media-array/create-media-array-field.d.ts.map +1 -0
  325. package/dist/puck-editor/internal/fields/media-array/create-media-array-field.js +32 -0
  326. package/dist/puck-editor/internal/fields/media-array/create-media-array-field.js.map +1 -0
  327. package/dist/puck-editor/internal/fields/media-array/media-array-field.d.ts +13 -0
  328. package/dist/puck-editor/internal/fields/media-array/media-array-field.d.ts.map +1 -0
  329. package/dist/puck-editor/internal/fields/media-array/media-array-field.js +372 -0
  330. package/dist/puck-editor/internal/fields/media-array/media-array-field.js.map +1 -0
  331. package/dist/puck-editor/internal/fields/media-array/reorder.d.ts +2 -0
  332. package/dist/puck-editor/internal/fields/media-array/reorder.d.ts.map +1 -0
  333. package/dist/puck-editor/internal/fields/media-array/reorder.js +8 -0
  334. package/dist/puck-editor/internal/fields/media-array/reorder.js.map +1 -0
  335. package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.d.ts +27 -0
  336. package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.d.ts.map +1 -0
  337. package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.js +32 -0
  338. package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.js.map +1 -0
  339. package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.d.ts +11 -0
  340. package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.d.ts.map +1 -0
  341. package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.js +219 -0
  342. package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.js.map +1 -0
  343. package/dist/puck-editor/internal/fields/media-selector/crop-types.d.ts +24 -0
  344. package/dist/puck-editor/internal/fields/media-selector/crop-types.d.ts.map +1 -0
  345. package/dist/puck-editor/internal/fields/media-selector/crop-types.js +8 -0
  346. package/dist/puck-editor/internal/fields/media-selector/crop-types.js.map +1 -0
  347. package/dist/puck-editor/internal/fields/media-selector/extract-fields.d.ts +8 -0
  348. package/dist/puck-editor/internal/fields/media-selector/extract-fields.d.ts.map +1 -0
  349. package/dist/puck-editor/internal/fields/media-selector/extract-fields.js +51 -0
  350. package/dist/puck-editor/internal/fields/media-selector/extract-fields.js.map +1 -0
  351. package/dist/puck-editor/internal/fields/media-selector/image-upload-form.d.ts +7 -0
  352. package/dist/puck-editor/internal/fields/media-selector/image-upload-form.d.ts.map +1 -0
  353. package/dist/puck-editor/internal/fields/media-selector/image-upload-form.js +147 -0
  354. package/dist/puck-editor/internal/fields/media-selector/image-upload-form.js.map +1 -0
  355. package/dist/puck-editor/internal/fields/media-selector/media-selector-field.d.ts +30 -0
  356. package/dist/puck-editor/internal/fields/media-selector/media-selector-field.d.ts.map +1 -0
  357. package/dist/puck-editor/internal/fields/media-selector/media-selector-field.js +358 -0
  358. package/dist/puck-editor/internal/fields/media-selector/media-selector-field.js.map +1 -0
  359. package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.d.ts +14 -0
  360. package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.d.ts.map +1 -0
  361. package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.js +355 -0
  362. package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.js.map +1 -0
  363. package/dist/puck-editor/internal/fields/media-selector/use-debounced-value.d.ts +2 -0
  364. package/dist/puck-editor/internal/fields/media-selector/use-debounced-value.d.ts.map +1 -0
  365. package/dist/puck-editor/internal/fields/media-selector/use-debounced-value.js +55 -0
  366. package/dist/puck-editor/internal/fields/media-selector/use-debounced-value.js.map +1 -0
  367. package/dist/puck-editor/internal/fields/media-selector/use-media-library.d.ts +24 -0
  368. package/dist/puck-editor/internal/fields/media-selector/use-media-library.d.ts.map +1 -0
  369. package/dist/puck-editor/internal/fields/media-selector/use-media-library.js +229 -0
  370. package/dist/puck-editor/internal/fields/media-selector/use-media-library.js.map +1 -0
  371. package/dist/puck-editor/internal/fields/media-selector/video-upload-form.d.ts +7 -0
  372. package/dist/puck-editor/internal/fields/media-selector/video-upload-form.d.ts.map +1 -0
  373. package/dist/puck-editor/internal/fields/media-selector/video-upload-form.js +120 -0
  374. package/dist/puck-editor/internal/fields/media-selector/video-upload-form.js.map +1 -0
  375. package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.d.ts +31 -0
  376. package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.d.ts.map +1 -0
  377. package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.js +39 -0
  378. package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.js.map +1 -0
  379. package/dist/puck-editor/internal/fields/required-field-label.d.ts +16 -0
  380. package/dist/puck-editor/internal/fields/required-field-label.d.ts.map +1 -0
  381. package/dist/puck-editor/internal/fields/required-field-label.js +89 -0
  382. package/dist/puck-editor/internal/fields/required-field-label.js.map +1 -0
  383. package/dist/puck-editor/internal/fields/required.d.ts +19 -0
  384. package/dist/puck-editor/internal/fields/required.d.ts.map +1 -0
  385. package/dist/puck-editor/internal/fields/required.js +20 -0
  386. package/dist/puck-editor/internal/fields/required.js.map +1 -0
  387. package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.d.ts +37 -0
  388. package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.d.ts.map +1 -0
  389. package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.js +26 -0
  390. package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.js.map +1 -0
  391. package/dist/puck-editor/internal/i18n.d.ts +188 -0
  392. package/dist/puck-editor/internal/i18n.d.ts.map +1 -0
  393. package/dist/puck-editor/internal/i18n.js +414 -0
  394. package/dist/puck-editor/internal/i18n.js.map +1 -0
  395. package/dist/puck-editor/internal/locale.d.ts +13 -0
  396. package/dist/puck-editor/internal/locale.d.ts.map +1 -0
  397. package/dist/puck-editor/internal/locale.js +20 -0
  398. package/dist/puck-editor/internal/locale.js.map +1 -0
  399. package/dist/puck-editor/internal/localize.d.ts +11 -0
  400. package/dist/puck-editor/internal/localize.d.ts.map +1 -0
  401. package/dist/puck-editor/internal/localize.js +42 -0
  402. package/dist/puck-editor/internal/localize.js.map +1 -0
  403. package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.d.ts +21 -0
  404. package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.d.ts.map +1 -0
  405. package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.js +197 -0
  406. package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.js.map +1 -0
  407. package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.d.ts +2 -0
  408. package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.d.ts.map +1 -0
  409. package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.js +131 -0
  410. package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.js.map +1 -0
  411. package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.d.ts +20 -0
  412. package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.d.ts.map +1 -0
  413. package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.js +46 -0
  414. package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.js.map +1 -0
  415. package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.d.ts +46 -0
  416. package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.d.ts.map +1 -0
  417. package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.js +176 -0
  418. package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.js.map +1 -0
  419. package/dist/puck-editor/internal/plugins/agent-plugin/catalog.d.ts +20 -0
  420. package/dist/puck-editor/internal/plugins/agent-plugin/catalog.d.ts.map +1 -0
  421. package/dist/puck-editor/internal/plugins/agent-plugin/catalog.js +39 -0
  422. package/dist/puck-editor/internal/plugins/agent-plugin/catalog.js.map +1 -0
  423. package/dist/puck-editor/internal/plugins/agent-plugin/constants.d.ts +5 -0
  424. package/dist/puck-editor/internal/plugins/agent-plugin/constants.d.ts.map +1 -0
  425. package/dist/puck-editor/internal/plugins/agent-plugin/constants.js +3 -0
  426. package/dist/puck-editor/internal/plugins/agent-plugin/constants.js.map +1 -0
  427. package/dist/puck-editor/internal/plugins/agent-plugin/create-page.d.ts +17 -0
  428. package/dist/puck-editor/internal/plugins/agent-plugin/create-page.d.ts.map +1 -0
  429. package/dist/puck-editor/internal/plugins/agent-plugin/create-page.js +35 -0
  430. package/dist/puck-editor/internal/plugins/agent-plugin/create-page.js.map +1 -0
  431. package/dist/puck-editor/internal/plugins/agent-plugin/find-component-location.d.ts +19 -0
  432. package/dist/puck-editor/internal/plugins/agent-plugin/find-component-location.d.ts.map +1 -0
  433. package/dist/puck-editor/internal/plugins/agent-plugin/find-component-location.js +79 -0
  434. package/dist/puck-editor/internal/plugins/agent-plugin/find-component-location.js.map +1 -0
  435. package/dist/puck-editor/internal/plugins/agent-plugin/help.d.ts +2 -0
  436. package/dist/puck-editor/internal/plugins/agent-plugin/help.d.ts.map +1 -0
  437. package/dist/puck-editor/internal/plugins/agent-plugin/help.js +243 -0
  438. package/dist/puck-editor/internal/plugins/agent-plugin/help.js.map +1 -0
  439. package/dist/puck-editor/internal/plugins/agent-plugin/index.d.ts +2 -0
  440. package/dist/puck-editor/internal/plugins/agent-plugin/index.d.ts.map +1 -0
  441. package/dist/puck-editor/internal/plugins/agent-plugin/index.js +2 -0
  442. package/dist/puck-editor/internal/plugins/agent-plugin/index.js.map +1 -0
  443. package/dist/puck-editor/internal/plugins/agent-plugin/list-media.d.ts +19 -0
  444. package/dist/puck-editor/internal/plugins/agent-plugin/list-media.d.ts.map +1 -0
  445. package/dist/puck-editor/internal/plugins/agent-plugin/list-media.js +31 -0
  446. package/dist/puck-editor/internal/plugins/agent-plugin/list-media.js.map +1 -0
  447. package/dist/puck-editor/internal/plugins/agent-plugin/templates.d.ts +23 -0
  448. package/dist/puck-editor/internal/plugins/agent-plugin/templates.d.ts.map +1 -0
  449. package/dist/puck-editor/internal/plugins/agent-plugin/templates.js +72 -0
  450. package/dist/puck-editor/internal/plugins/agent-plugin/templates.js.map +1 -0
  451. package/dist/puck-editor/internal/plugins/agent-plugin/upload-media.d.ts +20 -0
  452. package/dist/puck-editor/internal/plugins/agent-plugin/upload-media.d.ts.map +1 -0
  453. package/dist/puck-editor/internal/plugins/agent-plugin/upload-media.js +34 -0
  454. package/dist/puck-editor/internal/plugins/agent-plugin/upload-media.js.map +1 -0
  455. package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.d.ts +17 -0
  456. package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.d.ts.map +1 -0
  457. package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.js +70 -0
  458. package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.js.map +1 -0
  459. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.d.ts +2 -0
  460. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.d.ts.map +1 -0
  461. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.js +37 -0
  462. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.js.map +1 -0
  463. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.d.ts +7 -0
  464. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.d.ts.map +1 -0
  465. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.js +18 -0
  466. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.js.map +1 -0
  467. package/dist/puck-editor/internal/plugins/blocks-plugin/index.d.ts +2 -0
  468. package/dist/puck-editor/internal/plugins/blocks-plugin/index.d.ts.map +1 -0
  469. package/dist/puck-editor/internal/plugins/blocks-plugin/index.js +2 -0
  470. package/dist/puck-editor/internal/plugins/blocks-plugin/index.js.map +1 -0
  471. package/dist/puck-editor/internal/plugins/outline-plugin/index.d.ts +2 -0
  472. package/dist/puck-editor/internal/plugins/outline-plugin/index.d.ts.map +1 -0
  473. package/dist/puck-editor/internal/plugins/outline-plugin/index.js +2 -0
  474. package/dist/puck-editor/internal/plugins/outline-plugin/index.js.map +1 -0
  475. package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.d.ts +2 -0
  476. package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.d.ts.map +1 -0
  477. package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.js +861 -0
  478. package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.js.map +1 -0
  479. package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.d.ts +5 -0
  480. package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.d.ts.map +1 -0
  481. package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.js +16 -0
  482. package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.js.map +1 -0
  483. package/dist/puck-editor/internal/plugins/outline-plugin/outline-tree.d.ts +53 -0
  484. package/dist/puck-editor/internal/plugins/outline-plugin/outline-tree.d.ts.map +1 -0
  485. package/dist/puck-editor/internal/plugins/outline-plugin/outline-tree.js +145 -0
  486. package/dist/puck-editor/internal/plugins/outline-plugin/outline-tree.js.map +1 -0
  487. package/dist/puck-editor/internal/plugins/sections-plugin/index.d.ts +2 -0
  488. package/dist/puck-editor/internal/plugins/sections-plugin/index.d.ts.map +1 -0
  489. package/dist/puck-editor/internal/plugins/sections-plugin/index.js +2 -0
  490. package/dist/puck-editor/internal/plugins/sections-plugin/index.js.map +1 -0
  491. package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.d.ts +2 -0
  492. package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.d.ts.map +1 -0
  493. package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.js +69 -0
  494. package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.js.map +1 -0
  495. package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.d.ts +7 -0
  496. package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.d.ts.map +1 -0
  497. package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.js +18 -0
  498. package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.js.map +1 -0
  499. package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.d.ts +6 -0
  500. package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.d.ts.map +1 -0
  501. package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.js +178 -0
  502. package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.js.map +1 -0
  503. package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.d.ts +3 -0
  504. package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.d.ts.map +1 -0
  505. package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.js +55 -0
  506. package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.js.map +1 -0
  507. package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.d.ts +12 -0
  508. package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.d.ts.map +1 -0
  509. package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.js +125 -0
  510. package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.js.map +1 -0
  511. package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.d.ts +8 -0
  512. package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.d.ts.map +1 -0
  513. package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.js +582 -0
  514. package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.js.map +1 -0
  515. package/dist/puck-editor/internal/plugins/templates-plugin/index.d.ts +6 -0
  516. package/dist/puck-editor/internal/plugins/templates-plugin/index.d.ts.map +1 -0
  517. package/dist/puck-editor/internal/plugins/templates-plugin/index.js +6 -0
  518. package/dist/puck-editor/internal/plugins/templates-plugin/index.js.map +1 -0
  519. package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.d.ts +4 -0
  520. package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.d.ts.map +1 -0
  521. package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.js +54 -0
  522. package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.js.map +1 -0
  523. package/dist/puck-editor/internal/plugins/templates-plugin/template-form.d.ts +11 -0
  524. package/dist/puck-editor/internal/plugins/templates-plugin/template-form.d.ts.map +1 -0
  525. package/dist/puck-editor/internal/plugins/templates-plugin/template-form.js +92 -0
  526. package/dist/puck-editor/internal/plugins/templates-plugin/template-form.js.map +1 -0
  527. package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.d.ts +7 -0
  528. package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.d.ts.map +1 -0
  529. package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.js +30 -0
  530. package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.js.map +1 -0
  531. package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.d.ts +2 -0
  532. package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.d.ts.map +1 -0
  533. package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.js +471 -0
  534. package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.js.map +1 -0
  535. package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.d.ts +5 -0
  536. package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.d.ts.map +1 -0
  537. package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.js +16 -0
  538. package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.js.map +1 -0
  539. package/dist/puck-editor/internal/plugins/templates-plugin/templates.d.ts +43 -0
  540. package/dist/puck-editor/internal/plugins/templates-plugin/templates.d.ts.map +1 -0
  541. package/dist/puck-editor/internal/plugins/templates-plugin/templates.js +115 -0
  542. package/dist/puck-editor/internal/plugins/templates-plugin/templates.js.map +1 -0
  543. package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.d.ts +9 -0
  544. package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.d.ts.map +1 -0
  545. package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.js +152 -0
  546. package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.js.map +1 -0
  547. package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.d.ts +16 -0
  548. package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.d.ts.map +1 -0
  549. package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.js +134 -0
  550. package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.js.map +1 -0
  551. package/dist/puck-editor/internal/puck-augmentation.d.ts +28 -0
  552. package/dist/puck-editor/internal/puck-augmentation.d.ts.map +1 -0
  553. package/dist/puck-editor/internal/puck-augmentation.js +7 -0
  554. package/dist/puck-editor/internal/puck-augmentation.js.map +1 -0
  555. package/dist/puck-editor/internal/puck-editor-provider.d.ts +12 -0
  556. package/dist/puck-editor/internal/puck-editor-provider.d.ts.map +1 -0
  557. package/dist/puck-editor/internal/puck-editor-provider.js +69 -0
  558. package/dist/puck-editor/internal/puck-editor-provider.js.map +1 -0
  559. package/dist/puck-editor/internal/puck-node.d.ts +29 -0
  560. package/dist/puck-editor/internal/puck-node.d.ts.map +1 -0
  561. package/dist/puck-editor/internal/puck-node.js +2 -0
  562. package/dist/puck-editor/internal/puck-node.js.map +1 -0
  563. package/dist/puck-editor/internal/puck-wrapper.d.ts +19 -0
  564. package/dist/puck-editor/internal/puck-wrapper.d.ts.map +1 -0
  565. package/dist/puck-editor/internal/puck-wrapper.js +270 -0
  566. package/dist/puck-editor/internal/puck-wrapper.js.map +1 -0
  567. package/dist/puck-editor/internal/render/cropped-image.d.ts +19 -0
  568. package/dist/puck-editor/internal/render/cropped-image.d.ts.map +1 -0
  569. package/dist/puck-editor/internal/render/cropped-image.js +126 -0
  570. package/dist/puck-editor/internal/render/cropped-image.js.map +1 -0
  571. package/dist/puck-editor/internal/smart-actions/index.d.ts +13 -0
  572. package/dist/puck-editor/internal/smart-actions/index.d.ts.map +1 -0
  573. package/dist/puck-editor/internal/smart-actions/index.js +29 -0
  574. package/dist/puck-editor/internal/smart-actions/index.js.map +1 -0
  575. package/dist/puck-editor/internal/smart-actions/new-page.d.ts +13 -0
  576. package/dist/puck-editor/internal/smart-actions/new-page.d.ts.map +1 -0
  577. package/dist/puck-editor/internal/smart-actions/new-page.js +80 -0
  578. package/dist/puck-editor/internal/smart-actions/new-page.js.map +1 -0
  579. package/dist/puck-editor/internal/smart-actions/open-puck-editor.d.ts +2 -0
  580. package/dist/puck-editor/internal/smart-actions/open-puck-editor.d.ts.map +1 -0
  581. package/dist/puck-editor/internal/smart-actions/open-puck-editor.js +65 -0
  582. package/dist/puck-editor/internal/smart-actions/open-puck-editor.js.map +1 -0
  583. package/dist/puck-editor/internal/ui/calendar.d.ts +9 -0
  584. package/dist/puck-editor/internal/ui/calendar.d.ts.map +1 -0
  585. package/dist/puck-editor/internal/ui/calendar.js +147 -0
  586. package/dist/puck-editor/internal/ui/calendar.js.map +1 -0
  587. package/dist/puck-editor/internal/ui/component-list-accordion.d.ts +13 -0
  588. package/dist/puck-editor/internal/ui/component-list-accordion.d.ts.map +1 -0
  589. package/dist/puck-editor/internal/ui/component-list-accordion.js +93 -0
  590. package/dist/puck-editor/internal/ui/component-list-accordion.js.map +1 -0
  591. package/dist/puck-editor/internal/ui/dialog.d.ts +20 -0
  592. package/dist/puck-editor/internal/ui/dialog.d.ts.map +1 -0
  593. package/dist/puck-editor/internal/ui/dialog.js +286 -0
  594. package/dist/puck-editor/internal/ui/dialog.js.map +1 -0
  595. package/dist/puck-editor/internal/ui/drawer-item-content.d.ts +11 -0
  596. package/dist/puck-editor/internal/ui/drawer-item-content.d.ts.map +1 -0
  597. package/dist/puck-editor/internal/ui/drawer-item-content.js +109 -0
  598. package/dist/puck-editor/internal/ui/drawer-item-content.js.map +1 -0
  599. package/dist/puck-editor/internal/ui/icon-button.d.ts +10 -0
  600. package/dist/puck-editor/internal/ui/icon-button.d.ts.map +1 -0
  601. package/dist/puck-editor/internal/ui/icon-button.js +72 -0
  602. package/dist/puck-editor/internal/ui/icon-button.js.map +1 -0
  603. package/dist/puck-editor/internal/ui/popover.d.ts +9 -0
  604. package/dist/puck-editor/internal/ui/popover.d.ts.map +1 -0
  605. package/dist/puck-editor/internal/ui/popover.js +165 -0
  606. package/dist/puck-editor/internal/ui/popover.js.map +1 -0
  607. package/dist/puck-editor/internal/ui/required-mark.d.ts +2 -0
  608. package/dist/puck-editor/internal/ui/required-mark.d.ts.map +1 -0
  609. package/dist/puck-editor/internal/ui/required-mark.js +12 -0
  610. package/dist/puck-editor/internal/ui/required-mark.js.map +1 -0
  611. package/dist/puck-editor/internal/ui/search-control.d.ts +20 -0
  612. package/dist/puck-editor/internal/ui/search-control.d.ts.map +1 -0
  613. package/dist/puck-editor/internal/ui/search-control.js +156 -0
  614. package/dist/puck-editor/internal/ui/search-control.js.map +1 -0
  615. package/dist/puck-editor/internal/ui/use-panel-search-focus.d.ts +2 -0
  616. package/dist/puck-editor/internal/ui/use-panel-search-focus.d.ts.map +1 -0
  617. package/dist/puck-editor/internal/ui/use-panel-search-focus.js +40 -0
  618. package/dist/puck-editor/internal/ui/use-panel-search-focus.js.map +1 -0
  619. package/dist/puck-editor/internal/use-puck-overlay.d.ts +16 -0
  620. package/dist/puck-editor/internal/use-puck-overlay.d.ts.map +1 -0
  621. package/dist/puck-editor/internal/use-puck-overlay.js +121 -0
  622. package/dist/puck-editor/internal/use-puck-overlay.js.map +1 -0
  623. package/dist/puck-editor/internal/utils.d.ts +6 -0
  624. package/dist/puck-editor/internal/utils.d.ts.map +1 -0
  625. package/dist/puck-editor/internal/utils.js +57 -0
  626. package/dist/puck-editor/internal/utils.js.map +1 -0
  627. package/dist/puck-editor/puck-theme.css +110 -0
  628. package/dist/puck-editor/render.d.ts +3 -0
  629. package/dist/puck-editor/render.d.ts.map +1 -0
  630. package/dist/puck-editor/render.js +2 -0
  631. package/dist/puck-editor/render.js.map +1 -0
  632. package/dist/puck-editor/server.d.ts +4 -0
  633. package/dist/puck-editor/server.d.ts.map +1 -0
  634. package/dist/puck-editor/server.js +4 -0
  635. package/dist/puck-editor/server.js.map +1 -0
  636. package/dist/puck-editor/smart-actions.d.ts +2 -0
  637. package/dist/puck-editor/smart-actions.d.ts.map +1 -0
  638. package/dist/puck-editor/smart-actions.js +2 -0
  639. package/dist/puck-editor/smart-actions.js.map +1 -0
  640. package/dist/shared/cn.d.ts +3 -0
  641. package/dist/shared/cn.d.ts.map +1 -0
  642. package/dist/shared/cn.js +9 -0
  643. package/dist/shared/cn.js.map +1 -0
  644. package/dist/shared/i18n.d.ts +5 -0
  645. package/dist/shared/i18n.d.ts.map +1 -0
  646. package/dist/shared/i18n.js +18 -0
  647. package/dist/shared/i18n.js.map +1 -0
  648. package/dist/shared/toolbar-action.d.ts +9 -0
  649. package/dist/shared/toolbar-action.d.ts.map +1 -0
  650. package/dist/shared/toolbar-action.js +2 -0
  651. package/dist/shared/toolbar-action.js.map +1 -0
  652. package/dist/smart-actions/internal/get-smart-actions-context.d.ts +19 -0
  653. package/dist/smart-actions/internal/get-smart-actions-context.d.ts.map +1 -0
  654. package/dist/smart-actions/internal/get-smart-actions-context.js +24 -0
  655. package/dist/smart-actions/internal/get-smart-actions-context.js.map +1 -0
  656. package/dist/smart-actions/internal/i18n.d.ts +20 -0
  657. package/dist/smart-actions/internal/i18n.d.ts.map +1 -0
  658. package/dist/smart-actions/internal/i18n.js +35 -0
  659. package/dist/smart-actions/internal/i18n.js.map +1 -0
  660. package/dist/smart-actions/internal/logout-form.d.ts +8 -0
  661. package/dist/smart-actions/internal/logout-form.d.ts.map +1 -0
  662. package/dist/smart-actions/internal/logout-form.js +88 -0
  663. package/dist/smart-actions/internal/logout-form.js.map +1 -0
  664. package/dist/smart-actions/internal/refresh-page.d.ts +2 -0
  665. package/dist/smart-actions/internal/refresh-page.d.ts.map +1 -0
  666. package/dist/smart-actions/internal/refresh-page.js +126 -0
  667. package/dist/smart-actions/internal/refresh-page.js.map +1 -0
  668. package/dist/smart-actions/internal/smart-actions-button.d.ts +24 -0
  669. package/dist/smart-actions/internal/smart-actions-button.d.ts.map +1 -0
  670. package/dist/smart-actions/internal/smart-actions-button.js +41 -0
  671. package/dist/smart-actions/internal/smart-actions-button.js.map +1 -0
  672. package/dist/smart-actions/internal/smart-actions-config.d.ts +13 -0
  673. package/dist/smart-actions/internal/smart-actions-config.d.ts.map +1 -0
  674. package/dist/smart-actions/internal/smart-actions-config.js +101 -0
  675. package/dist/smart-actions/internal/smart-actions-config.js.map +1 -0
  676. package/dist/smart-actions/internal/smart-actions-toolbar-client.d.ts +15 -0
  677. package/dist/smart-actions/internal/smart-actions-toolbar-client.d.ts.map +1 -0
  678. package/dist/smart-actions/internal/smart-actions-toolbar-client.js +71 -0
  679. package/dist/smart-actions/internal/smart-actions-toolbar-client.js.map +1 -0
  680. package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.d.ts +13 -0
  681. package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.d.ts.map +1 -0
  682. package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.js +323 -0
  683. package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.js.map +1 -0
  684. package/dist/smart-actions/internal/toolbar/storage.d.ts +7 -0
  685. package/dist/smart-actions/internal/toolbar/storage.d.ts.map +1 -0
  686. package/dist/smart-actions/internal/toolbar/storage.js +29 -0
  687. package/dist/smart-actions/internal/toolbar/storage.js.map +1 -0
  688. package/dist/smart-actions/internal/toolbar/types.d.ts +4 -0
  689. package/dist/smart-actions/internal/toolbar/types.d.ts.map +1 -0
  690. package/dist/smart-actions/internal/toolbar/types.js +2 -0
  691. package/dist/smart-actions/internal/toolbar/types.js.map +1 -0
  692. package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.d.ts +6 -0
  693. package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.d.ts.map +1 -0
  694. package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.js +43 -0
  695. package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.js.map +1 -0
  696. package/dist/smart-actions/internal/ui/tooltip.d.ts +8 -0
  697. package/dist/smart-actions/internal/ui/tooltip.d.ts.map +1 -0
  698. package/dist/smart-actions/internal/ui/tooltip.js +156 -0
  699. package/dist/smart-actions/internal/ui/tooltip.js.map +1 -0
  700. package/dist/smart-actions/internal/user-profile.d.ts +8 -0
  701. package/dist/smart-actions/internal/user-profile.d.ts.map +1 -0
  702. package/dist/smart-actions/internal/user-profile.js +30 -0
  703. package/dist/smart-actions/internal/user-profile.js.map +1 -0
  704. package/dist/smart-actions/server.d.ts +4 -0
  705. package/dist/smart-actions/server.d.ts.map +1 -0
  706. package/dist/smart-actions/server.js +4 -0
  707. package/dist/smart-actions/server.js.map +1 -0
  708. package/dist/theme.css +2 -0
  709. package/dist/visual-editor/index.d.ts +4 -0
  710. package/dist/visual-editor/index.d.ts.map +1 -0
  711. package/dist/visual-editor/index.js +4 -0
  712. package/dist/visual-editor/index.js.map +1 -0
  713. package/dist/visual-editor/internal/bridge/connector.d.ts +7 -0
  714. package/dist/visual-editor/internal/bridge/connector.d.ts.map +1 -0
  715. package/dist/visual-editor/internal/bridge/connector.js +72 -0
  716. package/dist/visual-editor/internal/bridge/connector.js.map +1 -0
  717. package/dist/visual-editor/internal/bridge/draft-mode-self-heal.d.ts +8 -0
  718. package/dist/visual-editor/internal/bridge/draft-mode-self-heal.d.ts.map +1 -0
  719. package/dist/visual-editor/internal/bridge/draft-mode-self-heal.js +44 -0
  720. package/dist/visual-editor/internal/bridge/draft-mode-self-heal.js.map +1 -0
  721. package/dist/visual-editor/internal/bridge/editor-auth-gate-server.d.ts +16 -0
  722. package/dist/visual-editor/internal/bridge/editor-auth-gate-server.d.ts.map +1 -0
  723. package/dist/visual-editor/internal/bridge/editor-auth-gate-server.js +43 -0
  724. package/dist/visual-editor/internal/bridge/editor-auth-gate-server.js.map +1 -0
  725. package/dist/visual-editor/internal/bridge/editor-auth-gate.d.ts +15 -0
  726. package/dist/visual-editor/internal/bridge/editor-auth-gate.d.ts.map +1 -0
  727. package/dist/visual-editor/internal/bridge/editor-auth-gate.js +146 -0
  728. package/dist/visual-editor/internal/bridge/editor-auth-gate.js.map +1 -0
  729. package/dist/visual-editor/internal/i18n.d.ts +29 -0
  730. package/dist/visual-editor/internal/i18n.d.ts.map +1 -0
  731. package/dist/visual-editor/internal/i18n.js +51 -0
  732. package/dist/visual-editor/internal/i18n.js.map +1 -0
  733. package/dist/visual-editor/internal/overlays/drupal-origin.d.ts +7 -0
  734. package/dist/visual-editor/internal/overlays/drupal-origin.d.ts.map +1 -0
  735. package/dist/visual-editor/internal/overlays/drupal-origin.js +15 -0
  736. package/dist/visual-editor/internal/overlays/drupal-origin.js.map +1 -0
  737. package/dist/visual-editor/internal/overlays/edit-button.d.ts +10 -0
  738. package/dist/visual-editor/internal/overlays/edit-button.d.ts.map +1 -0
  739. package/dist/visual-editor/internal/overlays/edit-button.js +138 -0
  740. package/dist/visual-editor/internal/overlays/edit-button.js.map +1 -0
  741. package/dist/visual-editor/internal/overlays/edit-icon.d.ts +3 -0
  742. package/dist/visual-editor/internal/overlays/edit-icon.d.ts.map +1 -0
  743. package/dist/visual-editor/internal/overlays/edit-icon.js +19 -0
  744. package/dist/visual-editor/internal/overlays/edit-icon.js.map +1 -0
  745. package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.d.ts +15 -0
  746. package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.d.ts.map +1 -0
  747. package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.js +52 -0
  748. package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.js.map +1 -0
  749. package/dist/visual-editor/internal/overlays/iframe-wrapper.d.ts +6 -0
  750. package/dist/visual-editor/internal/overlays/iframe-wrapper.d.ts.map +1 -0
  751. package/dist/visual-editor/internal/overlays/iframe-wrapper.js +42 -0
  752. package/dist/visual-editor/internal/overlays/iframe-wrapper.js.map +1 -0
  753. package/dist/visual-editor/internal/overlays/menu/menu-wrapper.d.ts +9 -0
  754. package/dist/visual-editor/internal/overlays/menu/menu-wrapper.d.ts.map +1 -0
  755. package/dist/visual-editor/internal/overlays/menu/menu-wrapper.js +33 -0
  756. package/dist/visual-editor/internal/overlays/menu/menu-wrapper.js.map +1 -0
  757. package/dist/visual-editor/internal/overlays/node/node-metadata.d.ts +13 -0
  758. package/dist/visual-editor/internal/overlays/node/node-metadata.d.ts.map +1 -0
  759. package/dist/visual-editor/internal/overlays/node/node-metadata.js +17 -0
  760. package/dist/visual-editor/internal/overlays/node/node-metadata.js.map +1 -0
  761. package/dist/visual-editor/internal/overlays/node/node-wrapper.d.ts +8 -0
  762. package/dist/visual-editor/internal/overlays/node/node-wrapper.d.ts.map +1 -0
  763. package/dist/visual-editor/internal/overlays/node/node-wrapper.js +25 -0
  764. package/dist/visual-editor/internal/overlays/node/node-wrapper.js.map +1 -0
  765. package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.d.ts +18 -0
  766. package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.d.ts.map +1 -0
  767. package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.js +58 -0
  768. package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.js.map +1 -0
  769. package/dist/visual-editor/internal/revalidate-route.d.ts +19 -0
  770. package/dist/visual-editor/internal/revalidate-route.d.ts.map +1 -0
  771. package/dist/visual-editor/internal/revalidate-route.js +51 -0
  772. package/dist/visual-editor/internal/revalidate-route.js.map +1 -0
  773. package/dist/visual-editor/server.d.ts +7 -0
  774. package/dist/visual-editor/server.d.ts.map +1 -0
  775. package/dist/visual-editor/server.js +8 -0
  776. package/dist/visual-editor/server.js.map +1 -0
  777. package/package.json +154 -0
@@ -0,0 +1,229 @@
1
+ 'use client';
2
+
3
+ import { c as _c } from "react/compiler-runtime";
4
+ import { useState } from 'react';
5
+ import { keepPreviousData, useQuery } from '@tanstack/react-query';
6
+ import { absolutizeMediaUrl, fetchMediaList } from '../../api/client';
7
+ import { usePuckEditorConfig } from '../../editor-config';
8
+ import { getPathLocale } from '../../locale';
9
+ import { useDebouncedValue } from './use-debounced-value';
10
+ const PAGE_LIMIT = 15;
11
+ const SEARCH_DEBOUNCE_MS = 300;
12
+ const fetchMedia = async ({
13
+ type,
14
+ query,
15
+ offset,
16
+ limit
17
+ }) => fetchMediaList(type, {
18
+ query,
19
+ offset,
20
+ limit,
21
+ lang: getPathLocale(window.location.pathname)
22
+ });
23
+ export function useMediaLibrary(t0) {
24
+ const $ = _c(43);
25
+ const {
26
+ mediaTypes,
27
+ enabled: t1
28
+ } = t0;
29
+ const enabled = t1 === undefined ? true : t1;
30
+ const {
31
+ drupalBaseUrl: t2
32
+ } = usePuckEditorConfig();
33
+ const drupalBaseUrl = t2 === undefined ? "" : t2;
34
+ const [searchQuery, setSearchQuery] = useState("");
35
+ const [debouncedSearchQuery, flushSearchQuery] = useDebouncedValue(searchQuery, SEARCH_DEBOUNCE_MS);
36
+ const [mediaType, setMediaType] = useState(mediaTypes[0] || "");
37
+ const [currentOffset, setCurrentOffset] = useState(0);
38
+ const [prevDebouncedQuery, setPrevDebouncedQuery] = useState(debouncedSearchQuery);
39
+ if (prevDebouncedQuery !== debouncedSearchQuery) {
40
+ setPrevDebouncedQuery(debouncedSearchQuery);
41
+ setCurrentOffset(0);
42
+ }
43
+ let t3;
44
+ let t4;
45
+ if ($[0] !== currentOffset || $[1] !== debouncedSearchQuery || $[2] !== mediaType) {
46
+ t3 = ["media-items", mediaType, debouncedSearchQuery, currentOffset, PAGE_LIMIT];
47
+ t4 = () => fetchMedia({
48
+ type: mediaType,
49
+ query: debouncedSearchQuery,
50
+ offset: currentOffset,
51
+ limit: PAGE_LIMIT
52
+ });
53
+ $[0] = currentOffset;
54
+ $[1] = debouncedSearchQuery;
55
+ $[2] = mediaType;
56
+ $[3] = t3;
57
+ $[4] = t4;
58
+ } else {
59
+ t3 = $[3];
60
+ t4 = $[4];
61
+ }
62
+ const t5 = enabled && !!mediaType;
63
+ let t6;
64
+ if ($[5] !== t3 || $[6] !== t4 || $[7] !== t5) {
65
+ t6 = {
66
+ queryKey: t3,
67
+ queryFn: t4,
68
+ enabled: t5,
69
+ placeholderData: keepPreviousData
70
+ };
71
+ $[5] = t3;
72
+ $[6] = t4;
73
+ $[7] = t5;
74
+ $[8] = t6;
75
+ } else {
76
+ t6 = $[8];
77
+ }
78
+ const {
79
+ data,
80
+ isLoading,
81
+ isFetching,
82
+ refetch
83
+ } = useQuery(t6);
84
+ let t7;
85
+ if ($[9] !== data?.data || $[10] !== drupalBaseUrl) {
86
+ t7 = data?.data?.map(item => ({
87
+ ...item,
88
+ thumbnailImage: absolutizeMediaUrl(drupalBaseUrl, item?.thumbnail?.uri?.url)
89
+ })) || [];
90
+ $[9] = data?.data;
91
+ $[10] = drupalBaseUrl;
92
+ $[11] = t7;
93
+ } else {
94
+ t7 = $[11];
95
+ }
96
+ const mediaItems = t7;
97
+ const hasNextPage = !!data?.links?.next;
98
+ const hasPreviousPage = !!data?.links?.prev;
99
+ let t8;
100
+ if ($[12] !== debouncedSearchQuery || $[13] !== flushSearchQuery || $[14] !== refetch || $[15] !== searchQuery) {
101
+ t8 = () => {
102
+ if (searchQuery === debouncedSearchQuery) {
103
+ refetch();
104
+ return;
105
+ }
106
+ flushSearchQuery(searchQuery);
107
+ };
108
+ $[12] = debouncedSearchQuery;
109
+ $[13] = flushSearchQuery;
110
+ $[14] = refetch;
111
+ $[15] = searchQuery;
112
+ $[16] = t8;
113
+ } else {
114
+ t8 = $[16];
115
+ }
116
+ const submitSearch = t8;
117
+ let t9;
118
+ if ($[17] !== flushSearchQuery) {
119
+ t9 = () => {
120
+ setSearchQuery("");
121
+ flushSearchQuery("");
122
+ };
123
+ $[17] = flushSearchQuery;
124
+ $[18] = t9;
125
+ } else {
126
+ t9 = $[18];
127
+ }
128
+ const clearSearch = t9;
129
+ let t10;
130
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
131
+ t10 = type => {
132
+ setMediaType(type);
133
+ setCurrentOffset(0);
134
+ };
135
+ $[19] = t10;
136
+ } else {
137
+ t10 = $[19];
138
+ }
139
+ const selectMediaType = t10;
140
+ let t11;
141
+ if ($[20] !== hasNextPage || $[21] !== isFetching) {
142
+ t11 = () => {
143
+ if (hasNextPage && !isFetching) {
144
+ setCurrentOffset(_temp);
145
+ }
146
+ };
147
+ $[20] = hasNextPage;
148
+ $[21] = isFetching;
149
+ $[22] = t11;
150
+ } else {
151
+ t11 = $[22];
152
+ }
153
+ const nextPage = t11;
154
+ let t12;
155
+ if ($[23] !== hasPreviousPage || $[24] !== isFetching) {
156
+ t12 = () => {
157
+ if (hasPreviousPage && !isFetching) {
158
+ setCurrentOffset(_temp2);
159
+ }
160
+ };
161
+ $[23] = hasPreviousPage;
162
+ $[24] = isFetching;
163
+ $[25] = t12;
164
+ } else {
165
+ t12 = $[25];
166
+ }
167
+ const previousPage = t12;
168
+ let t13;
169
+ if ($[26] !== currentOffset || $[27] !== refetch) {
170
+ t13 = () => {
171
+ if (currentOffset !== 0) {
172
+ setCurrentOffset(0);
173
+ } else {
174
+ refetch();
175
+ }
176
+ };
177
+ $[26] = currentOffset;
178
+ $[27] = refetch;
179
+ $[28] = t13;
180
+ } else {
181
+ t13 = $[28];
182
+ }
183
+ const refreshAfterUpload = t13;
184
+ const t14 = Math.floor(currentOffset / PAGE_LIMIT) + 1;
185
+ let t15;
186
+ if ($[29] !== clearSearch || $[30] !== hasNextPage || $[31] !== hasPreviousPage || $[32] !== isFetching || $[33] !== isLoading || $[34] !== mediaItems || $[35] !== mediaType || $[36] !== nextPage || $[37] !== previousPage || $[38] !== refreshAfterUpload || $[39] !== searchQuery || $[40] !== submitSearch || $[41] !== t14) {
187
+ t15 = {
188
+ mediaItems,
189
+ isLoading,
190
+ isFetching,
191
+ searchQuery,
192
+ setSearchQuery,
193
+ submitSearch,
194
+ clearSearch,
195
+ mediaType,
196
+ selectMediaType,
197
+ page: t14,
198
+ hasNextPage,
199
+ hasPreviousPage,
200
+ nextPage,
201
+ previousPage,
202
+ refreshAfterUpload
203
+ };
204
+ $[29] = clearSearch;
205
+ $[30] = hasNextPage;
206
+ $[31] = hasPreviousPage;
207
+ $[32] = isFetching;
208
+ $[33] = isLoading;
209
+ $[34] = mediaItems;
210
+ $[35] = mediaType;
211
+ $[36] = nextPage;
212
+ $[37] = previousPage;
213
+ $[38] = refreshAfterUpload;
214
+ $[39] = searchQuery;
215
+ $[40] = submitSearch;
216
+ $[41] = t14;
217
+ $[42] = t15;
218
+ } else {
219
+ t15 = $[42];
220
+ }
221
+ return t15;
222
+ }
223
+ function _temp2(prev_0) {
224
+ return prev_0 - PAGE_LIMIT;
225
+ }
226
+ function _temp(prev) {
227
+ return prev + PAGE_LIMIT;
228
+ }
229
+ //# sourceMappingURL=use-media-library.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-media-library.js","names":["c","_c","useState","keepPreviousData","useQuery","absolutizeMediaUrl","fetchMediaList","usePuckEditorConfig","getPathLocale","useDebouncedValue","PAGE_LIMIT","SEARCH_DEBOUNCE_MS","fetchMedia","type","query","offset","limit","lang","window","location","pathname","useMediaLibrary","t0","$","mediaTypes","enabled","t1","undefined","drupalBaseUrl","t2","searchQuery","setSearchQuery","debouncedSearchQuery","flushSearchQuery","mediaType","setMediaType","currentOffset","setCurrentOffset","prevDebouncedQuery","setPrevDebouncedQuery","t3","t4","t5","t6","queryKey","queryFn","placeholderData","data","isLoading","isFetching","refetch","t7","map","item","thumbnailImage","thumbnail","uri","url","mediaItems","hasNextPage","links","next","hasPreviousPage","prev","t8","submitSearch","t9","clearSearch","t10","Symbol","for","selectMediaType","t11","_temp","nextPage","t12","_temp2","previousPage","t13","refreshAfterUpload","t14","Math","floor","t15","page","prev_0"],"sources":["../../../../../src/puck-editor/internal/fields/media-selector/use-media-library.ts"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { keepPreviousData, useQuery } from '@tanstack/react-query';\n\nimport { absolutizeMediaUrl, fetchMediaList } from '../../api/client';\nimport { usePuckEditorConfig } from '../../editor-config';\nimport { getPathLocale } from '../../locale';\nimport { MediaItem } from './media-selector-field';\nimport { useDebouncedValue } from './use-debounced-value';\n\nconst PAGE_LIMIT = 15;\nconst SEARCH_DEBOUNCE_MS = 300;\n\nconst fetchMedia = async ({\n type,\n query,\n offset,\n limit,\n}: {\n type: string;\n query: string;\n offset: number;\n limit: number;\n}) =>\n fetchMediaList<{\n data?: (MediaItem & { thumbnail?: { uri?: { url?: string } } })[];\n links?: { next?: unknown; prev?: unknown };\n }>(type, {\n query,\n offset,\n limit,\n lang: getPathLocale(window.location.pathname),\n });\n\ntype UseMediaLibraryOptions = {\n mediaTypes: string[];\n enabled?: boolean;\n};\n\nexport function useMediaLibrary({\n mediaTypes,\n enabled = true,\n}: UseMediaLibraryOptions) {\n const { drupalBaseUrl = '' } = usePuckEditorConfig();\n const [searchQuery, setSearchQuery] = useState('');\n const [debouncedSearchQuery, flushSearchQuery] = useDebouncedValue(\n searchQuery,\n SEARCH_DEBOUNCE_MS\n );\n const [mediaType, setMediaType] = useState(mediaTypes[0] || '');\n const [currentOffset, setCurrentOffset] = useState(0);\n const [prevDebouncedQuery, setPrevDebouncedQuery] =\n useState(debouncedSearchQuery);\n\n if (prevDebouncedQuery !== debouncedSearchQuery) {\n setPrevDebouncedQuery(debouncedSearchQuery);\n setCurrentOffset(0);\n }\n\n const { data, isLoading, isFetching, refetch } = useQuery({\n queryKey: [\n 'media-items',\n mediaType,\n debouncedSearchQuery,\n currentOffset,\n PAGE_LIMIT,\n ],\n queryFn: () =>\n fetchMedia({\n type: mediaType,\n query: debouncedSearchQuery,\n offset: currentOffset,\n limit: PAGE_LIMIT,\n }),\n enabled: enabled && !!mediaType,\n placeholderData: keepPreviousData,\n });\n\n const mediaItems: MediaItem[] =\n data?.data?.map(\n (item: MediaItem & { thumbnail?: { uri?: { url?: string } } }) => ({\n ...item,\n thumbnailImage: absolutizeMediaUrl(\n drupalBaseUrl,\n item?.thumbnail?.uri?.url\n ),\n })\n ) || [];\n\n const hasNextPage = !!data?.links?.next;\n const hasPreviousPage = !!data?.links?.prev;\n\n const submitSearch = () => {\n if (searchQuery === debouncedSearchQuery) {\n refetch();\n return;\n }\n flushSearchQuery(searchQuery);\n };\n\n const clearSearch = () => {\n setSearchQuery('');\n flushSearchQuery('');\n };\n\n const selectMediaType = (type: string) => {\n setMediaType(type);\n setCurrentOffset(0);\n };\n\n const nextPage = () => {\n if (hasNextPage && !isFetching) {\n setCurrentOffset((prev) => prev + PAGE_LIMIT);\n }\n };\n\n const previousPage = () => {\n if (hasPreviousPage && !isFetching) {\n setCurrentOffset((prev) => prev - PAGE_LIMIT);\n }\n };\n\n // New media is sorted `created DESC` (page 1), so reset the offset to show it.\n const refreshAfterUpload = () => {\n if (currentOffset !== 0) {\n setCurrentOffset(0);\n } else {\n refetch();\n }\n };\n\n return {\n mediaItems,\n isLoading,\n isFetching,\n searchQuery,\n setSearchQuery,\n submitSearch,\n clearSearch,\n mediaType,\n selectMediaType,\n page: Math.floor(currentOffset / PAGE_LIMIT) + 1,\n hasNextPage,\n hasPreviousPage,\n nextPage,\n previousPage,\n refreshAfterUpload,\n };\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAEb,SAASC,QAAQ,QAAQ,OAAO;AAChC,SAASC,gBAAgB,EAAEC,QAAQ,QAAQ,uBAAuB;AAElE,SAASC,kBAAkB,EAAEC,cAAc,QAAQ,kBAAkB;AACrE,SAASC,mBAAmB,QAAQ,qBAAqB;AACzD,SAASC,aAAa,QAAQ,cAAc;AAE5C,SAASC,iBAAiB,QAAQ,uBAAuB;AAEzD,MAAMC,UAAU,GAAG,EAAE;AACrB,MAAMC,kBAAkB,GAAG,GAAG;AAE9B,MAAMC,UAAU,GAAG,MAAAA,CAAO;EACxBC,IAAI;EACJC,KAAK;EACLC,MAAM;EACNC;AAMF,CAAC,KACCV,cAAc,CAGXO,IAAI,EAAE;EACPC,KAAK;EACLC,MAAM;EACNC,KAAK;EACLC,IAAI,EAAET,aAAa,CAACU,MAAM,CAACC,QAAQ,CAACC,QAAQ;AAC9C,CAAC,CAAC;AAOJ,OAAO,SAAAC,gBAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAtB,EAAA;EAAyB;IAAAuB,UAAA;IAAAC,OAAA,EAAAC;EAAA,IAAAJ,EAGP;EADvB,MAAAG,OAAA,GAAAC,EAAc,KAAdC,SAAc,GAAd,IAAc,GAAdD,EAAc;EAEd;IAAAE,aAAA,EAAAC;EAAA,IAA+BtB,mBAAmB,CAAC,CAAC;E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AAtD,CAAA,SAAAwD,kBAAA,IAAAxD,CAAA,SAAAO,WAAA,IAAAP,CAAA,SAAA0C,YAAA,IAAA1C,CAAA,SAAAyD,GAAA;IAV3CG,GAAA;MAAAzB,UAAA;MAAAV,SAAA;MAAAC,UAAA;MAAAnB,WAAA;MAAAC,cAAA;MAAAkC,YAAA;MAAAE,WAAA;MAAAjC,SAAA;MAAAqC,eAAA;MAAAa,IAAA,EAUCJ,GAA0C;MAAArB,WAAA;MAAAG,eAAA;MAAAY,QAAA;MAAAG,YAAA;MAAAE;IAMlD,CAAC;IAAAxD,CAAA,OAAA4C,WAAA;IAAA5C,CAAA,OAAAoC,WAAA;IAAApC,CAAA,OAAAuC,eAAA;IAAAvC,CAAA,OAAA0B,UAAA;IAAA1B,CAAA,OAAAyB,SAAA;IAAAzB,CAAA,OAAAmC,UAAA;IAAAnC,CAAA,OAAAW,SAAA;IAAAX,CAAA,OAAAmD,QAAA;IAAAnD,CAAA,OAAAsD,YAAA;IAAAtD,CAAA,OAAAwD,kBAAA;IAAAxD,CAAA,OAAAO,WAAA;IAAAP,CAAA,OAAA0C,YAAA;IAAA1C,CAAA,OAAAyD,GAAA;IAAAzD,CAAA,OAAA4D,GAAA;EAAA;IAAAA,GAAA,GAAA5D,CAAA;EAAA;EAAA,OAhBM4D,GAgBN;AAAA;AA5GI,SAAAP,OAAAS,MAAA;EAAA,OA+E0BtB,MAAI,GAAGrD,UAAU;AAAA;AA/E3C,SAAA+D,MAAAV,IAAA;EAAA,OAyE0BA,IAAI,GAAGrD,UAAU;AAAA","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ interface VideoUploadFormProps {
2
+ onCancel?: () => void;
3
+ onMediaAdded?: () => void;
4
+ }
5
+ export declare function VideoUploadForm({ onMediaAdded, onCancel, }: VideoUploadFormProps): import("react").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=video-upload-form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video-upload-form.d.ts","sourceRoot":"","sources":["../../../../../src/puck-editor/internal/fields/media-selector/video-upload-form.tsx"],"names":[],"mappings":"AAWA,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,wBAAgB,eAAe,CAAC,EAC9B,YAAY,EACZ,QAAQ,GACT,EAAE,oBAAoB,+BA4HtB"}
@@ -0,0 +1,120 @@
1
+ 'use client';
2
+
3
+ import { useState } from 'react';
4
+ import { Button } from '@puckeditor/core';
5
+ import { uploadRemoteVideoMedia } from '../../api/client';
6
+ import { usePuckDictionary } from '../../i18n';
7
+ import { RequiredMark } from '../../ui/required-mark';
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
+ export function VideoUploadForm({
10
+ onMediaAdded,
11
+ onCancel
12
+ }) {
13
+ const {
14
+ mediaSelector
15
+ } = usePuckDictionary();
16
+ const [isPending, setIsPending] = useState(false);
17
+ const [message, setMessage] = useState('');
18
+ const [messageType, setMessageType] = useState(null);
19
+ const [formData, setFormData] = useState({
20
+ videoUrl: '',
21
+ name: ''
22
+ });
23
+ const handleSubmit = async e => {
24
+ e.preventDefault();
25
+ setIsPending(true);
26
+ setMessage('');
27
+ setMessageType(null);
28
+ try {
29
+ const formElement = e.currentTarget;
30
+ const formData_0 = new FormData(formElement);
31
+ const result = await uploadRemoteVideoMedia(formData_0);
32
+ if (result) {
33
+ setMessage(result.message);
34
+ if (result.success) {
35
+ setMessageType('success');
36
+ formElement.reset();
37
+ setFormData({
38
+ videoUrl: '',
39
+ name: ''
40
+ });
41
+ if (onMediaAdded) {
42
+ onMediaAdded();
43
+ }
44
+ } else {
45
+ setMessageType('error');
46
+ }
47
+ }
48
+ } catch (error) {
49
+ setMessage(mediaSelector.addRemoteVideoFailed);
50
+ setMessageType('error');
51
+ console.error(error);
52
+ } finally {
53
+ setIsPending(false);
54
+ }
55
+ };
56
+ const handleChange = e_0 => {
57
+ const {
58
+ name,
59
+ value
60
+ } = e_0.target;
61
+ setFormData(prev => ({
62
+ ...prev,
63
+ [name]: value
64
+ }));
65
+ };
66
+ return /*#__PURE__*/_jsxs("form", {
67
+ onSubmit: handleSubmit,
68
+ className: "nh:space-y-4",
69
+ children: [message && /*#__PURE__*/_jsx("div", {
70
+ className: `nh:rounded nh:p-2 nh:text-sm nh:font-medium ${messageType === 'success' ? 'nh:border nh:border-green-200 nh:bg-green-100 text-green-700' : 'nh:border nh:border-red-200 nh:bg-red-100 text-red-700'}`,
71
+ children: message
72
+ }), /*#__PURE__*/_jsxs("div", {
73
+ children: [/*#__PURE__*/_jsxs("label", {
74
+ htmlFor: "name",
75
+ className: "nh:block nh:text-sm nh:font-medium nh:text-gray-700",
76
+ children: [mediaSelector.name, /*#__PURE__*/_jsx(RequiredMark, {})]
77
+ }), /*#__PURE__*/_jsx("input", {
78
+ type: "text",
79
+ id: "name",
80
+ name: "name",
81
+ placeholder: "",
82
+ value: formData.name,
83
+ onChange: handleChange,
84
+ className: "nh:mt-1 nh:block nh:w-full nh:max-w-3xl nh:rounded-md nh:border-gray-300 nh:shadow-sm",
85
+ required: true
86
+ })]
87
+ }), /*#__PURE__*/_jsxs("div", {
88
+ children: [/*#__PURE__*/_jsxs("label", {
89
+ htmlFor: "videoUrl",
90
+ className: "nh:block nh:text-sm nh:font-medium nh:text-gray-700",
91
+ children: [mediaSelector.videoUrl, /*#__PURE__*/_jsx(RequiredMark, {})]
92
+ }), /*#__PURE__*/_jsx("input", {
93
+ type: "url",
94
+ id: "videoUrl",
95
+ name: "videoUrl",
96
+ placeholder: "https://www.youtube.com/watch?v=...",
97
+ value: formData.videoUrl,
98
+ onChange: handleChange,
99
+ className: "nh:mt-1 nh:block nh:w-full nh:max-w-3xl nh:rounded-md nh:border-gray-300 nh:shadow-sm",
100
+ required: true
101
+ })]
102
+ }), /*#__PURE__*/_jsxs("div", {
103
+ className: "nh:mt-6 nh:flex nh:justify-between nh:gap-2",
104
+ children: [/*#__PURE__*/_jsx(Button, {
105
+ type: "button",
106
+ variant: "secondary",
107
+ onClick: onCancel,
108
+ children: mediaSelector.cancel
109
+ }), /*#__PURE__*/_jsx(Button, {
110
+ type: "submit",
111
+ disabled: isPending,
112
+ onClick: e_1 => {
113
+ e_1.stopPropagation();
114
+ },
115
+ children: isPending ? mediaSelector.uploading : mediaSelector.uploadVideo
116
+ })]
117
+ })]
118
+ });
119
+ }
120
+ //# sourceMappingURL=video-upload-form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video-upload-form.js","names":["useState","Button","uploadRemoteVideoMedia","usePuckDictionary","RequiredMark","jsx","_jsx","jsxs","_jsxs","VideoUploadForm","onMediaAdded","onCancel","mediaSelector","isPending","setIsPending","message","setMessage","messageType","setMessageType","formData","setFormData","videoUrl","name","handleSubmit","e","preventDefault","formElement","currentTarget","FormData","result","success","reset","error","addRemoteVideoFailed","console","handleChange","value","target","prev","onSubmit","className","children","htmlFor","type","id","placeholder","onChange","required","variant","onClick","cancel","disabled","stopPropagation","uploading","uploadVideo"],"sources":["../../../../../src/puck-editor/internal/fields/media-selector/video-upload-form.tsx"],"sourcesContent":["'use client';\n\nimport { FormEvent, useState } from 'react';\nimport { Button } from '@puckeditor/core';\n\nimport { uploadRemoteVideoMedia } from '../../api/client';\nimport { usePuckDictionary } from '../../i18n';\nimport { RequiredMark } from '../../ui/required-mark';\n\ntype MessageType = 'success' | 'error' | null;\n\ninterface VideoUploadFormProps {\n onCancel?: () => void;\n onMediaAdded?: () => void;\n}\n\nexport function VideoUploadForm({\n onMediaAdded,\n onCancel,\n}: VideoUploadFormProps) {\n const { mediaSelector } = usePuckDictionary();\n const [isPending, setIsPending] = useState(false);\n const [message, setMessage] = useState('');\n const [messageType, setMessageType] = useState<MessageType>(null);\n const [formData, setFormData] = useState({\n videoUrl: '',\n name: '',\n });\n\n const handleSubmit = async (e: FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n setIsPending(true);\n setMessage('');\n setMessageType(null);\n\n try {\n const formElement = e.currentTarget;\n const formData = new FormData(formElement);\n\n const result = await uploadRemoteVideoMedia(formData);\n\n if (result) {\n setMessage(result.message);\n if (result.success) {\n setMessageType('success');\n formElement.reset();\n setFormData({ videoUrl: '', name: '' });\n if (onMediaAdded) {\n onMediaAdded();\n }\n } else {\n setMessageType('error');\n }\n }\n } catch (error) {\n setMessage(mediaSelector.addRemoteVideoFailed);\n setMessageType('error');\n console.error(error);\n } finally {\n setIsPending(false);\n }\n };\n\n const handleChange = (\n e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>\n ) => {\n const { name, value } = e.target;\n setFormData((prev) => ({\n ...prev,\n [name]: value,\n }));\n };\n\n return (\n <form onSubmit={handleSubmit} className=\"nh:space-y-4\">\n {message && (\n <div\n className={`nh:rounded nh:p-2 nh:text-sm nh:font-medium ${\n messageType === 'success'\n ? 'nh:border nh:border-green-200 nh:bg-green-100 text-green-700'\n : 'nh:border nh:border-red-200 nh:bg-red-100 text-red-700'\n }`}\n >\n {message}\n </div>\n )}\n\n <div>\n <label\n htmlFor=\"name\"\n className=\"nh:block nh:text-sm nh:font-medium nh:text-gray-700\"\n >\n {mediaSelector.name}\n <RequiredMark />\n </label>\n <input\n type=\"text\"\n id=\"name\"\n name=\"name\"\n placeholder=\"\"\n value={formData.name}\n onChange={handleChange}\n className=\"nh:mt-1 nh:block nh:w-full nh:max-w-3xl nh:rounded-md nh:border-gray-300 nh:shadow-sm\"\n required\n />\n </div>\n\n <div>\n <label\n htmlFor=\"videoUrl\"\n className=\"nh:block nh:text-sm nh:font-medium nh:text-gray-700\"\n >\n {mediaSelector.videoUrl}\n <RequiredMark />\n </label>\n <input\n type=\"url\"\n id=\"videoUrl\"\n name=\"videoUrl\"\n placeholder=\"https://www.youtube.com/watch?v=...\"\n value={formData.videoUrl}\n onChange={handleChange}\n className=\"nh:mt-1 nh:block nh:w-full nh:max-w-3xl nh:rounded-md nh:border-gray-300 nh:shadow-sm\"\n required\n />\n </div>\n\n <div className=\"nh:mt-6 nh:flex nh:justify-between nh:gap-2\">\n <Button type=\"button\" variant=\"secondary\" onClick={onCancel}>\n {mediaSelector.cancel}\n </Button>\n <Button\n type=\"submit\"\n disabled={isPending}\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n {isPending ? mediaSelector.uploading : mediaSelector.uploadVideo}\n </Button>\n </div>\n </form>\n );\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SAAoBA,QAAQ,QAAQ,OAAO;AAC3C,SAASC,MAAM,QAAQ,kBAAkB;AAEzC,SAASC,sBAAsB,QAAQ,kBAAkB;AACzD,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,YAAY,QAAQ,wBAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAStD,OAAO,SAASC,eAAeA,CAAC;EAC9BC,YAAY;EACZC;AACoB,CAAC,EAAE;EACvB,MAAM;IAAEC;EAAc,CAAC,GAAGT,iBAAiB,CAAC,CAAC;EAC7C,MAAM,CAACU,SAAS,EAAEC,YAAY,CAAC,GAAGd,QAAQ,CAAC,KAAK,CAAC;EACjD,MAAM,CAACe,OAAO,EAAEC,UAAU,CAAC,GAAGhB,QAAQ,CAAC,EAAE,CAAC;EAC1C,MAAM,CAACiB,WAAW,EAAEC,cAAc,CAAC,GAAGlB,QAAQ,CAAc,IAAI,CAAC;EACjE,MAAM,CAACmB,QAAQ,EAAEC,WAAW,CAAC,GAAGpB,QAAQ,CAAC;IACvCqB,QAAQ,EAAE,EAAE;IACZC,IAAI,EAAE;EACR,CAAC,CAAC;EAEF,MAAMC,YAAY,GAAG,MAAOC,CAA6B,IAAK;IAC5DA,CAAC,CAACC,cAAc,CAAC,CAAC;IAClBX,YAAY,CAAC,IAAI,CAAC;IAClBE,UAAU,CAAC,EAAE,CAAC;IACdE,cAAc,CAAC,IAAI,CAAC;IAEpB,IAAI;MACF,MAAMQ,WAAW,GAAGF,CAAC,CAACG,aAAa;MACnC,MA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QAAA,EAED5B,SAAS,GAAGD,aAAa,CAACyC,SAAS,GAAGzC,aAAa,CAAC0C;MAAW,CAC1D,CAAC;IAAA,CACN,CAAC;EAAA,CACF,CAAC;AAEX","ignoreList":[]}
@@ -0,0 +1,31 @@
1
+ export type NodeSelectorItem = {
2
+ title?: string | null;
3
+ [key: string]: unknown;
4
+ };
5
+ export interface NodeSelectorFieldOptions<TItem extends NodeSelectorItem = NodeSelectorItem> {
6
+ nodeType: string;
7
+ label?: string;
8
+ locale?: string;
9
+ placeholder?: string;
10
+ showSearch?: boolean;
11
+ initialQuery?: string;
12
+ searchFields?: string[];
13
+ fields?: string[];
14
+ getItemSummary?: (item: TItem) => string;
15
+ mapRow?: (item: TItem) => TItem;
16
+ mapProp?: (item: TItem) => unknown;
17
+ }
18
+ export declare const createNodeSelectorField: <TItem extends NodeSelectorItem = NodeSelectorItem>({ nodeType, label, placeholder, showSearch, initialQuery, searchFields, fields, getItemSummary, mapRow, mapProp, }: NodeSelectorFieldOptions<TItem>) => {
19
+ type: "external";
20
+ label: string;
21
+ placeholder: string;
22
+ showSearch: boolean;
23
+ initialQuery: string;
24
+ fetchList: ({ query }?: {
25
+ query?: string;
26
+ }) => Promise<TItem[]>;
27
+ getItemSummary: (item: TItem) => string;
28
+ mapRow: (item: TItem) => TItem;
29
+ mapProp: ((item: TItem) => unknown) | undefined;
30
+ };
31
+ //# sourceMappingURL=create-node-selector-field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-node-selector-field.d.ts","sourceRoot":"","sources":["../../../../../src/puck-editor/internal/fields/node-selector/create-node-selector-field.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,WAAW,wBAAwB,CACvC,KAAK,SAAS,gBAAgB,GAAG,gBAAgB;IAEjD,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,MAAM,CAAC;IACzC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,KAAK,CAAC;IAChC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC;CACpC;AAED,eAAO,MAAM,uBAAuB,GAClC,KAAK,SAAS,gBAAgB,GAAG,gBAAgB,EACjD,oHAWC,wBAAwB,CAAC,KAAK,CAAC;;;;;;4BAOD;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAAQ,OAAO,CAAC,KAAK,EAAE,CAAC;qCAzBvC,MAAM;;+BAEb,OAAO;CA2CnC,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { fetchNodeList } from '../../api/client';
2
+ import { getPathLocale } from '../../locale';
3
+ export const createNodeSelectorField = ({
4
+ nodeType,
5
+ label = 'Node',
6
+ placeholder = `Select ${nodeType}`,
7
+ showSearch = true,
8
+ initialQuery = '',
9
+ searchFields = ['title'],
10
+ fields,
11
+ getItemSummary,
12
+ mapRow,
13
+ mapProp
14
+ }) => {
15
+ return {
16
+ type: 'external',
17
+ label,
18
+ placeholder,
19
+ showSearch,
20
+ initialQuery,
21
+ fetchList: async ({
22
+ query
23
+ } = {}) => fetchNodeList(nodeType, {
24
+ lang: getPathLocale(window.location.pathname),
25
+ query,
26
+ searchFields,
27
+ fields
28
+ }),
29
+ getItemSummary: getItemSummary || (item => {
30
+ const summary = item?.title;
31
+ return typeof summary === 'string' ? summary : '';
32
+ }),
33
+ mapRow: mapRow || (item => {
34
+ return item;
35
+ }),
36
+ mapProp
37
+ };
38
+ };
39
+ //# sourceMappingURL=create-node-selector-field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-node-selector-field.js","names":["fetchNodeList","getPathLocale","createNodeSelectorField","nodeType","label","placeholder","showSearch","initialQuery","searchFields","fields","getItemSummary","mapRow","mapProp","type","fetchList","query","lang","window","location","pathname","item","summary","title"],"sources":["../../../../../src/puck-editor/internal/fields/node-selector/create-node-selector-field.ts"],"sourcesContent":["import { fetchNodeList } from '../../api/client';\nimport { getPathLocale } from '../../locale';\n\nexport type NodeSelectorItem = {\n title?: string | null;\n [key: string]: unknown;\n};\n\nexport interface NodeSelectorFieldOptions<\n TItem extends NodeSelectorItem = NodeSelectorItem,\n> {\n nodeType: string;\n label?: string;\n locale?: string;\n placeholder?: string;\n showSearch?: boolean;\n initialQuery?: string;\n searchFields?: string[];\n fields?: string[];\n getItemSummary?: (item: TItem) => string;\n mapRow?: (item: TItem) => TItem;\n mapProp?: (item: TItem) => unknown;\n}\n\nexport const createNodeSelectorField = <\n TItem extends NodeSelectorItem = NodeSelectorItem,\n>({\n nodeType,\n label = 'Node',\n placeholder = `Select ${nodeType}`,\n showSearch = true,\n initialQuery = '',\n searchFields = ['title'],\n fields,\n getItemSummary,\n mapRow,\n mapProp,\n}: NodeSelectorFieldOptions<TItem>) => {\n return {\n type: 'external' as const,\n label,\n placeholder,\n showSearch,\n initialQuery,\n fetchList: async ({ query }: { query?: string } = {}): Promise<TItem[]> =>\n fetchNodeList<TItem>(nodeType, {\n lang: getPathLocale(window.location.pathname),\n query,\n searchFields,\n fields,\n }),\n getItemSummary:\n getItemSummary ||\n ((item: TItem) => {\n const summary = item?.title;\n return typeof summary === 'string' ? summary : '';\n }),\n mapRow:\n mapRow ||\n ((item: TItem): TItem => {\n return item;\n }),\n mapProp,\n };\n};\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,kBAAkB;AAChD,SAASC,aAAa,QAAQ,cAAc;AAuB5C,OAAO,MAAMC,uBAAuB,GAAGA,CAErC;EACAC,QAAQ;EACRC,KAAK,GAAG,MAAM;EACdC,WAAW,GAAG,UAAUF,QAAQ,EAAE;EAClCG,UAAU,GAAG,IAAI;EACjBC,YAAY,GAAG,EAAE;EACjBC,YAAY,GAAG,CAAC,OAAO,CAAC;EACxBC,MAAM;EACNC,cAAc;EACdC,MAAM;EACNC;AAC+B,CAAC,KAAK;EACrC,OAAO;IACLC,IAAI,EAAE,UAAmB;IACzBT,KAAK;IACLC,WAAW;IACXC,UAAU;IACVC,YAAY;IACZO,SAAS,EAAE,MAAAA,CAAO;MAAEC;IAA0B,CAAC,GAAG,CAAC,CAAC,KAClDf,aAAa,CAAQG,QAAQ,EAAE;MAC7Ba,IAAI,EAAEf,aAAa,CAACgB,MAAM,CAACC,QAAQ,CAACC,QAAQ,CAAC;MAC7CJ,KAAK;MACLP,YAAY;MACZC;IACF,CAAC,CAAC;IACJC,cAAc,EACZA,cAAc,KACZU,IAAW,IAAK;MAChB,MAAMC,OAAO,GAAGD,IAAI,EAAEE,KAAK;MAC3B,OAAO,OAAOD,OAAO,KAAK,QAAQ,GAAGA,OAAO,GAAG,EAAE;IACnD,CAAC,CAAC;IACJV,MAAM,EACJA,MAAM,KACJS,IAAW,IAAY;MACvB,OAAOA,IAAI;IACb,CAAC,CAAC;IACJR;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ import type { ComponentProps } from 'react';
2
+ import { FieldLabel } from '@puckeditor/core';
3
+ type FieldLabelProps = ComponentProps<typeof FieldLabel>;
4
+ /**
5
+ * Drop-in for Puck's FieldLabel. When the label ends with the required marker
6
+ * (" *", produced by the `required()` field wrapper), it renders a styled
7
+ * <RequiredMark /> inline instead of the literal asterisk — keeping Puck's
8
+ * native label styling.
9
+ *
10
+ * Used directly by custom fields and registered as `overrides.fieldLabel`, so
11
+ * built-in and custom fields get the same marker. Puck renders `label` as a JSX
12
+ * child, so a ReactNode works at runtime despite the `string` type.
13
+ */
14
+ export declare function RequiredFieldLabel({ label, ...rest }: FieldLabelProps): import("react").JSX.Element;
15
+ export {};
16
+ //# sourceMappingURL=required-field-label.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"required-field-label.d.ts","sourceRoot":"","sources":["../../../../src/puck-editor/internal/fields/required-field-label.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAI9C,KAAK,eAAe,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAEzD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,eAAe,+BAoBrE"}
@@ -0,0 +1,89 @@
1
+ 'use client';
2
+
3
+ import { c as _c } from "react/compiler-runtime";
4
+ import { FieldLabel } from '@puckeditor/core';
5
+ import { RequiredMark } from '../ui/required-mark';
6
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
7
+ /**
8
+ * Drop-in for Puck's FieldLabel. When the label ends with the required marker
9
+ * (" *", produced by the `required()` field wrapper), it renders a styled
10
+ * <RequiredMark /> inline instead of the literal asterisk — keeping Puck's
11
+ * native label styling.
12
+ *
13
+ * Used directly by custom fields and registered as `overrides.fieldLabel`, so
14
+ * built-in and custom fields get the same marker. Puck renders `label` as a JSX
15
+ * child, so a ReactNode works at runtime despite the `string` type.
16
+ */
17
+ export function RequiredFieldLabel(t0) {
18
+ const $ = _c(14);
19
+ let label;
20
+ let rest;
21
+ if ($[0] !== t0) {
22
+ ({
23
+ label,
24
+ ...rest
25
+ } = t0);
26
+ $[0] = t0;
27
+ $[1] = label;
28
+ $[2] = rest;
29
+ } else {
30
+ label = $[1];
31
+ rest = $[2];
32
+ }
33
+ const isRequired = typeof label === "string" && label.endsWith(" *");
34
+ if (!isRequired) {
35
+ let t1;
36
+ if ($[3] !== label || $[4] !== rest) {
37
+ t1 = /*#__PURE__*/_jsx(FieldLabel, {
38
+ label: label,
39
+ ...rest
40
+ });
41
+ $[3] = label;
42
+ $[4] = rest;
43
+ $[5] = t1;
44
+ } else {
45
+ t1 = $[5];
46
+ }
47
+ return t1;
48
+ }
49
+ let t1;
50
+ if ($[6] !== label) {
51
+ t1 = label.slice(0, -2);
52
+ $[6] = label;
53
+ $[7] = t1;
54
+ } else {
55
+ t1 = $[7];
56
+ }
57
+ let t2;
58
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
59
+ t2 = /*#__PURE__*/_jsx(RequiredMark, {});
60
+ $[8] = t2;
61
+ } else {
62
+ t2 = $[8];
63
+ }
64
+ let t3;
65
+ if ($[9] !== t1) {
66
+ t3 = /*#__PURE__*/_jsxs(_Fragment, {
67
+ children: [t1, t2]
68
+ });
69
+ $[9] = t1;
70
+ $[10] = t3;
71
+ } else {
72
+ t3 = $[10];
73
+ }
74
+ const t4 = t3;
75
+ let t5;
76
+ if ($[11] !== rest || $[12] !== t4) {
77
+ t5 = /*#__PURE__*/_jsx(FieldLabel, {
78
+ ...rest,
79
+ label: t4
80
+ });
81
+ $[11] = rest;
82
+ $[12] = t4;
83
+ $[13] = t5;
84
+ } else {
85
+ t5 = $[13];
86
+ }
87
+ return t5;
88
+ }
89
+ //# sourceMappingURL=required-field-label.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"required-field-label.js","names":["c","_c","FieldLabel","RequiredMark","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","RequiredFieldLabel","t0","$","label","rest","isRequired","endsWith","t1","slice","t2","Symbol","for","t3","children","t4","t5"],"sources":["../../../../src/puck-editor/internal/fields/required-field-label.tsx"],"sourcesContent":["'use client';\n\nimport type { ComponentProps } from 'react';\nimport { FieldLabel } from '@puckeditor/core';\n\nimport { RequiredMark } from '../ui/required-mark';\n\ntype FieldLabelProps = ComponentProps<typeof FieldLabel>;\n\n/**\n * Drop-in for Puck's FieldLabel. When the label ends with the required marker\n * (\" *\", produced by the `required()` field wrapper), it renders a styled\n * <RequiredMark /> inline instead of the literal asterisk — keeping Puck's\n * native label styling.\n *\n * Used directly by custom fields and registered as `overrides.fieldLabel`, so\n * built-in and custom fields get the same marker. Puck renders `label` as a JSX\n * child, so a ReactNode works at runtime despite the `string` type.\n */\nexport function RequiredFieldLabel({ label, ...rest }: FieldLabelProps) {\n const isRequired = typeof label === 'string' && label.endsWith(' *');\n\n if (!isRequired) {\n return <FieldLabel label={label} {...rest} />;\n }\n\n return (\n <FieldLabel\n {...rest}\n label={\n (\n <>\n {label.slice(0, -2)}\n <RequiredMark />\n </>\n ) as unknown as string\n }\n />\n );\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAGb,SAASC,UAAU,QAAQ,kBAAkB;AAE7C,SAASC,YAAY,QAAQ,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAInD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAAC,mBAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAX,EAAA;EAAA,IAAAY,KAAA;EAAA,IAAAC,IAAA;EAAA,IAAAF,CAAA,QAAAD,EAAA;IAA4B;MAAAE,KAAA;MAAA,GAAAC;IAAA,IAAAH,EAAmC;IAAAC,CAAA,MAAAD,EAAA;IAAAC,CAAA,MAAAC,KAAA;IAAAD,CAAA,MAAAE,IAAA;EAAA;IAAAD,KAAA,GAAAD,CAAA;IAAAE,IAAA,GAAAF,CAAA;EAAA;EACpE,MAAAG,UAAA,GAAmB,OAAOF,KAAK,KAAK,QAAgC,IAApBA,KAAK,CAAAG,QAAS,CAAC,IAAI,CAAC;EAEpE,IAAI,CAACD,UAAU;IAAA,IAAAE,EAAA;IAAA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AAA;IAAAA,EAAA,GAAAb,CAAA;EAAA;EAAA,OAVFa,EAUE;AAAA","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ import type { FieldMetadata } from '@puckeditor/core';
2
+ type RequirableField = {
3
+ label?: string;
4
+ metadata?: FieldMetadata;
5
+ };
6
+ /**
7
+ * Marks a Puck field as required. Puck has no native `required` support, so this
8
+ * sets both channels atomically: `metadata.required` is the source of truth for
9
+ * save validation, and a trailing " *" on the label is the display channel
10
+ * (Puck's `overrides.fieldLabel` only receives the label string, where
11
+ * `RequiredFieldLabel` renders it as a red mark). Never write either by hand.
12
+ *
13
+ * Wraps any field definition, built-in or factory-made:
14
+ * title: required({ type: 'text', label: 'Title' })
15
+ * image: required(createMediaSelectorField({ label: 'Media' }))
16
+ */
17
+ export declare const required: <F extends RequirableField>(field: F) => F;
18
+ export {};
19
+ //# sourceMappingURL=required.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"required.d.ts","sourceRoot":"","sources":["../../../../src/puck-editor/internal/fields/required.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,KAAK,eAAe,GAAG;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,eAAe,EAAE,OAAO,CAAC,KAAG,CAKtD,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Marks a Puck field as required. Puck has no native `required` support, so this
3
+ * sets both channels atomically: `metadata.required` is the source of truth for
4
+ * save validation, and a trailing " *" on the label is the display channel
5
+ * (Puck's `overrides.fieldLabel` only receives the label string, where
6
+ * `RequiredFieldLabel` renders it as a red mark). Never write either by hand.
7
+ *
8
+ * Wraps any field definition, built-in or factory-made:
9
+ * title: required({ type: 'text', label: 'Title' })
10
+ * image: required(createMediaSelectorField({ label: 'Media' }))
11
+ */
12
+ export const required = field => ({
13
+ ...field,
14
+ label: field.label ? `${field.label} *` : field.label,
15
+ metadata: {
16
+ ...field.metadata,
17
+ required: true
18
+ }
19
+ });
20
+ //# sourceMappingURL=required.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"required.js","names":["required","field","label","metadata"],"sources":["../../../../src/puck-editor/internal/fields/required.ts"],"sourcesContent":["import type { FieldMetadata } from '@puckeditor/core';\n\ntype RequirableField = {\n label?: string;\n metadata?: FieldMetadata;\n};\n\n/**\n * Marks a Puck field as required. Puck has no native `required` support, so this\n * sets both channels atomically: `metadata.required` is the source of truth for\n * save validation, and a trailing \" *\" on the label is the display channel\n * (Puck's `overrides.fieldLabel` only receives the label string, where\n * `RequiredFieldLabel` renders it as a red mark). Never write either by hand.\n *\n * Wraps any field definition, built-in or factory-made:\n * title: required({ type: 'text', label: 'Title' })\n * image: required(createMediaSelectorField({ label: 'Media' }))\n */\nexport const required = <F extends RequirableField>(field: F): F =>\n ({\n ...field,\n label: field.label ? `${field.label} *` : field.label,\n metadata: { ...field.metadata, required: true },\n }) as F;\n"],"mappings":"AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,QAAQ,GAA+BC,KAAQ,KACzD;EACC,GAAGA,KAAK;EACRC,KAAK,EAAED,KAAK,CAACC,KAAK,GAAG,GAAGD,KAAK,CAACC,KAAK,IAAI,GAAGD,KAAK,CAACC,KAAK;EACrDC,QAAQ,EAAE;IAAE,GAAGF,KAAK,CAACE,QAAQ;IAAEH,QAAQ,EAAE;EAAK;AAChD,CAAC,CAAM","ignoreList":[]}