@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,333 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
4
|
+
import { usePathname } from 'next/navigation';
|
|
5
|
+
import { Puck } from '@puckeditor/core';
|
|
6
|
+
import { toast } from 'sonner';
|
|
7
|
+
import { getBundle } from '../content-model';
|
|
8
|
+
import { usePuckContentModel, usePuckEditorConfig } from '../editor-config';
|
|
9
|
+
import { RequiredFieldLabel } from '../fields/required-field-label';
|
|
10
|
+
import { usePuckDictionary } from '../i18n';
|
|
11
|
+
import { createAgentPlugin } from '../plugins/agent-plugin';
|
|
12
|
+
import { createBlocksPlugin } from '../plugins/blocks-plugin';
|
|
13
|
+
import { createOutlinePlugin } from '../plugins/outline-plugin';
|
|
14
|
+
import { createSectionsPlugin } from '../plugins/sections-plugin';
|
|
15
|
+
import { createTemplatesPlugin, stripTemplateVehicles, useTemplateDnd } from '../plugins/templates-plugin';
|
|
16
|
+
import { CanvasQuickAdd } from './canvas-quick-add';
|
|
17
|
+
import ComponentItem from './component-item';
|
|
18
|
+
import { EditorActionBar } from './editor-action-bar';
|
|
19
|
+
import { EditorHeaderActions } from './editor-header-actions';
|
|
20
|
+
import { findMissingRequiredFields } from './find-missing-required-fields';
|
|
21
|
+
import { publishPuckData } from './publish-puck-data';
|
|
22
|
+
import { SectionTemplateModalHost } from './section-template-modal';
|
|
23
|
+
import '@puckeditor/core/no-external.css';
|
|
24
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
+
function isRelative(url) {
|
|
26
|
+
return !new RegExp('^(?:[a-z]+:)?//', 'i').test(url);
|
|
27
|
+
}
|
|
28
|
+
function getDefaultPageSettings(node, drupalBaseUrl, meta) {
|
|
29
|
+
const metadataImage = meta.image ? node?.[meta.image] : null;
|
|
30
|
+
const mediaImage = metadataImage?.field_media_image;
|
|
31
|
+
const firstMediaImage = Array.isArray(mediaImage) ? mediaImage[0] : mediaImage;
|
|
32
|
+
return {
|
|
33
|
+
title: node?.title || '',
|
|
34
|
+
metadataTitle: meta.title && node?.[meta.title] || '',
|
|
35
|
+
metadataDescription: meta.description && node?.[meta.description] || '',
|
|
36
|
+
metadataImage: metadataImage?.id ? {
|
|
37
|
+
id: metadataImage.id,
|
|
38
|
+
type: metadataImage.type || 'media--image',
|
|
39
|
+
name: metadataImage.name || '',
|
|
40
|
+
thumbnailImage: firstMediaImage?.uri?.url ? isRelative(firstMediaImage.uri.url) ? `${drupalBaseUrl}${firstMediaImage.uri.url}` : firstMediaImage.uri.url : ''
|
|
41
|
+
} : null,
|
|
42
|
+
publishedState: node?.status ? 'published' : 'unpublished',
|
|
43
|
+
urlAlias: node?.path?.alias || ''
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export default function PuckEditor(t0) {
|
|
47
|
+
const $ = _c(52);
|
|
48
|
+
const {
|
|
49
|
+
node,
|
|
50
|
+
fieldName,
|
|
51
|
+
data,
|
|
52
|
+
config,
|
|
53
|
+
closePuckEditor,
|
|
54
|
+
plugins: customizePlugins,
|
|
55
|
+
overrides: projectOverrides
|
|
56
|
+
} = t0;
|
|
57
|
+
const nodeData = node;
|
|
58
|
+
const lang = nodeData?.langcode;
|
|
59
|
+
const pathName = usePathname();
|
|
60
|
+
const tEditor = usePuckDictionary().editor;
|
|
61
|
+
const {
|
|
62
|
+
drupalBaseUrl: t1
|
|
63
|
+
} = usePuckEditorConfig();
|
|
64
|
+
const drupalBaseUrl = t1 === undefined ? "" : t1;
|
|
65
|
+
const model = usePuckContentModel();
|
|
66
|
+
const {
|
|
67
|
+
configWithTemplates,
|
|
68
|
+
onAction,
|
|
69
|
+
captureDispatch
|
|
70
|
+
} = useTemplateDnd(config);
|
|
71
|
+
let t2;
|
|
72
|
+
if ($[0] !== model || $[1] !== nodeData?.type) {
|
|
73
|
+
t2 = getBundle(model, nodeData?.type)?.metadataFields ?? model.bundles[0].metadataFields;
|
|
74
|
+
$[0] = model;
|
|
75
|
+
$[1] = nodeData?.type;
|
|
76
|
+
$[2] = t2;
|
|
77
|
+
} else {
|
|
78
|
+
t2 = $[2];
|
|
79
|
+
}
|
|
80
|
+
const metadataFields = t2;
|
|
81
|
+
let t3;
|
|
82
|
+
if ($[3] !== drupalBaseUrl || $[4] !== metadataFields || $[5] !== nodeData) {
|
|
83
|
+
t3 = getDefaultPageSettings(nodeData, drupalBaseUrl, metadataFields);
|
|
84
|
+
$[3] = drupalBaseUrl;
|
|
85
|
+
$[4] = metadataFields;
|
|
86
|
+
$[5] = nodeData;
|
|
87
|
+
$[6] = t3;
|
|
88
|
+
} else {
|
|
89
|
+
t3 = $[6];
|
|
90
|
+
}
|
|
91
|
+
const defaultPageSettings = t3;
|
|
92
|
+
let t4;
|
|
93
|
+
if ($[7] !== data?.root?.props) {
|
|
94
|
+
t4 = data?.root?.props || {};
|
|
95
|
+
$[7] = data?.root?.props;
|
|
96
|
+
$[8] = t4;
|
|
97
|
+
} else {
|
|
98
|
+
t4 = $[8];
|
|
99
|
+
}
|
|
100
|
+
const rootProps = t4;
|
|
101
|
+
let t5;
|
|
102
|
+
if ($[9] !== data?.root) {
|
|
103
|
+
t5 = data?.root || {};
|
|
104
|
+
$[9] = data?.root;
|
|
105
|
+
$[10] = t5;
|
|
106
|
+
} else {
|
|
107
|
+
t5 = $[10];
|
|
108
|
+
}
|
|
109
|
+
let t6;
|
|
110
|
+
if ($[11] !== defaultPageSettings || $[12] !== rootProps) {
|
|
111
|
+
t6 = {
|
|
112
|
+
...defaultPageSettings,
|
|
113
|
+
...rootProps
|
|
114
|
+
};
|
|
115
|
+
$[11] = defaultPageSettings;
|
|
116
|
+
$[12] = rootProps;
|
|
117
|
+
$[13] = t6;
|
|
118
|
+
} else {
|
|
119
|
+
t6 = $[13];
|
|
120
|
+
}
|
|
121
|
+
const t7 = t6;
|
|
122
|
+
let t8;
|
|
123
|
+
if ($[14] !== t5 || $[15] !== t7) {
|
|
124
|
+
t8 = {
|
|
125
|
+
...t5,
|
|
126
|
+
props: t7
|
|
127
|
+
};
|
|
128
|
+
$[14] = t5;
|
|
129
|
+
$[15] = t7;
|
|
130
|
+
$[16] = t8;
|
|
131
|
+
} else {
|
|
132
|
+
t8 = $[16];
|
|
133
|
+
}
|
|
134
|
+
let t9;
|
|
135
|
+
if ($[17] !== data || $[18] !== t8) {
|
|
136
|
+
t9 = {
|
|
137
|
+
...data,
|
|
138
|
+
root: t8
|
|
139
|
+
};
|
|
140
|
+
$[17] = data;
|
|
141
|
+
$[18] = t8;
|
|
142
|
+
$[19] = t9;
|
|
143
|
+
} else {
|
|
144
|
+
t9 = $[19];
|
|
145
|
+
}
|
|
146
|
+
const editorData = t9;
|
|
147
|
+
let t10;
|
|
148
|
+
if ($[20] !== config || $[21] !== fieldName || $[22] !== lang || $[23] !== nodeData || $[24] !== pathName || $[25] !== tEditor.pageSaved || $[26] !== tEditor.requiredFieldsMissing || $[27] !== tEditor.savePageFailed) {
|
|
149
|
+
t10 = async rawData => {
|
|
150
|
+
const data_0 = stripTemplateVehicles(rawData);
|
|
151
|
+
const rootProps_0 = data_0?.root?.props || {};
|
|
152
|
+
const {
|
|
153
|
+
title: t11,
|
|
154
|
+
metadataTitle: t12,
|
|
155
|
+
metadataDescription: t13,
|
|
156
|
+
metadataImage: t14,
|
|
157
|
+
publishedState: t15,
|
|
158
|
+
urlAlias: t16,
|
|
159
|
+
...contentRootProps
|
|
160
|
+
} = rootProps_0;
|
|
161
|
+
const title = t11 === undefined ? "" : t11;
|
|
162
|
+
const metadataTitle = t12 === undefined ? "" : t12;
|
|
163
|
+
const metadataDescription = t13 === undefined ? "" : t13;
|
|
164
|
+
const metadataImage = t14 === undefined ? null : t14;
|
|
165
|
+
const publishedState = t15 === undefined ? "unpublished" : t15;
|
|
166
|
+
const urlAlias = t16 === undefined ? "" : t16;
|
|
167
|
+
if (publishedState === "published") {
|
|
168
|
+
const missing = findMissingRequiredFields(config, data_0);
|
|
169
|
+
if (missing.length > 0) {
|
|
170
|
+
toast.error(tEditor.requiredFieldsMissing, {
|
|
171
|
+
description: missing.map(_temp).join(", ")
|
|
172
|
+
});
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
const puckData = {
|
|
177
|
+
...data_0,
|
|
178
|
+
root: {
|
|
179
|
+
...(data_0?.root || {}),
|
|
180
|
+
props: contentRootProps
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
await publishPuckData({
|
|
184
|
+
data: puckData,
|
|
185
|
+
pageSettings: {
|
|
186
|
+
title,
|
|
187
|
+
metadataTitle,
|
|
188
|
+
metadataDescription,
|
|
189
|
+
metadataImage,
|
|
190
|
+
published: publishedState === "published",
|
|
191
|
+
urlAlias
|
|
192
|
+
},
|
|
193
|
+
fieldName,
|
|
194
|
+
nodeId: nodeData.id,
|
|
195
|
+
path: pathName,
|
|
196
|
+
type: nodeData?.type,
|
|
197
|
+
lang,
|
|
198
|
+
messages: {
|
|
199
|
+
saved: tEditor.pageSaved,
|
|
200
|
+
saveFailed: tEditor.savePageFailed
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
};
|
|
204
|
+
$[20] = config;
|
|
205
|
+
$[21] = fieldName;
|
|
206
|
+
$[22] = lang;
|
|
207
|
+
$[23] = nodeData;
|
|
208
|
+
$[24] = pathName;
|
|
209
|
+
$[25] = tEditor.pageSaved;
|
|
210
|
+
$[26] = tEditor.requiredFieldsMissing;
|
|
211
|
+
$[27] = tEditor.savePageFailed;
|
|
212
|
+
$[28] = t10;
|
|
213
|
+
} else {
|
|
214
|
+
t10 = $[28];
|
|
215
|
+
}
|
|
216
|
+
const onSave = t10;
|
|
217
|
+
let t11;
|
|
218
|
+
if ($[29] !== config || $[30] !== customizePlugins || $[31] !== lang || $[32] !== onSave || $[33] !== tEditor.agentTab || $[34] !== tEditor.blocksTab || $[35] !== tEditor.outlineTab || $[36] !== tEditor.sectionsTab || $[37] !== tEditor.templatesTab) {
|
|
219
|
+
const defaultPlugins = [createSectionsPlugin({
|
|
220
|
+
label: tEditor.sectionsTab
|
|
221
|
+
}), createBlocksPlugin({
|
|
222
|
+
label: tEditor.blocksTab
|
|
223
|
+
}), createTemplatesPlugin({
|
|
224
|
+
label: tEditor.templatesTab
|
|
225
|
+
}), createOutlinePlugin({
|
|
226
|
+
label: tEditor.outlineTab
|
|
227
|
+
}), createAgentPlugin({
|
|
228
|
+
config,
|
|
229
|
+
lang,
|
|
230
|
+
onSave,
|
|
231
|
+
label: tEditor.agentTab
|
|
232
|
+
})];
|
|
233
|
+
t11 = customizePlugins ? customizePlugins(defaultPlugins) : defaultPlugins;
|
|
234
|
+
$[29] = config;
|
|
235
|
+
$[30] = customizePlugins;
|
|
236
|
+
$[31] = lang;
|
|
237
|
+
$[32] = onSave;
|
|
238
|
+
$[33] = tEditor.agentTab;
|
|
239
|
+
$[34] = tEditor.blocksTab;
|
|
240
|
+
$[35] = tEditor.outlineTab;
|
|
241
|
+
$[36] = tEditor.sectionsTab;
|
|
242
|
+
$[37] = tEditor.templatesTab;
|
|
243
|
+
$[38] = t11;
|
|
244
|
+
} else {
|
|
245
|
+
t11 = $[38];
|
|
246
|
+
}
|
|
247
|
+
const plugins = t11;
|
|
248
|
+
let t12;
|
|
249
|
+
if ($[39] !== captureDispatch || $[40] !== closePuckEditor || $[41] !== onSave) {
|
|
250
|
+
t12 = () => /*#__PURE__*/_jsx(EditorHeaderActions, {
|
|
251
|
+
onSave: onSave,
|
|
252
|
+
onClose: closePuckEditor,
|
|
253
|
+
captureDispatch: captureDispatch
|
|
254
|
+
});
|
|
255
|
+
$[39] = captureDispatch;
|
|
256
|
+
$[40] = closePuckEditor;
|
|
257
|
+
$[41] = onSave;
|
|
258
|
+
$[42] = t12;
|
|
259
|
+
} else {
|
|
260
|
+
t12 = $[42];
|
|
261
|
+
}
|
|
262
|
+
let t13;
|
|
263
|
+
if ($[43] !== projectOverrides || $[44] !== t12) {
|
|
264
|
+
t13 = {
|
|
265
|
+
puck: _temp2,
|
|
266
|
+
drawerItem: _temp3,
|
|
267
|
+
fieldLabel: _temp4,
|
|
268
|
+
actionBar: _temp5,
|
|
269
|
+
headerActions: t12,
|
|
270
|
+
...projectOverrides
|
|
271
|
+
};
|
|
272
|
+
$[43] = projectOverrides;
|
|
273
|
+
$[44] = t12;
|
|
274
|
+
$[45] = t13;
|
|
275
|
+
} else {
|
|
276
|
+
t13 = $[45];
|
|
277
|
+
}
|
|
278
|
+
const overrides = t13;
|
|
279
|
+
let t14;
|
|
280
|
+
if ($[46] !== configWithTemplates || $[47] !== editorData || $[48] !== onAction || $[49] !== overrides || $[50] !== plugins) {
|
|
281
|
+
t14 = /*#__PURE__*/_jsx(Puck, {
|
|
282
|
+
config: configWithTemplates,
|
|
283
|
+
data: editorData,
|
|
284
|
+
plugins: plugins,
|
|
285
|
+
onAction: onAction,
|
|
286
|
+
overrides: overrides
|
|
287
|
+
});
|
|
288
|
+
$[46] = configWithTemplates;
|
|
289
|
+
$[47] = editorData;
|
|
290
|
+
$[48] = onAction;
|
|
291
|
+
$[49] = overrides;
|
|
292
|
+
$[50] = plugins;
|
|
293
|
+
$[51] = t14;
|
|
294
|
+
} else {
|
|
295
|
+
t14 = $[51];
|
|
296
|
+
}
|
|
297
|
+
return t14;
|
|
298
|
+
}
|
|
299
|
+
function _temp5(t0) {
|
|
300
|
+
const {
|
|
301
|
+
children: children_0,
|
|
302
|
+
label
|
|
303
|
+
} = t0;
|
|
304
|
+
return /*#__PURE__*/_jsx(EditorActionBar, {
|
|
305
|
+
label: label,
|
|
306
|
+
children: children_0
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
function _temp4(props) {
|
|
310
|
+
return /*#__PURE__*/_jsx(RequiredFieldLabel, {
|
|
311
|
+
...props
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
function _temp3(t0) {
|
|
315
|
+
const {
|
|
316
|
+
name
|
|
317
|
+
} = t0;
|
|
318
|
+
return /*#__PURE__*/_jsx(ComponentItem, {
|
|
319
|
+
name: name
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
function _temp2(t0) {
|
|
323
|
+
const {
|
|
324
|
+
children
|
|
325
|
+
} = t0;
|
|
326
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
327
|
+
children: [children, /*#__PURE__*/_jsx(CanvasQuickAdd, {}), /*#__PURE__*/_jsx(SectionTemplateModalHost, {})]
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
function _temp(m) {
|
|
331
|
+
return `${m.componentLabel}: ${m.fieldLabel}`;
|
|
332
|
+
}
|
|
333
|
+
//# sourceMappingURL=puck-editor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"puck-editor.js","names":["c","_c","usePathname","Puck","toast","getBundle","usePuckContentModel","usePuckEditorConfig","RequiredFieldLabel","usePuckDictionary","createAgentPlugin","createBlocksPlugin","createOutlinePlugin","createSectionsPlugin","createTemplatesPlugin","stripTemplateVehicles","useTemplateDnd","CanvasQuickAdd","ComponentItem","EditorActionBar","EditorHeaderActions","findMissingRequiredFields","publishPuckData","SectionTemplateModalHost","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","isRelative","url","RegExp","test","getDefaultPageSettings","node","drupalBaseUrl","meta","metadataImage","image","mediaImage","field_media_image","firstMediaImage","Array","isArray","title","metadataTitle","metadataDescription","description","id","type","name","thumbnailImage","uri","publishedState","status","urlAlias","path","alias","PuckEditor","t0","$","fieldName","data","config","closePuckEditor","plugins","customizePlugins","overrides","projectOverrides","nodeData","lang","langcode","pathName","tEditor","editor","t1","undefined","model","configWithTemplates","onAction","captureDispatch","t2","metadataFields","bundles","t3","defaultPageSettings","t4","root","props","rootProps","t5","t6","t7","t8","t9","editorData","t10","pageSaved","requiredFieldsMissing","savePageFailed","rawData","data_0","rootProps_0","t11","t12","t13","t14","t15","t16","contentRootProps","missing","length","error","map","_temp","join","puckData","pageSettings","published","nodeId","messages","saved","saveFailed","onSave","agentTab","blocksTab","outlineTab","sectionsTab","templatesTab","defaultPlugins","label","puck","_temp2","drawerItem","_temp3","fieldLabel","_temp4","actionBar","_temp5","headerActions","children","children_0","m","componentLabel"],"sources":["../../../../src/puck-editor/internal/editor/puck-editor.tsx"],"sourcesContent":["'use client';\n\nimport { usePathname } from 'next/navigation';\nimport { Config, Data, Overrides, Plugin, Puck } from '@puckeditor/core';\nimport { toast } from 'sonner';\n\nimport { getBundle, type ResolvedPuckBundle } from '../content-model';\nimport { usePuckContentModel, usePuckEditorConfig } from '../editor-config';\nimport { RequiredFieldLabel } from '../fields/required-field-label';\nimport { usePuckDictionary } from '../i18n';\nimport { createAgentPlugin } from '../plugins/agent-plugin';\nimport { createBlocksPlugin } from '../plugins/blocks-plugin';\nimport { createOutlinePlugin } from '../plugins/outline-plugin';\nimport { createSectionsPlugin } from '../plugins/sections-plugin';\nimport {\n createTemplatesPlugin,\n stripTemplateVehicles,\n useTemplateDnd,\n} from '../plugins/templates-plugin';\nimport { PuckNode } from '../puck-node';\nimport { CanvasQuickAdd } from './canvas-quick-add';\nimport ComponentItem from './component-item';\nimport { EditorActionBar } from './editor-action-bar';\nimport { EditorHeaderActions } from './editor-header-actions';\nimport { findMissingRequiredFields } from './find-missing-required-fields';\nimport { publishPuckData } from './publish-puck-data';\nimport { SectionTemplateModalHost } from './section-template-modal';\n\nimport '@puckeditor/core/no-external.css';\n\nfunction isRelative(url: string) {\n return !new RegExp('^(?:[a-z]+:)?//', 'i').test(url);\n}\n\ntype PuckEditorProps = {\n node: PuckNode;\n fieldName: string;\n data: Partial<Data>;\n config: Config;\n closePuckEditor: () => void;\n plugins?: (defaultPlugins: Plugin[]) => Plugin[];\n overrides?: Partial<Overrides>;\n};\n\ntype PuckPageSettings = {\n title: string;\n metadataTitle: string;\n metadataDescription: string;\n metadataImage: {\n id?: string;\n type?: string;\n name?: string;\n thumbnailImage?: string;\n } | null;\n publishedState: 'published' | 'unpublished';\n urlAlias: string;\n};\n\ntype PuckRootProps = Record<string, unknown> & Partial<PuckPageSettings>;\n\nfunction getDefaultPageSettings(\n node: PuckNode,\n drupalBaseUrl: string,\n meta: ResolvedPuckBundle['metadataFields']\n): PuckPageSettings {\n const metadataImage = meta.image\n ? (node?.[meta.image] as PuckNode['field_metadata_image'])\n : null;\n const mediaImage = metadataImage?.field_media_image;\n const firstMediaImage = Array.isArray(mediaImage)\n ? mediaImage[0]\n : mediaImage;\n\n return {\n title: node?.title || '',\n metadataTitle: (meta.title && (node?.[meta.title] as string)) || '',\n metadataDescription:\n (meta.description && (node?.[meta.description] as string)) || '',\n metadataImage: metadataImage?.id\n ? {\n id: metadataImage.id,\n type: metadataImage.type || 'media--image',\n name: metadataImage.name || '',\n thumbnailImage: firstMediaImage?.uri?.url\n ? isRelative(firstMediaImage.uri.url)\n ? `${drupalBaseUrl}${firstMediaImage.uri.url}`\n : firstMediaImage.uri.url\n : '',\n }\n : null,\n publishedState: node?.status ? 'published' : 'unpublished',\n urlAlias: node?.path?.alias || '',\n };\n}\n\nexport default function PuckEditor({\n node,\n fieldName,\n data,\n config,\n closePuckEditor,\n plugins: customizePlugins,\n overrides: projectOverrides,\n}: PuckEditorProps) {\n const nodeData = node;\n const lang = nodeData?.langcode;\n const pathName = usePathname();\n const tEditor = usePuckDictionary().editor;\n const { drupalBaseUrl = '' } = usePuckEditorConfig();\n const model = usePuckContentModel();\n\n const { configWithTemplates, onAction, captureDispatch } =\n useTemplateDnd(config);\n\n const metadataFields =\n getBundle(model, nodeData?.type)?.metadataFields ??\n model.bundles[0].metadataFields;\n const defaultPageSettings = getDefaultPageSettings(\n nodeData,\n drupalBaseUrl,\n metadataFields\n );\n const rootProps = (data?.root?.props || {}) as PuckRootProps;\n const editorData: Partial<Data> = {\n ...data,\n root: {\n ...(data?.root || {}),\n props: {\n ...defaultPageSettings,\n ...rootProps,\n } as unknown as Data['root']['props'],\n },\n };\n\n const onSave = async (rawData: Partial<Data>) => {\n const data = stripTemplateVehicles(rawData);\n const rootProps = (data?.root?.props || {}) as PuckRootProps;\n const {\n title = '',\n metadataTitle = '',\n metadataDescription = '',\n metadataImage = null,\n publishedState = 'unpublished',\n urlAlias = '',\n ...contentRootProps\n } = rootProps;\n\n if (publishedState === 'published') {\n const missing = findMissingRequiredFields(config, data);\n if (missing.length > 0) {\n toast.error(tEditor.requiredFieldsMissing, {\n description: missing\n .map((m) => `${m.componentLabel}: ${m.fieldLabel}`)\n .join(', '),\n });\n return;\n }\n }\n\n const puckData: Partial<Data> = {\n ...data,\n root: {\n ...(data?.root || {}),\n props: contentRootProps as Data['root']['props'],\n },\n };\n\n await publishPuckData({\n data: puckData,\n pageSettings: {\n title,\n metadataTitle,\n metadataDescription,\n metadataImage,\n published: publishedState === 'published',\n urlAlias,\n },\n fieldName,\n nodeId: nodeData.id,\n path: pathName,\n type: nodeData?.type,\n lang,\n messages: {\n saved: tEditor.pageSaved,\n saveFailed: tEditor.savePageFailed,\n },\n });\n };\n\n const defaultPlugins = [\n createSectionsPlugin({ label: tEditor.sectionsTab }),\n createBlocksPlugin({ label: tEditor.blocksTab }),\n createTemplatesPlugin({ label: tEditor.templatesTab }),\n createOutlinePlugin({ label: tEditor.outlineTab }),\n createAgentPlugin({\n config,\n lang,\n onSave,\n label: tEditor.agentTab,\n }),\n ];\n const plugins = customizePlugins\n ? customizePlugins(defaultPlugins)\n : defaultPlugins;\n\n const overrides: Partial<Overrides> = {\n puck: ({ children }) => (\n <>\n {children}\n <CanvasQuickAdd />\n <SectionTemplateModalHost />\n </>\n ),\n drawerItem: ({ name }) => <ComponentItem name={name} />,\n fieldLabel: (props) => <RequiredFieldLabel {...props} />,\n actionBar: ({ children, label }) => (\n <EditorActionBar label={label}>{children}</EditorActionBar>\n ),\n headerActions: () => (\n <EditorHeaderActions\n onSave={onSave}\n onClose={closePuckEditor}\n captureDispatch={captureDispatch}\n />\n ),\n ...projectOverrides,\n };\n\n return (\n <Puck\n config={configWithTemplates}\n data={editorData}\n pl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AC,cAAe,KAAKD,CAAC,CAAAP,UAAW,EAAE;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section-template-modal.d.ts","sourceRoot":"","sources":["../../../../src/puck-editor/internal/editor/section-template-modal.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AA2B3C,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,QAGxD;AAED,wBAAgB,wBAAwB,gCAmBvC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
4
|
+
import { useSyncExternalStore } from 'react';
|
|
5
|
+
import { useQueryClient } from '@tanstack/react-query';
|
|
6
|
+
import { TEMPLATES_QUERY_KEY } from '../editor-query-client';
|
|
7
|
+
import ComponentTemplateModal from '../plugins/templates-plugin/component-template-modal';
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
let state = {
|
|
10
|
+
open: false,
|
|
11
|
+
content: null
|
|
12
|
+
};
|
|
13
|
+
const listeners = new Set();
|
|
14
|
+
const emit = () => listeners.forEach(listener => listener());
|
|
15
|
+
const subscribe = listener => {
|
|
16
|
+
listeners.add(listener);
|
|
17
|
+
return () => {
|
|
18
|
+
listeners.delete(listener);
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
const getSnapshot = () => state;
|
|
22
|
+
const setOpen = open => {
|
|
23
|
+
state = {
|
|
24
|
+
...state,
|
|
25
|
+
open
|
|
26
|
+
};
|
|
27
|
+
emit();
|
|
28
|
+
};
|
|
29
|
+
export function openSectionTemplateModal(content) {
|
|
30
|
+
state = {
|
|
31
|
+
open: true,
|
|
32
|
+
content
|
|
33
|
+
};
|
|
34
|
+
emit();
|
|
35
|
+
}
|
|
36
|
+
export function SectionTemplateModalHost() {
|
|
37
|
+
const $ = _c(6);
|
|
38
|
+
const {
|
|
39
|
+
open,
|
|
40
|
+
content
|
|
41
|
+
} = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
42
|
+
const queryClient = useQueryClient();
|
|
43
|
+
let t0;
|
|
44
|
+
if ($[0] !== queryClient) {
|
|
45
|
+
t0 = () => queryClient.invalidateQueries({
|
|
46
|
+
queryKey: [...TEMPLATES_QUERY_KEY]
|
|
47
|
+
});
|
|
48
|
+
$[0] = queryClient;
|
|
49
|
+
$[1] = t0;
|
|
50
|
+
} else {
|
|
51
|
+
t0 = $[1];
|
|
52
|
+
}
|
|
53
|
+
let t1;
|
|
54
|
+
if ($[2] !== content || $[3] !== open || $[4] !== t0) {
|
|
55
|
+
t1 = /*#__PURE__*/_jsx(ComponentTemplateModal, {
|
|
56
|
+
content: content,
|
|
57
|
+
isOpen: open,
|
|
58
|
+
setIsOpen: setOpen,
|
|
59
|
+
category: "section",
|
|
60
|
+
onTemplateSaved: t0
|
|
61
|
+
});
|
|
62
|
+
$[2] = content;
|
|
63
|
+
$[3] = open;
|
|
64
|
+
$[4] = t0;
|
|
65
|
+
$[5] = t1;
|
|
66
|
+
} else {
|
|
67
|
+
t1 = $[5];
|
|
68
|
+
}
|
|
69
|
+
return t1;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=section-template-modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section-template-modal.js","names":["c","_c","useSyncExternalStore","useQueryClient","TEMPLATES_QUERY_KEY","ComponentTemplateModal","jsx","_jsx","state","open","content","listeners","Set","emit","forEach","listener","subscribe","add","delete","getSnapshot","setOpen","openSectionTemplateModal","SectionTemplateModalHost","$","queryClient","t0","invalidateQueries","queryKey","t1","category","onTemplateSaved"],"sources":["../../../../src/puck-editor/internal/editor/section-template-modal.tsx"],"sourcesContent":["'use client';\n\nimport { useSyncExternalStore } from 'react';\nimport { Content } from '@puckeditor/core';\nimport { useQueryClient } from '@tanstack/react-query';\n\nimport { TEMPLATES_QUERY_KEY } from '../editor-query-client';\nimport ComponentTemplateModal from '../plugins/templates-plugin/component-template-modal';\n\ntype ModalState = { open: boolean; content: Content | null };\n\nlet state: ModalState = { open: false, content: null };\nconst listeners = new Set<() => void>();\n\nconst emit = () => listeners.forEach((listener) => listener());\n\nconst subscribe = (listener: () => void) => {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n};\n\nconst getSnapshot = () => state;\n\nconst setOpen = (open: boolean) => {\n state = { ...state, open };\n emit();\n};\n\nexport function openSectionTemplateModal(content: Content) {\n state = { open: true, content };\n emit();\n}\n\nexport function SectionTemplateModalHost() {\n const { open, content } = useSyncExternalStore(\n subscribe,\n getSnapshot,\n getSnapshot\n );\n const queryClient = useQueryClient();\n\n return (\n <ComponentTemplateModal\n content={content}\n isOpen={open}\n setIsOpen={setOpen}\n category=\"section\"\n onTemplateSaved={() =>\n queryClient.invalidateQueries({ queryKey: [...TEMPLATES_QUERY_KEY] })\n }\n />\n );\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAEb,SAASC,oBAAoB,QAAQ,OAAO;AAE5C,SAASC,cAAc,QAAQ,uBAAuB;AAEtD,SAASC,mBAAmB,QAAQ,wBAAwB;AAC5D,OAAOC,sBAAsB,MAAM,sDAAsD;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAI1F,IAAIC,KAAiB,GAAG;EAAEC,IAAI,EAAE,KAAK;EAAEC,OAAO,EAAE;AAAK,CAAC;AACtD,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAAa,CAAC;AAEvC,MAAMC,IAAI,GAAGA,CAAA,KAAMF,SAAS,CAACG,OAAO,CAAEC,QAAQ,IAAKA,QAAQ,CAAC,CAAC,CAAC;AAE9D,MAAMC,SAAS,GAAID,QAAoB,IAAK;EAC1CJ,SAAS,CAACM,GAAG,CAACF,QAAQ,CAAC;EACvB,OAAO,MAAM;IACXJ,SAAS,CAACO,MAAM,CAACH,QAAQ,CAAC;EAC5B,CAAC;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K,EAQE;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locks the document's background scroll while `active` is true, without
|
|
3
|
+
* touching <html>/<body> styles — so libraries that mirror those attributes
|
|
4
|
+
* into child iframes (e.g. Puck's CopyHostStyles) don't freeze those
|
|
5
|
+
* iframes' own scroll.
|
|
6
|
+
*
|
|
7
|
+
* Works by intercepting wheel and touchmove on the document and only
|
|
8
|
+
* letting events through when a scrollable ancestor inside an element
|
|
9
|
+
* matching `allowSelector` can consume them. Events anywhere else get
|
|
10
|
+
* preventDefault'd, so scroll can't chain to the body behind the overlay.
|
|
11
|
+
*
|
|
12
|
+
* Skips in iframes so the preview document isn't affected.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useScrollLockOutside(active: boolean, allowSelector: string): void;
|
|
15
|
+
//# sourceMappingURL=use-scroll-lock-outside.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-scroll-lock-outside.d.ts","sourceRoot":"","sources":["../../../../src/puck-editor/internal/editor/use-scroll-lock-outside.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,OAAO,EACf,aAAa,EAAE,MAAM,GACpB,IAAI,CA6CN"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
4
|
+
import { useEffect } from 'react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Locks the document's background scroll while `active` is true, without
|
|
8
|
+
* touching <html>/<body> styles — so libraries that mirror those attributes
|
|
9
|
+
* into child iframes (e.g. Puck's CopyHostStyles) don't freeze those
|
|
10
|
+
* iframes' own scroll.
|
|
11
|
+
*
|
|
12
|
+
* Works by intercepting wheel and touchmove on the document and only
|
|
13
|
+
* letting events through when a scrollable ancestor inside an element
|
|
14
|
+
* matching `allowSelector` can consume them. Events anywhere else get
|
|
15
|
+
* preventDefault'd, so scroll can't chain to the body behind the overlay.
|
|
16
|
+
*
|
|
17
|
+
* Skips in iframes so the preview document isn't affected.
|
|
18
|
+
*/
|
|
19
|
+
export function useScrollLockOutside(active, allowSelector) {
|
|
20
|
+
const $ = _c(4);
|
|
21
|
+
let t0;
|
|
22
|
+
let t1;
|
|
23
|
+
if ($[0] !== active || $[1] !== allowSelector) {
|
|
24
|
+
t0 = () => {
|
|
25
|
+
if (!active) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (typeof window !== "undefined" && window.self !== window.top) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const canConsumeScroll = _temp;
|
|
32
|
+
const onWheel = e => {
|
|
33
|
+
const target = e.target;
|
|
34
|
+
const allow = target?.closest?.(allowSelector);
|
|
35
|
+
if (!allow) {
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
let el_0 = target;
|
|
40
|
+
while (el_0 && el_0 !== allow) {
|
|
41
|
+
if (canConsumeScroll(el_0, e.deltaY)) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
el_0 = el_0.parentElement;
|
|
45
|
+
}
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
};
|
|
48
|
+
const onTouchMove = e_0 => {
|
|
49
|
+
const target_0 = e_0.target;
|
|
50
|
+
if (!target_0?.closest?.(allowSelector)) {
|
|
51
|
+
e_0.preventDefault();
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
document.addEventListener("wheel", onWheel, {
|
|
55
|
+
passive: false
|
|
56
|
+
});
|
|
57
|
+
document.addEventListener("touchmove", onTouchMove, {
|
|
58
|
+
passive: false
|
|
59
|
+
});
|
|
60
|
+
return () => {
|
|
61
|
+
document.removeEventListener("wheel", onWheel);
|
|
62
|
+
document.removeEventListener("touchmove", onTouchMove);
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
t1 = [active, allowSelector];
|
|
66
|
+
$[0] = active;
|
|
67
|
+
$[1] = allowSelector;
|
|
68
|
+
$[2] = t0;
|
|
69
|
+
$[3] = t1;
|
|
70
|
+
} else {
|
|
71
|
+
t0 = $[2];
|
|
72
|
+
t1 = $[3];
|
|
73
|
+
}
|
|
74
|
+
useEffect(t0, t1);
|
|
75
|
+
}
|
|
76
|
+
function _temp(el, deltaY) {
|
|
77
|
+
const style = getComputedStyle(el);
|
|
78
|
+
if (!/auto|scroll|overlay/.test(style.overflowY)) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
const he = el;
|
|
82
|
+
if (he.scrollHeight <= he.clientHeight) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
if (deltaY < 0 && he.scrollTop <= 0) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
if (deltaY > 0 && he.scrollTop + he.clientHeight >= he.scrollHeight) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=use-scroll-lock-outside.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-scroll-lock-outside.js","names":["c","_c","useEffect","useScrollLockOutside","active","allowSelector","$","t0","t1","window","self","top","canConsumeScroll","_temp","onWheel","e","target","allow","closest","preventDefault","el_0","el","deltaY","parentElement","onTouchMove","e_0","target_0","document","addEventListener","passive","removeEventListener","style","getComputedStyle","test","overflowY","he","scrollHeight","clientHeight","scrollTop"],"sources":["../../../../src/puck-editor/internal/editor/use-scroll-lock-outside.ts"],"sourcesContent":["'use client';\n\nimport { useEffect } from 'react';\n\n/**\n * Locks the document's background scroll while `active` is true, without\n * touching <html>/<body> styles — so libraries that mirror those attributes\n * into child iframes (e.g. Puck's CopyHostStyles) don't freeze those\n * iframes' own scroll.\n *\n * Works by intercepting wheel and touchmove on the document and only\n * letting events through when a scrollable ancestor inside an element\n * matching `allowSelector` can consume them. Events anywhere else get\n * preventDefault'd, so scroll can't chain to the body behind the overlay.\n *\n * Skips in iframes so the preview document isn't affected.\n */\nexport function useScrollLockOutside(\n active: boolean,\n allowSelector: string\n): void {\n useEffect(() => {\n if (!active) return;\n if (typeof window !== 'undefined' && window.self !== window.top) return;\n\n const canConsumeScroll = (el: Element, deltaY: number): boolean => {\n const style = getComputedStyle(el);\n if (!/auto|scroll|overlay/.test(style.overflowY)) return false;\n const he = el as HTMLElement;\n if (he.scrollHeight <= he.clientHeight) return false;\n if (deltaY < 0 && he.scrollTop <= 0) return false;\n if (deltaY > 0 && he.scrollTop + he.clientHeight >= he.scrollHeight)\n return false;\n return true;\n };\n\n const onWheel = (e: WheelEvent) => {\n const target = e.target as Element | null;\n const allow = target?.closest?.(allowSelector);\n if (!allow) {\n e.preventDefault();\n return;\n }\n let el: Element | null = target;\n while (el && el !== allow) {\n if (canConsumeScroll(el, e.deltaY)) return;\n el = el.parentElement;\n }\n e.preventDefault();\n };\n\n const onTouchMove = (e: TouchEvent) => {\n const target = e.target as Element | null;\n if (!target?.closest?.(allowSelector)) {\n e.preventDefault();\n }\n };\n\n document.addEventListener('wheel', onWheel, { passive: false });\n document.addEventListener('touchmove', onTouchMove, { passive: false });\n return () => {\n document.removeEventListener('wheel', onWheel);\n document.removeEventListener('touchmove', onTouchMove);\n };\n }, [active, allowSelector]);\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAEb,SAASC,SAAS,QAAQ,OAAO;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAAC,qBAAAC,MAAA,EAAAC,aAAA;EAAA,MAAAC,CAAA,GAAAL,EAAA;EAAA,IAAAM,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAF,CAAA,QAAAF,MAAA,IAAAE,CAAA,QAAAD,aAAA;IAIKE,EAAA,GAAAA,CAAA;MACR,IAAI,CAACH,MAAM;QAAA;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CAAC;IAAAC,CAAA,MAAAF,MAAA;IAAAE,CAAA,MAAAD,aAAA;IAAAC,CAAA,MAAAC,EAAA;IAAAD,CAAA,MAAAE,EAAA;EAAA;IAAAD,EAAA,GAAAD,CAAA;IAAAE,EAAA,GAAAF,CAAA;EAAA;EA3C1BJ,SAAS,CAACK,EA2CT,EAAEC,EAAuB,CAAC;AAAA;AA/CtB,SAAAK,MAAAQ,EAAA,EAAAC,MAAA;EASD,MAAAS,KAAA,GAAcC,gBAAgB,CAACX,EAAE,CAAC;EAClC,IAAI,CAAC,qBAAqB,CAAAY,IAAK,CAACF,KAAK,CAAAG,SAAU,CAAC;IAAA,OAAS,KAAK;EAAA;EAC9D,MAAAC,EAAA,GAAWd,EAAE;EACb,IAAIc,EAAE,CAAAC,YAAa,IAAID,EAAE,CAAAE,YAAa;IAAA,OAAS,KAAK;EAAA;EACpD,IAAIf,MAAM,GAAG,CAAsB,IAAjBa,EAAE,CAAAG,SAAU,IAAI,CAAC;IAAA,OAAS,KAAK;EAAA;EACjD,IAAIhB,MAAM,GAAG,CAAsD,IAAjDa,EAAE,CAAAG,SAAU,GAAGH,EAAE,CAAAE,YAAa,IAAIF,EAAE,CAAAC,YAAa;IAAA,OAC1D,KAAK;EAAA;EAAC,OACR,IAAI;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type PuckContentModel, type PuckContentModelInput } from './content-model';
|
|
3
|
+
import type { BuiltinTemplate } from './plugins/templates-plugin/templates';
|
|
4
|
+
export type PuckEditorConfig = {
|
|
5
|
+
/**
|
|
6
|
+
* Absolute Drupal base URL used to absolutize relative media URIs
|
|
7
|
+
* (thumbnails). Injected by the project instead of reading NEXT_PUBLIC_*
|
|
8
|
+
* env in module code — env inlining is not guaranteed inside packages.
|
|
9
|
+
*/
|
|
10
|
+
drupalBaseUrl?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Drupal content-model overrides. Pass the same value to createPuckApi so
|
|
13
|
+
* the editor UI and the publish validation stay in sync.
|
|
14
|
+
*/
|
|
15
|
+
contentModel?: PuckContentModelInput;
|
|
16
|
+
builtinTemplates?: BuiltinTemplate[];
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Mounted by PuckWrapper. Headless setups that use useMediaLibrary or
|
|
20
|
+
* MediaSelectorField outside PuckWrapper mount this provider themselves.
|
|
21
|
+
*/
|
|
22
|
+
export declare function PuckEditorConfigProvider({ config, children, }: {
|
|
23
|
+
config: PuckEditorConfig;
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
}): import("react").JSX.Element;
|
|
26
|
+
export declare function usePuckEditorConfig(): PuckEditorConfig;
|
|
27
|
+
/** Resolved content model; defaults apply without a provider (headless). */
|
|
28
|
+
export declare function usePuckContentModel(): PuckContentModel;
|
|
29
|
+
export declare function useBuiltinTemplates(): BuiltinTemplate[];
|
|
30
|
+
//# sourceMappingURL=editor-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-config.d.ts","sourceRoot":"","sources":["../../../src/puck-editor/internal/editor-config.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAE5E,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACrC,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;CACtC,CAAC;AAIF;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,MAAM,EACN,QAAQ,GACT,EAAE;IACD,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAMA;AAED,wBAAgB,mBAAmB,IAAI,gBAAgB,CAEtD;AAED,4EAA4E;AAC5E,wBAAgB,mBAAmB,IAAI,gBAAgB,CAGtD;AAID,wBAAgB,mBAAmB,IAAI,eAAe,EAAE,CAEvD"}
|