@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,46 @@
1
+ 'use client';
2
+
3
+ import { BotIcon } from 'lucide-react';
4
+ import { AgentBridge } from "./agent-bridge.js";
5
+ import { AgentInfoPanel } from "./agent-info-panel.js";
6
+
7
+ /**
8
+ * Puck plugin that hosts the local-agent bridge. Always registered; the
9
+ * wrapper-level handle (open/close/help via useAgentHandle) attaches for
10
+ * logged-in editors, so `window.puckAgent` exists only during an editor session.
11
+ *
12
+ * The bridge mounts via the `puck` override (wraps the whole editor UI), so the
13
+ * content methods are active whenever the plugin is installed — independent of
14
+ * whether the Agent panel/tab is open. The `render` panel only shows the
15
+ * copy-paste agent prompt. The lifecycle methods (open/close/isOpen/isReady/
16
+ * createPage) live in useAgentHandle because open() must work before the editor
17
+ * (and thus this plugin) mounts.
18
+ */
19
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
20
+ export function createAgentPlugin({
21
+ config,
22
+ lang,
23
+ onSave,
24
+ label
25
+ }) {
26
+ return {
27
+ name: 'agent',
28
+ label: label ?? 'Agent',
29
+ icon: /*#__PURE__*/_jsx(BotIcon, {
30
+ className: "nh:size-6"
31
+ }),
32
+ render: () => /*#__PURE__*/_jsx(AgentInfoPanel, {}),
33
+ overrides: {
34
+ puck: ({
35
+ children
36
+ }) => /*#__PURE__*/_jsxs(_Fragment, {
37
+ children: [children, /*#__PURE__*/_jsx(AgentBridge, {
38
+ config: config,
39
+ lang: lang,
40
+ onSave: onSave
41
+ })]
42
+ })
43
+ }
44
+ };
45
+ }
46
+ //# sourceMappingURL=agent-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-plugin.js","names":["BotIcon","AgentBridge","AgentInfoPanel","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","createAgentPlugin","config","lang","onSave","label","name","icon","className","render","overrides","puck","children"],"sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/agent-plugin.tsx"],"sourcesContent":["'use client';\n\nimport { Config, Data, Plugin } from '@puckeditor/core';\nimport { BotIcon } from 'lucide-react';\n\nimport { AgentBridge } from './agent-bridge.tsx';\nimport { AgentInfoPanel } from './agent-info-panel.tsx';\n\n/**\n * Puck plugin that hosts the local-agent bridge. Always registered; the\n * wrapper-level handle (open/close/help via useAgentHandle) attaches for\n * logged-in editors, so `window.puckAgent` exists only during an editor session.\n *\n * The bridge mounts via the `puck` override (wraps the whole editor UI), so the\n * content methods are active whenever the plugin is installed — independent of\n * whether the Agent panel/tab is open. The `render` panel only shows the\n * copy-paste agent prompt. The lifecycle methods (open/close/isOpen/isReady/\n * createPage) live in useAgentHandle because open() must work before the editor\n * (and thus this plugin) mounts.\n */\nexport function createAgentPlugin({\n config,\n lang,\n onSave,\n label,\n}: {\n config: Config;\n lang?: string;\n onSave?: (data: Partial<Data>) => Promise<void> | void;\n label?: string;\n}): Plugin {\n return {\n name: 'agent',\n label: label ?? 'Agent',\n icon: <BotIcon className=\"nh:size-6\" />,\n render: () => <AgentInfoPanel />,\n overrides: {\n puck: ({ children }) => (\n <>\n {children}\n <AgentBridge config={config} lang={lang} onSave={onSave} />\n </>\n ),\n },\n };\n}\n"],"mappings":"AAAA,YAAY;;AAGZ,SAASA,OAAO,QAAQ,cAAc;AAEtC,SAASC,WAAW,QAAQ,mBAAoB;AAChD,SAASC,cAAc,QAAQ,uBAAwB;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAXA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAYA,OAAO,SAASC,iBAAiBA,CAAC;EAChCC,MAAM;EACNC,IAAI;EACJC,MAAM;EACNC;AAMF,CAAC,EAAU;EACT,OAAO;IACLC,IAAI,EAAE,OAAO;IACbD,KAAK,EAAEA,KAAK,IAAI,OAAO;IACvBE,IAAI,eAAEX,IAAA,CAACJ,OAAO;MAACgB,SAAS,EAAC;IAAW,CAAE,CAAC;IACvCC,MAAM,EAAEA,CAAA,kBAAMb,IAAA,CAACF,cAAc,IAAE,CAAC;IAChCgB,SAAS,EAAE;MACTC,IAAI,EAAEA,CAAC;QAAEC;MAAS,CAAC,kBACjBZ,KAAA,CAAAF,SAAA;QAAAc,QAAA,GACGA,QAAQ,eACThB,IAAA,CAACH,WAAW;UAACS,MAAM,EAAEA,MAAO;UAACC,IAAI,EAAEA,IAAK;UAACC,MAAM,EAAEA;QAAO,CAAE,CAAC;MAAA,CAC3D;IAEN;EACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,46 @@
1
+ import type { ComponentData, Config, Data, PuckAction } from '@puckeditor/core';
2
+ type Dispatch = (action: PuckAction) => void;
3
+ /**
4
+ * Internal patch shape the engine translates into live Puck dispatches. The
5
+ * public handle exposes named methods (addComponent/updateComponent/...) that
6
+ * build these; `addMany` is internal only (template insertion).
7
+ */
8
+ export type PatchResult = {
9
+ ok: true;
10
+ id?: string;
11
+ ids?: string[];
12
+ } | {
13
+ ok: false;
14
+ error: string;
15
+ };
16
+ export type EnginePatch = {
17
+ action: 'add';
18
+ type: string;
19
+ props?: Record<string, unknown>;
20
+ destinationId?: string;
21
+ destinationSlot?: string;
22
+ destinationIndex?: number;
23
+ } | {
24
+ action: 'addMany';
25
+ components: ComponentData[];
26
+ destinationZone?: string;
27
+ destinationIndex?: number;
28
+ } | {
29
+ action: 'modify';
30
+ id: string;
31
+ newProps: Record<string, unknown>;
32
+ } | {
33
+ action: 'remove';
34
+ id: string;
35
+ } | {
36
+ action: 'setRoot';
37
+ fields: Record<string, unknown>;
38
+ };
39
+ /**
40
+ * Translate a single patch into live Puck store dispatches (the only path that
41
+ * re-renders the editor). Returns a structured result so a driving agent can
42
+ * tell success from failure without re-reading the page.
43
+ */
44
+ export declare function applyPatchToPuck(dispatch: Dispatch, data: Data | undefined, config: Config, patch: EnginePatch): PatchResult;
45
+ export {};
46
+ //# sourceMappingURL=apply-patch-to-puck.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply-patch-to-puck.d.ts","sourceRoot":"","sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAahF,KAAK,QAAQ,GAAG,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;AAsB7C;;;;GAIG;AACH,MAAM,MAAM,WAAW,GACrB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3E,MAAM,MAAM,WAAW,GACnB;IACE,MAAM,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GACD;IACE,MAAM,EAAE,SAAS,CAAC;IAClB,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GACD;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GACnE;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC;AAU3D;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,GAAG,SAAS,EACtB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,WAAW,GACjB,WAAW,CA8Gb"}
@@ -0,0 +1,176 @@
1
+ import { appendComponents, generateTemplateIds } from '../../utils';
2
+ import { isSectionType } from "../outline-plugin/outline-tree.js";
3
+ import { findComponentLocation, getZoneLength, ROOT_ZONE } from "./find-component-location.js";
4
+ const rootRejects = type => `only section-type components are allowed at the page root; "${type}" is not one`;
5
+ /**
6
+ * Whether a slot field on `parentType` permits `childType`, per the config's
7
+ * allow/disallow. Enforced deterministically so callers can't build an invalid
8
+ * tree — no need to document "respect slot rules". Unknown parent/slot → allowed
9
+ * (let Puck decide).
10
+ */
11
+ function slotAllows(config, parentType, slot, childType) {
12
+ const field = config.components?.[parentType]?.fields?.[slot];
13
+ if (!field || field.type !== 'slot') return true;
14
+ if (Array.isArray(field.allow)) return field.allow.includes(childType);
15
+ if (Array.isArray(field.disallow)) return !field.disallow.includes(childType);
16
+ return true;
17
+ }
18
+
19
+ /**
20
+ * Internal patch shape the engine translates into live Puck dispatches. The
21
+ * public handle exposes named methods (addComponent/updateComponent/...) that
22
+ * build these; `addMany` is internal only (template insertion).
23
+ */
24
+
25
+ const resolveZone = (destinationId, destinationSlot) => destinationId && destinationSlot ? `${destinationId}:${destinationSlot}` : ROOT_ZONE;
26
+
27
+ /**
28
+ * Translate a single patch into live Puck store dispatches (the only path that
29
+ * re-renders the editor). Returns a structured result so a driving agent can
30
+ * tell success from failure without re-reading the page.
31
+ */
32
+ export function applyPatchToPuck(dispatch, data, config, patch) {
33
+ if (!data) return {
34
+ ok: false,
35
+ error: 'editor not ready: no page data'
36
+ };
37
+ switch (patch.action) {
38
+ case 'add':
39
+ {
40
+ if (!config.components[patch.type]) {
41
+ return {
42
+ ok: false,
43
+ error: `unknown component type "${patch.type}"`
44
+ };
45
+ }
46
+ if (!patch.destinationId !== !patch.destinationSlot) {
47
+ return {
48
+ ok: false,
49
+ error: 'destinationId and destinationSlot are required together'
50
+ };
51
+ }
52
+ if (patch.destinationId && patch.destinationSlot) {
53
+ const parent = findComponentLocation(data, config, patch.destinationId)?.component;
54
+ if (!parent) {
55
+ return {
56
+ ok: false,
57
+ error: `destination "${patch.destinationId}" not found`
58
+ };
59
+ }
60
+ if (!slotAllows(config, parent.type, patch.destinationSlot, patch.type)) {
61
+ return {
62
+ ok: false,
63
+ error: `"${patch.type}" is not allowed in ${parent.type}.${patch.destinationSlot}`
64
+ };
65
+ }
66
+ }
67
+ const zone = resolveZone(patch.destinationId, patch.destinationSlot);
68
+ if (zone === ROOT_ZONE && !isSectionType(config, patch.type)) {
69
+ return {
70
+ ok: false,
71
+ error: rootRejects(patch.type)
72
+ };
73
+ }
74
+ // generateTemplateIds regenerates ids for the component and any nested
75
+ // children — the caller can never set or collide an id.
76
+ const [component] = generateTemplateIds([{
77
+ type: patch.type,
78
+ props: {
79
+ ...config.components[patch.type]?.defaultProps,
80
+ ...patch.props,
81
+ id: ''
82
+ }
83
+ }], config);
84
+ const index = patch.destinationIndex ?? getZoneLength(data, config, zone);
85
+ appendComponents(dispatch, zone, index, [component]);
86
+ return {
87
+ ok: true,
88
+ id: component.props.id
89
+ };
90
+ }
91
+ case 'addMany':
92
+ {
93
+ const zone = patch.destinationZone || ROOT_ZONE;
94
+ if (zone === ROOT_ZONE) {
95
+ const offending = patch.components.find(c => !isSectionType(config, c.type));
96
+ if (offending) {
97
+ return {
98
+ ok: false,
99
+ error: rootRejects(offending.type)
100
+ };
101
+ }
102
+ }
103
+ const index = patch.destinationIndex ?? getZoneLength(data, config, zone);
104
+ appendComponents(dispatch, zone, index, patch.components);
105
+ return {
106
+ ok: true,
107
+ ids: patch.components.map(c => c.props.id)
108
+ };
109
+ }
110
+ case 'modify':
111
+ {
112
+ const loc = findComponentLocation(data, config, patch.id);
113
+ if (!loc) {
114
+ return {
115
+ ok: false,
116
+ error: `id "${patch.id}" not found`
117
+ };
118
+ }
119
+ dispatch({
120
+ type: 'replace',
121
+ destinationZone: loc.zone,
122
+ destinationIndex: loc.index,
123
+ data: {
124
+ ...loc.component,
125
+ props: {
126
+ ...loc.component.props,
127
+ ...patch.newProps,
128
+ id: patch.id
129
+ }
130
+ }
131
+ });
132
+ return {
133
+ ok: true,
134
+ id: patch.id
135
+ };
136
+ }
137
+ case 'remove':
138
+ {
139
+ const loc = findComponentLocation(data, config, patch.id);
140
+ if (!loc) {
141
+ return {
142
+ ok: false,
143
+ error: `id "${patch.id}" not found`
144
+ };
145
+ }
146
+ dispatch({
147
+ type: 'remove',
148
+ zone: loc.zone,
149
+ index: loc.index
150
+ });
151
+ return {
152
+ ok: true,
153
+ id: patch.id
154
+ };
155
+ }
156
+ case 'setRoot':
157
+ {
158
+ dispatch({
159
+ type: 'replaceRoot',
160
+ root: {
161
+ ...(data.root || {
162
+ props: {}
163
+ }),
164
+ props: {
165
+ ...(data.root?.props || {}),
166
+ ...patch.fields
167
+ }
168
+ }
169
+ });
170
+ return {
171
+ ok: true
172
+ };
173
+ }
174
+ }
175
+ }
176
+ //# sourceMappingURL=apply-patch-to-puck.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply-patch-to-puck.js","names":["appendComponents","generateTemplateIds","isSectionType","findComponentLocation","getZoneLength","ROOT_ZONE","rootRejects","type","slotAllows","config","parentType","slot","childType","field","components","fields","Array","isArray","allow","includes","disallow","resolveZone","destinationId","destinationSlot","applyPatchToPuck","dispatch","data","patch","ok","error","action","parent","component","zone","props","defaultProps","id","index","destinationIndex","destinationZone","offending","find","c","ids","map","loc","newProps","root"],"sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.ts"],"sourcesContent":["import type { ComponentData, Config, Data, PuckAction } from '@puckeditor/core';\n\nimport { appendComponents, generateTemplateIds } from '../../utils';\nimport { isSectionType } from '../outline-plugin/outline-tree.ts';\nimport {\n findComponentLocation,\n getZoneLength,\n ROOT_ZONE,\n} from './find-component-location.ts';\n\nconst rootRejects = (type: string): string =>\n `only section-type components are allowed at the page root; \"${type}\" is not one`;\n\ntype Dispatch = (action: PuckAction) => void;\n\n/**\n * Whether a slot field on `parentType` permits `childType`, per the config's\n * allow/disallow. Enforced deterministically so callers can't build an invalid\n * tree — no need to document \"respect slot rules\". Unknown parent/slot → allowed\n * (let Puck decide).\n */\nfunction slotAllows(\n config: Config,\n parentType: string,\n slot: string,\n childType: string\n): boolean {\n const field = config.components?.[parentType]?.fields?.[slot] as\n { type?: string; allow?: string[]; disallow?: string[] } | undefined;\n if (!field || field.type !== 'slot') return true;\n if (Array.isArray(field.allow)) return field.allow.includes(childType);\n if (Array.isArray(field.disallow)) return !field.disallow.includes(childType);\n return true;\n}\n\n/**\n * Internal patch shape the engine translates into live Puck dispatches. The\n * public handle exposes named methods (addComponent/updateComponent/...) that\n * build these; `addMany` is internal only (template insertion).\n */\nexport type PatchResult =\n { ok: true; id?: string; ids?: string[] } | { ok: false; error: string };\n\nexport type EnginePatch =\n | {\n action: 'add';\n type: string;\n props?: Record<string, unknown>;\n destinationId?: string;\n destinationSlot?: string;\n destinationIndex?: number;\n }\n | {\n action: 'addMany';\n components: ComponentData[];\n destinationZone?: string;\n destinationIndex?: number;\n }\n | { action: 'modify'; id: string; newProps: Record<string, unknown> }\n | { action: 'remove'; id: string }\n | { action: 'setRoot'; fields: Record<string, unknown> };\n\nconst resolveZone = (\n destinationId?: string,\n destinationSlot?: string\n): string =>\n destinationId && destinationSlot\n ? `${destinationId}:${destinationSlot}`\n : ROOT_ZONE;\n\n/**\n * Translate a single patch into live Puck store dispatches (the only path that\n * re-renders the editor). Returns a structured result so a driving agent can\n * tell success from failure without re-reading the page.\n */\nexport function applyPatchToPuck(\n dispatch: Dispatch,\n data: Data | undefined,\n config: Config,\n patch: EnginePatch\n): PatchResult {\n if (!data) return { ok: false, error: 'editor not ready: no page data' };\n\n switch (patch.action) {\n case 'add': {\n if (!config.components[patch.type]) {\n return { ok: false, error: `unknown component type \"${patch.type}\"` };\n }\n if (!patch.destinationId !== !patch.destinationSlot) {\n return {\n ok: false,\n error: 'destinationId and destinationSlot are required together',\n };\n }\n if (patch.destinationId && patch.destinationSlot) {\n const parent = findComponentLocation(\n data,\n config,\n patch.destinationId\n )?.component;\n if (!parent) {\n return {\n ok: false,\n error: `destination \"${patch.destinationId}\" not found`,\n };\n }\n if (\n !slotAllows(config, parent.type, patch.destinationSlot, patch.type)\n ) {\n return {\n ok: false,\n error: `\"${patch.type}\" is not allowed in ${parent.type}.${patch.destinationSlot}`,\n };\n }\n }\n const zone = resolveZone(patch.destinationId, patch.destinationSlot);\n if (zone === ROOT_ZONE && !isSectionType(config, patch.type)) {\n return { ok: false, error: rootRejects(patch.type) };\n }\n // generateTemplateIds regenerates ids for the component and any nested\n // children — the caller can never set or collide an id.\n const [component] = generateTemplateIds(\n [\n {\n type: patch.type,\n props: {\n ...config.components[patch.type]?.defaultProps,\n ...patch.props,\n id: '',\n },\n } as ComponentData,\n ],\n config\n );\n const index = patch.destinationIndex ?? getZoneLength(data, config, zone);\n appendComponents(dispatch, zone, index, [component]);\n return { ok: true, id: component.props.id as string };\n }\n case 'addMany': {\n const zone = patch.destinationZone || ROOT_ZONE;\n if (zone === ROOT_ZONE) {\n const offending = patch.components.find(\n (c) => !isSectionType(config, c.type)\n );\n if (offending) {\n return { ok: false, error: rootRejects(offending.type) };\n }\n }\n const index = patch.destinationIndex ?? getZoneLength(data, config, zone);\n appendComponents(dispatch, zone, index, patch.components);\n return {\n ok: true,\n ids: patch.components.map((c) => c.props.id as string),\n };\n }\n case 'modify': {\n const loc = findComponentLocation(data, config, patch.id);\n if (!loc) {\n return { ok: false, error: `id \"${patch.id}\" not found` };\n }\n dispatch({\n type: 'replace',\n destinationZone: loc.zone,\n destinationIndex: loc.index,\n data: {\n ...loc.component,\n props: { ...loc.component.props, ...patch.newProps, id: patch.id },\n },\n });\n return { ok: true, id: patch.id };\n }\n case 'remove': {\n const loc = findComponentLocation(data, config, patch.id);\n if (!loc) {\n return { ok: false, error: `id \"${patch.id}\" not found` };\n }\n dispatch({ type: 'remove', zone: loc.zone, index: loc.index });\n return { ok: true, id: patch.id };\n }\n case 'setRoot': {\n dispatch({\n type: 'replaceRoot',\n root: {\n ...(data.root || { props: {} }),\n props: { ...(data.root?.props || {}), ...patch.fields },\n },\n });\n return { ok: true };\n }\n }\n}\n"],"mappings":"AAEA,SAASA,gBAAgB,EAAEC,mBAAmB,QAAQ,aAAa;AACnE,SAASC,aAAa,QAAQ,mCAAmC;AACjE,SACEC,qBAAqB,EACrBC,aAAa,EACbC,SAAS,QACJ,8BAA8B;AAErC,MAAMC,WAAW,GAAIC,IAAY,IAC/B,+DAA+DA,IAAI,cAAc;AAInF;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,UAAUA,CAC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GAAGP,KAAK,CAACZ;YAAO;UACxD;QACF,CAAC,CAAC;QACF,OAAO;UAAEa,EAAE,EAAE;QAAK,CAAC;MACrB;EACF;AACF","ignoreList":[]}
@@ -0,0 +1,20 @@
1
+ import type { Config } from '@puckeditor/core';
2
+ /**
3
+ * Palette overview: one entry per available component (name, label, category,
4
+ * field names). Mechanical projection from the live config.
5
+ */
6
+ export declare function listComponents(config: Config): {
7
+ name: string;
8
+ label: string | undefined;
9
+ category: string;
10
+ fields: string[];
11
+ }[];
12
+ /**
13
+ * Full field spec for one component: fields (with type + metadata), defaultProps
14
+ * and label. JSON round-trip drops function-valued props (field render /
15
+ * fetchList) that can't cross the tool boundary anyway; the agent reads
16
+ * `field.type` and `metadata.ai` to know external/custom fields need
17
+ * out-of-band values (listMedia / node fetch).
18
+ */
19
+ export declare function describeComponent(config: Config, type: string): any;
20
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAW/C;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM;;;;;IAO5C;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,OAS7D"}
@@ -0,0 +1,39 @@
1
+ const toPlain = value => JSON.parse(JSON.stringify(value ?? null));
2
+ function categoryOf(name, config) {
3
+ for (const [category, group] of Object.entries(config.categories || {})) {
4
+ if (group.components?.includes(name)) return category;
5
+ }
6
+ return 'other';
7
+ }
8
+
9
+ /**
10
+ * Palette overview: one entry per available component (name, label, category,
11
+ * field names). Mechanical projection from the live config.
12
+ */
13
+ export function listComponents(config) {
14
+ return Object.entries(config.components).map(([name, component]) => ({
15
+ name,
16
+ label: component.label,
17
+ category: categoryOf(name, config),
18
+ fields: Object.keys(component.fields ?? {})
19
+ }));
20
+ }
21
+
22
+ /**
23
+ * Full field spec for one component: fields (with type + metadata), defaultProps
24
+ * and label. JSON round-trip drops function-valued props (field render /
25
+ * fetchList) that can't cross the tool boundary anyway; the agent reads
26
+ * `field.type` and `metadata.ai` to know external/custom fields need
27
+ * out-of-band values (listMedia / node fetch).
28
+ */
29
+ export function describeComponent(config, type) {
30
+ const component = config.components[type];
31
+ if (!component) return null;
32
+ return toPlain({
33
+ fields: component.fields,
34
+ defaultProps: component.defaultProps,
35
+ label: component.label,
36
+ metadata: component.metadata
37
+ });
38
+ }
39
+ //# sourceMappingURL=catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.js","names":["toPlain","value","JSON","parse","stringify","categoryOf","name","config","category","group","Object","entries","categories","components","includes","listComponents","map","component","label","fields","keys","describeComponent","type","defaultProps","metadata"],"sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/catalog.ts"],"sourcesContent":["import type { Config } from '@puckeditor/core';\n\nconst toPlain = (value: unknown) => JSON.parse(JSON.stringify(value ?? null));\n\nfunction categoryOf(name: string, config: Config): string {\n for (const [category, group] of Object.entries(config.categories || {})) {\n if (group.components?.includes(name)) return category;\n }\n return 'other';\n}\n\n/**\n * Palette overview: one entry per available component (name, label, category,\n * field names). Mechanical projection from the live config.\n */\nexport function listComponents(config: Config) {\n return Object.entries(config.components).map(([name, component]) => ({\n name,\n label: component.label,\n category: categoryOf(name, config),\n fields: Object.keys(component.fields ?? {}),\n }));\n}\n\n/**\n * Full field spec for one component: fields (with type + metadata), defaultProps\n * and label. JSON round-trip drops function-valued props (field render /\n * fetchList) that can't cross the tool boundary anyway; the agent reads\n * `field.type` and `metadata.ai` to know external/custom fields need\n * out-of-band values (listMedia / node fetch).\n */\nexport function describeComponent(config: Config, type: string) {\n const component = config.components[type];\n if (!component) return null;\n return toPlain({\n fields: component.fields,\n defaultProps: component.defaultProps,\n label: component.label,\n metadata: component.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AAC;AACJ","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ export declare const MEDIA_TYPES: readonly ["image", "remote_video"];
2
+ export type MediaType = (typeof MEDIA_TYPES)[number];
3
+ export declare const PAGE_META_FIELDS: readonly ["title", "metadataTitle", "metadataDescription", "metadataImage", "publishedState", "urlAlias"];
4
+ export type PageMetaField = (typeof PAGE_META_FIELDS)[number];
5
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,oCAAqC,CAAC;AAC9D,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,eAAO,MAAM,gBAAgB,2GAOnB,CAAC;AACX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export const MEDIA_TYPES = ['image', 'remote_video'];
2
+ export const PAGE_META_FIELDS = ['title', 'metadataTitle', 'metadataDescription', 'metadataImage', 'publishedState', 'urlAlias'];
3
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","names":["MEDIA_TYPES","PAGE_META_FIELDS"],"sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/constants.ts"],"sourcesContent":["export const MEDIA_TYPES = ['image', 'remote_video'] as const;\nexport type MediaType = (typeof MEDIA_TYPES)[number];\n\nexport const PAGE_META_FIELDS = [\n 'title',\n 'metadataTitle',\n 'metadataDescription',\n 'metadataImage',\n 'publishedState',\n 'urlAlias',\n] as const;\nexport type PageMetaField = (typeof PAGE_META_FIELDS)[number];\n"],"mappings":"AAAA,OAAO,MAAMA,WAAW,GAAG,CAAC,OAAO,EAAE,cAAc,CAAU;AAG7D,OAAO,MAAMC,gBAAgB,GAAG,CAC9B,OAAO,EACP,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,UAAU,CACF","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ type CreatePageParams = {
2
+ title?: string;
3
+ alias?: string;
4
+ /** Bundle to create; the server defaults to the first creatable bundle. */
5
+ type?: string;
6
+ fieldName?: string;
7
+ lang: string;
8
+ };
9
+ export declare function createPage({ title, alias, type, fieldName, lang, }: CreatePageParams): Promise<{
10
+ id: string | null;
11
+ nid: number | null;
12
+ alias: string | null;
13
+ fieldName: string | null;
14
+ editUrl: string | null;
15
+ }>;
16
+ export {};
17
+ //# sourceMappingURL=create-page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-page.d.ts","sourceRoot":"","sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/create-page.ts"],"names":[],"mappings":"AAEA,KAAK,gBAAgB,GAAG;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAsB,UAAU,CAAC,EAC/B,KAAK,EACL,KAAK,EACL,IAAI,EACJ,SAAS,EACT,IAAI,GACL,EAAE,gBAAgB,GAAG,OAAO,CAAC;IAC5B,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC,CA4BD"}
@@ -0,0 +1,35 @@
1
+ import { puckFetch } from "../../api/client.js";
2
+ export async function createPage({
3
+ title,
4
+ alias,
5
+ type,
6
+ fieldName,
7
+ lang
8
+ }) {
9
+ const body = await puckFetch(`/create`, {
10
+ method: 'POST',
11
+ headers: {
12
+ 'Content-Type': 'application/json'
13
+ },
14
+ credentials: 'include',
15
+ body: JSON.stringify({
16
+ title,
17
+ alias,
18
+ type,
19
+ fieldName,
20
+ lang
21
+ })
22
+ });
23
+ const savedAlias = body.alias ?? null;
24
+ const nid = body.nid ?? null;
25
+ const savedFieldName = body.fieldName ?? null;
26
+ const target = savedAlias ?? (nid !== null ? `/node/${nid}` : null);
27
+ return {
28
+ id: body.id ?? null,
29
+ nid,
30
+ alias: savedAlias,
31
+ fieldName: savedFieldName,
32
+ editUrl: target && savedFieldName ? `/${lang}${target}?puckeditor=${savedFieldName}` : null
33
+ };
34
+ }
35
+ //# sourceMappingURL=create-page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-page.js","names":["puckFetch","createPage","title","alias","type","fieldName","lang","body","method","headers","credentials","JSON","stringify","savedAlias","nid","savedFieldName","target","id","editUrl"],"sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/create-page.ts"],"sourcesContent":["import { puckFetch } from '../../api/client.ts';\n\ntype CreatePageParams = {\n title?: string;\n alias?: string;\n /** Bundle to create; the server defaults to the first creatable bundle. */\n type?: string;\n fieldName?: string;\n lang: string;\n};\n\nexport async function createPage({\n title,\n alias,\n type,\n fieldName,\n lang,\n}: CreatePageParams): Promise<{\n id: string | null;\n nid: number | null;\n alias: string | null;\n fieldName: string | null;\n editUrl: string | null;\n}> {\n const body = await puckFetch<{\n id?: string;\n nid?: number;\n alias?: string;\n fieldName?: string;\n }>(`/create`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n credentials: 'include',\n body: JSON.stringify({ title, alias, type, fieldName, lang }),\n });\n\n const savedAlias = body.alias ?? null;\n const nid = body.nid ?? null;\n const savedFieldName = body.fieldName ?? null;\n const target = savedAlias ?? (nid !== null ? `/node/${nid}` : null);\n\n return {\n id: body.id ?? null,\n nid,\n alias: savedAlias,\n fieldName: savedFieldName,\n editUrl:\n target && savedFieldName\n ? `/${lang}${target}?puckeditor=${savedFieldName}`\n : null,\n };\n}\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,qBAAqB;AAW/C,OAAO,eAAeC,UAAUA,CAAC;EAC/BC,KAAK;EACLC,KAAK;EACLC,IAAI;EACJC,SAAS;EACTC;AACgB,CAAC,EAMhB;EACD,MAAMC,IAAI,GAAG,MAAMP,SAAS,CAKzB,SAAS,EAAE;IACZQ,MAAM,EAAE,MAAM;IACdC,OAAO,EAAE;MAAE,cAAc,EAAE;IAAmB,CAAC;IAC/CC,WAAW,EAAE,SAAS;IACtBH,IAAI,EAAEI,IAAI,CAACC,SAAS,CAAC;MAAEV,KAAK;MAAEC,KAAK;MAAEC,IAAI;MAAEC,SAAS;MAAEC;IAAK,CAAC;EAC9D,CAAC,CAAC;EAEF,MAAMO,UAAU,GAAGN,IAAI,CAACJ,KAAK,IAAI,IAAI;EACrC,MAAMW,GAAG,GAAGP,IAAI,CAACO,GAAG,IAAI,IAAI;EAC5B,MAAMC,cAAc,GAAGR,IAAI,CAACF,SAAS,IAAI,IAAI;EAC7C,MAAMW,MAAM,GAAGH,UAAU,KAAKC,GAAG,KAAK,IAAI,GAAG,SAASA,GAAG,EAAE,GAAG,IAAI,CAAC;EAEnE,OAAO;IACLG,EAAE,EAAEV,IAAI,CAACU,EAAE,IAAI,IAAI;IACnBH,GAAG;IACHX,KAAK,EAAEU,UAAU;IACjBR,SAAS,EAAEU,cAAc;IACzBG,OAAO,EACLF,MAAM,IAAID,cAAc,GACpB,IAAIT,IAAI,GAAGU,MAAM,eAAeD,cAAc,EAAE,GAChD;EACR,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ import type { ComponentData, Config, Data } from '@puckeditor/core';
2
+ export declare const ROOT_ZONE = "root:default-zone";
3
+ export type ComponentLocation = {
4
+ component: ComponentData;
5
+ zone: string;
6
+ index: number;
7
+ };
8
+ /**
9
+ * Walk the Puck data tree (root content + slot fields) to find a component
10
+ * by id, returning its zone and index for use with fine-grained Puck actions
11
+ * (replace, remove). Returns null if the id is not in the tree.
12
+ */
13
+ export declare function findComponentLocation(data: Data, config: Config, id: string): ComponentLocation | null;
14
+ /**
15
+ * Returns the length of a zone's content array (to compute an append index
16
+ * for incremental insert actions).
17
+ */
18
+ export declare function getZoneLength(data: Data, config: Config, zone: string): number;
19
+ //# sourceMappingURL=find-component-location.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-component-location.d.ts","sourceRoot":"","sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/find-component-location.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAEpE,eAAO,MAAM,SAAS,sBAAsB,CAAC;AAE7C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,aAAa,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,MAAM,GACT,iBAAiB,GAAG,IAAI,CAU1B;AAmCD;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,MAAM,CA8BR"}
@@ -0,0 +1,79 @@
1
+ export const ROOT_ZONE = 'root:default-zone';
2
+ /**
3
+ * Walk the Puck data tree (root content + slot fields) to find a component
4
+ * by id, returning its zone and index for use with fine-grained Puck actions
5
+ * (replace, remove). Returns null if the id is not in the tree.
6
+ */
7
+ export function findComponentLocation(data, config, id) {
8
+ for (let i = 0; i < data.content.length; i++) {
9
+ const component = data.content[i];
10
+ if (component.props?.id === id) {
11
+ return {
12
+ component,
13
+ zone: ROOT_ZONE,
14
+ index: i
15
+ };
16
+ }
17
+ const nested = findInComponent(component, id, config);
18
+ if (nested) return nested;
19
+ }
20
+ return null;
21
+ }
22
+ function findInComponent(component, id, config) {
23
+ const componentConfig = config.components?.[component.type];
24
+ if (!componentConfig) return null;
25
+ const fields = componentConfig.fields || {};
26
+ const parentId = component.props?.id;
27
+ if (!parentId) return null;
28
+ for (const [fieldName, fieldConfig] of Object.entries(fields)) {
29
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
+ if (fieldConfig.type !== 'slot') continue;
31
+ const slotValue = component.props?.[fieldName];
32
+ if (!Array.isArray(slotValue)) continue;
33
+ for (let i = 0; i < slotValue.length; i++) {
34
+ const child = slotValue[i];
35
+ if (child?.props?.id === id) {
36
+ return {
37
+ component: child,
38
+ zone: `${parentId}:${fieldName}`,
39
+ index: i
40
+ };
41
+ }
42
+ const deeper = findInComponent(child, id, config);
43
+ if (deeper) return deeper;
44
+ }
45
+ }
46
+ return null;
47
+ }
48
+
49
+ /**
50
+ * Returns the length of a zone's content array (to compute an append index
51
+ * for incremental insert actions).
52
+ */
53
+ export function getZoneLength(data, config, zone) {
54
+ if (zone === ROOT_ZONE) return data.content.length;
55
+ const [parentId, slotName] = zone.split(':');
56
+ if (!parentId || !slotName) return 0;
57
+ const walk = components => {
58
+ for (const c of components) {
59
+ if (c.props?.id === parentId) {
60
+ const slotValue = c.props?.[slotName];
61
+ return Array.isArray(slotValue) ? slotValue.length : 0;
62
+ }
63
+ const componentConfig = config.components?.[c.type];
64
+ if (!componentConfig) continue;
65
+ for (const [fName, fConfig] of Object.entries(componentConfig.fields || {})) {
66
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
67
+ if (fConfig.type !== 'slot') continue;
68
+ const sv = c.props?.[fName];
69
+ if (Array.isArray(sv)) {
70
+ const inner = walk(sv);
71
+ if (inner !== null) return inner;
72
+ }
73
+ }
74
+ }
75
+ return null;
76
+ };
77
+ return walk(data.content) ?? 0;
78
+ }
79
+ //# sourceMappingURL=find-component-location.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-component-location.js","names":["ROOT_ZONE","findComponentLocation","data","config","id","i","content","length","component","props","zone","index","nested","findInComponent","componentConfig","components","type","fields","parentId","fieldName","fieldConfig","Object","entries","slotValue","Array","isArray","child","deeper","getZoneLength","slotName","split","walk","c","fName","fConfig","sv","inner"],"sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/find-component-location.ts"],"sourcesContent":["import type { ComponentData, Config, Data } from '@puckeditor/core';\n\nexport const ROOT_ZONE = 'root:default-zone';\n\nexport type ComponentLocation = {\n component: ComponentData;\n zone: string;\n index: number;\n};\n\n/**\n * Walk the Puck data tree (root content + slot fields) to find a component\n * by id, returning its zone and index for use with fine-grained Puck actions\n * (replace, remove). Returns null if the id is not in the tree.\n */\nexport function findComponentLocation(\n data: Data,\n config: Config,\n id: string\n): ComponentLocation | null {\n for (let i = 0; i < data.content.length; i++) {\n const component = data.content[i];\n if (component.props?.id === id) {\n return { component, zone: ROOT_ZONE, index: i };\n }\n const nested = findInComponent(component, id, config);\n if (nested) return nested;\n }\n return null;\n}\n\nfunction findInComponent(\n component: ComponentData,\n id: string,\n config: Config\n): ComponentLocation | null {\n const componentConfig = config.components?.[component.type];\n if (!componentConfig) return null;\n const fields = componentConfig.fields || {};\n const parentId = component.props?.id;\n if (!parentId) return null;\n\n for (const [fieldName, fieldConfig] of Object.entries(fields)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((fieldConfig as any).type !== 'slot') continue;\n const slotValue = (component.props as Record<string, unknown>)?.[fieldName];\n if (!Array.isArray(slotValue)) continue;\n\n for (let i = 0; i < slotValue.length; i++) {\n const child = slotValue[i] as ComponentData;\n if (child?.props?.id === id) {\n return {\n component: child,\n zone: `${parentId}:${fieldName}`,\n index: i,\n };\n }\n const deeper = findInComponent(child, id, config);\n if (deeper) return deeper;\n }\n }\n return null;\n}\n\n/**\n * Returns the length of a zone's content array (to compute an append index\n * for incremental insert actions).\n */\nexport function getZoneLength(\n data: Data,\n config: Config,\n zone: string\n): number {\n if (zone === ROOT_ZONE) return data.content.length;\n\n const [parentId, slotName] = zone.split(':');\n if (!parentId || !slotName) return 0;\n\n const walk = (components: ComponentData[]): number | null => {\n for (const c of components) {\n if (c.props?.id === parentId) {\n const slotValue = (c.props as Record<string, unknown>)?.[slotName];\n return Array.isArray(slotValue) ? slotValue.length : 0;\n }\n const componentConfig = config.components?.[c.type];\n if (!componentConfig) continue;\n for (const [fName, fConfig] of Object.entries(\n componentConfig.fields || {}\n )) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((fConfig as any).type !== 'slot') continue;\n const sv = (c.props as Record<string, unknown>)?.[fName];\n if (Array.isArray(sv)) {\n const inner = walk(sv as ComponentData[]);\n if (inner !== null) return inner;\n }\n }\n }\n return null;\n };\n\n return walk(data.content) ?? 0;\n}\n"],"mappings":"AAEA,OAAO,MAAMA,SAAS,GAAG,mBAAmB;AAQ5C;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CACnCC,IAAU,EACVC,MAAc,EACdC,EAAU,EACgB;EAC1B,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,IAAI,CAACI,OAAO,CAACC,MAAM,EAAEF,CAAC,EAAE,EAAE;IAC5C,MAAMG,SAAS,GAAGN,IAAI,CAACI,OAAO,CAACD,CAAC,CAAC;IACjC,IAAIG,SAAS,CAACC,KAAK,EAAEL,EAAE,KAAKA,EAAE,EAAE;MAC9B,OAAO;QAAEI,SAAS;QAAEE,IAAI,EAAEV,SAAS;QAAEW,KAAK,EAAEN;MAAE,CAAC;IACjD;IACA,MAAMO,MAAM,GAAGC,eAAe,CAACL,SAAS,EAAEJ,EAAE,EAAED,MAAM,CAAC;IACrD,IAAIS,MAAM,EAAE,OAAOA,MAAM;EAC3B;EACA,OAAO,IAAI;AACb;AAEA,SAASC,eAAeA,CACtBL,SAAwB,EACxBJ,EAAU,EACVD,MAAc,EACY;EAC1B,MAAMW,eAAe,GAAGX,MAA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W,QAAQ,EAAEW,QAAQ,CAAC,GAAGnB,IAAI,CAACoB,KAAK,CAAC,GAAG,CAAC;EAC5C,IAAI,CAACZ,QAAQ,IAAI,CAACW,QAAQ,EAAE,OAAO,CAAC;EAEpC,MAAME,IAAI,GAAIhB,UAA2B,IAAoB;IAC3D,KAAK,MAAMiB,CAAC,IAAIjB,UAAU,EAAE;MAC1B,IAAIiB,CAAC,CAACvB,KAAK,EAAEL,EAAE,KAAKc,QAAQ,EAAE;QAC5B,MAAMK,SAAS,GAAIS,CAAC,CAACvB,KAAK,GAA+BoB,QAAQ,CAAC;QAClE,OAAOL,KAAK,CAACC,OAAO,CAACF,SAAS,CAAC,GAAGA,SAAS,CAAChB,MAAM,GAAG,CAAC;MACxD;MACA,MAAMO,eAAe,GAAGX,MAAM,CAACY,UAAU,GAAGiB,CAAC,CAAChB,IAAI,CAAC;MACnD,IAAI,CAACF,eAAe,EAAE;MACtB,KAAK,MAAM,CAACmB,KAAK,EAAEC,OAAO,CAAC,IAAIb,MAAM,CAACC,OAAO,CAC3CR,eAAe,CAACG,MAAM,IAAI,CAAC,CAC7B,CAAC,EAAE;QACD;QACA,IAAKiB,OAAO,CAASlB,IAAI,KAAK,MAAM,EAAE;QACtC,MAAMmB,EAAE,GAAIH,CAAC,CAACvB,KAAK,GAA+BwB,KAAK,CAAC;QACxD,IAAIT,KAAK,CAACC,OAAO,CAACU,EAAE,CAAC,EAAE;UACrB,MAAMC,KAAK,GAAGL,IAAI,CAACI,EAAqB,CAAC;UACzC,IAAIC,KAAK,KAAK,IAAI,EAAE,OAAOA,KAAK;QAClC;MACF;IACF;IACA,OAAO,IAAI;EACb,CAAC;EAED,OAAOL,IAAI,CAAC7B,IAAI,CAACI,OAAO,CAAC,IAAI,CAAC;AAChC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export declare function buildHelp(agent: Record<string, unknown> | undefined, name?: string): unknown;
2
+ //# sourceMappingURL=help.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../../../../src/puck-editor/internal/plugins/agent-plugin/help.ts"],"names":[],"mappings":"AAoRA,wBAAgB,SAAS,CACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC1C,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAoCT"}