@nodehive/nextjs 0.1.3 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (762) hide show
  1. package/README.md +1 -1
  2. package/dist/auth/index.d.ts +2 -3
  3. package/dist/auth/index.js.map +1 -1
  4. package/dist/auth/internal/config.d.ts +15 -5
  5. package/dist/auth/internal/config.js.map +1 -1
  6. package/dist/auth/internal/draft-mode.d.ts +2 -3
  7. package/dist/auth/internal/draft-mode.js +3 -20
  8. package/dist/auth/internal/draft-mode.js.map +1 -1
  9. package/dist/auth/internal/editor-locale.d.ts +0 -1
  10. package/dist/auth/internal/handoff.d.ts +0 -1
  11. package/dist/auth/internal/has-session.d.ts +0 -1
  12. package/dist/auth/internal/has-session.js +1 -1
  13. package/dist/auth/internal/has-session.js.map +1 -1
  14. package/dist/auth/internal/i18n.d.ts +10 -0
  15. package/dist/auth/internal/i18n.js +25 -0
  16. package/dist/auth/internal/i18n.js.map +1 -0
  17. package/dist/auth/internal/logout.d.ts +1 -2
  18. package/dist/auth/internal/logout.js +3 -3
  19. package/dist/auth/internal/logout.js.map +1 -1
  20. package/dist/auth/internal/next-cookie-storage.d.ts +5 -2
  21. package/dist/auth/internal/next-cookie-storage.js +8 -1
  22. package/dist/auth/internal/next-cookie-storage.js.map +1 -1
  23. package/dist/auth/internal/nodehive-client.d.ts +6 -4
  24. package/dist/auth/internal/nodehive-client.js +6 -4
  25. package/dist/auth/internal/nodehive-client.js.map +1 -1
  26. package/dist/auth/internal/oauth-config.d.ts +0 -1
  27. package/dist/auth/internal/proxy-helpers.d.ts +0 -1
  28. package/dist/auth/internal/proxy-helpers.js +4 -4
  29. package/dist/auth/internal/proxy-helpers.js.map +1 -1
  30. package/dist/auth/internal/refresh.d.ts +1 -2
  31. package/dist/auth/internal/refresh.js +4 -4
  32. package/dist/auth/internal/refresh.js.map +1 -1
  33. package/dist/auth/internal/require-auth.d.ts +0 -1
  34. package/dist/auth/internal/require-auth.js +1 -1
  35. package/dist/auth/internal/require-auth.js.map +1 -1
  36. package/dist/auth/internal/return-to.d.ts +0 -1
  37. package/dist/auth/internal/roles.d.ts +17 -0
  38. package/dist/auth/internal/roles.js +39 -0
  39. package/dist/auth/internal/roles.js.map +1 -0
  40. package/dist/auth/internal/routes/callback.d.ts +1 -2
  41. package/dist/auth/internal/routes/callback.js +6 -6
  42. package/dist/auth/internal/routes/callback.js.map +1 -1
  43. package/dist/auth/internal/routes/chips-exchange.d.ts +1 -2
  44. package/dist/auth/internal/routes/chips-exchange.js +5 -5
  45. package/dist/auth/internal/routes/chips-exchange.js.map +1 -1
  46. package/dist/auth/internal/routes/draft.d.ts +1 -2
  47. package/dist/auth/internal/routes/draft.js +3 -3
  48. package/dist/auth/internal/routes/draft.js.map +1 -1
  49. package/dist/auth/internal/routes/index.d.ts +4 -2
  50. package/dist/auth/internal/routes/index.js +7 -7
  51. package/dist/auth/internal/routes/index.js.map +1 -1
  52. package/dist/auth/internal/routes/login.d.ts +0 -1
  53. package/dist/auth/internal/routes/login.js +3 -3
  54. package/dist/auth/internal/routes/login.js.map +1 -1
  55. package/dist/auth/internal/routes/popup-done.d.ts +2 -2
  56. package/dist/auth/internal/routes/popup-done.js +9 -7
  57. package/dist/auth/internal/routes/popup-done.js.map +1 -1
  58. package/dist/auth/internal/routes/refresh.d.ts +2 -5
  59. package/dist/auth/internal/routes/refresh.js +8 -2
  60. package/dist/auth/internal/routes/refresh.js.map +1 -1
  61. package/dist/auth/internal/same-origin.d.ts +0 -1
  62. package/dist/auth/internal/session-gates.d.ts +27 -3
  63. package/dist/auth/internal/session-gates.js +35 -3
  64. package/dist/auth/internal/session-gates.js.map +1 -1
  65. package/dist/auth/internal/update-session.d.ts +1 -2
  66. package/dist/auth/internal/update-session.js +1 -1
  67. package/dist/auth/internal/update-session.js.map +1 -1
  68. package/dist/auth/internal/use-editor-login.d.ts +0 -1
  69. package/dist/auth/internal/use-editor-login.js +2 -3
  70. package/dist/auth/internal/use-editor-login.js.map +1 -1
  71. package/dist/auth/proxy.d.ts +7 -8
  72. package/dist/auth/proxy.js +6 -6
  73. package/dist/auth/proxy.js.map +1 -1
  74. package/dist/auth/react.d.ts +1 -2
  75. package/dist/auth/react.js +1 -1
  76. package/dist/auth/react.js.map +1 -1
  77. package/dist/auth/routes.d.ts +3 -3
  78. package/dist/auth/routes.js +1 -1
  79. package/dist/auth/routes.js.map +1 -1
  80. package/dist/auth/server.d.ts +14 -12
  81. package/dist/auth/server.js +14 -9
  82. package/dist/auth/server.js.map +1 -1
  83. package/dist/bridge-protocol/index.d.ts +50 -0
  84. package/dist/bridge-protocol/index.js +25 -0
  85. package/dist/bridge-protocol/index.js.map +1 -0
  86. package/dist/puck-editor/editor.d.ts +8 -0
  87. package/dist/puck-editor/editor.js +9 -0
  88. package/dist/puck-editor/editor.js.map +1 -0
  89. package/dist/puck-editor/fields.d.ts +6 -7
  90. package/dist/puck-editor/fields.js +3 -3
  91. package/dist/puck-editor/fields.js.map +1 -1
  92. package/dist/puck-editor/index.d.ts +17 -14
  93. package/dist/puck-editor/index.js +13 -11
  94. package/dist/puck-editor/index.js.map +1 -1
  95. package/dist/puck-editor/internal/api/client.d.ts +19 -4
  96. package/dist/puck-editor/internal/api/client.js +56 -19
  97. package/dist/puck-editor/internal/api/client.js.map +1 -1
  98. package/dist/puck-editor/internal/api/config.d.ts +36 -3
  99. package/dist/puck-editor/internal/api/config.js.map +1 -1
  100. package/dist/puck-editor/internal/api/create-puck-api.d.ts +1 -2
  101. package/dist/puck-editor/internal/api/create-puck-api.js +10 -13
  102. package/dist/puck-editor/internal/api/create-puck-api.js.map +1 -1
  103. package/dist/puck-editor/internal/api/handlers/create-page.d.ts +1 -2
  104. package/dist/puck-editor/internal/api/handlers/create-page.js +6 -4
  105. package/dist/puck-editor/internal/api/handlers/create-page.js.map +1 -1
  106. package/dist/puck-editor/internal/api/handlers/entities.d.ts +6 -5
  107. package/dist/puck-editor/internal/api/handlers/entities.js +60 -15
  108. package/dist/puck-editor/internal/api/handlers/entities.js.map +1 -1
  109. package/dist/puck-editor/internal/api/handlers/publish.d.ts +3 -6
  110. package/dist/puck-editor/internal/api/handlers/publish.js +57 -14
  111. package/dist/puck-editor/internal/api/handlers/publish.js.map +1 -1
  112. package/dist/puck-editor/internal/api/handlers/template.d.ts +5 -2
  113. package/dist/puck-editor/internal/api/handlers/template.js +28 -60
  114. package/dist/puck-editor/internal/api/handlers/template.js.map +1 -1
  115. package/dist/puck-editor/internal/api/handlers/upload.d.ts +10 -2
  116. package/dist/puck-editor/internal/api/handlers/upload.js +93 -28
  117. package/dist/puck-editor/internal/api/handlers/upload.js.map +1 -1
  118. package/dist/puck-editor/internal/api/localize-message.d.ts +15 -0
  119. package/dist/puck-editor/internal/api/localize-message.js +15 -0
  120. package/dist/puck-editor/internal/api/localize-message.js.map +1 -0
  121. package/dist/puck-editor/internal/api/media-params.d.ts +3 -3
  122. package/dist/puck-editor/internal/api/media-params.js +23 -19
  123. package/dist/puck-editor/internal/api/media-params.js.map +1 -1
  124. package/dist/puck-editor/internal/api/media-upload.d.ts +5 -3
  125. package/dist/puck-editor/internal/api/media-upload.js +33 -22
  126. package/dist/puck-editor/internal/api/media-upload.js.map +1 -1
  127. package/dist/puck-editor/internal/api/space.d.ts +0 -1
  128. package/dist/puck-editor/internal/api/type-segment.d.ts +2 -0
  129. package/dist/puck-editor/internal/api/type-segment.js +9 -0
  130. package/dist/puck-editor/internal/api/type-segment.js.map +1 -0
  131. package/dist/puck-editor/internal/content-model.d.ts +31 -3
  132. package/dist/puck-editor/internal/content-model.js +76 -6
  133. package/dist/puck-editor/internal/content-model.js.map +1 -1
  134. package/dist/puck-editor/internal/dictionaries.d.ts +225 -0
  135. package/dist/puck-editor/internal/dictionaries.js +673 -0
  136. package/dist/puck-editor/internal/dictionaries.js.map +1 -0
  137. package/dist/puck-editor/internal/editor/allowed-types.d.ts +1 -2
  138. package/dist/puck-editor/internal/editor/allowed-types.js +2 -2
  139. package/dist/puck-editor/internal/editor/allowed-types.js.map +1 -1
  140. package/dist/puck-editor/internal/editor/canvas-add-picker.d.ts +0 -1
  141. package/dist/puck-editor/internal/editor/canvas-add-picker.js +5 -5
  142. package/dist/puck-editor/internal/editor/canvas-add-picker.js.map +1 -1
  143. package/dist/puck-editor/internal/editor/canvas-empty-state.d.ts +0 -1
  144. package/dist/puck-editor/internal/editor/canvas-empty-state.js +4 -4
  145. package/dist/puck-editor/internal/editor/canvas-empty-state.js.map +1 -1
  146. package/dist/puck-editor/internal/editor/canvas-quick-add.d.ts +0 -1
  147. package/dist/puck-editor/internal/editor/canvas-quick-add.js +8 -8
  148. package/dist/puck-editor/internal/editor/canvas-quick-add.js.map +1 -1
  149. package/dist/puck-editor/internal/editor/canvas-scroll.d.ts +0 -1
  150. package/dist/puck-editor/internal/editor/component-icons.d.ts +1 -2
  151. package/dist/puck-editor/internal/editor/component-icons.js.map +1 -1
  152. package/dist/puck-editor/internal/editor/component-item.d.ts +0 -1
  153. package/dist/puck-editor/internal/editor/component-item.js +2 -2
  154. package/dist/puck-editor/internal/editor/component-item.js.map +1 -1
  155. package/dist/puck-editor/internal/editor/compose-save-issues.d.ts +15 -0
  156. package/dist/puck-editor/internal/editor/compose-save-issues.js +16 -0
  157. package/dist/puck-editor/internal/editor/compose-save-issues.js.map +1 -0
  158. package/dist/puck-editor/internal/editor/dirty-state.d.ts +3 -0
  159. package/dist/puck-editor/internal/editor/dirty-state.js +7 -0
  160. package/dist/puck-editor/internal/editor/dirty-state.js.map +1 -0
  161. package/dist/puck-editor/internal/editor/draft-restore-banner.d.ts +9 -0
  162. package/dist/puck-editor/internal/editor/draft-restore-banner.js +289 -0
  163. package/dist/puck-editor/internal/editor/draft-restore-banner.js.map +1 -0
  164. package/dist/puck-editor/internal/editor/draft-storage.d.ts +41 -0
  165. package/dist/puck-editor/internal/editor/draft-storage.js +129 -0
  166. package/dist/puck-editor/internal/editor/draft-storage.js.map +1 -0
  167. package/dist/puck-editor/internal/editor/editor-action-bar.d.ts +0 -1
  168. package/dist/puck-editor/internal/editor/editor-action-bar.js +4 -4
  169. package/dist/puck-editor/internal/editor/editor-action-bar.js.map +1 -1
  170. package/dist/puck-editor/internal/editor/editor-header-actions.d.ts +6 -4
  171. package/dist/puck-editor/internal/editor/editor-header-actions.js +119 -60
  172. package/dist/puck-editor/internal/editor/editor-header-actions.js.map +1 -1
  173. package/dist/puck-editor/internal/editor/find-missing-required-fields.d.ts +0 -1
  174. package/dist/puck-editor/internal/editor/grouped-drawer-panel.d.ts +1 -2
  175. package/dist/puck-editor/internal/editor/grouped-drawer-panel.js +6 -6
  176. package/dist/puck-editor/internal/editor/grouped-drawer-panel.js.map +1 -1
  177. package/dist/puck-editor/internal/editor/grouped-entry-list.d.ts +1 -2
  178. package/dist/puck-editor/internal/editor/grouped-entry-list.js +7 -6
  179. package/dist/puck-editor/internal/editor/grouped-entry-list.js.map +1 -1
  180. package/dist/puck-editor/internal/editor/header-save-button.d.ts +4 -4
  181. package/dist/puck-editor/internal/editor/header-save-button.js +66 -27
  182. package/dist/puck-editor/internal/editor/header-save-button.js.map +1 -1
  183. package/dist/puck-editor/internal/editor/leave-confirm-dialog.d.ts +5 -0
  184. package/dist/puck-editor/internal/editor/leave-confirm-dialog.js +140 -0
  185. package/dist/puck-editor/internal/editor/leave-confirm-dialog.js.map +1 -0
  186. package/dist/puck-editor/internal/editor/page-template-picker.d.ts +0 -1
  187. package/dist/puck-editor/internal/editor/page-template-picker.js +5 -5
  188. package/dist/puck-editor/internal/editor/page-template-picker.js.map +1 -1
  189. package/dist/puck-editor/internal/editor/picker-entry-item.d.ts +1 -2
  190. package/dist/puck-editor/internal/editor/picker-entry-item.js +4 -4
  191. package/dist/puck-editor/internal/editor/picker-entry-item.js.map +1 -1
  192. package/dist/puck-editor/internal/editor/picker-model.d.ts +14 -5
  193. package/dist/puck-editor/internal/editor/picker-model.js +157 -132
  194. package/dist/puck-editor/internal/editor/picker-model.js.map +1 -1
  195. package/dist/puck-editor/internal/editor/publish-puck-data.d.ts +18 -4
  196. package/dist/puck-editor/internal/editor/publish-puck-data.js +25 -4
  197. package/dist/puck-editor/internal/editor/publish-puck-data.js.map +1 -1
  198. package/dist/puck-editor/internal/editor/puck-editor.d.ts +6 -4
  199. package/dist/puck-editor/internal/editor/puck-editor.js +270 -209
  200. package/dist/puck-editor/internal/editor/puck-editor.js.map +1 -1
  201. package/dist/puck-editor/internal/editor/save-guard.d.ts +15 -0
  202. package/dist/puck-editor/internal/editor/save-guard.js +30 -0
  203. package/dist/puck-editor/internal/editor/save-guard.js.map +1 -0
  204. package/dist/puck-editor/internal/editor/save-page-context.d.ts +8 -0
  205. package/dist/puck-editor/internal/editor/save-page-context.js +34 -0
  206. package/dist/puck-editor/internal/editor/save-page-context.js.map +1 -0
  207. package/dist/puck-editor/internal/editor/section-template-modal.d.ts +0 -1
  208. package/dist/puck-editor/internal/editor/section-template-modal.js +2 -2
  209. package/dist/puck-editor/internal/editor/section-template-modal.js.map +1 -1
  210. package/dist/puck-editor/internal/editor/use-draft-recovery.d.ts +16 -0
  211. package/dist/puck-editor/internal/editor/use-draft-recovery.js +194 -0
  212. package/dist/puck-editor/internal/editor/use-draft-recovery.js.map +1 -0
  213. package/dist/puck-editor/internal/editor/use-frame-zoom.d.ts +0 -1
  214. package/dist/puck-editor/internal/editor/use-is-dirty.d.ts +1 -0
  215. package/dist/puck-editor/internal/editor/use-is-dirty.js +32 -0
  216. package/dist/puck-editor/internal/editor/use-is-dirty.js.map +1 -0
  217. package/dist/puck-editor/internal/editor/use-scroll-lock-outside.d.ts +0 -1
  218. package/dist/puck-editor/internal/editor-config.d.ts +16 -3
  219. package/dist/puck-editor/internal/editor-config.js +8 -1
  220. package/dist/puck-editor/internal/editor-config.js.map +1 -1
  221. package/dist/puck-editor/internal/editor-query-client.d.ts +0 -1
  222. package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.d.ts +0 -1
  223. package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.js +2 -2
  224. package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.js.map +1 -1
  225. package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.d.ts +0 -1
  226. package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.js +1 -1
  227. package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.js.map +1 -1
  228. package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.d.ts +0 -1
  229. package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.js +1 -1
  230. package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.js.map +1 -1
  231. package/dist/puck-editor/internal/fields/date-picker/date-picker.d.ts +0 -1
  232. package/dist/puck-editor/internal/fields/date-picker/date-picker.js +90 -73
  233. package/dist/puck-editor/internal/fields/date-picker/date-picker.js.map +1 -1
  234. package/dist/puck-editor/internal/fields/index.d.ts +10 -10
  235. package/dist/puck-editor/internal/fields/index.js +10 -9
  236. package/dist/puck-editor/internal/fields/index.js.map +1 -1
  237. package/dist/puck-editor/internal/fields/link-picker/anchor.d.ts +0 -1
  238. package/dist/puck-editor/internal/fields/link-picker/anchor.js +1 -1
  239. package/dist/puck-editor/internal/fields/link-picker/anchor.js.map +1 -1
  240. package/dist/puck-editor/internal/fields/link-picker/create-link-field.d.ts +1 -2
  241. package/dist/puck-editor/internal/fields/link-picker/create-link-field.js +1 -1
  242. package/dist/puck-editor/internal/fields/link-picker/create-link-field.js.map +1 -1
  243. package/dist/puck-editor/internal/fields/link-picker/humanize.d.ts +0 -1
  244. package/dist/puck-editor/internal/fields/link-picker/link-picker-control.d.ts +0 -1
  245. package/dist/puck-editor/internal/fields/link-picker/link-picker-control.js +208 -140
  246. package/dist/puck-editor/internal/fields/link-picker/link-picker-control.js.map +1 -1
  247. package/dist/puck-editor/internal/fields/link-picker/link-picker-field.d.ts +1 -2
  248. package/dist/puck-editor/internal/fields/link-picker/link-picker-field.js +6 -6
  249. package/dist/puck-editor/internal/fields/link-picker/link-picker-field.js.map +1 -1
  250. package/dist/puck-editor/internal/fields/link-picker/link-value.d.ts +25 -5
  251. package/dist/puck-editor/internal/fields/link-picker/link-value.js +56 -6
  252. package/dist/puck-editor/internal/fields/link-picker/link-value.js.map +1 -1
  253. package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.d.ts +0 -1
  254. package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.js +4 -4
  255. package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.js.map +1 -1
  256. package/dist/puck-editor/internal/fields/link-picker/richtext-extensions.d.ts +0 -1
  257. package/dist/puck-editor/internal/fields/link-picker/segmented-control.d.ts +0 -1
  258. package/dist/puck-editor/internal/fields/link-picker/segmented-control.js +3 -3
  259. package/dist/puck-editor/internal/fields/link-picker/segmented-control.js.map +1 -1
  260. package/dist/puck-editor/internal/fields/link-picker/types.d.ts +0 -1
  261. package/dist/puck-editor/internal/fields/media-array/create-media-array-field.d.ts +2 -3
  262. package/dist/puck-editor/internal/fields/media-array/create-media-array-field.js +1 -1
  263. package/dist/puck-editor/internal/fields/media-array/create-media-array-field.js.map +1 -1
  264. package/dist/puck-editor/internal/fields/media-array/media-array-field.d.ts +2 -3
  265. package/dist/puck-editor/internal/fields/media-array/media-array-field.js +100 -88
  266. package/dist/puck-editor/internal/fields/media-array/media-array-field.js.map +1 -1
  267. package/dist/puck-editor/internal/fields/media-array/reorder.d.ts +0 -1
  268. package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.d.ts +2 -3
  269. package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.js +1 -1
  270. package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.js.map +1 -1
  271. package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.d.ts +1 -2
  272. package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.js +4 -4
  273. package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.js.map +1 -1
  274. package/dist/puck-editor/internal/fields/media-selector/crop-types.d.ts +0 -1
  275. package/dist/puck-editor/internal/fields/media-selector/extract-fields.d.ts +0 -1
  276. package/dist/puck-editor/internal/fields/media-selector/image-upload-form.d.ts +0 -1
  277. package/dist/puck-editor/internal/fields/media-selector/image-upload-form.js +19 -10
  278. package/dist/puck-editor/internal/fields/media-selector/image-upload-form.js.map +1 -1
  279. package/dist/puck-editor/internal/fields/media-selector/media-selector-field.d.ts +7 -3
  280. package/dist/puck-editor/internal/fields/media-selector/media-selector-field.js +29 -22
  281. package/dist/puck-editor/internal/fields/media-selector/media-selector-field.js.map +1 -1
  282. package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.d.ts +1 -2
  283. package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.js +281 -255
  284. package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.js.map +1 -1
  285. package/dist/puck-editor/internal/fields/media-selector/use-debounced-value.d.ts +0 -1
  286. package/dist/puck-editor/internal/fields/media-selector/use-media-library.d.ts +15 -2
  287. package/dist/puck-editor/internal/fields/media-selector/use-media-library.js +23 -18
  288. package/dist/puck-editor/internal/fields/media-selector/use-media-library.js.map +1 -1
  289. package/dist/puck-editor/internal/fields/media-selector/video-upload-form.d.ts +0 -1
  290. package/dist/puck-editor/internal/fields/media-selector/video-upload-form.js +12 -6
  291. package/dist/puck-editor/internal/fields/media-selector/video-upload-form.js.map +1 -1
  292. package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.d.ts +0 -1
  293. package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.js +2 -2
  294. package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.js.map +1 -1
  295. package/dist/puck-editor/internal/fields/required-field-label.d.ts +0 -1
  296. package/dist/puck-editor/internal/fields/required-field-label.js +1 -1
  297. package/dist/puck-editor/internal/fields/required-field-label.js.map +1 -1
  298. package/dist/puck-editor/internal/fields/required.d.ts +0 -1
  299. package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.d.ts +13 -3
  300. package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.js +32 -22
  301. package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.js.map +1 -1
  302. package/dist/puck-editor/internal/i18n.d.ts +2 -181
  303. package/dist/puck-editor/internal/i18n.js +2 -358
  304. package/dist/puck-editor/internal/i18n.js.map +1 -1
  305. package/dist/puck-editor/internal/locale.d.ts +0 -1
  306. package/dist/puck-editor/internal/localize.d.ts +1 -2
  307. package/dist/puck-editor/internal/localize.js.map +1 -1
  308. package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.d.ts +3 -3
  309. package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.js +41 -32
  310. package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.js.map +1 -1
  311. package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.d.ts +0 -1
  312. package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.js +2 -2
  313. package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.js.map +1 -1
  314. package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.d.ts +3 -3
  315. package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.js.map +1 -1
  316. package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.d.ts +0 -1
  317. package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.js +1 -1
  318. package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.js.map +1 -1
  319. package/dist/puck-editor/internal/plugins/agent-plugin/catalog.d.ts +0 -1
  320. package/dist/puck-editor/internal/plugins/agent-plugin/constants.d.ts +0 -1
  321. package/dist/puck-editor/internal/plugins/agent-plugin/create-page.d.ts +0 -1
  322. package/dist/puck-editor/internal/plugins/agent-plugin/find-component-location.d.ts +0 -1
  323. package/dist/puck-editor/internal/plugins/agent-plugin/help.d.ts +0 -1
  324. package/dist/puck-editor/internal/plugins/agent-plugin/index.d.ts +1 -2
  325. package/dist/puck-editor/internal/plugins/agent-plugin/index.js +1 -1
  326. package/dist/puck-editor/internal/plugins/agent-plugin/index.js.map +1 -1
  327. package/dist/puck-editor/internal/plugins/agent-plugin/list-media.d.ts +2 -2
  328. package/dist/puck-editor/internal/plugins/agent-plugin/list-media.js +4 -3
  329. package/dist/puck-editor/internal/plugins/agent-plugin/list-media.js.map +1 -1
  330. package/dist/puck-editor/internal/plugins/agent-plugin/templates.d.ts +5 -6
  331. package/dist/puck-editor/internal/plugins/agent-plugin/templates.js +2 -2
  332. package/dist/puck-editor/internal/plugins/agent-plugin/templates.js.map +1 -1
  333. package/dist/puck-editor/internal/plugins/agent-plugin/upload-media.d.ts +1 -2
  334. package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.d.ts +0 -1
  335. package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.js +2 -2
  336. package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.js.map +1 -1
  337. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.d.ts +0 -1
  338. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.js +3 -3
  339. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.js.map +1 -1
  340. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.d.ts +0 -1
  341. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.js +1 -1
  342. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.js.map +1 -1
  343. package/dist/puck-editor/internal/plugins/blocks-plugin/index.d.ts +1 -2
  344. package/dist/puck-editor/internal/plugins/blocks-plugin/index.js +1 -1
  345. package/dist/puck-editor/internal/plugins/blocks-plugin/index.js.map +1 -1
  346. package/dist/puck-editor/internal/plugins/outline-plugin/index.d.ts +1 -2
  347. package/dist/puck-editor/internal/plugins/outline-plugin/index.js +1 -1
  348. package/dist/puck-editor/internal/plugins/outline-plugin/index.js.map +1 -1
  349. package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.d.ts +0 -1
  350. package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.js +46 -31
  351. package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.js.map +1 -1
  352. package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.d.ts +0 -1
  353. package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.js +1 -1
  354. package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.js.map +1 -1
  355. package/dist/puck-editor/internal/plugins/outline-plugin/outline-tree.d.ts +0 -1
  356. package/dist/puck-editor/internal/plugins/sections-plugin/index.d.ts +1 -2
  357. package/dist/puck-editor/internal/plugins/sections-plugin/index.js +1 -1
  358. package/dist/puck-editor/internal/plugins/sections-plugin/index.js.map +1 -1
  359. package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.d.ts +0 -1
  360. package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.js +5 -5
  361. package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.js.map +1 -1
  362. package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.d.ts +0 -1
  363. package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.js +1 -1
  364. package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.js.map +1 -1
  365. package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.d.ts +0 -1
  366. package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.js +2 -2
  367. package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.js.map +1 -1
  368. package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.d.ts +0 -1
  369. package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.js +1 -1
  370. package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.js.map +1 -1
  371. package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.d.ts +1 -2
  372. package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.js +3 -3
  373. package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.js.map +1 -1
  374. package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.d.ts +1 -2
  375. package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.js +224 -219
  376. package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.js.map +1 -1
  377. package/dist/puck-editor/internal/plugins/templates-plugin/index.d.ts +5 -6
  378. package/dist/puck-editor/internal/plugins/templates-plugin/index.js +5 -5
  379. package/dist/puck-editor/internal/plugins/templates-plugin/index.js.map +1 -1
  380. package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.d.ts +0 -1
  381. package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.js +3 -3
  382. package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.js.map +1 -1
  383. package/dist/puck-editor/internal/plugins/templates-plugin/template-form.d.ts +1 -2
  384. package/dist/puck-editor/internal/plugins/templates-plugin/template-form.js +17 -16
  385. package/dist/puck-editor/internal/plugins/templates-plugin/template-form.js.map +1 -1
  386. package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.d.ts +1 -2
  387. package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.js +1 -1
  388. package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.js.map +1 -1
  389. package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.d.ts +0 -1
  390. package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.js +171 -161
  391. package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.js.map +1 -1
  392. package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.d.ts +0 -1
  393. package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.js +1 -1
  394. package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.js.map +1 -1
  395. package/dist/puck-editor/internal/plugins/templates-plugin/templates.d.ts +2 -3
  396. package/dist/puck-editor/internal/plugins/templates-plugin/templates.js +9 -2
  397. package/dist/puck-editor/internal/plugins/templates-plugin/templates.js.map +1 -1
  398. package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.d.ts +0 -1
  399. package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.js +22 -20
  400. package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.js.map +1 -1
  401. package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.d.ts +14 -5
  402. package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.js +23 -15
  403. package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.js.map +1 -1
  404. package/dist/puck-editor/internal/puck-augmentation.d.ts +0 -1
  405. package/dist/puck-editor/internal/puck-editor-provider.d.ts +0 -1
  406. package/dist/puck-editor/internal/puck-node.d.ts +0 -1
  407. package/dist/puck-editor/internal/puck-props.d.ts +13 -0
  408. package/dist/puck-editor/internal/puck-props.js +2 -0
  409. package/dist/puck-editor/internal/puck-props.js.map +1 -0
  410. package/dist/puck-editor/internal/puck-wrapper.d.ts +25 -6
  411. package/dist/puck-editor/internal/puck-wrapper.js +124 -115
  412. package/dist/puck-editor/internal/puck-wrapper.js.map +1 -1
  413. package/dist/puck-editor/internal/render/cropped-image.d.ts +1 -2
  414. package/dist/puck-editor/internal/render/cropped-image.js.map +1 -1
  415. package/dist/puck-editor/internal/smart-actions/action-selection.d.ts +8 -0
  416. package/dist/puck-editor/internal/smart-actions/action-selection.js +10 -0
  417. package/dist/puck-editor/internal/smart-actions/action-selection.js.map +1 -0
  418. package/dist/puck-editor/internal/smart-actions/index.d.ts +10 -4
  419. package/dist/puck-editor/internal/smart-actions/index.js +27 -12
  420. package/dist/puck-editor/internal/smart-actions/index.js.map +1 -1
  421. package/dist/puck-editor/internal/smart-actions/new-page.d.ts +3 -2
  422. package/dist/puck-editor/internal/smart-actions/new-page.js +6 -6
  423. package/dist/puck-editor/internal/smart-actions/new-page.js.map +1 -1
  424. package/dist/puck-editor/internal/smart-actions/open-puck-editor.d.ts +3 -2
  425. package/dist/puck-editor/internal/smart-actions/open-puck-editor.js +49 -37
  426. package/dist/puck-editor/internal/smart-actions/open-puck-editor.js.map +1 -1
  427. package/dist/puck-editor/internal/ui/calendar.d.ts +0 -1
  428. package/dist/puck-editor/internal/ui/calendar.js +1 -1
  429. package/dist/puck-editor/internal/ui/calendar.js.map +1 -1
  430. package/dist/puck-editor/internal/ui/component-list-accordion.d.ts +0 -1
  431. package/dist/puck-editor/internal/ui/dialog.d.ts +0 -1
  432. package/dist/puck-editor/internal/ui/dialog.js +33 -20
  433. package/dist/puck-editor/internal/ui/dialog.js.map +1 -1
  434. package/dist/puck-editor/internal/ui/drawer-item-content.d.ts +0 -1
  435. package/dist/puck-editor/internal/ui/icon-button.d.ts +0 -1
  436. package/dist/puck-editor/internal/ui/icon-button.js +1 -1
  437. package/dist/puck-editor/internal/ui/icon-button.js.map +1 -1
  438. package/dist/puck-editor/internal/ui/load-error-notice.d.ts +6 -0
  439. package/dist/puck-editor/internal/ui/load-error-notice.js +81 -0
  440. package/dist/puck-editor/internal/ui/load-error-notice.js.map +1 -0
  441. package/dist/puck-editor/internal/ui/popover.d.ts +0 -1
  442. package/dist/puck-editor/internal/ui/popover.js +1 -1
  443. package/dist/puck-editor/internal/ui/popover.js.map +1 -1
  444. package/dist/puck-editor/internal/ui/required-mark.d.ts +0 -1
  445. package/dist/puck-editor/internal/ui/scroll-area.d.ts +8 -0
  446. package/dist/puck-editor/internal/ui/scroll-area.js +160 -0
  447. package/dist/puck-editor/internal/ui/scroll-area.js.map +1 -0
  448. package/dist/puck-editor/internal/ui/search-control.d.ts +0 -1
  449. package/dist/puck-editor/internal/ui/search-control.js +3 -3
  450. package/dist/puck-editor/internal/ui/search-control.js.map +1 -1
  451. package/dist/puck-editor/internal/ui/use-panel-search-focus.d.ts +0 -1
  452. package/dist/puck-editor/internal/use-puck-overlay.d.ts +1 -2
  453. package/dist/puck-editor/internal/use-puck-overlay.js +6 -5
  454. package/dist/puck-editor/internal/use-puck-overlay.js.map +1 -1
  455. package/dist/puck-editor/internal/utils.d.ts +0 -1
  456. package/dist/puck-editor/render.d.ts +2 -3
  457. package/dist/puck-editor/render.js +1 -1
  458. package/dist/puck-editor/render.js.map +1 -1
  459. package/dist/puck-editor/server.d.ts +3 -4
  460. package/dist/puck-editor/server.js +1 -1
  461. package/dist/puck-editor/server.js.map +1 -1
  462. package/dist/puck-editor/smart-actions.d.ts +1 -2
  463. package/dist/puck-editor/smart-actions.js +1 -1
  464. package/dist/puck-editor/smart-actions.js.map +1 -1
  465. package/dist/shared/cn.d.ts +0 -1
  466. package/dist/shared/i18n.d.ts +0 -1
  467. package/dist/shared/revalidate-path.d.ts +1 -0
  468. package/dist/shared/revalidate-path.js +2 -0
  469. package/dist/shared/revalidate-path.js.map +1 -0
  470. package/dist/shared/toolbar-action.d.ts +0 -1
  471. package/dist/shared/use-is-hydrated.d.ts +0 -1
  472. package/dist/shared/use-is-in-iframe.d.ts +0 -1
  473. package/dist/shared/use-is-in-iframe.js +1 -1
  474. package/dist/shared/use-is-in-iframe.js.map +1 -1
  475. package/dist/smart-actions/internal/backend-edit-link.d.ts +6 -0
  476. package/dist/smart-actions/internal/backend-edit-link.js +60 -0
  477. package/dist/smart-actions/internal/backend-edit-link.js.map +1 -0
  478. package/dist/smart-actions/internal/get-smart-actions-context.d.ts +1 -2
  479. package/dist/smart-actions/internal/get-smart-actions-context.js +2 -2
  480. package/dist/smart-actions/internal/get-smart-actions-context.js.map +1 -1
  481. package/dist/smart-actions/internal/i18n.d.ts +1 -2
  482. package/dist/smart-actions/internal/i18n.js +16 -2
  483. package/dist/smart-actions/internal/i18n.js.map +1 -1
  484. package/dist/smart-actions/internal/logout-form.d.ts +2 -2
  485. package/dist/smart-actions/internal/logout-form.js +47 -40
  486. package/dist/smart-actions/internal/logout-form.js.map +1 -1
  487. package/dist/smart-actions/internal/refresh-page.d.ts +3 -2
  488. package/dist/smart-actions/internal/refresh-page.js +60 -53
  489. package/dist/smart-actions/internal/refresh-page.js.map +1 -1
  490. package/dist/smart-actions/internal/smart-actions-button.d.ts +22 -4
  491. package/dist/smart-actions/internal/smart-actions-button.js +36 -13
  492. package/dist/smart-actions/internal/smart-actions-button.js.map +1 -1
  493. package/dist/smart-actions/internal/smart-actions-config.d.ts +12 -4
  494. package/dist/smart-actions/internal/smart-actions-config.js +36 -80
  495. package/dist/smart-actions/internal/smart-actions-config.js.map +1 -1
  496. package/dist/smart-actions/internal/smart-actions-toolbar-client.d.ts +5 -11
  497. package/dist/smart-actions/internal/smart-actions-toolbar-client.js +13 -53
  498. package/dist/smart-actions/internal/smart-actions-toolbar-client.js.map +1 -1
  499. package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.d.ts +1 -2
  500. package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.js +4 -4
  501. package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.js.map +1 -1
  502. package/dist/smart-actions/internal/toolbar/storage.d.ts +1 -2
  503. package/dist/smart-actions/internal/toolbar/storage.js.map +1 -1
  504. package/dist/smart-actions/internal/toolbar/types.d.ts +1 -2
  505. package/dist/smart-actions/internal/toolbar/types.js.map +1 -1
  506. package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.d.ts +1 -2
  507. package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.js +1 -1
  508. package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.js.map +1 -1
  509. package/dist/smart-actions/internal/ui/tooltip.d.ts +0 -1
  510. package/dist/smart-actions/internal/ui/tooltip.js +1 -1
  511. package/dist/smart-actions/internal/ui/tooltip.js.map +1 -1
  512. package/dist/smart-actions/internal/user-profile.d.ts +0 -1
  513. package/dist/smart-actions/internal/user-profile.js +71 -24
  514. package/dist/smart-actions/internal/user-profile.js.map +1 -1
  515. package/dist/smart-actions/server.d.ts +5 -4
  516. package/dist/smart-actions/server.js +2 -2
  517. package/dist/smart-actions/server.js.map +1 -1
  518. package/dist/theme.css +1 -1
  519. package/dist/visual-editor/index.d.ts +3 -4
  520. package/dist/visual-editor/index.js +3 -3
  521. package/dist/visual-editor/index.js.map +1 -1
  522. package/dist/visual-editor/internal/bridge/connector.d.ts +4 -3
  523. package/dist/visual-editor/internal/bridge/connector.js +22 -21
  524. package/dist/visual-editor/internal/bridge/connector.js.map +1 -1
  525. package/dist/visual-editor/internal/bridge/draft-mode-self-heal.d.ts +0 -1
  526. package/dist/visual-editor/internal/bridge/editor-auth-gate-server.d.ts +5 -3
  527. package/dist/visual-editor/internal/bridge/editor-auth-gate-server.js +7 -8
  528. package/dist/visual-editor/internal/bridge/editor-auth-gate-server.js.map +1 -1
  529. package/dist/visual-editor/internal/bridge/editor-auth-gate.d.ts +3 -3
  530. package/dist/visual-editor/internal/bridge/editor-auth-gate.js +4 -2
  531. package/dist/visual-editor/internal/bridge/editor-auth-gate.js.map +1 -1
  532. package/dist/visual-editor/internal/i18n.d.ts +3 -2
  533. package/dist/visual-editor/internal/i18n.js +32 -4
  534. package/dist/visual-editor/internal/i18n.js.map +1 -1
  535. package/dist/visual-editor/internal/overlays/drupal-origin.d.ts +1 -7
  536. package/dist/visual-editor/internal/overlays/drupal-origin.js +16 -3
  537. package/dist/visual-editor/internal/overlays/drupal-origin.js.map +1 -1
  538. package/dist/visual-editor/internal/overlays/edit-button.d.ts +5 -4
  539. package/dist/visual-editor/internal/overlays/edit-button.js +46 -44
  540. package/dist/visual-editor/internal/overlays/edit-button.js.map +1 -1
  541. package/dist/visual-editor/internal/overlays/edit-icon.d.ts +0 -1
  542. package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.d.ts +11 -2
  543. package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.js +18 -7
  544. package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.js.map +1 -1
  545. package/dist/visual-editor/internal/overlays/iframe-wrapper.d.ts +0 -1
  546. package/dist/visual-editor/internal/overlays/iframe-wrapper.js +1 -1
  547. package/dist/visual-editor/internal/overlays/iframe-wrapper.js.map +1 -1
  548. package/dist/visual-editor/internal/overlays/menu/menu-wrapper.d.ts +12 -3
  549. package/dist/visual-editor/internal/overlays/menu/menu-wrapper.js +14 -5
  550. package/dist/visual-editor/internal/overlays/menu/menu-wrapper.js.map +1 -1
  551. package/dist/visual-editor/internal/overlays/node/node-metadata.d.ts +4 -2
  552. package/dist/visual-editor/internal/overlays/node/node-metadata.js +10 -4
  553. package/dist/visual-editor/internal/overlays/node/node-metadata.js.map +1 -1
  554. package/dist/visual-editor/internal/overlays/node/node-wrapper.d.ts +5 -3
  555. package/dist/visual-editor/internal/overlays/node/node-wrapper.js +4 -2
  556. package/dist/visual-editor/internal/overlays/node/node-wrapper.js.map +1 -1
  557. package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.d.ts +11 -2
  558. package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.js +18 -7
  559. package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.js.map +1 -1
  560. package/dist/visual-editor/internal/revalidate-route.d.ts +0 -1
  561. package/dist/visual-editor/internal/revalidate-route.js +1 -1
  562. package/dist/visual-editor/internal/revalidate-route.js.map +1 -1
  563. package/dist/visual-editor/server.d.ts +6 -7
  564. package/dist/visual-editor/server.js +6 -6
  565. package/dist/visual-editor/server.js.map +1 -1
  566. package/package.json +20 -3
  567. package/dist/auth/index.d.ts.map +0 -1
  568. package/dist/auth/internal/config.d.ts.map +0 -1
  569. package/dist/auth/internal/draft-mode.d.ts.map +0 -1
  570. package/dist/auth/internal/editor-locale.d.ts.map +0 -1
  571. package/dist/auth/internal/handoff.d.ts.map +0 -1
  572. package/dist/auth/internal/has-session.d.ts.map +0 -1
  573. package/dist/auth/internal/logout.d.ts.map +0 -1
  574. package/dist/auth/internal/next-cookie-storage.d.ts.map +0 -1
  575. package/dist/auth/internal/nodehive-client.d.ts.map +0 -1
  576. package/dist/auth/internal/oauth-config.d.ts.map +0 -1
  577. package/dist/auth/internal/proxy-helpers.d.ts.map +0 -1
  578. package/dist/auth/internal/refresh.d.ts.map +0 -1
  579. package/dist/auth/internal/require-auth.d.ts.map +0 -1
  580. package/dist/auth/internal/return-to.d.ts.map +0 -1
  581. package/dist/auth/internal/routes/callback.d.ts.map +0 -1
  582. package/dist/auth/internal/routes/chips-exchange.d.ts.map +0 -1
  583. package/dist/auth/internal/routes/draft.d.ts.map +0 -1
  584. package/dist/auth/internal/routes/index.d.ts.map +0 -1
  585. package/dist/auth/internal/routes/login.d.ts.map +0 -1
  586. package/dist/auth/internal/routes/popup-done.d.ts.map +0 -1
  587. package/dist/auth/internal/routes/refresh.d.ts.map +0 -1
  588. package/dist/auth/internal/same-origin.d.ts.map +0 -1
  589. package/dist/auth/internal/session-gates.d.ts.map +0 -1
  590. package/dist/auth/internal/update-session.d.ts.map +0 -1
  591. package/dist/auth/internal/use-editor-login.d.ts.map +0 -1
  592. package/dist/auth/proxy.d.ts.map +0 -1
  593. package/dist/auth/react.d.ts.map +0 -1
  594. package/dist/auth/routes.d.ts.map +0 -1
  595. package/dist/auth/server.d.ts.map +0 -1
  596. package/dist/puck-editor/fields.d.ts.map +0 -1
  597. package/dist/puck-editor/index.d.ts.map +0 -1
  598. package/dist/puck-editor/internal/api/client.d.ts.map +0 -1
  599. package/dist/puck-editor/internal/api/config.d.ts.map +0 -1
  600. package/dist/puck-editor/internal/api/create-puck-api.d.ts.map +0 -1
  601. package/dist/puck-editor/internal/api/handlers/create-page.d.ts.map +0 -1
  602. package/dist/puck-editor/internal/api/handlers/entities.d.ts.map +0 -1
  603. package/dist/puck-editor/internal/api/handlers/publish.d.ts.map +0 -1
  604. package/dist/puck-editor/internal/api/handlers/template.d.ts.map +0 -1
  605. package/dist/puck-editor/internal/api/handlers/upload.d.ts.map +0 -1
  606. package/dist/puck-editor/internal/api/media-params.d.ts.map +0 -1
  607. package/dist/puck-editor/internal/api/media-upload.d.ts.map +0 -1
  608. package/dist/puck-editor/internal/api/space.d.ts.map +0 -1
  609. package/dist/puck-editor/internal/content-model.d.ts.map +0 -1
  610. package/dist/puck-editor/internal/editor/allowed-types.d.ts.map +0 -1
  611. package/dist/puck-editor/internal/editor/canvas-add-picker.d.ts.map +0 -1
  612. package/dist/puck-editor/internal/editor/canvas-empty-state.d.ts.map +0 -1
  613. package/dist/puck-editor/internal/editor/canvas-quick-add.d.ts.map +0 -1
  614. package/dist/puck-editor/internal/editor/canvas-scroll.d.ts.map +0 -1
  615. package/dist/puck-editor/internal/editor/component-icons.d.ts.map +0 -1
  616. package/dist/puck-editor/internal/editor/component-item.d.ts.map +0 -1
  617. package/dist/puck-editor/internal/editor/editor-action-bar.d.ts.map +0 -1
  618. package/dist/puck-editor/internal/editor/editor-header-actions.d.ts.map +0 -1
  619. package/dist/puck-editor/internal/editor/find-missing-required-fields.d.ts.map +0 -1
  620. package/dist/puck-editor/internal/editor/grouped-drawer-panel.d.ts.map +0 -1
  621. package/dist/puck-editor/internal/editor/grouped-entry-list.d.ts.map +0 -1
  622. package/dist/puck-editor/internal/editor/header-save-button.d.ts.map +0 -1
  623. package/dist/puck-editor/internal/editor/page-template-picker.d.ts.map +0 -1
  624. package/dist/puck-editor/internal/editor/picker-entry-item.d.ts.map +0 -1
  625. package/dist/puck-editor/internal/editor/picker-model.d.ts.map +0 -1
  626. package/dist/puck-editor/internal/editor/publish-puck-data.d.ts.map +0 -1
  627. package/dist/puck-editor/internal/editor/puck-editor.d.ts.map +0 -1
  628. package/dist/puck-editor/internal/editor/section-template-modal.d.ts.map +0 -1
  629. package/dist/puck-editor/internal/editor/use-frame-zoom.d.ts.map +0 -1
  630. package/dist/puck-editor/internal/editor/use-scroll-lock-outside.d.ts.map +0 -1
  631. package/dist/puck-editor/internal/editor-config.d.ts.map +0 -1
  632. package/dist/puck-editor/internal/editor-query-client.d.ts.map +0 -1
  633. package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.d.ts.map +0 -1
  634. package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.d.ts.map +0 -1
  635. package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.d.ts.map +0 -1
  636. package/dist/puck-editor/internal/fields/date-picker/date-picker.d.ts.map +0 -1
  637. package/dist/puck-editor/internal/fields/index.d.ts.map +0 -1
  638. package/dist/puck-editor/internal/fields/link-picker/anchor.d.ts.map +0 -1
  639. package/dist/puck-editor/internal/fields/link-picker/create-link-field.d.ts.map +0 -1
  640. package/dist/puck-editor/internal/fields/link-picker/humanize.d.ts.map +0 -1
  641. package/dist/puck-editor/internal/fields/link-picker/link-picker-control.d.ts.map +0 -1
  642. package/dist/puck-editor/internal/fields/link-picker/link-picker-field.d.ts.map +0 -1
  643. package/dist/puck-editor/internal/fields/link-picker/link-value.d.ts.map +0 -1
  644. package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.d.ts.map +0 -1
  645. package/dist/puck-editor/internal/fields/link-picker/richtext-extensions.d.ts.map +0 -1
  646. package/dist/puck-editor/internal/fields/link-picker/segmented-control.d.ts.map +0 -1
  647. package/dist/puck-editor/internal/fields/link-picker/types.d.ts.map +0 -1
  648. package/dist/puck-editor/internal/fields/media-array/create-media-array-field.d.ts.map +0 -1
  649. package/dist/puck-editor/internal/fields/media-array/media-array-field.d.ts.map +0 -1
  650. package/dist/puck-editor/internal/fields/media-array/reorder.d.ts.map +0 -1
  651. package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.d.ts.map +0 -1
  652. package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.d.ts.map +0 -1
  653. package/dist/puck-editor/internal/fields/media-selector/crop-types.d.ts.map +0 -1
  654. package/dist/puck-editor/internal/fields/media-selector/extract-fields.d.ts.map +0 -1
  655. package/dist/puck-editor/internal/fields/media-selector/image-upload-form.d.ts.map +0 -1
  656. package/dist/puck-editor/internal/fields/media-selector/media-selector-field.d.ts.map +0 -1
  657. package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.d.ts.map +0 -1
  658. package/dist/puck-editor/internal/fields/media-selector/use-debounced-value.d.ts.map +0 -1
  659. package/dist/puck-editor/internal/fields/media-selector/use-media-library.d.ts.map +0 -1
  660. package/dist/puck-editor/internal/fields/media-selector/video-upload-form.d.ts.map +0 -1
  661. package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.d.ts.map +0 -1
  662. package/dist/puck-editor/internal/fields/required-field-label.d.ts.map +0 -1
  663. package/dist/puck-editor/internal/fields/required.d.ts.map +0 -1
  664. package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.d.ts.map +0 -1
  665. package/dist/puck-editor/internal/i18n.d.ts.map +0 -1
  666. package/dist/puck-editor/internal/locale.d.ts.map +0 -1
  667. package/dist/puck-editor/internal/localize.d.ts.map +0 -1
  668. package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.d.ts.map +0 -1
  669. package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.d.ts.map +0 -1
  670. package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.d.ts.map +0 -1
  671. package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.d.ts.map +0 -1
  672. package/dist/puck-editor/internal/plugins/agent-plugin/catalog.d.ts.map +0 -1
  673. package/dist/puck-editor/internal/plugins/agent-plugin/constants.d.ts.map +0 -1
  674. package/dist/puck-editor/internal/plugins/agent-plugin/create-page.d.ts.map +0 -1
  675. package/dist/puck-editor/internal/plugins/agent-plugin/find-component-location.d.ts.map +0 -1
  676. package/dist/puck-editor/internal/plugins/agent-plugin/help.d.ts.map +0 -1
  677. package/dist/puck-editor/internal/plugins/agent-plugin/index.d.ts.map +0 -1
  678. package/dist/puck-editor/internal/plugins/agent-plugin/list-media.d.ts.map +0 -1
  679. package/dist/puck-editor/internal/plugins/agent-plugin/templates.d.ts.map +0 -1
  680. package/dist/puck-editor/internal/plugins/agent-plugin/upload-media.d.ts.map +0 -1
  681. package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.d.ts.map +0 -1
  682. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.d.ts.map +0 -1
  683. package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.d.ts.map +0 -1
  684. package/dist/puck-editor/internal/plugins/blocks-plugin/index.d.ts.map +0 -1
  685. package/dist/puck-editor/internal/plugins/outline-plugin/index.d.ts.map +0 -1
  686. package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.d.ts.map +0 -1
  687. package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.d.ts.map +0 -1
  688. package/dist/puck-editor/internal/plugins/outline-plugin/outline-tree.d.ts.map +0 -1
  689. package/dist/puck-editor/internal/plugins/sections-plugin/index.d.ts.map +0 -1
  690. package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.d.ts.map +0 -1
  691. package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.d.ts.map +0 -1
  692. package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.d.ts.map +0 -1
  693. package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.d.ts.map +0 -1
  694. package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.d.ts.map +0 -1
  695. package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.d.ts.map +0 -1
  696. package/dist/puck-editor/internal/plugins/templates-plugin/index.d.ts.map +0 -1
  697. package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.d.ts.map +0 -1
  698. package/dist/puck-editor/internal/plugins/templates-plugin/template-form.d.ts.map +0 -1
  699. package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.d.ts.map +0 -1
  700. package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.d.ts.map +0 -1
  701. package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.d.ts.map +0 -1
  702. package/dist/puck-editor/internal/plugins/templates-plugin/templates.d.ts.map +0 -1
  703. package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.d.ts.map +0 -1
  704. package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.d.ts.map +0 -1
  705. package/dist/puck-editor/internal/puck-augmentation.d.ts.map +0 -1
  706. package/dist/puck-editor/internal/puck-editor-provider.d.ts.map +0 -1
  707. package/dist/puck-editor/internal/puck-node.d.ts.map +0 -1
  708. package/dist/puck-editor/internal/puck-wrapper.d.ts.map +0 -1
  709. package/dist/puck-editor/internal/render/cropped-image.d.ts.map +0 -1
  710. package/dist/puck-editor/internal/smart-actions/index.d.ts.map +0 -1
  711. package/dist/puck-editor/internal/smart-actions/new-page.d.ts.map +0 -1
  712. package/dist/puck-editor/internal/smart-actions/open-puck-editor.d.ts.map +0 -1
  713. package/dist/puck-editor/internal/ui/calendar.d.ts.map +0 -1
  714. package/dist/puck-editor/internal/ui/component-list-accordion.d.ts.map +0 -1
  715. package/dist/puck-editor/internal/ui/dialog.d.ts.map +0 -1
  716. package/dist/puck-editor/internal/ui/drawer-item-content.d.ts.map +0 -1
  717. package/dist/puck-editor/internal/ui/icon-button.d.ts.map +0 -1
  718. package/dist/puck-editor/internal/ui/popover.d.ts.map +0 -1
  719. package/dist/puck-editor/internal/ui/required-mark.d.ts.map +0 -1
  720. package/dist/puck-editor/internal/ui/search-control.d.ts.map +0 -1
  721. package/dist/puck-editor/internal/ui/use-panel-search-focus.d.ts.map +0 -1
  722. package/dist/puck-editor/internal/use-puck-overlay.d.ts.map +0 -1
  723. package/dist/puck-editor/internal/utils.d.ts.map +0 -1
  724. package/dist/puck-editor/render.d.ts.map +0 -1
  725. package/dist/puck-editor/server.d.ts.map +0 -1
  726. package/dist/puck-editor/smart-actions.d.ts.map +0 -1
  727. package/dist/shared/cn.d.ts.map +0 -1
  728. package/dist/shared/i18n.d.ts.map +0 -1
  729. package/dist/shared/toolbar-action.d.ts.map +0 -1
  730. package/dist/shared/use-is-hydrated.d.ts.map +0 -1
  731. package/dist/shared/use-is-in-iframe.d.ts.map +0 -1
  732. package/dist/smart-actions/internal/get-smart-actions-context.d.ts.map +0 -1
  733. package/dist/smart-actions/internal/i18n.d.ts.map +0 -1
  734. package/dist/smart-actions/internal/logout-form.d.ts.map +0 -1
  735. package/dist/smart-actions/internal/refresh-page.d.ts.map +0 -1
  736. package/dist/smart-actions/internal/smart-actions-button.d.ts.map +0 -1
  737. package/dist/smart-actions/internal/smart-actions-config.d.ts.map +0 -1
  738. package/dist/smart-actions/internal/smart-actions-toolbar-client.d.ts.map +0 -1
  739. package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.d.ts.map +0 -1
  740. package/dist/smart-actions/internal/toolbar/storage.d.ts.map +0 -1
  741. package/dist/smart-actions/internal/toolbar/types.d.ts.map +0 -1
  742. package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.d.ts.map +0 -1
  743. package/dist/smart-actions/internal/ui/tooltip.d.ts.map +0 -1
  744. package/dist/smart-actions/internal/user-profile.d.ts.map +0 -1
  745. package/dist/smart-actions/server.d.ts.map +0 -1
  746. package/dist/visual-editor/index.d.ts.map +0 -1
  747. package/dist/visual-editor/internal/bridge/connector.d.ts.map +0 -1
  748. package/dist/visual-editor/internal/bridge/draft-mode-self-heal.d.ts.map +0 -1
  749. package/dist/visual-editor/internal/bridge/editor-auth-gate-server.d.ts.map +0 -1
  750. package/dist/visual-editor/internal/bridge/editor-auth-gate.d.ts.map +0 -1
  751. package/dist/visual-editor/internal/i18n.d.ts.map +0 -1
  752. package/dist/visual-editor/internal/overlays/drupal-origin.d.ts.map +0 -1
  753. package/dist/visual-editor/internal/overlays/edit-button.d.ts.map +0 -1
  754. package/dist/visual-editor/internal/overlays/edit-icon.d.ts.map +0 -1
  755. package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.d.ts.map +0 -1
  756. package/dist/visual-editor/internal/overlays/iframe-wrapper.d.ts.map +0 -1
  757. package/dist/visual-editor/internal/overlays/menu/menu-wrapper.d.ts.map +0 -1
  758. package/dist/visual-editor/internal/overlays/node/node-metadata.d.ts.map +0 -1
  759. package/dist/visual-editor/internal/overlays/node/node-wrapper.d.ts.map +0 -1
  760. package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.d.ts.map +0 -1
  761. package/dist/visual-editor/internal/revalidate-route.d.ts.map +0 -1
  762. package/dist/visual-editor/server.d.ts.map +0 -1
