@nodehive/nextjs 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +102 -0
- package/dist/auth/index.d.ts +6 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +7 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/internal/config.d.ts +24 -0
- package/dist/auth/internal/config.d.ts.map +1 -0
- package/dist/auth/internal/config.js +2 -0
- package/dist/auth/internal/config.js.map +1 -0
- package/dist/auth/internal/draft-mode.d.ts +17 -0
- package/dist/auth/internal/draft-mode.d.ts.map +1 -0
- package/dist/auth/internal/draft-mode.js +73 -0
- package/dist/auth/internal/draft-mode.js.map +1 -0
- package/dist/auth/internal/editor-locale.d.ts +4 -0
- package/dist/auth/internal/editor-locale.d.ts.map +1 -0
- package/dist/auth/internal/editor-locale.js +14 -0
- package/dist/auth/internal/editor-locale.js.map +1 -0
- package/dist/auth/internal/handoff.d.ts +11 -0
- package/dist/auth/internal/handoff.d.ts.map +1 -0
- package/dist/auth/internal/handoff.js +44 -0
- package/dist/auth/internal/handoff.js.map +1 -0
- package/dist/auth/internal/has-session.d.ts +7 -0
- package/dist/auth/internal/has-session.d.ts.map +1 -0
- package/dist/auth/internal/has-session.js +11 -0
- package/dist/auth/internal/has-session.js.map +1 -0
- package/dist/auth/internal/logout.d.ts +12 -0
- package/dist/auth/internal/logout.d.ts.map +1 -0
- package/dist/auth/internal/logout.js +48 -0
- package/dist/auth/internal/logout.js.map +1 -0
- package/dist/auth/internal/next-cookie-storage.d.ts +28 -0
- package/dist/auth/internal/next-cookie-storage.d.ts.map +1 -0
- package/dist/auth/internal/next-cookie-storage.js +103 -0
- package/dist/auth/internal/next-cookie-storage.js.map +1 -0
- package/dist/auth/internal/nodehive-client.d.ts +6 -0
- package/dist/auth/internal/nodehive-client.d.ts.map +1 -0
- package/dist/auth/internal/nodehive-client.js +64 -0
- package/dist/auth/internal/nodehive-client.js.map +1 -0
- package/dist/auth/internal/oauth-config.d.ts +37 -0
- package/dist/auth/internal/oauth-config.d.ts.map +1 -0
- package/dist/auth/internal/oauth-config.js +70 -0
- package/dist/auth/internal/oauth-config.js.map +1 -0
- package/dist/auth/internal/proxy-helpers.d.ts +15 -0
- package/dist/auth/internal/proxy-helpers.d.ts.map +1 -0
- package/dist/auth/internal/proxy-helpers.js +43 -0
- package/dist/auth/internal/proxy-helpers.js.map +1 -0
- package/dist/auth/internal/refresh.d.ts +13 -0
- package/dist/auth/internal/refresh.d.ts.map +1 -0
- package/dist/auth/internal/refresh.js +170 -0
- package/dist/auth/internal/refresh.js.map +1 -0
- package/dist/auth/internal/require-auth.d.ts +2 -0
- package/dist/auth/internal/require-auth.d.ts.map +1 -0
- package/dist/auth/internal/require-auth.js +11 -0
- package/dist/auth/internal/require-auth.js.map +1 -0
- package/dist/auth/internal/return-to.d.ts +16 -0
- package/dist/auth/internal/return-to.d.ts.map +1 -0
- package/dist/auth/internal/return-to.js +31 -0
- package/dist/auth/internal/return-to.js.map +1 -0
- package/dist/auth/internal/routes/callback.d.ts +11 -0
- package/dist/auth/internal/routes/callback.d.ts.map +1 -0
- package/dist/auth/internal/routes/callback.js +93 -0
- package/dist/auth/internal/routes/callback.js.map +1 -0
- package/dist/auth/internal/routes/chips-exchange.d.ts +4 -0
- package/dist/auth/internal/routes/chips-exchange.d.ts.map +1 -0
- package/dist/auth/internal/routes/chips-exchange.js +64 -0
- package/dist/auth/internal/routes/chips-exchange.js.map +1 -0
- package/dist/auth/internal/routes/draft.d.ts +4 -0
- package/dist/auth/internal/routes/draft.d.ts.map +1 -0
- package/dist/auth/internal/routes/draft.js +34 -0
- package/dist/auth/internal/routes/draft.js.map +1 -0
- package/dist/auth/internal/routes/index.d.ts +25 -0
- package/dist/auth/internal/routes/index.d.ts.map +1 -0
- package/dist/auth/internal/routes/index.js +66 -0
- package/dist/auth/internal/routes/index.js.map +1 -0
- package/dist/auth/internal/routes/login.d.ts +3 -0
- package/dist/auth/internal/routes/login.d.ts.map +1 -0
- package/dist/auth/internal/routes/login.js +47 -0
- package/dist/auth/internal/routes/login.js.map +1 -0
- package/dist/auth/internal/routes/popup-done.d.ts +3 -0
- package/dist/auth/internal/routes/popup-done.d.ts.map +1 -0
- package/dist/auth/internal/routes/popup-done.js +24 -0
- package/dist/auth/internal/routes/popup-done.js.map +1 -0
- package/dist/auth/internal/routes/refresh.d.ts +6 -0
- package/dist/auth/internal/routes/refresh.d.ts.map +1 -0
- package/dist/auth/internal/routes/refresh.js +44 -0
- package/dist/auth/internal/routes/refresh.js.map +1 -0
- package/dist/auth/internal/same-origin.d.ts +8 -0
- package/dist/auth/internal/same-origin.d.ts.map +1 -0
- package/dist/auth/internal/same-origin.js +9 -0
- package/dist/auth/internal/same-origin.js.map +1 -0
- package/dist/auth/internal/session-gates.d.ts +7 -0
- package/dist/auth/internal/session-gates.d.ts.map +1 -0
- package/dist/auth/internal/session-gates.js +12 -0
- package/dist/auth/internal/session-gates.js.map +1 -0
- package/dist/auth/internal/update-session.d.ts +17 -0
- package/dist/auth/internal/update-session.d.ts.map +1 -0
- package/dist/auth/internal/update-session.js +39 -0
- package/dist/auth/internal/update-session.js.map +1 -0
- package/dist/auth/internal/use-editor-login.d.ts +33 -0
- package/dist/auth/internal/use-editor-login.d.ts.map +1 -0
- package/dist/auth/internal/use-editor-login.js +143 -0
- package/dist/auth/internal/use-editor-login.js.map +1 -0
- package/dist/auth/proxy.d.ts +8 -0
- package/dist/auth/proxy.d.ts.map +1 -0
- package/dist/auth/proxy.js +8 -0
- package/dist/auth/proxy.js.map +1 -0
- package/dist/auth/react.d.ts +2 -0
- package/dist/auth/react.d.ts.map +1 -0
- package/dist/auth/react.js +3 -0
- package/dist/auth/react.js.map +1 -0
- package/dist/auth/routes.d.ts +3 -0
- package/dist/auth/routes.d.ts.map +1 -0
- package/dist/auth/routes.js +3 -0
- package/dist/auth/routes.js.map +1 -0
- package/dist/auth/server.d.ts +23 -0
- package/dist/auth/server.d.ts.map +1 -0
- package/dist/auth/server.js +61 -0
- package/dist/auth/server.js.map +1 -0
- package/dist/puck-editor/fields.d.ts +7 -0
- package/dist/puck-editor/fields.d.ts.map +1 -0
- package/dist/puck-editor/fields.js +4 -0
- package/dist/puck-editor/fields.js.map +1 -0
- package/dist/puck-editor/index.d.ts +14 -0
- package/dist/puck-editor/index.d.ts.map +1 -0
- package/dist/puck-editor/index.js +12 -0
- package/dist/puck-editor/index.js.map +1 -0
- package/dist/puck-editor/internal/api/client.d.ts +32 -0
- package/dist/puck-editor/internal/api/client.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/client.js +128 -0
- package/dist/puck-editor/internal/api/client.js.map +1 -0
- package/dist/puck-editor/internal/api/config.d.ts +29 -0
- package/dist/puck-editor/internal/api/config.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/config.js +2 -0
- package/dist/puck-editor/internal/api/config.js.map +1 -0
- package/dist/puck-editor/internal/api/create-puck-api.d.ts +26 -0
- package/dist/puck-editor/internal/api/create-puck-api.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/create-puck-api.js +124 -0
- package/dist/puck-editor/internal/api/create-puck-api.js.map +1 -0
- package/dist/puck-editor/internal/api/handlers/create-page.d.ts +13 -0
- package/dist/puck-editor/internal/api/handlers/create-page.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/handlers/create-page.js +125 -0
- package/dist/puck-editor/internal/api/handlers/create-page.js.map +1 -0
- package/dist/puck-editor/internal/api/handlers/entities.d.ts +17 -0
- package/dist/puck-editor/internal/api/handlers/entities.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/handlers/entities.js +166 -0
- package/dist/puck-editor/internal/api/handlers/entities.js.map +1 -0
- package/dist/puck-editor/internal/api/handlers/publish.d.ts +6 -0
- package/dist/puck-editor/internal/api/handlers/publish.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/handlers/publish.js +115 -0
- package/dist/puck-editor/internal/api/handlers/publish.js.map +1 -0
- package/dist/puck-editor/internal/api/handlers/template.d.ts +15 -0
- package/dist/puck-editor/internal/api/handlers/template.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/handlers/template.js +222 -0
- package/dist/puck-editor/internal/api/handlers/template.js.map +1 -0
- package/dist/puck-editor/internal/api/handlers/upload.d.ts +13 -0
- package/dist/puck-editor/internal/api/handlers/upload.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/handlers/upload.js +129 -0
- package/dist/puck-editor/internal/api/handlers/upload.js.map +1 -0
- package/dist/puck-editor/internal/api/media-params.d.ts +4 -0
- package/dist/puck-editor/internal/api/media-params.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/media-params.js +38 -0
- package/dist/puck-editor/internal/api/media-params.js.map +1 -0
- package/dist/puck-editor/internal/api/media-upload.d.ts +24 -0
- package/dist/puck-editor/internal/api/media-upload.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/media-upload.js +171 -0
- package/dist/puck-editor/internal/api/media-upload.js.map +1 -0
- package/dist/puck-editor/internal/api/space.d.ts +4 -0
- package/dist/puck-editor/internal/api/space.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/space.js +11 -0
- package/dist/puck-editor/internal/api/space.js.map +1 -0
- package/dist/puck-editor/internal/content-model.d.ts +55 -0
- package/dist/puck-editor/internal/content-model.d.ts.map +1 -0
- package/dist/puck-editor/internal/content-model.js +73 -0
- package/dist/puck-editor/internal/content-model.js.map +1 -0
- package/dist/puck-editor/internal/editor/allowed-types.d.ts +4 -0
- package/dist/puck-editor/internal/editor/allowed-types.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/allowed-types.js +6 -0
- package/dist/puck-editor/internal/editor/allowed-types.js.map +1 -0
- package/dist/puck-editor/internal/editor/canvas-add-picker.d.ts +9 -0
- package/dist/puck-editor/internal/editor/canvas-add-picker.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/canvas-add-picker.js +231 -0
- package/dist/puck-editor/internal/editor/canvas-add-picker.js.map +1 -0
- package/dist/puck-editor/internal/editor/canvas-empty-state.d.ts +6 -0
- package/dist/puck-editor/internal/editor/canvas-empty-state.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/canvas-empty-state.js +85 -0
- package/dist/puck-editor/internal/editor/canvas-empty-state.js.map +1 -0
- package/dist/puck-editor/internal/editor/canvas-quick-add.d.ts +2 -0
- package/dist/puck-editor/internal/editor/canvas-quick-add.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/canvas-quick-add.js +844 -0
- package/dist/puck-editor/internal/editor/canvas-quick-add.js.map +1 -0
- package/dist/puck-editor/internal/editor/canvas-scroll.d.ts +3 -0
- package/dist/puck-editor/internal/editor/canvas-scroll.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/canvas-scroll.js +16 -0
- package/dist/puck-editor/internal/editor/canvas-scroll.js.map +1 -0
- package/dist/puck-editor/internal/editor/component-icons.d.ts +14 -0
- package/dist/puck-editor/internal/editor/component-icons.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/component-icons.js +35 -0
- package/dist/puck-editor/internal/editor/component-icons.js.map +1 -0
- package/dist/puck-editor/internal/editor/component-item.d.ts +6 -0
- package/dist/puck-editor/internal/editor/component-item.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/component-item.js +42 -0
- package/dist/puck-editor/internal/editor/component-item.js.map +1 -0
- package/dist/puck-editor/internal/editor/editor-action-bar.d.ts +6 -0
- package/dist/puck-editor/internal/editor/editor-action-bar.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/editor-action-bar.js +249 -0
- package/dist/puck-editor/internal/editor/editor-action-bar.js.map +1 -0
- package/dist/puck-editor/internal/editor/editor-header-actions.d.ts +7 -0
- package/dist/puck-editor/internal/editor/editor-header-actions.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/editor-header-actions.js +120 -0
- package/dist/puck-editor/internal/editor/editor-header-actions.js.map +1 -0
- package/dist/puck-editor/internal/editor/find-missing-required-fields.d.ts +15 -0
- package/dist/puck-editor/internal/editor/find-missing-required-fields.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/find-missing-required-fields.js +61 -0
- package/dist/puck-editor/internal/editor/find-missing-required-fields.js.map +1 -0
- package/dist/puck-editor/internal/editor/grouped-drawer-panel.d.ts +15 -0
- package/dist/puck-editor/internal/editor/grouped-drawer-panel.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/grouped-drawer-panel.js +147 -0
- package/dist/puck-editor/internal/editor/grouped-drawer-panel.js.map +1 -0
- package/dist/puck-editor/internal/editor/grouped-entry-list.d.ts +17 -0
- package/dist/puck-editor/internal/editor/grouped-entry-list.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/grouped-entry-list.js +125 -0
- package/dist/puck-editor/internal/editor/grouped-entry-list.js.map +1 -0
- package/dist/puck-editor/internal/editor/header-save-button.d.ts +5 -0
- package/dist/puck-editor/internal/editor/header-save-button.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/header-save-button.js +60 -0
- package/dist/puck-editor/internal/editor/header-save-button.js.map +1 -0
- package/dist/puck-editor/internal/editor/page-template-picker.d.ts +4 -0
- package/dist/puck-editor/internal/editor/page-template-picker.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/page-template-picker.js +140 -0
- package/dist/puck-editor/internal/editor/page-template-picker.js.map +1 -0
- package/dist/puck-editor/internal/editor/picker-entry-item.d.ts +6 -0
- package/dist/puck-editor/internal/editor/picker-entry-item.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/picker-entry-item.js +79 -0
- package/dist/puck-editor/internal/editor/picker-entry-item.js.map +1 -0
- package/dist/puck-editor/internal/editor/picker-model.d.ts +62 -0
- package/dist/puck-editor/internal/editor/picker-model.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/picker-model.js +489 -0
- package/dist/puck-editor/internal/editor/picker-model.js.map +1 -0
- package/dist/puck-editor/internal/editor/publish-puck-data.d.ts +30 -0
- package/dist/puck-editor/internal/editor/publish-puck-data.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/publish-puck-data.js +30 -0
- package/dist/puck-editor/internal/editor/publish-puck-data.js.map +1 -0
- package/dist/puck-editor/internal/editor/puck-editor.d.ts +15 -0
- package/dist/puck-editor/internal/editor/puck-editor.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/puck-editor.js +333 -0
- package/dist/puck-editor/internal/editor/puck-editor.js.map +1 -0
- package/dist/puck-editor/internal/editor/section-template-modal.d.ts +4 -0
- package/dist/puck-editor/internal/editor/section-template-modal.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/section-template-modal.js +71 -0
- package/dist/puck-editor/internal/editor/section-template-modal.js.map +1 -0
- package/dist/puck-editor/internal/editor/use-scroll-lock-outside.d.ts +15 -0
- package/dist/puck-editor/internal/editor/use-scroll-lock-outside.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/use-scroll-lock-outside.js +93 -0
- package/dist/puck-editor/internal/editor/use-scroll-lock-outside.js.map +1 -0
- package/dist/puck-editor/internal/editor-config.d.ts +30 -0
- package/dist/puck-editor/internal/editor-config.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor-config.js +57 -0
- package/dist/puck-editor/internal/editor-config.js.map +1 -0
- package/dist/puck-editor/internal/editor-query-client.d.ts +4 -0
- package/dist/puck-editor/internal/editor-query-client.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor-query-client.js +8 -0
- package/dist/puck-editor/internal/editor-query-client.js.map +1 -0
- package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.d.ts +14 -0
- package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.js +120 -0
- package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.js.map +1 -0
- package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.d.ts +21 -0
- package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.js +24 -0
- package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.js.map +1 -0
- package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.d.ts +16 -0
- package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.js +20 -0
- package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.js.map +1 -0
- package/dist/puck-editor/internal/fields/date-picker/date-picker.d.ts +8 -0
- package/dist/puck-editor/internal/fields/date-picker/date-picker.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/date-picker/date-picker.js +151 -0
- package/dist/puck-editor/internal/fields/date-picker/date-picker.js.map +1 -0
- package/dist/puck-editor/internal/fields/index.d.ts +10 -0
- package/dist/puck-editor/internal/fields/index.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/index.js +10 -0
- package/dist/puck-editor/internal/fields/index.js.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/anchor.d.ts +33 -0
- package/dist/puck-editor/internal/fields/link-picker/anchor.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/anchor.js +83 -0
- package/dist/puck-editor/internal/fields/link-picker/anchor.js.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/create-link-field.d.ts +24 -0
- package/dist/puck-editor/internal/fields/link-picker/create-link-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/create-link-field.js +31 -0
- package/dist/puck-editor/internal/fields/link-picker/create-link-field.js.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/humanize.d.ts +2 -0
- package/dist/puck-editor/internal/fields/link-picker/humanize.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/humanize.js +4 -0
- package/dist/puck-editor/internal/fields/link-picker/humanize.js.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/link-picker-control.d.ts +27 -0
- package/dist/puck-editor/internal/fields/link-picker/link-picker-control.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/link-picker-control.js +564 -0
- package/dist/puck-editor/internal/fields/link-picker/link-picker-control.js.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/link-picker-field.d.ts +9 -0
- package/dist/puck-editor/internal/fields/link-picker/link-picker-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/link-picker-field.js +189 -0
- package/dist/puck-editor/internal/fields/link-picker/link-picker-field.js.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/link-value.d.ts +72 -0
- package/dist/puck-editor/internal/fields/link-picker/link-value.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/link-value.js +114 -0
- package/dist/puck-editor/internal/fields/link-picker/link-value.js.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.d.ts +14 -0
- package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.js +667 -0
- package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.js.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/richtext-extensions.d.ts +11 -0
- package/dist/puck-editor/internal/fields/link-picker/richtext-extensions.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/richtext-extensions.js +34 -0
- package/dist/puck-editor/internal/fields/link-picker/richtext-extensions.js.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/segmented-control.d.ts +40 -0
- package/dist/puck-editor/internal/fields/link-picker/segmented-control.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/segmented-control.js +146 -0
- package/dist/puck-editor/internal/fields/link-picker/segmented-control.js.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/types.d.ts +34 -0
- package/dist/puck-editor/internal/fields/link-picker/types.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/types.js +2 -0
- package/dist/puck-editor/internal/fields/link-picker/types.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-array/create-media-array-field.d.ts +27 -0
- package/dist/puck-editor/internal/fields/media-array/create-media-array-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-array/create-media-array-field.js +32 -0
- package/dist/puck-editor/internal/fields/media-array/create-media-array-field.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-array/media-array-field.d.ts +13 -0
- package/dist/puck-editor/internal/fields/media-array/media-array-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-array/media-array-field.js +372 -0
- package/dist/puck-editor/internal/fields/media-array/media-array-field.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-array/reorder.d.ts +2 -0
- package/dist/puck-editor/internal/fields/media-array/reorder.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-array/reorder.js +8 -0
- package/dist/puck-editor/internal/fields/media-array/reorder.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.d.ts +27 -0
- package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.js +32 -0
- package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.d.ts +11 -0
- package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.js +219 -0
- package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/crop-types.d.ts +24 -0
- package/dist/puck-editor/internal/fields/media-selector/crop-types.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/crop-types.js +8 -0
- package/dist/puck-editor/internal/fields/media-selector/crop-types.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/extract-fields.d.ts +8 -0
- package/dist/puck-editor/internal/fields/media-selector/extract-fields.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/extract-fields.js +51 -0
- package/dist/puck-editor/internal/fields/media-selector/extract-fields.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/image-upload-form.d.ts +7 -0
- package/dist/puck-editor/internal/fields/media-selector/image-upload-form.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/image-upload-form.js +147 -0
- package/dist/puck-editor/internal/fields/media-selector/image-upload-form.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/media-selector-field.d.ts +30 -0
- package/dist/puck-editor/internal/fields/media-selector/media-selector-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/media-selector-field.js +358 -0
- package/dist/puck-editor/internal/fields/media-selector/media-selector-field.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.d.ts +14 -0
- package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.js +355 -0
- package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/use-debounced-value.d.ts +2 -0
- package/dist/puck-editor/internal/fields/media-selector/use-debounced-value.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/use-debounced-value.js +55 -0
- package/dist/puck-editor/internal/fields/media-selector/use-debounced-value.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/use-media-library.d.ts +24 -0
- package/dist/puck-editor/internal/fields/media-selector/use-media-library.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/use-media-library.js +229 -0
- package/dist/puck-editor/internal/fields/media-selector/use-media-library.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/video-upload-form.d.ts +7 -0
- package/dist/puck-editor/internal/fields/media-selector/video-upload-form.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/video-upload-form.js +120 -0
- package/dist/puck-editor/internal/fields/media-selector/video-upload-form.js.map +1 -0
- package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.d.ts +31 -0
- package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.js +39 -0
- package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.js.map +1 -0
- package/dist/puck-editor/internal/fields/required-field-label.d.ts +16 -0
- package/dist/puck-editor/internal/fields/required-field-label.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/required-field-label.js +89 -0
- package/dist/puck-editor/internal/fields/required-field-label.js.map +1 -0
- package/dist/puck-editor/internal/fields/required.d.ts +19 -0
- package/dist/puck-editor/internal/fields/required.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/required.js +20 -0
- package/dist/puck-editor/internal/fields/required.js.map +1 -0
- package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.d.ts +37 -0
- package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.js +26 -0
- package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.js.map +1 -0
- package/dist/puck-editor/internal/i18n.d.ts +188 -0
- package/dist/puck-editor/internal/i18n.d.ts.map +1 -0
- package/dist/puck-editor/internal/i18n.js +414 -0
- package/dist/puck-editor/internal/i18n.js.map +1 -0
- package/dist/puck-editor/internal/locale.d.ts +13 -0
- package/dist/puck-editor/internal/locale.d.ts.map +1 -0
- package/dist/puck-editor/internal/locale.js +20 -0
- package/dist/puck-editor/internal/locale.js.map +1 -0
- package/dist/puck-editor/internal/localize.d.ts +11 -0
- package/dist/puck-editor/internal/localize.d.ts.map +1 -0
- package/dist/puck-editor/internal/localize.js +42 -0
- package/dist/puck-editor/internal/localize.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.d.ts +21 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.js +197 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.d.ts +2 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.js +131 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.d.ts +20 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.js +46 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.d.ts +46 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.js +176 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/catalog.d.ts +20 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/catalog.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/catalog.js +39 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/catalog.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/constants.d.ts +5 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/constants.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/constants.js +3 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/constants.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/create-page.d.ts +17 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/create-page.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/create-page.js +35 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/create-page.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/find-component-location.d.ts +19 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/find-component-location.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/find-component-location.js +79 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/find-component-location.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/help.d.ts +2 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/help.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/help.js +243 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/help.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/index.d.ts +2 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/index.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/index.js +2 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/index.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/list-media.d.ts +19 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/list-media.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/list-media.js +31 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/list-media.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/templates.d.ts +23 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/templates.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/templates.js +72 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/templates.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/upload-media.d.ts +20 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/upload-media.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/upload-media.js +34 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/upload-media.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.d.ts +17 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.js +70 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.js.map +1 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.d.ts +2 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.js +37 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.js.map +1 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.d.ts +7 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.js +18 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.js.map +1 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/index.d.ts +2 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/index.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/index.js +2 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/index.js.map +1 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/index.d.ts +2 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/index.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/index.js +2 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/index.js.map +1 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.d.ts +2 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.js +861 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.js.map +1 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.d.ts +5 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.js +16 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.js.map +1 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-tree.d.ts +53 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-tree.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-tree.js +145 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-tree.js.map +1 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/index.d.ts +2 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/index.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/index.js +2 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/index.js.map +1 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.d.ts +2 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.js +69 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.js.map +1 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.d.ts +7 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.js +18 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.d.ts +6 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.js +178 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.d.ts +3 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.js +55 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.d.ts +12 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.js +125 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.d.ts +8 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.js +582 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/index.d.ts +6 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/index.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/index.js +6 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/index.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.d.ts +4 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.js +54 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/template-form.d.ts +11 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/template-form.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/template-form.js +92 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/template-form.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.d.ts +7 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.js +30 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.d.ts +2 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.js +471 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.d.ts +5 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.js +16 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates.d.ts +43 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates.js +115 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.d.ts +9 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.js +152 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.d.ts +16 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.js +134 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.js.map +1 -0
- package/dist/puck-editor/internal/puck-augmentation.d.ts +28 -0
- package/dist/puck-editor/internal/puck-augmentation.d.ts.map +1 -0
- package/dist/puck-editor/internal/puck-augmentation.js +7 -0
- package/dist/puck-editor/internal/puck-augmentation.js.map +1 -0
- package/dist/puck-editor/internal/puck-editor-provider.d.ts +12 -0
- package/dist/puck-editor/internal/puck-editor-provider.d.ts.map +1 -0
- package/dist/puck-editor/internal/puck-editor-provider.js +69 -0
- package/dist/puck-editor/internal/puck-editor-provider.js.map +1 -0
- package/dist/puck-editor/internal/puck-node.d.ts +29 -0
- package/dist/puck-editor/internal/puck-node.d.ts.map +1 -0
- package/dist/puck-editor/internal/puck-node.js +2 -0
- package/dist/puck-editor/internal/puck-node.js.map +1 -0
- package/dist/puck-editor/internal/puck-wrapper.d.ts +19 -0
- package/dist/puck-editor/internal/puck-wrapper.d.ts.map +1 -0
- package/dist/puck-editor/internal/puck-wrapper.js +270 -0
- package/dist/puck-editor/internal/puck-wrapper.js.map +1 -0
- package/dist/puck-editor/internal/render/cropped-image.d.ts +19 -0
- package/dist/puck-editor/internal/render/cropped-image.d.ts.map +1 -0
- package/dist/puck-editor/internal/render/cropped-image.js +126 -0
- package/dist/puck-editor/internal/render/cropped-image.js.map +1 -0
- package/dist/puck-editor/internal/smart-actions/index.d.ts +13 -0
- package/dist/puck-editor/internal/smart-actions/index.d.ts.map +1 -0
- package/dist/puck-editor/internal/smart-actions/index.js +29 -0
- package/dist/puck-editor/internal/smart-actions/index.js.map +1 -0
- package/dist/puck-editor/internal/smart-actions/new-page.d.ts +13 -0
- package/dist/puck-editor/internal/smart-actions/new-page.d.ts.map +1 -0
- package/dist/puck-editor/internal/smart-actions/new-page.js +80 -0
- package/dist/puck-editor/internal/smart-actions/new-page.js.map +1 -0
- package/dist/puck-editor/internal/smart-actions/open-puck-editor.d.ts +2 -0
- package/dist/puck-editor/internal/smart-actions/open-puck-editor.d.ts.map +1 -0
- package/dist/puck-editor/internal/smart-actions/open-puck-editor.js +65 -0
- package/dist/puck-editor/internal/smart-actions/open-puck-editor.js.map +1 -0
- package/dist/puck-editor/internal/ui/calendar.d.ts +9 -0
- package/dist/puck-editor/internal/ui/calendar.d.ts.map +1 -0
- package/dist/puck-editor/internal/ui/calendar.js +147 -0
- package/dist/puck-editor/internal/ui/calendar.js.map +1 -0
- package/dist/puck-editor/internal/ui/component-list-accordion.d.ts +13 -0
- package/dist/puck-editor/internal/ui/component-list-accordion.d.ts.map +1 -0
- package/dist/puck-editor/internal/ui/component-list-accordion.js +93 -0
- package/dist/puck-editor/internal/ui/component-list-accordion.js.map +1 -0
- package/dist/puck-editor/internal/ui/dialog.d.ts +20 -0
- package/dist/puck-editor/internal/ui/dialog.d.ts.map +1 -0
- package/dist/puck-editor/internal/ui/dialog.js +286 -0
- package/dist/puck-editor/internal/ui/dialog.js.map +1 -0
- package/dist/puck-editor/internal/ui/drawer-item-content.d.ts +11 -0
- package/dist/puck-editor/internal/ui/drawer-item-content.d.ts.map +1 -0
- package/dist/puck-editor/internal/ui/drawer-item-content.js +109 -0
- package/dist/puck-editor/internal/ui/drawer-item-content.js.map +1 -0
- package/dist/puck-editor/internal/ui/icon-button.d.ts +10 -0
- package/dist/puck-editor/internal/ui/icon-button.d.ts.map +1 -0
- package/dist/puck-editor/internal/ui/icon-button.js +72 -0
- package/dist/puck-editor/internal/ui/icon-button.js.map +1 -0
- package/dist/puck-editor/internal/ui/popover.d.ts +9 -0
- package/dist/puck-editor/internal/ui/popover.d.ts.map +1 -0
- package/dist/puck-editor/internal/ui/popover.js +165 -0
- package/dist/puck-editor/internal/ui/popover.js.map +1 -0
- package/dist/puck-editor/internal/ui/required-mark.d.ts +2 -0
- package/dist/puck-editor/internal/ui/required-mark.d.ts.map +1 -0
- package/dist/puck-editor/internal/ui/required-mark.js +12 -0
- package/dist/puck-editor/internal/ui/required-mark.js.map +1 -0
- package/dist/puck-editor/internal/ui/search-control.d.ts +20 -0
- package/dist/puck-editor/internal/ui/search-control.d.ts.map +1 -0
- package/dist/puck-editor/internal/ui/search-control.js +156 -0
- package/dist/puck-editor/internal/ui/search-control.js.map +1 -0
- package/dist/puck-editor/internal/ui/use-panel-search-focus.d.ts +2 -0
- package/dist/puck-editor/internal/ui/use-panel-search-focus.d.ts.map +1 -0
- package/dist/puck-editor/internal/ui/use-panel-search-focus.js +40 -0
- package/dist/puck-editor/internal/ui/use-panel-search-focus.js.map +1 -0
- package/dist/puck-editor/internal/use-puck-overlay.d.ts +16 -0
- package/dist/puck-editor/internal/use-puck-overlay.d.ts.map +1 -0
- package/dist/puck-editor/internal/use-puck-overlay.js +121 -0
- package/dist/puck-editor/internal/use-puck-overlay.js.map +1 -0
- package/dist/puck-editor/internal/utils.d.ts +6 -0
- package/dist/puck-editor/internal/utils.d.ts.map +1 -0
- package/dist/puck-editor/internal/utils.js +57 -0
- package/dist/puck-editor/internal/utils.js.map +1 -0
- package/dist/puck-editor/puck-theme.css +110 -0
- package/dist/puck-editor/render.d.ts +3 -0
- package/dist/puck-editor/render.d.ts.map +1 -0
- package/dist/puck-editor/render.js +2 -0
- package/dist/puck-editor/render.js.map +1 -0
- package/dist/puck-editor/server.d.ts +4 -0
- package/dist/puck-editor/server.d.ts.map +1 -0
- package/dist/puck-editor/server.js +4 -0
- package/dist/puck-editor/server.js.map +1 -0
- package/dist/puck-editor/smart-actions.d.ts +2 -0
- package/dist/puck-editor/smart-actions.d.ts.map +1 -0
- package/dist/puck-editor/smart-actions.js +2 -0
- package/dist/puck-editor/smart-actions.js.map +1 -0
- package/dist/shared/cn.d.ts +3 -0
- package/dist/shared/cn.d.ts.map +1 -0
- package/dist/shared/cn.js +9 -0
- package/dist/shared/cn.js.map +1 -0
- package/dist/shared/i18n.d.ts +5 -0
- package/dist/shared/i18n.d.ts.map +1 -0
- package/dist/shared/i18n.js +18 -0
- package/dist/shared/i18n.js.map +1 -0
- package/dist/shared/toolbar-action.d.ts +9 -0
- package/dist/shared/toolbar-action.d.ts.map +1 -0
- package/dist/shared/toolbar-action.js +2 -0
- package/dist/shared/toolbar-action.js.map +1 -0
- package/dist/smart-actions/internal/get-smart-actions-context.d.ts +19 -0
- package/dist/smart-actions/internal/get-smart-actions-context.d.ts.map +1 -0
- package/dist/smart-actions/internal/get-smart-actions-context.js +24 -0
- package/dist/smart-actions/internal/get-smart-actions-context.js.map +1 -0
- package/dist/smart-actions/internal/i18n.d.ts +20 -0
- package/dist/smart-actions/internal/i18n.d.ts.map +1 -0
- package/dist/smart-actions/internal/i18n.js +35 -0
- package/dist/smart-actions/internal/i18n.js.map +1 -0
- package/dist/smart-actions/internal/logout-form.d.ts +8 -0
- package/dist/smart-actions/internal/logout-form.d.ts.map +1 -0
- package/dist/smart-actions/internal/logout-form.js +88 -0
- package/dist/smart-actions/internal/logout-form.js.map +1 -0
- package/dist/smart-actions/internal/refresh-page.d.ts +2 -0
- package/dist/smart-actions/internal/refresh-page.d.ts.map +1 -0
- package/dist/smart-actions/internal/refresh-page.js +126 -0
- package/dist/smart-actions/internal/refresh-page.js.map +1 -0
- package/dist/smart-actions/internal/smart-actions-button.d.ts +24 -0
- package/dist/smart-actions/internal/smart-actions-button.d.ts.map +1 -0
- package/dist/smart-actions/internal/smart-actions-button.js +41 -0
- package/dist/smart-actions/internal/smart-actions-button.js.map +1 -0
- package/dist/smart-actions/internal/smart-actions-config.d.ts +13 -0
- package/dist/smart-actions/internal/smart-actions-config.d.ts.map +1 -0
- package/dist/smart-actions/internal/smart-actions-config.js +101 -0
- package/dist/smart-actions/internal/smart-actions-config.js.map +1 -0
- package/dist/smart-actions/internal/smart-actions-toolbar-client.d.ts +15 -0
- package/dist/smart-actions/internal/smart-actions-toolbar-client.d.ts.map +1 -0
- package/dist/smart-actions/internal/smart-actions-toolbar-client.js +71 -0
- package/dist/smart-actions/internal/smart-actions-toolbar-client.js.map +1 -0
- package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.d.ts +13 -0
- package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.d.ts.map +1 -0
- package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.js +323 -0
- package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.js.map +1 -0
- package/dist/smart-actions/internal/toolbar/storage.d.ts +7 -0
- package/dist/smart-actions/internal/toolbar/storage.d.ts.map +1 -0
- package/dist/smart-actions/internal/toolbar/storage.js +29 -0
- package/dist/smart-actions/internal/toolbar/storage.js.map +1 -0
- package/dist/smart-actions/internal/toolbar/types.d.ts +4 -0
- package/dist/smart-actions/internal/toolbar/types.d.ts.map +1 -0
- package/dist/smart-actions/internal/toolbar/types.js +2 -0
- package/dist/smart-actions/internal/toolbar/types.js.map +1 -0
- package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.d.ts +6 -0
- package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.d.ts.map +1 -0
- package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.js +43 -0
- package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.js.map +1 -0
- package/dist/smart-actions/internal/ui/tooltip.d.ts +8 -0
- package/dist/smart-actions/internal/ui/tooltip.d.ts.map +1 -0
- package/dist/smart-actions/internal/ui/tooltip.js +156 -0
- package/dist/smart-actions/internal/ui/tooltip.js.map +1 -0
- package/dist/smart-actions/internal/user-profile.d.ts +8 -0
- package/dist/smart-actions/internal/user-profile.d.ts.map +1 -0
- package/dist/smart-actions/internal/user-profile.js +30 -0
- package/dist/smart-actions/internal/user-profile.js.map +1 -0
- package/dist/smart-actions/server.d.ts +4 -0
- package/dist/smart-actions/server.d.ts.map +1 -0
- package/dist/smart-actions/server.js +4 -0
- package/dist/smart-actions/server.js.map +1 -0
- package/dist/theme.css +2 -0
- package/dist/visual-editor/index.d.ts +4 -0
- package/dist/visual-editor/index.d.ts.map +1 -0
- package/dist/visual-editor/index.js +4 -0
- package/dist/visual-editor/index.js.map +1 -0
- package/dist/visual-editor/internal/bridge/connector.d.ts +7 -0
- package/dist/visual-editor/internal/bridge/connector.d.ts.map +1 -0
- package/dist/visual-editor/internal/bridge/connector.js +72 -0
- package/dist/visual-editor/internal/bridge/connector.js.map +1 -0
- package/dist/visual-editor/internal/bridge/draft-mode-self-heal.d.ts +8 -0
- package/dist/visual-editor/internal/bridge/draft-mode-self-heal.d.ts.map +1 -0
- package/dist/visual-editor/internal/bridge/draft-mode-self-heal.js +44 -0
- package/dist/visual-editor/internal/bridge/draft-mode-self-heal.js.map +1 -0
- package/dist/visual-editor/internal/bridge/editor-auth-gate-server.d.ts +16 -0
- package/dist/visual-editor/internal/bridge/editor-auth-gate-server.d.ts.map +1 -0
- package/dist/visual-editor/internal/bridge/editor-auth-gate-server.js +43 -0
- package/dist/visual-editor/internal/bridge/editor-auth-gate-server.js.map +1 -0
- package/dist/visual-editor/internal/bridge/editor-auth-gate.d.ts +15 -0
- package/dist/visual-editor/internal/bridge/editor-auth-gate.d.ts.map +1 -0
- package/dist/visual-editor/internal/bridge/editor-auth-gate.js +146 -0
- package/dist/visual-editor/internal/bridge/editor-auth-gate.js.map +1 -0
- package/dist/visual-editor/internal/i18n.d.ts +29 -0
- package/dist/visual-editor/internal/i18n.d.ts.map +1 -0
- package/dist/visual-editor/internal/i18n.js +51 -0
- package/dist/visual-editor/internal/i18n.js.map +1 -0
- package/dist/visual-editor/internal/overlays/drupal-origin.d.ts +7 -0
- package/dist/visual-editor/internal/overlays/drupal-origin.d.ts.map +1 -0
- package/dist/visual-editor/internal/overlays/drupal-origin.js +15 -0
- package/dist/visual-editor/internal/overlays/drupal-origin.js.map +1 -0
- package/dist/visual-editor/internal/overlays/edit-button.d.ts +10 -0
- package/dist/visual-editor/internal/overlays/edit-button.d.ts.map +1 -0
- package/dist/visual-editor/internal/overlays/edit-button.js +138 -0
- package/dist/visual-editor/internal/overlays/edit-button.js.map +1 -0
- package/dist/visual-editor/internal/overlays/edit-icon.d.ts +3 -0
- package/dist/visual-editor/internal/overlays/edit-icon.d.ts.map +1 -0
- package/dist/visual-editor/internal/overlays/edit-icon.js +19 -0
- package/dist/visual-editor/internal/overlays/edit-icon.js.map +1 -0
- package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.d.ts +15 -0
- package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.d.ts.map +1 -0
- package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.js +52 -0
- package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.js.map +1 -0
- package/dist/visual-editor/internal/overlays/iframe-wrapper.d.ts +6 -0
- package/dist/visual-editor/internal/overlays/iframe-wrapper.d.ts.map +1 -0
- package/dist/visual-editor/internal/overlays/iframe-wrapper.js +42 -0
- package/dist/visual-editor/internal/overlays/iframe-wrapper.js.map +1 -0
- package/dist/visual-editor/internal/overlays/menu/menu-wrapper.d.ts +9 -0
- package/dist/visual-editor/internal/overlays/menu/menu-wrapper.d.ts.map +1 -0
- package/dist/visual-editor/internal/overlays/menu/menu-wrapper.js +33 -0
- package/dist/visual-editor/internal/overlays/menu/menu-wrapper.js.map +1 -0
- package/dist/visual-editor/internal/overlays/node/node-metadata.d.ts +13 -0
- package/dist/visual-editor/internal/overlays/node/node-metadata.d.ts.map +1 -0
- package/dist/visual-editor/internal/overlays/node/node-metadata.js +17 -0
- package/dist/visual-editor/internal/overlays/node/node-metadata.js.map +1 -0
- package/dist/visual-editor/internal/overlays/node/node-wrapper.d.ts +8 -0
- package/dist/visual-editor/internal/overlays/node/node-wrapper.d.ts.map +1 -0
- package/dist/visual-editor/internal/overlays/node/node-wrapper.js +25 -0
- package/dist/visual-editor/internal/overlays/node/node-wrapper.js.map +1 -0
- package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.d.ts +18 -0
- package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.d.ts.map +1 -0
- package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.js +58 -0
- package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.js.map +1 -0
- package/dist/visual-editor/internal/revalidate-route.d.ts +19 -0
- package/dist/visual-editor/internal/revalidate-route.d.ts.map +1 -0
- package/dist/visual-editor/internal/revalidate-route.js +51 -0
- package/dist/visual-editor/internal/revalidate-route.js.map +1 -0
- package/dist/visual-editor/server.d.ts +7 -0
- package/dist/visual-editor/server.d.ts.map +1 -0
- package/dist/visual-editor/server.js +8 -0
- package/dist/visual-editor/server.js.map +1 -0
- package/package.json +154 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { NextResponse } from 'next/server';
|
|
2
|
+
import { enablePersistentDraftMode, shouldEnableDraftMode } from '../draft-mode';
|
|
3
|
+
import { clearAuthCookies, isAuthFailure, refreshSession } from '../refresh';
|
|
4
|
+
|
|
5
|
+
// The primary refresh path is the silent middleware refresh in src/proxy.ts;
|
|
6
|
+
// this route exposes the same race-protected primitive for explicit triggers.
|
|
7
|
+
export async function handleRefresh(request, config) {
|
|
8
|
+
const response = NextResponse.json({
|
|
9
|
+
ok: true
|
|
10
|
+
}, {
|
|
11
|
+
status: 200
|
|
12
|
+
});
|
|
13
|
+
try {
|
|
14
|
+
await refreshSession(request, response, config);
|
|
15
|
+
// Session proven valid → also renew the draft cookie's lifetime. The
|
|
16
|
+
// proxy context sees the user_details the refresh just wrote.
|
|
17
|
+
if (await shouldEnableDraftMode(config, {
|
|
18
|
+
request,
|
|
19
|
+
response
|
|
20
|
+
})) {
|
|
21
|
+
await enablePersistentDraftMode();
|
|
22
|
+
}
|
|
23
|
+
return response;
|
|
24
|
+
} catch (error) {
|
|
25
|
+
if (isAuthFailure(error)) {
|
|
26
|
+
const unauthorized = NextResponse.json({
|
|
27
|
+
ok: false,
|
|
28
|
+
error: 'invalid_grant'
|
|
29
|
+
}, {
|
|
30
|
+
status: 401
|
|
31
|
+
});
|
|
32
|
+
clearAuthCookies(request, unauthorized);
|
|
33
|
+
return unauthorized;
|
|
34
|
+
}
|
|
35
|
+
console.warn('[OAuth refresh] transient failure', error);
|
|
36
|
+
return NextResponse.json({
|
|
37
|
+
ok: false,
|
|
38
|
+
error: 'unavailable'
|
|
39
|
+
}, {
|
|
40
|
+
status: 503
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=refresh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh.js","names":["NextResponse","enablePersistentDraftMode","shouldEnableDraftMode","clearAuthCookies","isAuthFailure","refreshSession","handleRefresh","request","config","response","json","ok","status","error","unauthorized","console","warn"],"sources":["../../../../src/auth/internal/routes/refresh.ts"],"sourcesContent":["import { NextResponse, type NextRequest } from 'next/server';\n\nimport type { NodeHiveAuthConfig } from '../config';\nimport {\n enablePersistentDraftMode,\n shouldEnableDraftMode,\n} from '../draft-mode';\nimport { clearAuthCookies, isAuthFailure, refreshSession } from '../refresh';\n\n// The primary refresh path is the silent middleware refresh in src/proxy.ts;\n// this route exposes the same race-protected primitive for explicit triggers.\nexport async function handleRefresh(\n request: NextRequest,\n config: NodeHiveAuthConfig\n) {\n const response = NextResponse.json({ ok: true }, { status: 200 });\n\n try {\n await refreshSession(request, response, config);\n // Session proven valid → also renew the draft cookie's lifetime. The\n // proxy context sees the user_details the refresh just wrote.\n if (await shouldEnableDraftMode(config, { request, response })) {\n await enablePersistentDraftMode();\n }\n return response;\n } catch (error) {\n if (isAuthFailure(error)) {\n const unauthorized = NextResponse.json(\n { ok: false, error: 'invalid_grant' },\n { status: 401 }\n );\n clearAuthCookies(request, unauthorized);\n return unauthorized;\n }\n console.warn('[OAuth refresh] transient failure', error);\n return NextResponse.json(\n { ok: false, error: 'unavailable' },\n { status: 503 }\n );\n }\n}\n"],"mappings":"AAAA,SAASA,YAAY,QAA0B,aAAa;AAG5D,SACEC,yBAAyB,EACzBC,qBAAqB,QAChB,eAAe;AACtB,SAASC,gBAAgB,EAAEC,aAAa,EAAEC,cAAc,QAAQ,YAAY;;AAE5E;AACA;AACA,OAAO,eAAeC,aAAaA,CACjCC,OAAoB,EACpBC,MAA0B,EAC1B;EACA,MAAMC,QAAQ,GAAGT,YAAY,CAACU,IAAI,CAAC;IAAEC,EAAE,EAAE;EAAK,CAAC,EAAE;IAAEC,MAAM,EAAE;EAAI,CAAC,CAAC;EAEjE,IAAI;IACF,MAAMP,cAAc,CAACE,OAAO,EAAEE,QAAQ,EAAED,MAAM,CAAC;IAC/C;IACA;IACA,IAAI,MAAMN,qBAAqB,CAACM,MAAM,EAAE;MAAED,OAAO;MAAEE;IAAS,CAAC,CAAC,EAAE;MAC9D,MAAMR,yBAAyB,CAAC,CAAC;IACnC;IACA,OAAOQ,QAAQ;EACjB,CAAC,CAAC,OAAOI,KAAK,EAAE;IACd,IAAIT,aAAa,CAACS,KAAK,CAAC,EAAE;MACxB,MAAMC,YAAY,GAAGd,YAAY,CAACU,IAAI,CACpC;QAAEC,EAAE,EAAE,KAAK;QAAEE,KAAK,EAAE;MAAgB,CAAC,EACrC;QAAED,MAAM,EAAE;MAAI,CAChB,CAAC;MACDT,gBAAgB,CAACI,OAAO,EAAEO,YAAY,CAAC;MACvC,OAAOA,YAAY;IACrB;IACAC,OAAO,CAACC,IAAI,CAAC,mCAAmC,EAAEH,KAAK,CAAC;IACxD,OAAOb,YAAY,CAACU,IAAI,CACtB;MAAEC,EAAE,EAAE,KAAK;MAAEE,KAAK,EAAE;IAAc,CAAC,EACnC;MAAED,MAAM,EAAE;IAAI,CAChB,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NextRequest } from 'next/server';
|
|
2
|
+
/**
|
|
3
|
+
* CSRF defense: a genuine same-origin request (e.g. a Puck save from the editor
|
|
4
|
+
* iframe) sends `Sec-Fetch-Site: same-origin`, which a cross-site browser cannot
|
|
5
|
+
* forge. No Origin/Host fallback — that header is spoofable by non-browser clients.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isSameOriginRequest(request: NextRequest): boolean;
|
|
8
|
+
//# sourceMappingURL=same-origin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"same-origin.d.ts","sourceRoot":"","sources":["../../../src/auth/internal/same-origin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAEjE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSRF defense: a genuine same-origin request (e.g. a Puck save from the editor
|
|
3
|
+
* iframe) sends `Sec-Fetch-Site: same-origin`, which a cross-site browser cannot
|
|
4
|
+
* forge. No Origin/Host fallback — that header is spoofable by non-browser clients.
|
|
5
|
+
*/
|
|
6
|
+
export function isSameOriginRequest(request) {
|
|
7
|
+
return request.headers.get('sec-fetch-site') === 'same-origin';
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=same-origin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"same-origin.js","names":["isSameOriginRequest","request","headers","get"],"sources":["../../../src/auth/internal/same-origin.ts"],"sourcesContent":["import type { NextRequest } from 'next/server';\n\n/**\n * CSRF defense: a genuine same-origin request (e.g. a Puck save from the editor\n * iframe) sends `Sec-Fetch-Site: same-origin`, which a cross-site browser cannot\n * forge. No Origin/Host fallback — that header is spoofable by non-browser clients.\n */\nexport function isSameOriginRequest(request: NextRequest): boolean {\n return request.headers.get('sec-fetch-site') === 'same-origin';\n}\n"],"mappings":"AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,mBAAmBA,CAACC,OAAoB,EAAW;EACjE,OAAOA,OAAO,CAACC,OAAO,CAACC,GAAG,CAAC,gBAAgB,CAAC,KAAK,aAAa;AAChE","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface SessionGateProps {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
}
|
|
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)>;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=session-gates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-gates.d.ts","sourceRoot":"","sources":["../../../src/auth/internal/session-gates.tsx"],"names":[],"mappings":"AAEA,UAAU,gBAAgB;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAsB,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE,gBAAgB,wWAE5D;AAED,wBAAsB,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,gBAAgB,wWAE7D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { checkHasSession } from './has-session';
|
|
2
|
+
export async function SignedIn({
|
|
3
|
+
children
|
|
4
|
+
}) {
|
|
5
|
+
return (await checkHasSession()) ? children : null;
|
|
6
|
+
}
|
|
7
|
+
export async function SignedOut({
|
|
8
|
+
children
|
|
9
|
+
}) {
|
|
10
|
+
return (await checkHasSession()) ? null : children;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=session-gates.js.map
|
|
@@ -0,0 +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":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { NextRequest, NextResponse } from 'next/server';
|
|
2
|
+
import type { NodeHiveAuthConfig } from './config';
|
|
3
|
+
export interface UpdateSessionResult {
|
|
4
|
+
/** Refresh token invalid/expired — caller must clear cookies and start a fresh
|
|
5
|
+
* login. Caller builds the response (401 for /api, redirect for pages). */
|
|
6
|
+
authFailed: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Silent token refresh for the middleware (Supabase `updateSession` pattern).
|
|
10
|
+
* Owns the prefetch shortcut + shouldRefresh decision. Mutates request.cookies
|
|
11
|
+
* and sets Set-Cookie on `response` (caller must create it with `{ request }`).
|
|
12
|
+
*
|
|
13
|
+
* Returns authFailed as DATA, not a response: the 401-vs-redirect choice needs
|
|
14
|
+
* isApi + the public origin, which are proxy.ts's concern.
|
|
15
|
+
*/
|
|
16
|
+
export declare function updateSession(request: NextRequest, response: NextResponse, config: NodeHiveAuthConfig): Promise<UpdateSessionResult>;
|
|
17
|
+
//# sourceMappingURL=update-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-session.d.ts","sourceRoot":"","sources":["../../../src/auth/internal/update-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGnD,MAAM,WAAW,mBAAmB;IAClC;gFAC4E;IAC5E,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,mBAAmB,CAAC,CAwB9B"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { isAuthFailure, refreshSession, shouldRefreshSession } from './refresh';
|
|
2
|
+
/**
|
|
3
|
+
* Silent token refresh for the middleware (Supabase `updateSession` pattern).
|
|
4
|
+
* Owns the prefetch shortcut + shouldRefresh decision. Mutates request.cookies
|
|
5
|
+
* and sets Set-Cookie on `response` (caller must create it with `{ request }`).
|
|
6
|
+
*
|
|
7
|
+
* Returns authFailed as DATA, not a response: the 401-vs-redirect choice needs
|
|
8
|
+
* isApi + the public origin, which are proxy.ts's concern.
|
|
9
|
+
*/
|
|
10
|
+
export async function updateSession(request, response, config) {
|
|
11
|
+
// A Next prefetch must never consume the single-use refresh token.
|
|
12
|
+
if (request.headers.get('next-router-prefetch') === '1') {
|
|
13
|
+
return {
|
|
14
|
+
authFailed: false
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
if (!shouldRefreshSession(request)) {
|
|
18
|
+
return {
|
|
19
|
+
authFailed: false
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
await refreshSession(request, response, config);
|
|
24
|
+
return {
|
|
25
|
+
authFailed: false
|
|
26
|
+
};
|
|
27
|
+
} catch (error) {
|
|
28
|
+
if (isAuthFailure(error)) {
|
|
29
|
+
return {
|
|
30
|
+
authFailed: true
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
console.warn('[nodehive-auth] Token refresh failed (transient), keeping session:', error);
|
|
34
|
+
return {
|
|
35
|
+
authFailed: false
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=update-session.js.map
|
|
@@ -0,0 +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":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type EditorLoginPhase = 'login' | 'activate' | 'working';
|
|
2
|
+
export interface UseEditorLoginOptions {
|
|
3
|
+
/** OAuth login route. Default '/api/auth/login'. */
|
|
4
|
+
loginPath?: string;
|
|
5
|
+
/** Popup landing that relays the CHIPS handoff. Default '/api/auth/popup-done'. */
|
|
6
|
+
popupReturnTo?: string;
|
|
7
|
+
/** CHIPS exchange route. Default '/api/auth/chips-exchange'. */
|
|
8
|
+
chipsExchangePath?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface EditorLogin {
|
|
11
|
+
/** null until measured on mount; false when not embedded in an iframe. */
|
|
12
|
+
inIframe: boolean | null;
|
|
13
|
+
phase: EditorLoginPhase;
|
|
14
|
+
/** Storage-access activation failed — render your own error copy. */
|
|
15
|
+
error: boolean;
|
|
16
|
+
/** Open the OAuth login popup (the `login` step). */
|
|
17
|
+
signIn: () => void;
|
|
18
|
+
/** Request storage access then reload (the `activate` fallback step). */
|
|
19
|
+
activate: () => Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
/** Read and clear the "just logged in" flag set before a post-login reload. */
|
|
22
|
+
export declare function consumeJustLoggedIn(): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Client flow for the cross-site editor-iframe login (CHIPS). Headless — render
|
|
25
|
+
* your own banner from the returned state. Pair with `createAuthRouteHandlers`
|
|
26
|
+
* (login / popup-done / chips-exchange) on the server.
|
|
27
|
+
*
|
|
28
|
+
* Single click where CHIPS / partitioned cookies work (Chromium 114+, Safari
|
|
29
|
+
* 26.2+ and 18.4, Firefox). The `activate` (Storage Access) step is the fallback
|
|
30
|
+
* for browsers that can't read the partitioned cookie (Safari 18.5–26.1, older).
|
|
31
|
+
*/
|
|
32
|
+
export declare function useEditorLogin(authenticated: boolean, options?: UseEditorLoginOptions): EditorLogin;
|
|
33
|
+
//# sourceMappingURL=use-editor-login.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-editor-login.d.ts","sourceRoot":"","sources":["../../../src/auth/internal/use-editor-login.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;AAEhE,MAAM,WAAW,qBAAqB;IACpC,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mFAAmF;IACnF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW;IAC1B,0EAA0E;IAC1E,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,gBAAgB,CAAC;IACxB,qEAAqE;IACrE,KAAK,EAAE,OAAO,CAAC;IACf,qDAAqD;IACrD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,yEAAyE;IACzE,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B;AAmBD,+EAA+E;AAC/E,wBAAgB,mBAAmB,IAAI,OAAO,CAQ7C;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,aAAa,EAAE,OAAO,EACtB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,WAAW,CA0Gb"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef, useState } from 'react';
|
|
4
|
+
// Set before a CHIPS reload so that, if we land back here still unauthenticated
|
|
5
|
+
// (the browser dropped the partitioned cookie, e.g. Safari < 26.2), we fall
|
|
6
|
+
// through to the storage-access step instead of looping on the login step.
|
|
7
|
+
const CHIPS_TRIED_KEY = 'nh:chips-tried';
|
|
8
|
+
|
|
9
|
+
// Set right before a post-login reload so the banner can show a success toast
|
|
10
|
+
// once the page comes back (a toast fired before the reload wouldn't survive it).
|
|
11
|
+
const JUST_LOGGED_IN_KEY = 'nh:just-logged-in';
|
|
12
|
+
function markJustLoggedIn() {
|
|
13
|
+
try {
|
|
14
|
+
sessionStorage.setItem(JUST_LOGGED_IN_KEY, '1');
|
|
15
|
+
} catch {
|
|
16
|
+
// sessionStorage unavailable — no toast, login still works
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Read and clear the "just logged in" flag set before a post-login reload. */
|
|
21
|
+
export function consumeJustLoggedIn() {
|
|
22
|
+
try {
|
|
23
|
+
if (!sessionStorage.getItem(JUST_LOGGED_IN_KEY)) return false;
|
|
24
|
+
sessionStorage.removeItem(JUST_LOGGED_IN_KEY);
|
|
25
|
+
return true;
|
|
26
|
+
} catch {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Client flow for the cross-site editor-iframe login (CHIPS). Headless — render
|
|
33
|
+
* your own banner from the returned state. Pair with `createAuthRouteHandlers`
|
|
34
|
+
* (login / popup-done / chips-exchange) on the server.
|
|
35
|
+
*
|
|
36
|
+
* Single click where CHIPS / partitioned cookies work (Chromium 114+, Safari
|
|
37
|
+
* 26.2+ and 18.4, Firefox). The `activate` (Storage Access) step is the fallback
|
|
38
|
+
* for browsers that can't read the partitioned cookie (Safari 18.5–26.1, older).
|
|
39
|
+
*/
|
|
40
|
+
export function useEditorLogin(authenticated, options) {
|
|
41
|
+
const loginPath = options?.loginPath ?? '/api/auth/login';
|
|
42
|
+
const popupReturnTo = options?.popupReturnTo ?? '/api/auth/popup-done';
|
|
43
|
+
const chipsExchangePath = options?.chipsExchangePath ?? '/api/auth/chips-exchange';
|
|
44
|
+
const [inIframe, setInIframe] = useState(null);
|
|
45
|
+
const [phase, setPhase] = useState('login');
|
|
46
|
+
const [error, setError] = useState(false);
|
|
47
|
+
const popupRef = useRef(null);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
const embedded = window.self !== window.top;
|
|
50
|
+
// Measured post-mount (not a lazy initializer) so SSR and the first client
|
|
51
|
+
// render agree on `null` — reading window during render would risk a
|
|
52
|
+
// hydration mismatch.
|
|
53
|
+
// eslint-disable-next-line react-hooks/set-state-in-effect -- SSR-safe iframe detection
|
|
54
|
+
setInIframe(embedded);
|
|
55
|
+
if (!embedded) return;
|
|
56
|
+
|
|
57
|
+
// Back here after a CHIPS exchange that didn't stick → go straight to the
|
|
58
|
+
// storage-access step rather than re-prompting a full login.
|
|
59
|
+
try {
|
|
60
|
+
if (sessionStorage.getItem(CHIPS_TRIED_KEY)) {
|
|
61
|
+
sessionStorage.removeItem(CHIPS_TRIED_KEY);
|
|
62
|
+
if (!authenticated) setPhase('activate');
|
|
63
|
+
}
|
|
64
|
+
} catch {
|
|
65
|
+
// sessionStorage unavailable — stay on the login step
|
|
66
|
+
}
|
|
67
|
+
const onMessage = event => {
|
|
68
|
+
// Only accept the message from the popup we opened (origin alone would let
|
|
69
|
+
// 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;
|
|
73
|
+
const handoff = event.data.handoff;
|
|
74
|
+
void (async () => {
|
|
75
|
+
// CHIPS path: exchange the handoff so the iframe mints partitioned
|
|
76
|
+
// cookies in its own partition → 1 click where CHIPS is supported.
|
|
77
|
+
if (handoff) {
|
|
78
|
+
try {
|
|
79
|
+
const res = await fetch(chipsExchangePath, {
|
|
80
|
+
method: 'POST',
|
|
81
|
+
headers: {
|
|
82
|
+
'content-type': 'application/json'
|
|
83
|
+
},
|
|
84
|
+
body: JSON.stringify({
|
|
85
|
+
handoff
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
if (res.ok) {
|
|
89
|
+
try {
|
|
90
|
+
sessionStorage.setItem(CHIPS_TRIED_KEY, '1');
|
|
91
|
+
} catch {
|
|
92
|
+
// ignore — fallback just won't auto-trigger
|
|
93
|
+
}
|
|
94
|
+
markJustLoggedIn();
|
|
95
|
+
window.location.reload();
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
} catch {
|
|
99
|
+
// fall through to storage access
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
try {
|
|
103
|
+
if (document.hasStorageAccess && (await document.hasStorageAccess())) {
|
|
104
|
+
markJustLoggedIn();
|
|
105
|
+
window.location.reload();
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
} catch {
|
|
109
|
+
// fall through to the gesture step
|
|
110
|
+
}
|
|
111
|
+
setPhase('activate');
|
|
112
|
+
})();
|
|
113
|
+
};
|
|
114
|
+
window.addEventListener('message', onMessage);
|
|
115
|
+
return () => window.removeEventListener('message', onMessage);
|
|
116
|
+
}, [authenticated, chipsExchangePath]);
|
|
117
|
+
const signIn = () => {
|
|
118
|
+
setError(false);
|
|
119
|
+
popupRef.current = window.open(`${loginPath}?returnTo=${encodeURIComponent(popupReturnTo)}`, 'nh_editor_login', 'width=520,height=720');
|
|
120
|
+
};
|
|
121
|
+
const activate = async () => {
|
|
122
|
+
setError(false);
|
|
123
|
+
setPhase('working');
|
|
124
|
+
try {
|
|
125
|
+
if (document.requestStorageAccess) {
|
|
126
|
+
await document.requestStorageAccess();
|
|
127
|
+
}
|
|
128
|
+
markJustLoggedIn();
|
|
129
|
+
window.location.reload();
|
|
130
|
+
} catch {
|
|
131
|
+
setError(true);
|
|
132
|
+
setPhase('activate');
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
return {
|
|
136
|
+
inIframe,
|
|
137
|
+
phase,
|
|
138
|
+
error,
|
|
139
|
+
signIn,
|
|
140
|
+
activate
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=use-editor-login.js.map
|
|
@@ -0,0 +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":"AAAA,YAAY;;AAEZ,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAyBnD;AACA;AACA;AACA,MAAMC,eAAe,GAAG,gBAAgB;;AAExC;AACA;AACA,MAAMC,kBAAkB,GAAG,mBAAmB;AAE9C,SAASC,gBAAgBA,CAAA,EAAG;EAC1B,IAAI;IACFC,cAAc,CAACC,OAAO,CAACH,kBAAkB,EAAE,GAAG,CAAC;EACjD,CAAC,CAAC,MAAM;IACN;EAAA;AAEJ;;AAEA;AACA,OAAO,SAASI,mBAAmBA,CAAA,EAAY;EAC7C,IAAI;IACF,IAAI,CAACF,cAAc,CAACG,OAAO,CAACL,kBAAkB,CAAC,EAAE,OAAO,KAAK;IAC7DE,cAAc,CAACI,UAAU,CAACN,kBAAkB,CAAC;IAC7C,OAAO,IAAI;EACb,CAAC,CAAC,MAAM;IACN,OAAO,KAAK;EACd;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASO,cAAcA,CAC5BC,aAAsB,EACtBC,OAA+B,EAClB;EACb,MAAMC,SAAS,GAAGD,OAAO,EAAEC,SAAS,IAAI,iBAAiB;EACzD,MAAMC,aAAa,GAAGF,OAAO,EAAEE,aAAa,IAAI,sBAAsB;EACtE,MAAMC,iBAAiB,GACrBH,OAAO,EAAEG,iBAAiB,IAAI,0BAA0B;EAE1D,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAGhB,QAAQ,CAAiB,IAAI,CAAC;EAC9D,MAAM,CAACiB,KAAK,EAAEC,QAAQ,CAAC,GAAGlB,QAAQ,CAAmB,OAAO,CAAC;EAC7D,MAAM,CAACmB,KAAK,EAAEC,QAAQ,CAAC,GAAGpB,QAAQ,CAAC,KAAK,CAAC;EACzC,MAAMqB,QAAQ,GAAGtB,MAAM,CAAgB,IAAI,CAAC;EAE5CD,SAAS,CAAC,MAAM;IACd,MAAMwB,QAAQ,GAAGC,MAAM,CAACC,IAAI,KAAKD,MAAM,CAACE,GAAG;IAC3C;IACA;IACA;IACA;IACAT,WAAW,CAACM,QAAQ,CAAC;IACrB,IAAI,CAACA,QAAQ,EAAE;;IAEf;IACA;IACA,IAAI;MACF,IAAIlB,cAAc,CAACG,OAAO,CAACN,eAAe,CAAC,EAAE;QAC3CG,cAAc,CAACI,UAAU,CAACP,eAAe,CAAC;QAC1C,IAAI,CAACS,aAAa,EAAEQ,QAAQ,CAAC,UAAU,CAAC;MAC1C;IACF,CAAC,CAAC,MAAM;MACN;IAAA;IAGF,MAAMQ,SAAS,GAAIC,KAAmB,IAAK;MACzC;MACA;MACA,IAAIA,KAAK,CAACC,MAAM,KAAKL,MAAM,CAACM,QAAQ,CAACD,MAAM,EAAE;MAC7C,IAAID,KAAK,CAACG,MAAM,KAAKT,QAAQ,CAACU,OAAO,EAAE;MACvC,IAAIJ,KAAK,CAACK,IAAI,EAAEC,IAAI,KAAK,cAAc,EAAE;MACzC,MAAMC,OAA2B,GAAGP,KAAK,CAACK,IAAI,CAACE,OAAO;MACtD,KAAK,CAAC,YAAY;QAChB;QACA;QACA,IAAIA,OAAO,EAAE;UACX,IAAI;YACF,MAAMC,GAAG,GAAG,MAAMC,KAAK,CAACtB,iBAAiB,EAAE;cACzCuB,MAAM,EAAE,MAAM;cACdC,OAAO,EAAE;gBAAE,cAAc,EAAE;cAAmB,CAAC;cAC/CC,IAAI,EAAEC,IAAI,CAACC,SAAS,CAAC;gBAAEP;cAAQ,CAAC;YAClC,CAAC,CAAC;YACF,IAAIC,GAAG,CAACO,EAAE,EAAE;cACV,IAAI;gBACFtC,cAAc,CAACC,OAAO,CAACJ,eAAe,EAAE,GAAG,CAAC;cAC9C,CAAC,CAAC,MAAM;gBACN;cAAA;cAEFE,gBAAgB,CAAC,CAAC;cAClBoB,MAAM,CAACM,QAAQ,CAACc,MAAM,CAAC,CAAC;cACxB;YACF;UACF,CAAC,CAAC,MAAM;YACN;UAAA;QAEJ;QACA,IAAI;UACF,IACEC,QAAQ,CAACC,gBAAgB,KACxB,MAAMD,QAAQ,CAACC,gBAAgB,CAAC,CAAC,CAAC,EACnC;YACA1C,gBAAgB,CAAC,CAAC;YAClBoB,MAAM,CAACM,QAAQ,CAACc,MAAM,CAAC,CAAC;YACxB;UACF;QACF,CAAC,CAAC,MAAM;UACN;QAAA;QAEFzB,QAAQ,CAAC,UAAU,CAAC;MACtB,CAAC,EAAE,CAAC;IACN,CAAC;IACDK,MAAM,CAACuB,gBAAgB,CAAC,SAAS,EAAEpB,SAAS,CAAC;IAC7C,OAAO,MAAMH,MAAM,CAACwB,mBAAmB,CAAC,SAAS,EAAErB,SAAS,CAAC;EAC/D,CAAC,EAAE,CAAChB,aAAa,EAAEI,iBAAiB,CAAC,CAAC;EAEtC,MAAMkC,MAAM,GAAGA,CAAA,KAAM;IACnB5B,QAAQ,CAAC,KAAK,CAAC;IACfC,QAAQ,CAACU,OAAO,GAAGR,MAAM,CAAC0B,IAAI,CAC5B,GAAGrC,SAAS,aAAasC,kBAAkB,CAACrC,aAAa,CAAC,EAAE,EAC5D,iBAAiB,EACjB,sBACF,CAAC;EACH,CAAC;EAED,MAAMsC,QAAQ,GAAG,MAAAA,CAAA,KAAY;IAC3B/B,QAAQ,CAAC,KAAK,CAAC;IACfF,QAAQ,CAAC,SAAS,CAAC;IACnB,IAAI;MACF,IAAI0B,QAAQ,CAACQ,oBAAoB,EAAE;QACjC,MAAMR,QAAQ,CAACQ,oBAAoB,CAAC,CAAC;MACvC;MACAjD,gBAAgB,CAAC,CAAC;MAClBoB,MAAM,CAACM,QAAQ,CAACc,MAAM,CAAC,CAAC;IAC1B,CAAC,CAAC,MAAM;MACNvB,QAAQ,CAAC,IAAI,CAAC;MACdF,QAAQ,CAAC,UAAU,CAAC;IACtB;EACF,CAAC;EAED,OAAO;IAAEH,QAAQ;IAAEE,KAAK;IAAEE,KAAK;IAAE6B,MAAM;IAAEG;EAAS,CAAC;AACrD","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../src/auth/proxy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,aAAa,EACb,KAAK,mBAAmB,GACzB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
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';
|
|
8
|
+
//# sourceMappingURL=proxy.js.map
|
|
@@ -0,0 +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":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/auth/react.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +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":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/auth/routes.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EACvB,KAAK,gBAAgB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +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":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
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';
|
|
5
|
+
/**
|
|
6
|
+
* Bind the client factories + logout to a project config (explicit injection,
|
|
7
|
+
* no global singleton). Call once in the project and re-export the result.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createNodeHiveAuth(config: NodeHiveAuthConfig): {
|
|
10
|
+
createClient: () => Promise<import("nodehive-js").NodeHiveClient>;
|
|
11
|
+
createUserClient: (proxyContext?: ProxyContext) => import("nodehive-js").NodeHiveClient;
|
|
12
|
+
createAnonClient: () => import("nodehive-js").NodeHiveClient;
|
|
13
|
+
isAuthenticated: typeof checkHasSession;
|
|
14
|
+
performLogout: (options?: PerformLogoutOptions) => Promise<void>;
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/auth/server.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAiB,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAEL,KAAK,YAAY,EAClB,MAAM,gCAAgC,CAAC;AAGxC;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,kBAAkB;;sCAOlB,YAAY;;;8BAsCzB,oBAAoB;EAGjD;AAED,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,YAAY,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Server entry: client factories, editor guard, logout.
|
|
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';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Bind the client factories + logout to a project config (explicit injection,
|
|
10
|
+
* no global singleton). Call once in the project and re-export the result.
|
|
11
|
+
*/
|
|
12
|
+
export function createNodeHiveAuth(config) {
|
|
13
|
+
/**
|
|
14
|
+
* Deliberately act as the logged-in user. Default: use createClient().
|
|
15
|
+
* Binds to the request's session cookies but guarantees no user: without a
|
|
16
|
+
* session the client carries no token (it is NOT the anon client) — use it
|
|
17
|
+
* only where a session is established or where you check isLoggedIn().
|
|
18
|
+
*/
|
|
19
|
+
const createUserClient = proxyContext => buildUserClient(config, proxyContext);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Deliberately act as an anonymous visitor (client_credentials, capped
|
|
23
|
+
* rights). Default: use createClient(). One instance per runtime since the
|
|
24
|
+
* credential never rotates.
|
|
25
|
+
*/
|
|
26
|
+
let anonClient = null;
|
|
27
|
+
const createAnonClient = () => {
|
|
28
|
+
if (anonClient) return anonClient;
|
|
29
|
+
anonClient = buildAnonClient(config);
|
|
30
|
+
return anonClient;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The default client: user client when a usable access token is present,
|
|
35
|
+
* else the anon client. Memoized per request via React cache().
|
|
36
|
+
*
|
|
37
|
+
* Checks the short-lived access token, not the refresh token: only the
|
|
38
|
+
* proxy may refresh (rotated tokens can't be persisted from RSCs), so the
|
|
39
|
+
* user client is only picked when a request-ready token exists. "Is the
|
|
40
|
+
* user logged in?" is a different question — that's isAuthenticated, which
|
|
41
|
+
* checks the durable refresh token.
|
|
42
|
+
*/
|
|
43
|
+
const createClient = cache(async () => {
|
|
44
|
+
const storage = new NextCookieStorage();
|
|
45
|
+
const token = await storage.get('token');
|
|
46
|
+
return token ? createUserClient() : createAnonClient();
|
|
47
|
+
});
|
|
48
|
+
const isAuthenticated = cache(checkHasSession);
|
|
49
|
+
return {
|
|
50
|
+
createClient,
|
|
51
|
+
createUserClient,
|
|
52
|
+
createAnonClient,
|
|
53
|
+
isAuthenticated,
|
|
54
|
+
performLogout: options => performLogout(config, options)
|
|
55
|
+
};
|
|
56
|
+
}
|
|
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';
|
|
61
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +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":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../src/puck-editor/fields.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,uDAAuD,CAAC;AACvF,YAAY,EACV,cAAc,EACd,UAAU,EACV,SAAS,EACT,eAAe,GAChB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,oDAAoD,CAAC;AACrF,YAAY,EACV,cAAc,EACd,YAAY,EACZ,kBAAkB,GACnB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,cAAc,EACd,UAAU,EACV,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACd,KAAK,YAAY,GAClB,MAAM,0CAA0C,CAAC"}
|
|
@@ -0,0 +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';
|
|
4
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +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":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import './internal/puck-augmentation';
|
|
2
|
+
export { default as PuckWrapper } from './internal/puck-wrapper';
|
|
3
|
+
export { usePuckOverlay } from './internal/use-puck-overlay';
|
|
4
|
+
export { stripInstanceNames } from './internal/utils';
|
|
5
|
+
export { getPuckDictionary, PuckI18nProvider, usePuckDictionary, type PuckDictionary, type PuckDictionaryOverrides, } from './internal/i18n';
|
|
6
|
+
export { MEDIA_TYPES, type MediaType, } from './internal/plugins/agent-plugin/constants';
|
|
7
|
+
export { PuckEditorConfigProvider, usePuckContentModel, usePuckEditorConfig, type PuckEditorConfig, } from './internal/editor-config';
|
|
8
|
+
export { creatableBundles, getBundle, parsePuckData, resolveContentModel, type PuckBundleConfig, type PuckContentModel, type PuckContentModelInput, type PuckMetadataFields, type PuckTemplatesConfig, type ResolvedPuckBundle, } from './internal/content-model';
|
|
9
|
+
export type { PuckNode, PuckNodeMetadataImage } from './internal/puck-node';
|
|
10
|
+
export type { BuiltinTemplate, TemplateAi, TemplateCategory, TemplateEnvelope, } from './internal/plugins/templates-plugin/templates';
|
|
11
|
+
export { localizeConfig, localizeTemplates, type PuckLabelCatalog, } from './internal/localize';
|
|
12
|
+
export { RootDropZone } from './internal/plugins/templates-plugin/root-drop-zone';
|
|
13
|
+
export { PuckEditorProvider, usePuckEditor, } from './internal/puck-editor-provider';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/puck-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,cAAc,EACnB,KAAK,uBAAuB,GAC7B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,WAAW,EACX,KAAK,SAAS,GACf,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,KAAK,gBAAgB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,mBAAmB,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,YAAY,EACV,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAC;AAClF,OAAO,EACL,kBAAkB,EAClB,aAAa,GACd,MAAM,iCAAiC,CAAC"}
|