@nodehive/nextjs 0.1.3 → 0.2.1
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/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 +7 -6
- 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/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 +46 -31
- 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/scroll-area.d.ts +8 -0
- package/dist/puck-editor/internal/ui/scroll-area.js +160 -0
- package/dist/puck-editor/internal/ui/scroll-area.js.map +1 -0
- 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/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 +20 -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"puck-editor.js","names":["c","_c","usePathname","Puck","toast","getBundle","usePuckContentModel","usePuckEditorConfig","RequiredFieldLabel","usePuckDictionary","createAgentPlugin","createBlocksPlugin","createOutlinePlugin","createSectionsPlugin","createTemplatesPlugin","stripTemplateVehicles","useTemplateDnd","CanvasQuickAdd","ComponentItem","EditorActionBar","EditorHeaderActions","findMissingRequiredFields","publishPuckData","SectionTemplateModalHost","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","isRelative","url","RegExp","test","getDefaultPageSettings","node","drupalBaseUrl","meta","metadataImage","image","mediaImage","field_media_image","firstMediaImage","Array","isArray","title","metadataTitle","metadataDescription","description","id","type","name","thumbnailImage","uri","publishedState","status","urlAlias","path","alias","PuckEditor","t0","$","fieldName","data","config","closePuckEditor","plugins","customizePlugins","overrides","projectOverrides","nodeData","lang","langcode","pathName","tEditor","editor","t1","undefined","model","configWithTemplates","onAction","captureDispatch","t2","metadataFields","bundles","t3","defaultPageSettings","t4","root","props","rootProps","t5","t6","t7","t8","t9","editorData","t10","pageSaved","requiredFieldsMissing","savePageFailed","rawData","data_0","rootProps_0","t11","t12","t13","t14","t15","t16","contentRootProps","missing","length","error","map","_temp","join","puckData","pageSettings","published","nodeId","messages","saved","saveFailed","onSave","agentTab","blocksTab","outlineTab","sectionsTab","templatesTab","defaultPlugins","label","puck","_temp2","drawerItem","_temp3","fieldLabel","_temp4","actionBar","_temp5","headerActions","children","children_0","m","componentLabel"],"sources":["../../../../src/puck-editor/internal/editor/puck-editor.tsx"],"sourcesContent":["'use client';\n\nimport { usePathname } from 'next/navigation';\nimport { Config, Data, Overrides, Plugin, Puck } from '@puckeditor/core';\nimport { toast } from 'sonner';\n\nimport { getBundle, type ResolvedPuckBundle } from '../content-model';\nimport { usePuckContentModel, usePuckEditorConfig } from '../editor-config';\nimport { RequiredFieldLabel } from '../fields/required-field-label';\nimport { usePuckDictionary } from '../i18n';\nimport { createAgentPlugin } from '../plugins/agent-plugin';\nimport { createBlocksPlugin } from '../plugins/blocks-plugin';\nimport { createOutlinePlugin } from '../plugins/outline-plugin';\nimport { createSectionsPlugin } from '../plugins/sections-plugin';\nimport {\n createTemplatesPlugin,\n stripTemplateVehicles,\n useTemplateDnd,\n} from '../plugins/templates-plugin';\nimport { PuckNode } from '../puck-node';\nimport { CanvasQuickAdd } from './canvas-quick-add';\nimport ComponentItem from './component-item';\nimport { EditorActionBar } from './editor-action-bar';\nimport { EditorHeaderActions } from './editor-header-actions';\nimport { findMissingRequiredFields } from './find-missing-required-fields';\nimport { publishPuckData } from './publish-puck-data';\nimport { SectionTemplateModalHost } from './section-template-modal';\n\nimport '@puckeditor/core/no-external.css';\n\nfunction isRelative(url: string) {\n return !new RegExp('^(?:[a-z]+:)?//', 'i').test(url);\n}\n\ntype PuckEditorProps = {\n node: PuckNode;\n fieldName: string;\n data: Partial<Data>;\n config: Config;\n closePuckEditor: () => void;\n plugins?: (defaultPlugins: Plugin[]) => Plugin[];\n overrides?: Partial<Overrides>;\n};\n\ntype PuckPageSettings = {\n title: string;\n metadataTitle: string;\n metadataDescription: string;\n metadataImage: {\n id?: string;\n type?: string;\n name?: string;\n thumbnailImage?: string;\n } | null;\n publishedState: 'published' | 'unpublished';\n urlAlias: string;\n};\n\ntype PuckRootProps = Record<string, unknown> & Partial<PuckPageSettings>;\n\nfunction getDefaultPageSettings(\n node: PuckNode,\n drupalBaseUrl: string,\n meta: ResolvedPuckBundle['metadataFields']\n): PuckPageSettings {\n const metadataImage = meta.image\n ? (node?.[meta.image] as PuckNode['field_metadata_image'])\n : null;\n const mediaImage = metadataImage?.field_media_image;\n const firstMediaImage = Array.isArray(mediaImage)\n ? mediaImage[0]\n : mediaImage;\n\n return {\n title: node?.title || '',\n metadataTitle: (meta.title && (node?.[meta.title] as string)) || '',\n metadataDescription:\n (meta.description && (node?.[meta.description] as string)) || '',\n metadataImage: metadataImage?.id\n ? {\n id: metadataImage.id,\n type: metadataImage.type || 'media--image',\n name: metadataImage.name || '',\n thumbnailImage: firstMediaImage?.uri?.url\n ? isRelative(firstMediaImage.uri.url)\n ? `${drupalBaseUrl}${firstMediaImage.uri.url}`\n : firstMediaImage.uri.url\n : '',\n }\n : null,\n publishedState: node?.status ? 'published' : 'unpublished',\n urlAlias: node?.path?.alias || '',\n };\n}\n\nexport default function PuckEditor({\n node,\n fieldName,\n data,\n config,\n closePuckEditor,\n plugins: customizePlugins,\n overrides: projectOverrides,\n}: PuckEditorProps) {\n const nodeData = node;\n const lang = nodeData?.langcode;\n const pathName = usePathname();\n const tEditor = usePuckDictionary().editor;\n const { drupalBaseUrl = '' } = usePuckEditorConfig();\n const model = usePuckContentModel();\n\n const { configWithTemplates, onAction, captureDispatch } =\n useTemplateDnd(config);\n\n const metadataFields =\n getBundle(model, nodeData?.type)?.metadataFields ??\n model.bundles[0].metadataFields;\n const defaultPageSettings = getDefaultPageSettings(\n nodeData,\n drupalBaseUrl,\n metadataFields\n );\n const rootProps = (data?.root?.props || {}) as PuckRootProps;\n const editorData: Partial<Data> = {\n ...data,\n root: {\n ...(data?.root || {}),\n props: {\n ...defaultPageSettings,\n ...rootProps,\n } as unknown as Data['root']['props'],\n },\n };\n\n const onSave = async (rawData: Partial<Data>) => {\n const data = stripTemplateVehicles(rawData);\n const rootProps = (data?.root?.props || {}) as PuckRootProps;\n const {\n title = '',\n metadataTitle = '',\n metadataDescription = '',\n metadataImage = null,\n publishedState = 'unpublished',\n urlAlias = '',\n ...contentRootProps\n } = rootProps;\n\n if (publishedState === 'published') {\n const missing = findMissingRequiredFields(config, data);\n if (missing.length > 0) {\n toast.error(tEditor.requiredFieldsMissing, {\n description: missing\n .map((m) => `${m.componentLabel}: ${m.fieldLabel}`)\n .join(', '),\n });\n return;\n }\n }\n\n const puckData: Partial<Data> = {\n ...data,\n root: {\n ...(data?.root || {}),\n props: contentRootProps as Data['root']['props'],\n },\n };\n\n await publishPuckData({\n data: puckData,\n pageSettings: {\n title,\n metadataTitle,\n metadataDescription,\n metadataImage,\n published: publishedState === 'published',\n urlAlias,\n },\n fieldName,\n nodeId: nodeData.id,\n path: pathName,\n type: nodeData?.type,\n lang,\n messages: {\n saved: tEditor.pageSaved,\n saveFailed: tEditor.savePageFailed,\n },\n });\n };\n\n const defaultPlugins = [\n createSectionsPlugin({ label: tEditor.sectionsTab }),\n createBlocksPlugin({ label: tEditor.blocksTab }),\n createTemplatesPlugin({ label: tEditor.templatesTab }),\n createOutlinePlugin({ label: tEditor.outlineTab }),\n createAgentPlugin({\n config,\n lang,\n onSave,\n label: tEditor.agentTab,\n }),\n ];\n const plugins = customizePlugins\n ? customizePlugins(defaultPlugins)\n : defaultPlugins;\n\n const overrides: Partial<Overrides> = {\n puck: ({ children }) => (\n <>\n {children}\n <CanvasQuickAdd />\n <SectionTemplateModalHost />\n </>\n ),\n drawerItem: ({ name }) => <ComponentItem name={name} />,\n fieldLabel: (props) => <RequiredFieldLabel {...props} />,\n actionBar: ({ children, label }) => (\n <EditorActionBar label={label}>{children}</EditorActionBar>\n ),\n headerActions: () => (\n <EditorHeaderActions\n onSave={onSave}\n onClose={closePuckEditor}\n captureDispatch={captureDispatch}\n />\n ),\n ...projectOverrides,\n };\n\n return (\n <Puck\n config={configWithTemplates}\n data={editorData}\n plugins={plugins}\n onAction={onAction}\n overrides={overrides}\n ></Puck>\n );\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAEb,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAA0CC,IAAI,QAAQ,kBAAkB;AACxE,SAASC,KAAK,QAAQ,QAAQ;AAE9B,SAASC,SAAS,QAAiC,kBAAkB;AACrE,SAASC,mBAAmB,EAAEC,mBAAmB,QAAQ,kBAAkB;AAC3E,SAASC,kBAAkB,QAAQ,gCAAgC;AACnE,SAASC,iBAAiB,QAAQ,SAAS;AAC3C,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,mBAAmB,QAAQ,2BAA2B;AAC/D,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SACEC,qBAAqB,EACrBC,qBAAqB,EACrBC,cAAc,QACT,6BAA6B;AAEpC,SAASC,cAAc,QAAQ,oBAAoB;AACnD,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,yBAAyB,QAAQ,gCAAgC;AAC1E,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,wBAAwB,QAAQ,0BAA0B;AAEnE,OAAO,kCAAkC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE1C,SAASC,UAAUA,CAACC,GAAW,EAAE;EAC/B,OAAO,CAAC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,IAAAjF,EAAY;EAAA,oBACjB/B,KAAA,CAAAF,SAAA;IAAAkH,QAAA,GACGA,QAAQ,eACTpH,IAAA,CAACR,cAAc,IAAE,CAAC,eAClBQ,IAAA,CAACF,wBAAwB,IAAE,CAAC;EAAA,CAC5B,CAAC;AAAA;AApHM,SAAA4F,MAAA4B,CAAA;EAAA,OAyDS,GAAGA,CAAC,CAAAC,cAAe,KAAKD,CAAC,CAAAP,UAAW,EAAE;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"puck-editor.js","names":["c","_c","useState","usePathname","Puck","toast","getBundle","mediaEntityType","usePuckContentModel","usePuckEditorConfig","usePuckPropTransforms","RequiredFieldLabel","usePuckDictionary","createAgentPlugin","createBlocksPlugin","createOutlinePlugin","createSectionsPlugin","createTemplatesPlugin","stripTemplateVehicles","useTemplateDnd","CanvasQuickAdd","ComponentItem","composeSaveIssues","DraftRestoreBanner","buildDraftKey","clearDraft","getLocalStorage","EditorActionBar","EditorHeaderActions","publishPuckData","createSaveGuard","SavePageProvider","SectionTemplateModalHost","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","isRelative","url","RegExp","test","getDefaultPageSettings","node","drupalBaseUrl","meta","media","metadataImage","image","mediaImage","imageFileField","firstMediaImage","Array","isArray","title","metadataTitle","metadataDescription","description","id","type","imageType","name","thumbnailImage","uri","publishedState","status","urlAlias","path","alias","PuckEditor","t0","$","fieldName","data","config","closePuckEditor","plugins","customizePlugins","overrides","projectOverrides","onAction","projectOnAction","validate","puckProps","nodeData","lang","langcode","pathName","tEditor","editor","t1","undefined","propTransforms","model","configWithTemplates","templateDndOnAction","captureDispatch","t2","action","appState","prevAppState","t3","metadataFields","bundles","t4","defaultPageSettings","t5","root","props","rootProps","t6","t7","t8","t9","t10","editorData","savedVersion","setSavedVersion","savedData","setSavedData","draftIdentity","nodeId","discardDraft","runSave","rawData","data_0","rootProps_0","t11","t12","t13","t14","t15","t16","contentRootProps","requiredIssues","customIssues","blocked","map","_temp","_temp2","join","title_0","length","requiredFieldsMissing","validationFailed","error","ok","puckData","result","pageSettings","published","messages","saved","pageSaved","saveFailed","savePageFailed","sessionExpired","_temp3","t17","saveInProgress","saveGuard","onSave","data_1","save","defaultPlugins","label","sectionsTab","blocksTab","templatesTab","outlineTab","agentTab","t18","t19","children","t20","t21","puck","drawerItem","_temp4","fieldLabel","_temp5","actionBar","_temp6","headerActions","t22","t23","children_0","version","m_0","m","componentLabel","message"],"sources":["../../../../src/puck-editor/internal/editor/puck-editor.tsx"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { usePathname } from 'next/navigation';\nimport { Config, Data, Overrides, Plugin, Puck } from '@puckeditor/core';\nimport { toast } from 'sonner';\n\nimport {\n getBundle,\n mediaEntityType,\n type PuckMediaConfig,\n type ResolvedPuckBundle,\n} from '../content-model.ts';\nimport {\n usePuckContentModel,\n usePuckEditorConfig,\n usePuckPropTransforms,\n} from '../editor-config.tsx';\nimport { RequiredFieldLabel } from '../fields/required-field-label.tsx';\nimport { usePuckDictionary } from '../i18n.tsx';\nimport { createAgentPlugin } from '../plugins/agent-plugin/index.ts';\nimport { createBlocksPlugin } from '../plugins/blocks-plugin/index.ts';\nimport { createOutlinePlugin } from '../plugins/outline-plugin/index.ts';\nimport { createSectionsPlugin } from '../plugins/sections-plugin/index.ts';\nimport {\n createTemplatesPlugin,\n stripTemplateVehicles,\n useTemplateDnd,\n} from '../plugins/templates-plugin/index.ts';\nimport { PuckNode } from '../puck-node.ts';\nimport type {\n PuckOnAction,\n PuckPassthroughProps,\n PuckValidate,\n} from '../puck-props.ts';\nimport { CanvasQuickAdd } from './canvas-quick-add.tsx';\nimport ComponentItem from './component-item.tsx';\nimport { composeSaveIssues } from './compose-save-issues.ts';\nimport { DraftRestoreBanner } from './draft-restore-banner.tsx';\nimport { buildDraftKey, clearDraft, getLocalStorage } from './draft-storage.ts';\nimport { EditorActionBar } from './editor-action-bar.tsx';\nimport { EditorHeaderActions } from './editor-header-actions.tsx';\nimport { publishPuckData } from './publish-puck-data.ts';\nimport { createSaveGuard, PuckSaveHandler } from './save-guard.ts';\nimport { SavePageProvider } from './save-page-context.tsx';\nimport { SectionTemplateModalHost } from './section-template-modal.tsx';\n\nimport '@puckeditor/core/no-external.css';\n\nfunction isRelative(url: string) {\n return !new RegExp('^(?:[a-z]+:)?//', 'i').test(url);\n}\n\ntype PuckEditorProps = {\n node: PuckNode;\n fieldName: string;\n data: Partial<Data>;\n config: Config;\n closePuckEditor: () => void;\n plugins?: (defaultPlugins: Plugin[]) => Plugin[];\n overrides?: Partial<Overrides>;\n onAction?: PuckOnAction;\n validate?: PuckValidate;\n puckProps?: PuckPassthroughProps;\n};\n\ntype PuckPageSettings = {\n title: string;\n metadataTitle: string;\n metadataDescription: string;\n metadataImage: {\n id?: string;\n type?: string;\n name?: string;\n thumbnailImage?: string;\n } | null;\n publishedState: 'published' | 'unpublished';\n urlAlias: string;\n};\n\ntype PuckRootProps = Record<string, unknown> & Partial<PuckPageSettings>;\n\nfunction getDefaultPageSettings(\n node: PuckNode,\n drupalBaseUrl: string,\n meta: ResolvedPuckBundle['metadataFields'],\n media: PuckMediaConfig\n): PuckPageSettings {\n const metadataImage = meta.image\n ? (node?.[meta.image] as PuckNode['field_metadata_image'])\n : null;\n const mediaImage = (metadataImage as Record<string, unknown> | null)?.[\n media.imageFileField\n ] as\n { uri?: { url?: string } } | Array<{ uri?: { url?: string } }> | undefined;\n const firstMediaImage = Array.isArray(mediaImage)\n ? mediaImage[0]\n : mediaImage;\n\n return {\n title: node?.title || '',\n metadataTitle: (meta.title && (node?.[meta.title] as string)) || '',\n metadataDescription:\n (meta.description && (node?.[meta.description] as string)) || '',\n metadataImage: metadataImage?.id\n ? {\n id: metadataImage.id,\n type: metadataImage.type || mediaEntityType(media.imageType),\n name: metadataImage.name || '',\n thumbnailImage: firstMediaImage?.uri?.url\n ? isRelative(firstMediaImage.uri.url)\n ? `${drupalBaseUrl}${firstMediaImage.uri.url}`\n : firstMediaImage.uri.url\n : '',\n }\n : null,\n publishedState: node?.status ? 'published' : 'unpublished',\n urlAlias: node?.path?.alias || '',\n };\n}\n\nexport default function PuckEditor({\n node,\n fieldName,\n data,\n config,\n closePuckEditor,\n plugins: customizePlugins,\n overrides: projectOverrides,\n onAction: projectOnAction,\n validate,\n puckProps,\n}: PuckEditorProps) {\n const nodeData = node;\n const lang = nodeData?.langcode;\n const pathName = usePathname();\n const tEditor = usePuckDictionary().editor;\n const { drupalBaseUrl = '' } = usePuckEditorConfig();\n const propTransforms = usePuckPropTransforms();\n const model = usePuckContentModel();\n\n const {\n configWithTemplates,\n onAction: templateDndOnAction,\n captureDispatch,\n } = useTemplateDnd(config);\n\n const onAction: PuckOnAction = (action, appState, prevAppState) => {\n templateDndOnAction(action);\n projectOnAction?.(action, appState, prevAppState);\n };\n\n const metadataFields =\n getBundle(model, nodeData?.type)?.metadataFields ??\n model.bundles[0].metadataFields;\n const defaultPageSettings = getDefaultPageSettings(\n nodeData,\n drupalBaseUrl,\n metadataFields,\n model.media\n );\n const rootProps = (data?.root?.props || {}) as PuckRootProps;\n const editorData: Partial<Data> = {\n ...data,\n root: {\n ...(data?.root || {}),\n props: {\n ...defaultPageSettings,\n ...rootProps,\n } as unknown as Data['root']['props'],\n },\n };\n\n const [savedVersion, setSavedVersion] = useState(0);\n const [savedData, setSavedData] = useState<Partial<Data>>(editorData);\n\n const draftIdentity = { nodeId: nodeData.id, fieldName, lang: lang ?? '' };\n const discardDraft = () => {\n clearDraft(getLocalStorage(), buildDraftKey(draftIdentity));\n };\n\n const runSave: PuckSaveHandler = async (rawData) => {\n const data = stripTemplateVehicles(rawData);\n const rootProps = (data?.root?.props || {}) as PuckRootProps;\n const {\n title = '',\n metadataTitle = '',\n metadataDescription = '',\n metadataImage = null,\n publishedState = 'unpublished',\n urlAlias = '',\n ...contentRootProps\n } = rootProps;\n\n const { requiredIssues, customIssues, blocked } = composeSaveIssues({\n config,\n data,\n model,\n validate,\n });\n\n if (blocked) {\n const description = [\n ...requiredIssues.map((m) => `${m.componentLabel}: ${m.fieldLabel}`),\n ...customIssues.map(\n (m) => `${m.componentLabel}: ${m.fieldLabel} (${m.message})`\n ),\n ].join(', ');\n const title =\n requiredIssues.length > 0\n ? tEditor.requiredFieldsMissing\n : tEditor.validationFailed;\n toast.error(title, { description });\n return { ok: false, error: 'validation failed' };\n }\n\n const puckData: Partial<Data> = {\n ...data,\n root: {\n ...(data?.root || {}),\n props: contentRootProps as Data['root']['props'],\n },\n };\n\n const result = await publishPuckData({\n data: puckData,\n pageSettings: {\n title,\n metadataTitle,\n metadataDescription,\n metadataImage,\n published: publishedState === 'published',\n urlAlias,\n },\n fieldName,\n nodeId: nodeData.id,\n path: pathName,\n type: nodeData?.type,\n lang,\n messages: {\n saved: tEditor.pageSaved,\n saveFailed: tEditor.savePageFailed,\n sessionExpired: tEditor.sessionExpired,\n },\n });\n\n if (result.ok) {\n setSavedData(rawData);\n discardDraft();\n setSavedVersion((version) => version + 1);\n }\n return result;\n };\n\n const [saveGuard] = useState(() => createSaveGuard(tEditor.saveInProgress));\n const onSave: PuckSaveHandler = (data) => saveGuard.save(runSave, data);\n\n const defaultPlugins = [\n createSectionsPlugin({ label: tEditor.sectionsTab }),\n createBlocksPlugin({ label: tEditor.blocksTab }),\n createTemplatesPlugin({ label: tEditor.templatesTab }),\n createOutlinePlugin({ label: tEditor.outlineTab }),\n createAgentPlugin({\n config,\n lang,\n onSave,\n label: tEditor.agentTab,\n }),\n ];\n const plugins = customizePlugins\n ? customizePlugins(defaultPlugins)\n : defaultPlugins;\n\n const overrides: Partial<Overrides> = {\n puck: ({ children }) => (\n <>\n {children}\n <CanvasQuickAdd />\n <SectionTemplateModalHost />\n <DraftRestoreBanner\n identity={draftIdentity}\n serverData={savedData}\n config={config}\n propTransforms={propTransforms}\n />\n </>\n ),\n drawerItem: ({ name }) => <ComponentItem name={name} />,\n fieldLabel: (props) => <RequiredFieldLabel {...props} />,\n actionBar: ({ children, label }) => (\n <EditorActionBar label={label}>{children}</EditorActionBar>\n ),\n headerActions: () => (\n <EditorHeaderActions\n onSave={onSave}\n onClose={closePuckEditor}\n onDiscardDraft={discardDraft}\n captureDispatch={captureDispatch}\n savedVersion={savedVersion}\n />\n ),\n ...projectOverrides,\n };\n\n return (\n <SavePageProvider save={onSave}>\n <Puck\n {...puckProps}\n config={configWithTemplates}\n data={editorData}\n plugins={plugins}\n onAction={onAction}\n overrides={overrides}\n ></Puck>\n </SavePageProvider>\n );\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAEb,SAASC,QAAQ,QAAQ,OAAO;AAChC,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAA0CC,IAAI,QAAQ,kBAAkB;AACxE,SAASC,KAAK,QAAQ,QAAQ;AAE9B,SACEC,SAAS,EACTC,eAAe,QAGV,qBAAqB;AAC5B,SACEC,mBAAmB,EACnBC,mBAAmB,EACnBC,qBAAqB,QAChB,qBAAsB;AAC7B,SAASC,kBAAkB,QAAQ,mCAAoC;AACvE,SAASC,iBAAiB,QAAQ,YAAa;AAC/C,SAASC,iBAAiB,QAAQ,kCAAkC;AACpE,SAASC,kBAAkB,QAAQ,mCAAmC;AACtE,SAASC,mBAAmB,QAAQ,oCAAoC;AACxE,SAASC,oBAAoB,QAAQ,qCAAqC;AAC1E,SACEC,qBAAqB,EACrBC,qBAAqB,EACrBC,cAAc,QACT,sCAAsC;AAO7C,SAASC,cAAc,QAAQ,uBAAwB;AACvD,OAAOC,aAAa,MAAM,qBAAsB;AAChD,SAASC,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,kBAAkB,QAAQ,2BAA4B;AAC/D,SAASC,aAAa,EAAEC,UAAU,EAAEC,eAAe,QAAQ,oBAAoB;AAC/E,SAASC,eAAe,QAAQ,wBAAyB;AACzD,SAASC,mBAAmB,QAAQ,4BAA6B;AACjE,SAASC,eAAe,QAAQ,wBAAwB;AACxD,SAASC,eAAe,QAAyB,iBAAiB;AA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OAAAiH,GAAA;IAAAjH,CAAA,OAAAkH,GAAA;EAAA;IAAAA,GAAA,GAAAlH,CAAA;EAAA;EAAA,OATnBkH,GASmB;AAAA;AAjMR,SAAAH,OAAAhH,EAAA;EAwKC;IAAAuG,QAAA,EAAAa,UAAA;IAAArB;EAAA,IAAA/F,EAAmB;EAAA,oBAC7BrC,IAAA,CAACP,eAAe;IAAQ2I,KAAK,EAALA,KAAK;IAAAQ,QAAA,EAAGA;EAAQ,CAAkB,CAAC;AAAA;AAzKlD,SAAAO,OAAAxE,KAAA;EAAA,oBAuKY3E,IAAA,CAACvB,kBAAkB;IAAA,GAAKkG;EAAK,CAAG,CAAC;AAAA;AAvK7C,SAAAsE,OAAA5G,EAAA;EAsKE;IAAAT;EAAA,IAAAS,EAAQ;EAAA,oBAAKrC,IAAA,CAACb,aAAa;IAAOyC,IAAI,EAAJA;EAAI,CAAG,CAAC;AAAA;AAtK5C,SAAAgG,OAAA8B,OAAA;EAAA,OAgIoBA,OAAO,GAAG,CAAC;AAAA;AAhI/B,SAAAhD,OAAAiD,GAAA;EAAA,OAoFE,GAAGC,GAAC,CAAAC,cAAe,KAAKD,GAAC,CAAAV,UAAW,KAAKU,GAAC,CAAAE,OAAQ,GAAG;AAAA;AApFvD,SAAArD,MAAAmD,CAAA;EAAA,OAkFsB,GAAGA,CAAC,CAAAC,cAAe,KAAKD,CAAC,CAAAV,UAAW,EAAE;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Data } from '@puckeditor/core';
|
|
2
|
+
import type { PublishPuckDataResult } from './publish-puck-data.js';
|
|
3
|
+
export type PuckSaveHandler = (data: Partial<Data>) => Promise<PublishPuckDataResult>;
|
|
4
|
+
export type PuckSaveGuard = {
|
|
5
|
+
save: (run: PuckSaveHandler, data: Partial<Data>) => Promise<PublishPuckDataResult>;
|
|
6
|
+
isSaving: () => boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Single-flight guard shared by the header Save button and the agent bridge.
|
|
10
|
+
* The run function is supplied per call so callers always execute the latest
|
|
11
|
+
* closure. While a save is in flight a second call is rejected with `ok: false`
|
|
12
|
+
* instead of firing a parallel PATCH, so an older payload can never overwrite a
|
|
13
|
+
* newer one and the caller learns its save did not run.
|
|
14
|
+
*/
|
|
15
|
+
export declare function createSaveGuard(inProgressMessage: string): PuckSaveGuard;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single-flight guard shared by the header Save button and the agent bridge.
|
|
3
|
+
* The run function is supplied per call so callers always execute the latest
|
|
4
|
+
* closure. While a save is in flight a second call is rejected with `ok: false`
|
|
5
|
+
* instead of firing a parallel PATCH, so an older payload can never overwrite a
|
|
6
|
+
* newer one and the caller learns its save did not run.
|
|
7
|
+
*/
|
|
8
|
+
export function createSaveGuard(inProgressMessage) {
|
|
9
|
+
let inFlight = null;
|
|
10
|
+
const save = async (run, data) => {
|
|
11
|
+
if (inFlight) {
|
|
12
|
+
return {
|
|
13
|
+
ok: false,
|
|
14
|
+
error: inProgressMessage
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
const promise = Promise.resolve(run(data));
|
|
18
|
+
inFlight = promise;
|
|
19
|
+
try {
|
|
20
|
+
return await promise;
|
|
21
|
+
} finally {
|
|
22
|
+
inFlight = null;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
save,
|
|
27
|
+
isSaving: () => inFlight !== null
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=save-guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save-guard.js","names":["createSaveGuard","inProgressMessage","inFlight","save","run","data","ok","error","promise","Promise","resolve","isSaving"],"sources":["../../../../src/puck-editor/internal/editor/save-guard.ts"],"sourcesContent":["import type { Data } from '@puckeditor/core';\n\nimport type { PublishPuckDataResult } from './publish-puck-data.ts';\n\nexport type PuckSaveHandler = (\n data: Partial<Data>\n) => Promise<PublishPuckDataResult>;\n\nexport type PuckSaveGuard = {\n save: (\n run: PuckSaveHandler,\n data: Partial<Data>\n ) => Promise<PublishPuckDataResult>;\n isSaving: () => boolean;\n};\n\n/**\n * Single-flight guard shared by the header Save button and the agent bridge.\n * The run function is supplied per call so callers always execute the latest\n * closure. While a save is in flight a second call is rejected with `ok: false`\n * instead of firing a parallel PATCH, so an older payload can never overwrite a\n * newer one and the caller learns its save did not run.\n */\nexport function createSaveGuard(inProgressMessage: string): PuckSaveGuard {\n let inFlight: Promise<PublishPuckDataResult> | null = null;\n\n const save = async (run: PuckSaveHandler, data: Partial<Data>) => {\n if (inFlight) {\n return { ok: false, error: inProgressMessage };\n }\n const promise = Promise.resolve(run(data));\n inFlight = promise;\n try {\n return await promise;\n } finally {\n inFlight = null;\n }\n };\n\n return { save, isSaving: () => inFlight !== null };\n}\n"],"mappings":"AAgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,eAAeA,CAACC,iBAAyB,EAAiB;EACxE,IAAIC,QAA+C,GAAG,IAAI;EAE1D,MAAMC,IAAI,GAAG,MAAAA,CAAOC,GAAoB,EAAEC,IAAmB,KAAK;IAChE,IAAIH,QAAQ,EAAE;MACZ,OAAO;QAAEI,EAAE,EAAE,KAAK;QAAEC,KAAK,EAAEN;MAAkB,CAAC;IAChD;IACA,MAAMO,OAAO,GAAGC,OAAO,CAACC,OAAO,CAACN,GAAG,CAACC,IAAI,CAAC,CAAC;IAC1CH,QAAQ,GAAGM,OAAO;IAClB,IAAI;MACF,OAAO,MAAMA,OAAO;IACtB,CAAC,SAAS;MACRN,QAAQ,GAAG,IAAI;IACjB;EACF,CAAC;EAED,OAAO;IAAEC,IAAI;IAAEQ,QAAQ,EAAEA,CAAA,KAAMT,QAAQ,KAAK;EAAK,CAAC;AACpD","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { PuckSaveHandler } from './save-guard.js';
|
|
3
|
+
export type SavePage = PuckSaveHandler;
|
|
4
|
+
export declare function SavePageProvider({ save, children, }: {
|
|
5
|
+
save: SavePage;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
export declare function useSavePage(): SavePage;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
4
|
+
import { createContext, useContext } from 'react';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const SavePageContext = /*#__PURE__*/createContext(null);
|
|
7
|
+
export function SavePageProvider(t0) {
|
|
8
|
+
const $ = _c(3);
|
|
9
|
+
const {
|
|
10
|
+
save,
|
|
11
|
+
children
|
|
12
|
+
} = t0;
|
|
13
|
+
let t1;
|
|
14
|
+
if ($[0] !== children || $[1] !== save) {
|
|
15
|
+
t1 = /*#__PURE__*/_jsx(SavePageContext.Provider, {
|
|
16
|
+
value: save,
|
|
17
|
+
children: children
|
|
18
|
+
});
|
|
19
|
+
$[0] = children;
|
|
20
|
+
$[1] = save;
|
|
21
|
+
$[2] = t1;
|
|
22
|
+
} else {
|
|
23
|
+
t1 = $[2];
|
|
24
|
+
}
|
|
25
|
+
return t1;
|
|
26
|
+
}
|
|
27
|
+
export function useSavePage() {
|
|
28
|
+
const save = useContext(SavePageContext);
|
|
29
|
+
if (!save) {
|
|
30
|
+
throw new Error("useSavePage must be used within the Puck editor");
|
|
31
|
+
}
|
|
32
|
+
return save;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=save-page-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save-page-context.js","names":["c","_c","createContext","useContext","jsx","_jsx","SavePageContext","SavePageProvider","t0","$","save","children","t1","Provider","useSavePage","Error"],"sources":["../../../../src/puck-editor/internal/editor/save-page-context.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, useContext, type ReactNode } from 'react';\n\nimport type { PuckSaveHandler } from './save-guard.ts';\n\nexport type SavePage = PuckSaveHandler;\n\nconst SavePageContext = createContext<SavePage | null>(null);\n\nexport function SavePageProvider({\n save,\n children,\n}: {\n save: SavePage;\n children: ReactNode;\n}) {\n return (\n <SavePageContext.Provider value={save}>{children}</SavePageContext.Provider>\n );\n}\n\nexport function useSavePage(): SavePage {\n const save = useContext(SavePageContext);\n if (!save) {\n throw new Error('useSavePage must be used within the Puck editor');\n }\n return save;\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAEb,SAASC,aAAa,EAAEC,UAAU,QAAwB,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAMlE,MAAMC,eAAe,gBAAGJ,aAAa,CAAkB,IAAI,CAAC;AAE5D,OAAO,SAAAK,iBAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAR,EAAA;EAA0B;IAAAS,IAAA;IAAAC;EAAA,IAAAH,EAMhC;EAAA,IAAAI,EAAA;EAAA,IAAAH,CAAA,QAAAE,QAAA,IAAAF,CAAA,QAAAC,IAAA;IAEGE,EAAA,gBAAAP,IAAA,CAAAC,eAAA,CAAAO,QAAA;MAAiCH,KAAI,EAAJA,IAAI;MAAAC,QAAA,EAAGA;IAAQ,CAA2B,CAAC;IAAAF,CAAA,MAAAE,QAAA;IAAAF,CAAA,MAAAC,IAAA;IAAAD,CAAA,MAAAG,EAAA;EAAA;IAAAA,EAAA,GAAAH,CAAA;EAAA;EAAA,OAA5EG,EAA4E;AAAA;AAIhF,OAAO,SAAAE,YAAA;EACL,MAAAJ,IAAA,GAAaP,UAAU,CAACG,eAAe,CAAC;EACxC,IAAI,CAACI,IAAI;IACP,MAAM,IAAIK,KAAK,CAAC,iDAAiD,CAAC;EAAC;EACpE,OACML,IAAI;AAAA","ignoreList":[]}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
4
|
import { useSyncExternalStore } from 'react';
|
|
5
5
|
import { useQueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { TEMPLATES_QUERY_KEY } from
|
|
7
|
-
import ComponentTemplateModal from
|
|
6
|
+
import { TEMPLATES_QUERY_KEY } from "../editor-query-client.js";
|
|
7
|
+
import ComponentTemplateModal from "../plugins/templates-plugin/component-template-modal.js";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
let state = {
|
|
10
10
|
open: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"section-template-modal.js","names":["c","_c","useSyncExternalStore","useQueryClient","TEMPLATES_QUERY_KEY","ComponentTemplateModal","jsx","_jsx","state","open","content","listeners","Set","emit","forEach","listener","subscribe","add","delete","getSnapshot","setOpen","openSectionTemplateModal","SectionTemplateModalHost","$","queryClient","t0","invalidateQueries","queryKey","t1","category","onTemplateSaved"],"sources":["../../../../src/puck-editor/internal/editor/section-template-modal.tsx"],"sourcesContent":["'use client';\n\nimport { useSyncExternalStore } from 'react';\nimport { Content } from '@puckeditor/core';\nimport { useQueryClient } from '@tanstack/react-query';\n\nimport { TEMPLATES_QUERY_KEY } from '../editor-query-client';\nimport ComponentTemplateModal from '../plugins/templates-plugin/component-template-modal';\n\ntype ModalState = { open: boolean; content: Content | null };\n\nlet state: ModalState = { open: false, content: null };\nconst listeners = new Set<() => void>();\n\nconst emit = () => listeners.forEach((listener) => listener());\n\nconst subscribe = (listener: () => void) => {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n};\n\nconst getSnapshot = () => state;\n\nconst setOpen = (open: boolean) => {\n state = { ...state, open };\n emit();\n};\n\nexport function openSectionTemplateModal(content: Content) {\n state = { open: true, content };\n emit();\n}\n\nexport function SectionTemplateModalHost() {\n const { open, content } = useSyncExternalStore(\n subscribe,\n getSnapshot,\n getSnapshot\n );\n const queryClient = useQueryClient();\n\n return (\n <ComponentTemplateModal\n content={content}\n isOpen={open}\n setIsOpen={setOpen}\n category=\"section\"\n onTemplateSaved={() =>\n queryClient.invalidateQueries({ queryKey: [...TEMPLATES_QUERY_KEY] })\n }\n />\n );\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAEb,SAASC,oBAAoB,QAAQ,OAAO;AAE5C,SAASC,cAAc,QAAQ,uBAAuB;AAEtD,SAASC,mBAAmB,QAAQ,
|
|
1
|
+
{"version":3,"file":"section-template-modal.js","names":["c","_c","useSyncExternalStore","useQueryClient","TEMPLATES_QUERY_KEY","ComponentTemplateModal","jsx","_jsx","state","open","content","listeners","Set","emit","forEach","listener","subscribe","add","delete","getSnapshot","setOpen","openSectionTemplateModal","SectionTemplateModalHost","$","queryClient","t0","invalidateQueries","queryKey","t1","category","onTemplateSaved"],"sources":["../../../../src/puck-editor/internal/editor/section-template-modal.tsx"],"sourcesContent":["'use client';\n\nimport { useSyncExternalStore } from 'react';\nimport { Content } from '@puckeditor/core';\nimport { useQueryClient } from '@tanstack/react-query';\n\nimport { TEMPLATES_QUERY_KEY } from '../editor-query-client.ts';\nimport ComponentTemplateModal from '../plugins/templates-plugin/component-template-modal.tsx';\n\ntype ModalState = { open: boolean; content: Content | null };\n\nlet state: ModalState = { open: false, content: null };\nconst listeners = new Set<() => void>();\n\nconst emit = () => listeners.forEach((listener) => listener());\n\nconst subscribe = (listener: () => void) => {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n};\n\nconst getSnapshot = () => state;\n\nconst setOpen = (open: boolean) => {\n state = { ...state, open };\n emit();\n};\n\nexport function openSectionTemplateModal(content: Content) {\n state = { open: true, content };\n emit();\n}\n\nexport function SectionTemplateModalHost() {\n const { open, content } = useSyncExternalStore(\n subscribe,\n getSnapshot,\n getSnapshot\n );\n const queryClient = useQueryClient();\n\n return (\n <ComponentTemplateModal\n content={content}\n isOpen={open}\n setIsOpen={setOpen}\n category=\"section\"\n onTemplateSaved={() =>\n queryClient.invalidateQueries({ queryKey: [...TEMPLAT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CAAA,QAAAC,WAAA;IAQhBC,EAAA,GAAAA,CAAA,KACfD,WAAW,CAAAE,iBAAkB,CAAC;MAAAC,QAAA,EAAY,IAAIvB,mBAAmB;IAAE,CAAC,CAAC;IAAAmB,CAAA,MAAAC,WAAA;IAAAD,CAAA,MAAAE,EAAA;EAAA;IAAAA,EAAA,GAAAF,CAAA;EAAA;EAAA,IAAAK,EAAA;EAAA,IAAAL,CAAA,QAAAb,OAAA,IAAAa,CAAA,QAAAd,IAAA,IAAAc,CAAA,QAAAE,EAAA;IANzEG,EAAA,gBAAArB,IAAA,CAACF,sBAAsB;MACZK,OAAO,EAAPA,OAAO;MACRD,MAAI,EAAJA,IAAI;MACDW,SAAO,EAAPA,OAAO;MACTS,QAAS,EAAT,SAAS;MACDC,eACsD,EADtDL;IACsD,CAExE,CAAC;IAAAF,CAAA,MAAAb,OAAA;IAAAa,CAAA,MAAAd,IAAA;IAAAc,CAAA,MAAAE,EAAA;IAAAF,CAAA,MAAAK,EAAA;EAAA;IAAAA,EAAA,GAAAL,CAAA;EAAA;EAAA,OARFK,EAQE;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Config, type Data } from '@puckeditor/core';
|
|
2
|
+
import { type PuckPropTransforms } from '../content-model.js';
|
|
3
|
+
import { type DraftIdentity, type RestoreDecision } from './draft-storage.js';
|
|
4
|
+
export type DraftRecovery = {
|
|
5
|
+
decision: RestoreDecision;
|
|
6
|
+
restore: () => void;
|
|
7
|
+
discard: () => void;
|
|
8
|
+
quotaExceeded: boolean;
|
|
9
|
+
concurrentTab: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare function useDraftRecovery({ identity, serverData, config, propTransforms, }: {
|
|
12
|
+
identity: DraftIdentity;
|
|
13
|
+
serverData: Partial<Data>;
|
|
14
|
+
config: Config;
|
|
15
|
+
propTransforms?: PuckPropTransforms;
|
|
16
|
+
}): DraftRecovery;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
|
+
import { createUsePuck } from '@puckeditor/core';
|
|
6
|
+
import { parsePuckData } from "../content-model.js";
|
|
7
|
+
import { stripTemplateVehicles } from "../plugins/templates-plugin/index.js";
|
|
8
|
+
import { serializePuckData } from "./dirty-state.js";
|
|
9
|
+
import { buildDraftKey, clearDraft, createDraftRecord, evaluateDraft, getLocalStorage, hashSerialized, readDraft, writeDraft } from "./draft-storage.js";
|
|
10
|
+
const usePuck = createUsePuck();
|
|
11
|
+
const DEBOUNCE_MS = 1200;
|
|
12
|
+
function baselineOf(data) {
|
|
13
|
+
const serialized = serializePuckData(stripTemplateVehicles(data));
|
|
14
|
+
return {
|
|
15
|
+
serialized,
|
|
16
|
+
hash: hashSerialized(serialized)
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export function useDraftRecovery(t0) {
|
|
20
|
+
const $ = _c(33);
|
|
21
|
+
const {
|
|
22
|
+
identity,
|
|
23
|
+
serverData,
|
|
24
|
+
config,
|
|
25
|
+
propTransforms
|
|
26
|
+
} = t0;
|
|
27
|
+
const {
|
|
28
|
+
nodeId,
|
|
29
|
+
fieldName,
|
|
30
|
+
lang
|
|
31
|
+
} = identity;
|
|
32
|
+
const dispatch = usePuck(_temp);
|
|
33
|
+
const appData = usePuck(_temp2);
|
|
34
|
+
let t1;
|
|
35
|
+
if ($[0] !== identity) {
|
|
36
|
+
t1 = buildDraftKey(identity);
|
|
37
|
+
$[0] = identity;
|
|
38
|
+
$[1] = t1;
|
|
39
|
+
} else {
|
|
40
|
+
t1 = $[1];
|
|
41
|
+
}
|
|
42
|
+
const key = t1;
|
|
43
|
+
let t2;
|
|
44
|
+
if ($[2] !== serverData) {
|
|
45
|
+
t2 = () => baselineOf(serverData);
|
|
46
|
+
$[2] = serverData;
|
|
47
|
+
$[3] = t2;
|
|
48
|
+
} else {
|
|
49
|
+
t2 = $[3];
|
|
50
|
+
}
|
|
51
|
+
const [baseline] = useState(t2);
|
|
52
|
+
let t3;
|
|
53
|
+
if ($[4] !== key || $[5] !== serverData) {
|
|
54
|
+
t3 = () => evaluateDraft(readDraft(getLocalStorage(), key), stripTemplateVehicles(serverData));
|
|
55
|
+
$[4] = key;
|
|
56
|
+
$[5] = serverData;
|
|
57
|
+
$[6] = t3;
|
|
58
|
+
} else {
|
|
59
|
+
t3 = $[6];
|
|
60
|
+
}
|
|
61
|
+
const [decision, setDecision] = useState(t3);
|
|
62
|
+
const [quotaExceeded, setQuotaExceeded] = useState(false);
|
|
63
|
+
const [concurrentTab, setConcurrentTab] = useState(false);
|
|
64
|
+
let t4;
|
|
65
|
+
let t5;
|
|
66
|
+
if ($[7] !== appData || $[8] !== baseline || $[9] !== decision.restorable || $[10] !== fieldName || $[11] !== lang || $[12] !== nodeId) {
|
|
67
|
+
t4 = () => {
|
|
68
|
+
if (decision.restorable) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const stripped = stripTemplateVehicles(appData);
|
|
72
|
+
if (serializePuckData(stripped) === baseline.serialized) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const timer = setTimeout(() => {
|
|
76
|
+
const record = createDraftRecord({
|
|
77
|
+
identity: {
|
|
78
|
+
nodeId,
|
|
79
|
+
fieldName,
|
|
80
|
+
lang
|
|
81
|
+
},
|
|
82
|
+
data: stripped,
|
|
83
|
+
baselineHash: baseline.hash
|
|
84
|
+
});
|
|
85
|
+
const result = writeDraft(getLocalStorage(), record);
|
|
86
|
+
if (!result.ok) {
|
|
87
|
+
setQuotaExceeded(true);
|
|
88
|
+
}
|
|
89
|
+
}, DEBOUNCE_MS);
|
|
90
|
+
return () => clearTimeout(timer);
|
|
91
|
+
};
|
|
92
|
+
t5 = [appData, baseline, nodeId, fieldName, lang, decision.restorable];
|
|
93
|
+
$[7] = appData;
|
|
94
|
+
$[8] = baseline;
|
|
95
|
+
$[9] = decision.restorable;
|
|
96
|
+
$[10] = fieldName;
|
|
97
|
+
$[11] = lang;
|
|
98
|
+
$[12] = nodeId;
|
|
99
|
+
$[13] = t4;
|
|
100
|
+
$[14] = t5;
|
|
101
|
+
} else {
|
|
102
|
+
t4 = $[13];
|
|
103
|
+
t5 = $[14];
|
|
104
|
+
}
|
|
105
|
+
useEffect(t4, t5);
|
|
106
|
+
let t6;
|
|
107
|
+
let t7;
|
|
108
|
+
if ($[15] !== key) {
|
|
109
|
+
t6 = () => {
|
|
110
|
+
const onStorage = event => {
|
|
111
|
+
if (event.key === key && event.newValue) {
|
|
112
|
+
setConcurrentTab(true);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
window.addEventListener("storage", onStorage);
|
|
116
|
+
return () => window.removeEventListener("storage", onStorage);
|
|
117
|
+
};
|
|
118
|
+
t7 = [key];
|
|
119
|
+
$[15] = key;
|
|
120
|
+
$[16] = t6;
|
|
121
|
+
$[17] = t7;
|
|
122
|
+
} else {
|
|
123
|
+
t6 = $[16];
|
|
124
|
+
t7 = $[17];
|
|
125
|
+
}
|
|
126
|
+
useEffect(t6, t7);
|
|
127
|
+
let t8;
|
|
128
|
+
if ($[18] !== config || $[19] !== decision.record || $[20] !== decision.restorable || $[21] !== dispatch || $[22] !== nodeId || $[23] !== propTransforms) {
|
|
129
|
+
t8 = () => {
|
|
130
|
+
if (!decision.restorable) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
const restored = parsePuckData(JSON.stringify(decision.record.data), nodeId, propTransforms, config);
|
|
134
|
+
dispatch({
|
|
135
|
+
type: "setData",
|
|
136
|
+
data: restored,
|
|
137
|
+
recordHistory: true
|
|
138
|
+
});
|
|
139
|
+
setDecision({
|
|
140
|
+
restorable: false
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
$[18] = config;
|
|
144
|
+
$[19] = decision.record;
|
|
145
|
+
$[20] = decision.restorable;
|
|
146
|
+
$[21] = dispatch;
|
|
147
|
+
$[22] = nodeId;
|
|
148
|
+
$[23] = propTransforms;
|
|
149
|
+
$[24] = t8;
|
|
150
|
+
} else {
|
|
151
|
+
t8 = $[24];
|
|
152
|
+
}
|
|
153
|
+
const restore = t8;
|
|
154
|
+
let t9;
|
|
155
|
+
if ($[25] !== key) {
|
|
156
|
+
t9 = () => {
|
|
157
|
+
clearDraft(getLocalStorage(), key);
|
|
158
|
+
setDecision({
|
|
159
|
+
restorable: false
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
$[25] = key;
|
|
163
|
+
$[26] = t9;
|
|
164
|
+
} else {
|
|
165
|
+
t9 = $[26];
|
|
166
|
+
}
|
|
167
|
+
const discard = t9;
|
|
168
|
+
let t10;
|
|
169
|
+
if ($[27] !== concurrentTab || $[28] !== decision || $[29] !== discard || $[30] !== quotaExceeded || $[31] !== restore) {
|
|
170
|
+
t10 = {
|
|
171
|
+
decision,
|
|
172
|
+
restore,
|
|
173
|
+
discard,
|
|
174
|
+
quotaExceeded,
|
|
175
|
+
concurrentTab
|
|
176
|
+
};
|
|
177
|
+
$[27] = concurrentTab;
|
|
178
|
+
$[28] = decision;
|
|
179
|
+
$[29] = discard;
|
|
180
|
+
$[30] = quotaExceeded;
|
|
181
|
+
$[31] = restore;
|
|
182
|
+
$[32] = t10;
|
|
183
|
+
} else {
|
|
184
|
+
t10 = $[32];
|
|
185
|
+
}
|
|
186
|
+
return t10;
|
|
187
|
+
}
|
|
188
|
+
function _temp2(s_0) {
|
|
189
|
+
return s_0.appState.data;
|
|
190
|
+
}
|
|
191
|
+
function _temp(s) {
|
|
192
|
+
return s.dispatch;
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=use-draft-recovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-draft-recovery.js","names":["c","_c","useEffect","useState","createUsePuck","parsePuckData","stripTemplateVehicles","serializePuckData","buildDraftKey","clearDraft","createDraftRecord","evaluateDraft","getLocalStorage","hashSerialized","readDraft","writeDraft","usePuck","DEBOUNCE_MS","baselineOf","data","serialized","hash","useDraftRecovery","t0","$","identity","serverData","config","propTransforms","nodeId","fieldName","lang","dispatch","_temp","appData","_temp2","t1","key","t2","baseline","t3","decision","setDecision","quotaExceeded","setQuotaExceeded","concurrentTab","setConcurrentTab","t4","t5","restorable","stripped","timer","setTimeout","record","baselineHash","result","ok","clearTimeout","t6","t7","onStorage","event","newValue","window","addEventListener","removeEventListener","t8","restored","JSON","stringify","type","recordHistory","restore","t9","discard","t10","s_0","s","appState"],"sources":["../../../../src/puck-editor/internal/editor/use-draft-recovery.ts"],"sourcesContent":["'use client';\n\nimport { useEffect, useState } from 'react';\nimport { createUsePuck, type Config, type Data } from '@puckeditor/core';\n\nimport { parsePuckData, type PuckPropTransforms } from '../content-model.ts';\nimport { stripTemplateVehicles } from '../plugins/templates-plugin/index.ts';\nimport { serializePuckData } from './dirty-state.ts';\nimport {\n buildDraftKey,\n clearDraft,\n createDraftRecord,\n evaluateDraft,\n getLocalStorage,\n hashSerialized,\n readDraft,\n writeDraft,\n type DraftIdentity,\n type RestoreDecision,\n} from './draft-storage.ts';\n\nconst usePuck = createUsePuck();\n\nconst DEBOUNCE_MS = 1200;\n\ntype Baseline = { serialized: string; hash: string };\n\nfunction baselineOf(data: Partial<Data>): Baseline {\n const serialized = serializePuckData(stripTemplateVehicles(data));\n return { serialized, hash: hashSerialized(serialized) };\n}\n\nexport type DraftRecovery = {\n decision: RestoreDecision;\n restore: () => void;\n discard: () => void;\n quotaExceeded: boolean;\n concurrentTab: boolean;\n};\n\nexport function useDraftRecovery({\n identity,\n serverData,\n config,\n propTransforms,\n}: {\n identity: DraftIdentity;\n serverData: Partial<Data>;\n config: Config;\n propTransforms?: PuckPropTransforms;\n}): DraftRecovery {\n const { nodeId, fieldName, lang } = identity;\n const dispatch = usePuck((s) => s.dispatch);\n const appData = usePuck((s) => s.appState.data);\n\n const key = buildDraftKey(identity);\n\n const [baseline] = useState<Baseline>(() => baselineOf(serverData));\n const [decision, setDecision] = useState<RestoreDecision>(() =>\n evaluateDraft(\n readDraft(getLocalStorage(), key),\n stripTemplateVehicles(serverData)\n )\n );\n const [quotaExceeded, setQuotaExceeded] = useState(false);\n const [concurrentTab, setConcurrentTab] = useState(false);\n\n useEffect(() => {\n if (decision.restorable) return;\n const stripped = stripTemplateVehicles(appData);\n if (serializePuckData(stripped) === baseline.serialized) return;\n const timer = setTimeout(() => {\n const record = createDraftRecord({\n identity: { nodeId, fieldName, lang },\n data: stripped,\n baselineHash: baseline.hash,\n });\n const result = writeDraft(getLocalStorage(), record);\n if (!result.ok) setQuotaExceeded(true);\n }, DEBOUNCE_MS);\n return () => clearTimeout(timer);\n }, [appData, baseline, nodeId, fieldName, lang, decision.restorable]);\n\n useEffect(() => {\n // The storage event never fires in the writing tab, so any write to our\n // key comes from another tab editing the same entity.\n const onStorage = (event: StorageEvent) => {\n if (event.key === key && event.newValue) setConcurrentTab(true);\n };\n window.addEventListener('storage', onStorage);\n return () => window.removeEventListener('storage', onStorage);\n }, [key]);\n\n const restore = () => {\n if (!decision.restorable) return;\n const restored = parsePuckData(\n JSON.stringify(decision.record.data),\n nodeId,\n propTransforms,\n config\n );\n dispatch({ type: 'setData', data: restored, recordHistory: true });\n setDecision({ restorable: false });\n };\n\n const discard = () => {\n clearDraft(getLocalStorage(), key);\n setDecision({ restorable: false });\n };\n\n return { decision, restore, discard, quotaExceeded, concurrentTab };\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAEb,SAASC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,aAAa,QAAgC,kBAAkB;AAExE,SAASC,aAAa,QAAiC,qBAAqB;AAC5E,SAASC,qBAAqB,QAAQ,sCAAsC;AAC5E,SAASC,iBAAiB,QAAQ,kBAAkB;AACpD,SACEC,aAAa,EACbC,UAAU,EACVC,iBAAiB,EACjBC,aAAa,EACbC,eAAe,EACfC,cAAc,EACdC,SAAS,EACTC,U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A,GAAgBD,EAGf;EAAC,IAAAE,GAAA;EAAA,IAAAnD,CAAA,SAAAqB,aAAA,IAAArB,CAAA,SAAAiB,QAAA,IAAAjB,CAAA,SAAAkD,OAAA,IAAAlD,CAAA,SAAAmB,aAAA,IAAAnB,CAAA,SAAAgD,OAAA;IAEKG,GAAA;MAAAlC,QAAA;MAAA+B,OAAA;MAAAE,OAAA;MAAA/B,aAAA;MAAAE;IAA2D,CAAC;IAAArB,CAAA,OAAAqB,aAAA;IAAArB,CAAA,OAAAiB,QAAA;IAAAjB,CAAA,OAAAkD,OAAA;IAAAlD,CAAA,OAAAmB,aAAA;IAAAnB,CAAA,OAAAgD,OAAA;IAAAhD,CAAA,OAAAmD,GAAA;EAAA;IAAAA,GAAA,GAAAnD,CAAA;EAAA;EAAA,OAA5DmD,GAA4D;AAAA;AAtE9D,SAAAxC,OAAAyC,GAAA;EAAA,OAa0BC,GAAC,CAAAC,QAAS,CAAA3D,IAAK;AAAA;AAbzC,SAAAc,MAAA4C,CAAA;EAAA,OAY2BA,CAAC,CAAA7C,QAAS;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useIsDirty(savedVersion: number): boolean;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { createUsePuck } from '@puckeditor/core';
|
|
6
|
+
import { stripTemplateVehicles } from "../plugins/templates-plugin/index.js";
|
|
7
|
+
import { serializePuckData } from "./dirty-state.js";
|
|
8
|
+
const usePuck = createUsePuck();
|
|
9
|
+
export function useIsDirty(savedVersion) {
|
|
10
|
+
const $ = _c(2);
|
|
11
|
+
const appState = usePuck(_temp);
|
|
12
|
+
let t0;
|
|
13
|
+
if ($[0] !== appState.data) {
|
|
14
|
+
t0 = serializePuckData(stripTemplateVehicles(appState.data));
|
|
15
|
+
$[0] = appState.data;
|
|
16
|
+
$[1] = t0;
|
|
17
|
+
} else {
|
|
18
|
+
t0 = $[1];
|
|
19
|
+
}
|
|
20
|
+
const current = t0;
|
|
21
|
+
const [baseline, setBaseline] = useState(current);
|
|
22
|
+
const [seenVersion, setSeenVersion] = useState(savedVersion);
|
|
23
|
+
if (savedVersion !== seenVersion) {
|
|
24
|
+
setSeenVersion(savedVersion);
|
|
25
|
+
setBaseline(current);
|
|
26
|
+
}
|
|
27
|
+
return current !== baseline;
|
|
28
|
+
}
|
|
29
|
+
function _temp(s) {
|
|
30
|
+
return s.appState;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=use-is-dirty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-is-dirty.js","names":["c","_c","useState","createUsePuck","stripTemplateVehicles","serializePuckData","usePuck","useIsDirty","savedVersion","$","appState","_temp","t0","data","current","baseline","setBaseline","seenVersion","setSeenVersion","s"],"sources":["../../../../src/puck-editor/internal/editor/use-is-dirty.ts"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { createUsePuck } from '@puckeditor/core';\n\nimport { stripTemplateVehicles } from '../plugins/templates-plugin/index.ts';\nimport { serializePuckData } from './dirty-state.ts';\n\nconst usePuck = createUsePuck();\n\nexport function useIsDirty(savedVersion: number): boolean {\n const appState = usePuck((s) => s.appState);\n const current = serializePuckData(stripTemplateVehicles(appState.data));\n const [baseline, setBaseline] = useState(current);\n const [seenVersion, setSeenVersion] = useState(savedVersion);\n\n if (savedVersion !== seenVersion) {\n setSeenVersion(savedVersion);\n setBaseline(current);\n }\n\n return current !== baseline;\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAEb,SAASC,QAAQ,QAAQ,OAAO;AAChC,SAASC,aAAa,QAAQ,kBAAkB;AAEhD,SAASC,qBAAqB,QAAQ,sCAAsC;AAC5E,SAASC,iBAAiB,QAAQ,kBAAkB;AAEpD,MAAMC,OAAO,GAAGH,aAAa,CAAC,CAAC;AAE/B,OAAO,SAAAI,WAAAC,YAAA;EAAA,MAAAC,CAAA,GAAAR,EAAA;EACL,MAAAS,QAAA,GAAiBJ,OAAO,CAACK,KAAiB,CAAC;EAAC,IAAAC,EAAA;EAAA,IAAAH,CAAA,QAAAC,QAAA,CAAAG,IAAA;IAC5BD,EAAA,GAAAP,iBAAiB,CAACD,qBAAqB,CAACM,QAAQ,CAAAG,IAAK,CAAC,CAAC;IAAAJ,CAAA,MAAAC,QAAA,CAAAG,IAAA;IAAAJ,CAAA,MAAAG,EAAA;EAAA;IAAAA,EAAA,GAAAH,CAAA;EAAA;EAAvE,MAAAK,OAAA,GAAgBF,EAAuD;EACvE,OAAAG,QAAA,EAAAC,WAAA,IAAgCd,QAAQ,CAACY,OAAO,CAAC;EACjD,OAAAG,WAAA,EAAAC,cAAA,IAAsChB,QAAQ,CAACM,YAAY,CAAC;EAE5D,IAAIA,YAAY,KAAKS,WAAW;IAC9BC,cAAc,CAACV,YAAY,CAAC;IAC5BQ,WAAW,CAACF,OAAO,CAAC;EAAA;EACrB,OAEMA,OAAO,KAAKC,QAAQ;AAAA;AAXtB,SAAAJ,MAAAQ,CAAA;EAAA,OAC2BA,CAAC,CAAAT,QAAS;AAAA","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import { type
|
|
3
|
-
import type
|
|
2
|
+
import { type PuckApiInjection } from './api/client.js';
|
|
3
|
+
import { type PuckContentModel, type PuckContentModelInput, type PuckPropTransforms } from './content-model.js';
|
|
4
|
+
import type { BuiltinTemplate } from './plugins/templates-plugin/templates.js';
|
|
4
5
|
export type PuckEditorConfig = {
|
|
5
6
|
/**
|
|
6
7
|
* Absolute Drupal base URL used to absolutize relative media URIs
|
|
@@ -14,6 +15,18 @@ export type PuckEditorConfig = {
|
|
|
14
15
|
*/
|
|
15
16
|
contentModel?: PuckContentModelInput;
|
|
16
17
|
builtinTemplates?: BuiltinTemplate[];
|
|
18
|
+
/**
|
|
19
|
+
* Prop migrations applied wherever stored Puck data enters the editor
|
|
20
|
+
* (page data and template inserts). Pass the same transforms to
|
|
21
|
+
* parsePuckData in the live-render path so both paths stay in sync.
|
|
22
|
+
*/
|
|
23
|
+
propTransforms?: PuckPropTransforms;
|
|
24
|
+
/**
|
|
25
|
+
* Overrides for the editor API calls (base path and/or fetch). Defaults to
|
|
26
|
+
* NEXT_PUBLIC_NODEHIVE_PUCK_API_BASE (or /api/puck) and the global fetch, so
|
|
27
|
+
* leaving this unset keeps the current behavior.
|
|
28
|
+
*/
|
|
29
|
+
api?: PuckApiInjection;
|
|
17
30
|
};
|
|
18
31
|
/**
|
|
19
32
|
* Mounted by PuckWrapper. Headless setups that use useMediaLibrary or
|
|
@@ -26,5 +39,5 @@ export declare function PuckEditorConfigProvider({ config, children, }: {
|
|
|
26
39
|
export declare function usePuckEditorConfig(): PuckEditorConfig;
|
|
27
40
|
/** Resolved content model; defaults apply without a provider (headless). */
|
|
28
41
|
export declare function usePuckContentModel(): PuckContentModel;
|
|
42
|
+
export declare function usePuckPropTransforms(): PuckPropTransforms | undefined;
|
|
29
43
|
export declare function useBuiltinTemplates(): BuiltinTemplate[];
|
|
30
|
-
//# sourceMappingURL=editor-config.d.ts.map
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
4
|
import { createContext, useContext } from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { configurePuckApi } from "./api/client.js";
|
|
6
|
+
import { resolveContentModel } from "./content-model.js";
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
const PuckEditorConfigContext = /*#__PURE__*/createContext({});
|
|
8
9
|
|
|
@@ -16,6 +17,9 @@ export function PuckEditorConfigProvider(t0) {
|
|
|
16
17
|
config,
|
|
17
18
|
children
|
|
18
19
|
} = t0;
|
|
20
|
+
if (typeof window !== "undefined") {
|
|
21
|
+
configurePuckApi(config.api);
|
|
22
|
+
}
|
|
19
23
|
let t1;
|
|
20
24
|
if ($[0] !== children || $[1] !== config) {
|
|
21
25
|
t1 = /*#__PURE__*/_jsx(PuckEditorConfigContext.Provider, {
|
|
@@ -50,6 +54,9 @@ export function usePuckContentModel() {
|
|
|
50
54
|
}
|
|
51
55
|
return t0;
|
|
52
56
|
}
|
|
57
|
+
export function usePuckPropTransforms() {
|
|
58
|
+
return useContext(PuckEditorConfigContext).propTransforms;
|
|
59
|
+
}
|
|
53
60
|
const NO_BUILTINS = [];
|
|
54
61
|
export function useBuiltinTemplates() {
|
|
55
62
|
return useContext(PuckEditorConfigContext).builtinTemplates ?? NO_BUILTINS;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-config.js","names":["c","_c","createContext","useContext","resolveContentModel","jsx","_jsx","PuckEditorConfigContext","PuckEditorConfigProvider","t0","$","config","children","t1","Provider","usePuckEditorConfig","usePuckContentModel","contentModel","NO_BUILTINS","useBuiltinTemplates","builtinTemplates"],"sources":["../../../src/puck-editor/internal/editor-config.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, useContext, type ReactNode } from 'react';\n\nimport {\n resolveContentModel,\n type PuckContentModel,\n type PuckContentModelInput,\n} from './content-model';\nimport type { BuiltinTemplate } from './plugins/templates-plugin/templates';\n\nexport type PuckEditorConfig = {\n /**\n * Absolute Drupal base URL used to absolutize relative media URIs\n * (thumbnails). Injected by the project instead of reading NEXT_PUBLIC_*\n * env in module code — env inlining is not guaranteed inside packages.\n */\n drupalBaseUrl?: string;\n /**\n * Drupal content-model overrides. Pass the same value to createPuckApi so\n * the editor UI and the publish validation stay in sync.\n */\n contentModel?: PuckContentModelInput;\n builtinTemplates?: BuiltinTemplate[];\n};\n\nconst PuckEditorConfigContext = createContext<PuckEditorConfig>({});\n\n/**\n * Mounted by PuckWrapper. Headless setups that use useMediaLibrary or\n * MediaSelectorField outside PuckWrapper mount this provider themselves.\n */\nexport function PuckEditorConfigProvider({\n config,\n children,\n}: {\n config: PuckEditorConfig;\n children: ReactNode;\n}) {\n return (\n <PuckEditorConfigContext.Provider value={config}>\n {children}\n </PuckEditorConfigContext.Provider>\n );\n}\n\nexport function usePuckEditorConfig(): PuckEditorConfig {\n return useContext(PuckEditorConfigContext);\n}\n\n/** Resolved content model; defaults apply without a provider (headless). */\nexport function usePuckContentModel(): PuckContentModel {\n const { contentModel } = useContext(PuckEditorConfigContext);\n return resolveContentModel(contentModel);\n}\n\nconst NO_BUILTINS: BuiltinTemplate[] = [];\n\nexport function useBuiltinTemplates(): BuiltinTemplate[] {\n return useContext(PuckEditorConfigContext).builtinTemplates ?? NO_BUILTINS;\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAEb,SAASC,aAAa,EAAEC,UAAU,QAAwB,OAAO;AAEjE,SACEC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"editor-config.js","names":["c","_c","createContext","useContext","configurePuckApi","resolveContentModel","jsx","_jsx","PuckEditorConfigContext","PuckEditorConfigProvider","t0","$","config","children","window","api","t1","Provider","usePuckEditorConfig","usePuckContentModel","contentModel","usePuckPropTransforms","propTransforms","NO_BUILTINS","useBuiltinTemplates","builtinTemplates"],"sources":["../../../src/puck-editor/internal/editor-config.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, useContext, type ReactNode } from 'react';\n\nimport { configurePuckApi, type PuckApiInjection } from './api/client.ts';\nimport {\n resolveContentModel,\n type PuckContentModel,\n type PuckContentModelInput,\n type PuckPropTransforms,\n} from './content-model.ts';\nimport type { BuiltinTemplate } from './plugins/templates-plugin/templates.ts';\n\nexport type PuckEditorConfig = {\n /**\n * Absolute Drupal base URL used to absolutize relative media URIs\n * (thumbnails). Injected by the project instead of reading NEXT_PUBLIC_*\n * env in module code — env inlining is not guaranteed inside packages.\n */\n drupalBaseUrl?: string;\n /**\n * Drupal content-model overrides. Pass the same value to createPuckApi so\n * the editor UI and the publish validation stay in sync.\n */\n contentModel?: PuckContentModelInput;\n builtinTemplates?: BuiltinTemplate[];\n /**\n * Prop migrations applied wherever stored Puck data enters the editor\n * (page data and template inserts). Pass the same transforms to\n * parsePuckData in the live-render path so both paths stay in sync.\n */\n propTransforms?: PuckPropTransforms;\n /**\n * Overrides for the editor API calls (base path and/or fetch). Defaults to\n * NEXT_PUBLIC_NODEHIVE_PUCK_API_BASE (or /api/puck) and the global fetch, so\n * leaving this unset keeps the current behavior.\n */\n api?: PuckApiInjection;\n};\n\nconst PuckEditorConfigContext = createContext<PuckEditorConfig>({});\n\n/**\n * Mounted by PuckWrapper. Headless setups that use useMediaLibrary or\n * MediaSelectorField outside PuckWrapper mount this provider themselves.\n */\nexport function PuckEditorConfigProvider({\n config,\n children,\n}: {\n config: PuckEditorConfig;\n children: ReactNode;\n}) {\n if (typeof window !== 'undefined') {\n configurePuckApi(config.api);\n }\n return (\n <PuckEditorConfigContext.Provider value={config}>\n {children}\n </PuckEditorConfigContext.Provider>\n );\n}\n\nexport function usePuckEditorConfig(): PuckEditorConfig {\n return useContext(PuckEditorConfigContext);\n}\n\n/** Resolved content model; defaults apply without a provider (headless). */\nexport function usePuckContentModel(): PuckContentModel {\n const { contentModel } = useContext(PuckEditorConfigContext);\n return resolveContentModel(contentModel);\n}\n\nexport function usePuckPropTransforms(): PuckPropTransforms | undefined {\n return useContext(PuckEditorConfigContext).propTransforms;\n}\n\nconst NO_BUILTINS: BuiltinTemplate[] = [];\n\nexport function useBuiltinTemplates(): BuiltinTemplate[] {\n return useContext(PuckEditorConfigContext).builtinTemplates ?? NO_BUILTINS;\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,CAAA,IAAAC,EAAA;AAEb,SAASC,aAAa,EAAEC,UAAU,QAAwB,OAAO;AAEjE,SAASC,gBAAgB,QAA+B,iBAAiB;AACzE,SACEC,mBAAmB,QAId,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AA8B5B,MAAMC,uBAAuB,gBAAGN,aAAa,CAAmB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