@@ -1,7 +1,31 @@
1
1
  interface SessionGateProps {
2
2
  children: React.ReactNode;
3
+ /**
4
+ * Drupal roles to gate on. Matching is any-of: the session needs at least one
5
+ * of them. UI-gating only — real authorization lives in Drupal.
6
+ */
7
+ roles?: string[];
3
8
  }
4
- export declare function SignedIn({ children }: SessionGateProps): Promise<import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | (string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined)>;
5
- export declare function SignedOut({ children }: SessionGateProps): Promise<import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | (string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined)>;
9
+ /**
10
+ * Renders `children` only for a signed-in session.
11
+ *
12
+ * Dynamic RSC (reads `cookies()`); under `cacheComponents`, mount inside a `<Suspense>` boundary. See the auth README.
13
+ *
14
+ * With `roles`, gates on the session's Drupal roles instead of mere presence:
15
+ * renders only when the session carries at least one of the given roles
16
+ * (any-of, matching the draft-mode role semantic). Fails closed — no session,
17
+ * no `user_details`, roles not determinable, or an empty `roles` array → not
18
+ * rendered.
19
+ */
20
+ export declare function SignedIn({ children, roles }: SessionGateProps): Promise<import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | (string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined)>;
21
+ /**
22
+ * Renders `children` only when there is no signed-in session.
23
+ *
24
+ * Dynamic RSC (reads `cookies()`); under `cacheComponents`, mount inside a `<Suspense>` boundary. See the auth README.
25
+ *
26
+ * With `roles`, this is the inverse of `SignedIn roles`: renders when the
27
+ * session does NOT carry any of the given roles — i.e. no session at all, or a
28
+ * session lacking every listed role. An empty `roles` array always renders.
29
+ */
30
+ export declare function SignedOut({ children, roles }: SessionGateProps): Promise<import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | (string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined)>;
6
31
  export {};
