@wordpress/editor 14.9.0 → 14.11.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 +8 -0
- package/README.md +2 -2
- package/build/bindings/api.js +0 -29
- package/build/bindings/api.js.map +1 -1
- package/build/bindings/post-meta.js +2 -1
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/autocompleters/user.js.map +1 -1
- package/build/components/block-manager/index.js +2 -2
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/collab-sidebar/add-comment.js +120 -0
- package/build/components/collab-sidebar/add-comment.js.map +1 -0
- package/build/components/collab-sidebar/comment-button-toolbar.js +37 -0
- package/build/components/collab-sidebar/comment-button-toolbar.js.map +1 -0
- package/build/components/collab-sidebar/comment-button.js +37 -0
- package/build/components/collab-sidebar/comment-button.js.map +1 -0
- package/build/components/collab-sidebar/comments.js +321 -0
- package/build/components/collab-sidebar/comments.js.map +1 -0
- package/build/components/collab-sidebar/constants.js +8 -0
- package/build/components/collab-sidebar/constants.js.map +1 -0
- package/build/components/collab-sidebar/index.js +272 -0
- package/build/components/collab-sidebar/index.js.map +1 -0
- package/build/components/collab-sidebar/utils.js +16 -0
- package/build/components/collab-sidebar/utils.js.map +1 -0
- package/build/components/commands/index.js +6 -6
- package/build/components/commands/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/create-template-part-modal/utils.js.map +1 -1
- package/build/components/document-bar/index.js +8 -7
- package/build/components/document-bar/index.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 +2 -6
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-interface/index.js +4 -14
- package/build/components/editor-interface/index.js.map +1 -1
- package/build/components/entities-saved-states/index.js +2 -2
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build/components/global-styles-provider/index.js +13 -3
- package/build/components/global-styles-provider/index.js.map +1 -1
- package/build/components/header/index.js +5 -2
- package/build/components/header/index.js.map +1 -1
- package/build/components/inserter-sidebar/index.js +2 -2
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/media-categories/index.js.map +1 -1
- package/build/components/page-attributes/parent.js +5 -5
- package/build/components/page-attributes/parent.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 +13 -11
- package/build/components/plugin-more-menu-item/index.js.map +1 -1
- package/build/components/plugin-preview-menu-item/index.js +15 -13
- package/build/components/plugin-preview-menu-item/index.js.map +1 -1
- package/build/components/plugin-sidebar/index.js +0 -15
- package/build/components/plugin-sidebar/index.js.map +1 -1
- package/build/components/post-actions/index.js +5 -5
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-author/panel.js +4 -4
- package/build/components/post-author/panel.js.map +1 -1
- package/build/components/post-card-panel/index.js +7 -36
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-content-information/index.js +2 -3
- package/build/components/post-content-information/index.js.map +1 -1
- package/build/components/post-featured-image/index.js +26 -7
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-format/index.js +1 -1
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-last-revision/index.js +1 -1
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-locked-modal/index.js +2 -2
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-preview-button/index.js +1 -1
- package/build/components/post-preview-button/index.js.map +1 -1
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +1 -0
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/post-publish-panel/media-util.js +1 -0
- package/build/components/post-publish-panel/media-util.js.map +1 -1
- package/build/components/post-publish-panel/postpublish.js +1 -1
- package/build/components/post-publish-panel/postpublish.js.map +1 -1
- package/build/components/post-schedule/label.js +1 -1
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +13 -5
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +3 -2
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +1 -1
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/panel.js.map +1 -1
- package/build/components/post-template/classic-theme.js +2 -4
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-text-editor/index.js.map +1 -1
- package/build/components/post-title/index.js +15 -19
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/index.native.js +2 -2
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-url/index.js +76 -63
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/panel.js +49 -29
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +0 -4
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/index.js +10 -12
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +1 -1
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/resizable-editor/resize-handle.js.map +1 -1
- package/build/components/sidebar/header.js +2 -1
- package/build/components/sidebar/header.js.map +1 -1
- package/build/components/sidebar/index.js +3 -3
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/time-to-read/index.js +2 -2
- package/build/components/time-to-read/index.js.map +1 -1
- package/build/components/visual-editor/edit-template-blocks-notification.js +4 -1
- package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
- package/build/components/visual-editor/index.js +24 -25
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build/components/visual-editor/use-zoom-out-mode-exit.js +52 -0
- package/build/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -0
- package/build/components/zoom-out-toggle/index.js +37 -5
- package/build/components/zoom-out-toggle/index.js.map +1 -1
- package/build/dataviews/actions/duplicate-template-part.js +3 -3
- package/build/dataviews/actions/duplicate-template-part.js.map +1 -1
- package/build/private-apis.js +0 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +30 -4
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +1 -0
- package/build/store/constants.js.map +1 -1
- package/build/store/local-autosave.js.map +1 -1
- package/build/store/private-actions.js +8 -7
- package/build/store/private-actions.js.map +1 -1
- package/build/store/selectors.js +24 -2
- package/build/store/selectors.js.map +1 -1
- package/build/utils/media-upload/index.js.map +1 -1
- package/build/utils/pageTypeBadge.js +51 -0
- package/build/utils/pageTypeBadge.js.map +1 -0
- package/build/utils/terms.js +2 -2
- package/build/utils/terms.js.map +1 -1
- package/build-module/bindings/api.js +1 -29
- package/build-module/bindings/api.js.map +1 -1
- package/build-module/bindings/post-meta.js +2 -1
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/autocompleters/user.js +1 -3
- package/build-module/components/autocompleters/user.js.map +1 -1
- package/build-module/components/block-manager/category.js +1 -2
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/block-manager/checklist.js +1 -2
- package/build-module/components/block-manager/checklist.js.map +1 -1
- package/build-module/components/block-manager/index.js +3 -4
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js +1 -3
- package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
- package/build-module/components/blog-title/index.js +1 -3
- package/build-module/components/blog-title/index.js.map +1 -1
- package/build-module/components/collab-sidebar/add-comment.js +114 -0
- package/build-module/components/collab-sidebar/add-comment.js.map +1 -0
- package/build-module/components/collab-sidebar/comment-button-toolbar.js +30 -0
- package/build-module/components/collab-sidebar/comment-button-toolbar.js.map +1 -0
- package/build-module/components/collab-sidebar/comment-button.js +30 -0
- package/build-module/components/collab-sidebar/comment-button.js.map +1 -0
- package/build-module/components/collab-sidebar/comments.js +314 -0
- package/build-module/components/collab-sidebar/comments.js.map +1 -0
- package/build-module/components/collab-sidebar/constants.js +2 -0
- package/build-module/components/collab-sidebar/constants.js.map +1 -0
- package/build-module/components/collab-sidebar/index.js +264 -0
- package/build-module/components/collab-sidebar/index.js.map +1 -0
- package/build-module/components/collab-sidebar/utils.js +10 -0
- package/build-module/components/collab-sidebar/utils.js.map +1 -0
- package/build-module/components/collapsible-block-toolbar/index.js +1 -3
- package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
- package/build-module/components/commands/index.js +6 -6
- package/build-module/components/commands/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +1 -2
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/utils.js.map +1 -1
- package/build-module/components/document-bar/index.js +10 -10
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-outline/index.js +1 -2
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-outline/item.js +1 -2
- package/build-module/components/document-outline/item.js.map +1 -1
- package/build-module/components/document-tools/index.js +4 -10
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor/index.js +1 -3
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-help/add-blocks.native.js +1 -3
- package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/customize-blocks.native.js +1 -3
- 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 +1 -2
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build-module/components/editor-help/index.native.js +1 -3
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-help/intro-to-blocks.native.js +1 -3
- package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/move-blocks.native.js +1 -3
- package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/remove-blocks.native.js +1 -3
- package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/view-sections.native.js +1 -2
- package/build-module/components/editor-help/view-sections.native.js.map +1 -1
- package/build-module/components/editor-interface/index.js +5 -17
- package/build-module/components/editor-interface/index.js.map +1 -1
- package/build-module/components/editor-notices/index.js +1 -3
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +1 -3
- 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 +1 -2
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +3 -4
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/error-boundary/index.native.js +1 -2
- package/build-module/components/error-boundary/index.native.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build-module/components/global-styles-provider/index.js +13 -3
- package/build-module/components/global-styles-provider/index.js.map +1 -1
- package/build-module/components/header/index.js +6 -4
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/inserter-sidebar/index.js +2 -2
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -2
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -3
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/list-view-sidebar/list-view-outline.js +1 -3
- package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
- package/build-module/components/media-categories/index.js.map +1 -1
- package/build-module/components/more-menu/index.js +1 -3
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/offline-status/index.native.js +1 -2
- package/build-module/components/offline-status/index.native.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +6 -7
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/plugin-document-setting-panel/index.js +1 -3
- package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/components/plugin-more-menu-item/index.js +12 -10
- package/build-module/components/plugin-more-menu-item/index.js.map +1 -1
- package/build-module/components/plugin-preview-menu-item/index.js +14 -12
- package/build-module/components/plugin-preview-menu-item/index.js.map +1 -1
- package/build-module/components/plugin-sidebar/index.js +0 -15
- package/build-module/components/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/post-actions/index.js +6 -8
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-author/panel.js +5 -6
- package/build-module/components/post-author/panel.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +9 -38
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-content-information/index.js +2 -3
- package/build-module/components/post-content-information/index.js.map +1 -1
- package/build-module/components/post-discussion/panel.js +1 -2
- package/build-module/components/post-discussion/panel.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js +1 -3
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +27 -9
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-format/index.js +2 -3
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-format/panel.js +1 -2
- package/build-module/components/post-format/panel.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +1 -1
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +3 -5
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-panel-row/index.js +1 -2
- package/build-module/components/post-panel-row/index.js.map +1 -1
- package/build-module/components/post-preview-button/index.js +2 -4
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +1 -2
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +1 -3
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js +1 -2
- 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 +2 -3
- 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 +1 -2
- 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 +2 -2
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/post-publish-panel/media-util.js +1 -0
- package/build-module/components/post-publish-panel/media-util.js.map +1 -1
- package/build-module/components/post-publish-panel/postpublish.js +2 -4
- package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
- package/build-module/components/post-publish-panel/prepublish.js +1 -3
- package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +1 -2
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/label.js +1 -1
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-status/index.js +1 -3
- package/build-module/components/post-status/index.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +1 -3
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +16 -10
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +4 -4
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +1 -1
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +1 -2
- 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 +1 -3
- package/build-module/components/post-template/block-theme.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +3 -6
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/create-new-template-modal.js +1 -2
- package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
- package/build-module/components/post-template/create-new-template.js +1 -3
- package/build-module/components/post-template/create-new-template.js.map +1 -1
- package/build-module/components/post-template/swap-template-button.js +1 -3
- package/build-module/components/post-template/swap-template-button.js.map +1 -1
- package/build-module/components/post-text-editor/index.js +1 -3
- package/build-module/components/post-text-editor/index.js.map +1 -1
- package/build-module/components/post-title/index.js +15 -19
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/index.native.js +2 -2
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/post-trash/index.js +1 -2
- package/build-module/components/post-trash/index.js.map +1 -1
- package/build-module/components/post-url/index.js +78 -66
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/panel.js +51 -31
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/post-visibility/index.js +1 -2
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/components/posts-per-page/index.js +1 -3
- package/build-module/components/posts-per-page/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +1 -3
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +1 -7
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/index.js +11 -15
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +1 -3
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +1 -1
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/resizable-editor/resize-handle.js +1 -3
- package/build-module/components/resizable-editor/resize-handle.js.map +1 -1
- package/build-module/components/save-publish-panels/index.js +1 -3
- package/build-module/components/save-publish-panels/index.js.map +1 -1
- package/build-module/components/sidebar/header.js +3 -3
- package/build-module/components/sidebar/header.js.map +1 -1
- package/build-module/components/sidebar/index.js +5 -6
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-summary.js +1 -3
- package/build-module/components/sidebar/post-summary.js.map +1 -1
- package/build-module/components/site-discussion/index.js +1 -3
- package/build-module/components/site-discussion/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +1 -2
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/table-of-contents/panel.js +1 -3
- package/build-module/components/table-of-contents/panel.js.map +1 -1
- package/build-module/components/template-part-menu-items/convert-to-template-part.js +1 -3
- package/build-module/components/template-part-menu-items/convert-to-template-part.js.map +1 -1
- package/build-module/components/template-validation-notice/index.js +1 -3
- package/build-module/components/template-validation-notice/index.js.map +1 -1
- package/build-module/components/text-editor/index.js +1 -2
- package/build-module/components/text-editor/index.js.map +1 -1
- package/build-module/components/time-to-read/index.js +2 -2
- package/build-module/components/time-to-read/index.js.map +1 -1
- package/build-module/components/visual-editor/edit-template-blocks-notification.js +4 -1
- package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
- package/build-module/components/visual-editor/index.js +26 -29
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build-module/components/visual-editor/use-zoom-out-mode-exit.js +46 -0
- package/build-module/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -0
- package/build-module/components/zoom-out-toggle/index.js +37 -5
- package/build-module/components/zoom-out-toggle/index.js.map +1 -1
- package/build-module/dataviews/actions/duplicate-template-part.js +4 -4
- package/build-module/dataviews/actions/duplicate-template-part.js.map +1 -1
- package/build-module/hooks/pattern-overrides.js +1 -3
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/private-apis.js +1 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +30 -4
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +1 -0
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/local-autosave.js.map +1 -1
- package/build-module/store/private-actions.js +9 -8
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/selectors.js +24 -2
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/build-module/utils/pageTypeBadge.js +45 -0
- package/build-module/utils/pageTypeBadge.js.map +1 -0
- package/build-module/utils/terms.js +2 -2
- package/build-module/utils/terms.js.map +1 -1
- package/build-style/style-rtl.css +116 -59
- package/build-style/style.css +116 -59
- package/build-types/bindings/api.d.ts +0 -13
- package/build-types/bindings/api.d.ts.map +1 -1
- package/build-types/bindings/post-meta.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/add-comment.d.ts +15 -0
- package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/comment-button-toolbar.d.ts +5 -0
- package/build-types/components/collab-sidebar/comment-button-toolbar.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/comment-button.d.ts +5 -0
- package/build-types/components/collab-sidebar/comment-button.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/comments.d.ts +19 -0
- package/build-types/components/collab-sidebar/comments.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/constants.d.ts +2 -0
- package/build-types/components/collab-sidebar/constants.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/index.d.ts +5 -0
- package/build-types/components/collab-sidebar/index.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/utils.d.ts +8 -0
- package/build-types/components/collab-sidebar/utils.d.ts.map +1 -0
- package/build-types/components/commands/index.d.ts.map +1 -1
- package/build-types/components/document-bar/index.d.ts.map +1 -1
- package/build-types/components/document-tools/index.d.ts.map +1 -1
- package/build-types/components/editor-interface/index.d.ts +1 -2
- package/build-types/components/editor-interface/index.d.ts.map +1 -1
- package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
- package/build-types/components/header/index.d.ts.map +1 -1
- package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
- package/build-types/components/page-attributes/parent.d.ts.map +1 -1
- package/build-types/components/plugin-more-menu-item/index.d.ts +62 -2
- package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -1
- package/build-types/components/plugin-preview-menu-item/index.d.ts +41 -2
- package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -1
- package/build-types/components/plugin-sidebar/index.d.ts.map +1 -1
- package/build-types/components/post-author/panel.d.ts.map +1 -1
- package/build-types/components/post-card-panel/index.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
- package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
- package/build-types/components/post-url/index.d.ts.map +1 -1
- package/build-types/components/post-url/panel.d.ts.map +1 -1
- package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -1
- package/build-types/components/visual-editor/index.d.ts.map +1 -1
- package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts +5 -0
- package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts.map +1 -0
- package/build-types/components/zoom-out-toggle/index.d.ts +3 -1
- package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/store/actions.d.ts +1 -4
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +21 -0
- package/build-types/store/selectors.d.ts.map +1 -1
- package/build-types/utils/pageTypeBadge.d.ts +5 -0
- package/build-types/utils/pageTypeBadge.d.ts.map +1 -0
- package/build-types/utils/terms.d.ts.map +1 -1
- package/package.json +39 -38
- package/src/bindings/api.js +1 -32
- package/src/bindings/post-meta.js +1 -0
- package/src/components/collab-sidebar/add-comment.js +124 -0
- package/src/components/collab-sidebar/comment-button-toolbar.js +29 -0
- package/src/components/collab-sidebar/comment-button.js +31 -0
- package/src/components/collab-sidebar/comments.js +404 -0
- package/src/components/collab-sidebar/constants.js +1 -0
- package/src/components/collab-sidebar/index.js +307 -0
- package/src/components/collab-sidebar/style.scss +111 -0
- package/src/components/collab-sidebar/utils.js +9 -0
- package/src/components/commands/index.js +9 -7
- package/src/components/document-bar/index.js +15 -7
- package/src/components/document-bar/style.scss +0 -4
- package/src/components/document-tools/index.js +2 -8
- package/src/components/editor-interface/index.js +4 -18
- package/src/components/entities-saved-states/index.js +2 -2
- package/src/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
- package/src/components/global-styles-provider/index.js +20 -6
- package/src/components/header/index.js +3 -1
- package/src/components/header/style.scss +1 -0
- package/src/components/inserter-sidebar/index.js +3 -6
- package/src/components/page-attributes/parent.js +6 -4
- package/src/components/plugin-more-menu-item/index.js +12 -11
- package/src/components/plugin-preview-menu-item/index.js +14 -13
- package/src/components/plugin-sidebar/index.js +0 -13
- package/src/components/post-actions/index.js +8 -11
- package/src/components/post-author/panel.js +4 -2
- package/src/components/post-card-panel/index.js +9 -43
- package/src/components/post-card-panel/style.scss +1 -9
- package/src/components/post-content-information/index.js +1 -1
- package/src/components/post-featured-image/index.js +31 -16
- package/src/components/post-featured-image/style.scss +5 -2
- package/src/components/post-last-revision/index.js +1 -1
- package/src/components/post-saved-state/test/__snapshots__/index.js.snap +1 -1
- package/src/components/post-schedule/label.js +1 -1
- package/src/components/post-sticky/test/index.js +6 -6
- package/src/components/post-taxonomies/flat-term-selector.js +15 -4
- package/src/components/post-taxonomies/hierarchical-term-selector.js +3 -2
- package/src/components/post-template/classic-theme.js +1 -2
- package/src/components/post-url/index.js +67 -55
- package/src/components/post-url/panel.js +61 -35
- package/src/components/post-url/style.scss +21 -3
- package/src/components/preview-dropdown/index.js +0 -2
- package/src/components/provider/index.js +32 -24
- package/src/components/provider/use-block-editor-settings.js +1 -1
- package/src/components/sidebar/header.js +3 -2
- package/src/components/sidebar/index.js +5 -3
- package/src/components/time-to-read/index.js +3 -3
- package/src/components/visual-editor/edit-template-blocks-notification.js +5 -1
- package/src/components/visual-editor/index.js +32 -39
- package/src/components/visual-editor/use-zoom-out-mode-exit.js +49 -0
- package/src/components/zoom-out-toggle/index.js +39 -5
- package/src/dataviews/actions/duplicate-template-part.tsx +3 -3
- package/src/private-apis.js +1 -5
- package/src/store/actions.js +33 -4
- package/src/store/private-actions.js +3 -3
- package/src/store/selectors.js +24 -2
- package/src/style.scss +1 -0
- package/src/utils/pageTypeBadge.js +41 -0
- package/src/utils/terms.js +4 -2
- package/src/utils/test/terms.js +3 -3
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
privateApis as blockEditorPrivateApis,
|
|
17
17
|
__experimentalUseResizeCanvas as useResizeCanvas,
|
|
18
18
|
} from '@wordpress/block-editor';
|
|
19
|
-
import { useEffect, useRef, useMemo } from '@wordpress/element';
|
|
19
|
+
import { useEffect, useRef, useMemo, useState } from '@wordpress/element';
|
|
20
20
|
import { useSelect } from '@wordpress/data';
|
|
21
21
|
import { parse } from '@wordpress/blocks';
|
|
22
22
|
import { store as coreStore } from '@wordpress/core-data';
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
TEMPLATE_PART_POST_TYPE,
|
|
42
42
|
TEMPLATE_POST_TYPE,
|
|
43
43
|
} from '../../store/constants';
|
|
44
|
+
import { useZoomOutModeExit } from './use-zoom-out-mode-exit';
|
|
44
45
|
|
|
45
46
|
const {
|
|
46
47
|
LayoutStyle,
|
|
@@ -105,9 +106,11 @@ function VisualEditor( {
|
|
|
105
106
|
contentRef,
|
|
106
107
|
className,
|
|
107
108
|
} ) {
|
|
108
|
-
const [
|
|
109
|
+
const [ contentHeight, setContentHeight ] = useState( '' );
|
|
110
|
+
const effectContentHeight = useResizeObserver( ( [ entry ] ) => {
|
|
111
|
+
setContentHeight( entry.borderBoxSize[ 0 ].blockSize );
|
|
112
|
+
} );
|
|
109
113
|
const isMobileViewport = useViewportMatch( 'small', '<' );
|
|
110
|
-
const isTabletViewport = useViewportMatch( 'medium', '<' );
|
|
111
114
|
const {
|
|
112
115
|
renderingMode,
|
|
113
116
|
postContentAttributes,
|
|
@@ -166,7 +169,7 @@ function VisualEditor( {
|
|
|
166
169
|
deviceType: getDeviceType(),
|
|
167
170
|
isFocusedEntity: !! editorSettings.onNavigateToPreviousEntityRecord,
|
|
168
171
|
postType: postTypeSlug,
|
|
169
|
-
isPreview: editorSettings.
|
|
172
|
+
isPreview: editorSettings.isPreviewMode,
|
|
170
173
|
};
|
|
171
174
|
}, [] );
|
|
172
175
|
const { isCleanNewPost } = useSelect( editorStore );
|
|
@@ -323,28 +326,6 @@ function VisualEditor( {
|
|
|
323
326
|
.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}
|
|
324
327
|
.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;
|
|
325
328
|
|
|
326
|
-
const localRef = useRef();
|
|
327
|
-
const typewriterRef = useTypewriter();
|
|
328
|
-
contentRef = useMergeRefs( [
|
|
329
|
-
localRef,
|
|
330
|
-
contentRef,
|
|
331
|
-
renderingMode === 'post-only' ? typewriterRef : null,
|
|
332
|
-
useFlashEditableBlocks( {
|
|
333
|
-
isEnabled: renderingMode === 'template-locked',
|
|
334
|
-
} ),
|
|
335
|
-
useSelectNearestEditableBlock( {
|
|
336
|
-
isEnabled: renderingMode === 'template-locked',
|
|
337
|
-
} ),
|
|
338
|
-
] );
|
|
339
|
-
|
|
340
|
-
const zoomOutProps =
|
|
341
|
-
isZoomedOut && ! isTabletViewport
|
|
342
|
-
? {
|
|
343
|
-
scale: 'default',
|
|
344
|
-
frameSize: '48px',
|
|
345
|
-
}
|
|
346
|
-
: {};
|
|
347
|
-
|
|
348
329
|
const forceFullHeight = postType === NAVIGATION_POST_TYPE;
|
|
349
330
|
const enableResizing =
|
|
350
331
|
[
|
|
@@ -358,14 +339,15 @@ function VisualEditor( {
|
|
|
358
339
|
! isMobileViewport &&
|
|
359
340
|
// Dsiable resizing in zoomed-out mode.
|
|
360
341
|
! isZoomedOut;
|
|
361
|
-
const shouldIframe =
|
|
362
|
-
! disableIframe || [ 'Tablet', 'Mobile' ].includes( deviceType );
|
|
363
342
|
|
|
364
343
|
const iframeStyles = useMemo( () => {
|
|
365
344
|
return [
|
|
366
345
|
...( styles ?? [] ),
|
|
367
346
|
{
|
|
368
|
-
|
|
347
|
+
// Ensures margins of children are contained so that the body background paints behind them.
|
|
348
|
+
// Otherwise, the background of html (when zoomed out) would show there and appear broken. It’s
|
|
349
|
+
// important mostly for post-only views yet conceivably an issue in templated views too.
|
|
350
|
+
css: `:where(.block-editor-iframe__body){display:flow-root;}.is-root-container{display:flow-root;${
|
|
369
351
|
// Some themes will have `min-height: 100vh` for the root container,
|
|
370
352
|
// which isn't a requirement in auto resize mode.
|
|
371
353
|
enableResizing ? 'min-height:0!important;' : ''
|
|
@@ -374,6 +356,24 @@ function VisualEditor( {
|
|
|
374
356
|
];
|
|
375
357
|
}, [ styles, enableResizing ] );
|
|
376
358
|
|
|
359
|
+
const localRef = useRef();
|
|
360
|
+
const typewriterRef = useTypewriter();
|
|
361
|
+
contentRef = useMergeRefs( [
|
|
362
|
+
localRef,
|
|
363
|
+
contentRef,
|
|
364
|
+
renderingMode === 'post-only' ? typewriterRef : null,
|
|
365
|
+
useFlashEditableBlocks( {
|
|
366
|
+
isEnabled: renderingMode === 'template-locked',
|
|
367
|
+
} ),
|
|
368
|
+
useSelectNearestEditableBlock( {
|
|
369
|
+
isEnabled: renderingMode === 'template-locked',
|
|
370
|
+
} ),
|
|
371
|
+
useZoomOutModeExit(),
|
|
372
|
+
// Avoid resize listeners when not needed, these will trigger
|
|
373
|
+
// unnecessary re-renders when animating the iframe width.
|
|
374
|
+
enableResizing ? effectContentHeight : null,
|
|
375
|
+
] );
|
|
376
|
+
|
|
377
377
|
return (
|
|
378
378
|
<div
|
|
379
379
|
className={ clsx(
|
|
@@ -384,24 +384,23 @@ function VisualEditor( {
|
|
|
384
384
|
{
|
|
385
385
|
'has-padding': isFocusedEntity || enableResizing,
|
|
386
386
|
'is-resizable': enableResizing,
|
|
387
|
-
'is-iframed':
|
|
387
|
+
'is-iframed': ! disableIframe,
|
|
388
388
|
}
|
|
389
389
|
) }
|
|
390
390
|
>
|
|
391
391
|
<ResizableEditor
|
|
392
392
|
enableResizing={ enableResizing }
|
|
393
393
|
height={
|
|
394
|
-
|
|
394
|
+
contentHeight && ! forceFullHeight ? contentHeight : '100%'
|
|
395
395
|
}
|
|
396
396
|
>
|
|
397
397
|
<BlockCanvas
|
|
398
|
-
shouldIframe={
|
|
398
|
+
shouldIframe={ ! disableIframe }
|
|
399
399
|
contentRef={ contentRef }
|
|
400
400
|
styles={ iframeStyles }
|
|
401
401
|
height="100%"
|
|
402
402
|
iframeProps={ {
|
|
403
403
|
...iframeProps,
|
|
404
|
-
...zoomOutProps,
|
|
405
404
|
style: {
|
|
406
405
|
...iframeProps?.style,
|
|
407
406
|
...deviceStyles,
|
|
@@ -486,12 +485,6 @@ function VisualEditor( {
|
|
|
486
485
|
/>
|
|
487
486
|
) }
|
|
488
487
|
</RecursionProvider>
|
|
489
|
-
{
|
|
490
|
-
// Avoid resize listeners when not needed,
|
|
491
|
-
// these will trigger unnecessary re-renders
|
|
492
|
-
// when animating the iframe width.
|
|
493
|
-
enableResizing && resizeObserver
|
|
494
|
-
}
|
|
495
488
|
</BlockCanvas>
|
|
496
489
|
</ResizableEditor>
|
|
497
490
|
</div>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
|
+
import { useRefEffect } from '@wordpress/compose';
|
|
6
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { unlock } from '../../lock-unlock';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Allows Zoom Out mode to be exited by double clicking in the selected block.
|
|
15
|
+
*/
|
|
16
|
+
export function useZoomOutModeExit() {
|
|
17
|
+
const { getSettings, isZoomOut } = unlock( useSelect( blockEditorStore ) );
|
|
18
|
+
const { resetZoomLevel } = unlock( useDispatch( blockEditorStore ) );
|
|
19
|
+
|
|
20
|
+
return useRefEffect(
|
|
21
|
+
( node ) => {
|
|
22
|
+
function onDoubleClick( event ) {
|
|
23
|
+
if ( ! isZoomOut() ) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if ( ! event.defaultPrevented ) {
|
|
28
|
+
event.preventDefault();
|
|
29
|
+
|
|
30
|
+
const { __experimentalSetIsInserterOpened } = getSettings();
|
|
31
|
+
|
|
32
|
+
if (
|
|
33
|
+
typeof __experimentalSetIsInserterOpened === 'function'
|
|
34
|
+
) {
|
|
35
|
+
__experimentalSetIsInserterOpened( false );
|
|
36
|
+
}
|
|
37
|
+
resetZoomLevel();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
node.addEventListener( 'dblclick', onDoubleClick );
|
|
42
|
+
|
|
43
|
+
return () => {
|
|
44
|
+
node.removeEventListener( 'dblclick', onDoubleClick );
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
[ getSettings, isZoomOut, resetZoomLevel ]
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -3,18 +3,23 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Button } from '@wordpress/components';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
|
-
|
|
6
|
+
import { useEffect } from '@wordpress/element';
|
|
7
7
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
8
8
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
9
9
|
import { square as zoomOutIcon } from '@wordpress/icons';
|
|
10
10
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
11
|
+
import {
|
|
12
|
+
useShortcut,
|
|
13
|
+
store as keyboardShortcutsStore,
|
|
14
|
+
} from '@wordpress/keyboard-shortcuts';
|
|
15
|
+
import { isAppleOS } from '@wordpress/keycodes';
|
|
11
16
|
|
|
12
17
|
/**
|
|
13
18
|
* Internal dependencies
|
|
14
19
|
*/
|
|
15
20
|
import { unlock } from '../../lock-unlock';
|
|
16
21
|
|
|
17
|
-
const ZoomOutToggle = () => {
|
|
22
|
+
const ZoomOutToggle = ( { disabled } ) => {
|
|
18
23
|
const { isZoomOut, showIconLabels } = useSelect( ( select ) => ( {
|
|
19
24
|
isZoomOut: unlock( select( blockEditorStore ) ).isZoomOut(),
|
|
20
25
|
showIconLabels: select( preferencesStore ).get(
|
|
@@ -23,21 +28,50 @@ const ZoomOutToggle = () => {
|
|
|
23
28
|
),
|
|
24
29
|
} ) );
|
|
25
30
|
|
|
26
|
-
const { resetZoomLevel, setZoomLevel
|
|
31
|
+
const { resetZoomLevel, setZoomLevel } = unlock(
|
|
27
32
|
useDispatch( blockEditorStore )
|
|
28
33
|
);
|
|
34
|
+
const { registerShortcut, unregisterShortcut } = useDispatch(
|
|
35
|
+
keyboardShortcutsStore
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
useEffect( () => {
|
|
39
|
+
registerShortcut( {
|
|
40
|
+
name: 'core/editor/zoom',
|
|
41
|
+
category: 'global',
|
|
42
|
+
description: __( 'Enter or exit zoom out.' ),
|
|
43
|
+
keyCombination: {
|
|
44
|
+
// `primaryShift+0` (`ctrl+shift+0`) is the shortcut for switching
|
|
45
|
+
// to input mode in Windows, so apply a different key combination.
|
|
46
|
+
modifier: isAppleOS() ? 'primaryShift' : 'secondary',
|
|
47
|
+
character: '0',
|
|
48
|
+
},
|
|
49
|
+
} );
|
|
50
|
+
return () => {
|
|
51
|
+
unregisterShortcut( 'core/editor/zoom' );
|
|
52
|
+
};
|
|
53
|
+
}, [ registerShortcut, unregisterShortcut ] );
|
|
54
|
+
|
|
55
|
+
useShortcut( 'core/editor/zoom', () => {
|
|
56
|
+
if ( isZoomOut ) {
|
|
57
|
+
resetZoomLevel();
|
|
58
|
+
} else {
|
|
59
|
+
setZoomLevel( 'auto-scaled' );
|
|
60
|
+
}
|
|
61
|
+
} );
|
|
29
62
|
|
|
30
63
|
const handleZoomOut = () => {
|
|
31
64
|
if ( isZoomOut ) {
|
|
32
65
|
resetZoomLevel();
|
|
33
66
|
} else {
|
|
34
|
-
setZoomLevel(
|
|
67
|
+
setZoomLevel( 'auto-scaled' );
|
|
35
68
|
}
|
|
36
|
-
__unstableSetEditorMode( isZoomOut ? 'edit' : 'zoom-out' );
|
|
37
69
|
};
|
|
38
70
|
|
|
39
71
|
return (
|
|
40
72
|
<Button
|
|
73
|
+
accessibleWhenDisabled
|
|
74
|
+
disabled={ disabled }
|
|
41
75
|
onClick={ handleZoomOut }
|
|
42
76
|
icon={ zoomOutIcon }
|
|
43
77
|
label={ __( 'Zoom Out' ) }
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useDispatch } from '@wordpress/data';
|
|
5
|
-
import {
|
|
5
|
+
import { _x, sprintf } from '@wordpress/i18n';
|
|
6
6
|
import { store as noticesStore } from '@wordpress/notices';
|
|
7
7
|
import { useMemo } from '@wordpress/element';
|
|
8
8
|
// @ts-ignore
|
|
@@ -42,7 +42,7 @@ const duplicateTemplatePart: Action< TemplatePart > = {
|
|
|
42
42
|
createSuccessNotice(
|
|
43
43
|
sprintf(
|
|
44
44
|
// translators: %s: The new template part's title e.g. 'Call to action (copy)'.
|
|
45
|
-
|
|
45
|
+
_x( '"%s" duplicated.', 'template part' ),
|
|
46
46
|
getItemTitle( item )
|
|
47
47
|
),
|
|
48
48
|
{ type: 'snackbar', id: 'edit-site-patterns-success' }
|
|
@@ -55,7 +55,7 @@ const duplicateTemplatePart: Action< TemplatePart > = {
|
|
|
55
55
|
defaultArea={ item.area }
|
|
56
56
|
defaultTitle={ sprintf(
|
|
57
57
|
/* translators: %s: Existing template part title */
|
|
58
|
-
|
|
58
|
+
_x( '%s (Copy)', 'template part' ),
|
|
59
59
|
getItemTitle( item )
|
|
60
60
|
) }
|
|
61
61
|
onCreate={ onTemplatePartSuccess }
|
package/src/private-apis.js
CHANGED
|
@@ -23,10 +23,7 @@ import {
|
|
|
23
23
|
mergeBaseAndUserConfigs,
|
|
24
24
|
GlobalStylesProvider,
|
|
25
25
|
} from './components/global-styles-provider';
|
|
26
|
-
import {
|
|
27
|
-
registerCoreBlockBindingsSources,
|
|
28
|
-
bootstrapBlockBindingsSourcesFromServer,
|
|
29
|
-
} from './bindings/api';
|
|
26
|
+
import { registerCoreBlockBindingsSources } from './bindings/api';
|
|
30
27
|
|
|
31
28
|
const { store: interfaceStore, ...remainingInterfaceApis } = interfaceApis;
|
|
32
29
|
|
|
@@ -47,7 +44,6 @@ lock( privateApis, {
|
|
|
47
44
|
ViewMoreMenuGroup,
|
|
48
45
|
ResizableEditor,
|
|
49
46
|
registerCoreBlockBindingsSources,
|
|
50
|
-
bootstrapBlockBindingsSourcesFromServer,
|
|
51
47
|
|
|
52
48
|
// This is a temporary private API while we're updating the site editor to use EditorProvider.
|
|
53
49
|
interfaceStore,
|
package/src/store/actions.js
CHANGED
|
@@ -159,6 +159,29 @@ export function setEditedPost( postType, postId ) {
|
|
|
159
159
|
*
|
|
160
160
|
* @param {Object} edits Post attributes to edit.
|
|
161
161
|
* @param {Object} options Options for the edit.
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```js
|
|
165
|
+
* // Update the post title
|
|
166
|
+
* wp.data.dispatch( 'core/editor' ).editPost( { title: `${ newTitle }` } );
|
|
167
|
+
* ```
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
*```js
|
|
171
|
+
* // Get specific media size based on the featured media ID
|
|
172
|
+
* // Note: change sizes?.large for any registered size
|
|
173
|
+
* const getFeaturedMediaUrl = useSelect( ( select ) => {
|
|
174
|
+
* const getFeaturedMediaId =
|
|
175
|
+
* select( 'core/editor' ).getEditedPostAttribute( 'featured_media' );
|
|
176
|
+
* const getMedia = select( 'core' ).getMedia( getFeaturedMediaId );
|
|
177
|
+
*
|
|
178
|
+
* return (
|
|
179
|
+
* getMedia?.media_details?.sizes?.large?.source_url || getMedia?.source_url || ''
|
|
180
|
+
* );
|
|
181
|
+
* }, [] );
|
|
182
|
+
* ```
|
|
183
|
+
*
|
|
184
|
+
* @return {Object} Action object
|
|
162
185
|
*/
|
|
163
186
|
export const editPost =
|
|
164
187
|
( edits, options ) =>
|
|
@@ -255,7 +278,11 @@ export const savePost =
|
|
|
255
278
|
|
|
256
279
|
if ( ! error ) {
|
|
257
280
|
try {
|
|
258
|
-
await doActionAsync(
|
|
281
|
+
await doActionAsync(
|
|
282
|
+
'editor.savePost',
|
|
283
|
+
{ id: previousRecord.id },
|
|
284
|
+
options
|
|
285
|
+
);
|
|
259
286
|
} catch ( err ) {
|
|
260
287
|
error = err;
|
|
261
288
|
}
|
|
@@ -814,8 +841,8 @@ export const toggleDistractionFree =
|
|
|
814
841
|
.dispatch( noticesStore )
|
|
815
842
|
.createInfoNotice(
|
|
816
843
|
isDistractionFree
|
|
817
|
-
? __( 'Distraction free
|
|
818
|
-
: __( 'Distraction free
|
|
844
|
+
? __( 'Distraction free mode deactivated.' )
|
|
845
|
+
: __( 'Distraction free mode activated.' ),
|
|
819
846
|
{
|
|
820
847
|
id: 'core/editor/distraction-free-mode/notice',
|
|
821
848
|
type: 'snackbar',
|
|
@@ -856,9 +883,11 @@ export const switchEditorMode =
|
|
|
856
883
|
( { dispatch, registry } ) => {
|
|
857
884
|
registry.dispatch( preferencesStore ).set( 'core', 'editorMode', mode );
|
|
858
885
|
|
|
859
|
-
// Unselect blocks when we switch to a non visual mode.
|
|
860
886
|
if ( mode !== 'visual' ) {
|
|
887
|
+
// Unselect blocks when we switch to a non visual mode.
|
|
861
888
|
registry.dispatch( blockEditorStore ).clearSelectedBlock();
|
|
889
|
+
// Exit zoom out state when switching to a non visual mode.
|
|
890
|
+
unlock( registry.dispatch( blockEditorStore ) ).resetZoomLevel();
|
|
862
891
|
}
|
|
863
892
|
|
|
864
893
|
if ( mode === 'visual' ) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { store as coreStore } from '@wordpress/core-data';
|
|
5
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
5
|
+
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
6
6
|
import { store as noticesStore } from '@wordpress/notices';
|
|
7
7
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
8
8
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
@@ -410,8 +410,8 @@ export const removeTemplates =
|
|
|
410
410
|
decodeEntities( title )
|
|
411
411
|
)
|
|
412
412
|
: sprintf(
|
|
413
|
-
/* translators: The template/part's name. */
|
|
414
|
-
|
|
413
|
+
/* translators: %s: The template/part's name. */
|
|
414
|
+
_x( '"%s" deleted.', 'template part' ),
|
|
415
415
|
decodeEntities( title )
|
|
416
416
|
);
|
|
417
417
|
} else {
|
package/src/store/selectors.js
CHANGED
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
} from './constants';
|
|
29
29
|
import { getPostRawValue } from './reducer';
|
|
30
30
|
import { getTemplatePartIcon } from '../utils/get-template-part-icon';
|
|
31
|
+
import { unlock } from '../lock-unlock';
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
34
|
* Shared reference to an empty object for cases where it is important to avoid
|
|
@@ -177,6 +178,11 @@ export const getCurrentPost = createRegistrySelector(
|
|
|
177
178
|
*
|
|
178
179
|
* @param {Object} state Global application state.
|
|
179
180
|
*
|
|
181
|
+
* @example
|
|
182
|
+
*
|
|
183
|
+
*```js
|
|
184
|
+
* const currentPostType = wp.data.select( 'core/editor' ).getCurrentPostType();
|
|
185
|
+
*```
|
|
180
186
|
* @return {string} Post type.
|
|
181
187
|
*/
|
|
182
188
|
export function getCurrentPostType( state ) {
|
|
@@ -316,6 +322,22 @@ const getNestedEditedPostProperty = createSelector(
|
|
|
316
322
|
* @param {Object} state Global application state.
|
|
317
323
|
* @param {string} attributeName Post attribute name.
|
|
318
324
|
*
|
|
325
|
+
* @example
|
|
326
|
+
*
|
|
327
|
+
*```js
|
|
328
|
+
* // Get specific media size based on the featured media ID
|
|
329
|
+
* // Note: change sizes?.large for any registered size
|
|
330
|
+
* const getFeaturedMediaUrl = useSelect( ( select ) => {
|
|
331
|
+
* const getFeaturedMediaId =
|
|
332
|
+
* select( 'core/editor' ).getEditedPostAttribute( 'featured_media' );
|
|
333
|
+
* const getMedia = select( 'core' ).getMedia( getFeaturedMediaId );
|
|
334
|
+
*
|
|
335
|
+
* return (
|
|
336
|
+
* getMedia?.media_details?.sizes?.large?.source_url || getMedia?.source_url || ''
|
|
337
|
+
* );
|
|
338
|
+
* }, [] );
|
|
339
|
+
*```
|
|
340
|
+
*
|
|
319
341
|
* @return {*} Post attribute value.
|
|
320
342
|
*/
|
|
321
343
|
export function getEditedPostAttribute( state, attributeName ) {
|
|
@@ -1278,8 +1300,8 @@ export function getRenderingMode( state ) {
|
|
|
1278
1300
|
*/
|
|
1279
1301
|
export const getDeviceType = createRegistrySelector(
|
|
1280
1302
|
( select ) => ( state ) => {
|
|
1281
|
-
const
|
|
1282
|
-
if (
|
|
1303
|
+
const isZoomOut = unlock( select( blockEditorStore ) ).isZoomOut();
|
|
1304
|
+
if ( isZoomOut ) {
|
|
1283
1305
|
return 'Desktop';
|
|
1284
1306
|
}
|
|
1285
1307
|
return state.deviceType;
|
package/src/style.scss
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
@import "./components/autocompleters/style.scss";
|
|
4
4
|
@import "./components/block-manager/style.scss";
|
|
5
|
+
@import "./components/collab-sidebar/style.scss";
|
|
5
6
|
@import "./components/collapsible-block-toolbar/style.scss";
|
|
6
7
|
@import "./components/create-template-part-modal/style.scss";
|
|
7
8
|
@import "./components/block-settings-menu/style.scss";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { useSelect } from '@wordpress/data';
|
|
6
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { store as editorStore } from '../store';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Custom hook to get the page type badge for the current post on edit site view.
|
|
15
|
+
*/
|
|
16
|
+
export default function usePageTypeBadge() {
|
|
17
|
+
const { isFrontPage, isPostsPage } = useSelect( ( select ) => {
|
|
18
|
+
const { getCurrentPostId } = select( editorStore );
|
|
19
|
+
const { canUser, getEditedEntityRecord } = select( coreStore );
|
|
20
|
+
const postId = getCurrentPostId();
|
|
21
|
+
const siteSettings = canUser( 'read', {
|
|
22
|
+
kind: 'root',
|
|
23
|
+
name: 'site',
|
|
24
|
+
} )
|
|
25
|
+
? getEditedEntityRecord( 'root', 'site' )
|
|
26
|
+
: undefined;
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
isFrontPage: siteSettings?.page_on_front === postId,
|
|
30
|
+
isPostsPage: siteSettings?.page_for_posts === postId,
|
|
31
|
+
};
|
|
32
|
+
} );
|
|
33
|
+
|
|
34
|
+
if ( isFrontPage ) {
|
|
35
|
+
return __( 'Homepage' );
|
|
36
|
+
} else if ( isPostsPage ) {
|
|
37
|
+
return __( 'Posts Page' );
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return false;
|
|
41
|
+
}
|
package/src/utils/terms.js
CHANGED
|
@@ -14,14 +14,16 @@ export function buildTermsTree( flatTerms ) {
|
|
|
14
14
|
const flatTermsWithParentAndChildren = flatTerms.map( ( term ) => {
|
|
15
15
|
return {
|
|
16
16
|
children: [],
|
|
17
|
-
parent:
|
|
17
|
+
parent: undefined,
|
|
18
18
|
...term,
|
|
19
19
|
};
|
|
20
20
|
} );
|
|
21
21
|
|
|
22
22
|
// All terms should have a `parent` because we're about to index them by it.
|
|
23
23
|
if (
|
|
24
|
-
flatTermsWithParentAndChildren.some(
|
|
24
|
+
flatTermsWithParentAndChildren.some(
|
|
25
|
+
( { parent } ) => parent === undefined
|
|
26
|
+
)
|
|
25
27
|
) {
|
|
26
28
|
return flatTermsWithParentAndChildren;
|
|
27
29
|
}
|
package/src/utils/test/terms.js
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
import { buildTermsTree } from '../terms';
|
|
5
5
|
|
|
6
6
|
describe( 'buildTermsTree()', () => {
|
|
7
|
-
it( 'Should return same array as input with
|
|
7
|
+
it( 'Should return same array as input with undefined parent and empty children added if parent is never specified.', () => {
|
|
8
8
|
const input = Object.freeze( [
|
|
9
9
|
{ id: 2232, dummy: true },
|
|
10
10
|
{ id: 2245, dummy: true },
|
|
11
11
|
] );
|
|
12
12
|
const output = Object.freeze( [
|
|
13
|
-
{ id: 2232, parent:
|
|
14
|
-
{ id: 2245, parent:
|
|
13
|
+
{ id: 2232, parent: undefined, children: [], dummy: true },
|
|
14
|
+
{ id: 2245, parent: undefined, children: [], dummy: true },
|
|
15
15
|
] );
|
|
16
16
|
const termsTreem = buildTermsTree( input );
|
|
17
17
|
expect( termsTreem ).toEqual( output );
|