@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,372 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import NextImage from 'next/image';
|
|
6
|
+
import { FieldLabel } from '@puckeditor/core';
|
|
7
|
+
import { CropIcon, ImageIcon, PlusIcon, Trash2 } from 'lucide-react';
|
|
8
|
+
import { cn } from '../../../../shared/cn';
|
|
9
|
+
import { usePuckEditorConfig } from '../../editor-config';
|
|
10
|
+
import { usePuckDictionary } from '../../i18n';
|
|
11
|
+
import { IconButton } from '../../ui/icon-button';
|
|
12
|
+
import { CropEditorDialog } from '../media-selector/crop-editor-dialog';
|
|
13
|
+
import { extractFields } from '../media-selector/extract-fields';
|
|
14
|
+
import { deriveThumbnailImage } from '../media-selector/media-selector-field';
|
|
15
|
+
import { MediaSelectorModal } from '../media-selector/media-selector-modal';
|
|
16
|
+
import { reorder } from './reorder';
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
|
+
export function MediaArrayField(t0) {
|
|
19
|
+
const $ = _c(68);
|
|
20
|
+
const {
|
|
21
|
+
onChange,
|
|
22
|
+
value,
|
|
23
|
+
mediaTypes,
|
|
24
|
+
label,
|
|
25
|
+
fields,
|
|
26
|
+
cropConfig
|
|
27
|
+
} = t0;
|
|
28
|
+
const t = usePuckDictionary().fields;
|
|
29
|
+
const tMedia = usePuckDictionary().mediaSelector;
|
|
30
|
+
const tCrop = usePuckDictionary().crop;
|
|
31
|
+
const {
|
|
32
|
+
drupalBaseUrl: t1
|
|
33
|
+
} = usePuckEditorConfig();
|
|
34
|
+
const drupalBaseUrl = t1 === undefined ? "" : t1;
|
|
35
|
+
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
36
|
+
const [cropIndex, setCropIndex] = useState(null);
|
|
37
|
+
const [dragIndex, setDragIndex] = useState(null);
|
|
38
|
+
const [dropIndex, setDropIndex] = useState(null);
|
|
39
|
+
let t2;
|
|
40
|
+
if ($[0] !== value) {
|
|
41
|
+
t2 = value ?? [];
|
|
42
|
+
$[0] = value;
|
|
43
|
+
$[1] = t2;
|
|
44
|
+
} else {
|
|
45
|
+
t2 = $[1];
|
|
46
|
+
}
|
|
47
|
+
const items = t2;
|
|
48
|
+
let t3;
|
|
49
|
+
if ($[2] !== fields || $[3] !== items || $[4] !== onChange) {
|
|
50
|
+
t3 = selection => {
|
|
51
|
+
const selectedIds = new Set(selection.map(_temp));
|
|
52
|
+
const existingIds = new Set(items.map(_temp2));
|
|
53
|
+
const kept = items.filter(item => selectedIds.has(item.id));
|
|
54
|
+
const added = selection.filter(item_0 => !existingIds.has(item_0.id)).map(item_1 => fields ? extractFields(item_1, [...fields, "id", "type", "name", "thumbnailImage"]) : item_1);
|
|
55
|
+
onChange([...kept, ...added]);
|
|
56
|
+
setIsModalOpen(false);
|
|
57
|
+
};
|
|
58
|
+
$[2] = fields;
|
|
59
|
+
$[3] = items;
|
|
60
|
+
$[4] = onChange;
|
|
61
|
+
$[5] = t3;
|
|
62
|
+
} else {
|
|
63
|
+
t3 = $[5];
|
|
64
|
+
}
|
|
65
|
+
const handleConfirmSelection = t3;
|
|
66
|
+
let t4;
|
|
67
|
+
if ($[6] !== items || $[7] !== onChange) {
|
|
68
|
+
t4 = index => {
|
|
69
|
+
onChange(items.filter((_, i) => i !== index));
|
|
70
|
+
};
|
|
71
|
+
$[6] = items;
|
|
72
|
+
$[7] = onChange;
|
|
73
|
+
$[8] = t4;
|
|
74
|
+
} else {
|
|
75
|
+
t4 = $[8];
|
|
76
|
+
}
|
|
77
|
+
const handleRemove = t4;
|
|
78
|
+
let t5;
|
|
79
|
+
if ($[9] !== items || $[10] !== onChange) {
|
|
80
|
+
t5 = (index_0, crop) => {
|
|
81
|
+
onChange(items.map((item_2, i_0) => {
|
|
82
|
+
if (i_0 !== index_0) {
|
|
83
|
+
return item_2;
|
|
84
|
+
}
|
|
85
|
+
if (crop) {
|
|
86
|
+
return {
|
|
87
|
+
...item_2,
|
|
88
|
+
crop
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
const {
|
|
92
|
+
crop: _removed,
|
|
93
|
+
...rest
|
|
94
|
+
} = item_2;
|
|
95
|
+
return rest;
|
|
96
|
+
}));
|
|
97
|
+
setCropIndex(null);
|
|
98
|
+
};
|
|
99
|
+
$[9] = items;
|
|
100
|
+
$[10] = onChange;
|
|
101
|
+
$[11] = t5;
|
|
102
|
+
} else {
|
|
103
|
+
t5 = $[11];
|
|
104
|
+
}
|
|
105
|
+
const handleCropSave = t5;
|
|
106
|
+
let t6;
|
|
107
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
108
|
+
t6 = () => {
|
|
109
|
+
setDragIndex(null);
|
|
110
|
+
setDropIndex(null);
|
|
111
|
+
};
|
|
112
|
+
$[12] = t6;
|
|
113
|
+
} else {
|
|
114
|
+
t6 = $[12];
|
|
115
|
+
}
|
|
116
|
+
const resetDrag = t6;
|
|
117
|
+
let t7;
|
|
118
|
+
if ($[13] !== dragIndex || $[14] !== dropIndex || $[15] !== items || $[16] !== onChange) {
|
|
119
|
+
t7 = () => {
|
|
120
|
+
if (dragIndex !== null && dropIndex !== null) {
|
|
121
|
+
const to = dropIndex > dragIndex ? dropIndex - 1 : dropIndex;
|
|
122
|
+
if (to !== dragIndex) {
|
|
123
|
+
onChange(reorder(items, dragIndex, to));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
resetDrag();
|
|
127
|
+
};
|
|
128
|
+
$[13] = dragIndex;
|
|
129
|
+
$[14] = dropIndex;
|
|
130
|
+
$[15] = items;
|
|
131
|
+
$[16] = onChange;
|
|
132
|
+
$[17] = t7;
|
|
133
|
+
} else {
|
|
134
|
+
t7 = $[17];
|
|
135
|
+
}
|
|
136
|
+
const commitDrop = t7;
|
|
137
|
+
let t8;
|
|
138
|
+
if ($[18] !== drupalBaseUrl) {
|
|
139
|
+
t8 = item_3 => item_3.field_media_image?.uri?.url ? `${drupalBaseUrl}${item_3.field_media_image.uri.url}` : deriveThumbnailImage(item_3, drupalBaseUrl);
|
|
140
|
+
$[18] = drupalBaseUrl;
|
|
141
|
+
$[19] = t8;
|
|
142
|
+
} else {
|
|
143
|
+
t8 = $[19];
|
|
144
|
+
}
|
|
145
|
+
const originalSrc = t8;
|
|
146
|
+
const cropItem = cropIndex !== null ? items[cropIndex] : undefined;
|
|
147
|
+
let t9;
|
|
148
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
149
|
+
t9 = /*#__PURE__*/_jsx(ImageIcon, {
|
|
150
|
+
className: "nh:size-4"
|
|
151
|
+
});
|
|
152
|
+
$[20] = t9;
|
|
153
|
+
} else {
|
|
154
|
+
t9 = $[20];
|
|
155
|
+
}
|
|
156
|
+
const t10 = label ?? t.media;
|
|
157
|
+
let t11;
|
|
158
|
+
if ($[21] !== t10) {
|
|
159
|
+
t11 = /*#__PURE__*/_jsx(FieldLabel, {
|
|
160
|
+
icon: t9,
|
|
161
|
+
label: t10
|
|
162
|
+
});
|
|
163
|
+
$[21] = t10;
|
|
164
|
+
$[22] = t11;
|
|
165
|
+
} else {
|
|
166
|
+
t11 = $[22];
|
|
167
|
+
}
|
|
168
|
+
let t12;
|
|
169
|
+
if ($[23] !== commitDrop) {
|
|
170
|
+
t12 = e_0 => {
|
|
171
|
+
e_0.preventDefault();
|
|
172
|
+
commitDrop();
|
|
173
|
+
};
|
|
174
|
+
$[23] = commitDrop;
|
|
175
|
+
$[24] = t12;
|
|
176
|
+
} else {
|
|
177
|
+
t12 = $[24];
|
|
178
|
+
}
|
|
179
|
+
let t13;
|
|
180
|
+
if ($[25] !== cropConfig || $[26] !== dragIndex || $[27] !== dropIndex || $[28] !== drupalBaseUrl || $[29] !== handleRemove || $[30] !== items || $[31] !== tCrop || $[32] !== tMedia.remove) {
|
|
181
|
+
let t14;
|
|
182
|
+
if ($[34] !== cropConfig || $[35] !== dragIndex || $[36] !== dropIndex || $[37] !== drupalBaseUrl || $[38] !== handleRemove || $[39] !== items.length || $[40] !== tCrop || $[41] !== tMedia.remove) {
|
|
183
|
+
t14 = (item_4, index_1) => {
|
|
184
|
+
const thumbnail = deriveThumbnailImage(item_4, drupalBaseUrl);
|
|
185
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
186
|
+
draggable: true,
|
|
187
|
+
onDragStart: e_1 => {
|
|
188
|
+
setDragIndex(index_1);
|
|
189
|
+
e_1.dataTransfer.effectAllowed = "move";
|
|
190
|
+
e_1.dataTransfer.setData("text/plain", String(index_1));
|
|
191
|
+
},
|
|
192
|
+
onDragEnd: resetDrag,
|
|
193
|
+
onDragOver: e_2 => {
|
|
194
|
+
e_2.preventDefault();
|
|
195
|
+
e_2.dataTransfer.dropEffect = "move";
|
|
196
|
+
const rect = e_2.currentTarget.getBoundingClientRect();
|
|
197
|
+
const before = (e_2.clientX - rect.left) / rect.width < 0.5;
|
|
198
|
+
setDropIndex(before ? index_1 : index_1 + 1);
|
|
199
|
+
},
|
|
200
|
+
className: cn("nh:group nh:relative nh:aspect-square nh:cursor-grab nh:overflow-hidden nh:rounded-md nh:border nh:border-gray-200 nh:bg-gray-100", {
|
|
201
|
+
"nh:opacity-50": dragIndex === index_1,
|
|
202
|
+
"nh:shadow-[-3px_0_0_0_var(--nh-primary)]": dropIndex === index_1 && dragIndex !== null,
|
|
203
|
+
"nh:shadow-[3px_0_0_0_var(--nh-primary)]": dropIndex === index_1 + 1 && index_1 === items.length - 1 && dragIndex !== null
|
|
204
|
+
}),
|
|
205
|
+
children: [thumbnail ? /*#__PURE__*/_jsx(NextImage, {
|
|
206
|
+
src: thumbnail,
|
|
207
|
+
alt: item_4.name || "",
|
|
208
|
+
fill: true,
|
|
209
|
+
sizes: "96px",
|
|
210
|
+
className: "nh:pointer-events-none nh:object-cover"
|
|
211
|
+
}) : /*#__PURE__*/_jsx("div", {
|
|
212
|
+
className: "nh:flex nh:h-full nh:w-full nh:items-center nh:justify-center",
|
|
213
|
+
children: /*#__PURE__*/_jsx(ImageIcon, {
|
|
214
|
+
className: "nh:size-6 nh:text-gray-400"
|
|
215
|
+
})
|
|
216
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
217
|
+
className: "nh:absolute nh:top-1 nh:right-1 nh:flex nh:gap-1",
|
|
218
|
+
children: [cropConfig && item_4.type === "media--image" && /*#__PURE__*/_jsxs(IconButton, {
|
|
219
|
+
variant: "overlay",
|
|
220
|
+
title: tCrop.editCrop,
|
|
221
|
+
onClick: () => setCropIndex(index_1),
|
|
222
|
+
children: [/*#__PURE__*/_jsx(CropIcon, {
|
|
223
|
+
className: "nh:size-3.5"
|
|
224
|
+
}), item_4.crop && /*#__PURE__*/_jsx("span", {
|
|
225
|
+
className: "nh:absolute nh:-top-0.5 nh:-right-0.5 nh:size-1.5 nh:rounded-full nh:bg-(--nh-primary)"
|
|
226
|
+
})]
|
|
227
|
+
}), /*#__PURE__*/_jsx(IconButton, {
|
|
228
|
+
variant: "overlay",
|
|
229
|
+
title: tMedia.remove,
|
|
230
|
+
onClick: () => handleRemove(index_1),
|
|
231
|
+
children: /*#__PURE__*/_jsx(Trash2, {
|
|
232
|
+
className: "nh:size-3.5"
|
|
233
|
+
})
|
|
234
|
+
})]
|
|
235
|
+
})]
|
|
236
|
+
}, `${item_4.id}-${index_1}`);
|
|
237
|
+
};
|
|
238
|
+
$[34] = cropConfig;
|
|
239
|
+
$[35] = dragIndex;
|
|
240
|
+
$[36] = dropIndex;
|
|
241
|
+
$[37] = drupalBaseUrl;
|
|
242
|
+
$[38] = handleRemove;
|
|
243
|
+
$[39] = items.length;
|
|
244
|
+
$[40] = tCrop;
|
|
245
|
+
$[41] = tMedia.remove;
|
|
246
|
+
$[42] = t14;
|
|
247
|
+
} else {
|
|
248
|
+
t14 = $[42];
|
|
249
|
+
}
|
|
250
|
+
t13 = items.map(t14);
|
|
251
|
+
$[25] = cropConfig;
|
|
252
|
+
$[26] = dragIndex;
|
|
253
|
+
$[27] = dropIndex;
|
|
254
|
+
$[28] = drupalBaseUrl;
|
|
255
|
+
$[29] = handleRemove;
|
|
256
|
+
$[30] = items;
|
|
257
|
+
$[31] = tCrop;
|
|
258
|
+
$[32] = tMedia.remove;
|
|
259
|
+
$[33] = t13;
|
|
260
|
+
} else {
|
|
261
|
+
t13 = $[33];
|
|
262
|
+
}
|
|
263
|
+
let t14;
|
|
264
|
+
let t15;
|
|
265
|
+
if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
|
|
266
|
+
t14 = () => setIsModalOpen(true);
|
|
267
|
+
t15 = /*#__PURE__*/_jsx(PlusIcon, {
|
|
268
|
+
className: "nh:size-6"
|
|
269
|
+
});
|
|
270
|
+
$[43] = t14;
|
|
271
|
+
$[44] = t15;
|
|
272
|
+
} else {
|
|
273
|
+
t14 = $[43];
|
|
274
|
+
t15 = $[44];
|
|
275
|
+
}
|
|
276
|
+
let t16;
|
|
277
|
+
if ($[45] !== tMedia.selectMedia) {
|
|
278
|
+
t16 = /*#__PURE__*/_jsx(IconButton, {
|
|
279
|
+
variant: "tile",
|
|
280
|
+
title: tMedia.selectMedia,
|
|
281
|
+
onClick: t14,
|
|
282
|
+
children: t15
|
|
283
|
+
});
|
|
284
|
+
$[45] = tMedia.selectMedia;
|
|
285
|
+
$[46] = t16;
|
|
286
|
+
} else {
|
|
287
|
+
t16 = $[46];
|
|
288
|
+
}
|
|
289
|
+
let t17;
|
|
290
|
+
if ($[47] !== t12 || $[48] !== t13 || $[49] !== t16) {
|
|
291
|
+
t17 = /*#__PURE__*/_jsxs("div", {
|
|
292
|
+
className: "nh:grid nh:grid-cols-3 nh:gap-2",
|
|
293
|
+
onDragOver: _temp3,
|
|
294
|
+
onDrop: t12,
|
|
295
|
+
children: [t13, t16]
|
|
296
|
+
});
|
|
297
|
+
$[47] = t12;
|
|
298
|
+
$[48] = t13;
|
|
299
|
+
$[49] = t16;
|
|
300
|
+
$[50] = t17;
|
|
301
|
+
} else {
|
|
302
|
+
t17 = $[50];
|
|
303
|
+
}
|
|
304
|
+
let t18;
|
|
305
|
+
if ($[51] === Symbol.for("react.memo_cache_sentinel")) {
|
|
306
|
+
t18 = () => setIsModalOpen(false);
|
|
307
|
+
$[51] = t18;
|
|
308
|
+
} else {
|
|
309
|
+
t18 = $[51];
|
|
310
|
+
}
|
|
311
|
+
let t19;
|
|
312
|
+
if ($[52] !== handleConfirmSelection || $[53] !== isModalOpen || $[54] !== items || $[55] !== mediaTypes) {
|
|
313
|
+
t19 = /*#__PURE__*/_jsx(MediaSelectorModal, {
|
|
314
|
+
isOpen: isModalOpen,
|
|
315
|
+
onClose: t18,
|
|
316
|
+
value: null,
|
|
317
|
+
mediaTypes: mediaTypes,
|
|
318
|
+
multiple: true,
|
|
319
|
+
initialSelected: items,
|
|
320
|
+
onConfirmMultiple: handleConfirmSelection
|
|
321
|
+
});
|
|
322
|
+
$[52] = handleConfirmSelection;
|
|
323
|
+
$[53] = isModalOpen;
|
|
324
|
+
$[54] = items;
|
|
325
|
+
$[55] = mediaTypes;
|
|
326
|
+
$[56] = t19;
|
|
327
|
+
} else {
|
|
328
|
+
t19 = $[56];
|
|
329
|
+
}
|
|
330
|
+
let t20;
|
|
331
|
+
if ($[57] !== cropConfig || $[58] !== cropIndex || $[59] !== cropItem || $[60] !== handleCropSave || $[61] !== originalSrc) {
|
|
332
|
+
t20 = cropIndex !== null && cropConfig && cropItem && originalSrc(cropItem) && /*#__PURE__*/_jsx(CropEditorDialog, {
|
|
333
|
+
imageSrc: originalSrc(cropItem),
|
|
334
|
+
config: cropConfig,
|
|
335
|
+
value: cropItem.crop,
|
|
336
|
+
onSave: crop_0 => handleCropSave(cropIndex, crop_0),
|
|
337
|
+
onClose: () => setCropIndex(null)
|
|
338
|
+
});
|
|
339
|
+
$[57] = cropConfig;
|
|
340
|
+
$[58] = cropIndex;
|
|
341
|
+
$[59] = cropItem;
|
|
342
|
+
$[60] = handleCropSave;
|
|
343
|
+
$[61] = originalSrc;
|
|
344
|
+
$[62] = t20;
|
|
345
|
+
} else {
|
|
346
|
+
t20 = $[62];
|
|
347
|
+
}
|
|
348
|
+
let t21;
|
|
349
|
+
if ($[63] !== t11 || $[64] !== t17 || $[65] !== t19 || $[66] !== t20) {
|
|
350
|
+
t21 = /*#__PURE__*/_jsxs(_Fragment, {
|
|
351
|
+
children: [t11, t17, t19, t20]
|
|
352
|
+
});
|
|
353
|
+
$[63] = t11;
|
|
354
|
+
$[64] = t17;
|
|
355
|
+
$[65] = t19;
|
|
356
|
+
$[66] = t20;
|
|
357
|
+
$[67] = t21;
|
|
358
|
+
} else {
|
|
359
|
+
t21 = $[67];
|
|
360
|
+
}
|
|
361
|
+
return t21;
|
|
362
|
+
}
|
|
363
|
+
function _temp3(e) {
|
|
364
|
+
return e.preventDefault();
|
|
365
|
+
}
|
|
366
|
+
function _temp2(m_0) {
|
|
367
|
+
return m_0.id;
|
|
368
|
+
}
|
|
369
|
+
function _temp(m) {
|
|
370
|
+
return m.id;
|
|
371
|
+
}
|
|
372
|
+
//# sourceMappingURL=media-array-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-array-field.js","names":["c","_c","useState","NextImage","FieldLabel","CropIcon","ImageIcon","PlusIcon","Trash2","cn","usePuckEditorConfig","usePuckDictionary","IconButton","CropEditorDialog","extractFields","deriveThumbnailImage","MediaSelectorModal","reorder","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","MediaArrayField","t0","$","onChange","value","mediaTypes","label","fields","cropConfig","t","tMedia","mediaSelector","tCrop","crop","drupalBaseUrl","t1","undefined","isModalOpen","setIsModalOpen","cropIndex","setCropIndex","dragIndex","setDragIndex","dropIndex","setDropIndex","t2","items","t3","selection","selectedIds","Set","map","_temp","existingIds","_temp2","kept","filter","item","has","id","added","item_0","item_1","handleConfirmSelection","t4","index","_","i","handleRemove","t5","index_0","item_2","i_0","_removed","rest","handleCropSave","t6","Symbol","for","resetDrag","t7","to","commitDrop","t8","item_3","field_media_image","uri","url","originalSrc","cropItem","t9","className","t10","media","t11","icon","t12","e_0","e","preventDefault","t13","remove","t14","length","item_4","index_1","thumbnail","draggable","onDragStart","e_1","dataTransfer","effectAllowed","setData","String","onDragOver","e_2","dropEffect","rect","currentTarget","getBoundingClientRect","before","clientX","left","width","children","alt","name","fill","sizes","type","variant","title","editCrop","onClick","t15","t16","selectMedia","t17","_temp3","onDrop","t18","t19","onClose","multiple","t20","imageSrc","onSave","crop_0","t21","m_0","m"],"sources":["../../../../../src/puck-editor/internal/fields/media-array/media-array-field.tsx"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport NextImage from 'next/image';\nimport { FieldLabel } from '@puckeditor/core';\nimport { CropIcon, ImageIcon, PlusIcon, Trash2 } from 'lucide-react';\n\nimport { cn } from '../../../../shared/cn';\nimport { usePuckEditorConfig } from '../../editor-config';\nimport { usePuckDictionary } from '../../i18n';\nimport { IconButton } from '../../ui/icon-button';\nimport { CropEditorDialog } from '../media-selector/crop-editor-dialog';\nimport type { MediaCrop, MediaCropConfig } from '../media-selector/crop-types';\nimport { extractFields } from '../media-selector/extract-fields';\nimport {\n deriveThumbnailImage,\n MediaItem,\n} from '../media-selector/media-selector-field';\nimport { MediaSelectorModal } from '../media-selector/media-selector-modal';\nimport { reorder } from './reorder';\n\ntype MediaArrayFieldProps = {\n onChange: (value: MediaItem[] | null) => void;\n value: MediaItem[] | null;\n mediaTypes: string[];\n label?: string;\n fields?: string[];\n cropConfig?: MediaCropConfig;\n};\n\nexport function MediaArrayField({\n onChange,\n value,\n mediaTypes,\n label,\n fields,\n cropConfig,\n}: MediaArrayFieldProps) {\n const t = usePuckDictionary().fields;\n const tMedia = usePuckDictionary().mediaSelector;\n const tCrop = usePuckDictionary().crop;\n const { drupalBaseUrl = '' } = usePuckEditorConfig();\n const [isModalOpen, setIsModalOpen] = useState(false);\n const [cropIndex, setCropIndex] = useState<number | null>(null);\n const [dragIndex, setDragIndex] = useState<number | null>(null);\n const [dropIndex, setDropIndex] = useState<number | null>(null);\n\n const items = value ?? [];\n\n // Existing items keep their order and crop, deselected ones are removed,\n // newly selected ones are appended in click order (Gutenberg gallery model)\n const handleConfirmSelection = (selection: MediaItem[]) => {\n const selectedIds = new Set(selection.map((m) => m.id));\n const existingIds = new Set(items.map((m) => m.id));\n const kept = items.filter((item) => selectedIds.has(item.id));\n const added = selection\n .filter((item) => !existingIds.has(item.id))\n .map((item) =>\n fields\n ? extractFields(item, [\n ...fields,\n 'id',\n 'type',\n 'name',\n 'thumbnailImage',\n ])\n : item\n );\n onChange([...kept, ...added]);\n setIsModalOpen(false);\n };\n\n const handleRemove = (index: number) => {\n onChange(items.filter((_, i) => i !== index));\n };\n\n const handleCropSave = (index: number, crop: MediaCrop | undefined) => {\n onChange(\n items.map((item, i) => {\n if (i !== index) return item;\n if (crop) return { ...item, crop };\n const { crop: _removed, ...rest } = item;\n return rest as MediaItem;\n })\n );\n setCropIndex(null);\n };\n\n const resetDrag = () => {\n setDragIndex(null);\n setDropIndex(null);\n };\n\n const commitDrop = () => {\n if (dragIndex !== null && dropIndex !== null) {\n const to = dropIndex > dragIndex ? dropIndex - 1 : dropIndex;\n if (to !== dragIndex) {\n onChange(reorder(items, dragIndex, to));\n }\n }\n resetDrag();\n };\n\n const originalSrc = (item: MediaItem) =>\n item.field_media_image?.uri?.url\n ? `${drupalBaseUrl}${item.field_media_image.uri.url}`\n : deriveThumbnailImage(item, drupalBaseUrl);\n\n const cropItem = cropIndex !== null ? items[cropIndex] : undefined;\n\n return (\n <>\n <FieldLabel\n icon={<ImageIcon className=\"nh:size-4\" />}\n label={label ?? t.media}\n />\n <div\n className=\"nh:grid nh:grid-cols-3 nh:gap-2\"\n onDragOver={(e) => e.preventDefault()}\n onDrop={(e) => {\n e.preventDefault();\n commitDrop();\n }}\n >\n {items.map((item, index) => {\n const thumbnail = deriveThumbnailImage(item, drupalBaseUrl);\n return (\n <div\n key={`${item.id}-${index}`}\n draggable\n onDragStart={(e) => {\n setDragIndex(index);\n e.dataTransfer.effectAllowed = 'move';\n e.dataTransfer.setData('text/plain', String(index));\n }}\n onDragEnd={resetDrag}\n onDragOver={(e) => {\n e.preventDefault();\n e.dataTransfer.dropEffect = 'move';\n const rect = e.currentTarget.getBoundingClientRect();\n const before = (e.clientX - rect.left) / rect.width < 0.5;\n setDropIndex(before ? index : index + 1);\n }}\n className={cn(\n 'nh:group nh:relative nh:aspect-square nh:cursor-grab nh:overflow-hidden nh:rounded-md nh:border nh:border-gray-200 nh:bg-gray-100',\n {\n 'nh:opacity-50': dragIndex === index,\n 'nh:shadow-[-3px_0_0_0_var(--nh-primary)]':\n dropIndex === index && dragIndex !== null,\n 'nh:shadow-[3px_0_0_0_var(--nh-primary)]':\n dropIndex === index + 1 &&\n index === items.length - 1 &&\n dragIndex !== null,\n }\n )}\n >\n {thumbnail ? (\n <NextImage\n src={thumbnail}\n alt={item.name || ''}\n fill\n sizes=\"96px\"\n className=\"nh:pointer-events-none nh:object-cover\"\n />\n ) : (\n <div className=\"nh:flex nh:h-full nh:w-full nh:items-center nh:justify-center\">\n <ImageIcon className=\"nh:size-6 nh:text-gray-400\" />\n </div>\n )}\n <div className=\"nh:absolute nh:top-1 nh:right-1 nh:flex nh:gap-1\">\n {cropConfig && item.type === 'media--image' && (\n <IconButton\n variant=\"overlay\"\n title={tCrop.editCrop}\n onClick={() => setCropIndex(index)}\n >\n <CropIcon className=\"nh:size-3.5\" />\n {item.crop && (\n <span className=\"nh:absolute nh:-top-0.5 nh:-right-0.5 nh:size-1.5 nh:rounded-full nh:bg-(--nh-primary)\" />\n )}\n </IconButton>\n )}\n <IconButton\n variant=\"overlay\"\n title={tMedia.remove}\n onClick={() => handleRemove(index)}\n >\n <Trash2 className=\"nh:size-3.5\" />\n </IconButton>\n </div>\n </div>\n );\n })}\n <IconButton\n variant=\"tile\"\n title={tMedia.selectMedia}\n onClick={() => setIsModalOpen(true)}\n >\n <PlusIcon className=\"nh:size-6\" />\n </IconButton>\n </div>\n\n <MediaSelectorModal\n isOpen={isModalOpen}\n onClose={() => setIsModalOpen(false)}\n value={null}\n mediaTypes={mediaTypes}\n multiple\n initialSelected={items}\n onConfirmMultiple={handleConfirmSelection}\n />\n\n {cropIndex !== null &&\n cropConfig &&\n cropItem &&\n originalSrc(cropItem) && (\n <CropEditorDialog\n imageSrc={originalSrc(cropItem)!}\n config={cropConfig}\n value={cropItem.crop}\n onSave={(crop) => handleCropSave(cropIndex, crop)}\n onClose={() => setCropIndex(null)}\n />\n )}\n </>\n );\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAEb,SAASC,QAAQ,QAAQ,OAAO;AAChC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,cAAc;AAEpE,SAASC,EAAE,QAAQ,uBAAuB;AAC1C,SAASC,mBAAmB,QAAQ,qBAAqB;AACzD,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,UAAU,QAAQ,sBAAsB;AACjD,SAASC,gBAAgB,QAAQ,sCAAsC;AAEvE,SAASC,aAAa,QAAQ,kCAAkC;AAChE,SACEC,oBAAoB,QAEf,wCAAwC;AAC/C,SAASC,kBAAkB,QAAQ,wCAAwC;AAC3E,SAASC,OAAO,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAWpC,OAAO,SAAAC,gBAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAzB,EAAA;EAAyB;IAAA0B,QAAA;IAAAC,KAAA;IAAAC,UAAA;IAAAC,KAAA;IAAAC,MAAA;IAAAC;EAAA,IAAAP,EAOT;EACrB,MAAAQ,CAAA,GAAUtB,iBAAiB,CAAC,CAAC,CAAAoB,MAAO;EACpC,MAAAG,M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E,CAMpE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function reorder(items, from, to) {
|
|
2
|
+
if (from === to || from < 0 || from >= items.length) return items;
|
|
3
|
+
const next = [...items];
|
|
4
|
+
const [moved] = next.splice(from, 1);
|
|
5
|
+
next.splice(Math.max(0, Math.min(to, next.length)), 0, moved);
|
|
6
|
+
return next;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=reorder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reorder.js","names":["reorder","items","from","to","length","next","moved","splice","Math","max","min"],"sources":["../../../../../src/puck-editor/internal/fields/media-array/reorder.ts"],"sourcesContent":["export function reorder<T>(items: T[], from: number, to: number): T[] {\n if (from === to || from < 0 || from >= items.length) return items;\n const next = [...items];\n const [moved] = next.splice(from, 1);\n next.splice(Math.max(0, Math.min(to, next.length)), 0, moved);\n return next;\n}\n"],"mappings":"AAAA,OAAO,SAASA,OAAOA,CAAIC,KAAU,EAAEC,IAAY,EAAEC,EAAU,EAAO;EACpE,IAAID,IAAI,KAAKC,EAAE,IAAID,IAAI,GAAG,CAAC,IAAIA,IAAI,IAAID,KAAK,CAACG,MAAM,EAAE,OAAOH,KAAK;EACjE,MAAMI,IAAI,GAAG,CAAC,GAAGJ,KAAK,CAAC;EACvB,MAAM,CAACK,KAAK,CAAC,GAAGD,IAAI,CAACE,MAAM,CAACL,IAAI,EAAE,CAAC,CAAC;EACpCG,IAAI,CAACE,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAED,IAAI,CAACE,GAAG,CAACP,EAAE,EAAEE,IAAI,CAACD,MAAM,CAAC,CAAC,EAAE,CAAC,EAAEE,KAAK,CAAC;EAC7D,OAAOD,IAAI;AACb","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { MediaCropConfig } from './crop-types';
|
|
2
|
+
import { MediaItem } from './media-selector-field';
|
|
3
|
+
export interface MediaSelectorFieldOptions {
|
|
4
|
+
mediaTypes?: string[];
|
|
5
|
+
label?: string;
|
|
6
|
+
fields?: string[];
|
|
7
|
+
crop?: MediaCropConfig;
|
|
8
|
+
}
|
|
9
|
+
export declare const createMediaSelectorField: ({ mediaTypes, label, fields, crop, }?: MediaSelectorFieldOptions) => {
|
|
10
|
+
type: "custom";
|
|
11
|
+
label: string | undefined;
|
|
12
|
+
metadata: {
|
|
13
|
+
ai: {
|
|
14
|
+
bind: string;
|
|
15
|
+
instructions: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
render: ({ onChange, value, field }: {
|
|
19
|
+
field: import("@puckeditor/core").CustomField<MediaItem | null>;
|
|
20
|
+
name: string;
|
|
21
|
+
id: string;
|
|
22
|
+
value: MediaItem | null;
|
|
23
|
+
onChange: (value: MediaItem | null, uiState?: Partial<import("@puckeditor/core").UiState>) => void;
|
|
24
|
+
readOnly?: boolean;
|
|
25
|
+
}) => import("react").JSX.Element;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=create-media-selector-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-media-selector-field.d.ts","sourceRoot":"","sources":["../../../../../src/puck-editor/internal/fields/media-selector/create-media-selector-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,SAAS,EAAsB,MAAM,wBAAwB,CAAC;AAEvE,MAAM,WAAW,yBAAyB;IACxC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,CAAC,EAAE,eAAe,CAAC;CACxB;AAED,eAAO,MAAM,wBAAwB,GAAI,uCAKtC,yBAA8B;;;;;;;;;;;;;;;;;CAqBhC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { MediaSelectorField } from './media-selector-field';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
export const createMediaSelectorField = ({
|
|
4
|
+
mediaTypes = ['image'],
|
|
5
|
+
label,
|
|
6
|
+
fields,
|
|
7
|
+
crop
|
|
8
|
+
} = {}) => {
|
|
9
|
+
return {
|
|
10
|
+
type: 'custom',
|
|
11
|
+
label,
|
|
12
|
+
metadata: {
|
|
13
|
+
ai: {
|
|
14
|
+
bind: 'search_media',
|
|
15
|
+
instructions: `Value must be a full media object returned by search_media (type: ${mediaTypes.join(', ')}). Never construct one by hand.`
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
render: ({
|
|
19
|
+
onChange,
|
|
20
|
+
value,
|
|
21
|
+
field
|
|
22
|
+
}) => /*#__PURE__*/_jsx(MediaSelectorField, {
|
|
23
|
+
onChange: onChange,
|
|
24
|
+
value: value,
|
|
25
|
+
mediaTypes: mediaTypes,
|
|
26
|
+
label: field.label ?? label,
|
|
27
|
+
fields: fields,
|
|
28
|
+
cropConfig: crop
|
|
29
|
+
})
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=create-media-selector-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-media-selector-field.js","names":["MediaSelectorField","jsx","_jsx","createMediaSelectorField","mediaTypes","label","fields","crop","type","metadata","ai","bind","instructions","join","render","onChange","value","field","cropConfig"],"sources":["../../../../../src/puck-editor/internal/fields/media-selector/create-media-selector-field.tsx"],"sourcesContent":["import type { CustomFieldRender } from '@puckeditor/core';\n\nimport type { MediaCropConfig } from './crop-types';\nimport { MediaItem, MediaSelectorField } from './media-selector-field';\n\nexport interface MediaSelectorFieldOptions {\n mediaTypes?: string[];\n label?: string;\n fields?: string[]; // Array of property paths to save from API response\n crop?: MediaCropConfig;\n}\n\nexport const createMediaSelectorField = ({\n mediaTypes = ['image'],\n label,\n fields,\n crop,\n}: MediaSelectorFieldOptions = {}) => {\n return {\n type: 'custom' as const,\n label,\n metadata: {\n ai: {\n bind: 'search_media',\n instructions: `Value must be a full media object returned by search_media (type: ${mediaTypes.join(', ')}). Never construct one by hand.`,\n },\n },\n render: (({ onChange, value, field }) => (\n <MediaSelectorField\n onChange={onChange}\n value={value}\n mediaTypes={mediaTypes}\n label={field.label ?? label}\n fields={fields}\n cropConfig={crop}\n />\n )) satisfies CustomFieldRender<MediaItem | null>,\n };\n};\n"],"mappings":"AAGA,SAAoBA,kBAAkB,QAAQ,wBAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AASvE,OAAO,MAAMC,wBAAwB,GAAGA,CAAC;EACvCC,UAAU,GAAG,CAAC,OAAO,CAAC;EACtBC,KAAK;EACLC,MAAM;EACNC;AACyB,CAAC,GAAG,CAAC,CAAC,KAAK;EACpC,OAAO;IACLC,IAAI,EAAE,QAAiB;IACvBH,KAAK;IACLI,QAAQ,EAAE;MACRC,EAAE,EAAE;QACFC,IAAI,EAAE,cAAc;QACpBC,YAAY,EAAE,qEAAqER,UAAU,CAACS,IAAI,CAAC,IAAI,CAAC;MAC1G;IACF,CAAC;IACDC,MAAM,EAAGA,CAAC;MAAEC,QAAQ;MAAEC,KAAK;MAAEC;IAAM,CAAC,kBAClCf,IAAA,CAACF,kBAAkB;MACjBe,QAAQ,EAAEA,QAAS;MACnBC,KAAK,EAAEA,KAAM;MACbZ,UAAU,EAAEA,UAAW;MACvBC,KAAK,EAAEY,KAAK,CAACZ,KAAK,IAAIA,KAAM;MAC5BC,MAAM,EAAEA,MAAO;MACfY,UAAU,EAAEX;IAAK,CAClB;EAEL,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MediaCrop, MediaCropConfig } from './crop-types';
|
|
2
|
+
type CropEditorDialogProps = {
|
|
3
|
+
imageSrc: string;
|
|
4
|
+
config: MediaCropConfig;
|
|
5
|
+
value: MediaCrop | undefined;
|
|
6
|
+
onSave: (crop: MediaCrop | undefined) => void;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function CropEditorDialog({ imageSrc, config, value, onSave, onClose, }: CropEditorDialogProps): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=crop-editor-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crop-editor-dialog.d.ts","sourceRoot":"","sources":["../../../../../src/puck-editor/internal/fields/media-selector/crop-editor-dialog.tsx"],"names":[],"mappings":"AAeA,OAAO,EAGL,SAAS,EACT,eAAe,EAEhB,MAAM,cAAc,CAAC;AAKtB,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B,MAAM,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC;IAC9C,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,GACR,EAAE,qBAAqB,+BAuOvB"}
|