@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,229 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { keepPreviousData, useQuery } from '@tanstack/react-query';
|
|
6
|
+
import { absolutizeMediaUrl, fetchMediaList } from '../../api/client';
|
|
7
|
+
import { usePuckEditorConfig } from '../../editor-config';
|
|
8
|
+
import { getPathLocale } from '../../locale';
|
|
9
|
+
import { useDebouncedValue } from './use-debounced-value';
|
|
10
|
+
const PAGE_LIMIT = 15;
|
|
11
|
+
const SEARCH_DEBOUNCE_MS = 300;
|
|
12
|
+
const fetchMedia = async ({
|
|
13
|
+
type,
|
|
14
|
+
query,
|
|
15
|
+
offset,
|
|
16
|
+
limit
|
|
17
|
+
}) => fetchMediaList(type, {
|
|
18
|
+
query,
|
|
19
|
+
offset,
|
|
20
|
+
limit,
|
|
21
|
+
lang: getPathLocale(window.location.pathname)
|
|
22
|
+
});
|
|
23
|
+
export function useMediaLibrary(t0) {
|
|
24
|
+
const $ = _c(43);
|
|
25
|
+
const {
|
|
26
|
+
mediaTypes,
|
|
27
|
+
enabled: t1
|
|
28
|
+
} = t0;
|
|
29
|
+
const enabled = t1 === undefined ? true : t1;
|
|
30
|
+
const {
|
|
31
|
+
drupalBaseUrl: t2
|
|
32
|
+
} = usePuckEditorConfig();
|
|
33
|
+
const drupalBaseUrl = t2 === undefined ? "" : t2;
|
|
34
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
35
|
+
const [debouncedSearchQuery, flushSearchQuery] = useDebouncedValue(searchQuery, SEARCH_DEBOUNCE_MS);
|
|
36
|
+
const [mediaType, setMediaType] = useState(mediaTypes[0] || "");
|
|
37
|
+
const [currentOffset, setCurrentOffset] = useState(0);
|
|
38
|
+
const [prevDebouncedQuery, setPrevDebouncedQuery] = useState(debouncedSearchQuery);
|
|
39
|
+
if (prevDebouncedQuery !== debouncedSearchQuery) {
|
|
40
|
+
setPrevDebouncedQuery(debouncedSearchQuery);
|
|
41
|
+
setCurrentOffset(0);
|
|
42
|
+
}
|
|
43
|
+
let t3;
|
|
44
|
+
let t4;
|
|
45
|
+
if ($[0] !== currentOffset || $[1] !== debouncedSearchQuery || $[2] !== mediaType) {
|
|
46
|
+
t3 = ["media-items", mediaType, debouncedSearchQuery, currentOffset, PAGE_LIMIT];
|
|
47
|
+
t4 = () => fetchMedia({
|
|
48
|
+
type: mediaType,
|
|
49
|
+
query: debouncedSearchQuery,
|
|
50
|
+
offset: currentOffset,
|
|
51
|
+
limit: PAGE_LIMIT
|
|
52
|
+
});
|
|
53
|
+
$[0] = currentOffset;
|
|
54
|
+
$[1] = debouncedSearchQuery;
|
|
55
|
+
$[2] = mediaType;
|
|
56
|
+
$[3] = t3;
|
|
57
|
+
$[4] = t4;
|
|
58
|
+
} else {
|
|
59
|
+
t3 = $[3];
|
|
60
|
+
t4 = $[4];
|
|
61
|
+
}
|
|
62
|
+
const t5 = enabled && !!mediaType;
|
|
63
|
+
let t6;
|
|
64
|
+
if ($[5] !== t3 || $[6] !== t4 || $[7] !== t5) {
|
|
65
|
+
t6 = {
|
|
66
|
+
queryKey: t3,
|
|
67
|
+
queryFn: t4,
|
|
68
|
+
enabled: t5,
|
|
69
|
+
placeholderData: keepPreviousData
|
|
70
|
+
};
|
|
71
|
+
$[5] = t3;
|
|
72
|
+
$[6] = t4;
|
|
73
|
+
$[7] = t5;
|
|
74
|
+
$[8] = t6;
|
|
75
|
+
} else {
|
|
76
|
+
t6 = $[8];
|
|
77
|
+
}
|
|
78
|
+
const {
|
|
79
|
+
data,
|
|
80
|
+
isLoading,
|
|
81
|
+
isFetching,
|
|
82
|
+
refetch
|
|
83
|
+
} = useQuery(t6);
|
|
84
|
+
let t7;
|
|
85
|
+
if ($[9] !== data?.data || $[10] !== drupalBaseUrl) {
|
|
86
|
+
t7 = data?.data?.map(item => ({
|
|
87
|
+
...item,
|
|
88
|
+
thumbnailImage: absolutizeMediaUrl(drupalBaseUrl, item?.thumbnail?.uri?.url)
|
|
89
|
+
})) || [];
|
|
90
|
+
$[9] = data?.data;
|
|
91
|
+
$[10] = drupalBaseUrl;
|
|
92
|
+
$[11] = t7;
|
|
93
|
+
} else {
|
|
94
|
+
t7 = $[11];
|
|
95
|
+
}
|
|
96
|
+
const mediaItems = t7;
|
|
97
|
+
const hasNextPage = !!data?.links?.next;
|
|
98
|
+
const hasPreviousPage = !!data?.links?.prev;
|
|
99
|
+
let t8;
|
|
100
|
+
if ($[12] !== debouncedSearchQuery || $[13] !== flushSearchQuery || $[14] !== refetch || $[15] !== searchQuery) {
|
|
101
|
+
t8 = () => {
|
|
102
|
+
if (searchQuery === debouncedSearchQuery) {
|
|
103
|
+
refetch();
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
flushSearchQuery(searchQuery);
|
|
107
|
+
};
|
|
108
|
+
$[12] = debouncedSearchQuery;
|
|
109
|
+
$[13] = flushSearchQuery;
|
|
110
|
+
$[14] = refetch;
|
|
111
|
+
$[15] = searchQuery;
|
|
112
|
+
$[16] = t8;
|
|
113
|
+
} else {
|
|
114
|
+
t8 = $[16];
|
|
115
|
+
}
|
|
116
|
+
const submitSearch = t8;
|
|
117
|
+
let t9;
|
|
118
|
+
if ($[17] !== flushSearchQuery) {
|
|
119
|
+
t9 = () => {
|
|
120
|
+
setSearchQuery("");
|
|
121
|
+
flushSearchQuery("");
|
|
122
|
+
};
|
|
123
|
+
$[17] = flushSearchQuery;
|
|
124
|
+
$[18] = t9;
|
|
125
|
+
} else {
|
|
126
|
+
t9 = $[18];
|
|
127
|
+
}
|
|
128
|
+
const clearSearch = t9;
|
|
129
|
+
let t10;
|
|
130
|
+
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
131
|
+
t10 = type => {
|
|
132
|
+
setMediaType(type);
|
|
133
|
+
setCurrentOffset(0);
|
|
134
|
+
};
|
|
135
|
+
$[19] = t10;
|
|
136
|
+
} else {
|
|
137
|
+
t10 = $[19];
|
|
138
|
+
}
|
|
139
|
+
const selectMediaType = t10;
|
|
140
|
+
let t11;
|
|
141
|
+
if ($[20] !== hasNextPage || $[21] !== isFetching) {
|
|
142
|
+
t11 = () => {
|
|
143
|
+
if (hasNextPage && !isFetching) {
|
|
144
|
+
setCurrentOffset(_temp);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
$[20] = hasNextPage;
|
|
148
|
+
$[21] = isFetching;
|
|
149
|
+
$[22] = t11;
|
|
150
|
+
} else {
|
|
151
|
+
t11 = $[22];
|
|
152
|
+
}
|
|
153
|
+
const nextPage = t11;
|
|
154
|
+
let t12;
|
|
155
|
+
if ($[23] !== hasPreviousPage || $[24] !== isFetching) {
|
|
156
|
+
t12 = () => {
|
|
157
|
+
if (hasPreviousPage && !isFetching) {
|
|
158
|
+
setCurrentOffset(_temp2);
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
$[23] = hasPreviousPage;
|
|
162
|
+
$[24] = isFetching;
|
|
163
|
+
$[25] = t12;
|
|
164
|
+
} else {
|
|
165
|
+
t12 = $[25];
|
|
166
|
+
}
|
|
167
|
+
const previousPage = t12;
|
|
168
|
+
let t13;
|
|
169
|
+
if ($[26] !== currentOffset || $[27] !== refetch) {
|
|
170
|
+
t13 = () => {
|
|
171
|
+
if (currentOffset !== 0) {
|
|
172
|
+
setCurrentOffset(0);
|
|
173
|
+
} else {
|
|
174
|
+
refetch();
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
$[26] = currentOffset;
|
|
178
|
+
$[27] = refetch;
|
|
179
|
+
$[28] = t13;
|
|
180
|
+
} else {
|
|
181
|
+
t13 = $[28];
|
|
182
|
+
}
|
|
183
|
+
const refreshAfterUpload = t13;
|
|
184
|
+
const t14 = Math.floor(currentOffset / PAGE_LIMIT) + 1;
|
|
185
|
+
let t15;
|
|
186
|
+
if ($[29] !== clearSearch || $[30] !== hasNextPage || $[31] !== hasPreviousPage || $[32] !== isFetching || $[33] !== isLoading || $[34] !== mediaItems || $[35] !== mediaType || $[36] !== nextPage || $[37] !== previousPage || $[38] !== refreshAfterUpload || $[39] !== searchQuery || $[40] !== submitSearch || $[41] !== t14) {
|
|
187
|
+
t15 = {
|
|
188
|
+
mediaItems,
|
|
189
|
+
isLoading,
|
|
190
|
+
isFetching,
|
|
191
|
+
searchQuery,
|
|
192
|
+
setSearchQuery,
|
|
193
|
+
submitSearch,
|
|
194
|
+
clearSearch,
|
|
195
|
+
mediaType,
|
|
196
|
+
selectMediaType,
|
|
197
|
+
page: t14,
|
|
198
|
+
hasNextPage,
|
|
199
|
+
hasPreviousPage,
|
|
200
|
+
nextPage,
|
|
201
|
+
previousPage,
|
|
202
|
+
refreshAfterUpload
|
|
203
|
+
};
|
|
204
|
+
$[29] = clearSearch;
|
|
205
|
+
$[30] = hasNextPage;
|
|
206
|
+
$[31] = hasPreviousPage;
|
|
207
|
+
$[32] = isFetching;
|
|
208
|
+
$[33] = isLoading;
|
|
209
|
+
$[34] = mediaItems;
|
|
210
|
+
$[35] = mediaType;
|
|
211
|
+
$[36] = nextPage;
|
|
212
|
+
$[37] = previousPage;
|
|
213
|
+
$[38] = refreshAfterUpload;
|
|
214
|
+
$[39] = searchQuery;
|
|
215
|
+
$[40] = submitSearch;
|
|
216
|
+
$[41] = t14;
|
|
217
|
+
$[42] = t15;
|
|
218
|
+
} else {
|
|
219
|
+
t15 = $[42];
|
|
220
|
+
}
|
|
221
|
+
return t15;
|
|
222
|
+
}
|
|
223
|
+
function _temp2(prev_0) {
|
|
224
|
+
return prev_0 - PAGE_LIMIT;
|
|
225
|
+
}
|
|
226
|
+
function _temp(prev) {
|
|
227
|
+
return prev + PAGE_LIMIT;
|
|
228
|
+
}
|
|
229
|
+
//# sourceMappingURL=use-media-library.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-media-library.js","names":["c","_c","useState","keepPreviousData","useQuery","absolutizeMediaUrl","fetchMediaList","usePuckEditorConfig","getPathLocale","useDebouncedValue","PAGE_LIMIT","SEARCH_DEBOUNCE_MS","fetchMedia","type","query","offset","limit","lang","window","location","pathname","useMediaLibrary","t0","$","mediaTypes","enabled","t1","undefined","drupalBaseUrl","t2","searchQuery","setSearchQuery","debouncedSearchQuery","flushSearchQuery","mediaType","setMediaType","currentOffset","setCurrentOffset","prevDebouncedQuery","setPrevDebouncedQuery","t3","t4","t5","t6","queryKey","queryFn","placeholderData","data","isLoading","isFetching","refetch","t7","map","item","thumbnailImage","thumbnail","uri","url","mediaItems","hasNextPage","links","next","hasPreviousPage","prev","t8","submitSearch","t9","clearSearch","t10","Symbol","for","selectMediaType","t11","_temp","nextPage","t12","_temp2","previousPage","t13","refreshAfterUpload","t14","Math","floor","t15","page","prev_0"],"sources":["../../../../../src/puck-editor/internal/fields/media-selector/use-media-library.ts"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { keepPreviousData, useQuery } from '@tanstack/react-query';\n\nimport { absolutizeMediaUrl, fetchMediaList } from '../../api/client';\nimport { usePuckEditorConfig } from '../../editor-config';\nimport { getPathLocale } from '../../locale';\nimport { MediaItem } from './media-selector-field';\nimport { useDebouncedValue } from './use-debounced-value';\n\nconst PAGE_LIMIT = 15;\nconst SEARCH_DEBOUNCE_MS = 300;\n\nconst fetchMedia = async ({\n type,\n query,\n offset,\n limit,\n}: {\n type: string;\n query: string;\n offset: number;\n limit: number;\n}) =>\n fetchMediaList<{\n data?: (MediaItem & { thumbnail?: { uri?: { url?: string } } })[];\n links?: { next?: unknown; prev?: unknown };\n }>(type, {\n query,\n offset,\n limit,\n lang: getPathLocale(window.location.pathname),\n });\n\ntype UseMediaLibraryOptions = {\n mediaTypes: string[];\n enabled?: boolean;\n};\n\nexport function useMediaLibrary({\n mediaTypes,\n enabled = true,\n}: UseMediaLibraryOptions) {\n const { drupalBaseUrl = '' } = usePuckEditorConfig();\n const [searchQuery, setSearchQuery] = useState('');\n const [debouncedSearchQuery, flushSearchQuery] = useDebouncedValue(\n searchQuery,\n SEARCH_DEBOUNCE_MS\n );\n const [mediaType, setMediaType] = useState(mediaTypes[0] || '');\n const [currentOffset, setCurrentOffset] = useState(0);\n const [prevDebouncedQuery, setPrevDebouncedQuery] =\n useState(debouncedSearchQuery);\n\n if (prevDebouncedQuery !== debouncedSearchQuery) {\n setPrevDebouncedQuery(debouncedSearchQuery);\n setCurrentOffset(0);\n }\n\n const { data, isLoading, isFetching, refetch } = useQuery({\n queryKey: [\n 'media-items',\n mediaType,\n debouncedSearchQuery,\n currentOffset,\n PAGE_LIMIT,\n ],\n queryFn: () =>\n fetchMedia({\n type: mediaType,\n query: debouncedSearchQuery,\n offset: currentOffset,\n limit: PAGE_LIMIT,\n }),\n enabled: enabled && !!mediaType,\n placeholderData: keepPreviousData,\n });\n\n const mediaItems: MediaItem[] =\n data?.data?.map(\n (item: MediaItem & { thumbnail?: { uri?: { url?: string } } }) => ({\n ...item,\n thumbnailImage: absolutizeMediaUrl(\n drupalBaseUrl,\n item?.thumbnail?.uri?.url\n ),\n })\n ) || [];\n\n const hasNextPage = !!data?.links?.next;\n const hasPreviousPage = !!data?.links?.prev;\n\n const submitSearch = () => {\n if (searchQuery === debouncedSearchQuery) {\n refetch();\n return;\n }\n flushSearchQuery(searchQuery);\n };\n\n const clearSearch = () => {\n setSearchQuery('');\n flushSearchQuery('');\n };\n\n const selectMediaType = (type: string) => {\n setMediaType(type);\n setCurrentOffset(0);\n };\n\n const nextPage = () => {\n if (hasNextPage && !isFetching) {\n setCurrentOffset((prev) => prev + PAGE_LIMIT);\n }\n };\n\n const previousPage = () => {\n if (hasPreviousPage && !isFetching) {\n setCurrentOffset((prev) => prev - PAGE_LIMIT);\n }\n };\n\n // New media is sorted `created DESC` (page 1), so reset the offset to show it.\n const refreshAfterUpload = () => {\n if (currentOffset !== 0) {\n setCurrentOffset(0);\n } else {\n refetch();\n }\n };\n\n return {\n mediaItems,\n isLoading,\n isFetching,\n searchQuery,\n setSearchQuery,\n submitSearch,\n clearSearch,\n mediaType,\n selectMediaType,\n page: Math.floor(currentOffset / PAGE_LIMIT) + 1,\n hasNextPage,\n hasPreviousPage,\n nextPage,\n previousPage,\n refreshAfterUpload,\n };\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAEb,SAASC,QAAQ,QAAQ,OAAO;AAChC,SAASC,gBAAgB,EAAEC,QAAQ,QAAQ,uBAAuB;AAElE,SAASC,kBAAkB,EAAEC,cAAc,QAAQ,kBAAkB;AACrE,SAASC,mBAAmB,QAAQ,qBAAqB;AACzD,SAASC,aAAa,QAAQ,cAAc;AAE5C,SAASC,iBAAiB,QAAQ,uBAAuB;AAEzD,MAAMC,UAAU,GAAG,EAAE;AACrB,MAAMC,kBAAkB,GAAG,GAAG;AAE9B,MAAMC,UAAU,GAAG,MAAAA,CAAO;EACxBC,IAAI;EACJC,KAAK;EACLC,MAAM;EACNC;AAMF,CAAC,KACCV,cAAc,CAGXO,IAAI,EAAE;EACPC,KAAK;EACLC,MAAM;EACNC,KAAK;EACLC,IAAI,EAAET,aAAa,CAACU,MAAM,CAACC,QAAQ,CAACC,QAAQ;AAC9C,CAAC,CAAC;AAOJ,OAAO,SAAAC,gBAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAtB,EAAA;EAAyB;IAAAuB,UAAA;IAAAC,OAAA,EAAAC;EAAA,IAAAJ,EAGP;EADvB,MAAAG,OAAA,GAAAC,EAAc,KAAdC,SAAc,GAAd,IAAc,GAAdD,EAAc;EAEd;IAAAE,aAAA,EAAAC;EAAA,IAA+BtB,mBAAmB,CAAC,CAAC;EAA5C,MAAAqB,aAAA,GAAAC,EAAkB,KAAlBF,SAAkB,GAAlB,EAAkB,GAAlBE,EAAkB;EAC1B,OAAAC,WAAA,EAAAC,cAAA,IAAsC7B,QAAQ,CAAC,EAAE,CAAC;EAClD,OAAA8B,oBAAA,EAAAC,gBAAA,IAAiDxB,iBAAiB,CAChEqB,W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AE,WAAA;MAAAjC,SAAA;MAAAqC,eAAA;MAAAa,IAAA,EAUCJ,GAA0C;MAAArB,WAAA;MAAAG,eAAA;MAAAY,QAAA;MAAAG,YAAA;MAAAE;IAMlD,CAAC;IAAAxD,CAAA,OAAA4C,WAAA;IAAA5C,CAAA,OAAAoC,WAAA;IAAApC,CAAA,OAAAuC,eAAA;IAAAvC,CAAA,OAAA0B,UAAA;IAAA1B,CAAA,OAAAyB,SAAA;IAAAzB,CAAA,OAAAmC,UAAA;IAAAnC,CAAA,OAAAW,SAAA;IAAAX,CAAA,OAAAmD,QAAA;IAAAnD,CAAA,OAAAsD,YAAA;IAAAtD,CAAA,OAAAwD,kBAAA;IAAAxD,CAAA,OAAAO,WAAA;IAAAP,CAAA,OAAA0C,YAAA;IAAA1C,CAAA,OAAAyD,GAAA;IAAAzD,CAAA,OAAA4D,GAAA;EAAA;IAAAA,GAAA,GAAA5D,CAAA;EAAA;EAAA,OAhBM4D,GAgBN;AAAA;AA5GI,SAAAP,OAAAS,MAAA;EAAA,OA+E0BtB,MAAI,GAAGrD,UAAU;AAAA;AA/E3C,SAAA+D,MAAAV,IAAA;EAAA,OAyE0BA,IAAI,GAAGrD,UAAU;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface VideoUploadFormProps {
|
|
2
|
+
onCancel?: () => void;
|
|
3
|
+
onMediaAdded?: () => void;
|
|
4
|
+
}
|
|
5
|
+
export declare function VideoUploadForm({ onMediaAdded, onCancel, }: VideoUploadFormProps): import("react").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=video-upload-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-upload-form.d.ts","sourceRoot":"","sources":["../../../../../src/puck-editor/internal/fields/media-selector/video-upload-form.tsx"],"names":[],"mappings":"AAWA,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,wBAAgB,eAAe,CAAC,EAC9B,YAAY,EACZ,QAAQ,GACT,EAAE,oBAAoB,+BA4HtB"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { Button } from '@puckeditor/core';
|
|
5
|
+
import { uploadRemoteVideoMedia } from '../../api/client';
|
|
6
|
+
import { usePuckDictionary } from '../../i18n';
|
|
7
|
+
import { RequiredMark } from '../../ui/required-mark';
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
export function VideoUploadForm({
|
|
10
|
+
onMediaAdded,
|
|
11
|
+
onCancel
|
|
12
|
+
}) {
|
|
13
|
+
const {
|
|
14
|
+
mediaSelector
|
|
15
|
+
} = usePuckDictionary();
|
|
16
|
+
const [isPending, setIsPending] = useState(false);
|
|
17
|
+
const [message, setMessage] = useState('');
|
|
18
|
+
const [messageType, setMessageType] = useState(null);
|
|
19
|
+
const [formData, setFormData] = useState({
|
|
20
|
+
videoUrl: '',
|
|
21
|
+
name: ''
|
|
22
|
+
});
|
|
23
|
+
const handleSubmit = async e => {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
setIsPending(true);
|
|
26
|
+
setMessage('');
|
|
27
|
+
setMessageType(null);
|
|
28
|
+
try {
|
|
29
|
+
const formElement = e.currentTarget;
|
|
30
|
+
const formData_0 = new FormData(formElement);
|
|
31
|
+
const result = await uploadRemoteVideoMedia(formData_0);
|
|
32
|
+
if (result) {
|
|
33
|
+
setMessage(result.message);
|
|
34
|
+
if (result.success) {
|
|
35
|
+
setMessageType('success');
|
|
36
|
+
formElement.reset();
|
|
37
|
+
setFormData({
|
|
38
|
+
videoUrl: '',
|
|
39
|
+
name: ''
|
|
40
|
+
});
|
|
41
|
+
if (onMediaAdded) {
|
|
42
|
+
onMediaAdded();
|
|
43
|
+
}
|
|
44
|
+
} else {
|
|
45
|
+
setMessageType('error');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
} catch (error) {
|
|
49
|
+
setMessage(mediaSelector.addRemoteVideoFailed);
|
|
50
|
+
setMessageType('error');
|
|
51
|
+
console.error(error);
|
|
52
|
+
} finally {
|
|
53
|
+
setIsPending(false);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const handleChange = e_0 => {
|
|
57
|
+
const {
|
|
58
|
+
name,
|
|
59
|
+
value
|
|
60
|
+
} = e_0.target;
|
|
61
|
+
setFormData(prev => ({
|
|
62
|
+
...prev,
|
|
63
|
+
[name]: value
|
|
64
|
+
}));
|
|
65
|
+
};
|
|
66
|
+
return /*#__PURE__*/_jsxs("form", {
|
|
67
|
+
onSubmit: handleSubmit,
|
|
68
|
+
className: "nh:space-y-4",
|
|
69
|
+
children: [message && /*#__PURE__*/_jsx("div", {
|
|
70
|
+
className: `nh:rounded nh:p-2 nh:text-sm nh:font-medium ${messageType === 'success' ? 'nh:border nh:border-green-200 nh:bg-green-100 text-green-700' : 'nh:border nh:border-red-200 nh:bg-red-100 text-red-700'}`,
|
|
71
|
+
children: message
|
|
72
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
73
|
+
children: [/*#__PURE__*/_jsxs("label", {
|
|
74
|
+
htmlFor: "name",
|
|
75
|
+
className: "nh:block nh:text-sm nh:font-medium nh:text-gray-700",
|
|
76
|
+
children: [mediaSelector.name, /*#__PURE__*/_jsx(RequiredMark, {})]
|
|
77
|
+
}), /*#__PURE__*/_jsx("input", {
|
|
78
|
+
type: "text",
|
|
79
|
+
id: "name",
|
|
80
|
+
name: "name",
|
|
81
|
+
placeholder: "",
|
|
82
|
+
value: formData.name,
|
|
83
|
+
onChange: handleChange,
|
|
84
|
+
className: "nh:mt-1 nh:block nh:w-full nh:max-w-3xl nh:rounded-md nh:border-gray-300 nh:shadow-sm",
|
|
85
|
+
required: true
|
|
86
|
+
})]
|
|
87
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
88
|
+
children: [/*#__PURE__*/_jsxs("label", {
|
|
89
|
+
htmlFor: "videoUrl",
|
|
90
|
+
className: "nh:block nh:text-sm nh:font-medium nh:text-gray-700",
|
|
91
|
+
children: [mediaSelector.videoUrl, /*#__PURE__*/_jsx(RequiredMark, {})]
|
|
92
|
+
}), /*#__PURE__*/_jsx("input", {
|
|
93
|
+
type: "url",
|
|
94
|
+
id: "videoUrl",
|
|
95
|
+
name: "videoUrl",
|
|
96
|
+
placeholder: "https://www.youtube.com/watch?v=...",
|
|
97
|
+
value: formData.videoUrl,
|
|
98
|
+
onChange: handleChange,
|
|
99
|
+
className: "nh:mt-1 nh:block nh:w-full nh:max-w-3xl nh:rounded-md nh:border-gray-300 nh:shadow-sm",
|
|
100
|
+
required: true
|
|
101
|
+
})]
|
|
102
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
103
|
+
className: "nh:mt-6 nh:flex nh:justify-between nh:gap-2",
|
|
104
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
105
|
+
type: "button",
|
|
106
|
+
variant: "secondary",
|
|
107
|
+
onClick: onCancel,
|
|
108
|
+
children: mediaSelector.cancel
|
|
109
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
110
|
+
type: "submit",
|
|
111
|
+
disabled: isPending,
|
|
112
|
+
onClick: e_1 => {
|
|
113
|
+
e_1.stopPropagation();
|
|
114
|
+
},
|
|
115
|
+
children: isPending ? mediaSelector.uploading : mediaSelector.uploadVideo
|
|
116
|
+
})]
|
|
117
|
+
})]
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=video-upload-form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-upload-form.js","names":["useState","Button","uploadRemoteVideoMedia","usePuckDictionary","RequiredMark","jsx","_jsx","jsxs","_jsxs","VideoUploadForm","onMediaAdded","onCancel","mediaSelector","isPending","setIsPending","message","setMessage","messageType","setMessageType","formData","setFormData","videoUrl","name","handleSubmit","e","preventDefault","formElement","currentTarget","FormData","result","success","reset","error","addRemoteVideoFailed","console","handleChange","value","target","prev","onSubmit","className","children","htmlFor","type","id","placeholder","onChange","required","variant","onClick","cancel","disabled","stopPropagation","uploading","uploadVideo"],"sources":["../../../../../src/puck-editor/internal/fields/media-selector/video-upload-form.tsx"],"sourcesContent":["'use client';\n\nimport { FormEvent, useState } from 'react';\nimport { Button } from '@puckeditor/core';\n\nimport { uploadRemoteVideoMedia } from '../../api/client';\nimport { usePuckDictionary } from '../../i18n';\nimport { RequiredMark } from '../../ui/required-mark';\n\ntype MessageType = 'success' | 'error' | null;\n\ninterface VideoUploadFormProps {\n onCancel?: () => void;\n onMediaAdded?: () => void;\n}\n\nexport function VideoUploadForm({\n onMediaAdded,\n onCancel,\n}: VideoUploadFormProps) {\n const { mediaSelector } = usePuckDictionary();\n const [isPending, setIsPending] = useState(false);\n const [message, setMessage] = useState('');\n const [messageType, setMessageType] = useState<MessageType>(null);\n const [formData, setFormData] = useState({\n videoUrl: '',\n name: '',\n });\n\n const handleSubmit = async (e: FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n setIsPending(true);\n setMessage('');\n setMessageType(null);\n\n try {\n const formElement = e.currentTarget;\n const formData = new FormData(formElement);\n\n const result = await uploadRemoteVideoMedia(formData);\n\n if (result) {\n setMessage(result.message);\n if (result.success) {\n setMessageType('success');\n formElement.reset();\n setFormData({ videoUrl: '', name: '' });\n if (onMediaAdded) {\n onMediaAdded();\n }\n } else {\n setMessageType('error');\n }\n }\n } catch (error) {\n setMessage(mediaSelector.addRemoteVideoFailed);\n setMessageType('error');\n console.error(error);\n } finally {\n setIsPending(false);\n }\n };\n\n const handleChange = (\n e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>\n ) => {\n const { name, value } = e.target;\n setFormData((prev) => ({\n ...prev,\n [name]: value,\n }));\n };\n\n return (\n <form onSubmit={handleSubmit} className=\"nh:space-y-4\">\n {message && (\n <div\n className={`nh:rounded nh:p-2 nh:text-sm nh:font-medium ${\n messageType === 'success'\n ? 'nh:border nh:border-green-200 nh:bg-green-100 text-green-700'\n : 'nh:border nh:border-red-200 nh:bg-red-100 text-red-700'\n }`}\n >\n {message}\n </div>\n )}\n\n <div>\n <label\n htmlFor=\"name\"\n className=\"nh:block nh:text-sm nh:font-medium nh:text-gray-700\"\n >\n {mediaSelector.name}\n <RequiredMark />\n </label>\n <input\n type=\"text\"\n id=\"name\"\n name=\"name\"\n placeholder=\"\"\n value={formData.name}\n onChange={handleChange}\n className=\"nh:mt-1 nh:block nh:w-full nh:max-w-3xl nh:rounded-md nh:border-gray-300 nh:shadow-sm\"\n required\n />\n </div>\n\n <div>\n <label\n htmlFor=\"videoUrl\"\n className=\"nh:block nh:text-sm nh:font-medium nh:text-gray-700\"\n >\n {mediaSelector.videoUrl}\n <RequiredMark />\n </label>\n <input\n type=\"url\"\n id=\"videoUrl\"\n name=\"videoUrl\"\n placeholder=\"https://www.youtube.com/watch?v=...\"\n value={formData.videoUrl}\n onChange={handleChange}\n className=\"nh:mt-1 nh:block nh:w-full nh:max-w-3xl nh:rounded-md nh:border-gray-300 nh:shadow-sm\"\n required\n />\n </div>\n\n <div className=\"nh:mt-6 nh:flex nh:justify-between nh:gap-2\">\n <Button type=\"button\" variant=\"secondary\" onClick={onCancel}>\n {mediaSelector.cancel}\n </Button>\n <Button\n type=\"submit\"\n disabled={isPending}\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n {isPending ? mediaSelector.uploading : mediaSelector.uploadVideo}\n </Button>\n </div>\n </form>\n );\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SAAoBA,QAAQ,QAAQ,OAAO;AAC3C,SAASC,MAAM,QAAQ,kBAAkB;AAEzC,SAASC,sBAAsB,QAAQ,kBAAkB;AACzD,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,YAAY,QAAQ,wBAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAA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;QAAAC,QAAA,GAE9D7B,aAAa,CAACS,QAAQ,eACvBf,IAAA,CAACF,YAAY,IAAE,CAAC;MAAA,CACX,CAAC,eACRE,IAAA;QACEqC,IAAI,EAAC,KAAK;QACVC,EAAE,EAAC,UAAU;QACbtB,IAAI,EAAC,UAAU;QACfuB,WAAW,EAAC,qCAAqC;QACjDT,KAAK,EAAEjB,QAAQ,CAACE,QAAS;QACzByB,QAAQ,EAAEX,YAAa;QACvBK,SAAS,EAAC,uFAAuF;QACjGO,QAAQ;MAAA,CACT,CAAC;IAAA,CACC,CAAC,eAENvC,KAAA;MAAKgC,SAAS,EAAC,6CAA6C;MAAAC,QAAA,gBAC1DnC,IAAA,CAACL,MAAM;QAAC0C,IAAI,EAAC,QAAQ;QAACK,OAAO,EAAC,WAAW;QAACC,OAAO,EAAEtC,QAAS;QAAA8B,QAAA,EACzD7B,aAAa,CAACsC;MAAM,CACf,CAAC,eACT5C,IAAA,CAACL,MAAM;QACL0C,IAAI,EAAC,QAAQ;QACbQ,QAAQ,EAAEtC,SAAU;QACpBoC,OAAO,EAAGzB,GAAC,IAAK;UACdA,GAAC,CAAC4B,eAAe,CAAC,CAAC;QACrB,CAAE;QAAAX,QAAA,EAED5B,SAAS,GAAGD,aAAa,CAACyC,SAAS,GAAGzC,aAAa,CAAC0C;MAAW,CAC1D,CAAC;IAAA,CACN,CAAC;EAAA,CACF,CAAC;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type NodeSelectorItem = {
|
|
2
|
+
title?: string | null;
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
export interface NodeSelectorFieldOptions<TItem extends NodeSelectorItem = NodeSelectorItem> {
|
|
6
|
+
nodeType: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
locale?: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
showSearch?: boolean;
|
|
11
|
+
initialQuery?: string;
|
|
12
|
+
searchFields?: string[];
|
|
13
|
+
fields?: string[];
|
|
14
|
+
getItemSummary?: (item: TItem) => string;
|
|
15
|
+
mapRow?: (item: TItem) => TItem;
|
|
16
|
+
mapProp?: (item: TItem) => unknown;
|
|
17
|
+
}
|
|
18
|
+
export declare const createNodeSelectorField: <TItem extends NodeSelectorItem = NodeSelectorItem>({ nodeType, label, placeholder, showSearch, initialQuery, searchFields, fields, getItemSummary, mapRow, mapProp, }: NodeSelectorFieldOptions<TItem>) => {
|
|
19
|
+
type: "external";
|
|
20
|
+
label: string;
|
|
21
|
+
placeholder: string;
|
|
22
|
+
showSearch: boolean;
|
|
23
|
+
initialQuery: string;
|
|
24
|
+
fetchList: ({ query }?: {
|
|
25
|
+
query?: string;
|
|
26
|
+
}) => Promise<TItem[]>;
|
|
27
|
+
getItemSummary: (item: TItem) => string;
|
|
28
|
+
mapRow: (item: TItem) => TItem;
|
|
29
|
+
mapProp: ((item: TItem) => unknown) | undefined;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=create-node-selector-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-node-selector-field.d.ts","sourceRoot":"","sources":["../../../../../src/puck-editor/internal/fields/node-selector/create-node-selector-field.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,WAAW,wBAAwB,CACvC,KAAK,SAAS,gBAAgB,GAAG,gBAAgB;IAEjD,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,MAAM,CAAC;IACzC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,KAAK,CAAC;IAChC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC;CACpC;AAED,eAAO,MAAM,uBAAuB,GAClC,KAAK,SAAS,gBAAgB,GAAG,gBAAgB,EACjD,oHAWC,wBAAwB,CAAC,KAAK,CAAC;;;;;;4BAOD;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAAQ,OAAO,CAAC,KAAK,EAAE,CAAC;qCAzBvC,MAAM;;+BAEb,OAAO;CA2CnC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { fetchNodeList } from '../../api/client';
|
|
2
|
+
import { getPathLocale } from '../../locale';
|
|
3
|
+
export const createNodeSelectorField = ({
|
|
4
|
+
nodeType,
|
|
5
|
+
label = 'Node',
|
|
6
|
+
placeholder = `Select ${nodeType}`,
|
|
7
|
+
showSearch = true,
|
|
8
|
+
initialQuery = '',
|
|
9
|
+
searchFields = ['title'],
|
|
10
|
+
fields,
|
|
11
|
+
getItemSummary,
|
|
12
|
+
mapRow,
|
|
13
|
+
mapProp
|
|
14
|
+
}) => {
|
|
15
|
+
return {
|
|
16
|
+
type: 'external',
|
|
17
|
+
label,
|
|
18
|
+
placeholder,
|
|
19
|
+
showSearch,
|
|
20
|
+
initialQuery,
|
|
21
|
+
fetchList: async ({
|
|
22
|
+
query
|
|
23
|
+
} = {}) => fetchNodeList(nodeType, {
|
|
24
|
+
lang: getPathLocale(window.location.pathname),
|
|
25
|
+
query,
|
|
26
|
+
searchFields,
|
|
27
|
+
fields
|
|
28
|
+
}),
|
|
29
|
+
getItemSummary: getItemSummary || (item => {
|
|
30
|
+
const summary = item?.title;
|
|
31
|
+
return typeof summary === 'string' ? summary : '';
|
|
32
|
+
}),
|
|
33
|
+
mapRow: mapRow || (item => {
|
|
34
|
+
return item;
|
|
35
|
+
}),
|
|
36
|
+
mapProp
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=create-node-selector-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-node-selector-field.js","names":["fetchNodeList","getPathLocale","createNodeSelectorField","nodeType","label","placeholder","showSearch","initialQuery","searchFields","fields","getItemSummary","mapRow","mapProp","type","fetchList","query","lang","window","location","pathname","item","summary","title"],"sources":["../../../../../src/puck-editor/internal/fields/node-selector/create-node-selector-field.ts"],"sourcesContent":["import { fetchNodeList } from '../../api/client';\nimport { getPathLocale } from '../../locale';\n\nexport type NodeSelectorItem = {\n title?: string | null;\n [key: string]: unknown;\n};\n\nexport interface NodeSelectorFieldOptions<\n TItem extends NodeSelectorItem = NodeSelectorItem,\n> {\n nodeType: string;\n label?: string;\n locale?: string;\n placeholder?: string;\n showSearch?: boolean;\n initialQuery?: string;\n searchFields?: string[];\n fields?: string[];\n getItemSummary?: (item: TItem) => string;\n mapRow?: (item: TItem) => TItem;\n mapProp?: (item: TItem) => unknown;\n}\n\nexport const createNodeSelectorField = <\n TItem extends NodeSelectorItem = NodeSelectorItem,\n>({\n nodeType,\n label = 'Node',\n placeholder = `Select ${nodeType}`,\n showSearch = true,\n initialQuery = '',\n searchFields = ['title'],\n fields,\n getItemSummary,\n mapRow,\n mapProp,\n}: NodeSelectorFieldOptions<TItem>) => {\n return {\n type: 'external' as const,\n label,\n placeholder,\n showSearch,\n initialQuery,\n fetchList: async ({ query }: { query?: string } = {}): Promise<TItem[]> =>\n fetchNodeList<TItem>(nodeType, {\n lang: getPathLocale(window.location.pathname),\n query,\n searchFields,\n fields,\n }),\n getItemSummary:\n getItemSummary ||\n ((item: TItem) => {\n const summary = item?.title;\n return typeof summary === 'string' ? summary : '';\n }),\n mapRow:\n mapRow ||\n ((item: TItem): TItem => {\n return item;\n }),\n mapProp,\n };\n};\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,kBAAkB;AAChD,SAASC,aAAa,QAAQ,cAAc;AAuB5C,OAAO,MAAMC,uBAAuB,GAAGA,CAErC;EACAC,QAAQ;EACRC,KAAK,GAAG,MAAM;EACdC,WAAW,GAAG,UAAUF,QAAQ,EAAE;EAClCG,UAAU,GAAG,IAAI;EACjBC,YAAY,GAAG,EAAE;EACjBC,YAAY,GAAG,CAAC,OAAO,CAAC;EACxBC,MAAM;EACNC,cAAc;EACdC,MAAM;EACNC;AAC+B,CAAC,KAAK;EACrC,OAAO;IACLC,IAAI,EAAE,UAAmB;IACzBT,KAAK;IACLC,WAAW;IACXC,UAAU;IACVC,YAAY;IACZO,SAAS,EAAE,MAAAA,CAAO;MAAEC;IAA0B,CAAC,GAAG,CAAC,CAAC,KAClDf,aAAa,CAAQG,QAAQ,EAAE;MAC7Ba,IAAI,EAAEf,aAAa,CAACgB,MAAM,CAACC,QAAQ,CAACC,QAAQ,CAAC;MAC7CJ,KAAK;MACLP,YAAY;MACZC;IACF,CAAC,CAAC;IACJC,cAAc,EACZA,cAAc,KACZU,IAAW,IAAK;MAChB,MAAMC,OAAO,GAAGD,IAAI,EAAEE,KAAK;MAC3B,OAAO,OAAOD,OAAO,KAAK,QAAQ,GAAGA,OAAO,GAAG,EAAE;IACnD,CAAC,CAAC;IACJV,MAAM,EACJA,MAAM,KACJS,IAAW,IAAY;MACvB,OAAOA,IAAI;IACb,CAAC,CAAC;IACJR;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
import { FieldLabel } from '@puckeditor/core';
|
|
3
|
+
type FieldLabelProps = ComponentProps<typeof FieldLabel>;
|
|
4
|
+
/**
|
|
5
|
+
* Drop-in for Puck's FieldLabel. When the label ends with the required marker
|
|
6
|
+
* (" *", produced by the `required()` field wrapper), it renders a styled
|
|
7
|
+
* <RequiredMark /> inline instead of the literal asterisk — keeping Puck's
|
|
8
|
+
* native label styling.
|
|
9
|
+
*
|
|
10
|
+
* Used directly by custom fields and registered as `overrides.fieldLabel`, so
|
|
11
|
+
* built-in and custom fields get the same marker. Puck renders `label` as a JSX
|
|
12
|
+
* child, so a ReactNode works at runtime despite the `string` type.
|
|
13
|
+
*/
|
|
14
|
+
export declare function RequiredFieldLabel({ label, ...rest }: FieldLabelProps): import("react").JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=required-field-label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"required-field-label.d.ts","sourceRoot":"","sources":["../../../../src/puck-editor/internal/fields/required-field-label.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAI9C,KAAK,eAAe,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAEzD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,eAAe,+BAoBrE"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
4
|
+
import { FieldLabel } from '@puckeditor/core';
|
|
5
|
+
import { RequiredMark } from '../ui/required-mark';
|
|
6
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
/**
|
|
8
|
+
* Drop-in for Puck's FieldLabel. When the label ends with the required marker
|
|
9
|
+
* (" *", produced by the `required()` field wrapper), it renders a styled
|
|
10
|
+
* <RequiredMark /> inline instead of the literal asterisk — keeping Puck's
|
|
11
|
+
* native label styling.
|
|
12
|
+
*
|
|
13
|
+
* Used directly by custom fields and registered as `overrides.fieldLabel`, so
|
|
14
|
+
* built-in and custom fields get the same marker. Puck renders `label` as a JSX
|
|
15
|
+
* child, so a ReactNode works at runtime despite the `string` type.
|
|
16
|
+
*/
|
|
17
|
+
export function RequiredFieldLabel(t0) {
|
|
18
|
+
const $ = _c(14);
|
|
19
|
+
let label;
|
|
20
|
+
let rest;
|
|
21
|
+
if ($[0] !== t0) {
|
|
22
|
+
({
|
|
23
|
+
label,
|
|
24
|
+
...rest
|
|
25
|
+
} = t0);
|
|
26
|
+
$[0] = t0;
|
|
27
|
+
$[1] = label;
|
|
28
|
+
$[2] = rest;
|
|
29
|
+
} else {
|
|
30
|
+
label = $[1];
|
|
31
|
+
rest = $[2];
|
|
32
|
+
}
|
|
33
|
+
const isRequired = typeof label === "string" && label.endsWith(" *");
|
|
34
|
+
if (!isRequired) {
|
|
35
|
+
let t1;
|
|
36
|
+
if ($[3] !== label || $[4] !== rest) {
|
|
37
|
+
t1 = /*#__PURE__*/_jsx(FieldLabel, {
|
|
38
|
+
label: label,
|
|
39
|
+
...rest
|
|
40
|
+
});
|
|
41
|
+
$[3] = label;
|
|
42
|
+
$[4] = rest;
|
|
43
|
+
$[5] = t1;
|
|
44
|
+
} else {
|
|
45
|
+
t1 = $[5];
|
|
46
|
+
}
|
|
47
|
+
return t1;
|
|
48
|
+
}
|
|
49
|
+
let t1;
|
|
50
|
+
if ($[6] !== label) {
|
|
51
|
+
t1 = label.slice(0, -2);
|
|
52
|
+
$[6] = label;
|
|
53
|
+
$[7] = t1;
|
|
54
|
+
} else {
|
|
55
|
+
t1 = $[7];
|
|
56
|
+
}
|
|
57
|
+
let t2;
|
|
58
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
59
|
+
t2 = /*#__PURE__*/_jsx(RequiredMark, {});
|
|
60
|
+
$[8] = t2;
|
|
61
|
+
} else {
|
|
62
|
+
t2 = $[8];
|
|
63
|
+
}
|
|
64
|
+
let t3;
|
|
65
|
+
if ($[9] !== t1) {
|
|
66
|
+
t3 = /*#__PURE__*/_jsxs(_Fragment, {
|
|
67
|
+
children: [t1, t2]
|
|
68
|
+
});
|
|
69
|
+
$[9] = t1;
|
|
70
|
+
$[10] = t3;
|
|
71
|
+
} else {
|
|
72
|
+
t3 = $[10];
|
|
73
|
+
}
|
|
74
|
+
const t4 = t3;
|
|
75
|
+
let t5;
|
|
76
|
+
if ($[11] !== rest || $[12] !== t4) {
|
|
77
|
+
t5 = /*#__PURE__*/_jsx(FieldLabel, {
|
|
78
|
+
...rest,
|
|
79
|
+
label: t4
|
|
80
|
+
});
|
|
81
|
+
$[11] = rest;
|
|
82
|
+
$[12] = t4;
|
|
83
|
+
$[13] = t5;
|
|
84
|
+
} else {
|
|
85
|
+
t5 = $[13];
|
|
86
|
+
}
|
|
87
|
+
return t5;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=required-field-label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"required-field-label.js","names":["c","_c","FieldLabel","RequiredMark","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","RequiredFieldLabel","t0","$","label","rest","isRequired","endsWith","t1","slice","t2","Symbol","for","t3","children","t4","t5"],"sources":["../../../../src/puck-editor/internal/fields/required-field-label.tsx"],"sourcesContent":["'use client';\n\nimport type { ComponentProps } from 'react';\nimport { FieldLabel } from '@puckeditor/core';\n\nimport { RequiredMark } from '../ui/required-mark';\n\ntype FieldLabelProps = ComponentProps<typeof FieldLabel>;\n\n/**\n * Drop-in for Puck's FieldLabel. When the label ends with the required marker\n * (\" *\", produced by the `required()` field wrapper), it renders a styled\n * <RequiredMark /> inline instead of the literal asterisk — keeping Puck's\n * native label styling.\n *\n * Used directly by custom fields and registered as `overrides.fieldLabel`, so\n * built-in and custom fields get the same marker. Puck renders `label` as a JSX\n * child, so a ReactNode works at runtime despite the `string` type.\n */\nexport function RequiredFieldLabel({ label, ...rest }: FieldLabelProps) {\n const isRequired = typeof label === 'string' && label.endsWith(' *');\n\n if (!isRequired) {\n return <FieldLabel label={label} {...rest} />;\n }\n\n return (\n <FieldLabel\n {...rest}\n label={\n (\n <>\n {label.slice(0, -2)}\n <RequiredMark />\n </>\n ) as unknown as string\n }\n />\n );\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAGb,SAASC,UAAU,QAAQ,kBAAkB;AAE7C,SAASC,YAAY,QAAQ,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAInD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAAC,mBAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAX,EAAA;EAAA,IAAAY,KAAA;EAAA,IAAAC,IAAA;EAAA,IAAAF,CAAA,QAAAD,EAAA;IAA4B;MAAAE,KAAA;MAAA,GAAAC;IAAA,IAAAH,EAAmC;IAAAC,CAAA,MAAAD,EAAA;IAAAC,CAAA,MAAAC,KAAA;IAAAD,CAAA,MAAAE,IAAA;EAAA;IAAAD,KAAA,GAAAD,CAAA;IAAAE,IAAA,GAAAF,CAAA;EAAA;EACpE,MAAAG,UAAA,GAAmB,OAAOF,KAAK,KAAK,QAAgC,IAApBA,KAAK,CAAAG,QAAS,CAAC,IAAI,CAAC;EAEpE,IAAI,CAACD,UAAU;IAAA,IAAAE,EAAA;IAAA,IAAAL,CAAA,QAAAC,KAAA,IAAAD,CAAA,QAAAE,IAAA;MACNG,EAAA,gBAAAZ,IAAA,CAACH,UAAU;QAAQW,KAAK,EAALA,KAAK;QAAA,GAAMC;MAAI,CAAG,CAAC;MAAAF,CAAA,MAAAC,KAAA;MAAAD,CAAA,MAAAE,IAAA;MAAAF,CAAA,MAAAK,EAAA;IAAA;MAAAA,EAAA,GAAAL,CAAA;IAAA;IAAA,OAAtCK,EAAsC;EAAA;EAC9C,IAAAA,EAAA;EAAA,IAAAL,CAAA,QAAAC,KAAA;IAQUI,EAAA,GAAAJ,KAAK,CAAAK,KAAM,CAAC,CAAC,EAAE,EAAE,CAAC;IAAAN,CAAA,MAAAC,KAAA;IAAAD,CAAA,MAAAK,EAAA;EAAA;IAAAA,EAAA,GAAAL,CAAA;EAAA;EAAA,IAAAO,EAAA;EAAA,IAAAP,CAAA,QAAAQ,MAAA,CAAAC,GAAA;IACnBF,EAAA,gBAAAd,IAAA,CAACF,YAAY,IAAE,CAAC;IAAAS,CAAA,MAAAO,EAAA;EAAA;IAAAA,EAAA,GAAAP,CAAA;EAAA;EAAA,IAAAU,EAAA;EAAA,IAAAV,CAAA,QAAAK,EAAA;IAFlBK,EAAA,gBAAAb,KAAA,CAAAF,SAAA;MAAAgB,QAAA,GACGN,EAAkB,EACnBE,EAAgB;IAAA,CAChB,CAAC;IAAAP,CAAA,MAAAK,EAAA;IAAAL,CAAA,OAAAU,EAAA;EAAA;IAAAA,EAAA,GAAAV,CAAA;EAAA;EAJL,MAAAY,EAAA,GACEF,EAGG;EACiB,IAAAG,EAAA;EAAA,IAAAb,CAAA,SAAAE,IAAA,IAAAF,CAAA,SAAAY,EAAA;IAR1BC,EAAA,gBAAApB,IAAA,CAACH,UAAU;MAAA,GACLY,IAAI;MAEND,KAKsB,EALtBW;IAKsB,CAEzB,CAAC;IAAAZ,CAAA,OAAAE,IAAA;IAAAF,CAAA,OAAAY,EAAA;IAAAZ,CAAA,OAAAa,EAAA;EAAA;IAAAA,EAAA,GAAAb,CAAA;EAAA;EAAA,OAVFa,EAUE;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FieldMetadata } from '@puckeditor/core';
|
|
2
|
+
type RequirableField = {
|
|
3
|
+
label?: string;
|
|
4
|
+
metadata?: FieldMetadata;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Marks a Puck field as required. Puck has no native `required` support, so this
|
|
8
|
+
* sets both channels atomically: `metadata.required` is the source of truth for
|
|
9
|
+
* save validation, and a trailing " *" on the label is the display channel
|
|
10
|
+
* (Puck's `overrides.fieldLabel` only receives the label string, where
|
|
11
|
+
* `RequiredFieldLabel` renders it as a red mark). Never write either by hand.
|
|
12
|
+
*
|
|
13
|
+
* Wraps any field definition, built-in or factory-made:
|
|
14
|
+
* title: required({ type: 'text', label: 'Title' })
|
|
15
|
+
* image: required(createMediaSelectorField({ label: 'Media' }))
|
|
16
|
+
*/
|
|
17
|
+
export declare const required: <F extends RequirableField>(field: F) => F;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=required.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"required.d.ts","sourceRoot":"","sources":["../../../../src/puck-editor/internal/fields/required.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,KAAK,eAAe,GAAG;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,eAAe,EAAE,OAAO,CAAC,KAAG,CAKtD,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Marks a Puck field as required. Puck has no native `required` support, so this
|
|
3
|
+
* sets both channels atomically: `metadata.required` is the source of truth for
|
|
4
|
+
* save validation, and a trailing " *" on the label is the display channel
|
|
5
|
+
* (Puck's `overrides.fieldLabel` only receives the label string, where
|
|
6
|
+
* `RequiredFieldLabel` renders it as a red mark). Never write either by hand.
|
|
7
|
+
*
|
|
8
|
+
* Wraps any field definition, built-in or factory-made:
|
|
9
|
+
* title: required({ type: 'text', label: 'Title' })
|
|
10
|
+
* image: required(createMediaSelectorField({ label: 'Media' }))
|
|
11
|
+
*/
|
|
12
|
+
export const required = field => ({
|
|
13
|
+
...field,
|
|
14
|
+
label: field.label ? `${field.label} *` : field.label,
|
|
15
|
+
metadata: {
|
|
16
|
+
...field.metadata,
|
|
17
|
+
required: true
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=required.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"required.js","names":["required","field","label","metadata"],"sources":["../../../../src/puck-editor/internal/fields/required.ts"],"sourcesContent":["import type { FieldMetadata } from '@puckeditor/core';\n\ntype RequirableField = {\n label?: string;\n metadata?: FieldMetadata;\n};\n\n/**\n * Marks a Puck field as required. Puck has no native `required` support, so this\n * sets both channels atomically: `metadata.required` is the source of truth for\n * save validation, and a trailing \" *\" on the label is the display channel\n * (Puck's `overrides.fieldLabel` only receives the label string, where\n * `RequiredFieldLabel` renders it as a red mark). Never write either by hand.\n *\n * Wraps any field definition, built-in or factory-made:\n * title: required({ type: 'text', label: 'Title' })\n * image: required(createMediaSelectorField({ label: 'Media' }))\n */\nexport const required = <F extends RequirableField>(field: F): F =>\n ({\n ...field,\n label: field.label ? `${field.label} *` : field.label,\n metadata: { ...field.metadata, required: true },\n }) as F;\n"],"mappings":"AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,QAAQ,GAA+BC,KAAQ,KACzD;EACC,GAAGA,KAAK;EACRC,KAAK,EAAED,KAAK,CAACC,KAAK,GAAG,GAAGD,KAAK,CAACC,KAAK,IAAI,GAAGD,KAAK,CAACC,KAAK;EACrDC,QAAQ,EAAE;IAAE,GAAGF,KAAK,CAACE,QAAQ;IAAEH,QAAQ,EAAE;EAAK;AAChD,CAAC,CAAM","ignoreList":[]}
|