7
- //# sourceMappingURL=session-gates.d.ts.map
@@ -1,12 +1,44 @@
1
- import { checkHasSession } from './has-session';
1
+ import { checkHasSession } from "./has-session.js";
2
+ import { getUserRoles, hasAnyRole } from "./roles.js";
3
+ async function sessionHasAnyRole(roles) {
4
+ if (roles.length === 0) return false;
5
+ if (!(await checkHasSession())) return false;
6
+ return hasAnyRole(await getUserRoles(), roles);
7
+ }
8
+
9
+ /**
10
+ * Renders `children` only for a signed-in session.
11
+ *
12
+ * Dynamic RSC (reads `cookies()`); under `cacheComponents`, mount inside a `<Suspense>` boundary. See the auth README.
13
+ *
14
+ * With `roles`, gates on the session's Drupal roles instead of mere presence:
15
+ * renders only when the session carries at least one of the given roles
16
+ * (any-of, matching the draft-mode role semantic). Fails closed — no session,
17
+ * no `user_details`, roles not determinable, or an empty `roles` array → not
18
+ * rendered.
19
+ */
2
20
  export async function SignedIn({
3
- children
21
+ children,
22
+ roles
4
23
  }) {
24
+ if (roles) return (await sessionHasAnyRole(roles)) ? children : null;
5
25
  return (await checkHasSession()) ? children : null;
6
26
  }
