@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,243 @@
1
+ import { MEDIA_TYPES, PAGE_META_FIELDS } from "./constants.js";
2
+ const MUTATES = 'Mutates editor state; not persisted until save().';
3
+ const METHOD_DOCS = {
4
+ help: {
5
+ summary: "List the API, or with a name show one method's full detail.",
6
+ params: [{
7
+ name: 'name',
8
+ type: 'string',
9
+ required: false,
10
+ description: 'Method name for full detail; omit for the index.'
11
+ }],
12
+ returns: "The index object, or the named method's doc.",
13
+ example: "puckAgent.help('addComponent')"
14
+ },
15
+ open: {
16
+ summary: 'Open the Puck editor overlay.',
17
+ returns: 'undefined; poll isReady() until true before using content methods.',
18
+ sideEffects: 'Shows the editor; content methods (getPage, addComponent, …) mount once ready.',
19
+ example: 'puckAgent.open()'
20
+ },
21
+ close: {
22
+ summary: 'Close the editor; discards unsaved changes.',
23
+ returns: 'undefined.',
24
+ sideEffects: 'Discards unsaved edits and refreshes the page.'
25
+ },
26
+ isOpen: {
27
+ summary: 'Whether the editor overlay is open.',
28
+ returns: 'boolean.'
29
+ },
30
+ isReady: {
31
+ summary: 'Whether the content methods are mounted.',
32
+ returns: 'boolean; poll after open() until true.'
33
+ },
34
+ createPage: {
35
+ summary: 'Create a new unpublished page (a Drupal node).',
36
+ async: true,
37
+ params: [{
38
+ name: 'title',
39
+ type: 'string',
40
+ required: false,
41
+ description: 'Page title; omit for a Drupal default draft title.'
42
+ }, {
43
+ name: 'alias',
44
+ type: 'string',
45
+ required: false,
46
+ description: "URL path, e.g. '/about-us'; omit to let Drupal derive one from the title (Pathauto). A given alias overrides Pathauto."
47
+ }],
48
+ returns: 'Promise<{ id, nid, alias, fieldName, editUrl }>; alias is the actually saved path. Navigate to editUrl to open the editor on the new page.',
49
+ sideEffects: 'Persists a new unpublished node in the CMS immediately, assigned to the configured space. Needs the create permission on the content type.',
50
+ example: "await puckAgent.createPage('About us', '/about-us')"
51
+ },
52
+ listComponents: {
53
+ summary: 'List the available components (the palette).',
54
+ returns: '[{ name, label, category, fields }]; fields is the field-name list.',
55
+ example: 'puckAgent.listComponents()'
56
+ },
57
+ describeComponent: {
58
+ summary: 'Field spec and defaults for one component type.',
59
+ params: [{
60
+ name: 'type',
61
+ type: 'string',
62
+ required: true,
63
+ description: "Component type from listComponents(), e.g. 'HeroSection'."
64
+ }],
65
+ returns: '{ fields, defaultProps, label, metadata }; inspect fields before building props.',
66
+ example: "puckAgent.describeComponent('HeroSection')"
67
+ },
68
+ getPage: {
69
+ summary: 'The current page tree.',
70
+ returns: '{ root, content[], zones }; component ids are at props.id, use them for update/remove/placement.',
71
+ example: 'puckAgent.getPage()'
72
+ },
73
+ listMedia: {
74
+ summary: 'Search CMS media (images, videos).',
75
+ async: true,
76
+ params: [{
77
+ name: 'type',
78
+ type: 'string',
79
+ required: true,
80
+ description: 'Media type.',
81
+ enum: [...MEDIA_TYPES]
82
+ }, {
83
+ name: 'search',
84
+ type: 'string',
85
+ required: false,
86
+ description: 'Filter text; omit for the newest items.'
87
+ }, {
88
+ name: 'limit',
89
+ type: 'number',
90
+ required: false,
91
+ description: 'Max results per page (CMS caps at 50).'
92
+ }, {
93
+ name: 'offset',
94
+ type: 'number',
95
+ required: false,
96
+ description: 'Skip the first n items for pagination; results are sorted newest first.'
97
+ }],
98
+ returns: 'Promise<[{ id, type, name, title, url, alt, width, height, thumbnailImage }]>; pass a returned item verbatim into a media field, never invent media values.',
99
+ example: "await puckAgent.listMedia('image', 'logo', 10, 20)"
100
+ },
101
+ uploadMedia: {
102
+ summary: 'Upload a media item to the CMS.',
103
+ async: true,
104
+ params: [{
105
+ name: 'options',
106
+ type: 'object',
107
+ required: true,
108
+ description: `{ url, type?, name?, alt? }. type: one of ${MEDIA_TYPES.map(t => `'${t}'`).join(', ')} (default '${MEDIA_TYPES[0]}'). For images, url MUST be a data: URL: base64-encode the file inline (max 8 MB). The server never fetches external URLs, so for a web image download it yourself first, then pass it as a data: URL. For remote_video, url is a YouTube/Vimeo page URL (stored as oembed, not downloaded). name: media label. alt: image alt text.`
109
+ }],
110
+ returns: 'Promise<{ id, data }>; pass data verbatim into a media field, like a listMedia() item.',
111
+ sideEffects: 'Persists a new media entity in the CMS immediately.',
112
+ example: "await puckAgent.uploadMedia({ url: 'data:image/png;base64,iVBORw0KGgo...', name: 'logo.png', alt: 'Logo' })"
113
+ },
114
+ listTemplates: {
115
+ summary: 'List reusable content templates (built-in and editor-authored).',
116
+ async: true,
117
+ returns: 'Promise<[{ id, name, category, source, ai? }]>; category is "page" | "section" | "block", source is "builtin" | "custom", ai carries optional description/instructions. Pass id verbatim to insertTemplate.',
118
+ example: 'await puckAgent.listTemplates()'
119
+ },
120
+ insertTemplate: {
121
+ summary: "Insert a template's components into the page.",
122
+ async: true,
123
+ params: [{
124
+ name: 'id',
125
+ type: 'string',
126
+ required: true,
127
+ description: 'Template id from listTemplates().'
128
+ }, {
129
+ name: 'dest',
130
+ type: 'object',
131
+ required: false,
132
+ description: '{ destinationId, destinationSlot, destinationIndex }. page and section templates go to the page root (omit dest). block templates need destinationId + destinationSlot; they cannot go to the root, which accepts only section-type components.'
133
+ }],
134
+ returns: 'Promise<{ ok: true, ids } | { ok: false, error }>; ids are the inserted component ids. error when a block template targets the root, a section/page template targets a slot, or the slot disallows a type.',
135
+ sideEffects: MUTATES
136
+ },
137
+ addComponent: {
138
+ summary: 'Add a component to the page and render it live.',
139
+ params: [{
140
+ name: 'type',
141
+ type: 'string',
142
+ required: true,
143
+ description: "Component type from listComponents(), e.g. 'HeroSection'."
144
+ }, {
145
+ name: 'opts',
146
+ type: 'object',
147
+ required: false,
148
+ description: '{ props?, destinationId?, destinationSlot?, destinationIndex? }. props: partial, missing use defaults. destinationId from getPage(), omit = page root (which accepts only section-type components). destinationSlot required with destinationId. destinationIndex omit = append.'
149
+ }],
150
+ returns: '{ ok: true, id } with the new component id, or { ok: false, error } (unknown type, missing destination, slot disallows the type, or the page root rejects a non-section type).',
151
+ sideEffects: MUTATES,
152
+ example: "puckAgent.addComponent('HeroSection', { props: { title: 'Welcome' } })"
153
+ },
154
+ updateComponent: {
155
+ summary: 'Merge new props into an existing component.',
156
+ params: [{
157
+ name: 'id',
158
+ type: 'string',
159
+ required: true,
160
+ description: 'Component id from getPage().'
161
+ }, {
162
+ name: 'newProps',
163
+ type: 'object',
164
+ required: true,
165
+ description: 'Props to merge; unspecified props keep their value.'
166
+ }],
167
+ returns: '{ ok: true, id } or { ok: false, error } if the id is unknown.',
168
+ sideEffects: MUTATES,
169
+ example: "puckAgent.updateComponent('HeroSection-1a2b', { title: 'New title' })"
170
+ },
171
+ removeComponent: {
172
+ summary: 'Remove a component from the page.',
173
+ params: [{
174
+ name: 'id',
175
+ type: 'string',
176
+ required: true,
177
+ description: 'Component id from getPage().'
178
+ }],
179
+ returns: '{ ok: true, id } or { ok: false, error } if the id is unknown.',
180
+ sideEffects: MUTATES
181
+ },
182
+ setPageMeta: {
183
+ summary: 'Set page-level metadata.',
184
+ params: [{
185
+ name: 'fields',
186
+ type: 'object',
187
+ required: true,
188
+ description: `Any of: ${PAGE_META_FIELDS.join(', ')}. urlAlias is a URL path (no locale prefix); publishedState is "published" | "unpublished".`
189
+ }],
190
+ returns: '{ ok: true, ignored? } (ignored lists unknown fields) or { ok: false, error } if no field is known.',
191
+ sideEffects: MUTATES,
192
+ example: "puckAgent.setPageMeta({ title: 'About us', publishedState: 'published' })"
193
+ },
194
+ save: {
195
+ summary: 'Persist the current page in its current published state (does not change publish status).',
196
+ async: true,
197
+ returns: 'Promise<{ ok: true } | { ok: false, error }>.',
198
+ sideEffects: "Persists to the CMS, the same action as the editor's Save button. Publish/unpublish only via setPageMeta({ publishedState }). No autosave; call only when the user asks.",
199
+ example: 'await puckAgent.save()'
200
+ }
201
+ };
202
+ const USAGE = "window.puckAgent editor API. Call help('name') for one method's full detail. Await async methods. Component ids come from getPage() and are generated by the editor, never invent them.";
203
+ export function buildHelp(agent, name) {
204
+ const present = new Set(agent ? Object.keys(agent).filter(k => typeof agent[k] === 'function') : []);
205
+ if (name) {
206
+ const doc = METHOD_DOCS[name];
207
+ if (!doc) {
208
+ if (present.has(name)) return {
209
+ name,
210
+ note: 'present but undocumented'
211
+ };
212
+ return {
213
+ error: `no method "${name}"`,
214
+ hint: 'call help() for the list'
215
+ };
216
+ }
217
+ return {
218
+ name,
219
+ available: present.has(name),
220
+ ...(present.has(name) ? {} : {
221
+ hint: 'call open(), then poll isReady()'
222
+ }),
223
+ ...doc
224
+ };
225
+ }
226
+ const methods = {};
227
+ const needsOpen = {};
228
+ for (const [key, doc] of Object.entries(METHOD_DOCS)) {
229
+ (present.has(key) ? methods : needsOpen)[key] = doc.summary;
230
+ }
231
+ const undocumented = [...present].filter(k => !(k in METHOD_DOCS));
232
+ return {
233
+ usage: USAGE,
234
+ methods,
235
+ ...(Object.keys(needsOpen).length ? {
236
+ needsOpen
237
+ } : {}),
238
+ ...(undocumented.length ? {
239
+ undocumented
240
+ } : {})
241
+ };
242
+ }
243
+ //# sourceMappingURL=help.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help.js","names":["MEDIA_TYPES","PAGE_META_FIELDS","MUTATES","METHOD_DOCS","help","summary","params","name","type","required","description","returns","example","open","sideEffects","close","isOpen","isReady","createPage","async","listComponents","describeComponent","getPage","listMedia","enum","uploadMedia","map","t","join","listTemplates","insertTemplate","addComponent","updateComponent","removeComponent","setPageMeta","save","USAGE","buildHelp","agent","present","Set","Object","keys","filter","k","doc","has","note","error","hint","available","methods","needsOpen","key","entries","undocumented","usage","length"],"sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/help.ts"],"sourcesContent":["import { MEDIA_TYPES, PAGE_META_FIELDS } from './constants.ts';\n\ntype Param = {\n name: string;\n type: string;\n required: boolean;\n description: string;\n enum?: string[];\n};\n\ntype MethodDoc = {\n summary: string;\n async?: boolean;\n params?: Param[];\n returns?: string;\n sideEffects?: string;\n example?: string;\n};\n\nconst MUTATES = 'Mutates editor state; not persisted until save().';\n\nconst METHOD_DOCS: Record<string, MethodDoc> = {\n help: {\n summary: \"List the API, or with a name show one method's full detail.\",\n params: [\n {\n name: 'name',\n type: 'string',\n required: false,\n description: 'Method name for full detail; omit for the index.',\n },\n ],\n returns: \"The index object, or the named method's doc.\",\n example: \"puckAgent.help('addComponent')\",\n },\n open: {\n summary: 'Open the Puck editor overlay.',\n returns:\n 'undefined; poll isReady() until true before using content methods.',\n sideEffects:\n 'Shows the editor; content methods (getPage, addComponent, …) mount once ready.',\n example: 'puckAgent.open()',\n },\n close: {\n summary: 'Close the editor; discards unsaved changes.',\n returns: 'undefined.',\n sideEffects: 'Discards unsaved edits and refreshes the page.',\n },\n isOpen: {\n summary: 'Whether the editor overlay is open.',\n returns: 'boolean.',\n },\n isReady: {\n summary: 'Whether the content methods are mounted.',\n returns: 'boolean; poll after open() until true.',\n },\n createPage: {\n summary: 'Create a new unpublished page (a Drupal node).',\n async: true,\n params: [\n {\n name: 'title',\n type: 'string',\n required: false,\n description: 'Page title; omit for a Drupal default draft title.',\n },\n {\n name: 'alias',\n type: 'string',\n required: false,\n description:\n \"URL path, e.g. '/about-us'; omit to let Drupal derive one from the title (Pathauto). A given alias overrides Pathauto.\",\n },\n ],\n returns:\n 'Promise<{ id, nid, alias, fieldName, editUrl }>; alias is the actually saved path. Navigate to editUrl to open the editor on the new page.',\n sideEffects:\n 'Persists a new unpublished node in the CMS immediately, assigned to the configured space. Needs the create permission on the content type.',\n example: \"await puckAgent.createPage('About us', '/about-us')\",\n },\n listComponents: {\n summary: 'List the available components (the palette).',\n returns:\n '[{ name, label, category, fields }]; fields is the field-name list.',\n example: 'puckAgent.listComponents()',\n },\n describeComponent: {\n summary: 'Field spec and defaults for one component type.',\n params: [\n {\n name: 'type',\n type: 'string',\n required: true,\n description:\n \"Component type from listComponents(), e.g. 'HeroSection'.\",\n },\n ],\n returns:\n '{ fields, defaultProps, label, metadata }; inspect fields before building props.',\n example: \"puckAgent.describeComponent('HeroSection')\",\n },\n getPage: {\n summary: 'The current page tree.',\n returns:\n '{ root, content[], zones }; component ids are at props.id, use them for update/remove/placement.',\n example: 'puckAgent.getPage()',\n },\n listMedia: {\n summary: 'Search CMS media (images, videos).',\n async: true,\n params: [\n {\n name: 'type',\n type: 'string',\n required: true,\n description: 'Media type.',\n enum: [...MEDIA_TYPES],\n },\n {\n name: 'search',\n type: 'string',\n required: false,\n description: 'Filter text; omit for the newest items.',\n },\n {\n name: 'limit',\n type: 'number',\n required: false,\n description: 'Max results per page (CMS caps at 50).',\n },\n {\n name: 'offset',\n type: 'number',\n required: false,\n description:\n 'Skip the first n items for pagination; results are sorted newest first.',\n },\n ],\n returns:\n 'Promise<[{ id, type, name, title, url, alt, width, height, thumbnailImage }]>; pass a returned item verbatim into a media field, never invent media values.',\n example: \"await puckAgent.listMedia('image', 'logo', 10, 20)\",\n },\n uploadMedia: {\n summary: 'Upload a media item to the CMS.',\n async: true,\n params: [\n {\n name: 'options',\n type: 'object',\n required: true,\n description: `{ url, type?, name?, alt? }. type: one of ${MEDIA_TYPES.map((t) => `'${t}'`).join(', ')} (default '${MEDIA_TYPES[0]}'). For images, url MUST be a data: URL: base64-encode the file inline (max 8 MB). The server never fetches external URLs, so for a web image download it yourself first, then pass it as a data: URL. For remote_video, url is a YouTube/Vimeo page URL (stored as oembed, not downloaded). name: media label. alt: image alt text.`,\n },\n ],\n returns:\n 'Promise<{ id, data }>; pass data verbatim into a media field, like a listMedia() item.',\n sideEffects: 'Persists a new media entity in the CMS immediately.',\n example:\n \"await puckAgent.uploadMedia({ url: 'data:image/png;base64,iVBORw0KGgo...', name: 'logo.png', alt: 'Logo' })\",\n },\n listTemplates: {\n summary: 'List reusable content templates (built-in and editor-authored).',\n async: true,\n returns:\n 'Promise<[{ id, name, category, source, ai? }]>; category is \"page\" | \"section\" | \"block\", source is \"builtin\" | \"custom\", ai carries optional description/instructions. Pass id verbatim to insertTemplate.',\n example: 'await puckAgent.listTemplates()',\n },\n insertTemplate: {\n summary: \"Insert a template's components into the page.\",\n async: true,\n params: [\n {\n name: 'id',\n type: 'string',\n required: true,\n description: 'Template id from listTemplates().',\n },\n {\n name: 'dest',\n type: 'object',\n required: false,\n description:\n '{ destinationId, destinationSlot, destinationIndex }. page and section templates go to the page root (omit dest). block templates need destinationId + destinationSlot; they cannot go to the root, which accepts only section-type components.',\n },\n ],\n returns:\n 'Promise<{ ok: true, ids } | { ok: false, error }>; ids are the inserted component ids. error when a block template targets the root, a section/page template targets a slot, or the slot disallows a type.',\n sideEffects: MUTATES,\n },\n addComponent: {\n summary: 'Add a component to the page and render it live.',\n params: [\n {\n name: 'type',\n type: 'string',\n required: true,\n description:\n \"Component type from listComponents(), e.g. 'HeroSection'.\",\n },\n {\n name: 'opts',\n type: 'object',\n required: false,\n description:\n '{ props?, destinationId?, destinationSlot?, destinationIndex? }. props: partial, missing use defaults. destinationId from getPage(), omit = page root (which accepts only section-type components). destinationSlot required with destinationId. destinationIndex omit = append.',\n },\n ],\n returns:\n '{ ok: true, id } with the new component id, or { ok: false, error } (unknown type, missing destination, slot disallows the type, or the page root rejects a non-section type).',\n sideEffects: MUTATES,\n example:\n \"puckAgent.addComponent('HeroSection', { props: { title: 'Welcome' } })\",\n },\n updateComponent: {\n summary: 'Merge new props into an existing component.',\n params: [\n {\n name: 'id',\n type: 'string',\n required: true,\n description: 'Component id from getPage().',\n },\n {\n name: 'newProps',\n type: 'object',\n required: true,\n description: 'Props to merge; unspecified props keep their value.',\n },\n ],\n returns: '{ ok: true, id } or { ok: false, error } if the id is unknown.',\n sideEffects: MUTATES,\n example:\n \"puckAgent.updateComponent('HeroSection-1a2b', { title: 'New title' })\",\n },\n removeComponent: {\n summary: 'Remove a component from the page.',\n params: [\n {\n name: 'id',\n type: 'string',\n required: true,\n description: 'Component id from getPage().',\n },\n ],\n returns: '{ ok: true, id } or { ok: false, error } if the id is unknown.',\n sideEffects: MUTATES,\n },\n setPageMeta: {\n summary: 'Set page-level metadata.',\n params: [\n {\n name: 'fields',\n type: 'object',\n required: true,\n description: `Any of: ${PAGE_META_FIELDS.join(', ')}. urlAlias is a URL path (no locale prefix); publishedState is \"published\" | \"unpublished\".`,\n },\n ],\n returns:\n '{ ok: true, ignored? } (ignored lists unknown fields) or { ok: false, error } if no field is known.',\n sideEffects: MUTATES,\n example:\n \"puckAgent.setPageMeta({ title: 'About us', publishedState: 'published' })\",\n },\n save: {\n summary:\n 'Persist the current page in its current published state (does not change publish status).',\n async: true,\n returns: 'Promise<{ ok: true } | { ok: false, error }>.',\n sideEffects:\n \"Persists to the CMS, the same action as the editor's Save button. Publish/unpublish only via setPageMeta({ publishedState }). No autosave; call only when the user asks.\",\n example: 'await puckAgent.save()',\n },\n};\n\nconst USAGE =\n \"window.puckAgent editor API. Call help('name') for one method's full detail. Await async methods. Component ids come from getPage() and are generated by the editor, never invent them.\";\n\nexport function buildHelp(\n agent: Record<string, unknown> | undefined,\n name?: string\n): unknown {\n const present = new Set(\n agent\n ? Object.keys(agent).filter((k) => typeof agent[k] === 'function')\n : []\n );\n\n if (name) {\n const doc = METHOD_DOCS[name];\n if (!doc) {\n if (present.has(name)) return { name, note: 'present but undocumented' };\n return { error: `no method \"${name}\"`, hint: 'call help() for the list' };\n }\n return {\n name,\n available: present.has(name),\n ...(present.has(name)\n ? {}\n : { hint: 'call open(), then poll isReady()' }),\n ...doc,\n };\n }\n\n const methods: Record<string, string> = {};\n const needsOpen: Record<string, string> = {};\n for (const [key, doc] of Object.entries(METHOD_DOCS)) {\n (present.has(key) ? methods : needsOpen)[key] = doc.summary;\n }\n const undocumented = [...present].filter((k) => !(k in METHOD_DOCS));\n\n return {\n usage: USAGE,\n methods,\n ...(Object.keys(needsOpen).length ? { needsOpen } : {}),\n ...(undocumented.length ? { undocumented } : {}),\n };\n}\n"],"mappings":"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","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export { createAgentPlugin } from './agent-plugin';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { createAgentPlugin } from './agent-plugin';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["createAgentPlugin"],"sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/index.ts"],"sourcesContent":["export { createAgentPlugin } from './agent-plugin';\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,gBAAgB","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ export type AgentMediaItem = {
2
+ id: string;
3
+ type: string;
4
+ name?: string;
5
+ title?: string;
6
+ url?: string;
7
+ alt?: string;
8
+ width?: number;
9
+ height?: number;
10
+ thumbnailImage?: string;
11
+ };
12
+ /**
13
+ * Fetch CMS media of a given type via the editor-gated media route, mapped to
14
+ * a flat list. Values for media/node fields MUST come from this output
15
+ * verbatim — never invented; items keep id/type/name/thumbnailImage so they
16
+ * drop into media fields unchanged.
17
+ */
18
+ export declare function listMedia(lang: string | undefined, drupalBaseUrl: string, type: string, query?: string, limit?: number, offset?: number): Promise<AgentMediaItem[]>;
19
+ //# sourceMappingURL=list-media.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-media.d.ts","sourceRoot":"","sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/list-media.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAsBF;;;;;GAKG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,MAAM,EACd,KAAK,CAAC,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,cAAc,EAAE,CAAC,CA4B3B"}
@@ -0,0 +1,31 @@
1
+ import { absolutizeMediaUrl, fetchMediaList } from "../../api/client.js";
2
+ /**
3
+ * Fetch CMS media of a given type via the editor-gated media route, mapped to
4
+ * a flat list. Values for media/node fields MUST come from this output
5
+ * verbatim — never invented; items keep id/type/name/thumbnailImage so they
6
+ * drop into media fields unchanged.
7
+ */
8
+ export async function listMedia(lang, drupalBaseUrl, type, query, limit, offset) {
9
+ const body = await fetchMediaList(type, {
10
+ lang,
11
+ query,
12
+ limit,
13
+ offset
14
+ });
15
+ const items = Array.isArray(body?.data) ? body.data : [];
16
+ return items.map(item => {
17
+ const file = item.field_media_image ?? item.field_media_video_file;
18
+ return {
19
+ id: item.id,
20
+ type: item.type,
21
+ name: item.name,
22
+ title: item.name,
23
+ url: absolutizeMediaUrl(drupalBaseUrl, file?.uri?.url) ?? item.field_media_oembed_video,
24
+ alt: file?.meta?.alt ?? undefined,
25
+ width: file?.meta?.width,
26
+ height: file?.meta?.height,
27
+ thumbnailImage: absolutizeMediaUrl(drupalBaseUrl, item.thumbnail?.uri?.url)
28
+ };
29
+ });
30
+ }
31
+ //# sourceMappingURL=list-media.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-media.js","names":["absolutizeMediaUrl","fetchMediaList","listMedia","lang","drupalBaseUrl","type","query","limit","offset","body","items","Array","isArray","data","map","item","file","field_media_image","field_media_video_file","id","name","title","url","uri","field_media_oembed_video","alt","meta","undefined","width","height","thumbnailImage","thumbnail"],"sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/list-media.ts"],"sourcesContent":["import { absolutizeMediaUrl, fetchMediaList } from '../../api/client.ts';\n\nexport type AgentMediaItem = {\n id: string;\n type: string;\n name?: string;\n title?: string;\n url?: string;\n alt?: string;\n width?: number;\n height?: number;\n thumbnailImage?: string;\n};\n\ntype FileRef = {\n uri?: { url?: string };\n meta?: {\n alt?: string | null;\n title?: string | null;\n width?: number;\n height?: number;\n };\n};\n\ntype MediaEntity = {\n id: string;\n type: string;\n name?: string;\n thumbnail?: { uri?: { url?: string } };\n field_media_image?: FileRef;\n field_media_video_file?: FileRef;\n field_media_oembed_video?: string;\n};\n\n/**\n * Fetch CMS media of a given type via the editor-gated media route, mapped to\n * a flat list. Values for media/node fields MUST come from this output\n * verbatim — never invented; items keep id/type/name/thumbnailImage so they\n * drop into media fields unchanged.\n */\nexport async function listMedia(\n lang: string | undefined,\n drupalBaseUrl: string,\n type: string,\n query?: string,\n limit?: number,\n offset?: number\n): Promise<AgentMediaItem[]> {\n const body = await fetchMediaList<{ data?: MediaEntity[] }>(type, {\n lang,\n query,\n limit,\n offset,\n });\n const items: MediaEntity[] = Array.isArray(body?.data) ? body.data : [];\n\n return items.map((item) => {\n const file = item.field_media_image ?? item.field_media_video_file;\n return {\n id: item.id,\n type: item.type,\n name: item.name,\n title: item.name,\n url:\n absolutizeMediaUrl(drupalBaseUrl, file?.uri?.url) ??\n item.field_media_oembed_video,\n alt: file?.meta?.alt ?? undefined,\n width: file?.meta?.width,\n height: file?.meta?.height,\n thumbnailImage: absolutizeMediaUrl(\n drupalBaseUrl,\n item.thumbnail?.uri?.url\n ),\n };\n });\n}\n"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,cAAc,QAAQ,qBAAqB;AAkCxE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,SAASA,CAC7BC,IAAwB,EACxBC,aAAqB,EACrBC,IAAY,EACZC,KAAc,EACdC,KAAc,EACdC,MAAe,EACY;EAC3B,MAAMC,IAAI,GAAG,MAAMR,cAAc,CAA2BI,IAAI,EAAE;IAChEF,IAAI;IACJG,KAAK;IACLC,KAAK;IACLC;EACF,CAAC,CAAC;EACF,MAAME,KAAoB,GAAGC,KAAK,CAACC,OAAO,CAACH,IAAI,EAAEI,IAAI,CAAC,GAAGJ,IAAI,CAACI,IAAI,GAAG,EAAE;EAEvE,OAAOH,KAAK,CAACI,GAAG,CAAEC,IAAI,IAAK;IACzB,MAAMC,IAAI,GAAGD,IAAI,CAACE,iBAAiB,IAAIF,IAAI,CAACG,sBAAsB;IAClE,OAAO;MACLC,EAAE,EAAEJ,IAAI,CAACI,EAAE;MACXd,IAAI,EAAEU,IAAI,CAACV,IAAI;MACfe,IAAI,EAAEL,IAAI,CAACK,IAAI;MACfC,KAAK,EAAEN,IAAI,CAACK,IAAI;MAChBE,GAAG,EACDtB,kBAAkB,CAACI,aAAa,EAAEY,IAAI,EAAEO,GAAG,EAAED,GAAG,CAAC,IACjDP,IAAI,CAACS,wBAAwB;MAC/BC,GAAG,EAAET,IAAI,EAAEU,IAAI,EAAED,GAAG,IAAIE,SAAS;MACjCC,KAAK,EAAEZ,IAAI,EAAEU,IAAI,EAAEE,KAAK;MACxBC,MAAM,EAAEb,IAAI,EAAEU,IAAI,EAAEG,MAAM;MAC1BC,cAAc,EAAE9B,kBAAkB,CAChCI,aAAa,EACbW,IAAI,CAACgB,SAAS,EAAER,GAAG,EAAED,GACvB;IACF,CAAC;EACH,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ import type { Config, Data, PuckAction } from '@puckeditor/core';
2
+ import type { PuckTemplatesConfig } from '../../content-model.ts';
3
+ import { type BuiltinTemplate } from '../templates-plugin/templates.ts';
4
+ import { type PatchResult } from './apply-patch-to-puck.ts';
5
+ type Dispatch = (action: PuckAction) => void;
6
+ export type TemplateDestination = {
7
+ destinationId?: string;
8
+ destinationSlot?: string;
9
+ destinationIndex?: number;
10
+ };
11
+ export declare function listTemplates(templatesConfig: PuckTemplatesConfig, builtins: BuiltinTemplate[]): Promise<{
12
+ ai?: {
13
+ instructions?: string | undefined;
14
+ description?: string | undefined;
15
+ } | undefined;
16
+ id: string;
17
+ name: string;
18
+ category: import("../templates-plugin/templates.ts").TemplateCategory;
19
+ source: "custom" | "builtin";
20
+ }[]>;
21
+ export declare function insertTemplate(dispatch: Dispatch, data: Data | undefined, config: Config, templatesConfig: PuckTemplatesConfig, builtins: BuiltinTemplate[], templateId: string, dest?: TemplateDestination): Promise<PatchResult>;
22
+ export {};
23
+ //# sourceMappingURL=templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/templates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAKlE,OAAO,EAOL,KAAK,eAAe,EAErB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE9E,KAAK,QAAQ,GAAG,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;AAE7C,MAAM,MAAM,mBAAmB,GAAG;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAgCF,wBAAsB,aAAa,CACjC,eAAe,EAAE,mBAAmB,EACpC,QAAQ,EAAE,eAAe,EAAE;;;;;;;;;KAI5B;AAED,wBAAsB,cAAc,CAClC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,GAAG,SAAS,EACtB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,mBAAmB,EACpC,QAAQ,EAAE,eAAe,EAAE,EAC3B,UAAU,EAAE,MAAM,EAClB,IAAI,CAAC,EAAE,mBAAmB,GACzB,OAAO,CAAC,WAAW,CAAC,CA2CtB"}
@@ -0,0 +1,72 @@
1
+ import { getEditorQueryClient, TEMPLATES_QUERY_KEY } from "../../editor-query-client.js";
2
+ import { expandTemplate, fetchTemplates, isRootLevelTemplate, mergeTemplates, templateKey, templateLabel } from "../templates-plugin/templates.js";
3
+ import { applyPatchToPuck } from "./apply-patch-to-puck.js";
4
+ const summarize = template => ({
5
+ id: templateKey(template),
6
+ name: templateLabel(template, 'en'),
7
+ category: template.category,
8
+ source: template.source,
9
+ ...(template.ai ? {
10
+ ai: {
11
+ ...(template.ai.description ? {
12
+ description: template.ai.description
13
+ } : {}),
14
+ ...(template.ai.instructions ? {
15
+ instructions: template.ai.instructions
16
+ } : {})
17
+ }
18
+ } : {})
19
+ });
20
+ async function resolveTemplates(templatesConfig, builtins) {
21
+ const {
22
+ valid
23
+ } = await getEditorQueryClient().fetchQuery({
24
+ queryKey: [...TEMPLATES_QUERY_KEY],
25
+ queryFn: () => fetchTemplates(templatesConfig)
26
+ });
27
+ return mergeTemplates(builtins, valid);
28
+ }
29
+ export async function listTemplates(templatesConfig, builtins) {
30
+ const templates = await resolveTemplates(templatesConfig, builtins);
31
+ return templates.map(summarize);
32
+ }
33
+ export async function insertTemplate(dispatch, data, config, templatesConfig, builtins, templateId, dest) {
34
+ const templates = await resolveTemplates(templatesConfig, builtins);
35
+ const template = templates.find(t => templateKey(t) === templateId);
36
+ if (!template) {
37
+ return {
38
+ ok: false,
39
+ error: `template "${templateId}" not found`
40
+ };
41
+ }
42
+ if (dest?.destinationId && !dest.destinationSlot) {
43
+ return {
44
+ ok: false,
45
+ error: 'destinationSlot is required with destinationId'
46
+ };
47
+ }
48
+ const targetsRoot = !(dest?.destinationId && dest?.destinationSlot);
49
+ if (template.category === 'block' && targetsRoot) {
50
+ return {
51
+ ok: false,
52
+ error: 'block templates cannot be inserted at the page root; pass destinationId and destinationSlot'
53
+ };
54
+ }
55
+ if (isRootLevelTemplate(template) && !targetsRoot) {
56
+ return {
57
+ ok: false,
58
+ error: `${template.category} templates can only be inserted at the page root; omit destinationId and destinationSlot`
59
+ };
60
+ }
61
+ const {
62
+ content
63
+ } = expandTemplate(template, config, templateLabel(template, 'en'));
64
+ const zone = dest?.destinationId ? `${dest.destinationId}:${dest.destinationSlot}` : undefined;
65
+ return applyPatchToPuck(dispatch, data, config, {
66
+ action: 'addMany',
67
+ components: content,
68
+ destinationZone: zone,
69
+ destinationIndex: dest?.destinationIndex
70
+ });
71
+ }
72
+ //# sourceMappingURL=templates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.js","names":["getEditorQueryClient","TEMPLATES_QUERY_KEY","expandTemplate","fetchTemplates","isRootLevelTemplate","mergeTemplates","templateKey","templateLabel","applyPatchToPuck","summarize","template","id","name","category","source","ai","description","instructions","resolveTemplates","templatesConfig","builtins","valid","fetchQuery","queryKey","queryFn","listTemplates","templates","map","insertTemplate","dispatch","data","config","templateId","dest","find","t","ok","error","destinationId","destinationSlot","targetsRoot","content","zone","undefined","action","components","destinationZone","destinationIndex"],"sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/templates.ts"],"sourcesContent":["import type { Config, Data, PuckAction } from '@puckeditor/core';\n\nimport type { PuckTemplatesConfig } from '../../content-model.ts';\nimport {\n getEditorQueryClient,\n TEMPLATES_QUERY_KEY,\n} from '../../editor-query-client.ts';\nimport {\n expandTemplate,\n fetchTemplates,\n isRootLevelTemplate,\n mergeTemplates,\n templateKey,\n templateLabel,\n type BuiltinTemplate,\n type Template,\n} from '../templates-plugin/templates.ts';\nimport { applyPatchToPuck, type PatchResult } from './apply-patch-to-puck.ts';\n\ntype Dispatch = (action: PuckAction) => void;\n\nexport type TemplateDestination = {\n destinationId?: string;\n destinationSlot?: string;\n destinationIndex?: number;\n};\n\nconst summarize = (template: Template) => ({\n id: templateKey(template),\n name: templateLabel(template, 'en'),\n category: template.category,\n source: template.source,\n ...(template.ai\n ? {\n ai: {\n ...(template.ai.description\n ? { description: template.ai.description }\n : {}),\n ...(template.ai.instructions\n ? { instructions: template.ai.instructions }\n : {}),\n },\n }\n : {}),\n});\n\nasync function resolveTemplates(\n templatesConfig: PuckTemplatesConfig,\n builtins: BuiltinTemplate[]\n): Promise<Template[]> {\n const { valid } = await getEditorQueryClient().fetchQuery({\n queryKey: [...TEMPLATES_QUERY_KEY],\n queryFn: () => fetchTemplates(templatesConfig),\n });\n return mergeTemplates(builtins, valid);\n}\n\nexport async function listTemplates(\n templatesConfig: PuckTemplatesConfig,\n builtins: BuiltinTemplate[]\n) {\n const templates = await resolveTemplates(templatesConfig, builtins);\n return templates.map(summarize);\n}\n\nexport async function insertTemplate(\n dispatch: Dispatch,\n data: Data | undefined,\n config: Config,\n templatesConfig: PuckTemplatesConfig,\n builtins: BuiltinTemplate[],\n templateId: string,\n dest?: TemplateDestination\n): Promise<PatchResult> {\n const templates = await resolveTemplates(templatesConfig, builtins);\n const template = templates.find((t) => templateKey(t) === templateId);\n if (!template) {\n return { ok: false, error: `template \"${templateId}\" not found` };\n }\n if (dest?.destinationId && !dest.destinationSlot) {\n return {\n ok: false,\n error: 'destinationSlot is required with destinationId',\n };\n }\n\n const targetsRoot = !(dest?.destinationId && dest?.destinationSlot);\n if (template.category === 'block' && targetsRoot) {\n return {\n ok: false,\n error:\n 'block templates cannot be inserted at the page root; pass destinationId and destinationSlot',\n };\n }\n if (isRootLevelTemplate(template) && !targetsRoot) {\n return {\n ok: false,\n error: `${template.category} templates can only be inserted at the page root; omit destinationId and destinationSlot`,\n };\n }\n\n const { content } = expandTemplate(\n template,\n config,\n templateLabel(template, 'en')\n );\n const zone = dest?.destinationId\n ? `${dest.destinationId}:${dest.destinationSlot}`\n : undefined;\n\n return applyPatchToPuck(dispatch, data, config, {\n action: 'addMany',\n components: content,\n destinationZone: zone,\n destinationIndex: dest?.destinationIndex,\n });\n}\n"],"mappings":"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","ignoreList":[]}
@@ -0,0 +1,20 @@
1
+ import { MediaType } from './constants.ts';
2
+ type UploadMediaParams = {
3
+ lang: string | undefined;
4
+ type?: MediaType;
5
+ url: string;
6
+ name?: string;
7
+ alt?: string;
8
+ };
9
+ /**
10
+ * Upload a media item to the CMS. Images are passed inline as a data: URL
11
+ * (base64), remote_video as a YouTube/Vimeo page URL; the server never fetches
12
+ * external URLs. Returns the created media entity, shaped like a listMedia()
13
+ * item so it can be passed verbatim into a media field.
14
+ */
15
+ export declare function uploadMedia({ lang, type, url, name, alt, }: UploadMediaParams): Promise<{
16
+ id: string | null;
17
+ data: unknown;
18
+ }>;
19
+ export {};
20
+ //# sourceMappingURL=upload-media.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-media.d.ts","sourceRoot":"","sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/upload-media.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,EAChC,IAAI,EACJ,IAAc,EACd,GAAG,EACH,IAAI,EACJ,GAAG,GACJ,EAAE,iBAAiB,GAAG,OAAO,CAAC;IAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAQnE"}
@@ -0,0 +1,34 @@
1
+ import { puckFetch } from "../../api/client.js";
2
+ /**
3
+ * Upload a media item to the CMS. Images are passed inline as a data: URL
4
+ * (base64), remote_video as a YouTube/Vimeo page URL; the server never fetches
5
+ * external URLs. Returns the created media entity, shaped like a listMedia()
6
+ * item so it can be passed verbatim into a media field.
7
+ */
8
+ export async function uploadMedia({
9
+ lang,
10
+ type = 'image',
11
+ url,
12
+ name,
13
+ alt
14
+ }) {
15
+ const body = await puckFetch(`/upload`, {
16
+ method: 'POST',
17
+ headers: {
18
+ 'Content-Type': 'application/json'
19
+ },
20
+ credentials: 'include',
21
+ body: JSON.stringify({
22
+ type,
23
+ url,
24
+ name,
25
+ alt,
26
+ lang
27
+ })
28
+ });
29
+ return {
30
+ id: body.id ?? null,
31
+ data: body.data ?? null
32
+ };
33
+ }
34
+ //# sourceMappingURL=upload-media.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-media.js","names":["puckFetch","uploadMedia","lang","type","url","name","alt","body","method","headers","credentials","JSON","stringify","id","data"],"sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/upload-media.ts"],"sourcesContent":["import { puckFetch } from '../../api/client.ts';\nimport { MediaType } from './constants.ts';\n\ntype UploadMediaParams = {\n lang: string | undefined;\n type?: MediaType;\n url: string;\n name?: string;\n alt?: string;\n};\n\n/**\n * Upload a media item to the CMS. Images are passed inline as a data: URL\n * (base64), remote_video as a YouTube/Vimeo page URL; the server never fetches\n * external URLs. Returns the created media entity, shaped like a listMedia()\n * item so it can be passed verbatim into a media field.\n */\nexport async function uploadMedia({\n lang,\n type = 'image',\n url,\n name,\n alt,\n}: UploadMediaParams): Promise<{ id: string | null; data: unknown }> {\n const body = await puckFetch<{ id?: string; data?: unknown }>(`/upload`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n credentials: 'include',\n body: JSON.stringify({ type, url, name, alt, lang }),\n });\n return { id: body.id ?? null, data: body.data ?? null };\n}\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,qBAAqB;AAW/C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,WAAWA,CAAC;EAChCC,IAAI;EACJC,IAAI,GAAG,OAAO;EACdC,GAAG;EACHC,IAAI;EACJC;AACiB,CAAC,EAAiD;EACnE,MAAMC,IAAI,GAAG,MAAMP,SAAS,CAAkC,SAAS,EAAE;IACvEQ,MAAM,EAAE,MAAM;IACdC,OAAO,EAAE;MAAE,cAAc,EAAE;IAAmB,CAAC;IAC/CC,WAAW,EAAE,SAAS;IACtBH,IAAI,EAAEI,IAAI,CAACC,SAAS,CAAC;MAAET,IAAI;MAAEC,GAAG;MAAEC,IAAI;MAAEC,GAAG;MAAEJ;IAAK,CAAC;EACrD,CAAC,CAAC;EACF,OAAO;IAAEW,EAAE,EAAEN,IAAI,CAACM,EAAE,IAAI,IAAI;IAAEC,IAAI,EAAEP,IAAI,CAACO,IAAI,IAAI;EAAK,CAAC;AACzD","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ declare global {
2
+ interface Window {
3
+ puckAgent?: Record<string, unknown>;
4
+ }
5
+ }
6
+ type AgentHandleParams = {
7
+ isLoggedIn: boolean;
8
+ open: () => void;
9
+ close: () => void;
10
+ isEditMode: boolean;
11
+ type?: string;
12
+ fieldName: string;
13
+ lang: string;
14
+ };
15
+ export declare function useAgentHandle(params: AgentHandleParams): void;
16
+ export {};
17
+ //# sourceMappingURL=use-agent-handle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-agent-handle.d.ts","sourceRoot":"","sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/use-agent-handle.ts"],"names":[],"mappings":"AAOA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACrC;CACF;AAED,KAAK,iBAAiB,GAAG;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAgB,cAAc,CAAC,MAAM,EAAE,iBAAiB,QAkCvD"}
@@ -0,0 +1,70 @@
1
+ 'use client';
2
+
3
+ import { c as _c } from "react/compiler-runtime";
4
+ import { useEffect, useRef } from 'react';
5
+ import { createPage } from './create-page';
6
+ import { buildHelp } from './help';
7
+ export function useAgentHandle(params) {
8
+ const $ = _c(5);
9
+ const {
10
+ isLoggedIn
11
+ } = params;
12
+ const live = useRef(params);
13
+ let t0;
14
+ if ($[0] !== params) {
15
+ t0 = () => {
16
+ live.current = params;
17
+ };
18
+ $[0] = params;
19
+ $[1] = t0;
20
+ } else {
21
+ t0 = $[1];
22
+ }
23
+ useEffect(t0);
24
+ let t1;
25
+ let t2;
26
+ if ($[2] !== isLoggedIn) {
27
+ t1 = () => {
28
+ if (typeof window === "undefined" || !isLoggedIn) {
29
+ return;
30
+ }
31
+ const handle = window.puckAgent = window.puckAgent || {};
32
+ const methods = {
33
+ help: _temp,
34
+ open: () => live.current.open(),
35
+ close: () => live.current.close(),
36
+ isOpen: () => live.current.isEditMode,
37
+ isReady: () => typeof handle.getPage === "function",
38
+ createPage: (title, alias) => createPage({
39
+ title,
40
+ alias,
41
+ type: live.current.type,
42
+ fieldName: live.current.fieldName,
43
+ lang: live.current.lang
44
+ })
45
+ };
46
+ Object.assign(handle, methods);
47
+ return () => {
48
+ const h = window.puckAgent;
49
+ if (!h) {
50
+ return;
51
+ }
52
+ for (const key of Object.keys(methods)) {
53
+ delete h[key];
54
+ }
55
+ };
56
+ };
57
+ t2 = [isLoggedIn];
58
+ $[2] = isLoggedIn;
59
+ $[3] = t1;
60
+ $[4] = t2;
61
+ } else {
62
+ t1 = $[3];
63
+ t2 = $[4];
64
+ }
65
+ useEffect(t1, t2);
66
+ }
67
+ function _temp(name) {
68
+ return buildHelp(window.puckAgent, name);
69
+ }
70
+ //# sourceMappingURL=use-agent-handle.js.map