@nodehive/nextjs 0.1.3 → 0.2.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/README.md +1 -1
- package/dist/auth/index.d.ts +2 -3
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/internal/config.d.ts +15 -5
- package/dist/auth/internal/config.js.map +1 -1
- package/dist/auth/internal/draft-mode.d.ts +2 -3
- package/dist/auth/internal/draft-mode.js +3 -20
- package/dist/auth/internal/draft-mode.js.map +1 -1
- package/dist/auth/internal/editor-locale.d.ts +0 -1
- package/dist/auth/internal/handoff.d.ts +0 -1
- package/dist/auth/internal/has-session.d.ts +0 -1
- package/dist/auth/internal/has-session.js +1 -1
- package/dist/auth/internal/has-session.js.map +1 -1
- package/dist/auth/internal/i18n.d.ts +10 -0
- package/dist/auth/internal/i18n.js +25 -0
- package/dist/auth/internal/i18n.js.map +1 -0
- package/dist/auth/internal/logout.d.ts +1 -2
- package/dist/auth/internal/logout.js +3 -3
- package/dist/auth/internal/logout.js.map +1 -1
- package/dist/auth/internal/next-cookie-storage.d.ts +5 -2
- package/dist/auth/internal/next-cookie-storage.js +8 -1
- package/dist/auth/internal/next-cookie-storage.js.map +1 -1
- package/dist/auth/internal/nodehive-client.d.ts +6 -4
- package/dist/auth/internal/nodehive-client.js +6 -4
- package/dist/auth/internal/nodehive-client.js.map +1 -1
- package/dist/auth/internal/oauth-config.d.ts +0 -1
- package/dist/auth/internal/proxy-helpers.d.ts +0 -1
- package/dist/auth/internal/proxy-helpers.js +4 -4
- package/dist/auth/internal/proxy-helpers.js.map +1 -1
- package/dist/auth/internal/refresh.d.ts +1 -2
- package/dist/auth/internal/refresh.js +4 -4
- package/dist/auth/internal/refresh.js.map +1 -1
- package/dist/auth/internal/require-auth.d.ts +0 -1
- package/dist/auth/internal/require-auth.js +1 -1
- package/dist/auth/internal/require-auth.js.map +1 -1
- package/dist/auth/internal/return-to.d.ts +0 -1
- package/dist/auth/internal/roles.d.ts +17 -0
- package/dist/auth/internal/roles.js +39 -0
- package/dist/auth/internal/roles.js.map +1 -0
- package/dist/auth/internal/routes/callback.d.ts +1 -2
- package/dist/auth/internal/routes/callback.js +6 -6
- package/dist/auth/internal/routes/callback.js.map +1 -1
- package/dist/auth/internal/routes/chips-exchange.d.ts +1 -2
- package/dist/auth/internal/routes/chips-exchange.js +5 -5
- package/dist/auth/internal/routes/chips-exchange.js.map +1 -1
- package/dist/auth/internal/routes/draft.d.ts +1 -2
- package/dist/auth/internal/routes/draft.js +3 -3
- package/dist/auth/internal/routes/draft.js.map +1 -1
- package/dist/auth/internal/routes/index.d.ts +4 -2
- package/dist/auth/internal/routes/index.js +7 -7
- package/dist/auth/internal/routes/index.js.map +1 -1
- package/dist/auth/internal/routes/login.d.ts +0 -1
- package/dist/auth/internal/routes/login.js +3 -3
- package/dist/auth/internal/routes/login.js.map +1 -1
- package/dist/auth/internal/routes/popup-done.d.ts +2 -2
- package/dist/auth/internal/routes/popup-done.js +9 -7
- package/dist/auth/internal/routes/popup-done.js.map +1 -1
- package/dist/auth/internal/routes/refresh.d.ts +2 -5
- package/dist/auth/internal/routes/refresh.js +8 -2
- package/dist/auth/internal/routes/refresh.js.map +1 -1
- package/dist/auth/internal/same-origin.d.ts +0 -1
- package/dist/auth/internal/session-gates.d.ts +27 -3
- package/dist/auth/internal/session-gates.js +35 -3
- package/dist/auth/internal/session-gates.js.map +1 -1
- package/dist/auth/internal/update-session.d.ts +1 -2
- package/dist/auth/internal/update-session.js +1 -1
- package/dist/auth/internal/update-session.js.map +1 -1
- package/dist/auth/internal/use-editor-login.d.ts +0 -1
- package/dist/auth/internal/use-editor-login.js +2 -3
- package/dist/auth/internal/use-editor-login.js.map +1 -1
- package/dist/auth/proxy.d.ts +7 -8
- package/dist/auth/proxy.js +6 -6
- package/dist/auth/proxy.js.map +1 -1
- package/dist/auth/react.d.ts +1 -2
- package/dist/auth/react.js +1 -1
- package/dist/auth/react.js.map +1 -1
- package/dist/auth/routes.d.ts +3 -3
- package/dist/auth/routes.js +1 -1
- package/dist/auth/routes.js.map +1 -1
- package/dist/auth/server.d.ts +14 -12
- package/dist/auth/server.js +14 -9
- package/dist/auth/server.js.map +1 -1
- package/dist/bridge-protocol/index.d.ts +50 -0
- package/dist/bridge-protocol/index.js +25 -0
- package/dist/bridge-protocol/index.js.map +1 -0
- package/dist/puck-editor/editor.d.ts +8 -0
- package/dist/puck-editor/editor.js +9 -0
- package/dist/puck-editor/editor.js.map +1 -0
- package/dist/puck-editor/fields.d.ts +6 -7
- package/dist/puck-editor/fields.js +3 -3
- package/dist/puck-editor/fields.js.map +1 -1
- package/dist/puck-editor/index.d.ts +17 -14
- package/dist/puck-editor/index.js +13 -11
- package/dist/puck-editor/index.js.map +1 -1
- package/dist/puck-editor/internal/api/client.d.ts +19 -4
- package/dist/puck-editor/internal/api/client.js +56 -19
- package/dist/puck-editor/internal/api/client.js.map +1 -1
- package/dist/puck-editor/internal/api/config.d.ts +36 -3
- package/dist/puck-editor/internal/api/config.js.map +1 -1
- package/dist/puck-editor/internal/api/create-puck-api.d.ts +1 -2
- package/dist/puck-editor/internal/api/create-puck-api.js +10 -13
- package/dist/puck-editor/internal/api/create-puck-api.js.map +1 -1
- package/dist/puck-editor/internal/api/handlers/create-page.d.ts +1 -2
- package/dist/puck-editor/internal/api/handlers/create-page.js +6 -4
- package/dist/puck-editor/internal/api/handlers/create-page.js.map +1 -1
- package/dist/puck-editor/internal/api/handlers/entities.d.ts +6 -5
- package/dist/puck-editor/internal/api/handlers/entities.js +60 -15
- package/dist/puck-editor/internal/api/handlers/entities.js.map +1 -1
- package/dist/puck-editor/internal/api/handlers/publish.d.ts +3 -6
- package/dist/puck-editor/internal/api/handlers/publish.js +57 -14
- package/dist/puck-editor/internal/api/handlers/publish.js.map +1 -1
- package/dist/puck-editor/internal/api/handlers/template.d.ts +5 -2
- package/dist/puck-editor/internal/api/handlers/template.js +28 -60
- package/dist/puck-editor/internal/api/handlers/template.js.map +1 -1
- package/dist/puck-editor/internal/api/handlers/upload.d.ts +10 -2
- package/dist/puck-editor/internal/api/handlers/upload.js +93 -28
- package/dist/puck-editor/internal/api/handlers/upload.js.map +1 -1
- package/dist/puck-editor/internal/api/localize-message.d.ts +15 -0
- package/dist/puck-editor/internal/api/localize-message.js +15 -0
- package/dist/puck-editor/internal/api/localize-message.js.map +1 -0
- package/dist/puck-editor/internal/api/media-params.d.ts +3 -3
- package/dist/puck-editor/internal/api/media-params.js +23 -19
- package/dist/puck-editor/internal/api/media-params.js.map +1 -1
- package/dist/puck-editor/internal/api/media-upload.d.ts +5 -3
- package/dist/puck-editor/internal/api/media-upload.js +33 -22
- package/dist/puck-editor/internal/api/media-upload.js.map +1 -1
- package/dist/puck-editor/internal/api/message-codes.d.ts +2 -0
- package/dist/puck-editor/internal/api/message-codes.js +2 -0
- package/dist/puck-editor/internal/api/message-codes.js.map +1 -0
- package/dist/puck-editor/internal/api/space.d.ts +0 -1
- package/dist/puck-editor/internal/api/type-segment.d.ts +2 -0
- package/dist/puck-editor/internal/api/type-segment.js +9 -0
- package/dist/puck-editor/internal/api/type-segment.js.map +1 -0
- package/dist/puck-editor/internal/content-model.d.ts +31 -3
- package/dist/puck-editor/internal/content-model.js +76 -6
- package/dist/puck-editor/internal/content-model.js.map +1 -1
- package/dist/puck-editor/internal/dictionaries.d.ts +225 -0
- package/dist/puck-editor/internal/dictionaries.js +673 -0
- package/dist/puck-editor/internal/dictionaries.js.map +1 -0
- package/dist/puck-editor/internal/editor/allowed-types.d.ts +1 -2
- package/dist/puck-editor/internal/editor/allowed-types.js +2 -2
- package/dist/puck-editor/internal/editor/allowed-types.js.map +1 -1
- package/dist/puck-editor/internal/editor/canvas-add-picker.d.ts +0 -1
- package/dist/puck-editor/internal/editor/canvas-add-picker.js +5 -5
- package/dist/puck-editor/internal/editor/canvas-add-picker.js.map +1 -1
- package/dist/puck-editor/internal/editor/canvas-empty-state.d.ts +0 -1
- package/dist/puck-editor/internal/editor/canvas-empty-state.js +4 -4
- package/dist/puck-editor/internal/editor/canvas-empty-state.js.map +1 -1
- package/dist/puck-editor/internal/editor/canvas-quick-add.d.ts +0 -1
- package/dist/puck-editor/internal/editor/canvas-quick-add.js +8 -8
- package/dist/puck-editor/internal/editor/canvas-quick-add.js.map +1 -1
- package/dist/puck-editor/internal/editor/canvas-scroll.d.ts +0 -1
- package/dist/puck-editor/internal/editor/component-icons.d.ts +1 -2
- package/dist/puck-editor/internal/editor/component-icons.js.map +1 -1
- package/dist/puck-editor/internal/editor/component-item.d.ts +0 -1
- package/dist/puck-editor/internal/editor/component-item.js +2 -2
- package/dist/puck-editor/internal/editor/component-item.js.map +1 -1
- package/dist/puck-editor/internal/editor/compose-save-issues.d.ts +15 -0
- package/dist/puck-editor/internal/editor/compose-save-issues.js +16 -0
- package/dist/puck-editor/internal/editor/compose-save-issues.js.map +1 -0
- package/dist/puck-editor/internal/editor/dirty-state.d.ts +3 -0
- package/dist/puck-editor/internal/editor/dirty-state.js +7 -0
- package/dist/puck-editor/internal/editor/dirty-state.js.map +1 -0
- package/dist/puck-editor/internal/editor/draft-restore-banner.d.ts +9 -0
- package/dist/puck-editor/internal/editor/draft-restore-banner.js +289 -0
- package/dist/puck-editor/internal/editor/draft-restore-banner.js.map +1 -0
- package/dist/puck-editor/internal/editor/draft-storage.d.ts +41 -0
- package/dist/puck-editor/internal/editor/draft-storage.js +129 -0
- package/dist/puck-editor/internal/editor/draft-storage.js.map +1 -0
- package/dist/puck-editor/internal/editor/editor-action-bar.d.ts +0 -1
- package/dist/puck-editor/internal/editor/editor-action-bar.js +4 -4
- package/dist/puck-editor/internal/editor/editor-action-bar.js.map +1 -1
- package/dist/puck-editor/internal/editor/editor-header-actions.d.ts +6 -4
- package/dist/puck-editor/internal/editor/editor-header-actions.js +119 -60
- package/dist/puck-editor/internal/editor/editor-header-actions.js.map +1 -1
- package/dist/puck-editor/internal/editor/find-missing-required-fields.d.ts +0 -1
- package/dist/puck-editor/internal/editor/grouped-drawer-panel.d.ts +1 -2
- package/dist/puck-editor/internal/editor/grouped-drawer-panel.js +6 -6
- package/dist/puck-editor/internal/editor/grouped-drawer-panel.js.map +1 -1
- package/dist/puck-editor/internal/editor/grouped-entry-list.d.ts +1 -2
- package/dist/puck-editor/internal/editor/grouped-entry-list.js +3 -3
- package/dist/puck-editor/internal/editor/grouped-entry-list.js.map +1 -1
- package/dist/puck-editor/internal/editor/header-save-button.d.ts +4 -4
- package/dist/puck-editor/internal/editor/header-save-button.js +66 -27
- package/dist/puck-editor/internal/editor/header-save-button.js.map +1 -1
- package/dist/puck-editor/internal/editor/leave-confirm-dialog.d.ts +5 -0
- package/dist/puck-editor/internal/editor/leave-confirm-dialog.js +140 -0
- package/dist/puck-editor/internal/editor/leave-confirm-dialog.js.map +1 -0
- package/dist/puck-editor/internal/editor/page-template-picker.d.ts +0 -1
- package/dist/puck-editor/internal/editor/page-template-picker.js +5 -5
- package/dist/puck-editor/internal/editor/page-template-picker.js.map +1 -1
- package/dist/puck-editor/internal/editor/picker-entry-item.d.ts +1 -2
- package/dist/puck-editor/internal/editor/picker-entry-item.js +4 -4
- package/dist/puck-editor/internal/editor/picker-entry-item.js.map +1 -1
- package/dist/puck-editor/internal/editor/picker-model.d.ts +14 -5
- package/dist/puck-editor/internal/editor/picker-model.js +157 -132
- package/dist/puck-editor/internal/editor/picker-model.js.map +1 -1
- package/dist/puck-editor/internal/editor/publish-puck-data.d.ts +18 -4
- package/dist/puck-editor/internal/editor/publish-puck-data.js +25 -4
- package/dist/puck-editor/internal/editor/publish-puck-data.js.map +1 -1
- package/dist/puck-editor/internal/editor/puck-editor.d.ts +6 -4
- package/dist/puck-editor/internal/editor/puck-editor.js +270 -209
- package/dist/puck-editor/internal/editor/puck-editor.js.map +1 -1
- package/dist/puck-editor/internal/editor/save-guard.d.ts +15 -0
- package/dist/puck-editor/internal/editor/save-guard.js +30 -0
- package/dist/puck-editor/internal/editor/save-guard.js.map +1 -0
- package/dist/puck-editor/internal/editor/save-page-context.d.ts +8 -0
- package/dist/puck-editor/internal/editor/save-page-context.js +34 -0
- package/dist/puck-editor/internal/editor/save-page-context.js.map +1 -0
- package/dist/puck-editor/internal/editor/section-template-modal.d.ts +0 -1
- package/dist/puck-editor/internal/editor/section-template-modal.js +2 -2
- package/dist/puck-editor/internal/editor/section-template-modal.js.map +1 -1
- package/dist/puck-editor/internal/editor/unsaved-changes-guard.d.ts +3 -0
- package/dist/puck-editor/internal/editor/unsaved-changes-guard.js +38 -0
- package/dist/puck-editor/internal/editor/unsaved-changes-guard.js.map +1 -0
- package/dist/puck-editor/internal/editor/use-dirty-baseline.d.ts +5 -0
- package/dist/puck-editor/internal/editor/use-dirty-baseline.js +72 -0
- package/dist/puck-editor/internal/editor/use-dirty-baseline.js.map +1 -0
- package/dist/puck-editor/internal/editor/use-draft-recovery.d.ts +16 -0
- package/dist/puck-editor/internal/editor/use-draft-recovery.js +194 -0
- package/dist/puck-editor/internal/editor/use-draft-recovery.js.map +1 -0
- package/dist/puck-editor/internal/editor/use-frame-zoom.d.ts +0 -1
- package/dist/puck-editor/internal/editor/use-is-dirty.d.ts +1 -0
- package/dist/puck-editor/internal/editor/use-is-dirty.js +32 -0
- package/dist/puck-editor/internal/editor/use-is-dirty.js.map +1 -0
- package/dist/puck-editor/internal/editor/use-scroll-lock-outside.d.ts +0 -1
- package/dist/puck-editor/internal/editor-config.d.ts +16 -3
- package/dist/puck-editor/internal/editor-config.js +8 -1
- package/dist/puck-editor/internal/editor-config.js.map +1 -1
- package/dist/puck-editor/internal/editor-query-client.d.ts +0 -1
- package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.d.ts +0 -1
- package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.js +2 -2
- package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.js.map +1 -1
- package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.d.ts +0 -1
- package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.js +1 -1
- package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.js.map +1 -1
- package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.d.ts +0 -1
- package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.js +1 -1
- package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.js.map +1 -1
- package/dist/puck-editor/internal/fields/date-picker/date-picker.d.ts +0 -1
- package/dist/puck-editor/internal/fields/date-picker/date-picker.js +90 -73
- package/dist/puck-editor/internal/fields/date-picker/date-picker.js.map +1 -1
- package/dist/puck-editor/internal/fields/index.d.ts +10 -10
- package/dist/puck-editor/internal/fields/index.js +10 -9
- package/dist/puck-editor/internal/fields/index.js.map +1 -1
- package/dist/puck-editor/internal/fields/link-picker/anchor.d.ts +0 -1
- package/dist/puck-editor/internal/fields/link-picker/anchor.js +1 -1
- package/dist/puck-editor/internal/fields/link-picker/anchor.js.map +1 -1
- package/dist/puck-editor/internal/fields/link-picker/create-link-field.d.ts +1 -2
- package/dist/puck-editor/internal/fields/link-picker/create-link-field.js +1 -1
- package/dist/puck-editor/internal/fields/link-picker/create-link-field.js.map +1 -1
- package/dist/puck-editor/internal/fields/link-picker/humanize.d.ts +0 -1
- package/dist/puck-editor/internal/fields/link-picker/link-picker-control.d.ts +0 -1
- package/dist/puck-editor/internal/fields/link-picker/link-picker-control.js +208 -140
- package/dist/puck-editor/internal/fields/link-picker/link-picker-control.js.map +1 -1
- package/dist/puck-editor/internal/fields/link-picker/link-picker-field.d.ts +1 -2
- package/dist/puck-editor/internal/fields/link-picker/link-picker-field.js +6 -6
- package/dist/puck-editor/internal/fields/link-picker/link-picker-field.js.map +1 -1
- package/dist/puck-editor/internal/fields/link-picker/link-value.d.ts +25 -5
- package/dist/puck-editor/internal/fields/link-picker/link-value.js +56 -6
- package/dist/puck-editor/internal/fields/link-picker/link-value.js.map +1 -1
- package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.d.ts +0 -1
- package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.js +4 -4
- package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.js.map +1 -1
- package/dist/puck-editor/internal/fields/link-picker/richtext-extensions.d.ts +0 -1
- package/dist/puck-editor/internal/fields/link-picker/segmented-control.d.ts +0 -1
- package/dist/puck-editor/internal/fields/link-picker/segmented-control.js +3 -3
- package/dist/puck-editor/internal/fields/link-picker/segmented-control.js.map +1 -1
- package/dist/puck-editor/internal/fields/link-picker/types.d.ts +0 -1
- package/dist/puck-editor/internal/fields/media-array/create-media-array-field.d.ts +2 -3
- package/dist/puck-editor/internal/fields/media-array/create-media-array-field.js +1 -1
- package/dist/puck-editor/internal/fields/media-array/create-media-array-field.js.map +1 -1
- package/dist/puck-editor/internal/fields/media-array/media-array-field.d.ts +2 -3
- package/dist/puck-editor/internal/fields/media-array/media-array-field.js +100 -88
- package/dist/puck-editor/internal/fields/media-array/media-array-field.js.map +1 -1
- package/dist/puck-editor/internal/fields/media-array/reorder.d.ts +0 -1
- package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.d.ts +2 -3
- package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.js +1 -1
- package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.js.map +1 -1
- package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.d.ts +1 -2
- package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.js +4 -4
- package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.js.map +1 -1
- package/dist/puck-editor/internal/fields/media-selector/crop-types.d.ts +0 -1
- package/dist/puck-editor/internal/fields/media-selector/extract-fields.d.ts +0 -1
- package/dist/puck-editor/internal/fields/media-selector/image-upload-form.d.ts +0 -1
- package/dist/puck-editor/internal/fields/media-selector/image-upload-form.js +19 -10
- package/dist/puck-editor/internal/fields/media-selector/image-upload-form.js.map +1 -1
- package/dist/puck-editor/internal/fields/media-selector/media-selector-field.d.ts +7 -3
- package/dist/puck-editor/internal/fields/media-selector/media-selector-field.js +29 -22
- package/dist/puck-editor/internal/fields/media-selector/media-selector-field.js.map +1 -1
- package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.d.ts +1 -2
- package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.js +281 -255
- package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.js.map +1 -1
- package/dist/puck-editor/internal/fields/media-selector/use-debounced-value.d.ts +0 -1
- package/dist/puck-editor/internal/fields/media-selector/use-media-library.d.ts +15 -2
- package/dist/puck-editor/internal/fields/media-selector/use-media-library.js +23 -18
- package/dist/puck-editor/internal/fields/media-selector/use-media-library.js.map +1 -1
- package/dist/puck-editor/internal/fields/media-selector/video-upload-form.d.ts +0 -1
- package/dist/puck-editor/internal/fields/media-selector/video-upload-form.js +12 -6
- package/dist/puck-editor/internal/fields/media-selector/video-upload-form.js.map +1 -1
- package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.d.ts +0 -1
- package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.js +2 -2
- package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.js.map +1 -1
- package/dist/puck-editor/internal/fields/required-field-label.d.ts +0 -1
- package/dist/puck-editor/internal/fields/required-field-label.js +1 -1
- package/dist/puck-editor/internal/fields/required-field-label.js.map +1 -1
- package/dist/puck-editor/internal/fields/required.d.ts +0 -1
- package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.d.ts +13 -3
- package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.js +32 -22
- package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.js.map +1 -1
- package/dist/puck-editor/internal/i18n.d.ts +2 -181
- package/dist/puck-editor/internal/i18n.js +2 -358
- package/dist/puck-editor/internal/i18n.js.map +1 -1
- package/dist/puck-editor/internal/locale.d.ts +0 -1
- package/dist/puck-editor/internal/localize.d.ts +1 -2
- package/dist/puck-editor/internal/localize.js.map +1 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.d.ts +3 -3
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.js +41 -32
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.js.map +1 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.d.ts +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.js +2 -2
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.js.map +1 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.d.ts +3 -3
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.js.map +1 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.d.ts +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.js +1 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.js.map +1 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/catalog.d.ts +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/constants.d.ts +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/create-page.d.ts +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/find-component-location.d.ts +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/help.d.ts +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/index.d.ts +1 -2
- package/dist/puck-editor/internal/plugins/agent-plugin/index.js +1 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/index.js.map +1 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/list-media.d.ts +2 -2
- package/dist/puck-editor/internal/plugins/agent-plugin/list-media.js +4 -3
- package/dist/puck-editor/internal/plugins/agent-plugin/list-media.js.map +1 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/templates.d.ts +5 -6
- package/dist/puck-editor/internal/plugins/agent-plugin/templates.js +2 -2
- package/dist/puck-editor/internal/plugins/agent-plugin/templates.js.map +1 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/upload-media.d.ts +1 -2
- package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.d.ts +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.js +2 -2
- package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.js.map +1 -1
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.d.ts +0 -1
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.js +3 -3
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.js.map +1 -1
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.d.ts +0 -1
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.js +1 -1
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.js.map +1 -1
- package/dist/puck-editor/internal/plugins/blocks-plugin/index.d.ts +1 -2
- package/dist/puck-editor/internal/plugins/blocks-plugin/index.js +1 -1
- package/dist/puck-editor/internal/plugins/blocks-plugin/index.js.map +1 -1
- package/dist/puck-editor/internal/plugins/outline-plugin/index.d.ts +1 -2
- package/dist/puck-editor/internal/plugins/outline-plugin/index.js +1 -1
- package/dist/puck-editor/internal/plugins/outline-plugin/index.js.map +1 -1
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.d.ts +0 -1
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.js +8 -8
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.js.map +1 -1
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.d.ts +0 -1
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.js +1 -1
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.js.map +1 -1
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-tree.d.ts +0 -1
- package/dist/puck-editor/internal/plugins/sections-plugin/index.d.ts +1 -2
- package/dist/puck-editor/internal/plugins/sections-plugin/index.js +1 -1
- package/dist/puck-editor/internal/plugins/sections-plugin/index.js.map +1 -1
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.d.ts +0 -1
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.js +5 -5
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.js.map +1 -1
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.d.ts +0 -1
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.js +1 -1
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.js.map +1 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.d.ts +0 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.js +2 -2
- package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.js.map +1 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.d.ts +0 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.js +1 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.js.map +1 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.d.ts +1 -2
- package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.js +3 -3
- package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.js.map +1 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.d.ts +1 -2
- package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.js +224 -219
- package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.js.map +1 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/index.d.ts +5 -6
- package/dist/puck-editor/internal/plugins/templates-plugin/index.js +5 -5
- package/dist/puck-editor/internal/plugins/templates-plugin/index.js.map +1 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.d.ts +0 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.js +3 -3
- package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.js.map +1 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/template-form.d.ts +1 -2
- package/dist/puck-editor/internal/plugins/templates-plugin/template-form.js +17 -16
- package/dist/puck-editor/internal/plugins/templates-plugin/template-form.js.map +1 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.d.ts +1 -2
- package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.js +1 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.js.map +1 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.d.ts +0 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.js +171 -161
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.js.map +1 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.d.ts +0 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.js +1 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.js.map +1 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/templates.d.ts +2 -3
- package/dist/puck-editor/internal/plugins/templates-plugin/templates.js +9 -2
- package/dist/puck-editor/internal/plugins/templates-plugin/templates.js.map +1 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.d.ts +0 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.js +22 -20
- package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.js.map +1 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.d.ts +14 -5
- package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.js +23 -15
- package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.js.map +1 -1
- package/dist/puck-editor/internal/puck-augmentation.d.ts +0 -1
- package/dist/puck-editor/internal/puck-editor-provider.d.ts +0 -1
- package/dist/puck-editor/internal/puck-node.d.ts +0 -1
- package/dist/puck-editor/internal/puck-props.d.ts +13 -0
- package/dist/puck-editor/internal/puck-props.js +2 -0
- package/dist/puck-editor/internal/puck-props.js.map +1 -0
- package/dist/puck-editor/internal/puck-wrapper.d.ts +25 -6
- package/dist/puck-editor/internal/puck-wrapper.js +124 -115
- package/dist/puck-editor/internal/puck-wrapper.js.map +1 -1
- package/dist/puck-editor/internal/render/cropped-image.d.ts +1 -2
- package/dist/puck-editor/internal/render/cropped-image.js.map +1 -1
- package/dist/puck-editor/internal/smart-actions/action-selection.d.ts +8 -0
- package/dist/puck-editor/internal/smart-actions/action-selection.js +10 -0
- package/dist/puck-editor/internal/smart-actions/action-selection.js.map +1 -0
- package/dist/puck-editor/internal/smart-actions/index.d.ts +10 -4
- package/dist/puck-editor/internal/smart-actions/index.js +27 -12
- package/dist/puck-editor/internal/smart-actions/index.js.map +1 -1
- package/dist/puck-editor/internal/smart-actions/new-page.d.ts +3 -2
- package/dist/puck-editor/internal/smart-actions/new-page.js +6 -6
- package/dist/puck-editor/internal/smart-actions/new-page.js.map +1 -1
- package/dist/puck-editor/internal/smart-actions/open-puck-editor.d.ts +3 -2
- package/dist/puck-editor/internal/smart-actions/open-puck-editor.js +49 -37
- package/dist/puck-editor/internal/smart-actions/open-puck-editor.js.map +1 -1
- package/dist/puck-editor/internal/ui/calendar.d.ts +0 -1
- package/dist/puck-editor/internal/ui/calendar.js +1 -1
- package/dist/puck-editor/internal/ui/calendar.js.map +1 -1
- package/dist/puck-editor/internal/ui/component-list-accordion.d.ts +0 -1
- package/dist/puck-editor/internal/ui/dialog.d.ts +0 -1
- package/dist/puck-editor/internal/ui/dialog.js +33 -20
- package/dist/puck-editor/internal/ui/dialog.js.map +1 -1
- package/dist/puck-editor/internal/ui/drawer-item-content.d.ts +0 -1
- package/dist/puck-editor/internal/ui/icon-button.d.ts +0 -1
- package/dist/puck-editor/internal/ui/icon-button.js +1 -1
- package/dist/puck-editor/internal/ui/icon-button.js.map +1 -1
- package/dist/puck-editor/internal/ui/load-error-notice.d.ts +6 -0
- package/dist/puck-editor/internal/ui/load-error-notice.js +81 -0
- package/dist/puck-editor/internal/ui/load-error-notice.js.map +1 -0
- package/dist/puck-editor/internal/ui/popover.d.ts +0 -1
- package/dist/puck-editor/internal/ui/popover.js +1 -1
- package/dist/puck-editor/internal/ui/popover.js.map +1 -1
- package/dist/puck-editor/internal/ui/required-mark.d.ts +0 -1
- package/dist/puck-editor/internal/ui/search-control.d.ts +0 -1
- package/dist/puck-editor/internal/ui/search-control.js +3 -3
- package/dist/puck-editor/internal/ui/search-control.js.map +1 -1
- package/dist/puck-editor/internal/ui/use-panel-search-focus.d.ts +0 -1
- package/dist/puck-editor/internal/use-puck-overlay.d.ts +1 -2
- package/dist/puck-editor/internal/use-puck-overlay.js +6 -5
- package/dist/puck-editor/internal/use-puck-overlay.js.map +1 -1
- package/dist/puck-editor/internal/utils.d.ts +0 -1
- package/dist/puck-editor/render.d.ts +2 -3
- package/dist/puck-editor/render.js +1 -1
- package/dist/puck-editor/render.js.map +1 -1
- package/dist/puck-editor/server.d.ts +3 -4
- package/dist/puck-editor/server.js +1 -1
- package/dist/puck-editor/server.js.map +1 -1
- package/dist/puck-editor/smart-actions.d.ts +1 -2
- package/dist/puck-editor/smart-actions.js +1 -1
- package/dist/puck-editor/smart-actions.js.map +1 -1
- package/dist/shared/cn.d.ts +0 -1
- package/dist/shared/i18n.d.ts +0 -1
- package/dist/shared/revalidate-path.d.ts +1 -0
- package/dist/shared/revalidate-path.js +2 -0
- package/dist/shared/revalidate-path.js.map +1 -0
- package/dist/shared/toolbar-action.d.ts +0 -1
- package/dist/shared/use-is-hydrated.d.ts +0 -1
- package/dist/shared/use-is-in-iframe.d.ts +0 -1
- package/dist/shared/use-is-in-iframe.js +1 -1
- package/dist/shared/use-is-in-iframe.js.map +1 -1
- package/dist/smart-actions/internal/assemble-smart-actions.d.ts +14 -0
- package/dist/smart-actions/internal/assemble-smart-actions.js +11 -0
- package/dist/smart-actions/internal/assemble-smart-actions.js.map +1 -0
- package/dist/smart-actions/internal/backend-edit-link.d.ts +6 -0
- package/dist/smart-actions/internal/backend-edit-link.js +60 -0
- package/dist/smart-actions/internal/backend-edit-link.js.map +1 -0
- package/dist/smart-actions/internal/get-smart-actions-context.d.ts +1 -2
- package/dist/smart-actions/internal/get-smart-actions-context.js +2 -2
- package/dist/smart-actions/internal/get-smart-actions-context.js.map +1 -1
- package/dist/smart-actions/internal/i18n.d.ts +1 -2
- package/dist/smart-actions/internal/i18n.js +16 -2
- package/dist/smart-actions/internal/i18n.js.map +1 -1
- package/dist/smart-actions/internal/logout-form.d.ts +2 -2
- package/dist/smart-actions/internal/logout-form.js +47 -40
- package/dist/smart-actions/internal/logout-form.js.map +1 -1
- package/dist/smart-actions/internal/refresh-page.d.ts +3 -2
- package/dist/smart-actions/internal/refresh-page.js +60 -53
- package/dist/smart-actions/internal/refresh-page.js.map +1 -1
- package/dist/smart-actions/internal/smart-actions-button.d.ts +22 -4
- package/dist/smart-actions/internal/smart-actions-button.js +36 -13
- package/dist/smart-actions/internal/smart-actions-button.js.map +1 -1
- package/dist/smart-actions/internal/smart-actions-config.d.ts +12 -4
- package/dist/smart-actions/internal/smart-actions-config.js +36 -80
- package/dist/smart-actions/internal/smart-actions-config.js.map +1 -1
- package/dist/smart-actions/internal/smart-actions-toolbar-client.d.ts +5 -11
- package/dist/smart-actions/internal/smart-actions-toolbar-client.js +13 -53
- package/dist/smart-actions/internal/smart-actions-toolbar-client.js.map +1 -1
- package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.d.ts +1 -2
- package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.js +4 -4
- package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.js.map +1 -1
- package/dist/smart-actions/internal/toolbar/storage.d.ts +1 -2
- package/dist/smart-actions/internal/toolbar/storage.js.map +1 -1
- package/dist/smart-actions/internal/toolbar/types.d.ts +1 -2
- package/dist/smart-actions/internal/toolbar/types.js.map +1 -1
- package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.d.ts +1 -2
- package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.js +1 -1
- package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.js.map +1 -1
- package/dist/smart-actions/internal/ui/tooltip.d.ts +0 -1
- package/dist/smart-actions/internal/ui/tooltip.js +1 -1
- package/dist/smart-actions/internal/ui/tooltip.js.map +1 -1
- package/dist/smart-actions/internal/user-profile.d.ts +0 -1
- package/dist/smart-actions/internal/user-profile.js +71 -24
- package/dist/smart-actions/internal/user-profile.js.map +1 -1
- package/dist/smart-actions/server.d.ts +5 -4
- package/dist/smart-actions/server.js +2 -2
- package/dist/smart-actions/server.js.map +1 -1
- package/dist/theme.css +1 -1
- package/dist/visual-editor/index.d.ts +3 -4
- package/dist/visual-editor/index.js +3 -3
- package/dist/visual-editor/index.js.map +1 -1
- package/dist/visual-editor/internal/bridge/connector.d.ts +4 -3
- package/dist/visual-editor/internal/bridge/connector.js +22 -21
- package/dist/visual-editor/internal/bridge/connector.js.map +1 -1
- package/dist/visual-editor/internal/bridge/draft-mode-self-heal.d.ts +0 -1
- package/dist/visual-editor/internal/bridge/editor-auth-gate-server.d.ts +5 -3
- package/dist/visual-editor/internal/bridge/editor-auth-gate-server.js +7 -8
- package/dist/visual-editor/internal/bridge/editor-auth-gate-server.js.map +1 -1
- package/dist/visual-editor/internal/bridge/editor-auth-gate.d.ts +3 -3
- package/dist/visual-editor/internal/bridge/editor-auth-gate.js +4 -2
- package/dist/visual-editor/internal/bridge/editor-auth-gate.js.map +1 -1
- package/dist/visual-editor/internal/i18n.d.ts +3 -2
- package/dist/visual-editor/internal/i18n.js +32 -4
- package/dist/visual-editor/internal/i18n.js.map +1 -1
- package/dist/visual-editor/internal/overlays/drupal-origin.d.ts +1 -7
- package/dist/visual-editor/internal/overlays/drupal-origin.js +16 -3
- package/dist/visual-editor/internal/overlays/drupal-origin.js.map +1 -1
- package/dist/visual-editor/internal/overlays/edit-button.d.ts +5 -4
- package/dist/visual-editor/internal/overlays/edit-button.js +46 -44
- package/dist/visual-editor/internal/overlays/edit-button.js.map +1 -1
- package/dist/visual-editor/internal/overlays/edit-icon.d.ts +0 -1
- package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.d.ts +11 -2
- package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.js +18 -7
- package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.js.map +1 -1
- package/dist/visual-editor/internal/overlays/iframe-wrapper.d.ts +0 -1
- package/dist/visual-editor/internal/overlays/iframe-wrapper.js +1 -1
- package/dist/visual-editor/internal/overlays/iframe-wrapper.js.map +1 -1
- package/dist/visual-editor/internal/overlays/menu/menu-wrapper.d.ts +12 -3
- package/dist/visual-editor/internal/overlays/menu/menu-wrapper.js +14 -5
- package/dist/visual-editor/internal/overlays/menu/menu-wrapper.js.map +1 -1
- package/dist/visual-editor/internal/overlays/node/node-metadata.d.ts +4 -2
- package/dist/visual-editor/internal/overlays/node/node-metadata.js +10 -4
- package/dist/visual-editor/internal/overlays/node/node-metadata.js.map +1 -1
- package/dist/visual-editor/internal/overlays/node/node-wrapper.d.ts +5 -3
- package/dist/visual-editor/internal/overlays/node/node-wrapper.js +4 -2
- package/dist/visual-editor/internal/overlays/node/node-wrapper.js.map +1 -1
- package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.d.ts +11 -2
- package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.js +18 -7
- package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.js.map +1 -1
- package/dist/visual-editor/internal/revalidate-route.d.ts +0 -1
- package/dist/visual-editor/internal/revalidate-route.js +1 -1
- package/dist/visual-editor/internal/revalidate-route.js.map +1 -1
- package/dist/visual-editor/server.d.ts +6 -7
- package/dist/visual-editor/server.js +6 -6
- package/dist/visual-editor/server.js.map +1 -1
- package/package.json +19 -3
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/internal/config.d.ts.map +0 -1
- package/dist/auth/internal/draft-mode.d.ts.map +0 -1
- package/dist/auth/internal/editor-locale.d.ts.map +0 -1
- package/dist/auth/internal/handoff.d.ts.map +0 -1
- package/dist/auth/internal/has-session.d.ts.map +0 -1
- package/dist/auth/internal/logout.d.ts.map +0 -1
- package/dist/auth/internal/next-cookie-storage.d.ts.map +0 -1
- package/dist/auth/internal/nodehive-client.d.ts.map +0 -1
- package/dist/auth/internal/oauth-config.d.ts.map +0 -1
- package/dist/auth/internal/proxy-helpers.d.ts.map +0 -1
- package/dist/auth/internal/refresh.d.ts.map +0 -1
- package/dist/auth/internal/require-auth.d.ts.map +0 -1
- package/dist/auth/internal/return-to.d.ts.map +0 -1
- package/dist/auth/internal/routes/callback.d.ts.map +0 -1
- package/dist/auth/internal/routes/chips-exchange.d.ts.map +0 -1
- package/dist/auth/internal/routes/draft.d.ts.map +0 -1
- package/dist/auth/internal/routes/index.d.ts.map +0 -1
- package/dist/auth/internal/routes/login.d.ts.map +0 -1
- package/dist/auth/internal/routes/popup-done.d.ts.map +0 -1
- package/dist/auth/internal/routes/refresh.d.ts.map +0 -1
- package/dist/auth/internal/same-origin.d.ts.map +0 -1
- package/dist/auth/internal/session-gates.d.ts.map +0 -1
- package/dist/auth/internal/update-session.d.ts.map +0 -1
- package/dist/auth/internal/use-editor-login.d.ts.map +0 -1
- package/dist/auth/proxy.d.ts.map +0 -1
- package/dist/auth/react.d.ts.map +0 -1
- package/dist/auth/routes.d.ts.map +0 -1
- package/dist/auth/server.d.ts.map +0 -1
- package/dist/puck-editor/fields.d.ts.map +0 -1
- package/dist/puck-editor/index.d.ts.map +0 -1
- package/dist/puck-editor/internal/api/client.d.ts.map +0 -1
- package/dist/puck-editor/internal/api/config.d.ts.map +0 -1
- package/dist/puck-editor/internal/api/create-puck-api.d.ts.map +0 -1
- package/dist/puck-editor/internal/api/handlers/create-page.d.ts.map +0 -1
- package/dist/puck-editor/internal/api/handlers/entities.d.ts.map +0 -1
- package/dist/puck-editor/internal/api/handlers/publish.d.ts.map +0 -1
- package/dist/puck-editor/internal/api/handlers/template.d.ts.map +0 -1
- package/dist/puck-editor/internal/api/handlers/upload.d.ts.map +0 -1
- package/dist/puck-editor/internal/api/media-params.d.ts.map +0 -1
- package/dist/puck-editor/internal/api/media-upload.d.ts.map +0 -1
- package/dist/puck-editor/internal/api/space.d.ts.map +0 -1
- package/dist/puck-editor/internal/content-model.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor/allowed-types.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor/canvas-add-picker.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor/canvas-empty-state.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor/canvas-quick-add.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor/canvas-scroll.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor/component-icons.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor/component-item.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor/editor-action-bar.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor/editor-header-actions.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor/find-missing-required-fields.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor/grouped-drawer-panel.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor/grouped-entry-list.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor/header-save-button.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor/page-template-picker.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor/picker-entry-item.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor/picker-model.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor/publish-puck-data.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor/puck-editor.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor/section-template-modal.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor/use-frame-zoom.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor/use-scroll-lock-outside.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor-config.d.ts.map +0 -1
- package/dist/puck-editor/internal/editor-query-client.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/date-picker/date-picker.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/index.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/link-picker/anchor.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/link-picker/create-link-field.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/link-picker/humanize.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/link-picker/link-picker-control.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/link-picker/link-picker-field.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/link-picker/link-value.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/link-picker/richtext-extensions.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/link-picker/segmented-control.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/link-picker/types.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/media-array/create-media-array-field.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/media-array/media-array-field.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/media-array/reorder.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/media-selector/crop-types.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/media-selector/extract-fields.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/media-selector/image-upload-form.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/media-selector/media-selector-field.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/media-selector/use-debounced-value.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/media-selector/use-media-library.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/media-selector/video-upload-form.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/required-field-label.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/required.d.ts.map +0 -1
- package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.d.ts.map +0 -1
- package/dist/puck-editor/internal/i18n.d.ts.map +0 -1
- package/dist/puck-editor/internal/locale.d.ts.map +0 -1
- package/dist/puck-editor/internal/localize.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/catalog.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/constants.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/create-page.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/find-component-location.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/help.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/index.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/list-media.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/templates.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/upload-media.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/blocks-plugin/index.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/outline-plugin/index.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-tree.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/sections-plugin/index.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/index.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/template-form.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/templates.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.d.ts.map +0 -1
- package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.d.ts.map +0 -1
- package/dist/puck-editor/internal/puck-augmentation.d.ts.map +0 -1
- package/dist/puck-editor/internal/puck-editor-provider.d.ts.map +0 -1
- package/dist/puck-editor/internal/puck-node.d.ts.map +0 -1
- package/dist/puck-editor/internal/puck-wrapper.d.ts.map +0 -1
- package/dist/puck-editor/internal/render/cropped-image.d.ts.map +0 -1
- package/dist/puck-editor/internal/smart-actions/index.d.ts.map +0 -1
- package/dist/puck-editor/internal/smart-actions/new-page.d.ts.map +0 -1
- package/dist/puck-editor/internal/smart-actions/open-puck-editor.d.ts.map +0 -1
- package/dist/puck-editor/internal/ui/calendar.d.ts.map +0 -1
- package/dist/puck-editor/internal/ui/component-list-accordion.d.ts.map +0 -1
- package/dist/puck-editor/internal/ui/dialog.d.ts.map +0 -1
- package/dist/puck-editor/internal/ui/drawer-item-content.d.ts.map +0 -1
- package/dist/puck-editor/internal/ui/icon-button.d.ts.map +0 -1
- package/dist/puck-editor/internal/ui/popover.d.ts.map +0 -1
- package/dist/puck-editor/internal/ui/required-mark.d.ts.map +0 -1
- package/dist/puck-editor/internal/ui/search-control.d.ts.map +0 -1
- package/dist/puck-editor/internal/ui/use-panel-search-focus.d.ts.map +0 -1
- package/dist/puck-editor/internal/use-puck-overlay.d.ts.map +0 -1
- package/dist/puck-editor/internal/utils.d.ts.map +0 -1
- package/dist/puck-editor/render.d.ts.map +0 -1
- package/dist/puck-editor/server.d.ts.map +0 -1
- package/dist/puck-editor/smart-actions.d.ts.map +0 -1
- package/dist/shared/cn.d.ts.map +0 -1
- package/dist/shared/i18n.d.ts.map +0 -1
- package/dist/shared/toolbar-action.d.ts.map +0 -1
- package/dist/shared/use-is-hydrated.d.ts.map +0 -1
- package/dist/shared/use-is-in-iframe.d.ts.map +0 -1
- package/dist/smart-actions/internal/get-smart-actions-context.d.ts.map +0 -1
- package/dist/smart-actions/internal/i18n.d.ts.map +0 -1
- package/dist/smart-actions/internal/logout-form.d.ts.map +0 -1
- package/dist/smart-actions/internal/refresh-page.d.ts.map +0 -1
- package/dist/smart-actions/internal/smart-actions-button.d.ts.map +0 -1
- package/dist/smart-actions/internal/smart-actions-config.d.ts.map +0 -1
- package/dist/smart-actions/internal/smart-actions-toolbar-client.d.ts.map +0 -1
- package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.d.ts.map +0 -1
- package/dist/smart-actions/internal/toolbar/storage.d.ts.map +0 -1
- package/dist/smart-actions/internal/toolbar/types.d.ts.map +0 -1
- package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.d.ts.map +0 -1
- package/dist/smart-actions/internal/ui/tooltip.d.ts.map +0 -1
- package/dist/smart-actions/internal/user-profile.d.ts.map +0 -1
- package/dist/smart-actions/server.d.ts.map +0 -1
- package/dist/visual-editor/index.d.ts.map +0 -1
- package/dist/visual-editor/internal/bridge/connector.d.ts.map +0 -1
- package/dist/visual-editor/internal/bridge/draft-mode-self-heal.d.ts.map +0 -1
- package/dist/visual-editor/internal/bridge/editor-auth-gate-server.d.ts.map +0 -1
- package/dist/visual-editor/internal/bridge/editor-auth-gate.d.ts.map +0 -1
- package/dist/visual-editor/internal/i18n.d.ts.map +0 -1
- package/dist/visual-editor/internal/overlays/drupal-origin.d.ts.map +0 -1
- package/dist/visual-editor/internal/overlays/edit-button.d.ts.map +0 -1
- package/dist/visual-editor/internal/overlays/edit-icon.d.ts.map +0 -1
- package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.d.ts.map +0 -1
- package/dist/visual-editor/internal/overlays/iframe-wrapper.d.ts.map +0 -1
- package/dist/visual-editor/internal/overlays/menu/menu-wrapper.d.ts.map +0 -1
- package/dist/visual-editor/internal/overlays/node/node-metadata.d.ts.map +0 -1
- package/dist/visual-editor/internal/overlays/node/node-wrapper.d.ts.map +0 -1
- package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.d.ts.map +0 -1
- package/dist/visual-editor/internal/revalidate-route.d.ts.map +0 -1
- package/dist/visual-editor/server.d.ts.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import { type PuckDictionaryOverrides } from './i18n';
|
|
3
|
-
import '../puck-theme.css';
|
|
2
|
+
import { type PuckDictionaryOverrides } from './i18n.js';
|
|
4
3
|
import { Config, Overrides, Plugin } from '@puckeditor/core';
|
|
5
|
-
import { type PuckEditorConfig } from './editor-config';
|
|
6
|
-
import { PuckNode } from './puck-node';
|
|
4
|
+
import { type PuckEditorConfig } from './editor-config.js';
|
|
5
|
+
import { PuckNode } from './puck-node.js';
|
|
6
|
+
import type { PuckOnAction, PuckPassthroughProps, PuckValidate } from './puck-props.js';
|
|
7
7
|
type PuckWrapperProps = {
|
|
8
8
|
node: PuckNode;
|
|
9
9
|
config: Config;
|
|
@@ -12,8 +12,27 @@ type PuckWrapperProps = {
|
|
|
12
12
|
dictionaryOverrides?: PuckDictionaryOverrides;
|
|
13
13
|
plugins?: (defaultPlugins: Plugin[]) => Plugin[];
|
|
14
14
|
overrides?: Partial<Overrides>;
|
|
15
|
+
/** Called after the module's internal action handling. */
|
|
16
|
+
onAction?: PuckOnAction;
|
|
17
|
+
/**
|
|
18
|
+
* Custom validation run on save, composed after the built-in required-field
|
|
19
|
+
* check. Returning one or more issues blocks the publish and surfaces them in
|
|
20
|
+
* the editor toast.
|
|
21
|
+
*/
|
|
22
|
+
validate?: PuckValidate;
|
|
23
|
+
/**
|
|
24
|
+
* Remaining <Puck> props, spread before the module-managed ones (managed
|
|
25
|
+
* props always win). Managed and therefore excluded: config, data, plugins,
|
|
26
|
+
* overrides, onAction, onPublish, renderHeader, renderHeaderActions.
|
|
27
|
+
*/
|
|
28
|
+
puckProps?: PuckPassthroughProps;
|
|
15
29
|
children: ReactNode;
|
|
16
30
|
} & PuckEditorConfig;
|
|
17
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Editor overlay shell for a Puck page.
|
|
33
|
+
*
|
|
34
|
+
* Requires the `sonner` (save/upload/template toasts) and `motion` (overlay
|
|
35
|
+
* animation) peers, alongside `@puckeditor/core`; see the module README.
|
|
36
|
+
*/
|
|
37
|
+
export default function PuckWrapper({ node, config, isLoggedIn, editorLocale, dictionaryOverrides, plugins, overrides, onAction, validate, puckProps, drupalBaseUrl, contentModel, builtinTemplates, propTransforms, api, children, }: PuckWrapperProps): import("react").JSX.Element;
|
|
18
38
|
export {};
|
|
19
|
-
//# sourceMappingURL=puck-wrapper.d.ts.map
|
|
@@ -1,46 +1,28 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
function __transformExtension(filepath, extMapping) {
|
|
4
|
-
if (!filepath.startsWith('./') && !filepath.startsWith('../')) {
|
|
5
|
-
// Package import
|
|
6
|
-
return filepath;
|
|
7
|
-
}
|
|
8
|
-
const idx = filepath.lastIndexOf('.');
|
|
9
|
-
if (idx === -1 || filepath.includes('/', idx)) {
|
|
10
|
-
// No extension
|
|
11
|
-
const newExt = extMapping[''];
|
|
12
|
-
if (newExt) {
|
|
13
|
-
return filepath + newExt;
|
|
14
|
-
}
|
|
15
|
-
return filepath;
|
|
16
|
-
}
|
|
17
|
-
for (let [origExt, newExt] of Object.entries(extMapping).sort((a, b) => b[0].length - a[0].length)) {
|
|
18
|
-
if (filepath.endsWith(origExt)) {
|
|
19
|
-
return filepath.slice(0, -origExt.length) + newExt;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return filepath;
|
|
23
|
-
}
|
|
24
3
|
import { c as _c } from "react/compiler-runtime";
|
|
25
4
|
import dynamic from 'next/dynamic';
|
|
26
|
-
import { PuckI18nProvider } from
|
|
27
|
-
import { usePuckOverlay } from
|
|
5
|
+
import { PuckI18nProvider } from "./i18n.js";
|
|
6
|
+
import { usePuckOverlay } from "./use-puck-overlay.js";
|
|
28
7
|
import '../puck-theme.css';
|
|
29
8
|
import { QueryClientProvider } from '@tanstack/react-query';
|
|
30
9
|
import { motion } from 'motion/react';
|
|
31
|
-
import { cn } from
|
|
32
|
-
import { getBundle, parsePuckData, resolveContentModel } from
|
|
33
|
-
import { PuckEditorConfigProvider } from
|
|
34
|
-
import { getEditorQueryClient } from
|
|
35
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
36
|
-
const LazyPuckEditor = dynamic(() => import(
|
|
37
|
-
".ts": ".js",
|
|
38
|
-
".tsx": ".js"
|
|
39
|
-
})), {
|
|
10
|
+
import { cn } from "../../shared/cn.js";
|
|
11
|
+
import { getBundle, parsePuckData, resolveContentModel } from "./content-model.js";
|
|
12
|
+
import { PuckEditorConfigProvider } from "./editor-config.js";
|
|
13
|
+
import { getEditorQueryClient } from "./editor-query-client.js";
|
|
14
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
const LazyPuckEditor = dynamic(() => import("./editor/puck-editor.js"), {
|
|
40
16
|
ssr: false
|
|
41
17
|
});
|
|
18
|
+
/**
|
|
19
|
+
* Editor overlay shell for a Puck page.
|
|
20
|
+
*
|
|
21
|
+
* Requires the `sonner` (save/upload/template toasts) and `motion` (overlay
|
|
22
|
+
* animation) peers, alongside `@puckeditor/core`; see the module README.
|
|
23
|
+
*/
|
|
42
24
|
export default function PuckWrapper(t0) {
|
|
43
|
-
const $ = _c(
|
|
25
|
+
const $ = _c(59);
|
|
44
26
|
const {
|
|
45
27
|
node,
|
|
46
28
|
config,
|
|
@@ -49,9 +31,14 @@ export default function PuckWrapper(t0) {
|
|
|
49
31
|
dictionaryOverrides,
|
|
50
32
|
plugins,
|
|
51
33
|
overrides,
|
|
34
|
+
onAction,
|
|
35
|
+
validate,
|
|
36
|
+
puckProps,
|
|
52
37
|
drupalBaseUrl,
|
|
53
38
|
contentModel,
|
|
54
39
|
builtinTemplates,
|
|
40
|
+
propTransforms,
|
|
41
|
+
api,
|
|
55
42
|
children
|
|
56
43
|
} = t0;
|
|
57
44
|
const editorLocale = t1 === undefined ? "en" : t1;
|
|
@@ -68,28 +55,30 @@ export default function PuckWrapper(t0) {
|
|
|
68
55
|
const fieldName = bundle?.dataField ?? "";
|
|
69
56
|
const puckField = bundle ? node[fieldName] : "";
|
|
70
57
|
let t3;
|
|
71
|
-
if ($[3] !== node.id || $[
|
|
72
|
-
t3 = parsePuckData(puckField, node.id);
|
|
73
|
-
$[3] =
|
|
74
|
-
$[4] =
|
|
75
|
-
$[5] =
|
|
58
|
+
if ($[3] !== config || $[4] !== node.id || $[5] !== propTransforms || $[6] !== puckField) {
|
|
59
|
+
t3 = parsePuckData(puckField, node.id, propTransforms, config);
|
|
60
|
+
$[3] = config;
|
|
61
|
+
$[4] = node.id;
|
|
62
|
+
$[5] = propTransforms;
|
|
63
|
+
$[6] = puckField;
|
|
64
|
+
$[7] = t3;
|
|
76
65
|
} else {
|
|
77
|
-
t3 = $[
|
|
66
|
+
t3 = $[7];
|
|
78
67
|
}
|
|
79
68
|
const puckData = t3;
|
|
80
69
|
let t4;
|
|
81
|
-
if ($[
|
|
70
|
+
if ($[8] !== fieldName || $[9] !== isLoggedIn || $[10] !== node) {
|
|
82
71
|
t4 = {
|
|
83
72
|
node,
|
|
84
73
|
fieldName,
|
|
85
74
|
isLoggedIn
|
|
86
75
|
};
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
89
|
-
$[
|
|
90
|
-
$[
|
|
76
|
+
$[8] = fieldName;
|
|
77
|
+
$[9] = isLoggedIn;
|
|
78
|
+
$[10] = node;
|
|
79
|
+
$[11] = t4;
|
|
91
80
|
} else {
|
|
92
|
-
t4 = $[
|
|
81
|
+
t4 = $[11];
|
|
93
82
|
}
|
|
94
83
|
const {
|
|
95
84
|
isEditMode,
|
|
@@ -99,93 +88,107 @@ export default function PuckWrapper(t0) {
|
|
|
99
88
|
isHighlighted
|
|
100
89
|
} = usePuckOverlay(t4);
|
|
101
90
|
if (!bundle) {
|
|
102
|
-
console.error(`puck-editor: no bundle configured for node type "${node.type}"`);
|
|
103
|
-
|
|
91
|
+
console.error(`puck-editor: no bundle configured for node type "${node.type}"; rendering page without editor`);
|
|
92
|
+
let t5;
|
|
93
|
+
if ($[12] !== children) {
|
|
94
|
+
t5 = /*#__PURE__*/_jsx(_Fragment, {
|
|
95
|
+
children: children
|
|
96
|
+
});
|
|
97
|
+
$[12] = children;
|
|
98
|
+
$[13] = t5;
|
|
99
|
+
} else {
|
|
100
|
+
t5 = $[13];
|
|
101
|
+
}
|
|
102
|
+
return t5;
|
|
104
103
|
}
|
|
105
104
|
let t5;
|
|
106
|
-
if ($[
|
|
105
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
107
106
|
t5 = getEditorQueryClient();
|
|
108
|
-
$[
|
|
107
|
+
$[14] = t5;
|
|
109
108
|
} else {
|
|
110
|
-
t5 = $[
|
|
109
|
+
t5 = $[14];
|
|
111
110
|
}
|
|
112
111
|
let t6;
|
|
113
|
-
if ($[
|
|
112
|
+
if ($[15] !== api || $[16] !== builtinTemplates || $[17] !== contentModel || $[18] !== drupalBaseUrl || $[19] !== propTransforms) {
|
|
114
113
|
t6 = {
|
|
115
114
|
drupalBaseUrl,
|
|
116
115
|
contentModel,
|
|
117
|
-
builtinTemplates
|
|
116
|
+
builtinTemplates,
|
|
117
|
+
propTransforms,
|
|
118
|
+
api
|
|
118
119
|
};
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
120
|
+
$[15] = api;
|
|
121
|
+
$[16] = builtinTemplates;
|
|
122
|
+
$[17] = contentModel;
|
|
123
|
+
$[18] = drupalBaseUrl;
|
|
124
|
+
$[19] = propTransforms;
|
|
125
|
+
$[20] = t6;
|
|
123
126
|
} else {
|
|
124
|
-
t6 = $[
|
|
127
|
+
t6 = $[20];
|
|
125
128
|
}
|
|
126
129
|
let t7;
|
|
127
|
-
if ($[
|
|
130
|
+
if ($[21] !== isHighlighted) {
|
|
128
131
|
t7 = cn("nh:relative nh:-outline-offset-1", {
|
|
129
132
|
"nh:outline-1 nh:outline-(--nh-primary) nh:outline-dashed": isHighlighted
|
|
130
133
|
});
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
134
|
+
$[21] = isHighlighted;
|
|
135
|
+
$[22] = t7;
|
|
133
136
|
} else {
|
|
134
|
-
t7 = $[
|
|
137
|
+
t7 = $[22];
|
|
135
138
|
}
|
|
136
139
|
let t8;
|
|
137
|
-
if ($[
|
|
140
|
+
if ($[23] !== children || $[24] !== t7) {
|
|
138
141
|
t8 = /*#__PURE__*/_jsx("div", {
|
|
139
142
|
className: t7,
|
|
140
143
|
children: children
|
|
141
144
|
});
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
145
|
+
$[23] = children;
|
|
146
|
+
$[24] = t7;
|
|
147
|
+
$[25] = t8;
|
|
145
148
|
} else {
|
|
146
|
-
t8 = $[
|
|
149
|
+
t8 = $[25];
|
|
147
150
|
}
|
|
148
151
|
let t9;
|
|
149
|
-
if ($[
|
|
152
|
+
if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
|
|
150
153
|
t9 = {
|
|
151
154
|
y: "100%"
|
|
152
155
|
};
|
|
153
|
-
$[
|
|
156
|
+
$[26] = t9;
|
|
154
157
|
} else {
|
|
155
|
-
t9 = $[
|
|
158
|
+
t9 = $[26];
|
|
156
159
|
}
|
|
157
160
|
const t10 = isEditMode ? 0 : "100%";
|
|
158
161
|
let t11;
|
|
159
|
-
if ($[
|
|
162
|
+
if ($[27] !== t10) {
|
|
160
163
|
t11 = {
|
|
161
164
|
y: t10
|
|
162
165
|
};
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
166
|
+
$[27] = t10;
|
|
167
|
+
$[28] = t11;
|
|
165
168
|
} else {
|
|
166
|
-
t11 = $[
|
|
169
|
+
t11 = $[28];
|
|
167
170
|
}
|
|
168
171
|
let t12;
|
|
169
|
-
if ($[
|
|
172
|
+
if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
|
|
170
173
|
t12 = {
|
|
171
174
|
duration: 0.3,
|
|
172
175
|
ease: "easeInOut"
|
|
173
176
|
};
|
|
174
|
-
$[
|
|
177
|
+
$[29] = t12;
|
|
175
178
|
} else {
|
|
176
|
-
t12 = $[
|
|
179
|
+
t12 = $[29];
|
|
177
180
|
}
|
|
178
181
|
let t13;
|
|
179
|
-
if ($[
|
|
182
|
+
if ($[30] !== isEditMode || $[31] !== setIsEditorReady) {
|
|
180
183
|
t13 = () => setIsEditorReady(isEditMode);
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
$[
|
|
184
|
+
$[30] = isEditMode;
|
|
185
|
+
$[31] = setIsEditorReady;
|
|
186
|
+
$[32] = t13;
|
|
184
187
|
} else {
|
|
185
|
-
t13 = $[
|
|
188
|
+
t13 = $[32];
|
|
186
189
|
}
|
|
187
190
|
let t14;
|
|
188
|
-
if ($[
|
|
191
|
+
if ($[33] !== closeEditor || $[34] !== config || $[35] !== fieldName || $[36] !== isEditorReady || $[37] !== node || $[38] !== onAction || $[39] !== overrides || $[40] !== plugins || $[41] !== puckData || $[42] !== puckProps || $[43] !== validate) {
|
|
189
192
|
t14 = isEditorReady && /*#__PURE__*/_jsx(LazyPuckEditor, {
|
|
190
193
|
fieldName: fieldName,
|
|
191
194
|
node: node,
|
|
@@ -193,22 +196,28 @@ export default function PuckWrapper(t0) {
|
|
|
193
196
|
config: config,
|
|
194
197
|
closePuckEditor: closeEditor,
|
|
195
198
|
plugins: plugins,
|
|
196
|
-
overrides: overrides
|
|
199
|
+
overrides: overrides,
|
|
200
|
+
onAction: onAction,
|
|
201
|
+
validate: validate,
|
|
202
|
+
puckProps: puckProps
|
|
197
203
|
}, `puck-editor-${fieldName}`);
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
204
|
+
$[33] = closeEditor;
|
|
205
|
+
$[34] = config;
|
|
206
|
+
$[35] = fieldName;
|
|
207
|
+
$[36] = isEditorReady;
|
|
208
|
+
$[37] = node;
|
|
209
|
+
$[38] = onAction;
|
|
210
|
+
$[39] = overrides;
|
|
211
|
+
$[40] = plugins;
|
|
212
|
+
$[41] = puckData;
|
|
213
|
+
$[42] = puckProps;
|
|
214
|
+
$[43] = validate;
|
|
215
|
+
$[44] = t14;
|
|
207
216
|
} else {
|
|
208
|
-
t14 = $[
|
|
217
|
+
t14 = $[44];
|
|
209
218
|
}
|
|
210
219
|
let t15;
|
|
211
|
-
if ($[
|
|
220
|
+
if ($[45] !== t11 || $[46] !== t13 || $[47] !== t14) {
|
|
212
221
|
t15 = /*#__PURE__*/_jsx(motion.div, {
|
|
213
222
|
"data-puck-editor-overlay": true,
|
|
214
223
|
className: "nh-root nh:fixed nh:inset-0 nh:z-50 nh:border nh:border-t nh:border-b nh:border-gray-300 nh:bg-white",
|
|
@@ -218,40 +227,40 @@ export default function PuckWrapper(t0) {
|
|
|
218
227
|
onAnimationComplete: t13,
|
|
219
228
|
children: t14
|
|
220
229
|
});
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
230
|
+
$[45] = t11;
|
|
231
|
+
$[46] = t13;
|
|
232
|
+
$[47] = t14;
|
|
233
|
+
$[48] = t15;
|
|
225
234
|
} else {
|
|
226
|
-
t15 = $[
|
|
235
|
+
t15 = $[48];
|
|
227
236
|
}
|
|
228
237
|
let t16;
|
|
229
|
-
if ($[
|
|
238
|
+
if ($[49] !== t15 || $[50] !== t8) {
|
|
230
239
|
t16 = /*#__PURE__*/_jsxs("div", {
|
|
231
240
|
children: [t8, t15]
|
|
232
241
|
});
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
242
|
+
$[49] = t15;
|
|
243
|
+
$[50] = t8;
|
|
244
|
+
$[51] = t16;
|
|
236
245
|
} else {
|
|
237
|
-
t16 = $[
|
|
246
|
+
t16 = $[51];
|
|
238
247
|
}
|
|
239
248
|
let t17;
|
|
240
|
-
if ($[
|
|
249
|
+
if ($[52] !== dictionaryOverrides || $[53] !== editorLocale || $[54] !== t16) {
|
|
241
250
|
t17 = /*#__PURE__*/_jsx(PuckI18nProvider, {
|
|
242
251
|
locale: editorLocale,
|
|
243
252
|
overrides: dictionaryOverrides,
|
|
244
253
|
children: t16
|
|
245
254
|
});
|
|
246
|
-
$[
|
|
247
|
-
$[
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
255
|
+
$[52] = dictionaryOverrides;
|
|
256
|
+
$[53] = editorLocale;
|
|
257
|
+
$[54] = t16;
|
|
258
|
+
$[55] = t17;
|
|
250
259
|
} else {
|
|
251
|
-
t17 = $[
|
|
260
|
+
t17 = $[55];
|
|
252
261
|
}
|
|
253
262
|
let t18;
|
|
254
|
-
if ($[
|
|
263
|
+
if ($[56] !== t17 || $[57] !== t6) {
|
|
255
264
|
t18 = /*#__PURE__*/_jsx(QueryClientProvider, {
|
|
256
265
|
client: t5,
|
|
257
266
|
children: /*#__PURE__*/_jsx(PuckEditorConfigProvider, {
|
|
@@ -259,11 +268,11 @@ export default function PuckWrapper(t0) {
|
|
|
259
268
|
children: t17
|
|
260
269
|
})
|
|
261
270
|
});
|
|
262
|
-
$[
|
|
263
|
-
$[
|
|
264
|
-
$[
|
|
271
|
+
$[56] = t17;
|
|
272
|
+
$[57] = t6;
|
|
273
|
+
$[58] = t18;
|
|
265
274
|
} else {
|
|
266
|
-
t18 = $[
|
|
275
|
+
t18 = $[58];
|
|
267
276
|
}
|
|
268
277
|
return t18;
|
|
269
278
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"puck-wrapper.js","names":["__transformExtension","filepath","extMapping","startsWith","idx","lastIndexOf","includes","newExt","origExt","Object","entries","sort","a","b","length","endsWith","slice","c","_c","dynamic","PuckI18nProvider","usePuckOverlay","QueryClientProvider","motion","cn","getBundle","parsePuckData","resolveContentModel","PuckEditorConfigProvider","getEditorQueryClient","jsx","_jsx","jsxs","_jsxs","LazyPuckEditor","ssr","PuckWrapper","t0","$","node","config","isLoggedIn","editorLocale","t1","dictionaryOverrides","plugins","overrides","drupalBaseUrl","contentModel","builtinTemplates","children","undefined","t2","type","bundle","fieldName","dataField","puckField","t3","id","puckData","t4","isEditMode","isEditorReady","setIsEditorReady","closeEditor","isHighlighted","console","error","t5","Symbol","for","t6","t7","t8","className","t9","y","t10","t11","t12","duration","ease","t13","t14","t15","div","initial","animate","transition","onAnimationComplete","t16","t17","t18","client"],"sources":["../../../src/puck-editor/internal/puck-wrapper.tsx"],"sourcesContent":["'use client';\n\nimport { type ReactNode } from 'react';\nimport dynamic from 'next/dynamic';\n\nimport { PuckI18nProvider, type PuckDictionaryOverrides } from './i18n';\nimport { usePuckOverlay } from './use-puck-overlay';\n\nimport '../puck-theme.css';\n\nimport { Config, Overrides, Plugin } from '@puckeditor/core';\nimport { QueryClientProvider } from '@tanstack/react-query';\nimport { motion } from 'motion/react';\n\nimport { cn } from '../../shared/cn';\nimport { getBundle, parsePuckData, resolveContentModel } from './content-model';\nimport {\n PuckEditorConfigProvider,\n type PuckEditorConfig,\n} from './editor-config';\nimport { getEditorQueryClient } from './editor-query-client';\nimport { PuckNode } from './puck-node';\n\nconst LazyPuckEditor = dynamic(() => import('./editor/puck-editor'), {\n ssr: false,\n});\n\ntype PuckWrapperProps = {\n node: PuckNode;\n config: Config;\n isLoggedIn: boolean;\n editorLocale?: string;\n dictionaryOverrides?: PuckDictionaryOverrides;\n plugins?: (defaultPlugins: Plugin[]) => Plugin[];\n overrides?: Partial<Overrides>;\n children: ReactNode;\n} & PuckEditorConfig;\n\nexport default function PuckWrapper({\n node,\n config,\n isLoggedIn,\n editorLocale = 'en',\n dictionaryOverrides,\n plugins,\n overrides,\n drupalBaseUrl,\n contentModel,\n builtinTemplates,\n children,\n}: PuckWrapperProps) {\n const bundle = getBundle(resolveContentModel(contentModel), node.type);\n const fieldName = bundle?.dataField ?? '';\n const puckField = bundle ? (node[fieldName] as string) : '';\n const puckData = parsePuckData(puckField, node.id);\n const {\n isEditMode,\n isEditorReady,\n setIsEditorReady,\n closeEditor,\n isHighlighted,\n } = usePuckOverlay({ node, fieldName, isLoggedIn });\n\n if (!bundle) {\n console.error(\n `puck-editor: no bundle configured for node type \"${node.type}\"`\n );\n return null;\n }\n\n return (\n <QueryClientProvider client={getEditorQueryClient()}>\n <PuckEditorConfigProvider\n config={{ drupalBaseUrl, contentModel, builtinTemplates }}\n >\n <PuckI18nProvider locale={editorLocale} overrides={dictionaryOverrides}>\n <div>\n <div\n className={cn('nh:relative nh:-outline-offset-1', {\n 'nh:outline-1 nh:outline-(--nh-primary) nh:outline-dashed':\n isHighlighted,\n })}\n >\n {children}\n </div>\n <motion.div\n data-puck-editor-overlay\n className=\"nh-root nh:fixed nh:inset-0 nh:z-50 nh:border nh:border-t nh:border-b nh:border-gray-300 nh:bg-white\"\n initial={{ y: '100%' }}\n animate={{ y: isEditMode ? 0 : '100%' }}\n transition={{\n duration: 0.3,\n ease: 'easeInOut',\n }}\n onAnimationComplete={() => setIsEditorReady(isEditMode)}\n >\n {isEditorReady && (\n <LazyPuckEditor\n key={`puck-editor-${fieldName}`}\n fieldName={fieldName}\n node={node}\n data={puckData}\n config={config}\n closePuckEditor={closeEditor}\n plugins={plugins}\n overrides={overrides}\n />\n )}\n </motion.div>\n </div>\n </PuckI18nProvider>\n </PuckEditorConfigProvider>\n </QueryClientProvider>\n );\n}\n"],"mappings":"AAAA,YAAY;;AAAX,SAASA,oBAAoBA,CAACC,QAAQ,EAAEC,UAAU,EAAE;EACnD,IAAG,CAACD,QAAQ,CAACE,UAAU,CAAC,IAAI,CAAC,IAAI,CAACF,QAAQ,CAACE,UAAU,CAAC,KAAK,CAAC,EAAE;IAC5D;IACA,OAAOF,QAAQ;EACjB;EAEA,MAAMG,GAAG,GAAGH,QAAQ,CAACI,WAAW,CAAC,GAAG,CAAC;EACrC,IAAGD,GAAG,KAAK,CAAC,CAAC,IAAIH,QAAQ,CAACK,QAAQ,CAAC,GAAG,EAAEF,GAAG,CAAC,EAAE;IAC5C;IACA,MAAMG,MAAM,GAAGL,UAAU,CAAC,EAAE,CAAC;IAC7B,IAAGK,MAAM,EAAE;MACT,OAAON,QAAQ,GAAGM,MAAM;IAC1B;IACA,OAAON,QA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,KAAA;MAAAiB,QAAA,GACEwB,EAOM,EACNW,GAuBa;IAAA,CACV,CAAC;IAAA/C,CAAA,OAAA+C,GAAA;IAAA/C,CAAA,OAAAoC,EAAA;IAAApC,CAAA,OAAAqD,GAAA;EAAA;IAAAA,GAAA,GAAArD,CAAA;EAAA;EAAA,IAAAsD,GAAA;EAAA,IAAAtD,CAAA,SAAAM,mBAAA,IAAAN,CAAA,SAAAI,YAAA,IAAAJ,CAAA,SAAAqD,GAAA;IAlCRC,GAAA,gBAAA7D,IAAA,CAACX,gBAAgB;MAASsB,MAAY,EAAZA,YAAY;MAAaE,SAAmB,EAAnBA,mBAAmB;MAAAM,QAAA,EACpEyC;IAiCM,CACU,CAAC;IAAArD,CAAA,OAAAM,mBAAA;IAAAN,CAAA,OAAAI,YAAA;IAAAJ,CAAA,OAAAqD,GAAA;IAAArD,CAAA,OAAAsD,GAAA;EAAA;IAAAA,GAAA,GAAAtD,CAAA;EAAA;EAAA,IAAAuD,GAAA;EAAA,IAAAvD,CAAA,SAAAsD,GAAA,IAAAtD,CAAA,SAAAkC,EAAA;IAvCvBqB,GAAA,gBAAA9D,IAAA,CAACT,mBAAmB;MAASwE,MAAsB,EAAtBzB,EAAsB;MAAAnB,QAAA,eACjDnB,IAAA,CAACH,wBAAwB;QACfY,MAAiD,EAAjDgC,EAAiD;QAAAtB,QAAA,EAEzD0C;MAmCmB,CACK;IAAC,CACR,CAAC;IAAAtD,CAAA,OAAAsD,GAAA;IAAAtD,CAAA,OAAAkC,EAAA;IAAAlC,CAAA,OAAAuD,GAAA;EAAA;IAAAA,GAAA,GAAAvD,CAAA;EAAA;EAAA,OAzCtBuD,GAyCsB;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"puck-wrapper.js","names":["c","_c","dynamic","PuckI18nProvider","usePuckOverlay","QueryClientProvider","motion","cn","getBundle","parsePuckData","resolveContentModel","PuckEditorConfigProvider","getEditorQueryClient","Fragment","_Fragment","jsx","_jsx","jsxs","_jsxs","LazyPuckEditor","ssr","PuckWrapper","t0","$","node","config","isLoggedIn","editorLocale","t1","dictionaryOverrides","plugins","overrides","onAction","validate","puckProps","drupalBaseUrl","contentModel","builtinTemplates","propTransforms","api","children","undefined","t2","type","bundle","fieldName","dataField","puckField","t3","id","puckData","t4","isEditMode","isEditorReady","setIsEditorReady","closeEditor","isHighlighted","console","error","t5","Symbol","for","t6","t7","t8","className","t9","y","t10","t11","t12","duration","ease","t13","t14","t15","div","initial","animate","transition","onAnimationComplete","t16","t17","t18","client"],"sources":["../../../src/puck-editor/internal/puck-wrapper.tsx"],"sourcesContent":["'use client';\n\nimport { type ReactNode } from 'react';\nimport dynamic from 'next/dynamic';\n\nimport { PuckI18nProvider, type PuckDictionaryOverrides } from './i18n.tsx';\nimport { usePuckOverlay } from './use-puck-overlay.ts';\n\nimport '../puck-theme.css';\n\nimport { Config, Overrides, Plugin } from '@puckeditor/core';\nimport { QueryClientProvider } from '@tanstack/react-query';\nimport { motion } from 'motion/react';\n\nimport { cn } from '../../shared/cn.ts';\nimport {\n getBundle,\n parsePuckData,\n resolveContentModel,\n} from './content-model.ts';\nimport {\n PuckEditorConfigProvider,\n type PuckEditorConfig,\n} from './editor-config.tsx';\nimport { getEditorQueryClient } from './editor-query-client.ts';\nimport { PuckNode } from './puck-node.ts';\nimport type {\n PuckOnAction,\n PuckPassthroughProps,\n PuckValidate,\n} from './puck-props.ts';\n\nconst LazyPuckEditor = dynamic(() => import('./editor/puck-editor.tsx'), {\n ssr: false,\n});\n\ntype PuckWrapperProps = {\n node: PuckNode;\n config: Config;\n isLoggedIn: boolean;\n editorLocale?: string;\n dictionaryOverrides?: PuckDictionaryOverrides;\n plugins?: (defaultPlugins: Plugin[]) => Plugin[];\n overrides?: Partial<Overrides>;\n /** Called after the module's internal action handling. */\n onAction?: PuckOnAction;\n /**\n * Custom validation run on save, composed after the built-in required-field\n * check. Returning one or more issues blocks the publish and surfaces them in\n * the editor toast.\n */\n validate?: PuckValidate;\n /**\n * Remaining <Puck> props, spread before the module-managed ones (managed\n * props always win). Managed and therefore excluded: config, data, plugins,\n * overrides, onAction, onPublish, renderHeader, renderHeaderActions.\n */\n puckProps?: PuckPassthroughProps;\n children: ReactNode;\n} & PuckEditorConfig;\n\n/**\n * Editor overlay shell for a Puck page.\n *\n * Requires the `sonner` (save/upload/template toasts) and `motion` (overlay\n * animation) peers, alongside `@puckeditor/core`; see the module README.\n */\nexport default function PuckWrapper({\n node,\n config,\n isLoggedIn,\n editorLocale = 'en',\n dictionaryOverrides,\n plugins,\n overrides,\n onAction,\n validate,\n puckProps,\n drupalBaseUrl,\n contentModel,\n builtinTemplates,\n propTransforms,\n api,\n children,\n}: PuckWrapperProps) {\n const bundle = getBundle(resolveContentModel(contentModel), node.type);\n const fieldName = bundle?.dataField ?? '';\n const puckField = bundle ? (node[fieldName] as string) : '';\n const puckData = parsePuckData(puckField, node.id, propTransforms, config);\n const {\n isEditMode,\n isEditorReady,\n setIsEditorReady,\n closeEditor,\n isHighlighted,\n } = usePuckOverlay({ node, fieldName, isLoggedIn });\n\n if (!bundle) {\n console.error(\n `puck-editor: no bundle configured for node type \"${node.type}\"; rendering page without editor`\n );\n return <>{children}</>;\n }\n\n return (\n <QueryClientProvider client={getEditorQueryClient()}>\n <PuckEditorConfigProvider\n config={{\n drupalBaseUrl,\n contentModel,\n builtinTemplates,\n propTransforms,\n api,\n }}\n >\n <PuckI18nProvider locale={editorLocale} overrides={dictionaryOverrides}>\n <div>\n <div\n className={cn('nh:relative nh:-outline-offset-1', {\n 'nh:outline-1 nh:outline-(--nh-primary) nh:outline-dashed':\n isHighlighted,\n })}\n >\n {children}\n </div>\n <motion.div\n data-puck-editor-overlay\n className=\"nh-root nh:fixed nh:inset-0 nh:z-50 nh:border nh:border-t nh:border-b nh:border-gray-300 nh:bg-white\"\n initial={{ y: '100%' }}\n animate={{ y: isEditMode ? 0 : '100%' }}\n transition={{\n duration: 0.3,\n ease: 'easeInOut',\n }}\n onAnimationComplete={() => setIsEditorReady(isEditMode)}\n >\n {isEditorReady && (\n <LazyPuckEditor\n key={`puck-editor-${fieldName}`}\n fieldName={fieldName}\n node={node}\n data={puckData}\n config={config}\n closePuckEditor={closeEditor}\n plugins={plugins}\n overrides={overrides}\n onAction={onAction}\n validate={validate}\n puckProps={puckProps}\n />\n )}\n </motion.div>\n </div>\n </PuckI18nProvider>\n </PuckEditorConfigProvider>\n </QueryClientProvider>\n );\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAGb,OAAOC,OAAO,MAAM,cAAc;AAElC,SAASC,gBAAgB,QAAsC,WAAY;AAC3E,SAASC,cAAc,QAAQ,uBAAuB;AAEtD,OAAO,mBAAmB;AAG1B,SAASC,mBAAmB,QAAQ,uBAAuB;AAC3D,SAASC,MAAM,QAAQ,cAAc;AAErC,SAASC,EAAE,QAAQ,oBAAoB;AACvC,SACEC,SAAS,EACTC,aAAa,EACbC,mBAAmB,QACd,oBAAoB;AAC3B,SACEC,wBAAwB,QAEnB,oBAAqB;AAC5B,SAASC,oBAAoB,QAAQ,0BAA0B;AAAC,SAAAC,QAAA,IAAAC,SAAA,EAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAQhE,MAAMC,cAAc,GAAGjB,OAAO,CAAC,MAAM,MAAM,CAAC,yBAA0B,CAAC,EAAE;EACvEkB,GAAG,EAAE;AACP,CAAC,CAAC;AA2BF;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAAC,YAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAtB,EAAA;EAAqB;IAAAuB,IAAA;IAAAC,MAAA;IAAAC,UAAA;IAAAC,YAAA,EAAAC,EAAA;IAAAC,mBAAA;IAAAC,OAAA;IAAAC,SAAA;IAAAC,QAAA;IAAAC,QAAA;IAAAC,SAAA;IAAAC,aAAA;IAAAC,YAAA;IAAAC,gBAAA;IAAAC,cAAA;IAAAC,GAAA;IAAAC;EAAA,IAAAlB,EAiBj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AAA0D,GAAA;IAAA1D,CAAA,OAAA2D,GAAA;EAAA;IAAAA,GAAA,GAAA3D,CAAA;EAAA;EAAA,IAAA4D,GAAA;EAAA,IAAA5D,CAAA,SAAA2D,GAAA,IAAA3D,CAAA,SAAAuC,EAAA;IAhDvBqB,GAAA,gBAAAnE,IAAA,CAACX,mBAAmB;MAAS+E,MAAsB,EAAtBzB,EAAsB;MAAAnB,QAAA,eACjDxB,IAAA,CAACL,wBAAwB;QACfc,MAMP,EANOqC,EAMP;QAAAtB,QAAA,EAED0C;MAsCmB,CACK;IAAC,CACR,CAAC;IAAA3D,CAAA,OAAA2D,GAAA;IAAA3D,CAAA,OAAAuC,EAAA;IAAAvC,CAAA,OAAA4D,GAAA;EAAA;IAAAA,GAAA,GAAA5D,CAAA;EAAA;EAAA,OAlDtB4D,GAkDsB;AAAA","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CropBreakpoint, MediaCrop } from '../fields/media-selector/crop-types';
|
|
1
|
+
import type { CropBreakpoint, MediaCrop } from '../fields/media-selector/crop-types.js';
|
|
2
2
|
export declare function cropSizes(crop: MediaCrop, breakpoints?: CropBreakpoint[]): string;
|
|
3
3
|
export declare function cropFocusPosition(crop?: MediaCrop | null): string | undefined;
|
|
4
4
|
export type CroppedImageProps = {
|
|
@@ -16,4 +16,3 @@ export type CroppedImageProps = {
|
|
|
16
16
|
fillContainer?: boolean;
|
|
17
17
|
};
|
|
18
18
|
export declare function CroppedImage({ src, alt, scopeId, crop, breakpoints, fallbackAspectRatio, sizes, priority, className, imgClassName, objectFit, fillContainer, }: CroppedImageProps): import("react").JSX.Element;
|
|
19
|
-
//# sourceMappingURL=cropped-image.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cropped-image.js","names":["NextImage","jsx","_jsx","jsxs","_jsxs","round","n","Math","sanitizeScopeId","id","replace","cropVars","region","aspect","width","height","x","y","join","overridesFor","crop","breakpoints","filter","bp","overrides","key","map","cropSizes","entries","sort","a","b","maxWidth","ceil","base","cropFocusPosition","undefined","CroppedImage","src","alt","scopeId","fallbackAspectRatio","sizes","priority","className","imgClassName","objectFit","fillContainer","style","position","inset","overflow","aspectRatio","children","fill","css","left","top","containerType","transform"],"sources":["../../../../src/puck-editor/internal/render/cropped-image.tsx"],"sourcesContent":["import NextImage from 'next/image';\n\nimport type {\n CropBreakpoint,\n CropRegion,\n MediaCrop,\n} from '../fields/media-selector/crop-types';\n\nconst round = (n: number) => Math.round(n * 10000) / 10000;\n\nconst sanitizeScopeId = (id: string) => id.replace(/[^a-zA-Z0-9_-]/g, '');\n\nfunction cropVars(region: CropRegion): string {\n return [\n `--nh-crop-ar:${round(region.aspect)}`,\n `--nh-crop-w:${round(100 / region.width)}%`,\n `--nh-crop-h:${round(100 / region.height)}%`,\n `--nh-crop-l:${round((-region.x / region.width) * 100)}%`,\n `--nh-crop-t:${round((-region.y / region.height) * 100)}%`,\n ].join(';');\n}\n\nfunction overridesFor(\n crop: MediaCrop,\n breakpoints?: CropBreakpoint[]\n): Array<CropBreakpoint & { region: CropRegion }> {\n return (breakpoints ?? [])\n .filter((bp) => crop.overrides?.[bp.key])\n .map((bp) => ({ ...bp, region: crop.overrides![bp.key] }));\n}\n\nexport function cropSizes(\n crop: MediaCrop,\n breakpoints?: CropBreakpoint[]\n): string {\n const entries = overridesFor(crop, breakpoints)\n .sort((a, b) => a.maxWidth - b.maxWidth)\n .map(\n (bp) =>\n `(max-width: ${bp.maxWidth}px) ${Math.ceil(100 / bp.region.width)}vw`\n );\n return [...entries, `${Math.ceil(100 / crop.base.width)}vw`].join(', ');\n}\n\nexport function cropFocusPosition(crop?: MediaCrop | null): string | undefined {\n if (!crop) return undefined;\n const { x, y, width, height } = crop.base;\n return `${round((x + width / 2) * 100)}% ${round((y + height / 2) * 100)}%`;\n}\n\nexport type CroppedImageProps = {\n src: string;\n alt: string;\n scopeId: string;\n crop?: MediaCrop | null;\n breakpoints?: CropBreakpoint[];\n fallbackAspectRatio?: string;\n sizes?: string;\n priority?: boolean;\n className?: string;\n imgClassName?: string;\n objectFit?: 'cover' | 'contain';\n fillContainer?: boolean;\n};\n\nexport function CroppedImage({\n src,\n alt,\n scopeId,\n crop,\n breakpoints,\n fallbackAspectRatio,\n sizes,\n priority,\n className,\n imgClassName,\n objectFit = 'cover',\n fillContainer,\n}: CroppedImageProps) {\n if (!crop) {\n return (\n <div\n className={className}\n style={\n fillContainer\n ? { position: 'absolute', inset: 0, overflow: 'hidden' }\n : {\n position: 'relative',\n aspectRatio: fallbackAspectRatio ?? '16/9',\n }\n }\n >\n <NextImage\n src={src}\n alt={alt}\n fill\n priority={priority}\n sizes={sizes ?? (priority ? '100vw' : 'auto')}\n className={imgClassName}\n style={{ objectFit }}\n />\n </div>\n );\n }\n\n const id = sanitizeScopeId(scopeId);\n const css = [\n `[data-nh-crop=\"${id}\"]{${cropVars(crop.base)}}`,\n ...overridesFor(crop, breakpoints)\n .sort((a, b) => b.maxWidth - a.maxWidth)\n .map(\n (bp) =>\n `@media (max-width:${bp.maxWidth}px){[data-nh-crop=\"${id}\"]{${cropVars(bp.region)}}}`\n ),\n ].join('');\n\n const region = (\n <div\n style={{\n position: 'absolute',\n width: 'var(--nh-crop-w)',\n height: 'var(--nh-crop-h)',\n left: 'var(--nh-crop-l)',\n top: 'var(--nh-crop-t)',\n }}\n >\n <NextImage\n src={src}\n alt={alt}\n fill\n priority={priority}\n sizes={sizes ?? (priority ? cropSizes(crop, breakpoints) : 'auto')}\n className={imgClassName}\n style={{ objectFit }}\n />\n </div>\n );\n\n if (fillContainer) {\n return (\n <div\n data-nh-crop={id}\n className={className}\n style={{\n position: 'absolute',\n inset: 0,\n overflow: 'hidden',\n containerType: 'size',\n }}\n >\n <style>{css}</style>\n <div\n style={{\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n width: 'max(100cqw, calc(100cqh * var(--nh-crop-ar)))',\n height: 'max(100cqh, calc(100cqw / var(--nh-crop-ar)))',\n }}\n >\n {region}\n </div>\n </div>\n );\n }\n\n return (\n <div\n data-nh-crop={id}\n className={className}\n style={{\n position: 'relative',\n overflow: 'hidden',\n aspectRatio: 'var(--nh-crop-ar)',\n }}\n >\n <style>{css}</style>\n {region}\n </div>\n );\n}\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAQnC,MAAMC,KAAK,GAAIC,CAAS,IAAKC,IAAI,CAACF,KAAK,CAACC,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK;AAE1D,MAAME,eAAe,GAAIC,EAAU,IAAKA,EAAE,CAACC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC;AAEzE,SAASC,QAAQA,CAACC,MAAkB,EAAU;EAC5C,OAAO,CACL,gBAAgBP,KAAK,CAACO,MAAM,CAACC,MAAM,CAAC,EAAE,EACtC,eAAeR,KAAK,CAAC,GAAG,GAAGO,MAAM,CAACE,KAAK,CAAC,GAAG,EAC3C,eAAeT,KAAK,CAAC,GAAG,GAAGO,MAAM,CAACG,MAAM,CAAC,GAAG,EAC5C,eAAeV,KAAK,CAAE,CAACO,MAAM,CAACI,CAAC,GAAGJ,MAAM,CAACE,KAAK,GAAI,GAAG,CAAC,GAAG,EACzD,eAAeT,KAAK,CAAE,CAACO,MAAM,CAACK,CAAC,GAAGL,MAAM,CAACG,MAAM,GAAI,GAAG,CAAC,GAAG,CAC3D,CAACG,IAAI,CAAC,GAAG,CAAC;AACb;AAEA,SAASC,YAAYA,CACnBC,IAAe,EACfC,WAA8B,EACkB;EAChD,OAAO,CAACA,WAAW,IAAI,EAAE,EACtBC,MAAM,CAAEC,EAAE,IAAKH,IAAI,CAACI,SAAS,GAAGD,EAAE,CAACE,GAAG,CAAC,CAAC,CACxCC,GAAG,CAAEH,EAAE,KAAM;IAAE,GAAGA,EAAE;IAAEX,MAAM,EAAEQ,IAAI,CAACI,SA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sC,GAAG,EAAEA,GAAI;MACTC,GAAG,EAAEA,GAAI;MACTe,IAAI;MACJX,QAAQ,EAAEA,QAAS;MACnBD,KAAK,EAAEA,KAAK,KAAKC,QAAQ,GAAGhB,SAAS,CAACP,IAAI,EAAEC,WAAW,CAAC,GAAG,MAAM,CAAE;MACnEuB,SAAS,EAAEC,YAAa;MACxBG,KAAK,EAAE;QAAEF;MAAU;IAAE,CACtB;EAAC,CACC,CACN;EAED,IAAIC,aAAa,EAAE;IACjB,oBACE3C,KAAA;MACE,gBAAcK,EAAG;MACjBmC,SAAS,EAAEA,SAAU;MACrBI,KAAK,EAAE;QACLC,QAAQ,EAAE,UAAU;QACpBC,KAAK,EAAE,CAAC;QACRC,QAAQ,EAAE,QAAQ;QAClBO,aAAa,EAAE;MACjB,CAAE;MAAAL,QAAA,gBAEFnD,IAAA;QAAAmD,QAAA,EAAQE;MAAG,CAAQ,CAAC,eACpBrD,IAAA;QACE8C,KAAK,EAAE;UACLC,QAAQ,EAAE,UAAU;UACpBQ,GAAG,EAAE,KAAK;UACVD,IAAI,EAAE,KAAK;UACXG,SAAS,EAAE,uBAAuB;UAClC7C,KAAK,EAAE,+CAA+C;UACtDC,MAAM,EAAE;QACV,CAAE;QAAAsC,QAAA,EAEDzC;MAAM,CACJ,CAAC;IAAA,CACH,CAAC;EAEV;EAEA,oBACER,KAAA;IACE,gBAAcK,EAAG;IACjBmC,SAAS,EAAEA,SAAU;IACrBI,KAAK,EAAE;MACLC,QAAQ,EAAE,UAAU;MACpBE,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAE;IACf,CAAE;IAAAC,QAAA,gBAEFnD,IAAA;MAAAmD,QAAA,EAAQE;IAAG,CAAQ,CAAC,EACnB3C,MAAM;EAAA,CACJ,CAAC;AAEV","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"cropped-image.js","names":["NextImage","jsx","_jsx","jsxs","_jsxs","round","n","Math","sanitizeScopeId","id","replace","cropVars","region","aspect","width","height","x","y","join","overridesFor","crop","breakpoints","filter","bp","overrides","key","map","cropSizes","entries","sort","a","b","maxWidth","ceil","base","cropFocusPosition","undefined","CroppedImage","src","alt","scopeId","fallbackAspectRatio","sizes","priority","className","imgClassName","objectFit","fillContainer","style","position","inset","overflow","aspectRatio","children","fill","css","left","top","containerType","transform"],"sources":["../../../../src/puck-editor/internal/render/cropped-image.tsx"],"sourcesContent":["import NextImage from 'next/image';\n\nimport type {\n CropBreakpoint,\n CropRegion,\n MediaCrop,\n} from '../fields/media-selector/crop-types.ts';\n\nconst round = (n: number) => Math.round(n * 10000) / 10000;\n\nconst sanitizeScopeId = (id: string) => id.replace(/[^a-zA-Z0-9_-]/g, '');\n\nfunction cropVars(region: CropRegion): string {\n return [\n `--nh-crop-ar:${round(region.aspect)}`,\n `--nh-crop-w:${round(100 / region.width)}%`,\n `--nh-crop-h:${round(100 / region.height)}%`,\n `--nh-crop-l:${round((-region.x / region.width) * 100)}%`,\n `--nh-crop-t:${round((-region.y / region.height) * 100)}%`,\n ].join(';');\n}\n\nfunction overridesFor(\n crop: MediaCrop,\n breakpoints?: CropBreakpoint[]\n): Array<CropBreakpoint & { region: CropRegion }> {\n return (breakpoints ?? [])\n .filter((bp) => crop.overrides?.[bp.key])\n .map((bp) => ({ ...bp, region: crop.overrides![bp.key] }));\n}\n\nexport function cropSizes(\n crop: MediaCrop,\n breakpoints?: CropBreakpoint[]\n): string {\n const entries = overridesFor(crop, breakpoints)\n .sort((a, b) => a.maxWidth - b.maxWidth)\n .map(\n (bp) =>\n `(max-width: ${bp.maxWidth}px) ${Math.ceil(100 / bp.region.width)}vw`\n );\n return [...entries, `${Math.ceil(100 / crop.base.width)}vw`].join(', ');\n}\n\nexport function cropFocusPosition(crop?: MediaCrop | null): string | undefined {\n if (!crop) return undefined;\n const { x, y, width, height } = crop.base;\n return `${round((x + width / 2) * 100)}% ${round((y + height / 2) * 100)}%`;\n}\n\nexport type CroppedImageProps = {\n src: string;\n alt: string;\n scopeId: string;\n crop?: MediaCrop | null;\n breakpoints?: CropBreakpoint[];\n fallbackAspectRatio?: string;\n sizes?: string;\n priority?: boolean;\n className?: string;\n imgClassName?: string;\n objectFit?: 'cover' | 'contain';\n fillContainer?: boolean;\n};\n\nexport function CroppedImage({\n src,\n alt,\n scopeId,\n crop,\n breakpoints,\n fallbackAspectRatio,\n sizes,\n priority,\n className,\n imgClassName,\n objectFit = 'cover',\n fillContainer,\n}: CroppedImageProps) {\n if (!crop) {\n return (\n <div\n className={className}\n style={\n fillContainer\n ? { position: 'absolute', inset: 0, overflow: 'hidden' }\n : {\n position: 'relative',\n aspectRatio: fallbackAspectRatio ?? '16/9',\n }\n }\n >\n <NextImage\n src={src}\n alt={alt}\n fill\n priority={priority}\n sizes={sizes ?? (priority ? '100vw' : 'auto')}\n className={imgClassName}\n style={{ objectFit }}\n />\n </div>\n );\n }\n\n const id = sanitizeScopeId(scopeId);\n const css = [\n `[data-nh-crop=\"${id}\"]{${cropVars(crop.base)}}`,\n ...overridesFor(crop, breakpoints)\n .sort((a, b) => b.maxWidth - a.maxWidth)\n .map(\n (bp) =>\n `@media (max-width:${bp.maxWidth}px){[data-nh-crop=\"${id}\"]{${cropVars(bp.region)}}}`\n ),\n ].join('');\n\n const region = (\n <div\n style={{\n position: 'absolute',\n width: 'var(--nh-crop-w)',\n height: 'var(--nh-crop-h)',\n left: 'var(--nh-crop-l)',\n top: 'var(--nh-crop-t)',\n }}\n >\n <NextImage\n src={src}\n alt={alt}\n fill\n priority={priority}\n sizes={sizes ?? (priority ? cropSizes(crop, breakpoints) : 'auto')}\n className={imgClassName}\n style={{ objectFit }}\n />\n </div>\n );\n\n if (fillContainer) {\n return (\n <div\n data-nh-crop={id}\n className={className}\n style={{\n position: 'absolute',\n inset: 0,\n overflow: 'hidden',\n containerType: 'size',\n }}\n >\n <style>{css}</style>\n <div\n style={{\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n width: 'max(100cqw, calc(100cqh * var(--nh-crop-ar)))',\n height: 'max(100cqh, calc(100cqw / var(--nh-crop-ar)))',\n }}\n >\n {region}\n </div>\n </div>\n );\n }\n\n return (\n <div\n data-nh-crop={id}\n className={className}\n style={{\n position: 'relative',\n overflow: 'hidden',\n aspectRatio: 'var(--nh-crop-ar)',\n }}\n >\n <style>{css}</style>\n {region}\n </div>\n );\n}\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAQnC,MAAMC,KAAK,GAAIC,CAAS,IAAKC,IAAI,CAACF,KAAK,CAACC,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK;AAE1D,MAAME,eAAe,GAAIC,EAAU,IAAKA,EAAE,CAACC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC;AAEzE,SAASC,QAAQA,CAACC,MAAkB,EAAU;EAC5C,OAAO,CACL,gBAAgBP,KAAK,CAACO,MAAM,CAACC,MAAM,CAAC,EAAE,EACtC,eAAeR,KAAK,CAAC,GAAG,GAAGO,MAAM,CAACE,KAAK,CAAC,GAAG,EAC3C,eAAeT,KAAK,CAAC,GAAG,GAAGO,MAAM,CAACG,MAAM,CAAC,GAAG,EAC5C,eAAeV,KAAK,CAAE,CAACO,MAAM,CAACI,CAAC,GAAGJ,MAAM,CAACE,KAAK,GAAI,GAAG,CAAC,GAAG,EACzD,eAAeT,KAAK,CAAE,CAACO,MAAM,CAACK,CAAC,GAAGL,MAAM,CAACG,MAAM,GAAI,GAAG,CAAC,GAAG,CAC3D,CAACG,IAAI,CAAC,GAAG,CAAC;AACb;AAEA,SAASC,YAAYA,CACnBC,IAAe,EACfC,WAA8B,EACkB;EAChD,OAAO,CAACA,WAAW,IAAI,EAAE,EACtBC,MAAM,CAAEC,EAAE,IAAKH,IAAI,CAACI,SAAS,GAAGD,EAAE,CAACE,GAAG,CAAC,CAAC,CACxCC,GAAG,CAAEH,EAAE,KAAM;IAAE,GAAGA,EAAE;I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martActionId = 'open-puck-editor' | 'new-page';
|
|
3
|
+
export declare function selectPuckSmartActionIds({ contentModel, nodeType, hasCreatableBundles, }: {
|
|
4
|
+
contentModel: PuckContentModel;
|
|
5
|
+
/** Undefined preserves the legacy edit action; null means no current node. */
|
|
6
|
+
nodeType?: string | null;
|
|
7
|
+
hasCreatableBundles: boolean;
|
|
8
|
+
}): PuckSmartActionId[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { getBundle } from "../content-model.js";
|
|
2
|
+
export function selectPuckSmartActionIds({
|
|
3
|
+
contentModel,
|
|
4
|
+
nodeType,
|
|
5
|
+
hasCreatableBundles
|
|
6
|
+
}) {
|
|
7
|
+
const canEdit = nodeType === undefined || Boolean(nodeType && getBundle(contentModel, nodeType));
|
|
8
|
+
return [...(canEdit ? ['open-puck-editor'] : []), ...(hasCreatableBundles ? ['new-page'] : [])];
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=action-selection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-selection.js","names":["getBundle","selectPuckSmartActionIds","contentModel","nodeType","hasCreatableBundles","canEdit","undefined","Boolean"],"sources":["../../../../src/puck-editor/internal/smart-actions/action-selection.ts"],"sourcesContent":["import {\n getBundle,\n type PuckContentModel,\n} from '../content-model.ts';\n\nexport type PuckSmartActionId = 'open-puck-editor' | 'new-page';\n\nexport function selectPuckSmartActionIds({\n contentModel,\n nodeType,\n hasCreatableBundles,\n}: {\n contentModel: PuckContentModel;\n /** Undefined preserves the legacy edit action; null means no current node. */\n nodeType?: string | null;\n hasCreatableBundles: boolean;\n}): PuckSmartActionId[] {\n const canEdit =\n nodeType === undefined ||\n Boolean(nodeType && getBundle(contentModel, nodeType));\n\n return [\n ...(canEdit ? (['open-puck-editor'] as const) : []),\n ...(hasCreatableBundles ? (['new-page'] as const) : []),\n ];\n}\n"],"mappings":"AAAA,SACEA,SAAS,QAEJ,qBAAqB;AAI5B,OAAO,SAASC,wBAAwBA,CAAC;EACvCC,YAAY;EACZC,QAAQ;EACRC;AAMF,CAAC,EAAuB;EACtB,MAAMC,OAAO,GACXF,QAAQ,KAAKG,SAAS,IACtBC,OAAO,CAACJ,QAAQ,IAAIH,SAAS,CAACE,YAAY,EAAEC,QAAQ,CAAC,CAAC;EAExD,OAAO,CACL,IAAIE,OAAO,GAAI,CAAC,kBAAkB,CAAC,GAAa,EAAE,CAAC,EACnD,IAAID,mBAAmB,GAAI,CAAC,UAAU,CAAC,GAAa,EAAE,CAAC,CACxD;AACH","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { ToolbarAction } from '../../../shared/toolbar-action';
|
|
2
|
-
import { type PuckContentModelInput } from '../content-model';
|
|
1
|
+
import type { ToolbarAction } from '../../../shared/toolbar-action.js';
|
|
2
|
+
import { type PuckContentModelInput } from '../content-model.js';
|
|
3
|
+
import { type PuckDictionaryOverrides } from '../dictionaries.js';
|
|
3
4
|
type PuckSmartActionsContext = {
|
|
4
5
|
lang: string;
|
|
5
6
|
labels: {
|
|
@@ -7,7 +8,12 @@ type PuckSmartActionsContext = {
|
|
|
7
8
|
newPage: string;
|
|
8
9
|
};
|
|
9
10
|
contentModel?: PuckContentModelInput;
|
|
11
|
+
/** Current JSON:API resource type; null means there is no current node. */
|
|
12
|
+
nodeType?: string | null;
|
|
13
|
+
/** Editor UI locale for the action messages; falls back to lang. */
|
|
14
|
+
editorLocale?: string;
|
|
15
|
+
/** Per-section overrides merged over the resolved Puck dictionary. */
|
|
16
|
+
dictionaryOverrides?: PuckDictionaryOverrides;
|
|
10
17
|
};
|
|
11
|
-
export declare function createPuckSmartActions({ lang, labels, contentModel, }: PuckSmartActionsContext): ToolbarAction[];
|
|
18
|
+
export declare function createPuckSmartActions({ lang, labels, contentModel, nodeType, editorLocale, dictionaryOverrides, }: PuckSmartActionsContext): ToolbarAction[];
|
|
12
19
|
export {};
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|