27
+
28
+ /**
29
+ * Renders `children` only when there is no signed-in session.
30
+ *
31
+ * Dynamic RSC (reads `cookies()`); under `cacheComponents`, mount inside a `<Suspense>` boundary. See the auth README.
32
+ *
33
+ * With `roles`, this is the inverse of `SignedIn roles`: renders when the
34
+ * session does NOT carry any of the given roles — i.e. no session at all, or a
35
+ * session lacking every listed role. An empty `roles` array always renders.
36
+ */
7
37
  export async function SignedOut({
8
- children
38
+ children,
39
+ roles
9
40
  }) {
41
+ if (roles) return (await sessionHasAnyRole(roles)) ? null : children;
10
42
  return (await checkHasSession()) ? null : children;
11
43
  }
12
44
  //# sourceMappingURL=session-gates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"session-gates.js","names":["checkHasSession","SignedIn","children","SignedOut"],"sources":["../../../src/auth/internal/session-gates.tsx"],"sourcesContent":["import { checkHasSession } from './has-session';\n\ninterface SessionGateProps {\n children: React.ReactNode;\n}\n\nexport async function SignedIn({ children }: SessionGateProps) {\n return (await checkHasSession()) ? children : null;\n}\n\nexport async function SignedOut({ children }: SessionGateProps) {\n return (await checkHasSession()) ? null : children;\n}\n"],"mappings":"AAAA,SAASA,eAAe,QAAQ,eAAe;AAM/C,OAAO,eAAeC,QAAQA,CAAC;EAAEC;AAA2B,CAAC,EAAE;EAC7D,OAAO,CAAC,MAAMF,eAAe,CAAC,CAAC,IAAIE,QAAQ,GAAG,IAAI;AACpD;AAEA,OAAO,eAAeC,SAASA,CAAC;EAAED;AAA2B,CAAC,EAAE;EAC9D,OAAO,CAAC,MAAMF,eAAe,CAAC,CAAC,IAAI,IAAI,GAAGE,QAAQ;AACpD","ignoreList":[]}
