@wordpress/editor 13.32.0 → 13.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/README.md +225 -2
- package/build/bindings/index.js.map +1 -1
- package/build/bindings/pattern-overrides.js.map +1 -1
- package/build/bindings/post-meta.js +12 -30
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/autocompleters/index.js.map +1 -1
- package/build/components/autocompleters/user.js.map +1 -1
- package/build/components/autosave-monitor/index.js +10 -0
- package/build/components/autosave-monitor/index.js.map +1 -1
- package/build/components/block-manager/category.js.map +1 -1
- package/build/components/block-manager/checklist.js.map +1 -1
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/block-removal-warnings/index.js.map +1 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build/components/character-count/index.js.map +1 -1
- package/build/components/commands/index.js +19 -0
- package/build/components/commands/index.js.map +1 -1
- package/build/components/commands/index.native.js.map +1 -1
- package/build/components/deprecated.js.map +1 -1
- package/build/components/deprecated.native.js.map +1 -1
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-outline/check.js.map +1 -1
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-outline/item.js.map +1 -1
- package/build/components/document-tools/index.js +1 -1
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-canvas/edit-template-blocks-notification.js +13 -2
- package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build/components/editor-canvas/index.js +2 -2
- package/build/components/editor-canvas/index.js.map +1 -1
- package/build/components/editor-help/add-blocks.native.js.map +1 -1
- package/build/components/editor-help/customize-blocks.native.js.map +1 -1
- package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
- package/build/components/editor-help/help-section-title.native.js.map +1 -1
- package/build/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build/components/editor-help/move-blocks.native.js.map +1 -1
- package/build/components/editor-help/remove-blocks.native.js.map +1 -1
- package/build/components/editor-help/view-sections.native.js.map +1 -1
- package/build/components/editor-history/redo.js.map +1 -1
- package/build/components/editor-history/undo.js.map +1 -1
- package/build/components/editor-notices/index.js.map +1 -1
- package/build/components/editor-snackbars/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/error-boundary/index.native.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/index.js +24 -0
- package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build/components/index.js +33 -1
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js.map +1 -1
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +78 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +49 -0
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/index.js +126 -0
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +55 -0
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
- package/build/components/list-view-sidebar/index.js.map +1 -1
- package/build/components/list-view-sidebar/list-view-outline.js.map +1 -1
- package/build/components/local-autosave-monitor/index.js.map +1 -1
- package/build/components/media-categories/index.js.map +1 -1
- package/build/components/mode-switcher/index.js.map +1 -1
- package/build/components/offline-status/index.native.js.map +1 -1
- package/build/components/page-attributes/check.js.map +1 -1
- package/build/components/page-attributes/order.js.map +1 -1
- package/build/components/page-attributes/panel.js.map +1 -1
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/pattern-overrides-panel/index.js.map +1 -1
- package/build/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/plugin-more-menu-item/index.js +78 -0
- package/build/components/plugin-more-menu-item/index.js.map +1 -0
- package/build/components/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/plugin-post-status-info/index.js +73 -0
- package/build/components/plugin-post-status-info/index.js.map +1 -0
- package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/plugin-sidebar/index.js +108 -0
- package/build/components/plugin-sidebar/index.js.map +1 -0
- package/build/components/plugin-sidebar-more-menu-item/index.js +71 -0
- package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
- package/build/components/post-actions/actions.js +218 -17
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +137 -0
- package/build/components/post-actions/index.js.map +1 -0
- package/build/components/post-author/check.js.map +1 -1
- package/build/components/post-author/combobox.js.map +1 -1
- package/build/components/post-author/constants.js.map +1 -1
- package/build/components/post-author/hook.js.map +1 -1
- package/build/components/post-author/index.js.map +1 -1
- package/build/components/post-author/panel.js.map +1 -1
- package/build/components/post-author/select.js.map +1 -1
- package/build/components/post-card-panel/index.js +40 -6
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-discussion/panel.js.map +1 -1
- package/build/components/post-excerpt/check.js +8 -0
- package/build/components/post-excerpt/check.js.map +1 -1
- package/build/components/post-excerpt/index.js.map +1 -1
- package/build/components/post-excerpt/panel.js.map +1 -1
- package/build/components/post-excerpt/plugin.js.map +1 -1
- package/build/components/post-featured-image/check.js.map +1 -1
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-featured-image/panel.js.map +1 -1
- package/build/components/post-format/check.js.map +1 -1
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-last-revision/check.js.map +1 -1
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-last-revision/panel.js.map +1 -1
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-panel-row/index.js.map +1 -1
- package/build/components/post-pending-status/check.js.map +1 -1
- package/build/components/post-pending-status/index.js.map +1 -1
- package/build/components/post-pingbacks/index.js.map +1 -1
- package/build/components/post-preview-button/index.js.map +1 -1
- package/build/components/post-publish-button/index.js +31 -31
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-button/label.js +51 -43
- package/build/components/post-publish-button/label.js.map +1 -1
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/post-publish-panel/postpublish.js.map +1 -1
- package/build/components/post-publish-panel/prepublish.js.map +1 -1
- package/build/components/post-saved-state/index.js +10 -6
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/check.js.map +1 -1
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-schedule/panel.js +8 -0
- package/build/components/post-schedule/panel.js.map +1 -1
- package/build/components/post-slug/check.js.map +1 -1
- package/build/components/post-slug/index.js +43 -68
- package/build/components/post-slug/index.js.map +1 -1
- package/build/components/post-status/index.js +239 -0
- package/build/components/post-status/index.js.map +1 -0
- package/build/components/post-sticky/check.js.map +1 -1
- package/build/components/post-sticky/index.js.map +1 -1
- package/build/components/post-switch-to-draft-button/index.js +6 -1
- package/build/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build/components/post-sync-status/index.js.map +1 -1
- package/build/components/post-taxonomies/check.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-taxonomies/panel.js.map +1 -1
- package/build/components/post-template/block-theme.js +6 -2
- package/build/components/post-template/block-theme.js.map +1 -1
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-template/create-new-template-modal.js.map +1 -1
- package/build/components/post-template/create-new-template.js.map +1 -1
- package/build/components/post-template/hooks.js.map +1 -1
- package/build/components/post-template/panel.js.map +1 -1
- package/build/components/post-template/reset-default-template.js.map +1 -1
- package/build/components/post-template/swap-template-button.js.map +1 -1
- package/build/components/post-text-editor/index.js.map +1 -1
- package/build/components/post-title/constants.js.map +1 -1
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-title/post-title-raw.js.map +1 -1
- package/build/components/post-title/use-post-title-focus.js.map +1 -1
- package/build/components/post-title/use-post-title.js.map +1 -1
- package/build/components/post-trash/check.js +23 -25
- package/build/components/post-trash/check.js.map +1 -1
- package/build/components/post-trash/index.js +2 -1
- package/build/components/post-trash/index.js.map +1 -1
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/post-url/check.js.map +1 -1
- package/build/components/post-url/index.js +44 -19
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/label.js.map +1 -1
- package/build/components/post-url/panel.js +14 -7
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/post-view-link/index.js.map +1 -1
- package/build/components/post-visibility/check.js.map +1 -1
- package/build/components/post-visibility/index.js +2 -1
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/components/post-visibility/label.js.map +1 -1
- package/build/components/post-visibility/utils.js.map +1 -1
- package/build/components/preferences-modal/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
- package/build/components/preferences-modal/index.js +19 -17
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/index.js +4 -2
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +6 -1
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/navigation-block-editing-mode.js.map +1 -1
- package/build/components/provider/use-auto-switch-editor-sidebars.js +52 -0
- package/build/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
- package/build/components/provider/use-block-editor-settings.js +64 -43
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
- package/build/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
- package/build/components/provider/with-registry-provider.js +1 -0
- package/build/components/provider/with-registry-provider.js.map +1 -1
- package/build/components/start-page-options/index.js +139 -0
- package/build/components/start-page-options/index.js.map +1 -0
- package/build/components/table-of-contents/index.js.map +1 -1
- package/build/components/table-of-contents/panel.js.map +1 -1
- package/build/components/template-areas/index.js.map +1 -1
- package/build/components/template-validation-notice/index.js +23 -29
- package/build/components/template-validation-notice/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +10 -16
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/components/time-to-read/index.js.map +1 -1
- package/build/components/unsaved-changes-warning/index.js.map +1 -1
- package/build/components/word-count/index.js.map +1 -1
- package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build/hooks/default-autocompleters.js.map +1 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/pattern-overrides.js +22 -10
- package/build/hooks/pattern-overrides.js.map +1 -1
- package/build/hooks/use-select-nearest-editable-block.js.map +1 -1
- package/build/index.js.map +1 -1
- package/build/index.native.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/private-apis.js +20 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/actions.native.js.map +1 -1
- package/build/store/constants.js +8 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/defaults.js.map +1 -1
- package/build/store/index.js +1 -1
- package/build/store/index.js.map +1 -1
- package/build/store/local-autosave.js.map +1 -1
- package/build/store/private-actions.js +177 -4
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +1 -7
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/reducer.native.js.map +1 -1
- package/build/store/selectors.js +5 -10
- package/build/store/selectors.js.map +1 -1
- package/build/store/selectors.native.js.map +1 -1
- package/build/store/utils/get-filtered-template-parts.js.map +1 -1
- package/build/store/utils/is-template-revertable.js +28 -0
- package/build/store/utils/is-template-revertable.js.map +1 -0
- package/build/store/utils/notice-builder.js.map +1 -1
- package/build/utils/get-template-part-icon.js.map +1 -1
- package/build/utils/index.js.map +1 -1
- package/build/utils/index.native.js.map +1 -1
- package/build/utils/media-upload/index.js.map +1 -1
- package/build/utils/media-upload/index.native.js.map +1 -1
- package/build/utils/terms.js.map +1 -1
- package/build/utils/url.js.map +1 -1
- package/build-module/bindings/index.js.map +1 -1
- package/build-module/bindings/pattern-overrides.js.map +1 -1
- package/build-module/bindings/post-meta.js +14 -31
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/autocompleters/index.js.map +1 -1
- package/build-module/components/autocompleters/user.js.map +1 -1
- package/build-module/components/autosave-monitor/index.js +10 -0
- package/build-module/components/autosave-monitor/index.js.map +1 -1
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/block-manager/checklist.js.map +1 -1
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/block-removal-warnings/index.js.map +1 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build-module/components/character-count/index.js.map +1 -1
- package/build-module/components/commands/index.js +20 -1
- package/build-module/components/commands/index.js.map +1 -1
- package/build-module/components/commands/index.native.js.map +1 -1
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/deprecated.native.js.map +1 -1
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-outline/check.js.map +1 -1
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-outline/item.js.map +1 -1
- package/build-module/components/document-tools/index.js +1 -1
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js +13 -2
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build-module/components/editor-canvas/index.js +2 -2
- package/build-module/components/editor-canvas/index.js.map +1 -1
- package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
- package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
- package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/view-sections.native.js.map +1 -1
- package/build-module/components/editor-history/redo.js.map +1 -1
- package/build-module/components/editor-history/undo.js.map +1 -1
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/error-boundary/index.native.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/index.js +24 -0
- package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build-module/components/index.js +4 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +71 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +41 -0
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/index.js +118 -0
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +48 -0
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
- package/build-module/components/list-view-sidebar/index.js.map +1 -1
- package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
- package/build-module/components/local-autosave-monitor/index.js.map +1 -1
- package/build-module/components/media-categories/index.js.map +1 -1
- package/build-module/components/mode-switcher/index.js.map +1 -1
- package/build-module/components/offline-status/index.native.js.map +1 -1
- package/build-module/components/page-attributes/check.js.map +1 -1
- package/build-module/components/page-attributes/order.js.map +1 -1
- package/build-module/components/page-attributes/panel.js.map +1 -1
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/pattern-overrides-panel/index.js.map +1 -1
- package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/components/plugin-more-menu-item/index.js +73 -0
- package/build-module/components/plugin-more-menu-item/index.js.map +1 -0
- package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
- package/build-module/components/plugin-post-status-info/index.js +66 -0
- package/build-module/components/plugin-post-status-info/index.js.map +1 -0
- package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/plugin-sidebar/index.js +102 -0
- package/build-module/components/plugin-sidebar/index.js.map +1 -0
- package/build-module/components/plugin-sidebar-more-menu-item/index.js +65 -0
- package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
- package/build-module/components/post-actions/actions.js +219 -15
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +130 -0
- package/build-module/components/post-actions/index.js.map +1 -0
- package/build-module/components/post-author/check.js.map +1 -1
- package/build-module/components/post-author/combobox.js.map +1 -1
- package/build-module/components/post-author/constants.js.map +1 -1
- package/build-module/components/post-author/hook.js.map +1 -1
- package/build-module/components/post-author/index.js.map +1 -1
- package/build-module/components/post-author/panel.js.map +1 -1
- package/build-module/components/post-author/select.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +42 -8
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-discussion/panel.js.map +1 -1
- package/build-module/components/post-excerpt/check.js +9 -0
- package/build-module/components/post-excerpt/check.js.map +1 -1
- package/build-module/components/post-excerpt/index.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-excerpt/plugin.js.map +1 -1
- package/build-module/components/post-featured-image/check.js.map +1 -1
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-featured-image/panel.js.map +1 -1
- package/build-module/components/post-format/check.js.map +1 -1
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-last-revision/check.js.map +1 -1
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-last-revision/panel.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-panel-row/index.js.map +1 -1
- package/build-module/components/post-pending-status/check.js.map +1 -1
- package/build-module/components/post-pending-status/index.js.map +1 -1
- package/build-module/components/post-pingbacks/index.js.map +1 -1
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +31 -31
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/label.js +51 -42
- package/build-module/components/post-publish-button/label.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
- package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +10 -6
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/check.js.map +1 -1
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-schedule/panel.js +8 -0
- package/build-module/components/post-schedule/panel.js.map +1 -1
- package/build-module/components/post-slug/check.js.map +1 -1
- package/build-module/components/post-slug/index.js +44 -68
- package/build-module/components/post-slug/index.js.map +1 -1
- package/build-module/components/post-status/index.js +231 -0
- package/build-module/components/post-status/index.js.map +1 -0
- package/build-module/components/post-sticky/check.js.map +1 -1
- package/build-module/components/post-sticky/index.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +7 -1
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-sync-status/index.js.map +1 -1
- package/build-module/components/post-taxonomies/check.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-taxonomies/panel.js.map +1 -1
- package/build-module/components/post-template/block-theme.js +7 -3
- package/build-module/components/post-template/block-theme.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
- package/build-module/components/post-template/create-new-template.js.map +1 -1
- package/build-module/components/post-template/hooks.js.map +1 -1
- package/build-module/components/post-template/panel.js.map +1 -1
- package/build-module/components/post-template/reset-default-template.js.map +1 -1
- package/build-module/components/post-template/swap-template-button.js.map +1 -1
- package/build-module/components/post-text-editor/index.js.map +1 -1
- package/build-module/components/post-title/constants.js.map +1 -1
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/post-title/post-title-raw.js.map +1 -1
- package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
- package/build-module/components/post-title/use-post-title.js.map +1 -1
- package/build-module/components/post-trash/check.js +24 -26
- package/build-module/components/post-trash/check.js.map +1 -1
- package/build-module/components/post-trash/index.js +2 -1
- package/build-module/components/post-trash/index.js.map +1 -1
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/post-url/check.js.map +1 -1
- package/build-module/components/post-url/index.js +46 -21
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/label.js.map +1 -1
- package/build-module/components/post-url/panel.js +14 -7
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/post-view-link/index.js.map +1 -1
- package/build-module/components/post-visibility/check.js.map +1 -1
- package/build-module/components/post-visibility/index.js +2 -1
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/components/post-visibility/label.js.map +1 -1
- package/build-module/components/post-visibility/utils.js.map +1 -1
- package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
- package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +19 -17
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/provider/index.js +5 -3
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/navigation-block-editing-mode.js.map +1 -1
- package/build-module/components/provider/use-auto-switch-editor-sidebars.js +46 -0
- package/build-module/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
- package/build-module/components/provider/use-block-editor-settings.js +66 -45
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
- package/build-module/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
- package/build-module/components/provider/with-registry-provider.js +1 -0
- package/build-module/components/provider/with-registry-provider.js.map +1 -1
- package/build-module/components/start-page-options/index.js +132 -0
- package/build-module/components/start-page-options/index.js.map +1 -0
- package/build-module/components/table-of-contents/index.js.map +1 -1
- package/build-module/components/table-of-contents/panel.js.map +1 -1
- package/build-module/components/template-areas/index.js.map +1 -1
- package/build-module/components/template-validation-notice/index.js +25 -31
- package/build-module/components/template-validation-notice/index.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +11 -16
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/components/time-to-read/index.js.map +1 -1
- package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
- package/build-module/components/word-count/index.js.map +1 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build-module/hooks/default-autocompleters.js.map +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/pattern-overrides.js +22 -10
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/hooks/use-select-nearest-editable-block.js.map +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/private-apis.js +18 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/actions.native.js.map +1 -1
- package/build-module/store/constants.js +7 -0
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/local-autosave.js.map +1 -1
- package/build-module/store/private-actions.js +174 -4
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +1 -6
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/reducer.native.js.map +1 -1
- package/build-module/store/selectors.js +1 -6
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/selectors.native.js.map +1 -1
- package/build-module/store/utils/get-filtered-template-parts.js.map +1 -1
- package/build-module/store/utils/is-template-revertable.js +22 -0
- package/build-module/store/utils/is-template-revertable.js.map +1 -0
- package/build-module/store/utils/notice-builder.js.map +1 -1
- package/build-module/utils/get-template-part-icon.js.map +1 -1
- package/build-module/utils/index.js.map +1 -1
- package/build-module/utils/index.native.js.map +1 -1
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/build-module/utils/media-upload/index.native.js.map +1 -1
- package/build-module/utils/terms.js.map +1 -1
- package/build-module/utils/url.js.map +1 -1
- package/build-style/style-rtl.css +498 -25
- package/build-style/style.css +498 -25
- package/package.json +35 -35
- package/src/bindings/post-meta.js +11 -27
- package/src/components/autosave-monitor/index.js +9 -0
- package/src/components/commands/index.js +20 -1
- package/src/components/document-tools/index.js +16 -14
- package/src/components/editor-canvas/edit-template-blocks-notification.js +16 -2
- package/src/components/editor-canvas/index.js +4 -4
- package/src/components/error-boundary/style.native.scss +1 -1
- package/src/components/global-keyboard-shortcuts/index.js +25 -0
- package/src/components/global-keyboard-shortcuts/register-shortcuts.js +20 -0
- package/src/components/index.js +4 -0
- package/src/components/keyboard-shortcut-help-modal/config.js +53 -0
- package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +43 -0
- package/src/components/keyboard-shortcut-help-modal/index.js +160 -0
- package/src/components/keyboard-shortcut-help-modal/shortcut.js +67 -0
- package/src/components/keyboard-shortcut-help-modal/style.scss +61 -0
- package/src/components/plugin-more-menu-item/index.js +73 -0
- package/src/components/plugin-post-status-info/index.js +63 -0
- package/src/components/plugin-sidebar/index.js +98 -0
- package/src/components/plugin-sidebar-more-menu-item/index.js +64 -0
- package/src/components/post-actions/actions.js +294 -14
- package/src/components/post-actions/index.js +156 -0
- package/src/components/post-actions/style.scss +3 -0
- package/src/components/post-card-panel/index.js +69 -9
- package/src/components/post-excerpt/check.js +8 -0
- package/src/components/post-publish-button/index.js +23 -36
- package/src/components/post-publish-button/label.js +54 -39
- package/src/components/post-publish-button/test/index.js +15 -26
- package/src/components/post-publish-button/test/label.js +44 -21
- package/src/components/post-saved-state/index.js +13 -6
- package/src/components/post-saved-state/test/index.js +4 -0
- package/src/components/post-schedule/panel.js +22 -0
- package/src/components/post-slug/index.js +50 -68
- package/src/components/post-slug/test/index.js +29 -6
- package/src/components/post-status/index.js +310 -0
- package/src/components/post-status/style.scss +75 -0
- package/src/components/post-switch-to-draft-button/index.js +5 -0
- package/src/components/post-template/block-theme.js +31 -22
- package/src/components/post-trash/check.js +19 -19
- package/src/components/post-trash/index.js +1 -0
- package/src/components/post-url/index.js +131 -101
- package/src/components/post-url/panel.js +20 -7
- package/src/components/post-url/style.scss +8 -6
- package/src/components/post-visibility/index.js +1 -0
- package/src/components/preferences-modal/index.js +26 -22
- package/src/components/provider/index.js +17 -8
- package/src/components/provider/use-auto-switch-editor-sidebars.js +49 -0
- package/src/components/provider/use-block-editor-settings.js +59 -33
- package/src/components/provider/with-registry-provider.js +1 -0
- package/src/components/start-page-options/index.js +135 -0
- package/src/components/start-page-options/style.scss +26 -0
- package/src/components/template-validation-notice/index.js +48 -50
- package/src/components/theme-support-check/index.js +9 -16
- package/src/components/theme-support-check/test/index.js +44 -43
- package/src/hooks/pattern-overrides.js +25 -14
- package/src/private-apis.js +15 -0
- package/src/store/constants.js +7 -0
- package/src/store/private-actions.js +269 -4
- package/src/store/private-selectors.js +1 -6
- package/src/store/selectors.js +1 -6
- package/src/store/utils/is-template-revertable.js +23 -0
- package/src/style.scss +6 -2
- package/src/components/post-publish-button/style.scss +0 -8
- package/src/components/provider/test/disable-non-page-content-blocks.js +0 -111
- package/src/components/template-validation-notice/style.scss +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_memize","_interopRequireDefault","_reactNativeSafeAreaContext","_reactNativeBridge","_interopRequireWildcard","_element","_wordcount","_blocks","_data","_compose","_hooks","_blockEditor","_components","_blockLibrary","_i18n","_editor","_notices","_coreData","_index","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","postTypeEntities","name","baseURL","map","postTypeEntity","kind","transientEdits","blocks","selection","mergedEdits","meta","rawAttributes","NativeEditorProvider","Component","constructor","arguments","post","props","addEntities","receiveEntityRecords","type","onHardwareBackPress","bind","getEditorSettings","memize","settings","capabilities","maxSize","state","isHelpVisible","componentDidMount","createErrorNotice","locale","hostAppNamespace","updateEditorSettings","updateBlockEditorSettings","getThemeColors","subscriptionParentGetHtml","subscribeParentGetHtml","serializeToNativeAction","subscriptionParentToggleHTMLMode","subscribeParentToggleHTMLMode","toggleMode","subscriptionParentSetTitle","subscribeSetTitle","payload","editTitle","title","subscriptionParentUpdateHtml","subscribeUpdateHtml","updateHtmlAction","html","subscriptionParentReplaceBlock","subscribeReplaceBlock","replaceBlockAction","clientId","subscriptionParentMediaAppend","subscribeMediaAppend","blockName","mediaType","blockType","getBlockType","newBlock","createBlock","id","mediaId","mediaUrl","indexAfterSelected","selectedBlockIndex","insertionIndex","blockCount","insertBlock","__","subscriptionParentUpdateEditorSettings","subscribeUpdateEditorSettings","galleryWithImageBlocks","editorSettings","window","wp","galleryBlockV2Enabled","subscriptionParentUpdateCapabilities","subscribeUpdateCapabilities","updateCapabilitiesAction","subscriptionParentShowNotice","subscribeShowNotice","createSuccessNotice","message","subscriptionParentShowEditorHelp","subscribeShowEditorHelp","setState","hardwareBackPressListener","BackHandler","addEventListener","requestBlockTypeImpressions","storedImpressions","impressions","NEW_BLOCK_TYPES","storedImpressionKeys","keys","storedImpressionsCurrent","every","newKey","includes","setBlockTypeImpressions","componentWillUnmount","remove","rawStyles","rawFeatures","defaultEditorColors","defaultEditorGradients","getGlobalStyles","getColorsAndGradients","componentDidUpdate","prevProps","isReady","isUnsupportedBlock","getUnregisteredTypeHandlerName","unsupportedBlockNames","filter","block","attributes","originalName","RNReactNativeGutenbergBridge","editorDidMount","clearSelectedBlock","mode","applyFilters","serialize","hasChanges","raw","content","contentInfo","characterCount","wordCount","paragraphCount","provideToNative_Html","parsed","parse","resetEditorBlocksWithoutUndoLevel","blockClientId","replaceBlock","switchMode","render","children","_react","createElement","Fragment","SafeAreaProvider","EditorHelpTopics","isVisible","onClose","close","showSupport","supportSection","ComposedNativeProvider","exports","ExperimentalEditorProvider","compose","withSelect","select","_settings$colors","_settings$gradients","__unstableIsEditorReady","isEditorReady","getEditorBlocks","getEditedPostAttribute","getEditedPostContent","getEditorMode","editorStore","getBlockIndex","getSelectedBlockClientId","getGlobalBlockCount","blockEditorStore","colors","gradients","selectedBlockClientId","withDispatch","dispatch","editPost","resetEditorBlocks","switchEditorMode","updateSettings","coreStore","noticesStore","__unstableShouldCreateUndoLevel","_default"],"sources":["@wordpress/editor/src/components/provider/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { BackHandler } from 'react-native';\nimport memize from 'memize';\nimport { SafeAreaProvider } from 'react-native-safe-area-context';\n\n/**\n * WordPress dependencies\n */\nimport RNReactNativeGutenbergBridge, {\n\trequestBlockTypeImpressions,\n\tsetBlockTypeImpressions,\n\tsubscribeParentGetHtml,\n\tsubscribeParentToggleHTMLMode,\n\tsubscribeUpdateHtml,\n\tsubscribeSetTitle,\n\tsubscribeMediaAppend,\n\tsubscribeReplaceBlock,\n\tsubscribeUpdateEditorSettings,\n\tsubscribeUpdateCapabilities,\n\tsubscribeShowNotice,\n\tsubscribeShowEditorHelp,\n} from '@wordpress/react-native-bridge';\nimport { Component } from '@wordpress/element';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport {\n\tparse,\n\tserialize,\n\tgetUnregisteredTypeHandlerName,\n\tgetBlockType,\n\tcreateBlock,\n} from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { applyFilters } from '@wordpress/hooks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { getGlobalStyles, getColorsAndGradients } from '@wordpress/components';\nimport { NEW_BLOCK_TYPES } from '@wordpress/block-library';\nimport { __ } from '@wordpress/i18n';\n\nconst postTypeEntities = [\n\t{ name: 'post', baseURL: '/wp/v2/posts' },\n\t{ name: 'page', baseURL: '/wp/v2/pages' },\n\t{ name: 'attachment', baseURL: '/wp/v2/media' },\n\t{ name: 'wp_block', baseURL: '/wp/v2/blocks' },\n].map( ( postTypeEntity ) => ( {\n\tkind: 'postType',\n\t...postTypeEntity,\n\ttransientEdits: {\n\t\tblocks: true,\n\t\tselection: true,\n\t},\n\tmergedEdits: {\n\t\tmeta: true,\n\t},\n\trawAttributes: [ 'title', 'excerpt', 'content' ],\n} ) );\nimport { EditorHelpTopics, store as editorStore } from '@wordpress/editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport EditorProvider from './index.js';\n\nclass NativeEditorProvider extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\t// Keep a local reference to `post` to detect changes.\n\t\tthis.post = this.props.post;\n\t\tthis.props.addEntities( postTypeEntities );\n\t\tthis.props.receiveEntityRecords(\n\t\t\t'postType',\n\t\t\tthis.post.type,\n\t\t\tthis.post\n\t\t);\n\n\t\tthis.onHardwareBackPress = this.onHardwareBackPress.bind( this );\n\n\t\tthis.getEditorSettings = memize(\n\t\t\t( settings, capabilities ) => ( {\n\t\t\t\t...settings,\n\t\t\t\tcapabilities,\n\t\t\t} ),\n\t\t\t{\n\t\t\t\tmaxSize: 1,\n\t\t\t}\n\t\t);\n\t\tthis.state = {\n\t\t\tisHelpVisible: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst {\n\t\t\tcapabilities,\n\t\t\tcreateErrorNotice,\n\t\t\tlocale,\n\t\t\thostAppNamespace,\n\t\t\tupdateEditorSettings,\n\t\t\tupdateBlockEditorSettings,\n\t\t} = this.props;\n\n\t\tupdateEditorSettings( {\n\t\t\tcapabilities,\n\t\t\t...this.getThemeColors( this.props ),\n\t\t\tlocale,\n\t\t\thostAppNamespace,\n\t\t} );\n\n\t\tthis.subscriptionParentGetHtml = subscribeParentGetHtml( () => {\n\t\t\tthis.serializeToNativeAction();\n\t\t} );\n\n\t\tthis.subscriptionParentToggleHTMLMode = subscribeParentToggleHTMLMode(\n\t\t\t() => {\n\t\t\t\tthis.toggleMode();\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentSetTitle = subscribeSetTitle( ( payload ) => {\n\t\t\tthis.props.editTitle( payload.title );\n\t\t} );\n\n\t\tthis.subscriptionParentUpdateHtml = subscribeUpdateHtml(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateHtmlAction( payload.html );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentReplaceBlock = subscribeReplaceBlock(\n\t\t\t( payload ) => {\n\t\t\t\tthis.replaceBlockAction( payload.html, payload.clientId );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentMediaAppend = subscribeMediaAppend(\n\t\t\t( payload ) => {\n\t\t\t\tconst blockName = 'core/' + payload.mediaType;\n\t\t\t\tconst blockType = getBlockType( blockName );\n\n\t\t\t\tif ( blockType && blockType?.name ) {\n\t\t\t\t\tconst newBlock = createBlock( blockType.name, {\n\t\t\t\t\t\tid: payload.mediaId,\n\t\t\t\t\t\t[ payload.mediaType === 'image' ? 'url' : 'src' ]:\n\t\t\t\t\t\t\tpayload.mediaUrl,\n\t\t\t\t\t} );\n\n\t\t\t\t\tconst indexAfterSelected =\n\t\t\t\t\t\tthis.props.selectedBlockIndex + 1;\n\t\t\t\t\tconst insertionIndex =\n\t\t\t\t\t\tindexAfterSelected || this.props.blockCount;\n\n\t\t\t\t\tthis.props.insertBlock( newBlock, insertionIndex );\n\t\t\t\t} else {\n\t\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t\t__( 'File type not supported as a media file.' )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateEditorSettings =\n\t\t\tsubscribeUpdateEditorSettings(\n\t\t\t\t( { galleryWithImageBlocks, ...editorSettings } ) => {\n\t\t\t\t\tif ( typeof galleryWithImageBlocks === 'boolean' ) {\n\t\t\t\t\t\twindow.wp.galleryBlockV2Enabled =\n\t\t\t\t\t\t\tgalleryWithImageBlocks;\n\t\t\t\t\t}\n\t\t\t\t\tupdateEditorSettings(\n\t\t\t\t\t\tthis.getThemeColors( editorSettings )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\tthis.subscriptionParentUpdateCapabilities = subscribeUpdateCapabilities(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateCapabilitiesAction( payload );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowNotice = subscribeShowNotice(\n\t\t\t( payload ) => {\n\t\t\t\tthis.props.createSuccessNotice( payload.message );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowEditorHelp = subscribeShowEditorHelp( () => {\n\t\t\tthis.setState( { isHelpVisible: true } );\n\t\t} );\n\n\t\tthis.hardwareBackPressListener = BackHandler.addEventListener(\n\t\t\t'hardwareBackPress',\n\t\t\tthis.onHardwareBackPress\n\t\t);\n\n\t\t// Request current block impressions from native app.\n\t\trequestBlockTypeImpressions( ( storedImpressions ) => {\n\t\t\tconst impressions = { ...NEW_BLOCK_TYPES, ...storedImpressions };\n\n\t\t\t// Persist impressions to JavaScript store.\n\t\t\tupdateBlockEditorSettings( { impressions } );\n\n\t\t\t// Persist impressions to native store if they do not include latest\n\t\t\t// `NEW_BLOCK_TYPES` configuration.\n\t\t\tconst storedImpressionKeys = Object.keys( storedImpressions );\n\t\t\tconst storedImpressionsCurrent = Object.keys(\n\t\t\t\tNEW_BLOCK_TYPES\n\t\t\t).every( ( newKey ) => storedImpressionKeys.includes( newKey ) );\n\t\t\tif ( ! storedImpressionsCurrent ) {\n\t\t\t\tsetBlockTypeImpressions( impressions );\n\t\t\t}\n\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentGetHtml ) {\n\t\t\tthis.subscriptionParentGetHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentToggleHTMLMode ) {\n\t\t\tthis.subscriptionParentToggleHTMLMode.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentSetTitle ) {\n\t\t\tthis.subscriptionParentSetTitle.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateHtml ) {\n\t\t\tthis.subscriptionParentUpdateHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentReplaceBlock ) {\n\t\t\tthis.subscriptionParentReplaceBlock.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentMediaAppend ) {\n\t\t\tthis.subscriptionParentMediaAppend.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateEditorSettings ) {\n\t\t\tthis.subscriptionParentUpdateEditorSettings.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateCapabilities ) {\n\t\t\tthis.subscriptionParentUpdateCapabilities.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowNotice ) {\n\t\t\tthis.subscriptionParentShowNotice.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowEditorHelp ) {\n\t\t\tthis.subscriptionParentShowEditorHelp.remove();\n\t\t}\n\n\t\tif ( this.hardwareBackPressListener ) {\n\t\t\tthis.hardwareBackPressListener.remove();\n\t\t}\n\t}\n\n\tgetThemeColors( { rawStyles, rawFeatures } ) {\n\t\tconst { defaultEditorColors, defaultEditorGradients } = this.props;\n\n\t\tif ( rawStyles && rawFeatures ) {\n\t\t\treturn getGlobalStyles( rawStyles, rawFeatures );\n\t\t}\n\n\t\treturn getColorsAndGradients(\n\t\t\tdefaultEditorColors,\n\t\t\tdefaultEditorGradients,\n\t\t\trawFeatures\n\t\t);\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( ! prevProps.isReady && this.props.isReady ) {\n\t\t\tconst blocks = this.props.blocks;\n\t\t\tconst isUnsupportedBlock = ( { name } ) =>\n\t\t\t\tname === getUnregisteredTypeHandlerName();\n\t\t\tconst unsupportedBlockNames = blocks\n\t\t\t\t.filter( isUnsupportedBlock )\n\t\t\t\t.map( ( block ) => block.attributes.originalName );\n\t\t\tRNReactNativeGutenbergBridge.editorDidMount(\n\t\t\t\tunsupportedBlockNames\n\t\t\t);\n\t\t}\n\t}\n\n\tonHardwareBackPress() {\n\t\tconst { clearSelectedBlock, selectedBlockIndex } = this.props;\n\n\t\tif ( selectedBlockIndex !== -1 ) {\n\t\t\tclearSelectedBlock();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tserializeToNativeAction() {\n\t\tconst title = this.props.title;\n\t\tlet html;\n\n\t\tif ( this.props.mode === 'text' ) {\n\t\t\t// The HTMLTextInput component does not update the store when user is doing changes\n\t\t\t// Let's request the HTML from the component's state directly.\n\t\t\thtml = applyFilters( 'native.persist-html' );\n\t\t} else {\n\t\t\thtml = serialize( this.props.blocks );\n\t\t}\n\n\t\tconst hasChanges =\n\t\t\ttitle !== this.post.title.raw || html !== this.post.content.raw;\n\n\t\t// Variable to store the content structure metrics.\n\t\tconst contentInfo = {};\n\t\tcontentInfo.characterCount = wordCount(\n\t\t\thtml,\n\t\t\t'characters_including_spaces'\n\t\t);\n\t\tcontentInfo.wordCount = wordCount( html, 'words' );\n\t\tcontentInfo.paragraphCount = this.props.paragraphCount;\n\t\tcontentInfo.blockCount = this.props.blockCount;\n\t\tRNReactNativeGutenbergBridge.provideToNative_Html(\n\t\t\thtml,\n\t\t\ttitle,\n\t\t\thasChanges,\n\t\t\tcontentInfo\n\t\t);\n\n\t\tif ( hasChanges ) {\n\t\t\tthis.post.title.raw = title;\n\t\t\tthis.post.content.raw = html;\n\t\t}\n\t}\n\n\tupdateHtmlAction( html ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.resetEditorBlocksWithoutUndoLevel( parsed );\n\t}\n\n\treplaceBlockAction( html, blockClientId ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.replaceBlock( blockClientId, parsed );\n\t}\n\n\ttoggleMode() {\n\t\tconst { mode, switchMode } = this.props;\n\t\t// Refresh html content first.\n\t\tthis.serializeToNativeAction();\n\t\tswitchMode( mode === 'visual' ? 'text' : 'visual' );\n\t}\n\n\tupdateCapabilitiesAction( capabilities ) {\n\t\tthis.props.updateEditorSettings( { capabilities } );\n\t}\n\n\trender() {\n\t\tconst { children, post, capabilities, settings, ...props } = this.props;\n\t\tconst editorSettings = this.getEditorSettings( settings, capabilities );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ this.post }\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t<SafeAreaProvider>{ children }</SafeAreaProvider>\n\t\t\t\t</EditorProvider>\n\t\t\t\t<EditorHelpTopics\n\t\t\t\t\tisVisible={ this.state.isHelpVisible }\n\t\t\t\t\tonClose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tclose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tshowSupport={ capabilities?.supportSection === true }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nconst ComposedNativeProvider = compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\t__unstableIsEditorReady: isEditorReady,\n\t\t\tgetEditorBlocks,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostContent,\n\t\t\tgetEditorSettings,\n\t\t\tgetEditorMode,\n\t\t} = select( editorStore );\n\n\t\tconst { getBlockIndex, getSelectedBlockClientId, getGlobalBlockCount } =\n\t\t\tselect( blockEditorStore );\n\n\t\tconst settings = getEditorSettings();\n\t\tconst defaultEditorColors = settings?.colors ?? [];\n\t\tconst defaultEditorGradients = settings?.gradients ?? [];\n\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t\tisReady: isEditorReady(),\n\t\t\tblocks: getEditorBlocks(),\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tgetEditedPostContent,\n\t\t\tdefaultEditorColors,\n\t\t\tdefaultEditorGradients,\n\t\t\tselectedBlockIndex: getBlockIndex( selectedBlockClientId ),\n\t\t\tblockCount: getGlobalBlockCount(),\n\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst {\n\t\t\teditPost,\n\t\t\tresetEditorBlocks,\n\t\t\tupdateEditorSettings,\n\t\t\tswitchEditorMode,\n\t\t} = dispatch( editorStore );\n\t\tconst {\n\t\t\tclearSelectedBlock,\n\t\t\tupdateSettings,\n\t\t\tinsertBlock,\n\t\t\treplaceBlock,\n\t\t} = dispatch( blockEditorStore );\n\t\tconst { addEntities, receiveEntityRecords } = dispatch( coreStore );\n\t\tconst { createSuccessNotice, createErrorNotice } =\n\t\t\tdispatch( noticesStore );\n\n\t\treturn {\n\t\t\tupdateBlockEditorSettings: updateSettings,\n\t\t\tupdateEditorSettings,\n\t\t\taddEntities,\n\t\t\tinsertBlock,\n\t\t\tcreateSuccessNotice,\n\t\t\tcreateErrorNotice,\n\t\t\tclearSelectedBlock,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\treceiveEntityRecords,\n\t\t\tresetEditorBlocksWithoutUndoLevel( blocks ) {\n\t\t\t\tresetEditorBlocks( blocks, {\n\t\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tswitchMode( mode ) {\n\t\t\t\tswitchEditorMode( mode );\n\t\t\t},\n\t\t\treplaceBlock,\n\t\t};\n\t} ),\n] )( NativeEditorProvider );\n\nexport default ComposedNativeProvider;\nexport { ComposedNativeProvider as ExperimentalEditorProvider };\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,2BAAA,GAAAH,OAAA;AAKA,IAAAI,kBAAA,GAAAC,uBAAA,CAAAL,OAAA;AAcA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAOA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,YAAA,GAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AACA,IAAAc,aAAA,GAAAd,OAAA;AACA,IAAAe,KAAA,GAAAf,OAAA;AAmBA,IAAAgB,OAAA,GAAAhB,OAAA;AACA,IAAAiB,QAAA,GAAAjB,OAAA;AACA,IAAAkB,SAAA,GAAAlB,OAAA;AAKA,IAAAmB,MAAA,GAAAjB,sBAAA,CAAAF,OAAA;AAAwC,SAAAoB,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAhB,wBAAAgB,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAA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AAmB,CAAC,CAAC;IACjCrC,cAAc,EAAEqC,mBAAmB,CAAE,gBAAiB;EACvD,CAAC;AACF,CAAE,CAAC,EACH,IAAAK,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IACLC,QAAQ;IACRC,iBAAiB;IACjBjJ,oBAAoB;IACpBkJ;EACD,CAAC,GAAGH,QAAQ,CAAET,aAAY,CAAC;EAC3B,MAAM;IACL5C,kBAAkB;IAClByD,cAAc;IACd9G,WAAW;IACXqE;EACD,CAAC,GAAGqC,QAAQ,CAAEL,kBAAiB,CAAC;EAChC,MAAM;IAAE1J,WAAW;IAAEC;EAAqB,CAAC,GAAG8J,QAAQ,CAAEK,eAAU,CAAC;EACnE,MAAM;IAAEjG,mBAAmB;IAAEtD;EAAkB,CAAC,GAC/CkJ,QAAQ,CAAEM,cAAa,CAAC;EAEzB,OAAO;IACNpJ,yBAAyB,EAAEkJ,cAAc;IACzCnJ,oBAAoB;IACpBhB,WAAW;IACXqD,WAAW;IACXc,mBAAmB;IACnBtD,iBAAiB;IACjB6F,kBAAkB;IAClB9E,SAASA,CAAEC,KAAK,EAAG;MAClBmI,QAAQ,CAAE;QAAEnI;MAAM,CAAE,CAAC;IACtB,CAAC;IACD5B,oBAAoB;IACpBuH,iCAAiCA,CAAEnI,MAAM,EAAG;MAC3C4K,iBAAiB,CAAE5K,MAAM,EAAE;QAC1BiL,+BAA+B,EAAE;MAClC,CAAE,CAAC;IACJ,CAAC;IACD3C,UAAUA,CAAEhB,IAAI,EAAG;MAClBuD,gBAAgB,CAAEvD,IAAK,CAAC;IACzB,CAAC;IACDe;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAEhI,oBAAqB,CAAC;AAAC,IAAA6K,QAAA,GAAA9B,OAAA,CAAA1K,OAAA,GAEbyK,sBAAsB"}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_memize","_interopRequireDefault","_reactNativeSafeAreaContext","_reactNativeBridge","_interopRequireWildcard","_element","_wordcount","_blocks","_data","_compose","_hooks","_blockEditor","_components","_blockLibrary","_i18n","_editor","_notices","_coreData","_index","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","postTypeEntities","name","baseURL","map","postTypeEntity","kind","transientEdits","blocks","selection","mergedEdits","meta","rawAttributes","NativeEditorProvider","Component","constructor","arguments","post","props","addEntities","receiveEntityRecords","type","onHardwareBackPress","bind","getEditorSettings","memize","settings","capabilities","maxSize","state","isHelpVisible","componentDidMount","createErrorNotice","locale","hostAppNamespace","updateEditorSettings","updateBlockEditorSettings","getThemeColors","subscriptionParentGetHtml","subscribeParentGetHtml","serializeToNativeAction","subscriptionParentToggleHTMLMode","subscribeParentToggleHTMLMode","toggleMode","subscriptionParentSetTitle","subscribeSetTitle","payload","editTitle","title","subscriptionParentUpdateHtml","subscribeUpdateHtml","updateHtmlAction","html","subscriptionParentReplaceBlock","subscribeReplaceBlock","replaceBlockAction","clientId","subscriptionParentMediaAppend","subscribeMediaAppend","blockName","mediaType","blockType","getBlockType","newBlock","createBlock","id","mediaId","mediaUrl","indexAfterSelected","selectedBlockIndex","insertionIndex","blockCount","insertBlock","__","subscriptionParentUpdateEditorSettings","subscribeUpdateEditorSettings","galleryWithImageBlocks","editorSettings","window","wp","galleryBlockV2Enabled","subscriptionParentUpdateCapabilities","subscribeUpdateCapabilities","updateCapabilitiesAction","subscriptionParentShowNotice","subscribeShowNotice","createSuccessNotice","message","subscriptionParentShowEditorHelp","subscribeShowEditorHelp","setState","hardwareBackPressListener","BackHandler","addEventListener","requestBlockTypeImpressions","storedImpressions","impressions","NEW_BLOCK_TYPES","storedImpressionKeys","keys","storedImpressionsCurrent","every","newKey","includes","setBlockTypeImpressions","componentWillUnmount","remove","rawStyles","rawFeatures","defaultEditorColors","defaultEditorGradients","getGlobalStyles","getColorsAndGradients","componentDidUpdate","prevProps","isReady","isUnsupportedBlock","getUnregisteredTypeHandlerName","unsupportedBlockNames","filter","block","attributes","originalName","RNReactNativeGutenbergBridge","editorDidMount","clearSelectedBlock","mode","applyFilters","serialize","hasChanges","raw","content","contentInfo","characterCount","wordCount","paragraphCount","provideToNative_Html","parsed","parse","resetEditorBlocksWithoutUndoLevel","blockClientId","replaceBlock","switchMode","render","children","_react","createElement","Fragment","SafeAreaProvider","EditorHelpTopics","isVisible","onClose","close","showSupport","supportSection","ComposedNativeProvider","exports","ExperimentalEditorProvider","compose","withSelect","select","_settings$colors","_settings$gradients","__unstableIsEditorReady","isEditorReady","getEditorBlocks","getEditedPostAttribute","getEditedPostContent","getEditorMode","editorStore","getBlockIndex","getSelectedBlockClientId","getGlobalBlockCount","blockEditorStore","colors","gradients","selectedBlockClientId","withDispatch","dispatch","editPost","resetEditorBlocks","switchEditorMode","updateSettings","coreStore","noticesStore","__unstableShouldCreateUndoLevel","_default"],"sources":["@wordpress/editor/src/components/provider/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { BackHandler } from 'react-native';\nimport memize from 'memize';\nimport { SafeAreaProvider } from 'react-native-safe-area-context';\n\n/**\n * WordPress dependencies\n */\nimport RNReactNativeGutenbergBridge, {\n\trequestBlockTypeImpressions,\n\tsetBlockTypeImpressions,\n\tsubscribeParentGetHtml,\n\tsubscribeParentToggleHTMLMode,\n\tsubscribeUpdateHtml,\n\tsubscribeSetTitle,\n\tsubscribeMediaAppend,\n\tsubscribeReplaceBlock,\n\tsubscribeUpdateEditorSettings,\n\tsubscribeUpdateCapabilities,\n\tsubscribeShowNotice,\n\tsubscribeShowEditorHelp,\n} from '@wordpress/react-native-bridge';\nimport { Component } from '@wordpress/element';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport {\n\tparse,\n\tserialize,\n\tgetUnregisteredTypeHandlerName,\n\tgetBlockType,\n\tcreateBlock,\n} from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { applyFilters } from '@wordpress/hooks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { getGlobalStyles, getColorsAndGradients } from '@wordpress/components';\nimport { NEW_BLOCK_TYPES } from '@wordpress/block-library';\nimport { __ } from '@wordpress/i18n';\n\nconst postTypeEntities = [\n\t{ name: 'post', baseURL: '/wp/v2/posts' },\n\t{ name: 'page', baseURL: '/wp/v2/pages' },\n\t{ name: 'attachment', baseURL: '/wp/v2/media' },\n\t{ name: 'wp_block', baseURL: '/wp/v2/blocks' },\n].map( ( postTypeEntity ) => ( {\n\tkind: 'postType',\n\t...postTypeEntity,\n\ttransientEdits: {\n\t\tblocks: true,\n\t\tselection: true,\n\t},\n\tmergedEdits: {\n\t\tmeta: true,\n\t},\n\trawAttributes: [ 'title', 'excerpt', 'content' ],\n} ) );\nimport { EditorHelpTopics, store as editorStore } from '@wordpress/editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport EditorProvider from './index.js';\n\nclass NativeEditorProvider extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\t// Keep a local reference to `post` to detect changes.\n\t\tthis.post = this.props.post;\n\t\tthis.props.addEntities( postTypeEntities );\n\t\tthis.props.receiveEntityRecords(\n\t\t\t'postType',\n\t\t\tthis.post.type,\n\t\t\tthis.post\n\t\t);\n\n\t\tthis.onHardwareBackPress = this.onHardwareBackPress.bind( this );\n\n\t\tthis.getEditorSettings = memize(\n\t\t\t( settings, capabilities ) => ( {\n\t\t\t\t...settings,\n\t\t\t\tcapabilities,\n\t\t\t} ),\n\t\t\t{\n\t\t\t\tmaxSize: 1,\n\t\t\t}\n\t\t);\n\t\tthis.state = {\n\t\t\tisHelpVisible: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst {\n\t\t\tcapabilities,\n\t\t\tcreateErrorNotice,\n\t\t\tlocale,\n\t\t\thostAppNamespace,\n\t\t\tupdateEditorSettings,\n\t\t\tupdateBlockEditorSettings,\n\t\t} = this.props;\n\n\t\tupdateEditorSettings( {\n\t\t\tcapabilities,\n\t\t\t...this.getThemeColors( this.props ),\n\t\t\tlocale,\n\t\t\thostAppNamespace,\n\t\t} );\n\n\t\tthis.subscriptionParentGetHtml = subscribeParentGetHtml( () => {\n\t\t\tthis.serializeToNativeAction();\n\t\t} );\n\n\t\tthis.subscriptionParentToggleHTMLMode = subscribeParentToggleHTMLMode(\n\t\t\t() => {\n\t\t\t\tthis.toggleMode();\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentSetTitle = subscribeSetTitle( ( payload ) => {\n\t\t\tthis.props.editTitle( payload.title );\n\t\t} );\n\n\t\tthis.subscriptionParentUpdateHtml = subscribeUpdateHtml(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateHtmlAction( payload.html );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentReplaceBlock = subscribeReplaceBlock(\n\t\t\t( payload ) => {\n\t\t\t\tthis.replaceBlockAction( payload.html, payload.clientId );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentMediaAppend = subscribeMediaAppend(\n\t\t\t( payload ) => {\n\t\t\t\tconst blockName = 'core/' + payload.mediaType;\n\t\t\t\tconst blockType = getBlockType( blockName );\n\n\t\t\t\tif ( blockType && blockType?.name ) {\n\t\t\t\t\tconst newBlock = createBlock( blockType.name, {\n\t\t\t\t\t\tid: payload.mediaId,\n\t\t\t\t\t\t[ payload.mediaType === 'image' ? 'url' : 'src' ]:\n\t\t\t\t\t\t\tpayload.mediaUrl,\n\t\t\t\t\t} );\n\n\t\t\t\t\tconst indexAfterSelected =\n\t\t\t\t\t\tthis.props.selectedBlockIndex + 1;\n\t\t\t\t\tconst insertionIndex =\n\t\t\t\t\t\tindexAfterSelected || this.props.blockCount;\n\n\t\t\t\t\tthis.props.insertBlock( newBlock, insertionIndex );\n\t\t\t\t} else {\n\t\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t\t__( 'File type not supported as a media file.' )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateEditorSettings =\n\t\t\tsubscribeUpdateEditorSettings(\n\t\t\t\t( { galleryWithImageBlocks, ...editorSettings } ) => {\n\t\t\t\t\tif ( typeof galleryWithImageBlocks === 'boolean' ) {\n\t\t\t\t\t\twindow.wp.galleryBlockV2Enabled =\n\t\t\t\t\t\t\tgalleryWithImageBlocks;\n\t\t\t\t\t}\n\t\t\t\t\tupdateEditorSettings(\n\t\t\t\t\t\tthis.getThemeColors( editorSettings )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\tthis.subscriptionParentUpdateCapabilities = subscribeUpdateCapabilities(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateCapabilitiesAction( payload );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowNotice = subscribeShowNotice(\n\t\t\t( payload ) => {\n\t\t\t\tthis.props.createSuccessNotice( payload.message );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowEditorHelp = subscribeShowEditorHelp( () => {\n\t\t\tthis.setState( { isHelpVisible: true } );\n\t\t} );\n\n\t\tthis.hardwareBackPressListener = BackHandler.addEventListener(\n\t\t\t'hardwareBackPress',\n\t\t\tthis.onHardwareBackPress\n\t\t);\n\n\t\t// Request current block impressions from native app.\n\t\trequestBlockTypeImpressions( ( storedImpressions ) => {\n\t\t\tconst impressions = { ...NEW_BLOCK_TYPES, ...storedImpressions };\n\n\t\t\t// Persist impressions to JavaScript store.\n\t\t\tupdateBlockEditorSettings( { impressions } );\n\n\t\t\t// Persist impressions to native store if they do not include latest\n\t\t\t// `NEW_BLOCK_TYPES` configuration.\n\t\t\tconst storedImpressionKeys = Object.keys( storedImpressions );\n\t\t\tconst storedImpressionsCurrent = Object.keys(\n\t\t\t\tNEW_BLOCK_TYPES\n\t\t\t).every( ( newKey ) => storedImpressionKeys.includes( newKey ) );\n\t\t\tif ( ! storedImpressionsCurrent ) {\n\t\t\t\tsetBlockTypeImpressions( impressions );\n\t\t\t}\n\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentGetHtml ) {\n\t\t\tthis.subscriptionParentGetHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentToggleHTMLMode ) {\n\t\t\tthis.subscriptionParentToggleHTMLMode.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentSetTitle ) {\n\t\t\tthis.subscriptionParentSetTitle.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateHtml ) {\n\t\t\tthis.subscriptionParentUpdateHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentReplaceBlock ) {\n\t\t\tthis.subscriptionParentReplaceBlock.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentMediaAppend ) {\n\t\t\tthis.subscriptionParentMediaAppend.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateEditorSettings ) {\n\t\t\tthis.subscriptionParentUpdateEditorSettings.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateCapabilities ) {\n\t\t\tthis.subscriptionParentUpdateCapabilities.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowNotice ) {\n\t\t\tthis.subscriptionParentShowNotice.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowEditorHelp ) {\n\t\t\tthis.subscriptionParentShowEditorHelp.remove();\n\t\t}\n\n\t\tif ( this.hardwareBackPressListener ) {\n\t\t\tthis.hardwareBackPressListener.remove();\n\t\t}\n\t}\n\n\tgetThemeColors( { rawStyles, rawFeatures } ) {\n\t\tconst { defaultEditorColors, defaultEditorGradients } = this.props;\n\n\t\tif ( rawStyles && rawFeatures ) {\n\t\t\treturn getGlobalStyles( rawStyles, rawFeatures );\n\t\t}\n\n\t\treturn getColorsAndGradients(\n\t\t\tdefaultEditorColors,\n\t\t\tdefaultEditorGradients,\n\t\t\trawFeatures\n\t\t);\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( ! prevProps.isReady && this.props.isReady ) {\n\t\t\tconst blocks = this.props.blocks;\n\t\t\tconst isUnsupportedBlock = ( { name } ) =>\n\t\t\t\tname === getUnregisteredTypeHandlerName();\n\t\t\tconst unsupportedBlockNames = blocks\n\t\t\t\t.filter( isUnsupportedBlock )\n\t\t\t\t.map( ( block ) => block.attributes.originalName );\n\t\t\tRNReactNativeGutenbergBridge.editorDidMount(\n\t\t\t\tunsupportedBlockNames\n\t\t\t);\n\t\t}\n\t}\n\n\tonHardwareBackPress() {\n\t\tconst { clearSelectedBlock, selectedBlockIndex } = this.props;\n\n\t\tif ( selectedBlockIndex !== -1 ) {\n\t\t\tclearSelectedBlock();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tserializeToNativeAction() {\n\t\tconst title = this.props.title;\n\t\tlet html;\n\n\t\tif ( this.props.mode === 'text' ) {\n\t\t\t// The HTMLTextInput component does not update the store when user is doing changes\n\t\t\t// Let's request the HTML from the component's state directly.\n\t\t\thtml = applyFilters( 'native.persist-html' );\n\t\t} else {\n\t\t\thtml = serialize( this.props.blocks );\n\t\t}\n\n\t\tconst hasChanges =\n\t\t\ttitle !== this.post.title.raw || html !== this.post.content.raw;\n\n\t\t// Variable to store the content structure metrics.\n\t\tconst contentInfo = {};\n\t\tcontentInfo.characterCount = wordCount(\n\t\t\thtml,\n\t\t\t'characters_including_spaces'\n\t\t);\n\t\tcontentInfo.wordCount = wordCount( html, 'words' );\n\t\tcontentInfo.paragraphCount = this.props.paragraphCount;\n\t\tcontentInfo.blockCount = this.props.blockCount;\n\t\tRNReactNativeGutenbergBridge.provideToNative_Html(\n\t\t\thtml,\n\t\t\ttitle,\n\t\t\thasChanges,\n\t\t\tcontentInfo\n\t\t);\n\n\t\tif ( hasChanges ) {\n\t\t\tthis.post.title.raw = title;\n\t\t\tthis.post.content.raw = html;\n\t\t}\n\t}\n\n\tupdateHtmlAction( html ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.resetEditorBlocksWithoutUndoLevel( parsed );\n\t}\n\n\treplaceBlockAction( html, blockClientId ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.replaceBlock( blockClientId, parsed );\n\t}\n\n\ttoggleMode() {\n\t\tconst { mode, switchMode } = this.props;\n\t\t// Refresh html content first.\n\t\tthis.serializeToNativeAction();\n\t\tswitchMode( mode === 'visual' ? 'text' : 'visual' );\n\t}\n\n\tupdateCapabilitiesAction( capabilities ) {\n\t\tthis.props.updateEditorSettings( { capabilities } );\n\t}\n\n\trender() {\n\t\tconst { children, post, capabilities, settings, ...props } = this.props;\n\t\tconst editorSettings = this.getEditorSettings( settings, capabilities );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ this.post }\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t<SafeAreaProvider>{ children }</SafeAreaProvider>\n\t\t\t\t</EditorProvider>\n\t\t\t\t<EditorHelpTopics\n\t\t\t\t\tisVisible={ this.state.isHelpVisible }\n\t\t\t\t\tonClose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tclose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tshowSupport={ capabilities?.supportSection === true }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nconst ComposedNativeProvider = compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\t__unstableIsEditorReady: isEditorReady,\n\t\t\tgetEditorBlocks,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostContent,\n\t\t\tgetEditorSettings,\n\t\t\tgetEditorMode,\n\t\t} = select( editorStore );\n\n\t\tconst { getBlockIndex, getSelectedBlockClientId, getGlobalBlockCount } =\n\t\t\tselect( blockEditorStore );\n\n\t\tconst settings = getEditorSettings();\n\t\tconst defaultEditorColors = settings?.colors ?? [];\n\t\tconst defaultEditorGradients = settings?.gradients ?? [];\n\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t\tisReady: isEditorReady(),\n\t\t\tblocks: getEditorBlocks(),\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tgetEditedPostContent,\n\t\t\tdefaultEditorColors,\n\t\t\tdefaultEditorGradients,\n\t\t\tselectedBlockIndex: getBlockIndex( selectedBlockClientId ),\n\t\t\tblockCount: getGlobalBlockCount(),\n\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst {\n\t\t\teditPost,\n\t\t\tresetEditorBlocks,\n\t\t\tupdateEditorSettings,\n\t\t\tswitchEditorMode,\n\t\t} = dispatch( editorStore );\n\t\tconst {\n\t\t\tclearSelectedBlock,\n\t\t\tupdateSettings,\n\t\t\tinsertBlock,\n\t\t\treplaceBlock,\n\t\t} = dispatch( blockEditorStore );\n\t\tconst { addEntities, receiveEntityRecords } = dispatch( coreStore );\n\t\tconst { createSuccessNotice, createErrorNotice } =\n\t\t\tdispatch( noticesStore );\n\n\t\treturn {\n\t\t\tupdateBlockEditorSettings: updateSettings,\n\t\t\tupdateEditorSettings,\n\t\t\taddEntities,\n\t\t\tinsertBlock,\n\t\t\tcreateSuccessNotice,\n\t\t\tcreateErrorNotice,\n\t\t\tclearSelectedBlock,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\treceiveEntityRecords,\n\t\t\tresetEditorBlocksWithoutUndoLevel( blocks ) {\n\t\t\t\tresetEditorBlocks( blocks, {\n\t\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tswitchMode( mode ) {\n\t\t\t\tswitchEditorMode( mode );\n\t\t\t},\n\t\t\treplaceBlock,\n\t\t};\n\t} ),\n] )( NativeEditorProvider );\n\nexport default ComposedNativeProvider;\nexport { ComposedNativeProvider as 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ByD,cAAc;IACd9G,WAAW;IACXqE;EACD,CAAC,GAAGqC,QAAQ,CAAEL,kBAAiB,CAAC;EAChC,MAAM;IAAE1J,WAAW;IAAEC;EAAqB,CAAC,GAAG8J,QAAQ,CAAEK,eAAU,CAAC;EACnE,MAAM;IAAEjG,mBAAmB;IAAEtD;EAAkB,CAAC,GAC/CkJ,QAAQ,CAAEM,cAAa,CAAC;EAEzB,OAAO;IACNpJ,yBAAyB,EAAEkJ,cAAc;IACzCnJ,oBAAoB;IACpBhB,WAAW;IACXqD,WAAW;IACXc,mBAAmB;IACnBtD,iBAAiB;IACjB6F,kBAAkB;IAClB9E,SAASA,CAAEC,KAAK,EAAG;MAClBmI,QAAQ,CAAE;QAAEnI;MAAM,CAAE,CAAC;IACtB,CAAC;IACD5B,oBAAoB;IACpBuH,iCAAiCA,CAAEnI,MAAM,EAAG;MAC3C4K,iBAAiB,CAAE5K,MAAM,EAAE;QAC1BiL,+BAA+B,EAAE;MAClC,CAAE,CAAC;IACJ,CAAC;IACD3C,UAAUA,CAAEhB,IAAI,EAAG;MAClBuD,gBAAgB,CAAEvD,IAAK,CAAC;IACzB,CAAC;IACDe;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAEhI,oBAAqB,CAAC;AAAC,IAAA6K,QAAA,GAAA9B,OAAA,CAAAzK,OAAA,GAEbwK,sBAAsB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_blockEditor","NavigationBlockEditingMode","blockClientId","useSelect","select","blockEditorStore","getBlockOrder","setBlockEditingMode","unsetBlockEditingMode","useDispatch","useEffect"],"sources":["@wordpress/editor/src/components/provider/navigation-block-editing-mode.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * For the Navigation block editor, we need to force the block editor to contentOnly for that block.\n *\n * Set block editing mode to contentOnly when entering Navigation focus mode.\n * this ensures that non-content controls on the block will be hidden and thus\n * the user can focus on editing the Navigation Menu content only.\n */\n\nexport default function NavigationBlockEditingMode() {\n\t// In the navigation block editor,\n\t// the navigation block is the only root block.\n\tconst blockClientId = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlockOrder()?.[ 0 ],\n\t\t[]\n\t);\n\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tif ( ! blockClientId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetBlockEditingMode( blockClientId, 'contentOnly' );\n\n\t\treturn () => {\n\t\t\tunsetBlockEditingMode( blockClientId );\n\t\t};\n\t}, [ blockClientId, unsetBlockEditingMode, setBlockEditingMode ] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe,SAASG,0BAA0BA,CAAA,EAAG;EACpD;EACA;EACA,MAAMC,aAAa,GAAG,IAAAC,eAAS,EAC5BC,MAAM,IAAMA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,aAAa,CAAC,CAAC,GAAI,CAAC,CAAE,EAC/D,EACD,CAAC;EACD,MAAM;IAAEC,mBAAmB;IAAEC;EAAsB,CAAC,GACnD,IAAAC,iBAAW,EAAEJ,kBAAiB,CAAC;EAEhC,IAAAK,kBAAS,EAAE,MAAM;IAChB,IAAK,CAAER,aAAa,EAAG;MACtB;IACD;IAEAK,mBAAmB,CAAEL,aAAa,EAAE,aAAc,CAAC;IAEnD,OAAO,MAAM;MACZM,qBAAqB,CAAEN,aAAc,CAAC;IACvC,CAAC;EACF,CAAC,EAAE,CAAEA,aAAa,EAAEM,qBAAqB,EAAED,mBAAmB,CAAG,CAAC;AACnE"}
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_blockEditor","NavigationBlockEditingMode","blockClientId","useSelect","select","blockEditorStore","getBlockOrder","setBlockEditingMode","unsetBlockEditingMode","useDispatch","useEffect"],"sources":["@wordpress/editor/src/components/provider/navigation-block-editing-mode.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * For the Navigation block editor, we need to force the block editor to contentOnly for that block.\n *\n * Set block editing mode to contentOnly when entering Navigation focus mode.\n * this ensures that non-content controls on the block will be hidden and thus\n * the user can focus on editing the Navigation Menu content only.\n */\n\nexport default function NavigationBlockEditingMode() {\n\t// In the navigation block editor,\n\t// the navigation block is the only root block.\n\tconst blockClientId = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlockOrder()?.[ 0 ],\n\t\t[]\n\t);\n\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tif ( ! blockClientId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetBlockEditingMode( blockClientId, 'contentOnly' );\n\n\t\treturn () => {\n\t\t\tunsetBlockEditingMode( blockClientId );\n\t\t};\n\t}, [ blockClientId, unsetBlockEditingMode, setBlockEditingMode ] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe,SAASG,0BAA0BA,CAAA,EAAG;EACpD;EACA;EACA,MAAMC,aAAa,GAAG,IAAAC,eAAS,EAC5BC,MAAM,IAAMA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,aAAa,CAAC,CAAC,GAAI,CAAC,CAAE,EAC/D,EACD,CAAC;EACD,MAAM;IAAEC,mBAAmB;IAAEC;EAAsB,CAAC,GACnD,IAAAC,iBAAW,EAAEJ,kBAAiB,CAAC;EAEhC,IAAAK,kBAAS,EAAE,MAAM;IAChB,IAAK,CAAER,aAAa,EAAG;MACtB;IACD;IAEAK,mBAAmB,CAAEL,aAAa,EAAE,aAAc,CAAC;IAEnD,OAAO,MAAM;MACZM,qBAAqB,CAAEN,aAAc,CAAC;IACvC,CAAC;EACF,CAAC,EAAE,CAAEA,aAAa,EAAEM,qBAAqB,EAAED,mBAAmB,CAAG,CAAC;AACnE","ignoreList":[]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _data = require("@wordpress/data");
|
|
8
|
+
var _element = require("@wordpress/element");
|
|
9
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
10
|
+
var _preferences = require("@wordpress/preferences");
|
|
11
|
+
var _interface = require("@wordpress/interface");
|
|
12
|
+
/**
|
|
13
|
+
* WordPress dependencies
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* This listener hook monitors for block selection and triggers the appropriate
|
|
18
|
+
* sidebar state.
|
|
19
|
+
*/
|
|
20
|
+
function useAutoSwitchEditorSidebars() {
|
|
21
|
+
const {
|
|
22
|
+
hasBlockSelection
|
|
23
|
+
} = (0, _data.useSelect)(select => {
|
|
24
|
+
return {
|
|
25
|
+
hasBlockSelection: !!select(_blockEditor.store).getBlockSelectionStart()
|
|
26
|
+
};
|
|
27
|
+
}, []);
|
|
28
|
+
const {
|
|
29
|
+
getActiveComplementaryArea
|
|
30
|
+
} = (0, _data.useSelect)(_interface.store);
|
|
31
|
+
const {
|
|
32
|
+
enableComplementaryArea
|
|
33
|
+
} = (0, _data.useDispatch)(_interface.store);
|
|
34
|
+
const {
|
|
35
|
+
get: getPreference
|
|
36
|
+
} = (0, _data.useSelect)(_preferences.store);
|
|
37
|
+
(0, _element.useEffect)(() => {
|
|
38
|
+
const activeGeneralSidebar = getActiveComplementaryArea('core');
|
|
39
|
+
const isEditorSidebarOpened = ['edit-post/document', 'edit-post/block'].includes(activeGeneralSidebar);
|
|
40
|
+
const isDistractionFree = getPreference('core', 'distractionFree');
|
|
41
|
+
if (!isEditorSidebarOpened || isDistractionFree) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (hasBlockSelection) {
|
|
45
|
+
enableComplementaryArea('core', 'edit-post/block');
|
|
46
|
+
} else {
|
|
47
|
+
enableComplementaryArea('core', 'edit-post/document');
|
|
48
|
+
}
|
|
49
|
+
}, [hasBlockSelection, getActiveComplementaryArea, enableComplementaryArea, getPreference]);
|
|
50
|
+
}
|
|
51
|
+
var _default = exports.default = useAutoSwitchEditorSidebars;
|
|
52
|
+
//# sourceMappingURL=use-auto-switch-editor-sidebars.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_data","require","_element","_blockEditor","_preferences","_interface","useAutoSwitchEditorSidebars","hasBlockSelection","useSelect","select","blockEditorStore","getBlockSelectionStart","getActiveComplementaryArea","interfaceStore","enableComplementaryArea","useDispatch","get","getPreference","preferencesStore","useEffect","activeGeneralSidebar","isEditorSidebarOpened","includes","isDistractionFree","_default","exports","default"],"sources":["@wordpress/editor/src/components/provider/use-auto-switch-editor-sidebars.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * This listener hook monitors for block selection and triggers the appropriate\n * sidebar state.\n */\nfunction useAutoSwitchEditorSidebars() {\n\tconst { hasBlockSelection } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\thasBlockSelection:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t};\n\t}, [] );\n\n\tconst { getActiveComplementaryArea } = useSelect( interfaceStore );\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tconst { get: getPreference } = useSelect( preferencesStore );\n\n\tuseEffect( () => {\n\t\tconst activeGeneralSidebar = getActiveComplementaryArea( 'core' );\n\t\tconst isEditorSidebarOpened = [\n\t\t\t'edit-post/document',\n\t\t\t'edit-post/block',\n\t\t].includes( activeGeneralSidebar );\n\t\tconst isDistractionFree = getPreference( 'core', 'distractionFree' );\n\t\tif ( ! isEditorSidebarOpened || isDistractionFree ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( hasBlockSelection ) {\n\t\t\tenableComplementaryArea( 'core', 'edit-post/block' );\n\t\t} else {\n\t\t\tenableComplementaryArea( 'core', 'edit-post/document' );\n\t\t}\n\t}, [\n\t\thasBlockSelection,\n\t\tgetActiveComplementaryArea,\n\t\tenableComplementaryArea,\n\t\tgetPreference,\n\t] );\n}\n\nexport default useAutoSwitchEditorSidebars;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAPA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA,SAASK,2BAA2BA,CAAA,EAAG;EACtC,MAAM;IAAEC;EAAkB,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACtD,OAAO;MACNF,iBAAiB,EAChB,CAAC,CAAEE,MAAM,CAAEC,kBAAiB,CAAC,CAACC,sBAAsB,CAAC;IACvD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEC;EAA2B,CAAC,GAAG,IAAAJ,eAAS,EAAEK,gBAAe,CAAC;EAClE,MAAM;IAAEC;EAAwB,CAAC,GAAG,IAAAC,iBAAW,EAAEF,gBAAe,CAAC;EACjE,MAAM;IAAEG,GAAG,EAAEC;EAAc,CAAC,GAAG,IAAAT,eAAS,EAAEU,kBAAiB,CAAC;EAE5D,IAAAC,kBAAS,EAAE,MAAM;IAChB,MAAMC,oBAAoB,GAAGR,0BAA0B,CAAE,MAAO,CAAC;IACjE,MAAMS,qBAAqB,GAAG,CAC7B,oBAAoB,EACpB,iBAAiB,CACjB,CAACC,QAAQ,CAAEF,oBAAqB,CAAC;IAClC,MAAMG,iBAAiB,GAAGN,aAAa,CAAE,MAAM,EAAE,iBAAkB,CAAC;IACpE,IAAK,CAAEI,qBAAqB,IAAIE,iBAAiB,EAAG;MACnD;IACD;IACA,IAAKhB,iBAAiB,EAAG;MACxBO,uBAAuB,CAAE,MAAM,EAAE,iBAAkB,CAAC;IACrD,CAAC,MAAM;MACNA,uBAAuB,CAAE,MAAM,EAAE,oBAAqB,CAAC;IACxD;EACD,CAAC,EAAE,CACFP,iBAAiB,EACjBK,0BAA0B,EAC1BE,uBAAuB,EACvBG,aAAa,CACZ,CAAC;AACJ;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcpB,2BAA2B","ignoreList":[]}
|
|
@@ -32,18 +32,19 @@ function __experimentalReusableBlocksSelect(select) {
|
|
|
32
32
|
per_page: -1
|
|
33
33
|
})) !== null && _select$getEntityReco !== void 0 ? _select$getEntityReco : EMPTY_BLOCKS_LIST;
|
|
34
34
|
}
|
|
35
|
-
const BLOCK_EDITOR_SETTINGS = ['__experimentalBlockDirectory', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalGlobalStylesBaseStyles', '__unstableGalleryWithImageBlocks', 'alignWide', 'blockInspectorTabs', 'allowedMimeTypes', 'bodyPlaceholder', 'canLockBlocks', 'capabilities', 'clearBlockSelection', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomSpacingSizes', 'disableCustomGradients', 'disableLayoutStyles', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'enableOpenverseMediaCategory', 'fontSizes', 'gradients', 'generateAnchors', 'onNavigateToEntityRecord', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isRTL', 'locale', 'maxWidth', 'postContentAttributes', 'postsPerPage', 'readOnly', 'styles', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableHasCustomAppender', '__unstableIsPreviewMode', '__unstableResolvedAssets', '__unstableIsBlockBasedTheme', '__experimentalArchiveTitleTypeLabel', '__experimentalArchiveTitleNameLabel'];
|
|
35
|
+
const BLOCK_EDITOR_SETTINGS = ['__experimentalBlockDirectory', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalGlobalStylesBaseStyles', '__unstableGalleryWithImageBlocks', 'alignWide', 'blockInspectorTabs', 'allowedMimeTypes', 'bodyPlaceholder', 'canLockBlocks', 'capabilities', 'clearBlockSelection', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomSpacingSizes', 'disableCustomGradients', 'disableLayoutStyles', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'enableOpenverseMediaCategory', 'fontSizes', 'gradients', 'generateAnchors', 'onNavigateToEntityRecord', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isRTL', 'locale', 'maxWidth', 'postContentAttributes', 'postsPerPage', 'readOnly', 'sectionRootClientId', 'styles', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableHasCustomAppender', '__unstableIsPreviewMode', '__unstableResolvedAssets', '__unstableIsBlockBasedTheme', '__experimentalArchiveTitleTypeLabel', '__experimentalArchiveTitleNameLabel'];
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* React hook used to compute the block editor settings to use for the post editor.
|
|
39
39
|
*
|
|
40
|
-
* @param {Object} settings
|
|
41
|
-
* @param {string} postType
|
|
42
|
-
* @param {string} postId
|
|
40
|
+
* @param {Object} settings EditorProvider settings prop.
|
|
41
|
+
* @param {string} postType Editor root level post type.
|
|
42
|
+
* @param {string} postId Editor root level post ID.
|
|
43
|
+
* @param {string} renderingMode Editor rendering mode.
|
|
43
44
|
*
|
|
44
45
|
* @return {Object} Block Editor Settings.
|
|
45
46
|
*/
|
|
46
|
-
function useBlockEditorSettings(settings, postType, postId) {
|
|
47
|
+
function useBlockEditorSettings(settings, postType, postId, renderingMode) {
|
|
47
48
|
var _settings$__experimen, _settings$__experimen2;
|
|
48
49
|
const isLargeViewport = (0, _compose.useViewportMatch)('medium');
|
|
49
50
|
const {
|
|
@@ -60,7 +61,8 @@ function useBlockEditorSettings(settings, postType, postId) {
|
|
|
60
61
|
pageOnFront,
|
|
61
62
|
pageForPosts,
|
|
62
63
|
userPatternCategories,
|
|
63
|
-
restBlockPatternCategories
|
|
64
|
+
restBlockPatternCategories,
|
|
65
|
+
sectionRootClientId
|
|
64
66
|
} = (0, _data.useSelect)(select => {
|
|
65
67
|
var _canUser;
|
|
66
68
|
const {
|
|
@@ -76,7 +78,19 @@ function useBlockEditorSettings(settings, postType, postId) {
|
|
|
76
78
|
const {
|
|
77
79
|
getBlockTypes
|
|
78
80
|
} = select(_blocks.store);
|
|
81
|
+
const {
|
|
82
|
+
getBlocksByName,
|
|
83
|
+
getBlockAttributes
|
|
84
|
+
} = select(_blockEditor.store);
|
|
79
85
|
const siteSettings = canUser('read', 'settings') ? getEntityRecord('root', 'site') : undefined;
|
|
86
|
+
function getSectionRootBlock() {
|
|
87
|
+
var _getBlocksByName$find;
|
|
88
|
+
if (renderingMode === 'template-locked') {
|
|
89
|
+
var _getBlocksByName$;
|
|
90
|
+
return (_getBlocksByName$ = getBlocksByName('core/post-content')?.[0]) !== null && _getBlocksByName$ !== void 0 ? _getBlocksByName$ : '';
|
|
91
|
+
}
|
|
92
|
+
return (_getBlocksByName$find = getBlocksByName('core/group').find(clientId => getBlockAttributes(clientId)?.tagName === 'main')) !== null && _getBlocksByName$find !== void 0 ? _getBlocksByName$find : '';
|
|
93
|
+
}
|
|
80
94
|
return {
|
|
81
95
|
allowRightClickOverrides: get('core', 'allowRightClickOverrides'),
|
|
82
96
|
blockTypes: getBlockTypes(),
|
|
@@ -91,9 +105,10 @@ function useBlockEditorSettings(settings, postType, postId) {
|
|
|
91
105
|
pageOnFront: siteSettings?.page_on_front,
|
|
92
106
|
pageForPosts: siteSettings?.page_for_posts,
|
|
93
107
|
userPatternCategories: getUserPatternCategories(),
|
|
94
|
-
restBlockPatternCategories: getBlockPatternCategories()
|
|
108
|
+
restBlockPatternCategories: getBlockPatternCategories(),
|
|
109
|
+
sectionRootClientId: getSectionRootBlock()
|
|
95
110
|
};
|
|
96
|
-
}, [postType, postId, isLargeViewport]);
|
|
111
|
+
}, [postType, postId, isLargeViewport, renderingMode]);
|
|
97
112
|
const settingsBlockPatterns = (_settings$__experimen = settings.__experimentalAdditionalBlockPatterns) !== null && _settings$__experimen !== void 0 ? _settings$__experimen :
|
|
98
113
|
// WP 6.0
|
|
99
114
|
settings.__experimentalBlockPatterns; // WP 5.9
|
|
@@ -144,41 +159,47 @@ function useBlockEditorSettings(settings, postType, postId) {
|
|
|
144
159
|
return settings.allowedBlockTypes;
|
|
145
160
|
}, [settings.allowedBlockTypes, hiddenBlockTypes, blockTypes]);
|
|
146
161
|
const forceDisableFocusMode = settings.focusMode === false;
|
|
147
|
-
return (0, _element.useMemo)(() =>
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
162
|
+
return (0, _element.useMemo)(() => {
|
|
163
|
+
const blockEditorSettings = {
|
|
164
|
+
...Object.fromEntries(Object.entries(settings).filter(([key]) => BLOCK_EDITOR_SETTINGS.includes(key))),
|
|
165
|
+
allowedBlockTypes,
|
|
166
|
+
allowRightClickOverrides,
|
|
167
|
+
focusMode: focusMode && !forceDisableFocusMode,
|
|
168
|
+
hasFixedToolbar,
|
|
169
|
+
isDistractionFree,
|
|
170
|
+
keepCaretInsideBlock,
|
|
171
|
+
mediaUpload: hasUploadPermissions ? _utils.mediaUpload : undefined,
|
|
172
|
+
__experimentalBlockPatterns: blockPatterns,
|
|
173
|
+
[(0, _lockUnlock.unlock)(_blockEditor.privateApis).selectBlockPatternsKey]: select => (0, _lockUnlock.unlock)(select(_coreData.store)).getBlockPatternsForPostType(postType),
|
|
174
|
+
[(0, _lockUnlock.unlock)(_blockEditor.privateApis).reusableBlocksSelectKey]: __experimentalReusableBlocksSelect,
|
|
175
|
+
__experimentalBlockPatternCategories: blockPatternCategories,
|
|
176
|
+
__experimentalUserPatternCategories: userPatternCategories,
|
|
177
|
+
__experimentalFetchLinkSuggestions: (search, searchOptions) => (0, _coreData.__experimentalFetchLinkSuggestions)(search, searchOptions, settings),
|
|
178
|
+
inserterMediaCategories: _mediaCategories.default,
|
|
179
|
+
__experimentalFetchRichUrlData: _coreData.__experimentalFetchUrlData,
|
|
180
|
+
// Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.
|
|
181
|
+
// This might be better as a generic "canUser" selector.
|
|
182
|
+
__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,
|
|
183
|
+
//Todo: this is only needed for native and should probably be removed.
|
|
184
|
+
__experimentalUndo: undo,
|
|
185
|
+
// Check whether we want all site editor frames to have outlines
|
|
186
|
+
// including the navigation / pattern / parts editors.
|
|
187
|
+
outlineMode: postType === 'wp_template',
|
|
188
|
+
// Check these two properties: they were not present in the site editor.
|
|
189
|
+
__experimentalCreatePageEntity: createPageEntity,
|
|
190
|
+
__experimentalUserCanCreatePages: userCanCreatePages,
|
|
191
|
+
pageOnFront,
|
|
192
|
+
pageForPosts,
|
|
193
|
+
__experimentalPreferPatternsOnRoot: postType === 'wp_template',
|
|
194
|
+
templateLock: postType === 'wp_navigation' ? 'insert' : settings.templateLock,
|
|
195
|
+
template: postType === 'wp_navigation' ? [['core/navigation', {}, []]] : settings.template,
|
|
196
|
+
__experimentalSetIsInserterOpened: setIsInserterOpened
|
|
197
|
+
};
|
|
198
|
+
(0, _lockUnlock.lock)(blockEditorSettings, {
|
|
199
|
+
sectionRootClientId
|
|
200
|
+
});
|
|
201
|
+
return blockEditorSettings;
|
|
202
|
+
}, [allowedBlockTypes, allowRightClickOverrides, focusMode, forceDisableFocusMode, hasFixedToolbar, isDistractionFree, keepCaretInsideBlock, settings, hasUploadPermissions, userPatternCategories, blockPatterns, blockPatternCategories, canUseUnfilteredHTML, undo, createPageEntity, userCanCreatePages, pageOnFront, pageForPosts, postType, setIsInserterOpened, sectionRootClientId]);
|
|
182
203
|
}
|
|
183
204
|
var _default = exports.default = useBlockEditorSettings;
|
|
184
205
|
//# sourceMappingURL=use-block-editor-settings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_coreData","_i18n","_preferences","_compose","_blocks","_blockEditor","_mediaCategories","_interopRequireDefault","_utils","_store","_lockUnlock","EMPTY_BLOCKS_LIST","__experimentalReusableBlocksSelect","select","_select$getEntityReco","coreStore","getEntityRecords","per_page","BLOCK_EDITOR_SETTINGS","useBlockEditorSettings","settings","postType","postId","_settings$__experimen","_settings$__experimen2","isLargeViewport","useViewportMatch","allowRightClickOverrides","blockTypes","focusMode","hasFixedToolbar","isDistractionFree","keepCaretInsideBlock","hasUploadPermissions","hiddenBlockTypes","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","pageForPosts","userPatternCategories","restBlockPatternCategories","useSelect","_canUser","canUser","getRawEntityRecord","getEntityRecord","getUserPatternCategories","getBlockPatternCategories","get","preferencesStore","getBlockTypes","blocksStore","siteSettings","undefined","_links","hasOwnProperty","page_on_front","page_for_posts","settingsBlockPatterns","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","settingsBlockPatternCategories","__experimentalAdditionalBlockPatternCategories","__experimentalBlockPatternCategories","blockPatterns","useMemo","filter","postTypes","Array","isArray","includes","blockPatternCategories","x","index","arr","findIndex","y","name","undo","setIsInserterOpened","useDispatch","editorStore","saveEntityRecord","createPageEntity","useCallback","options","Promise","reject","message","__","allowedBlockTypes","length","defaultAllowedBlockTypes","map","type","forceDisableFocusMode","Object","fromEntries","entries","key","mediaUpload","unlock","privateApis","selectBlockPatternsKey","getBlockPatternsForPostType","reusableBlocksSelectKey","__experimentalUserPatternCategories","__experimentalFetchLinkSuggestions","search","searchOptions","fetchLinkSuggestions","inserterMediaCategories","__experimentalFetchRichUrlData","fetchUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot","templateLock","template","__experimentalSetIsInserterOpened","_default","exports","default"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { privateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst EMPTY_BLOCKS_LIST = [];\n\nfunction __experimentalReusableBlocksSelect( select ) {\n\treturn (\n\t\tselect( coreStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\tper_page: -1,\n\t\t} ) ?? EMPTY_BLOCKS_LIST\n\t);\n}\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'__unstableGalleryWithImageBlocks',\n\t'alignWide',\n\t'blockInspectorTabs',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canLockBlocks',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableCustomColors',\n\t'disableCustomFontSizes',\n\t'disableCustomSpacingSizes',\n\t'disableCustomGradients',\n\t'disableLayoutStyles',\n\t'enableCustomLineHeight',\n\t'enableCustomSpacing',\n\t'enableCustomUnits',\n\t'enableOpenverseMediaCategory',\n\t'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'onNavigateToEntityRecord',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isRTL',\n\t'locale',\n\t'maxWidth',\n\t'postContentAttributes',\n\t'postsPerPage',\n\t'readOnly',\n\t'styles',\n\t'titlePlaceholder',\n\t'supportsLayout',\n\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t'__unstableHasCustomAppender',\n\t'__unstableIsPreviewMode',\n\t'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n\t'__experimentalArchiveTitleTypeLabel',\n\t'__experimentalArchiveTitleNameLabel',\n];\n\n/**\n * React hook used to compute the block editor settings to use for the post editor.\n *\n * @param {Object} settings EditorProvider settings prop.\n * @param {string} postType Editor root level post type.\n * @param {string} postId Editor root level post ID.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallowRightClickOverrides,\n\t\tblockTypes,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\thasUploadPermissions,\n\t\thiddenBlockTypes,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tuserPatternCategories,\n\t\trestBlockPatternCategories,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetUserPatternCategories,\n\t\t\t\tgetBlockPatternCategories,\n\t\t\t} = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { getBlockTypes } = select( blocksStore );\n\t\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\treturn {\n\t\t\t\tallowRightClickOverrides: get(\n\t\t\t\t\t'core',\n\t\t\t\t\t'allowRightClickOverrides'\n\t\t\t\t),\n\t\t\t\tblockTypes: getBlockTypes(),\n\t\t\t\tcanUseUnfilteredHTML: getRawEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t)?._links?.hasOwnProperty( 'wp:action-unfiltered-html' ),\n\t\t\t\tfocusMode: get( 'core', 'focusMode' ),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tget( 'core', 'fixedToolbar' ) || ! isLargeViewport,\n\t\t\t\thiddenBlockTypes: get( 'core', 'hiddenBlockTypes' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tkeepCaretInsideBlock: get( 'core', 'keepCaretInsideBlock' ),\n\t\t\t\thasUploadPermissions: canUser( 'create', 'media' ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', 'pages' ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t\t\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, isLargeViewport ]\n\t);\n\n\tconst settingsBlockPatterns =\n\t\tsettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatterns; // WP 5.9\n\tconst settingsBlockPatternCategories =\n\t\tsettings.__experimentalAdditionalBlockPatternCategories ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatternCategories; // WP 5.9\n\n\tconst blockPatterns = useMemo(\n\t\t() =>\n\t\t\t[ ...( settingsBlockPatterns || [] ) ].filter(\n\t\t\t\t( { postTypes } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t! postTypes ||\n\t\t\t\t\t\t( Array.isArray( postTypes ) &&\n\t\t\t\t\t\t\tpostTypes.includes( postType ) )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t),\n\t\t[ settingsBlockPatterns, postType ]\n\t);\n\n\tconst blockPatternCategories = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatternCategories || [] ),\n\t\t\t\t...( restBlockPatternCategories || [] ),\n\t\t\t].filter(\n\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t),\n\t\t[ settingsBlockPatternCategories, restBlockPatternCategories ]\n\t);\n\n\tconst { undo, setIsInserterOpened } = useDispatch( editorStore );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\t/**\n\t * Creates a Post entity.\n\t * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.\n\t *\n\t * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.\n\t * @return {Object} the post type object that was created.\n\t */\n\tconst createPageEntity = useCallback(\n\t\t( options ) => {\n\t\t\tif ( ! userCanCreatePages ) {\n\t\t\t\treturn Promise.reject( {\n\t\t\t\t\tmessage: __(\n\t\t\t\t\t\t'You do not have permission to create Pages.'\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t\t},\n\t\t[ saveEntityRecord, userCanCreatePages ]\n\t);\n\n\tconst allowedBlockTypes = useMemo( () => {\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes && hiddenBlockTypes.length > 0 ) {\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\treturn defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn settings.allowedBlockTypes;\n\t}, [ settings.allowedBlockTypes, hiddenBlockTypes, blockTypes ] );\n\n\tconst forceDisableFocusMode = settings.focusMode === false;\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\t...Object.fromEntries(\n\t\t\t\tObject.entries( settings ).filter( ( [ key ] ) =>\n\t\t\t\t\tBLOCK_EDITOR_SETTINGS.includes( key )\n\t\t\t\t)\n\t\t\t),\n\t\t\tallowedBlockTypes,\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode: focusMode && ! forceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t[ unlock( privateApis ).selectBlockPatternsKey ]: ( select ) =>\n\t\t\t\tunlock( select( coreStore ) ).getBlockPatternsForPostType(\n\t\t\t\t\tpostType\n\t\t\t\t),\n\t\t\t[ unlock( privateApis ).reusableBlocksSelectKey ]:\n\t\t\t\t__experimentalReusableBlocksSelect,\n\t\t\t__experimentalBlockPatternCategories: blockPatternCategories,\n\t\t\t__experimentalUserPatternCategories: userPatternCategories,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\tinserterMediaCategories,\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t// Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.\n\t\t\t// This might be better as a generic \"canUser\" selector.\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t//Todo: this is only needed for native and should probably be removed.\n\t\t\t__experimentalUndo: undo,\n\t\t\t// Check whether we want all site editor frames to have outlines\n\t\t\t// including the navigation / pattern / parts editors.\n\t\t\toutlineMode: postType === 'wp_template',\n\t\t\t// Check these two properties: they were not present in the site editor.\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\t__experimentalPreferPatternsOnRoot: postType === 'wp_template',\n\t\t\ttemplateLock:\n\t\t\t\tpostType === 'wp_navigation' ? 'insert' : settings.templateLock,\n\t\t\ttemplate:\n\t\t\t\tpostType === 'wp_navigation'\n\t\t\t\t\t? [ [ 'core/navigation', {}, [] ] ]\n\t\t\t\t\t: settings.template,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t} ),\n\t\t[\n\t\t\tallowedBlockTypes,\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode,\n\t\t\tforceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tsettings,\n\t\t\thasUploadPermissions,\n\t\t\tuserPatternCategories,\n\t\t\tblockPatterns,\n\t\t\tblockPatternCategories,\n\t\t\tcanUseUnfilteredHTML,\n\t\t\tundo,\n\t\t\tcreatePageEntity,\n\t\t\tuserCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\tpostType,\n\t\t\tsetIsInserterOpened,\n\t\t]\n\t);\n}\n\nexport default useBlockEditorSettings;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAKA,IAAAQ,gBAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AAtBA;AACA;AACA;;AAcA;AACA;AACA;;AAMA,MAAMa,iBAAiB,GAAG,EAAE;AAE5B,SAASC,kCAAkCA,CAAEC,MAAM,EAAG;EAAA,IAAAC,qBAAA;EACrD,QAAAA,qBAAA,GACCD,MAAM,CAAEE,eAAU,CAAC,CAACC,gBAAgB,CAAE,UAAU,EAAE,UAAU,EAAE;IAC7DC,QAAQ,EAAE,CAAC;EACZ,CAAE,CAAC,cAAAH,qBAAA,cAAAA,qBAAA,GAAIH,iBAAiB;AAE1B;AAEA,MAAMO,qBAAqB,GAAG,CAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,wBAAwB,EACxB,sCAAsC,EACtC,kCAAkC,EAClC,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,QAAQ,EACR,qBAAqB,EACrB,wBAAwB,EACxB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ClBC,WAAW,EACXC,YAAY,EACZjB,QAAQ,EACR0D,mBAAmB,CAErB,CAAC;AACF;AAAC,IAAA4C,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc1G,sBAAsB"}
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_coreData","_i18n","_preferences","_compose","_blocks","_blockEditor","_mediaCategories","_interopRequireDefault","_utils","_store","_lockUnlock","EMPTY_BLOCKS_LIST","__experimentalReusableBlocksSelect","select","_select$getEntityReco","coreStore","getEntityRecords","per_page","BLOCK_EDITOR_SETTINGS","useBlockEditorSettings","settings","postType","postId","renderingMode","_settings$__experimen","_settings$__experimen2","isLargeViewport","useViewportMatch","allowRightClickOverrides","blockTypes","focusMode","hasFixedToolbar","isDistractionFree","keepCaretInsideBlock","hasUploadPermissions","hiddenBlockTypes","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","pageForPosts","userPatternCategories","restBlockPatternCategories","sectionRootClientId","useSelect","_canUser","canUser","getRawEntityRecord","getEntityRecord","getUserPatternCategories","getBlockPatternCategories","get","preferencesStore","getBlockTypes","blocksStore","getBlocksByName","getBlockAttributes","blockEditorStore","siteSettings","undefined","getSectionRootBlock","_getBlocksByName$find","_getBlocksByName$","find","clientId","tagName","_links","hasOwnProperty","page_on_front","page_for_posts","settingsBlockPatterns","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","settingsBlockPatternCategories","__experimentalAdditionalBlockPatternCategories","__experimentalBlockPatternCategories","blockPatterns","useMemo","filter","postTypes","Array","isArray","includes","blockPatternCategories","x","index","arr","findIndex","y","name","undo","setIsInserterOpened","useDispatch","editorStore","saveEntityRecord","createPageEntity","useCallback","options","Promise","reject","message","__","allowedBlockTypes","length","defaultAllowedBlockTypes","map","type","forceDisableFocusMode","blockEditorSettings","Object","fromEntries","entries","key","mediaUpload","unlock","privateApis","selectBlockPatternsKey","getBlockPatternsForPostType","reusableBlocksSelectKey","__experimentalUserPatternCategories","__experimentalFetchLinkSuggestions","search","searchOptions","fetchLinkSuggestions","inserterMediaCategories","__experimentalFetchRichUrlData","fetchUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot","templateLock","template","__experimentalSetIsInserterOpened","lock","_default","exports","default"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tprivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport { store as editorStore } from '../../store';\nimport { lock, unlock } from '../../lock-unlock';\n\nconst EMPTY_BLOCKS_LIST = [];\n\nfunction __experimentalReusableBlocksSelect( select ) {\n\treturn (\n\t\tselect( coreStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\tper_page: -1,\n\t\t} ) ?? EMPTY_BLOCKS_LIST\n\t);\n}\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'__unstableGalleryWithImageBlocks',\n\t'alignWide',\n\t'blockInspectorTabs',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canLockBlocks',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableCustomColors',\n\t'disableCustomFontSizes',\n\t'disableCustomSpacingSizes',\n\t'disableCustomGradients',\n\t'disableLayoutStyles',\n\t'enableCustomLineHeight',\n\t'enableCustomSpacing',\n\t'enableCustomUnits',\n\t'enableOpenverseMediaCategory',\n\t'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'onNavigateToEntityRecord',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isRTL',\n\t'locale',\n\t'maxWidth',\n\t'postContentAttributes',\n\t'postsPerPage',\n\t'readOnly',\n\t'sectionRootClientId',\n\t'styles',\n\t'titlePlaceholder',\n\t'supportsLayout',\n\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t'__unstableHasCustomAppender',\n\t'__unstableIsPreviewMode',\n\t'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n\t'__experimentalArchiveTitleTypeLabel',\n\t'__experimentalArchiveTitleNameLabel',\n];\n\n/**\n * React hook used to compute the block editor settings to use for the post editor.\n *\n * @param {Object} settings EditorProvider settings prop.\n * @param {string} postType Editor root level post type.\n * @param {string} postId Editor root level post ID.\n * @param {string} renderingMode Editor rendering mode.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId, renderingMode ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallowRightClickOverrides,\n\t\tblockTypes,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\thasUploadPermissions,\n\t\thiddenBlockTypes,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tuserPatternCategories,\n\t\trestBlockPatternCategories,\n\t\tsectionRootClientId,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetUserPatternCategories,\n\t\t\t\tgetBlockPatternCategories,\n\t\t\t} = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { getBlockTypes } = select( blocksStore );\n\t\t\tconst { getBlocksByName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\tfunction getSectionRootBlock() {\n\t\t\t\tif ( renderingMode === 'template-locked' ) {\n\t\t\t\t\treturn getBlocksByName( 'core/post-content' )?.[ 0 ] ?? '';\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tgetBlocksByName( 'core/group' ).find(\n\t\t\t\t\t\t( clientId ) =>\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )?.tagName === 'main'\n\t\t\t\t\t) ?? ''\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tallowRightClickOverrides: get(\n\t\t\t\t\t'core',\n\t\t\t\t\t'allowRightClickOverrides'\n\t\t\t\t),\n\t\t\t\tblockTypes: getBlockTypes(),\n\t\t\t\tcanUseUnfilteredHTML: getRawEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t)?._links?.hasOwnProperty( 'wp:action-unfiltered-html' ),\n\t\t\t\tfocusMode: get( 'core', 'focusMode' ),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tget( 'core', 'fixedToolbar' ) || ! isLargeViewport,\n\t\t\t\thiddenBlockTypes: get( 'core', 'hiddenBlockTypes' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tkeepCaretInsideBlock: get( 'core', 'keepCaretInsideBlock' ),\n\t\t\t\thasUploadPermissions: canUser( 'create', 'media' ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', 'pages' ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t\t\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t\tsectionRootClientId: getSectionRootBlock(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, isLargeViewport, renderingMode ]\n\t);\n\n\tconst settingsBlockPatterns =\n\t\tsettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatterns; // WP 5.9\n\tconst settingsBlockPatternCategories =\n\t\tsettings.__experimentalAdditionalBlockPatternCategories ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatternCategories; // WP 5.9\n\n\tconst blockPatterns = useMemo(\n\t\t() =>\n\t\t\t[ ...( settingsBlockPatterns || [] ) ].filter(\n\t\t\t\t( { postTypes } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t! postTypes ||\n\t\t\t\t\t\t( Array.isArray( postTypes ) &&\n\t\t\t\t\t\t\tpostTypes.includes( postType ) )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t),\n\t\t[ settingsBlockPatterns, postType ]\n\t);\n\n\tconst blockPatternCategories = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatternCategories || [] ),\n\t\t\t\t...( restBlockPatternCategories || [] ),\n\t\t\t].filter(\n\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t),\n\t\t[ settingsBlockPatternCategories, restBlockPatternCategories ]\n\t);\n\n\tconst { undo, setIsInserterOpened } = useDispatch( editorStore );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\t/**\n\t * Creates a Post entity.\n\t * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.\n\t *\n\t * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.\n\t * @return {Object} the post type object that was created.\n\t */\n\tconst createPageEntity = useCallback(\n\t\t( options ) => {\n\t\t\tif ( ! userCanCreatePages ) {\n\t\t\t\treturn Promise.reject( {\n\t\t\t\t\tmessage: __(\n\t\t\t\t\t\t'You do not have permission to create Pages.'\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t\t},\n\t\t[ saveEntityRecord, userCanCreatePages ]\n\t);\n\n\tconst allowedBlockTypes = useMemo( () => {\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes && hiddenBlockTypes.length > 0 ) {\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\treturn defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn settings.allowedBlockTypes;\n\t}, [ settings.allowedBlockTypes, hiddenBlockTypes, blockTypes ] );\n\n\tconst forceDisableFocusMode = settings.focusMode === false;\n\n\treturn useMemo( () => {\n\t\tconst blockEditorSettings = {\n\t\t\t...Object.fromEntries(\n\t\t\t\tObject.entries( settings ).filter( ( [ key ] ) =>\n\t\t\t\t\tBLOCK_EDITOR_SETTINGS.includes( key )\n\t\t\t\t)\n\t\t\t),\n\t\t\tallowedBlockTypes,\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode: focusMode && ! forceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t[ unlock( privateApis ).selectBlockPatternsKey ]: ( select ) =>\n\t\t\t\tunlock( select( coreStore ) ).getBlockPatternsForPostType(\n\t\t\t\t\tpostType\n\t\t\t\t),\n\t\t\t[ unlock( privateApis ).reusableBlocksSelectKey ]:\n\t\t\t\t__experimentalReusableBlocksSelect,\n\t\t\t__experimentalBlockPatternCategories: blockPatternCategories,\n\t\t\t__experimentalUserPatternCategories: userPatternCategories,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\tinserterMediaCategories,\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t// Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.\n\t\t\t// This might be better as a generic \"canUser\" selector.\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t//Todo: this is only needed for native and should probably be removed.\n\t\t\t__experimentalUndo: undo,\n\t\t\t// Check whether we want all site editor frames to have outlines\n\t\t\t// including the navigation / pattern / parts editors.\n\t\t\toutlineMode: postType === 'wp_template',\n\t\t\t// Check these two properties: they were not present in the site editor.\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\t__experimentalPreferPatternsOnRoot: postType === 'wp_template',\n\t\t\ttemplateLock:\n\t\t\t\tpostType === 'wp_navigation' ? 'insert' : settings.templateLock,\n\t\t\ttemplate:\n\t\t\t\tpostType === 'wp_navigation'\n\t\t\t\t\t? [ [ 'core/navigation', {}, [] ] ]\n\t\t\t\t\t: settings.template,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t};\n\t\tlock( blockEditorSettings, {\n\t\t\tsectionRootClientId,\n\t\t} );\n\t\treturn blockEditorSettings;\n\t}, [\n\t\tallowedBlockTypes,\n\t\tallowRightClickOverrides,\n\t\tfocusMode,\n\t\tforceDisableFocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\tsettings,\n\t\thasUploadPermissions,\n\t\tuserPatternCategories,\n\t\tblockPatterns,\n\t\tblockPatternCategories,\n\t\tcanUseUnfilteredHTML,\n\t\tundo,\n\t\tcreatePageEntity,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tpostType,\n\t\tsetIsInserterOpened,\n\t\tsectionRootClientId,\n\t] );\n}\n\nexport default useBlockEditorSettings;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAQA,IAAAQ,gBAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AAzBA;AACA;AACA;;AAiBA;AACA;AACA;;AAMA,MAAMa,iBAAiB,GAAG,EAAE;AAE5B,SAASC,kCAAkCA,CAAEC,MAAM,EAAG;EAAA,IAAAC,qBAAA;EACrD,QAAAA,qBAAA,GACCD,MAAM,CAAEE,eAAU,CAAC,CAACC,gBAAgB,CAAE,UAAU,EAAE,UAAU,EAAE;IAC7DC,QAAQ,EAAE,CAAC;EACZ,CAAE,CAAC,cAAAH,qBAAA,cAAAA,qBAAA,GAAIH,iBAAiB;AAE1B;AAEA,MAAMO,qBAAqB,GAAG,CAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,wBAAwB,EACxB,sCAAsC,EACtC,kCAAkC,EAClC,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,QAAQ,EACR,qBAAq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;MACAuC,WAAW,EAAE3G,QAAQ,KAAK,aAAa;MACvC;MACA4G,8BAA8B,EAAEnC,gBAAgB;MAChDoC,gCAAgC,EAAE7F,kBAAkB;MACpDC,WAAW;MACXC,YAAY;MACZ4F,kCAAkC,EAAE9G,QAAQ,KAAK,aAAa;MAC9D+G,YAAY,EACX/G,QAAQ,KAAK,eAAe,GAAG,QAAQ,GAAGD,QAAQ,CAACgH,YAAY;MAChEC,QAAQ,EACPhH,QAAQ,KAAK,eAAe,GACzB,CAAE,CAAE,iBAAiB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAE,CAAE,GACjCD,QAAQ,CAACiH,QAAQ;MACrBC,iCAAiC,EAAE5C;IACpC,CAAC;IACD,IAAA6C,gBAAI,EAAE5B,mBAAmB,EAAE;MAC1BjE;IACD,CAAE,CAAC;IACH,OAAOiE,mBAAmB;EAC3B,CAAC,EAAE,CACFN,iBAAiB,EACjBzE,wBAAwB,EACxBE,SAAS,EACT4E,qBAAqB,EACrB3E,eAAe,EACfC,iBAAiB,EACjBC,oBAAoB,EACpBb,QAAQ,EACRc,oBAAoB,EACpBM,qBAAqB,EACrBmC,aAAa,EACbO,sBAAsB,EACtB9C,oBAAoB,EACpBqD,IAAI,EACJK,gBAAgB,EAChBzD,kBAAkB,EAClBC,WAAW,EACXC,YAAY,EACZlB,QAAQ,EACRqE,mBAAmB,EACnBhD,mBAAmB,CAClB,CAAC;AACJ;AAAC,IAAA8F,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcvH,sBAAsB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_coreData","_useBlockEditorSettings","_interopRequireDefault","_store","EMPTY_BLOCKS_LIST","useNativeBlockEditorSettings","settings","postType","postId","editorSettings","useBlockEditorSettings","supportReusableBlock","capabilities","reusableBlock","reusableBlocks","isTitleSelected","useSelect","select","coreStore","getEntityRecords","per_page","editorStore","isPostTitleSelected","useMemo","__experimentalReusableBlocks","__experimentalShouldInsertAtTheTop","_default","exports","default"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport useBlockEditorSettings from './use-block-editor-settings.js';\nimport { store as editorStore } from '../../store';\n\nconst EMPTY_BLOCKS_LIST = [];\n\nfunction useNativeBlockEditorSettings( settings, postType, postId ) {\n\tconst editorSettings = useBlockEditorSettings( settings, postType, postId );\n\tconst supportReusableBlock = settings.capabilities?.reusableBlock === true;\n\n\tconst { reusableBlocks, isTitleSelected } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\treusableBlocks: supportReusableBlock\n\t\t\t\t\t? select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t'wp_block',\n\t\t\t\t\t\t\t// Unbounded queries are not supported on native so as a workaround, we set per_page with the maximum value that native version can handle.\n\t\t\t\t\t\t\t// Related issue: https://github.com/wordpress-mobile/gutenberg-mobile/issues/2661\n\t\t\t\t\t\t\t{ per_page: 100 }\n\t\t\t\t\t )\n\t\t\t\t\t: EMPTY_BLOCKS_LIST,\n\t\t\t\tisTitleSelected: select( editorStore ).isPostTitleSelected(),\n\t\t\t};\n\t\t},\n\t\t[ supportReusableBlock ]\n\t);\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\t...editorSettings,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\t__experimentalShouldInsertAtTheTop: isTitleSelected,\n\t\t} ),\n\t\t[ editorSettings, reusableBlocks, isTitleSelected ]\n\t);\n}\n\nexport default useNativeBlockEditorSettings;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,uBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAXA;AACA;AACA;;AAKA;AACA;AACA;;AAIA,MAAMM,iBAAiB,GAAG,EAAE;AAE5B,SAASC,4BAA4BA,CAAEC,QAAQ,EAAEC,QAAQ,EAAEC,MAAM,EAAG;EACnE,MAAMC,cAAc,GAAG,IAAAC,+BAAsB,EAAEJ,QAAQ,EAAEC,QAAQ,EAAEC,MAAO,CAAC;EAC3E,MAAMG,oBAAoB,GAAGL,QAAQ,CAACM,YAAY,EAAEC,aAAa,KAAK,IAAI;EAE1E,MAAM;IAAEC,cAAc;IAAEC;EAAgB,CAAC,GAAG,IAAAC,eAAS,EAClDC,MAAM,IAAM;IACb,OAAO;MACNH,cAAc,EAAEH,oBAAoB,GACjCM,MAAM,CAAEC,eAAU,CAAC,CAACC,gBAAgB,CACpC,UAAU,EACV,UAAU;MACV;MACA;MACA;QAAEC,QAAQ,EAAE;MAAI,CAChB,CAAC,GACDhB,iBAAiB;MACpBW,eAAe,EAAEE,MAAM,CAAEI,YAAY,CAAC,CAACC,mBAAmB,CAAC;IAC5D,CAAC;EACF,CAAC,EACD,CAAEX,oBAAoB,CACvB,CAAC;EAED,OAAO,IAAAY,gBAAO,EACb,OAAQ;IACP,GAAGd,cAAc;IACjBe,4BAA4B,EAAEV,cAAc;IAC5CW,kCAAkC,EAAEV;EACrC,CAAC,CAAE,EACH,CAAEN,cAAc,EAAEK,cAAc,EAAEC,eAAe,CAClD,CAAC;AACF;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcvB,4BAA4B"}
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_coreData","_useBlockEditorSettings","_interopRequireDefault","_store","EMPTY_BLOCKS_LIST","useNativeBlockEditorSettings","settings","postType","postId","editorSettings","useBlockEditorSettings","supportReusableBlock","capabilities","reusableBlock","reusableBlocks","isTitleSelected","useSelect","select","coreStore","getEntityRecords","per_page","editorStore","isPostTitleSelected","useMemo","__experimentalReusableBlocks","__experimentalShouldInsertAtTheTop","_default","exports","default"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport useBlockEditorSettings from './use-block-editor-settings.js';\nimport { store as editorStore } from '../../store';\n\nconst EMPTY_BLOCKS_LIST = [];\n\nfunction useNativeBlockEditorSettings( settings, postType, postId ) {\n\tconst editorSettings = useBlockEditorSettings( settings, postType, postId );\n\tconst supportReusableBlock = settings.capabilities?.reusableBlock === true;\n\n\tconst { reusableBlocks, isTitleSelected } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\treusableBlocks: supportReusableBlock\n\t\t\t\t\t? select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t'wp_block',\n\t\t\t\t\t\t\t// Unbounded queries are not supported on native so as a workaround, we set per_page with the maximum value that native version can handle.\n\t\t\t\t\t\t\t// Related issue: https://github.com/wordpress-mobile/gutenberg-mobile/issues/2661\n\t\t\t\t\t\t\t{ per_page: 100 }\n\t\t\t\t\t )\n\t\t\t\t\t: EMPTY_BLOCKS_LIST,\n\t\t\t\tisTitleSelected: select( editorStore ).isPostTitleSelected(),\n\t\t\t};\n\t\t},\n\t\t[ supportReusableBlock ]\n\t);\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\t...editorSettings,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\t__experimentalShouldInsertAtTheTop: isTitleSelected,\n\t\t} ),\n\t\t[ editorSettings, reusableBlocks, isTitleSelected ]\n\t);\n}\n\nexport default useNativeBlockEditorSettings;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,uBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAXA;AACA;AACA;;AAKA;AACA;AACA;;AAIA,MAAMM,iBAAiB,GAAG,EAAE;AAE5B,SAASC,4BAA4BA,CAAEC,QAAQ,EAAEC,QAAQ,EAAEC,MAAM,EAAG;EACnE,MAAMC,cAAc,GAAG,IAAAC,+BAAsB,EAAEJ,QAAQ,EAAEC,QAAQ,EAAEC,MAAO,CAAC;EAC3E,MAAMG,oBAAoB,GAAGL,QAAQ,CAACM,YAAY,EAAEC,aAAa,KAAK,IAAI;EAE1E,MAAM;IAAEC,cAAc;IAAEC;EAAgB,CAAC,GAAG,IAAAC,eAAS,EAClDC,MAAM,IAAM;IACb,OAAO;MACNH,cAAc,EAAEH,oBAAoB,GACjCM,MAAM,CAAEC,eAAU,CAAC,CAACC,gBAAgB,CACpC,UAAU,EACV,UAAU;MACV;MACA;MACA;QAAEC,QAAQ,EAAE;MAAI,CAChB,CAAC,GACDhB,iBAAiB;MACpBW,eAAe,EAAEE,MAAM,CAAEI,YAAY,CAAC,CAACC,mBAAmB,CAAC;IAC5D,CAAC;EACF,CAAC,EACD,CAAEX,oBAAoB,CACvB,CAAC;EAED,OAAO,IAAAY,gBAAO,EACb,OAAQ;IACP,GAAGd,cAAc;IACjBe,4BAA4B,EAAEV,cAAc;IAC5CW,kCAAkC,EAAEV;EACrC,CAAC,CAAE,EACH,CAAEN,cAAc,EAAEK,cAAc,EAAEC,eAAe,CAClD,CAAC;AACF;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcvB,4BAA4B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_hooks","POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART","useHideBlocksFromInserter","postType","mode","useEffect","addFilter","canInsert","blockType","includes","name","rootClientId","getBlockParentsByBlockName","length","removeFilter"],"sources":["@wordpress/editor/src/components/provider/use-hide-blocks-from-inserter.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { addFilter, removeFilter } from '@wordpress/hooks';\n\n// These post types are \"structural\" block lists.\n// We should be allowed to use\n// the post content and template parts blocks within them.\nconst POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART = [\n\t'wp_block',\n\t'wp_template',\n\t'wp_template_part',\n];\n\n/**\n * In some specific contexts,\n * the template part and post content blocks need to be hidden.\n *\n * @param {string} postType Post Type\n * @param {string} mode Rendering mode\n */\nexport function useHideBlocksFromInserter( postType, mode ) {\n\tuseEffect( () => {\n\t\t/*\n\t\t * Prevent adding template part in the editor.\n\t\t */\n\t\taddFilter(\n\t\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t\t'removeTemplatePartsFromInserter',\n\t\t\t( canInsert, blockType ) => {\n\t\t\t\tif (\n\t\t\t\t\t! POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART.includes(\n\t\t\t\t\t\tpostType\n\t\t\t\t\t) &&\n\t\t\t\t\tblockType.name === 'core/template-part' &&\n\t\t\t\t\tmode === 'post-only'\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn canInsert;\n\t\t\t}\n\t\t);\n\n\t\t/*\n\t\t * Prevent adding post content block (except in query block) in the editor.\n\t\t */\n\t\taddFilter(\n\t\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t\t'removePostContentFromInserter',\n\t\t\t(\n\t\t\t\tcanInsert,\n\t\t\t\tblockType,\n\t\t\t\trootClientId,\n\t\t\t\t{ getBlockParentsByBlockName }\n\t\t\t) => {\n\t\t\t\tif (\n\t\t\t\t\t! POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART.includes(\n\t\t\t\t\t\tpostType\n\t\t\t\t\t) &&\n\t\t\t\t\tblockType.name === 'core/post-content'\n\t\t\t\t) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\tgetBlockParentsByBlockName( rootClientId, 'core/query' )\n\t\t\t\t\t\t\t.length > 0\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn canInsert;\n\t\t\t}\n\t\t);\n\n\t\treturn () => {\n\t\t\tremoveFilter(\n\t\t\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t\t\t'removeTemplatePartsFromInserter'\n\t\t\t);\n\t\t\tremoveFilter(\n\t\t\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t\t\t'removePostContentFromInserter'\n\t\t\t);\n\t\t};\n\t}, [ postType, mode ] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA,MAAME,8CAA8C,GAAG,CACtD,UAAU,EACV,aAAa,EACb,kBAAkB,CAClB;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,yBAAyBA,CAAEC,QAAQ,EAAEC,IAAI,EAAG;EAC3D,IAAAC,kBAAS,EAAE,MAAM;IAChB;AACF;AACA;IACE,IAAAC,gBAAS,EACR,0CAA0C,EAC1C,iCAAiC,EACjC,CAAEC,SAAS,EAAEC,SAAS,KAAM;MAC3B,IACC,CAAEP,8CAA8C,CAACQ,QAAQ,CACxDN,QACD,CAAC,IACDK,SAAS,CAACE,IAAI,KAAK,oBAAoB,IACvCN,IAAI,KAAK,WAAW,EACnB;QACD,OAAO,KAAK;MACb;MACA,OAAOG,SAAS;IACjB,CACD,CAAC;;IAED;AACF;AACA;IACE,IAAAD,gBAAS,EACR,0CAA0C,EAC1C,+BAA+B,EAC/B,CACCC,SAAS,EACTC,SAAS,EACTG,YAAY,EACZ;MAAEC;IAA2B,CAAC,KAC1B;MACJ,IACC,CAAEX,8CAA8C,CAACQ,QAAQ,CACxDN,QACD,CAAC,IACDK,SAAS,CAACE,IAAI,KAAK,mBAAmB,EACrC;QACD,OACCE,0BAA0B,CAAED,YAAY,EAAE,YAAa,CAAC,CACtDE,MAAM,GAAG,CAAC;MAEd;MACA,OAAON,SAAS;IACjB,CACD,CAAC;IAED,OAAO,MAAM;MACZ,IAAAO,mBAAY,EACX,0CAA0C,EAC1C,iCACD,CAAC;MACD,IAAAA,mBAAY,EACX,0CAA0C,EAC1C,+BACD,CAAC;IACF,CAAC;EACF,CAAC,EAAE,CAAEX,QAAQ,EAAEC,IAAI,CAAG,CAAC;AACxB"}
|
|
1
|
+
{"version":3,"names":["_element","require","_hooks","POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART","useHideBlocksFromInserter","postType","mode","useEffect","addFilter","canInsert","blockType","includes","name","rootClientId","getBlockParentsByBlockName","length","removeFilter"],"sources":["@wordpress/editor/src/components/provider/use-hide-blocks-from-inserter.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { addFilter, removeFilter } from '@wordpress/hooks';\n\n// These post types are \"structural\" block lists.\n// We should be allowed to use\n// the post content and template parts blocks within them.\nconst POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART = [\n\t'wp_block',\n\t'wp_template',\n\t'wp_template_part',\n];\n\n/**\n * In some specific contexts,\n * the template part and post content blocks need to be hidden.\n *\n * @param {string} postType Post Type\n * @param {string} mode Rendering mode\n */\nexport function useHideBlocksFromInserter( postType, mode ) {\n\tuseEffect( () => {\n\t\t/*\n\t\t * Prevent adding template part in the editor.\n\t\t */\n\t\taddFilter(\n\t\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t\t'removeTemplatePartsFromInserter',\n\t\t\t( canInsert, blockType ) => {\n\t\t\t\tif (\n\t\t\t\t\t! POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART.includes(\n\t\t\t\t\t\tpostType\n\t\t\t\t\t) &&\n\t\t\t\t\tblockType.name === 'core/template-part' &&\n\t\t\t\t\tmode === 'post-only'\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn canInsert;\n\t\t\t}\n\t\t);\n\n\t\t/*\n\t\t * Prevent adding post content block (except in query block) in the editor.\n\t\t */\n\t\taddFilter(\n\t\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t\t'removePostContentFromInserter',\n\t\t\t(\n\t\t\t\tcanInsert,\n\t\t\t\tblockType,\n\t\t\t\trootClientId,\n\t\t\t\t{ getBlockParentsByBlockName }\n\t\t\t) => {\n\t\t\t\tif (\n\t\t\t\t\t! POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART.includes(\n\t\t\t\t\t\tpostType\n\t\t\t\t\t) &&\n\t\t\t\t\tblockType.name === 'core/post-content'\n\t\t\t\t) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\tgetBlockParentsByBlockName( rootClientId, 'core/query' )\n\t\t\t\t\t\t\t.length > 0\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn canInsert;\n\t\t\t}\n\t\t);\n\n\t\treturn () => {\n\t\t\tremoveFilter(\n\t\t\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t\t\t'removeTemplatePartsFromInserter'\n\t\t\t);\n\t\t\tremoveFilter(\n\t\t\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t\t\t'removePostContentFromInserter'\n\t\t\t);\n\t\t};\n\t}, [ postType, mode ] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA,MAAME,8CAA8C,GAAG,CACtD,UAAU,EACV,aAAa,EACb,kBAAkB,CAClB;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,yBAAyBA,CAAEC,QAAQ,EAAEC,IAAI,EAAG;EAC3D,IAAAC,kBAAS,EAAE,MAAM;IAChB;AACF;AACA;IACE,IAAAC,gBAAS,EACR,0CAA0C,EAC1C,iCAAiC,EACjC,CAAEC,SAAS,EAAEC,SAAS,KAAM;MAC3B,IACC,CAAEP,8CAA8C,CAACQ,QAAQ,CACxDN,QACD,CAAC,IACDK,SAAS,CAACE,IAAI,KAAK,oBAAoB,IACvCN,IAAI,KAAK,WAAW,EACnB;QACD,OAAO,KAAK;MACb;MACA,OAAOG,SAAS;IACjB,CACD,CAAC;;IAED;AACF;AACA;IACE,IAAAD,gBAAS,EACR,0CAA0C,EAC1C,+BAA+B,EAC/B,CACCC,SAAS,EACTC,SAAS,EACTG,YAAY,EACZ;MAAEC;IAA2B,CAAC,KAC1B;MACJ,IACC,CAAEX,8CAA8C,CAACQ,QAAQ,CACxDN,QACD,CAAC,IACDK,SAAS,CAACE,IAAI,KAAK,mBAAmB,EACrC;QACD,OACCE,0BAA0B,CAAED,YAAY,EAAE,YAAa,CAAC,CACtDE,MAAM,GAAG,CAAC;MAEd;MACA,OAAON,SAAS;IACjB,CACD,CAAC;IAED,OAAO,MAAM;MACZ,IAAAO,mBAAY,EACX,0CAA0C,EAC1C,iCACD,CAAC;MACD,IAAAA,mBAAY,EACX,0CAA0C,EAC1C,+BACD,CAAC;IACF,CAAC;EACF,CAAC,EAAE,CAAEX,QAAQ,EAAEC,IAAI,CAAG,CAAC;AACxB","ignoreList":[]}
|
|
@@ -34,6 +34,7 @@ const withRegistryProvider = (0, _compose.createHigherOrderComponent)(WrappedCom
|
|
|
34
34
|
const newRegistry = (0, _data.createRegistry)({
|
|
35
35
|
'core/block-editor': _blockEditor.storeConfig
|
|
36
36
|
}, registry);
|
|
37
|
+
// Todo: The interface store should also be created per instance.
|
|
37
38
|
newRegistry.registerStore('core/editor', _store.storeConfig);
|
|
38
39
|
setSubRegistry(newRegistry);
|
|
39
40
|
}, [registry]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_compose","_blockEditor","_store","withRegistryProvider","createHigherOrderComponent","WrappedComponent","withRegistry","props","useSubRegistry","registry","additionalProps","_react","createElement","subRegistry","setSubRegistry","useState","useEffect","newRegistry","createRegistry","blockEditorStoreConfig","registerStore","storeConfig","RegistryProvider","value","_default","exports","default"],"sources":["@wordpress/editor/src/components/provider/with-registry-provider.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\nimport {\n\twithRegistry,\n\tcreateRegistry,\n\tRegistryProvider,\n} from '@wordpress/data';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { storeConfig as blockEditorStoreConfig } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { storeConfig } from '../../store';\n\nconst withRegistryProvider = createHigherOrderComponent(\n\t( WrappedComponent ) =>\n\t\twithRegistry( ( props ) => {\n\t\t\tconst {\n\t\t\t\tuseSubRegistry = true,\n\t\t\t\tregistry,\n\t\t\t\t...additionalProps\n\t\t\t} = props;\n\t\t\tif ( ! useSubRegistry ) {\n\t\t\t\treturn <WrappedComponent { ...additionalProps } />;\n\t\t\t}\n\n\t\t\tconst [ subRegistry, setSubRegistry ] = useState( null );\n\t\t\tuseEffect( () => {\n\t\t\t\tconst newRegistry = createRegistry(\n\t\t\t\t\t{\n\t\t\t\t\t\t'core/block-editor': blockEditorStoreConfig,\n\t\t\t\t\t},\n\t\t\t\t\tregistry\n\t\t\t\t);\n\t\t\t\tnewRegistry.registerStore( 'core/editor', storeConfig );\n\t\t\t\tsetSubRegistry( newRegistry );\n\t\t\t}, [ registry ] );\n\n\t\t\tif ( ! subRegistry ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<RegistryProvider value={ subRegistry }>\n\t\t\t\t\t<WrappedComponent { ...additionalProps } />\n\t\t\t\t</RegistryProvider>\n\t\t\t);\n\t\t} ),\n\t'withRegistryProvider'\n);\n\nexport default withRegistryProvider;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAfA;AACA;AACA;;AAUA;AACA;AACA;;AAGA,MAAMK,oBAAoB,GAAG,IAAAC,mCAA0B,EACpDC,gBAAgB,IACjB,IAAAC,kBAAY,EAAIC,KAAK,IAAM;EAC1B,MAAM;IACLC,cAAc,GAAG,IAAI;IACrBC,QAAQ;IACR,GAAGC;EACJ,CAAC,GAAGH,KAAK;EACT,IAAK,CAAEC,cAAc,EAAG;IACvB,OAAO,IAAAG,MAAA,CAAAC,aAAA,EAACP,gBAAgB;MAAA,GAAMK;IAAe,CAAI,CAAC;EACnD;EAEA,MAAM,CAAEG,WAAW,EAAEC,cAAc,CAAE,GAAG,IAAAC,iBAAQ,EAAE,IAAK,CAAC;EACxD,IAAAC,kBAAS,EAAE,MAAM;IAChB,MAAMC,WAAW,GAAG,IAAAC,oBAAc,EACjC;MACC,mBAAmB,EAAEC;IACtB,CAAC,EACDV,QACD,CAAC;
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_compose","_blockEditor","_store","withRegistryProvider","createHigherOrderComponent","WrappedComponent","withRegistry","props","useSubRegistry","registry","additionalProps","_react","createElement","subRegistry","setSubRegistry","useState","useEffect","newRegistry","createRegistry","blockEditorStoreConfig","registerStore","storeConfig","RegistryProvider","value","_default","exports","default"],"sources":["@wordpress/editor/src/components/provider/with-registry-provider.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\nimport {\n\twithRegistry,\n\tcreateRegistry,\n\tRegistryProvider,\n} from '@wordpress/data';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { storeConfig as blockEditorStoreConfig } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { storeConfig } from '../../store';\n\nconst withRegistryProvider = createHigherOrderComponent(\n\t( WrappedComponent ) =>\n\t\twithRegistry( ( props ) => {\n\t\t\tconst {\n\t\t\t\tuseSubRegistry = true,\n\t\t\t\tregistry,\n\t\t\t\t...additionalProps\n\t\t\t} = props;\n\t\t\tif ( ! useSubRegistry ) {\n\t\t\t\treturn <WrappedComponent { ...additionalProps } />;\n\t\t\t}\n\n\t\t\tconst [ subRegistry, setSubRegistry ] = useState( null );\n\t\t\tuseEffect( () => {\n\t\t\t\tconst newRegistry = createRegistry(\n\t\t\t\t\t{\n\t\t\t\t\t\t'core/block-editor': blockEditorStoreConfig,\n\t\t\t\t\t},\n\t\t\t\t\tregistry\n\t\t\t\t);\n\t\t\t\t// Todo: The interface store should also be created per instance.\n\t\t\t\tnewRegistry.registerStore( 'core/editor', storeConfig );\n\t\t\t\tsetSubRegistry( newRegistry );\n\t\t\t}, [ registry ] );\n\n\t\t\tif ( ! subRegistry ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<RegistryProvider value={ subRegistry }>\n\t\t\t\t\t<WrappedComponent { ...additionalProps } />\n\t\t\t\t</RegistryProvider>\n\t\t\t);\n\t\t} ),\n\t'withRegistryProvider'\n);\n\nexport default withRegistryProvider;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAfA;AACA;AACA;;AAUA;AACA;AACA;;AAGA,MAAMK,oBAAoB,GAAG,IAAAC,mCAA0B,EACpDC,gBAAgB,IACjB,IAAAC,kBAAY,EAAIC,KAAK,IAAM;EAC1B,MAAM;IACLC,cAAc,GAAG,IAAI;IACrBC,QAAQ;IACR,GAAGC;EACJ,CAAC,GAAGH,KAAK;EACT,IAAK,CAAEC,cAAc,EAAG;IACvB,OAAO,IAAAG,MAAA,CAAAC,aAAA,EAACP,gBAAgB;MAAA,GAAMK;IAAe,CAAI,CAAC;EACnD;EAEA,MAAM,CAAEG,WAAW,EAAEC,cAAc,CAAE,GAAG,IAAAC,iBAAQ,EAAE,IAAK,CAAC;EACxD,I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