1
+ {"version":3,"file":"session-gates.js","names":["checkHasSession","getUserRoles","hasAnyRole","sessionHasAnyRole","roles","length","SignedIn","children","SignedOut"],"sources":["../../../src/auth/internal/session-gates.tsx"],"sourcesContent":["import { checkHasSession } from './has-session.ts';\nimport { getUserRoles, hasAnyRole } from './roles.ts';\n\ninterface SessionGateProps {\n children: React.ReactNode;\n /**\n * Drupal roles to gate on. Matching is any-of: the session needs at least one\n * of them. UI-gating only — real authorization lives in Drupal.\n */\n roles?: string[];\n}\n\nasync function sessionHasAnyRole(roles: string[]): Promise<boolean> {\n if (roles.length === 0) return false;\n if (!(await checkHasSession())) return false;\n return hasAnyRole(await getUserRoles(), roles);\n}\n\n/**\n * Renders `children` only for a signed-in session.\n *\n * Dynamic RSC (reads `cookies()`); under `cacheComponents`, mount inside a `<Suspense>` boundary. See the auth README.\n *\n * With `roles`, gates on the session's Drupal roles instead of mere presence:\n * renders only when the session carries at least one of the given roles\n * (any-of, matching the draft-mode role semantic). Fails closed — no session,\n * no `user_details`, roles not determinable, or an empty `roles` array → not\n * rendered.\n */\nexport async function SignedIn({ children, roles }: SessionGateProps) {\n if (roles) return (await sessionHasAnyRole(roles)) ? children : null;\n return (await checkHasSession()) ? children : null;\n}\n\n/**\n * Renders `children` only when there is no signed-in session.\n *\n * Dynamic RSC (reads `cookies()`); under `cacheComponents`, mount inside a `<Suspense>` boundary. See the auth README.\n *\n * With `roles`, this is the inverse of `SignedIn roles`: renders when the\n * session does NOT carry any of the given roles — i.e. no session at all, or a\n * session lacking every listed role. An empty `roles` array always renders.\n */\nexport async function SignedOut({ children, roles }: SessionGateProps) {\n if (roles) return (await sessionHasAnyRole(roles)) ? null : children;\n return (await checkHasSession()) ? null : children;\n}\n"],"mappings":"AAAA,SAASA,eAAe,QAAQ,kBAAkB;AAClD,SAASC,YAAY,EAAEC,UAAU,QAAQ,YAAY;AAWrD,eAAeC,iBAAiBA,CAACC,KAAe,EAAoB;EAClE,IAAIA,KAAK,CAACC,MAAM,KAAK,CAAC,EAAE,OAAO,KAAK;EACpC,IAAI,EAAE,MAAML,eAAe,CAAC,CAAC,CAAC,EAAE,OAAO,KAAK;EAC5C,OAAOE,UAAU,CAAC,MAAMD,YAAY,CAAC,CAAC,EAAEG,KAAK,CAAC;AAChD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeE,QAAQA,CAAC;EAAEC,QAAQ;EAAEH;AAAwB,CAAC,EAAE;EACpE,IAAIA,KAAK,EAAE,OAAO,CAAC,MAAMD,iBAAiB,CAACC,KAAK,CAAC,IAAIG,QAAQ,GAAG,IAAI;EACpE,OAAO,CAAC,MAAMP,eAAe,CAAC,CAAC,IAAIO,QAAQ,GAAG,IAAI;AACpD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,SAASA,CAAC;EAAED,QAAQ;EAAEH;AAAwB,CAAC,EAAE;EACrE,IAAIA,KAAK,EAAE,OAAO,CAAC,MAAMD,iBAAiB,CAACC,KAAK,CAAC,IAAI,IAAI,GAAGG,QAAQ;EACpE,OAAO,CAAC,MAAMP,eAAe,CAAC,CAAC,IAAI,IAAI,GAAGO,QAAQ;AACpD","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import type { NextRequest, NextResponse } from 'next/server';
2
- import type { NodeHiveAuthConfig } from './config';
2
+ import type { NodeHiveAuthConfig } from './config.js';
3
3
  export interface UpdateSessionResult {
4
4
  /** Refresh token invalid/expired — caller must clear cookies and start a fresh
5
5
  * login. Caller builds the response (401 for /api, redirect for pages). */
@@ -14,4 +14,3 @@ export interface UpdateSessionResult {
14
14
  * isApi + the public origin, which are proxy.ts's concern.
15
15
  */
16
16
  export declare function updateSession(request: NextRequest, response: NextResponse, config: NodeHiveAuthConfig): Promise<UpdateSessionResult>;
17
- //# sourceMappingURL=update-session.d.ts.map
@@ -1,4 +1,4 @@
1
- import { isAuthFailure, refreshSession, shouldRefreshSession } from './refresh';
1
+ import { isAuthFailure, refreshSession, shouldRefreshSession } from "./refresh.js";
2
2
  /**
3
3
  * Silent token refresh for the middleware (Supabase `updateSession` pattern).
4
4
  * Owns the prefetch shortcut + shouldRefresh decision. Mutates request.cookies
@@ -1 +1 @@
1
- {"version":3,"file":"update-session.js","names":["isAuthFailure","refreshSession","shouldRefreshSession","updateSession","request","response","config","headers","get","authFailed","error","console","warn"],"sources":["../../../src/auth/internal/update-session.ts"],"sourcesContent":["import type { NextRequest, NextResponse } from 'next/server';\n\nimport type { NodeHiveAuthConfig } from './config';\nimport { isAuthFailure, refreshSession, shouldRefreshSession } from './refresh';\n\nexport interface UpdateSessionResult {\n /** Refresh token invalid/expired — caller must clear cookies and start a fresh\n * login. Caller builds the response (401 for /api, redirect for pages). */\n authFailed: boolean;\n}\n\n/**\n * Silent token refresh for the middleware (Supabase `updateSession` pattern).\n * Owns the prefetch shortcut + shouldRefresh decision. Mutates request.cookies\n * and sets Set-Cookie on `response` (caller must create it with `{ request }`).\n *\n * Returns authFailed as DATA, not a response: the 401-vs-redirect choice needs\n * isApi + the public origin, which are proxy.ts's concern.\n */\nexport async function updateSession(\n request: NextRequest,\n response: NextResponse,\n config: NodeHiveAuthConfig\n): Promise<UpdateSessionResult> {\n // A Next prefetch must never consume the single-use refresh token.\n if (request.headers.get('next-router-prefetch') === '1') {\n return { authFailed: false };\n }\n\n if (!shouldRefreshSession(request)) {\n return { authFailed: false };\n }\n\n try {\n await refreshSession(request, response, config);\n return { authFailed: false };\n } catch (error) {\n if (isAuthFailure(error)) {\n return { authFailed: true };\n }\n\n console.warn(\n '[nodehive-auth] Token refresh failed (transient), keeping session:',\n error\n );\n return { authFailed: false };\n }\n}\n"],"mappings":"AAGA,SAASA,aAAa,EAAEC,cAAc,EAAEC,oBAAoB,QAAQ,WAAW;AAQ/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,aAAaA,CACjCC,OAAoB,EACpBC,QAAsB,EACtBC,MAA0B,EACI;EAC9B;EACA,IAAIF,OAAO,CAACG,OAAO,CAACC,GAAG,CAAC,sBAAsB,CAAC,KAAK,GAAG,EAAE;IACvD,OAAO;MAAEC,UAAU,EAAE;IAAM,CAAC;EAC9B;EAEA,IAAI,CAACP,oBAAoB,CAACE,OAAO,CAAC,EAAE;IAClC,OAAO;MAAEK,UAAU,EAAE;IAAM,CAAC;EAC9B;EAEA,IAAI;IACF,MAAMR,cAAc,CAACG,OAAO,EAAEC,QAAQ,EAAEC,MAAM,CAAC;IAC/C,OAAO;MAAEG,UAAU,EAAE;IAAM,CAAC;EAC9B,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd,IAAIV,aAAa,CAACU,KAAK,CAAC,EAAE;MACxB,OAAO;QAAED,UAAU,EAAE;MAAK,CAAC;IAC7B;IAEAE,OAAO,CAACC,IAAI,CACV,oEAAoE,EACpEF,KACF,CAAC;IACD,OAAO;MAAED,UAAU,EAAE;IAAM,CAAC;EAC9B;AACF","ignoreList":[]}
1
+ {"version":3,"file":"update-session.js","names":["isAuthFailure","refreshSession","shouldRefreshSession","updateSession","request","response","config","headers","get","authFailed","error","console","warn"],"sources":["../../../src/auth/internal/update-session.ts"],"sourcesContent":["import type { NextRequest, NextResponse } from 'next/server';\n\nimport type { NodeHiveAuthConfig } from './config.ts';\nimport {\n isAuthFailure,\n refreshSession,\n shouldRefreshSession,\n} from './refresh.ts';\n\nexport interface UpdateSessionResult {\n /** Refresh token invalid/expired — caller must clear cookies and start a fresh\n * login. Caller builds the response (401 for /api, redirect for pages). */\n authFailed: boolean;\n}\n\n/**\n * Silent token refresh for the middleware (Supabase `updateSession` pattern).\n * Owns the prefetch shortcut + shouldRefresh decision. Mutates request.cookies\n * and sets Set-Cookie on `response` (caller must create it with `{ request }`).\n *\n * Returns authFailed as DATA, not a response: the 401-vs-redirect choice needs\n * isApi + the public origin, which are proxy.ts's concern.\n */\nexport async function updateSession(\n request: NextRequest,\n response: NextResponse,\n config: NodeHiveAuthConfig\n): Promise<UpdateSessionResult> {\n // A Next prefetch must never consume the single-use refresh token.\n if (request.headers.get('next-router-prefetch') === '1') {\n return { authFailed: false };\n }\n\n if (!shouldRefreshSession(request)) {\n return { authFailed: false };\n }\n\n try {\n await refreshSession(request, response, config);\n return { authFailed: false };\n } catch (error) {\n if (isAuthFailure(error)) {\n return { authFailed: true };\n }\n\n console.warn(\n '[nodehive-auth] Token refresh failed (transient), keeping session:',\n error\n );\n return { authFailed: false };\n }\n}\n"],"mappings":"AAGA,SACEA,aAAa,EACbC,cAAc,EACdC,oBAAoB,QACf,cAAc;AAQrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,aAAaA,CACjCC,OAAoB,EACpBC,QAAsB,EACtBC,MAA0B,EACI;EAC9B;EACA,IAAIF,OAAO,CAACG,OAAO,CAACC,GAAG,CAAC,sBAAsB,CAAC,KAAK,GAAG,EAAE;IACvD,OAAO;MAAEC,UAAU,EAAE;IAAM,CAAC;EAC9B;EAEA,IAAI,CAACP,oBAAoB,CAACE,OAAO,CAAC,EAAE;IAClC,OAAO;MAAEK,UAAU,EAAE;IAAM,CAAC;EAC9B;EAEA,IAAI;IACF,MAAMR,cAAc,CAACG,OAAO,EAAEC,QAAQ,EAAEC,MAAM,CAAC;IAC/C,OAAO;MAAEG,UAAU,EAAE;IAAM,CAAC;EAC9B,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd,IAAIV,aAAa,CAACU,KAAK,CAAC,EAAE;MACxB,OAAO;QAAED,UAAU,EAAE;MAAK,CAAC;IAC7B;IAEAE,OAAO,CAACC,IAAI,CACV,oEAAoE,EACpEF,KACF,CAAC;IACD,OAAO;MAAED,UAAU,EAAE;IAAM,CAAC;EAC9B;AACF","ignoreList":[]}
@@ -30,4 +30,3 @@ export declare function consumeJustLoggedIn(): boolean;
30
30
  * for browsers that can't read the partitioned cookie (Safari 18.5–26.1, older).
31
31
  */
32
32
  export declare function useEditorLogin(authenticated: boolean, options?: UseEditorLoginOptions): EditorLogin;
33
- //# sourceMappingURL=use-editor-login.d.ts.map
@@ -1,6 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { useEffect, useRef, useState } from 'react';
4
+ import { isAuthDoneFrom } from "../../bridge-protocol/index.js";
4
5
  // Set before a CHIPS reload so that, if we land back here still unauthenticated
5
6
  // (the browser dropped the partitioned cookie, e.g. Safari < 26.2), we fall
6
7
  // through to the storage-access step instead of looping on the login step.
@@ -67,9 +68,7 @@ export function useEditorLogin(authenticated, options) {
67
68
  const onMessage = event => {
68
69
  // Only accept the message from the popup we opened (origin alone would let
69
70
  // any same-origin window forge an auth-done with an attacker's handoff).
70
- if (event.origin !== window.location.origin) return;
71
- if (event.source !== popupRef.current) return;
72
- if (event.data?.type !== 'nh:auth-done') return;
71
+ if (!isAuthDoneFrom(event, window.location.origin, popupRef.current)) return;
73
72
  const handoff = event.data.handoff;
74
73
  void (async () => {
75
74
  // CHIPS path: exchange the handoff so the iframe mints partitioned
@@ -1 +1 @@
1
- {"version":3,"file":"use-editor-login.js","names":["useEffect","useRef","useState","CHIPS_TRIED_KEY","JUST_LOGGED_IN_KEY","markJustLoggedIn","sessionStorage","setItem","consumeJustLoggedIn","getItem","removeItem","useEditorLogin","authenticated","options","loginPath","popupReturnTo","chipsExchangePath","inIframe","setInIframe","phase","setPhase","error","setError","popupRef","embedded","window","self","top","onMessage","event","origin","location","source","current","data","type","handoff","res","fetch","method","headers","body","JSON","stringify","ok","reload","document","hasStorageAccess","addEventListener","removeEventListener","signIn","open","encodeURIComponent","activate","requestStorageAccess"],"sources":["../../../src/auth/internal/use-editor-login.ts"],"sourcesContent":["'use client';\n\nimport { useEffect, useRef, useState } from 'react';\n\nexport type EditorLoginPhase = 'login' | 'activate' | 'working';\n\nexport interface UseEditorLoginOptions {\n /** OAuth login route. Default '/api/auth/login'. */\n loginPath?: string;\n /** Popup landing that relays the CHIPS handoff. Default '/api/auth/popup-done'. */\n popupReturnTo?: string;\n /** CHIPS exchange route. Default '/api/auth/chips-exchange'. */\n chipsExchangePath?: string;\n}\n\nexport interface EditorLogin {\n /** null until measured on mount; false when not embedded in an iframe. */\n inIframe: boolean | null;\n phase: EditorLoginPhase;\n /** Storage-access activation failed — render your own error copy. */\n error: boolean;\n /** Open the OAuth login popup (the `login` step). */\n signIn: () => void;\n /** Request storage access then reload (the `activate` fallback step). */\n activate: () => Promise<void>;\n}\n\n// Set before a CHIPS reload so that, if we land back here still unauthenticated\n// (the browser dropped the partitioned cookie, e.g. Safari < 26.2), we fall\n// through to the storage-access step instead of looping on the login step.\nconst CHIPS_TRIED_KEY = 'nh:chips-tried';\n\n// Set right before a post-login reload so the banner can show a success toast\n// once the page comes back (a toast fired before the reload wouldn't survive it).\nconst JUST_LOGGED_IN_KEY = 'nh:just-logged-in';\n\nfunction markJustLoggedIn() {\n try {\n sessionStorage.setItem(JUST_LOGGED_IN_KEY, '1');\n } catch {\n // sessionStorage unavailable — no toast, login still works\n }\n}\n\n/** Read and clear the \"just logged in\" flag set before a post-login reload. */\nexport function consumeJustLoggedIn(): boolean {\n try {\n if (!sessionStorage.getItem(JUST_LOGGED_IN_KEY)) return false;\n sessionStorage.removeItem(JUST_LOGGED_IN_KEY);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Client flow for the cross-site editor-iframe login (CHIPS). Headless — render\n * your own banner from the returned state. Pair with `createAuthRouteHandlers`\n * (login / popup-done / chips-exchange) on the server.\n *\n * Single click where CHIPS / partitioned cookies work (Chromium 114+, Safari\n * 26.2+ and 18.4, Firefox). The `activate` (Storage Access) step is the fallback\n * for browsers that can't read the partitioned cookie (Safari 18.5–26.1, older).\n */\nexport function useEditorLogin(\n authenticated: boolean,\n options?: UseEditorLoginOptions\n): EditorLogin {\n const loginPath = options?.loginPath ?? '/api/auth/login';\n const popupReturnTo = options?.popupReturnTo ?? '/api/auth/popup-done';\n const chipsExchangePath =\n options?.chipsExchangePath ?? '/api/auth/chips-exchange';\n\n const [inIframe, setInIframe] = useState<boolean | null>(null);\n const [phase, setPhase] = useState<EditorLoginPhase>('login');\n const [error, setError] = useState(false);\n const popupRef = useRef<Window | null>(null);\n\n useEffect(() => {\n const embedded = window.self !== window.top;\n // Measured post-mount (not a lazy initializer) so SSR and the first client\n // render agree on `null` — reading window during render would risk a\n // hydration mismatch.\n // eslint-disable-next-line react-hooks/set-state-in-effect -- SSR-safe iframe detection\n setInIframe(embedded);\n if (!embedded) return;\n\n // Back here after a CHIPS exchange that didn't stick → go straight to the\n // storage-access step rather than re-prompting a full login.\n try {\n if (sessionStorage.getItem(CHIPS_TRIED_KEY)) {\n sessionStorage.removeItem(CHIPS_TRIED_KEY);\n if (!authenticated) setPhase('activate');\n }\n } catch {\n // sessionStorage unavailable — stay on the login step\n }\n\n const onMessage = (event: MessageEvent) => {\n // Only accept the message from the popup we opened (origin alone would let\n // any same-origin window forge an auth-done with an attacker's handoff).\n if (event.origin !== window.location.origin) return;\n if (event.source !== popupRef.current) return;\n if (event.data?.type !== 'nh:auth-done') return;\n const handoff: string | undefined = event.data.handoff;\n void (async () => {\n // CHIPS path: exchange the handoff so the iframe mints partitioned\n // cookies in its own partition → 1 click where CHIPS is supported.\n if (handoff) {\n try {\n const res = await fetch(chipsExchangePath, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ handoff }),\n });\n if (res.ok) {\n try {\n sessionStorage.setItem(CHIPS_TRIED_KEY, '1');\n } catch {\n // ignore — fallback just won't auto-trigger\n }\n markJustLoggedIn();\n window.location.reload();\n return;\n }\n } catch {\n // fall through to storage access\n }\n }\n try {\n if (\n document.hasStorageAccess &&\n (await document.hasStorageAccess())\n ) {\n markJustLoggedIn();\n window.location.reload();\n return;\n }\n } catch {\n // fall through to the gesture step\n }\n setPhase('activate');\n })();\n };\n window.addEventListener('message', onMessage);\n return () => window.removeEventListener('message', onMessage);\n }, [authenticated, chipsExchangePath]);\n\n const signIn = () => {\n setError(false);\n popupRef.current = window.open(\n `${loginPath}?returnTo=${encodeURIComponent(popupReturnTo)}`,\n 'nh_editor_login',\n 'width=520,height=720'\n );\n };\n\n const activate = async () => {\n setError(false);\n setPhase('working');\n try {\n if (document.requestStorageAccess) {\n await document.requestStorageAccess();\n }\n markJustLoggedIn();\n window.location.reload();\n } catch {\n setError(true);\n setPhase('activate');\n }\n };\n\n return { inIframe, phase, error, signIn, activate };\n}\n"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"file":"use-editor-login.js","names":["useEffect","useRef","useState","isAuthDoneFrom","CHIPS_TRIED_KEY","JUST_LOGGED_IN_KEY","markJustLoggedIn","sessionStorage","setItem","consumeJustLoggedIn","getItem","removeItem","useEditorLogin","authenticated","options","loginPath","popupReturnTo","chipsExchangePath","inIframe","setInIframe","phase","setPhase","error","setError","popupRef","embedded","window","self","top","onMessage","event","location","origin","current","handoff","data","res","fetch","method","headers","body","JSON","stringify","ok","reload","document","hasStorageAccess","addEventListener","removeEventListener","signIn","open","encodeURIComponent","activate","requestStorageAccess"],"sources":["../../../src/auth/internal/use-editor-login.ts"],"sourcesContent":["'use client';\n\nimport { useEffect, useRef, useState } from 'react';\n\nimport { isAuthDoneFrom } from '../../bridge-protocol/index.ts';\n\nexport type EditorLoginPhase = 'login' | 'activate' | 'working';\n\nexport interface UseEditorLoginOptions {\n /** OAuth login route. Default '/api/auth/login'. */\n loginPath?: string;\n /** Popup landing that relays the CHIPS handoff. Default '/api/auth/popup-done'. */\n popupReturnTo?: string;\n /** CHIPS exchange route. Default '/api/auth/chips-exchange'. */\n chipsExchangePath?: string;\n}\n\nexport interface EditorLogin {\n /** null until measured on mount; false when not embedded in an iframe. */\n inIframe: boolean | null;\n phase: EditorLoginPhase;\n /** Storage-access activation failed — render your own error copy. */\n error: boolean;\n /** Open the OAuth login popup (the `login` step). */\n signIn: () => void;\n /** Request storage access then reload (the `activate` fallback step). */\n activate: () => Promise<void>;\n}\n\n// Set before a CHIPS reload so that, if we land back here still unauthenticated\n// (the browser dropped the partitioned cookie, e.g. Safari < 26.2), we fall\n// through to the storage-access step instead of looping on the login step.\nconst CHIPS_TRIED_KEY = 'nh:chips-tried';\n\n// Set right before a post-login reload so the banner can show a success toast\n// once the page comes back (a toast fired before the reload wouldn't survive it).\nconst JUST_LOGGED_IN_KEY = 'nh:just-logged-in';\n\nfunction markJustLoggedIn() {\n try {\n sessionStorage.setItem(JUST_LOGGED_IN_KEY, '1');\n } catch {\n // sessionStorage unavailable — no toast, login still works\n }\n}\n\n/** Read and clear the \"just logged in\" flag set before a post-login reload. */\nexport function consumeJustLoggedIn(): boolean {\n try {\n if (!sessionStorage.getItem(JUST_LOGGED_IN_KEY)) return false;\n sessionStorage.removeItem(JUST_LOGGED_IN_KEY);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Client flow for the cross-site editor-iframe login (CHIPS). Headless — render\n * your own banner from the returned state. Pair with `createAuthRouteHandlers`\n * (login / popup-done / chips-exchange) on the server.\n *\n * Single click where CHIPS / partitioned cookies work (Chromium 114+, Safari\n * 26.2+ and 18.4, Firefox). The `activate` (Storage Access) step is the fallback\n * for browsers that can't read the partitioned cookie (Safari 18.5–26.1, older).\n */\nexport function useEditorLogin(\n authenticated: boolean,\n options?: UseEditorLoginOptions\n): EditorLogin {\n const loginPath = options?.loginPath ?? '/api/auth/login';\n const popupReturnTo = options?.popupReturnTo ?? '/api/auth/popup-done';\n const chipsExchangePath =\n options?.chipsExchangePath ?? '/api/auth/chips-exchange';\n\n const [inIframe, setInIframe] = useState<boolean | null>(null);\n const [phase, setPhase] = useState<EditorLoginPhase>('login');\n const [error, setError] = useState(false);\n const popupRef = useRef<Window | null>(null);\n\n useEffect(() => {\n const embedded = window.self !== window.top;\n // Measured post-mount (not a lazy initializer) so SSR and the first client\n // render agree on `null` — reading window during render would risk a\n // hydration mismatch.\n // eslint-disable-next-line react-hooks/set-state-in-effect -- SSR-safe iframe detection\n setInIframe(embedded);\n if (!embedded) return;\n\n // Back here after a CHIPS exchange that didn't stick → go straight to the\n // storage-access step rather than re-prompting a full login.\n try {\n if (sessionStorage.getItem(CHIPS_TRIED_KEY)) {\n sessionStorage.removeItem(CHIPS_TRIED_KEY);\n if (!authenticated) setPhase('activate');\n }\n } catch {\n // sessionStorage unavailable — stay on the login step\n }\n\n const onMessage = (event: MessageEvent) => {\n // Only accept the message from the popup we opened (origin alone would let\n // any same-origin window forge an auth-done with an attacker's handoff).\n if (!isAuthDoneFrom(event, window.location.origin, popupRef.current))\n return;\n const handoff: string | undefined = event.data.handoff;\n void (async () => {\n // CHIPS path: exchange the handoff so the iframe mints partitioned\n // cookies in its own partition → 1 click where CHIPS is supported.\n if (handoff) {\n try {\n const res = await fetch(chipsExchangePath, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ handoff }),\n });\n if (res.ok) {\n try {\n sessionStorage.setItem(CHIPS_TRIED_KEY, '1');\n } catch {\n // ignore — fallback just won't auto-trigger\n }\n markJustLoggedIn();\n window.location.reload();\n return;\n }\n } catch {\n // fall through to storage access\n }\n }\n try {\n if (\n document.hasStorageAccess &&\n (await document.hasStorageAccess())\n ) {\n markJustLoggedIn();\n window.location.reload();\n return;\n }\n } catch {\n // fall through to the gesture step\n }\n setPhase('activate');\n })();\n };\n window.addEventListener('message', onMessage);\n return () => window.removeEventListener('message', onMessage);\n }, [authenticated, chipsExchangePath]);\n\n const signIn = () => {\n setError(false);\n popupRef.current = window.open(\n `${loginPath}?returnTo=${encodeURIComponent(popupReturnTo)}`,\n 'nh_editor_login',\n 'width=520,height=720'\n );\n };\n\n const activate = async () => {\n setError(false);\n setPhase('working');\n try {\n if (document.requestStorageAccess) {\n await document.requestStorageAccess();\n }\n markJustLoggedIn();\n window.location.reload();\n } catch {\n setError(true);\n setPhase('activate');\n }\n };\n\n return { inIframe, phase, error, signIn, activate };\n}\n"],"mappings":"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","ignoreList":[]}
@@ -1,8 +1,7 @@
1
- export { authFailedResponse, csrfGuard } from './internal/proxy-helpers';
2
- export { clearAuthCookies } from './internal/refresh';
3
- export { getRequestOrigin } from './internal/oauth-config';
4
- export { isSameOriginRequest } from './internal/same-origin';
5
- export { validateReturnTo } from './internal/return-to';
6
- export { updateSession, type UpdateSessionResult, } from './internal/update-session';
7
- export type { NodeHiveAuthConfig } from './internal/config';
8
- //# sourceMappingURL=proxy.d.ts.map
1
+ export { authFailedResponse, csrfGuard } from './internal/proxy-helpers.js';
2
+ export { clearAuthCookies } from './internal/refresh.js';
3
+ export { getRequestOrigin } from './internal/oauth-config.js';
4
+ export { isSameOriginRequest } from './internal/same-origin.js';
5
+ export { validateReturnTo } from './internal/return-to.js';
6
+ export { updateSession, type UpdateSessionResult, } from './internal/update-session.js';
7
+ export type { NodeHiveAuthConfig } from './internal/config.js';
@@ -1,8 +1,8 @@
1
1
  // Middleware-facing entry (src/proxy.ts): silent refresh + request helpers.
2
- export { authFailedResponse, csrfGuard } from './internal/proxy-helpers';
3
- export { clearAuthCookies } from './internal/refresh';
4
- export { getRequestOrigin } from './internal/oauth-config';
5
- export { isSameOriginRequest } from './internal/same-origin';
6
- export { validateReturnTo } from './internal/return-to';
7
- export { updateSession } from './internal/update-session';
2
+ export { authFailedResponse, csrfGuard } from "./internal/proxy-helpers.js";
3
+ export { clearAuthCookies } from "./internal/refresh.js";
4
+ export { getRequestOrigin } from "./internal/oauth-config.js";
5
+ export { isSameOriginRequest } from "./internal/same-origin.js";
6
+ export { validateReturnTo } from "./internal/return-to.js";
7
+ export { updateSession } from "./internal/update-session.js";
8
8
  //# sourceMappingURL=proxy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"proxy.js","names":["authFailedResponse","csrfGuard","clearAuthCookies","getRequestOrigin","isSameOriginRequest","validateReturnTo","updateSession"],"sources":["../../src/auth/proxy.ts"],"sourcesContent":["// Middleware-facing entry (src/proxy.ts): silent refresh + request helpers.\nexport { authFailedResponse, csrfGuard } from './internal/proxy-helpers';\nexport { clearAuthCookies } from './internal/refresh';\nexport { getRequestOrigin } from './internal/oauth-config';\nexport { isSameOriginRequest } from './internal/same-origin';\nexport { validateReturnTo } from './internal/return-to';\nexport {\n updateSession,\n type UpdateSessionResult,\n} from './internal/update-session';\nexport type { NodeHiveAuthConfig } from './internal/config';\n"],"mappings":"AAAA;AACA,SAASA,kBAAkB,EAAEC,SAAS,QAAQ,0BAA0B;AACxE,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,gBAAgB,QAAQ,yBAAyB;AAC1D,SAASC,mBAAmB,QAAQ,wBAAwB;AAC5D,SAASC,gBAAgB,QAAQ,sBAAsB;AACvD,SACEC,aAAa,QAER,2BAA2B","ignoreList":[]}
1
+ {"version":3,"file":"proxy.js","names":["authFailedResponse","csrfGuard","clearAuthCookies","getRequestOrigin","isSameOriginRequest","validateReturnTo","updateSession"],"sources":["../../src/auth/proxy.ts"],"sourcesContent":["// Middleware-facing entry (src/proxy.ts): silent refresh + request helpers.\nexport { authFailedResponse, csrfGuard } from './internal/proxy-helpers.ts';\nexport { clearAuthCookies } from './internal/refresh.ts';\nexport { getRequestOrigin } from './internal/oauth-config.ts';\nexport { isSameOriginRequest } from './internal/same-origin.ts';\nexport { validateReturnTo } from './internal/return-to.ts';\nexport {\n updateSession,\n type UpdateSessionResult,\n} from './internal/update-session.ts';\nexport type { NodeHiveAuthConfig } from './internal/config.ts';\n"],"mappings":"AAAA;AACA,SAASA,kBAAkB,EAAEC,SAAS,QAAQ,6BAA6B;AAC3E,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,mBAAmB,QAAQ,2BAA2B;AAC/D,SAASC,gBAAgB,QAAQ,yBAAyB;AAC1D,SACEC,aAAa,QAER,8BAA8B","ignoreList":[]}
@@ -1,2 +1 @@
1
- export { useEditorLogin, consumeJustLoggedIn, type EditorLogin, type EditorLoginPhase, type UseEditorLoginOptions, } from './internal/use-editor-login';
2
- //# sourceMappingURL=react.d.ts.map
1
+ export { useEditorLogin, consumeJustLoggedIn, type EditorLogin, type EditorLoginPhase, type UseEditorLoginOptions, } from './internal/use-editor-login.js';
@@ -1,3 +1,3 @@
1
1
  // Client (React) entry — hooks for browser-side auth flows.
2
- export { useEditorLogin, consumeJustLoggedIn } from './internal/use-editor-login';
2
+ export { useEditorLogin, consumeJustLoggedIn } from "./internal/use-editor-login.js";
3
3
  //# sourceMappingURL=react.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"react.js","names":["useEditorLogin","consumeJustLoggedIn"],"sources":["../../src/auth/react.ts"],"sourcesContent":["// Client (React) entry — hooks for browser-side auth flows.\nexport {\n useEditorLogin,\n consumeJustLoggedIn,\n type EditorLogin,\n type EditorLoginPhase,\n type UseEditorLoginOptions,\n} from './internal/use-editor-login';\n"],"mappings":"AAAA;AACA,SACEA,cAAc,EACdC,mBAAmB,QAId,6BAA6B","ignoreList":[]}
1
+ {"version":3,"file":"react.js","names":["useEditorLogin","consumeJustLoggedIn"],"sources":["../../src/auth/react.ts"],"sourcesContent":["// Client (React) entry — hooks for browser-side auth flows.\nexport {\n useEditorLogin,\n consumeJustLoggedIn,\n type EditorLogin,\n type EditorLoginPhase,\n type UseEditorLoginOptions,\n} from './internal/use-editor-login.ts';\n"],"mappings":"AAAA;AACA,SACEA,cAAc,EACdC,mBAAmB,QAId,gCAAgC","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- export { createAuthRouteHandlers, type AuthRouteOptions, } from './internal/routes';
2
- export type { NodeHiveAuthConfig } from './internal/config';
3
- //# sourceMappingURL=routes.d.ts.map
1
+ export { createAuthRouteHandlers, type AuthRouteOptions, } from './internal/routes/index.js';
2
+ export type { AuthDictionaryOverrides } from './internal/i18n.js';
3
+ export type { NodeHiveAuthConfig } from './internal/config.js';
@@ -1,3 +1,3 @@
1
1
  // Route-handler entry: the OAuth catch-all factory.
2
- export { createAuthRouteHandlers } from './internal/routes';
2
+ export { createAuthRouteHandlers } from "./internal/routes/index.js";
3
3
  //# sourceMappingURL=routes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"routes.js","names":["createAuthRouteHandlers"],"sources":["../../src/auth/routes.ts"],"sourcesContent":["// Route-handler entry: the OAuth catch-all factory.\nexport {\n createAuthRouteHandlers,\n type AuthRouteOptions,\n} from './internal/routes';\nexport type { NodeHiveAuthConfig } from './internal/config';\n"],"mappings":"AAAA;AACA,SACEA,uBAAuB,QAElB,mBAAmB","ignoreList":[]}
1
+ {"version":3,"file":"routes.js","names":["createAuthRouteHandlers"],"sources":["../../src/auth/routes.ts"],"sourcesContent":["// Route-handler entry: the OAuth catch-all factory.\nexport {\n createAuthRouteHandlers,\n type AuthRouteOptions,\n} from './internal/routes/index.ts';\nexport type { AuthDictionaryOverrides } from './internal/i18n.ts';\nexport type { NodeHiveAuthConfig } from './internal/config.ts';\n"],"mappings":"AAAA;AACA,SACEA,uBAAuB,QAElB,4BAA4B","ignoreList":[]}
@@ -1,7 +1,7 @@
1
- import type { NodeHiveAuthConfig } from './internal/config';
2
- import { checkHasSession } from './internal/has-session';
3
- import { type PerformLogoutOptions } from './internal/logout';
4
- import { type ProxyContext } from './internal/next-cookie-storage';
1
+ import type { NodeHiveAuthConfig } from './internal/config.js';
2
+ import { checkHasSession } from './internal/has-session.js';
3
+ import { type PerformLogoutOptions } from './internal/logout.js';
4
+ import { type ProxyContext } from './internal/next-cookie-storage.js';
5
5
  /**
6
6
  * Bind the client factories + logout to a project config (explicit injection,
7
7
  * no global singleton). Call once in the project and re-export the result.
@@ -13,11 +13,13 @@ export declare function createNodeHiveAuth(config: NodeHiveAuthConfig): {
13
13
  isAuthenticated: typeof checkHasSession;
14
14
  performLogout: (options?: PerformLogoutOptions) => Promise<void>;
15
15
  };
16
- export { getEditorLocale, resolveEditorLocale } from './internal/editor-locale';
17
- export { requireAuth } from './internal/require-auth';
18
- export { isSameOriginRequest } from './internal/same-origin';
19
- export { SignedIn, SignedOut } from './internal/session-gates';
20
- export type { NodeHiveAuthConfig } from './internal/config';
21
- export type { ProxyContext } from './internal/next-cookie-storage';
22
- export type { PerformLogoutOptions } from './internal/logout';
23
- //# sourceMappingURL=server.d.ts.map
16
+ export { shouldEnableDraftMode } from './internal/draft-mode.js';
17
+ export { checkHasSession } from './internal/has-session.js';
18
+ export { getEditorLocale, resolveEditorLocale, } from './internal/editor-locale.js';
19
+ export { requireAuth } from './internal/require-auth.js';
20
+ export { getUserRoles } from './internal/roles.js';
21
+ export { isSameOriginRequest } from './internal/same-origin.js';
22
+ export { SignedIn, SignedOut } from './internal/session-gates.js';
23
+ export type { NodeHiveAuthConfig } from './internal/config.js';
24
+ export type { ProxyContext } from './internal/next-cookie-storage.js';
25
+ export type { PerformLogoutOptions } from './internal/logout.js';
@@ -1,9 +1,9 @@
1
1
  // Server entry: client factories, editor guard, logout.
2
2
  import { cache } from 'react';
3
- import { checkHasSession } from './internal/has-session';
4
- import { performLogout } from './internal/logout';
5
- import { NextCookieStorage } from './internal/next-cookie-storage';
6
- import { buildAnonClient, buildUserClient } from './internal/nodehive-client';
3
+ import { checkHasSession } from "./internal/has-session.js";
4
+ import { performLogout } from "./internal/logout.js";
5
+ import { NextCookieStorage } from "./internal/next-cookie-storage.js";
6
+ import { buildAnonClient, buildUserClient } from "./internal/nodehive-client.js";
7
7
 
8
8
  /**
9
9
  * Bind the client factories + logout to a project config (explicit injection,
@@ -16,7 +16,9 @@ export function createNodeHiveAuth(config) {
16
16
  * session the client carries no token (it is NOT the anon client) — use it
17
17
  * only where a session is established or where you check isLoggedIn().
18
18
  */
19
- const createUserClient = proxyContext => buildUserClient(config, proxyContext);
19
+ const createUserClient = proxyContext => buildUserClient(config, proxyContext, {
20
+ preventSdkRefresh: !proxyContext
21
+ });
20
22
 
21
23
  /**
22
24
  * Deliberately act as an anonymous visitor (client_credentials, capped
@@ -54,8 +56,11 @@ export function createNodeHiveAuth(config) {
54
56
  performLogout: options => performLogout(config, options)
55
57
  };
56
58
  }
57
- export { getEditorLocale, resolveEditorLocale } from './internal/editor-locale';
58
- export { requireAuth } from './internal/require-auth';
59
- export { isSameOriginRequest } from './internal/same-origin';
60
- export { SignedIn, SignedOut } from './internal/session-gates';
59
+ export { shouldEnableDraftMode } from "./internal/draft-mode.js";
60
+ export { checkHasSession } from "./internal/has-session.js";
61
+ export { getEditorLocale, resolveEditorLocale } from "./internal/editor-locale.js";
62
+ export { requireAuth } from "./internal/require-auth.js";
63
+ export { getUserRoles } from "./internal/roles.js";
64
+ export { isSameOriginRequest } from "./internal/same-origin.js";
65
+ export { SignedIn, SignedOut } from "./internal/session-gates.js";
61
66
  //# sourceMappingURL=server.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","names":["cache","checkHasSession","performLogout","NextCookieStorage","buildAnonClient","buildUserClient","createNodeHiveAuth","config","createUserClient","proxyContext","anonClient","createAnonClient","createClient","storage","token","get","isAuthenticated","options","getEditorLocale","resolveEditorLocale","requireAuth","isSameOriginRequest","SignedIn","SignedOut"],"sources":["../../src/auth/server.ts"],"sourcesContent":["// Server entry: client factories, editor guard, logout.\nimport { cache } from 'react';\n\nimport type { NodeHiveAuthConfig } from './internal/config';\nimport { checkHasSession } from './internal/has-session';\nimport { performLogout, type PerformLogoutOptions } from './internal/logout';\nimport {\n NextCookieStorage,\n type ProxyContext,\n} from './internal/next-cookie-storage';\nimport { buildAnonClient, buildUserClient } from './internal/nodehive-client';\n\n/**\n * Bind the client factories + logout to a project config (explicit injection,\n * no global singleton). Call once in the project and re-export the result.\n */\nexport function createNodeHiveAuth(config: NodeHiveAuthConfig) {\n /**\n * Deliberately act as the logged-in user. Default: use createClient().\n * Binds to the request's session cookies but guarantees no user: without a\n * session the client carries no token (it is NOT the anon client) — use it\n * only where a session is established or where you check isLoggedIn().\n */\n const createUserClient = (proxyContext?: ProxyContext) =>\n buildUserClient(config, proxyContext);\n\n /**\n * Deliberately act as an anonymous visitor (client_credentials, capped\n * rights). Default: use createClient(). One instance per runtime since the\n * credential never rotates.\n */\n let anonClient: ReturnType<typeof buildAnonClient> | null = null;\n const createAnonClient = () => {\n if (anonClient) return anonClient;\n anonClient = buildAnonClient(config);\n return anonClient;\n };\n\n /**\n * The default client: user client when a usable access token is present,\n * else the anon client. Memoized per request via React cache().\n *\n * Checks the short-lived access token, not the refresh token: only the\n * proxy may refresh (rotated tokens can't be persisted from RSCs), so the\n * user client is only picked when a request-ready token exists. \"Is the\n * user logged in?\" is a different question — that's isAuthenticated, which\n * checks the durable refresh token.\n */\n const createClient = cache(async () => {\n const storage = new NextCookieStorage();\n const token = await storage.get('token');\n return token ? createUserClient() : createAnonClient();\n });\n\n const isAuthenticated = cache(checkHasSession);\n\n return {\n createClient,\n createUserClient,\n createAnonClient,\n isAuthenticated,\n performLogout: (options?: PerformLogoutOptions) =>\n performLogout(config, options),\n };\n}\n\nexport { getEditorLocale, resolveEditorLocale } from './internal/editor-locale';\nexport { requireAuth } from './internal/require-auth';\nexport { isSameOriginRequest } from './internal/same-origin';\nexport { SignedIn, SignedOut } from './internal/session-gates';\nexport type { NodeHiveAuthConfig } from './internal/config';\nexport type { ProxyContext } from './internal/next-cookie-storage';\nexport type { PerformLogoutOptions } from './internal/logout';\n"],"mappings":"AAAA;AACA,SAASA,KAAK,QAAQ,OAAO;AAG7B,SAASC,eAAe,QAAQ,wBAAwB;AACxD,SAASC,aAAa,QAAmC,mBAAmB;AAC5E,SACEC,iBAAiB,QAEZ,gCAAgC;AACvC,SAASC,eAAe,EAAEC,eAAe,QAAQ,4BAA4B;;AAE7E;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAACC,MAA0B,EAAE;EAC7D;AACF;AACA;AACA;AACA;AACA;EACE,MAAMC,gBAAgB,GAAIC,YAA2B,IACnDJ,eAAe,CAACE,MAAM,EAAEE,YAAY,CAAC;;EAEvC;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAqD,GAAG,IAAI;EAChE,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;IAC7B,IAAID,UAAU,EAAE,OAAOA,UAAU;IACjCA,UAAU,GAAGN,eAAe,CAACG,MAAM,CAAC;IACpC,OAAOG,UAAU;EACnB,CAAC;;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAME,YAAY,GAAGZ,KAAK,CAAC,YAAY;IACrC,MAAMa,OAAO,GAAG,IAAIV,iBAAiB,CAAC,CAAC;IACvC,MAAMW,KAAK,GAAG,MAAMD,OAAO,CAACE,GAAG,CAAC,OAAO,CAAC;IACxC,OAAOD,KAAK,GAAGN,gBAAgB,CAAC,CAAC,GAAGG,gBAAgB,CAAC,CAAC;EACxD,CAAC,CAAC;EAEF,MAAMK,eAAe,GAAGhB,KAAK,CAACC,eAAe,CAAC;EAE9C,OAAO;IACLW,YAAY;IACZJ,gBAAgB;IAChBG,gBAAgB;IAChBK,eAAe;IACfd,aAAa,EAAGe,OAA8B,IAC5Cf,aAAa,CAACK,MAAM,EAAEU,OAAO;EACjC,CAAC;AACH;AAEA,SAASC,eAAe,EAAEC,mBAAmB,QAAQ,0BAA0B;AAC/E,SAASC,WAAW,QAAQ,yBAAyB;AACrD,SAASC,mBAAmB,QAAQ,wBAAwB;AAC5D,SAASC,QAAQ,EAAEC,SAAS,QAAQ,0BAA0B","ignoreList":[]}
1
+ {"version":3,"file":"server.js","names":["cache","checkHasSession","performLogout","NextCookieStorage","buildAnonClient","buildUserClient","createNodeHiveAuth","config","createUserClient","proxyContext","preventSdkRefresh","anonClient","createAnonClient","createClient","storage","token","get","isAuthenticated","options","shouldEnableDraftMode","getEditorLocale","resolveEditorLocale","requireAuth","getUserRoles","isSameOriginRequest","SignedIn","SignedOut"],"sources":["../../src/auth/server.ts"],"sourcesContent":["// Server entry: client factories, editor guard, logout.\nimport { cache } from 'react';\n\nimport type { NodeHiveAuthConfig } from './internal/config.ts';\nimport { checkHasSession } from './internal/has-session.ts';\nimport { performLogout, type PerformLogoutOptions } from './internal/logout.ts';\nimport {\n NextCookieStorage,\n type ProxyContext,\n} from './internal/next-cookie-storage.ts';\nimport {\n buildAnonClient,\n buildUserClient,\n} from './internal/nodehive-client.ts';\n\n/**\n * Bind the client factories + logout to a project config (explicit injection,\n * no global singleton). Call once in the project and re-export the result.\n */\nexport function createNodeHiveAuth(config: NodeHiveAuthConfig) {\n /**\n * Deliberately act as the logged-in user. Default: use createClient().\n * Binds to the request's session cookies but guarantees no user: without a\n * session the client carries no token (it is NOT the anon client) — use it\n * only where a session is established or where you check isLoggedIn().\n */\n const createUserClient = (proxyContext?: ProxyContext) =>\n buildUserClient(config, proxyContext, { preventSdkRefresh: !proxyContext });\n\n /**\n * Deliberately act as an anonymous visitor (client_credentials, capped\n * rights). Default: use createClient(). One instance per runtime since the\n * credential never rotates.\n */\n let anonClient: ReturnType<typeof buildAnonClient> | null = null;\n const createAnonClient = () => {\n if (anonClient) return anonClient;\n anonClient = buildAnonClient(config);\n return anonClient;\n };\n\n /**\n * The default client: user client when a usable access token is present,\n * else the anon client. Memoized per request via React cache().\n *\n * Checks the short-lived access token, not the refresh token: only the\n * proxy may refresh (rotated tokens can't be persisted from RSCs), so the\n * user client is only picked when a request-ready token exists. \"Is the\n * user logged in?\" is a different question — that's isAuthenticated, which\n * checks the durable refresh token.\n */\n const createClient = cache(async () => {\n const storage = new NextCookieStorage();\n const token = await storage.get('token');\n return token ? createUserClient() : createAnonClient();\n });\n\n const isAuthenticated = cache(checkHasSession);\n\n return {\n createClient,\n createUserClient,\n createAnonClient,\n isAuthenticated,\n performLogout: (options?: PerformLogoutOptions) =>\n performLogout(config, options),\n };\n}\n\nexport { shouldEnableDraftMode } from './internal/draft-mode.ts';\nexport { checkHasSession } from './internal/has-session.ts';\nexport {\n getEditorLocale,\n resolveEditorLocale,\n} from './internal/editor-locale.ts';\nexport { requireAuth } from './internal/require-auth.ts';\nexport { getUserRoles } from './internal/roles.ts';\nexport { isSameOriginRequest } from './internal/same-origin.ts';\nexport { SignedIn, SignedOut } from './internal/session-gates.tsx';\nexport type { NodeHiveAuthConfig } from './internal/config.ts';\nexport type { ProxyContext } from './internal/next-cookie-storage.ts';\nexport type { PerformLogoutOptions } from './internal/logout.ts';\n"],"mappings":"AAAA;AACA,SAASA,KAAK,QAAQ,OAAO;AAG7B,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,aAAa,QAAmC,sBAAsB;AAC/E,SACEC,iBAAiB,QAEZ,mCAAmC;AAC1C,SACEC,eAAe,EACfC,eAAe,QACV,+BAA+B;;AAEtC;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAACC,MAA0B,EAAE;EAC7D;AACF;AACA;AACA;AACA;AACA;EACE,MAAMC,gBAAgB,GAAIC,YAA2B,IACnDJ,eAAe,CAACE,MAAM,EAAEE,YAAY,EAAE;IAAEC,iBAAiB,EAAE,CAACD;EAAa,CAAC,CAAC;;EAE7E;AACF;AACA;AACA;AACA;EACE,IAAIE,UAAqD,GAAG,IAAI;EAChE,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;IAC7B,IAAID,UAAU,EAAE,OAAOA,UAAU;IACjCA,UAAU,GAAGP,eAAe,CAACG,MAAM,CAAC;IACpC,OAAOI,UAAU;EACnB,CAAC;;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAME,YAAY,GAAGb,KAAK,CAAC,YAAY;IACrC,MAAMc,OAAO,GAAG,IAAIX,iBAAiB,CAAC,CAAC;IACvC,MAAMY,KAAK,GAAG,MAAMD,OAAO,CAACE,GAAG,CAAC,OAAO,CAAC;IACxC,OAAOD,KAAK,GAAGP,gBAAgB,CAAC,CAAC,GAAGI,gBAAgB,CAAC,CAAC;EACxD,CAAC,CAAC;EAEF,MAAMK,eAAe,GAAGjB,KAAK,CAACC,eAAe,CAAC;EAE9C,OAAO;IACLY,YAAY;IACZL,gBAAgB;IAChBI,gBAAgB;IAChBK,eAAe;IACff,aAAa,EAAGgB,OAA8B,IAC5ChB,aAAa,CAACK,MAAM,EAAEW,OAAO;EACjC,CAAC;AACH;AAEA,SAASC,qBAAqB,QAAQ,0BAA0B;AAChE,SAASlB,eAAe,QAAQ,2BAA2B;AAC3D,SACEmB,eAAe,EACfC,mBAAmB,QACd,6BAA6B;AACpC,SAASC,WAAW,QAAQ,4BAA4B;AACxD,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,mBAAmB,QAAQ,2BAA2B;AAC/D,SAASC,QAAQ,EAAEC,SAAS,QAAQ,6BAA8B","ignoreList":[]}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The postMessage wire contract between the Next.js frontend and the Drupal
3
+ * visual-editor embedder. Freezing these types is the point of the module: a
4
+ * field rename breaks compilation of the sender/receiver and the fixture tests
5
+ * (bridge-protocol.test.ts).
6
+ *
7
+ * Convention for new messages: an `nh:`-prefixed `type` discriminant and a
8
+ * numeric `v` version field. See the visual-editor README ("Bridge protocol").
9
+ */
10
+ export declare const AUTH_DONE_TYPE = "nh:auth-done";
11
+ export declare const RELOAD_FRAME_MESSAGE = "reloadFrame";
12
+ export interface ParagraphEditMessage {
13
+ type: 'paragraph';
14
+ uuid: string;
15
+ id: string | number | undefined;
16
+ parent_id: string | undefined;
17
+ langcode: string;
18
+ }
19
+ export interface FragmentEditMessage {
20
+ type: 'fragment';
21
+ uuid: string;
22
+ id: string;
23
+ langcode: string;
24
+ }
25
+ export interface MenuEditMessage {
26
+ type: 'menu';
27
+ menu_id: string;
28
+ langcode: string;
29
+ /**
30
+ * @deprecated Legacy alias for `langcode`, sent for one major so older Drupal
31
+ * receivers keep working. Read `langcode`.
32
+ */
33
+ lang: string;
34
+ }
35
+ export type BridgeEditPayload = ParagraphEditMessage | FragmentEditMessage | MenuEditMessage;
36
+ /** An edit payload as posted to the parent: the payload plus the frame pathname. */
37
+ export type PostedEditMessage = BridgeEditPayload & {
38
+ pathname: string;
39
+ };
40
+ export interface AuthDoneMessage {
41
+ type: typeof AUTH_DONE_TYPE;
42
+ via: 'oauth';
43
+ handoff: string;
44
+ }
45
+ /** connector: a `reloadFrame` from the trusted embedder origin only. */
46
+ export declare function isReloadFrameFrom(event: Pick<MessageEvent, 'origin' | 'data'>, allowedOrigin: string | null): boolean;
47
+ /** use-editor-login: an `nh:auth-done` from the popup we opened only. */
48
+ export declare function isAuthDoneFrom(event: Pick<MessageEvent, 'origin' | 'source' | 'data'>, expectedOrigin: string, expectedSource: MessageEventSource | null): event is Pick<MessageEvent, 'origin' | 'source'> & {
49
+ data: AuthDoneMessage;
50
+ };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The postMessage wire contract between the Next.js frontend and the Drupal
3
+ * visual-editor embedder. Freezing these types is the point of the module: a
4
+ * field rename breaks compilation of the sender/receiver and the fixture tests
5
+ * (bridge-protocol.test.ts).
6
+ *
7
+ * Convention for new messages: an `nh:`-prefixed `type` discriminant and a
8
+ * numeric `v` version field. See the visual-editor README ("Bridge protocol").
9
+ */
10
+
11
+ export const AUTH_DONE_TYPE = 'nh:auth-done';
12
+ export const RELOAD_FRAME_MESSAGE = 'reloadFrame';
13
+
14
+ /** An edit payload as posted to the parent: the payload plus the frame pathname. */
15
+
16
+ /** connector: a `reloadFrame` from the trusted embedder origin only. */
17
+ export function isReloadFrameFrom(event, allowedOrigin) {
18
+ return allowedOrigin !== null && event.origin === allowedOrigin && event.data === RELOAD_FRAME_MESSAGE;
19
+ }
20
+
21
+ /** use-editor-login: an `nh:auth-done` from the popup we opened only. */
22
+ export function isAuthDoneFrom(event, expectedOrigin, expectedSource) {
23
+ return event.origin === expectedOrigin && event.source === expectedSource && typeof event.data === 'object' && event.data !== null && event.data.type === AUTH_DONE_TYPE;
24
+ }
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["AUTH_DONE_TYPE","RELOAD_FRAME_MESSAGE","isReloadFrameFrom","event","allowedOrigin","origin","data","isAuthDoneFrom","expectedOrigin","expectedSource","source","type"],"sources":["../../src/bridge-protocol/index.ts"],"sourcesContent":["/**\n * The postMessage wire contract between the Next.js frontend and the Drupal\n * visual-editor embedder. Freezing these types is the point of the module: a\n * field rename breaks compilation of the sender/receiver and the fixture tests\n * (bridge-protocol.test.ts).\n *\n * Convention for new messages: an `nh:`-prefixed `type` discriminant and a\n * numeric `v` version field. See the visual-editor README (\"Bridge protocol\").\n */\n\nexport const AUTH_DONE_TYPE = 'nh:auth-done';\n\nexport const RELOAD_FRAME_MESSAGE = 'reloadFrame';\n\nexport interface ParagraphEditMessage {\n type: 'paragraph';\n uuid: string;\n id: string | number | undefined;\n parent_id: string | undefined;\n langcode: string;\n}\n\nexport interface FragmentEditMessage {\n type: 'fragment';\n uuid: string;\n id: string;\n langcode: string;\n}\n\nexport interface MenuEditMessage {\n type: 'menu';\n menu_id: string;\n langcode: string;\n /**\n * @deprecated Legacy alias for `langcode`, sent for one major so older Drupal\n * receivers keep working. Read `langcode`.\n */\n lang: string;\n}\n\nexport type BridgeEditPayload =\n ParagraphEditMessage | FragmentEditMessage | MenuEditMessage;\n\n/** An edit payload as posted to the parent: the payload plus the frame pathname. */\nexport type PostedEditMessage = BridgeEditPayload & { pathname: string };\n\nexport interface AuthDoneMessage {\n type: typeof AUTH_DONE_TYPE;\n via: 'oauth';\n handoff: string;\n}\n\n/** connector: a `reloadFrame` from the trusted embedder origin only. */\nexport function isReloadFrameFrom(\n event: Pick<MessageEvent, 'origin' | 'data'>,\n allowedOrigin: string | null\n): boolean {\n return (\n allowedOrigin !== null &&\n event.origin === allowedOrigin &&\n event.data === RELOAD_FRAME_MESSAGE\n );\n}\n\n/** use-editor-login: an `nh:auth-done` from the popup we opened only. */\nexport function isAuthDoneFrom(\n event: Pick<MessageEvent, 'origin' | 'source' | 'data'>,\n expectedOrigin: string,\n expectedSource: MessageEventSource | null\n): event is Pick<MessageEvent, 'origin' | 'source'> & {\n data: AuthDoneMessage;\n} {\n return (\n event.origin === expectedOrigin &&\n event.source === expectedSource &&\n typeof event.data === 'object' &&\n event.data !== null &&\n (event.data as { type?: unknown }).type === AUTH_DONE_TYPE\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,cAAc,GAAG,cAAc;AAE5C,OAAO,MAAMC,oBAAoB,GAAG,aAAa;;AA+BjD;;AASA;AACA,OAAO,SAASC,iBAAiBA,CAC/BC,KAA4C,EAC5CC,aAA4B,EACnB;EACT,OACEA,aAAa,KAAK,IAAI,IACtBD,KAAK,CAACE,MAAM,KAAKD,aAAa,IAC9BD,KAAK,CAACG,IAAI,KAAKL,oBAAoB;AAEvC;;AAEA;AACA,OAAO,SAASM,cAAcA,CAC5BJ,KAAuD,EACvDK,cAAsB,EACtBC,cAAyC,EAGzC;EACA,OACEN,KAAK,CAACE,MAAM,KAAKG,cAAc,IAC/BL,KAAK,CAACO,MAAM,KAAKD,cAAc,IAC/B,OAAON,KAAK,CAACG,IAAI,KAAK,QAAQ,IAC9BH,KAAK,CAACG,IAAI,KAAK,IAAI,IAClBH,KAAK,CAACG,IAAI,CAAwBK,IAAI,KAAKX,cAAc;AAE9D","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ export { publishPuckData, type PublishPuckDataParams, } from './internal/editor/publish-puck-data.js';
2
+ export { useSavePage, SavePageProvider, type SavePage, } from './internal/editor/save-page-context.js';
3
+ export { findMissingRequiredFields, type MissingRequiredField, } from './internal/editor/find-missing-required-fields.js';
4
+ export { createSectionsPlugin } from './internal/plugins/sections-plugin/index.js';
5
+ export { createBlocksPlugin } from './internal/plugins/blocks-plugin/index.js';
6
+ export { createTemplatesPlugin } from './internal/plugins/templates-plugin/index.js';
7
+ export { createOutlinePlugin } from './internal/plugins/outline-plugin/index.js';
8
+ export { createAgentPlugin } from './internal/plugins/agent-plugin/index.js';
@@ -0,0 +1,9 @@
1
+ export { publishPuckData } from "./internal/editor/publish-puck-data.js";
2
+ export { useSavePage, SavePageProvider } from "./internal/editor/save-page-context.js";
3
+ export { findMissingRequiredFields } from "./internal/editor/find-missing-required-fields.js";
4
+ export { createSectionsPlugin } from "./internal/plugins/sections-plugin/index.js";
5
+ export { createBlocksPlugin } from "./internal/plugins/blocks-plugin/index.js";
6
+ export { createTemplatesPlugin } from "./internal/plugins/templates-plugin/index.js";
7
+ export { createOutlinePlugin } from "./internal/plugins/outline-plugin/index.js";
8
+ export { createAgentPlugin } from "./internal/plugins/agent-plugin/index.js";
9
+ //# sourceMappingURL=editor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor.js","names":["publishPuckData","useSavePage","SavePageProvider","findMissingRequiredFields","createSectionsPlugin","createBlocksPlugin","createTemplatesPlugin","createOutlinePlugin","createAgentPlugin"],"sources":["../../src/puck-editor/editor.ts"],"sourcesContent":["export {\n publishPuckData,\n type PublishPuckDataParams,\n} from './internal/editor/publish-puck-data.ts';\nexport {\n useSavePage,\n SavePageProvider,\n type SavePage,\n} from './internal/editor/save-page-context.tsx';\nexport {\n findMissingRequiredFields,\n type MissingRequiredField,\n} from './internal/editor/find-missing-required-fields.ts';\nexport { createSectionsPlugin } from './internal/plugins/sections-plugin/index.ts';\nexport { createBlocksPlugin } from './internal/plugins/blocks-plugin/index.ts';\nexport { createTemplatesPlugin } from './internal/plugins/templates-plugin/index.ts';\nexport { createOutlinePlugin } from './internal/plugins/outline-plugin/index.ts';\nexport { createAgentPlugin } from './internal/plugins/agent-plugin/index.ts';\n"],"mappings":"AAAA,SACEA,eAAe,QAEV,wCAAwC;AAC/C,SACEC,WAAW,EACXC,gBAAgB,QAEX,wCAAyC;AAChD,SACEC,yBAAyB,QAEpB,mDAAmD;AAC1D,SAASC,oBAAoB,QAAQ,6CAA6C;AAClF,SAASC,kBAAkB,QAAQ,2CAA2C;AAC9E,SAASC,qBAAqB,QAAQ,8CAA8C;AACpF,SAASC,mBAAmB,QAAQ,4CAA4C;AAChF,SAASC,iBAAiB,QAAQ,0CAA0C","ignoreList":[]}
@@ -1,7 +1,6 @@
1
- export * from './internal/fields';
2
- export { type MediaItem } from './internal/fields/media-selector/media-selector-field';
3
- export type { CropBreakpoint, CropRegion, MediaCrop, MediaCropConfig, } from './internal/fields/media-selector/crop-types';
4
- export { useMediaLibrary } from './internal/fields/media-selector/use-media-library';
5
- export type { LocalizedLabel, RoutableLink, RoutableLinkSource, } from './internal/fields/link-picker/types';
6
- export { isExternalHref, linkTarget, normalizeLink, resolveLink, resolveLinkTarget, TARGET_OPTIONS, type LinkTargetOverride, type LinkValue, type ResolvedLink, } from './internal/fields/link-picker/link-value';
7
- //# sourceMappingURL=fields.d.ts.map
1
+ export * from './internal/fields/index.js';
2
+ export { type MediaItem } from './internal/fields/media-selector/media-selector-field.js';
3
+ export type { CropBreakpoint, CropRegion, MediaCrop, MediaCropConfig, } from './internal/fields/media-selector/crop-types.js';
4
+ export { useMediaLibrary } from './internal/fields/media-selector/use-media-library.js';
5
+ export type { LocalizedLabel, RoutableLink, RoutableLinkSource, } from './internal/fields/link-picker/types.js';
6
+ export { isExternalHref, isSafeHref, linkTarget, normalizeLink, resolveLink, resolveLinkTarget, sanitizeHref, TARGET_OPTIONS, type LinkTargetOverride, type LinkValue, type ResolvedLink, } from './internal/fields/link-picker/link-value.js';
@@ -1,4 +1,4 @@
1
- export * from './internal/fields';
2
- export { useMediaLibrary } from './internal/fields/media-selector/use-media-library';
3
- export { isExternalHref, linkTarget, normalizeLink, resolveLink, resolveLinkTarget, TARGET_OPTIONS } from './internal/fields/link-picker/link-value';
1
+ export * from "./internal/fields/index.js";
2
+ export { useMediaLibrary } from "./internal/fields/media-selector/use-media-library.js";
3
+ export { isExternalHref, isSafeHref, linkTarget, normalizeLink, resolveLink, resolveLinkTarget, sanitizeHref, TARGET_OPTIONS } from "./internal/fields/link-picker/link-value.js";
4
4
  //# sourceMappingURL=fields.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fields.js","names":["useMediaLibrary","isExternalHref","linkTarget","normalizeLink","resolveLink","resolveLinkTarget","TARGET_OPTIONS"],"sources":["../../src/puck-editor/fields.ts"],"sourcesContent":["export * from './internal/fields';\nexport { type MediaItem } from './internal/fields/media-selector/media-selector-field';\nexport type {\n CropBreakpoint,\n CropRegion,\n MediaCrop,\n MediaCropConfig,\n} from './internal/fields/media-selector/crop-types';\nexport { useMediaLibrary } from './internal/fields/media-selector/use-media-library';\nexport type {\n LocalizedLabel,\n RoutableLink,\n RoutableLinkSource,\n} from './internal/fields/link-picker/types';\nexport {\n isExternalHref,\n linkTarget,\n normalizeLink,\n resolveLink,\n resolveLinkTarget,\n TARGET_OPTIONS,\n type LinkTargetOverride,\n type LinkValue,\n type ResolvedLink,\n} from './internal/fields/link-picker/link-value';\n"],"mappings":"AAAA,cAAc,mBAAmB;AAQjC,SAASA,eAAe,QAAQ,oDAAoD;AAMpF,SACEC,cAAc,EACdC,UAAU,EACVC,aAAa,EACbC,WAAW,EACXC,iBAAiB,EACjBC,cAAc,QAIT,0CAA0C","ignoreList":[]}
1
+ {"version":3,"file":"fields.js","names":["useMediaLibrary","isExternalHref","isSafeHref","linkTarget","normalizeLink","resolveLink","resolveLinkTarget","sanitizeHref","TARGET_OPTIONS"],"sources":["../../src/puck-editor/fields.ts"],"sourcesContent":["export * from './internal/fields/index.ts';\nexport { type MediaItem } from './internal/fields/media-selector/media-selector-field.tsx';\nexport type {\n CropBreakpoint,\n CropRegion,\n MediaCrop,\n MediaCropConfig,\n} from './internal/fields/media-selector/crop-types.ts';\nexport { useMediaLibrary } from './internal/fields/media-selector/use-media-library.ts';\nexport type {\n LocalizedLabel,\n RoutableLink,\n RoutableLinkSource,\n} from './internal/fields/link-picker/types.ts';\nexport {\n isExternalHref,\n isSafeHref,\n linkTarget,\n normalizeLink,\n resolveLink,\n resolveLinkTarget,\n sanitizeHref,\n TARGET_OPTIONS,\n type LinkTargetOverride,\n type LinkValue,\n type ResolvedLink,\n} from './internal/fields/link-picker/link-value.ts';\n"],"mappings":"AAAA,cAAc,4BAA4B;AAQ1C,SAASA,eAAe,QAAQ,uDAAuD;AAMvF,SACEC,cAAc,EACdC,UAAU,EACVC,UAAU,EACVC,aAAa,EACbC,WAAW,EACXC,iBAAiB,EACjBC,YAAY,EACZC,cAAc,QAIT,6CAA6C","ignoreList":[]}