@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
|
@@ -72,7 +72,7 @@ function EditorKeyboardShortcutsRegister() {
|
|
|
72
72
|
registerShortcut( {
|
|
73
73
|
name: 'core/editor/toggle-list-view',
|
|
74
74
|
category: 'global',
|
|
75
|
-
description: __( '
|
|
75
|
+
description: __( 'Show or hide the List View.' ),
|
|
76
76
|
keyCombination: {
|
|
77
77
|
modifier: 'access',
|
|
78
78
|
character: 'o',
|
|
@@ -82,7 +82,7 @@ function EditorKeyboardShortcutsRegister() {
|
|
|
82
82
|
registerShortcut( {
|
|
83
83
|
name: 'core/editor/toggle-distraction-free',
|
|
84
84
|
category: 'global',
|
|
85
|
-
description: __( '
|
|
85
|
+
description: __( 'Enter or exit distraction free mode.' ),
|
|
86
86
|
keyCombination: {
|
|
87
87
|
modifier: 'primaryShift',
|
|
88
88
|
character: '\\',
|
|
@@ -92,7 +92,7 @@ function EditorKeyboardShortcutsRegister() {
|
|
|
92
92
|
registerShortcut( {
|
|
93
93
|
name: 'core/editor/toggle-sidebar',
|
|
94
94
|
category: 'global',
|
|
95
|
-
description: __( 'Show or hide the Settings
|
|
95
|
+
description: __( 'Show or hide the Settings panel.' ),
|
|
96
96
|
keyCombination: {
|
|
97
97
|
modifier: 'primaryShift',
|
|
98
98
|
character: ',',
|
|
@@ -56,13 +56,27 @@ function useGlobalStylesUserConfig() {
|
|
|
56
56
|
select( coreStore ).__experimentalGetCurrentGlobalStylesId();
|
|
57
57
|
|
|
58
58
|
let record;
|
|
59
|
-
const userCanEditGlobalStyles = canUser( 'update', {
|
|
60
|
-
kind: 'root',
|
|
61
|
-
name: 'globalStyles',
|
|
62
|
-
id: _globalStylesId,
|
|
63
|
-
} );
|
|
64
59
|
|
|
65
|
-
|
|
60
|
+
// We want the global styles ID request to finish before triggering
|
|
61
|
+
// the OPTIONS request for user capabilities, otherwise it will
|
|
62
|
+
// fetch `/wp/v2/global-styles` instead of
|
|
63
|
+
// `/wp/v2/global-styles/{id}`!
|
|
64
|
+
// Please adjust the preloaded requests if this changes!
|
|
65
|
+
const userCanEditGlobalStyles = _globalStylesId
|
|
66
|
+
? canUser( 'update', {
|
|
67
|
+
kind: 'root',
|
|
68
|
+
name: 'globalStyles',
|
|
69
|
+
id: _globalStylesId,
|
|
70
|
+
} )
|
|
71
|
+
: null;
|
|
72
|
+
|
|
73
|
+
if (
|
|
74
|
+
_globalStylesId &&
|
|
75
|
+
// We want the OPTIONS request for user capabilities to finish
|
|
76
|
+
// before getting the records, otherwise we'll fetch both!
|
|
77
|
+
typeof userCanEditGlobalStyles === 'boolean'
|
|
78
|
+
) {
|
|
79
|
+
// Please adjust the preloaded requests if this changes!
|
|
66
80
|
if ( userCanEditGlobalStyles ) {
|
|
67
81
|
record = getEditedEntityRecord(
|
|
68
82
|
'root',
|
|
@@ -12,6 +12,7 @@ import { PinnedItems } from '@wordpress/interface';
|
|
|
12
12
|
/**
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
|
+
import CollabSidebar from '../collab-sidebar';
|
|
15
16
|
import BackButton, { useHasBackButton } from './back-button';
|
|
16
17
|
import CollapsibleBlockToolbar from '../collapsible-block-toolbar';
|
|
17
18
|
import DocumentBar from '../document-bar';
|
|
@@ -149,7 +150,7 @@ function Header( {
|
|
|
149
150
|
) }
|
|
150
151
|
|
|
151
152
|
{ canBeZoomedOut && isEditorIframed && isWideViewport && (
|
|
152
|
-
<ZoomOutToggle />
|
|
153
|
+
<ZoomOutToggle disabled={ forceDisableBlockTools } />
|
|
153
154
|
) }
|
|
154
155
|
|
|
155
156
|
<PreviewDropdown
|
|
@@ -174,6 +175,7 @@ function Header( {
|
|
|
174
175
|
}
|
|
175
176
|
/>
|
|
176
177
|
) }
|
|
178
|
+
<CollabSidebar />
|
|
177
179
|
|
|
178
180
|
{ customSaveButton }
|
|
179
181
|
<MoreMenu />
|
|
@@ -33,15 +33,12 @@ export default function InserterSidebar() {
|
|
|
33
33
|
getInserter,
|
|
34
34
|
isPublishSidebarOpened,
|
|
35
35
|
} = unlock( select( editorStore ) );
|
|
36
|
-
const {
|
|
37
|
-
|
|
38
|
-
__unstableGetEditorMode,
|
|
39
|
-
getSectionRootClientId,
|
|
40
|
-
} = unlock( select( blockEditorStore ) );
|
|
36
|
+
const { getBlockRootClientId, isZoomOut, getSectionRootClientId } =
|
|
37
|
+
unlock( select( blockEditorStore ) );
|
|
41
38
|
const { get } = select( preferencesStore );
|
|
42
39
|
const { getActiveComplementaryArea } = select( interfaceStore );
|
|
43
40
|
const getBlockSectionRootClientId = () => {
|
|
44
|
-
if (
|
|
41
|
+
if ( isZoomOut() ) {
|
|
45
42
|
const sectionRootClientId = getSectionRootClientId();
|
|
46
43
|
|
|
47
44
|
if ( sectionRootClientId ) {
|
|
@@ -212,8 +212,10 @@ function PostParentToggle( { isOpen, onClick } ) {
|
|
|
212
212
|
className="editor-post-parent__panel-toggle"
|
|
213
213
|
variant="tertiary"
|
|
214
214
|
aria-expanded={ isOpen }
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
aria-label={
|
|
216
|
+
// translators: %s: Current post parent.
|
|
217
|
+
sprintf( __( 'Change parent: %s' ), parentTitle )
|
|
218
|
+
}
|
|
217
219
|
onClick={ onClick }
|
|
218
220
|
>
|
|
219
221
|
{ parentTitle }
|
|
@@ -261,9 +263,9 @@ export function ParentRow() {
|
|
|
261
263
|
<div>
|
|
262
264
|
{ createInterpolateElement(
|
|
263
265
|
sprintf(
|
|
264
|
-
/* translators: %
|
|
266
|
+
/* translators: %s: The home URL of the WordPress installation without the scheme. */
|
|
265
267
|
__(
|
|
266
|
-
'Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %
|
|
268
|
+
'Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %s<wbr />/services<wbr />/pricing.'
|
|
267
269
|
),
|
|
268
270
|
filterURLForDisplay( homeUrl ).replace(
|
|
269
271
|
/([/.])/g,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { compose } from '@wordpress/compose';
|
|
5
4
|
import { MenuItem } from '@wordpress/components';
|
|
6
|
-
import {
|
|
5
|
+
import { usePluginContext } from '@wordpress/plugins';
|
|
7
6
|
import { ActionItem } from '@wordpress/interface';
|
|
8
7
|
|
|
9
8
|
/**
|
|
@@ -62,12 +61,14 @@ import { ActionItem } from '@wordpress/interface';
|
|
|
62
61
|
*
|
|
63
62
|
* @return {Component} The component to be rendered.
|
|
64
63
|
*/
|
|
65
|
-
export default
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
export default function PluginMoreMenuItem( props ) {
|
|
65
|
+
const context = usePluginContext();
|
|
66
|
+
return (
|
|
67
|
+
<ActionItem
|
|
68
|
+
name="core/plugin-more-menu"
|
|
69
|
+
as={ props.as ?? MenuItem }
|
|
70
|
+
icon={ props.icon || context.icon }
|
|
71
|
+
{ ...props }
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { compose } from '@wordpress/compose';
|
|
5
4
|
import { MenuItem } from '@wordpress/components';
|
|
6
|
-
import {
|
|
5
|
+
import { usePluginContext } from '@wordpress/plugins';
|
|
7
6
|
import { ActionItem } from '@wordpress/interface';
|
|
8
7
|
|
|
9
8
|
/**
|
|
@@ -27,12 +26,12 @@ import { ActionItem } from '@wordpress/interface';
|
|
|
27
26
|
* }
|
|
28
27
|
*
|
|
29
28
|
* const ExternalPreviewMenuItem = () => (
|
|
30
|
-
* <
|
|
29
|
+
* <PluginPreviewMenuItem
|
|
31
30
|
* icon={ external }
|
|
32
31
|
* onClick={ onPreviewClick }
|
|
33
32
|
* >
|
|
34
33
|
* { __( 'Preview in new tab' ) }
|
|
35
|
-
* </
|
|
34
|
+
* </PluginPreviewMenuItem>
|
|
36
35
|
* );
|
|
37
36
|
* registerPlugin( 'external-preview-menu-item', {
|
|
38
37
|
* render: ExternalPreviewMenuItem,
|
|
@@ -41,12 +40,14 @@ import { ActionItem } from '@wordpress/interface';
|
|
|
41
40
|
*
|
|
42
41
|
* @return {Component} The rendered menu item component.
|
|
43
42
|
*/
|
|
44
|
-
export default
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
export default function PluginPreviewMenuItem( props ) {
|
|
44
|
+
const context = usePluginContext();
|
|
45
|
+
return (
|
|
46
|
+
<ActionItem
|
|
47
|
+
name="core/plugin-preview-menu"
|
|
48
|
+
as={ props.as ?? MenuItem }
|
|
49
|
+
icon={ props.icon || context.icon }
|
|
50
|
+
{ ...props }
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { useSelect } from '@wordpress/data';
|
|
5
|
-
import { __ } from '@wordpress/i18n';
|
|
6
4
|
import { ComplementaryArea } from '@wordpress/interface';
|
|
7
5
|
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
|
-
import { store as editorStore } from '../../store';
|
|
12
|
-
|
|
13
6
|
/**
|
|
14
7
|
* Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.
|
|
15
8
|
* It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.
|
|
@@ -76,16 +69,10 @@ import { store as editorStore } from '../../store';
|
|
|
76
69
|
* ```
|
|
77
70
|
*/
|
|
78
71
|
export default function PluginSidebar( { className, ...props } ) {
|
|
79
|
-
const { postTitle } = useSelect( ( select ) => {
|
|
80
|
-
return {
|
|
81
|
-
postTitle: select( editorStore ).getEditedPostAttribute( 'title' ),
|
|
82
|
-
};
|
|
83
|
-
}, [] );
|
|
84
72
|
return (
|
|
85
73
|
<ComplementaryArea
|
|
86
74
|
panelClassName={ className }
|
|
87
75
|
className="editor-sidebar"
|
|
88
|
-
smallScreenTitle={ postTitle || __( '(no title)' ) }
|
|
89
76
|
scope="core"
|
|
90
77
|
{ ...props }
|
|
91
78
|
/>
|
|
@@ -18,7 +18,7 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
18
18
|
import { unlock } from '../../lock-unlock';
|
|
19
19
|
import { usePostActions } from './actions';
|
|
20
20
|
|
|
21
|
-
const {
|
|
21
|
+
const { Menu, kebabCase } = unlock( componentsPrivateApis );
|
|
22
22
|
|
|
23
23
|
export default function PostActions( { postType, postId, onActionPerformed } ) {
|
|
24
24
|
const [ isActionsMenuOpen, setIsActionsMenuOpen ] = useState( false );
|
|
@@ -54,7 +54,7 @@ export default function PostActions( { postType, postId, onActionPerformed } ) {
|
|
|
54
54
|
}, [ allActions, itemWithPermissions ] );
|
|
55
55
|
|
|
56
56
|
return (
|
|
57
|
-
<
|
|
57
|
+
<Menu
|
|
58
58
|
open={ isActionsMenuOpen }
|
|
59
59
|
trigger={
|
|
60
60
|
<Button
|
|
@@ -79,7 +79,7 @@ export default function PostActions( { postType, postId, onActionPerformed } ) {
|
|
|
79
79
|
setIsActionsMenuOpen( false );
|
|
80
80
|
} }
|
|
81
81
|
/>
|
|
82
|
-
</
|
|
82
|
+
</Menu>
|
|
83
83
|
);
|
|
84
84
|
}
|
|
85
85
|
|
|
@@ -93,12 +93,9 @@ function DropdownMenuItemTrigger( { action, onClick, items } ) {
|
|
|
93
93
|
const label =
|
|
94
94
|
typeof action.label === 'string' ? action.label : action.label( items );
|
|
95
95
|
return (
|
|
96
|
-
<
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
>
|
|
100
|
-
<DropdownMenuV2.ItemLabel>{ label }</DropdownMenuV2.ItemLabel>
|
|
101
|
-
</DropdownMenuV2.Item>
|
|
96
|
+
<Menu.Item onClick={ onClick } hideOnClick={ ! action.RenderModal }>
|
|
97
|
+
<Menu.ItemLabel>{ label }</Menu.ItemLabel>
|
|
98
|
+
</Menu.Item>
|
|
102
99
|
);
|
|
103
100
|
}
|
|
104
101
|
|
|
@@ -145,7 +142,7 @@ function ActionWithModal( { action, item, ActionTrigger, onClose } ) {
|
|
|
145
142
|
// With an added onClose prop.
|
|
146
143
|
function ActionsDropdownMenuGroup( { actions, item, onClose } ) {
|
|
147
144
|
return (
|
|
148
|
-
<
|
|
145
|
+
<Menu.Group>
|
|
149
146
|
{ actions.map( ( action ) => {
|
|
150
147
|
if ( action.RenderModal ) {
|
|
151
148
|
return (
|
|
@@ -167,6 +164,6 @@ function ActionsDropdownMenuGroup( { actions, item, onClose } ) {
|
|
|
167
164
|
/>
|
|
168
165
|
);
|
|
169
166
|
} ) }
|
|
170
|
-
</
|
|
167
|
+
</Menu.Group>
|
|
171
168
|
);
|
|
172
169
|
}
|
|
@@ -25,8 +25,10 @@ function PostAuthorToggle( { isOpen, onClick } ) {
|
|
|
25
25
|
className="editor-post-author__panel-toggle"
|
|
26
26
|
variant="tertiary"
|
|
27
27
|
aria-expanded={ isOpen }
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
aria-label={
|
|
29
|
+
// translators: %s: Author name.
|
|
30
|
+
sprintf( __( 'Change author: %s' ), authorName )
|
|
31
|
+
}
|
|
30
32
|
onClick={ onClick }
|
|
31
33
|
>
|
|
32
34
|
{ authorName }
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import clsx from 'clsx';
|
|
5
1
|
/**
|
|
6
2
|
* WordPress dependencies
|
|
7
3
|
*/
|
|
@@ -22,27 +18,20 @@ import { store as editorStore } from '../../store';
|
|
|
22
18
|
import {
|
|
23
19
|
TEMPLATE_POST_TYPE,
|
|
24
20
|
TEMPLATE_PART_POST_TYPE,
|
|
25
|
-
PATTERN_POST_TYPE,
|
|
26
|
-
GLOBAL_POST_TYPES,
|
|
27
21
|
} from '../../store/constants';
|
|
28
22
|
import { unlock } from '../../lock-unlock';
|
|
29
23
|
import PostActions from '../post-actions';
|
|
24
|
+
import usePageTypeBadge from '../../utils/pageTypeBadge';
|
|
30
25
|
|
|
31
26
|
export default function PostCardPanel( {
|
|
32
27
|
postType,
|
|
33
28
|
postId,
|
|
34
29
|
onActionPerformed,
|
|
35
30
|
} ) {
|
|
36
|
-
const {
|
|
31
|
+
const { title, icon } = useSelect(
|
|
37
32
|
( select ) => {
|
|
38
33
|
const { __experimentalGetTemplateInfo } = select( editorStore );
|
|
39
|
-
const {
|
|
40
|
-
const siteSettings = canUser( 'read', {
|
|
41
|
-
kind: 'root',
|
|
42
|
-
name: 'site',
|
|
43
|
-
} )
|
|
44
|
-
? getEditedEntityRecord( 'root', 'site' )
|
|
45
|
-
: undefined;
|
|
34
|
+
const { getEditedEntityRecord } = select( coreStore );
|
|
46
35
|
const _record = getEditedEntityRecord(
|
|
47
36
|
'postType',
|
|
48
37
|
postType,
|
|
@@ -52,31 +41,18 @@ export default function PostCardPanel( {
|
|
|
52
41
|
[ TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE ].includes(
|
|
53
42
|
postType
|
|
54
43
|
) && __experimentalGetTemplateInfo( _record );
|
|
55
|
-
let _isSync = false;
|
|
56
|
-
if ( GLOBAL_POST_TYPES.includes( postType ) ) {
|
|
57
|
-
if ( PATTERN_POST_TYPE === postType ) {
|
|
58
|
-
// When the post is first created, the top level wp_pattern_sync_status is not set so get meta value instead.
|
|
59
|
-
const currentSyncStatus =
|
|
60
|
-
_record?.meta?.wp_pattern_sync_status === 'unsynced'
|
|
61
|
-
? 'unsynced'
|
|
62
|
-
: _record?.wp_pattern_sync_status;
|
|
63
|
-
_isSync = currentSyncStatus !== 'unsynced';
|
|
64
|
-
} else {
|
|
65
|
-
_isSync = true;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
44
|
return {
|
|
69
45
|
title: _templateInfo?.title || _record?.title,
|
|
70
46
|
icon: unlock( select( editorStore ) ).getPostIcon( postType, {
|
|
71
47
|
area: _record?.area,
|
|
72
48
|
} ),
|
|
73
|
-
isSync: _isSync,
|
|
74
|
-
isFrontPage: siteSettings?.page_on_front === postId,
|
|
75
|
-
isPostsPage: siteSettings?.page_for_posts === postId,
|
|
76
49
|
};
|
|
77
50
|
},
|
|
78
51
|
[ postId, postType ]
|
|
79
52
|
);
|
|
53
|
+
|
|
54
|
+
const pageTypeBadge = usePageTypeBadge();
|
|
55
|
+
|
|
80
56
|
return (
|
|
81
57
|
<div className="editor-post-card-panel">
|
|
82
58
|
<HStack
|
|
@@ -84,12 +60,7 @@ export default function PostCardPanel( {
|
|
|
84
60
|
className="editor-post-card-panel__header"
|
|
85
61
|
align="flex-start"
|
|
86
62
|
>
|
|
87
|
-
<Icon
|
|
88
|
-
className={ clsx( 'editor-post-card-panel__icon', {
|
|
89
|
-
'is-sync': isSync,
|
|
90
|
-
} ) }
|
|
91
|
-
icon={ icon }
|
|
92
|
-
/>
|
|
63
|
+
<Icon className="editor-post-card-panel__icon" icon={ icon } />
|
|
93
64
|
<Text
|
|
94
65
|
numberOfLines={ 2 }
|
|
95
66
|
truncate
|
|
@@ -99,14 +70,9 @@ export default function PostCardPanel( {
|
|
|
99
70
|
lineHeight="20px"
|
|
100
71
|
>
|
|
101
72
|
{ title ? decodeEntities( title ) : __( 'No title' ) }
|
|
102
|
-
{
|
|
103
|
-
<span className="editor-post-card-panel__title-badge">
|
|
104
|
-
{ __( 'Homepage' ) }
|
|
105
|
-
</span>
|
|
106
|
-
) }
|
|
107
|
-
{ isPostsPage && (
|
|
73
|
+
{ pageTypeBadge && (
|
|
108
74
|
<span className="editor-post-card-panel__title-badge">
|
|
109
|
-
{
|
|
75
|
+
{ pageTypeBadge }
|
|
110
76
|
</span>
|
|
111
77
|
) }
|
|
112
78
|
</Text>
|
|
@@ -34,17 +34,9 @@
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
.editor-post-card-panel__icon.is-sync {
|
|
38
|
-
fill: var(--wp-block-synced-color);
|
|
39
|
-
|
|
40
|
-
& + .editor-post-card-panel__title {
|
|
41
|
-
color: var(--wp-block-synced-color);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
37
|
.editor-post-card-panel__title-badge {
|
|
46
38
|
background: $gray-100;
|
|
47
|
-
color: $gray-
|
|
39
|
+
color: $gray-800;
|
|
48
40
|
padding: 0 $grid-unit-05;
|
|
49
41
|
border-radius: $radius-small;
|
|
50
42
|
font-size: 12px;
|
|
@@ -70,7 +70,7 @@ export default function PostContentInformation() {
|
|
|
70
70
|
readingTime <= 1
|
|
71
71
|
? __( '1 minute' )
|
|
72
72
|
: sprintf(
|
|
73
|
-
|
|
73
|
+
/* translators: %s: the number of minutes to read the post. */
|
|
74
74
|
_n( '%s minute', '%s minutes', readingTime ),
|
|
75
75
|
readingTime.toLocaleString()
|
|
76
76
|
);
|
|
@@ -121,6 +121,35 @@ function PostFeaturedImage( {
|
|
|
121
121
|
} );
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
/**
|
|
125
|
+
* Generates the featured image alt text for this editing context.
|
|
126
|
+
*
|
|
127
|
+
* @param {Object} imageMedia The image media object.
|
|
128
|
+
* @param {string} imageMedia.alt_text The alternative text of the image.
|
|
129
|
+
* @param {Object} imageMedia.media_details The media details of the image.
|
|
130
|
+
* @param {Object} imageMedia.media_details.sizes The sizes of the image.
|
|
131
|
+
* @param {Object} imageMedia.media_details.sizes.full The full size details of the image.
|
|
132
|
+
* @param {string} imageMedia.media_details.sizes.full.file The file name of the full size image.
|
|
133
|
+
* @param {string} imageMedia.slug The slug of the image.
|
|
134
|
+
* @return {string} The featured image alt text.
|
|
135
|
+
*/
|
|
136
|
+
function getImageDescription( imageMedia ) {
|
|
137
|
+
if ( imageMedia.alt_text ) {
|
|
138
|
+
return sprintf(
|
|
139
|
+
// Translators: %s: The selected image alt text.
|
|
140
|
+
__( 'Current image: %s' ),
|
|
141
|
+
imageMedia.alt_text
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
return sprintf(
|
|
145
|
+
// Translators: %s: The selected image filename.
|
|
146
|
+
__(
|
|
147
|
+
'The current image has no alternative text. The file name is: %s'
|
|
148
|
+
),
|
|
149
|
+
imageMedia.media_details.sizes?.full?.file || imageMedia.slug
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
124
153
|
return (
|
|
125
154
|
<PostFeaturedImageCheck>
|
|
126
155
|
{ noticeUI }
|
|
@@ -130,21 +159,7 @@ function PostFeaturedImage( {
|
|
|
130
159
|
id={ `editor-post-featured-image-${ featuredImageId }-describedby` }
|
|
131
160
|
className="hidden"
|
|
132
161
|
>
|
|
133
|
-
{ media
|
|
134
|
-
sprintf(
|
|
135
|
-
// Translators: %s: The selected image alt text.
|
|
136
|
-
__( 'Current image: %s' ),
|
|
137
|
-
media.alt_text
|
|
138
|
-
) }
|
|
139
|
-
{ ! media.alt_text &&
|
|
140
|
-
sprintf(
|
|
141
|
-
// Translators: %s: The selected image filename.
|
|
142
|
-
__(
|
|
143
|
-
'The current image has no alternative text. The file name is: %s'
|
|
144
|
-
),
|
|
145
|
-
media.media_details.sizes?.full?.file ||
|
|
146
|
-
media.slug
|
|
147
|
-
) }
|
|
162
|
+
{ getImageDescription( media ) }
|
|
148
163
|
</div>
|
|
149
164
|
) }
|
|
150
165
|
<MediaUploadCheck fallback={ instructions }>
|
|
@@ -188,7 +203,7 @@ function PostFeaturedImage( {
|
|
|
188
203
|
<img
|
|
189
204
|
className="editor-post-featured-image__preview-image"
|
|
190
205
|
src={ mediaSourceUrl }
|
|
191
|
-
alt=
|
|
206
|
+
alt={ getImageDescription( media ) }
|
|
192
207
|
/>
|
|
193
208
|
) }
|
|
194
209
|
{ isLoading && <Spinner /> }
|
|
@@ -41,8 +41,6 @@
|
|
|
41
41
|
.editor-post-featured-image__preview {
|
|
42
42
|
width: 100%;
|
|
43
43
|
padding: 0;
|
|
44
|
-
transition: all 0.1s ease-out;
|
|
45
|
-
@include reduce-motion("transition");
|
|
46
44
|
box-shadow: 0 0 0 0 var(--wp-admin-theme-color);
|
|
47
45
|
overflow: hidden; // Ensure the focus style properly encapsulates the image.
|
|
48
46
|
outline-offset: -#{$border-width};
|
|
@@ -66,6 +64,11 @@
|
|
|
66
64
|
|
|
67
65
|
.editor-post-featured-image__toggle {
|
|
68
66
|
box-shadow: inset 0 0 0 $border-width $gray-400;
|
|
67
|
+
|
|
68
|
+
&:focus:not(:disabled) {
|
|
69
|
+
// Allow smooth transition between focused and unfocused box-shadow states.
|
|
70
|
+
box-shadow: 0 0 0 currentColor inset, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
71
|
+
}
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
.editor-post-featured-image__actions {
|
|
@@ -16,7 +16,7 @@ exports[`PostSavedState returns a disabled button if the post is not saveable 1`
|
|
|
16
16
|
xmlns="http://www.w3.org/2000/svg"
|
|
17
17
|
>
|
|
18
18
|
<path
|
|
19
|
-
d="M17.3 10.
|
|
19
|
+
d="M17.3 10.1C17.3 7.60001 15.2 5.70001 12.5 5.70001C10.3 5.70001 8.4 7.10001 7.9 9.00001H7.7C5.7 9.00001 4 10.7 4 12.8C4 14.9 5.7 16.6 7.7 16.6H9.5V15.2H7.7C6.5 15.2 5.5 14.1 5.5 12.9C5.5 11.7 6.5 10.5 7.7 10.5H9L9.3 9.40001C9.7 8.10001 11 7.20001 12.5 7.20001C14.3 7.20001 15.8 8.50001 15.8 10.1V11.4L17.1 11.6C17.9 11.7 18.5 12.5 18.5 13.4C18.5 14.4 17.7 15.2 16.8 15.2H14.5V16.6H16.7C18.5 16.6 19.9 15.1 19.9 13.3C20 11.7 18.8 10.4 17.3 10.1Z M14.1245 14.2426L15.1852 13.182L12.0032 10L8.82007 13.1831L9.88072 14.2438L11.25 12.8745V18H12.75V12.8681L14.1245 14.2426Z"
|
|
20
20
|
/>
|
|
21
21
|
</svg>
|
|
22
22
|
</button>
|
|
@@ -48,7 +48,7 @@ export function getFullPostScheduleLabel( dateAttribute ) {
|
|
|
48
48
|
|
|
49
49
|
const timezoneAbbreviation = getTimezoneAbbreviation();
|
|
50
50
|
const formattedDate = dateI18n(
|
|
51
|
-
// translators:
|
|
51
|
+
// translators: Use a non-breaking space between 'g:i' and 'a' if appropriate.
|
|
52
52
|
_x( 'F j, Y g:i\xa0a', 'post schedule full date format' ),
|
|
53
53
|
date
|
|
54
54
|
);
|
|
@@ -35,23 +35,23 @@ function setupUseSelectMock( { hasStickyAction, postType } ) {
|
|
|
35
35
|
describe( 'PostSticky', () => {
|
|
36
36
|
it( 'should not render anything if the post type is not "post"', () => {
|
|
37
37
|
setupUseSelectMock( { hasStickyAction: true, postType: 'page' } );
|
|
38
|
-
render( <PostStickyCheck>Can
|
|
38
|
+
render( <PostStickyCheck>Can Show Sticky</PostStickyCheck> );
|
|
39
39
|
expect(
|
|
40
|
-
screen.queryByText( 'Can
|
|
40
|
+
screen.queryByText( 'Can Show Sticky' )
|
|
41
41
|
).not.toBeInTheDocument();
|
|
42
42
|
} );
|
|
43
43
|
|
|
44
44
|
it( "should not render anything if post doesn't support stickying", () => {
|
|
45
45
|
setupUseSelectMock( { hasStickyAction: false, postType: 'post' } );
|
|
46
|
-
render( <PostStickyCheck>Can
|
|
46
|
+
render( <PostStickyCheck>Can Show Sticky</PostStickyCheck> );
|
|
47
47
|
expect(
|
|
48
|
-
screen.queryByText( 'Can
|
|
48
|
+
screen.queryByText( 'Can Show Sticky' )
|
|
49
49
|
).not.toBeInTheDocument();
|
|
50
50
|
} );
|
|
51
51
|
|
|
52
52
|
it( 'should render if the post supports stickying', () => {
|
|
53
53
|
setupUseSelectMock( { hasStickyAction: true, postType: 'post' } );
|
|
54
|
-
render( <PostStickyCheck>Can
|
|
55
|
-
expect( screen.getByText( 'Can
|
|
54
|
+
render( <PostStickyCheck>Can Show Sticky</PostStickyCheck> );
|
|
55
|
+
expect( screen.getByText( 'Can Show Sticky' ) ).toBeVisible();
|
|
56
56
|
} );
|
|
57
57
|
} );
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
5
|
-
import { useEffect, useMemo, useState } from '@wordpress/element';
|
|
6
|
-
import {
|
|
5
|
+
import { Fragment, useEffect, useMemo, useState } from '@wordpress/element';
|
|
6
|
+
import {
|
|
7
|
+
FormTokenField,
|
|
8
|
+
withFilters,
|
|
9
|
+
__experimentalVStack as VStack,
|
|
10
|
+
} from '@wordpress/components';
|
|
7
11
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
8
12
|
import deprecated from '@wordpress/deprecated';
|
|
9
13
|
import { store as coreStore } from '@wordpress/core-data';
|
|
@@ -288,8 +292,15 @@ export function FlatTermSelector( { slug, __nextHasNoMarginBottom } ) {
|
|
|
288
292
|
singularName
|
|
289
293
|
);
|
|
290
294
|
|
|
295
|
+
const Wrapper = ( { children } ) =>
|
|
296
|
+
__nextHasNoMarginBottom ? (
|
|
297
|
+
<VStack spacing={ 4 }>{ children }</VStack>
|
|
298
|
+
) : (
|
|
299
|
+
<Fragment>{ children }</Fragment>
|
|
300
|
+
);
|
|
301
|
+
|
|
291
302
|
return (
|
|
292
|
-
|
|
303
|
+
<Wrapper>
|
|
293
304
|
<FormTokenField
|
|
294
305
|
__next40pxDefaultSize
|
|
295
306
|
value={ values }
|
|
@@ -306,7 +317,7 @@ export function FlatTermSelector( { slug, __nextHasNoMarginBottom } ) {
|
|
|
306
317
|
__nextHasNoMarginBottom={ __nextHasNoMarginBottom }
|
|
307
318
|
/>
|
|
308
319
|
<MostUsedTerms taxonomy={ taxonomy } onSelect={ appendTerm } />
|
|
309
|
-
|
|
320
|
+
</Wrapper>
|
|
310
321
|
);
|
|
311
322
|
}
|
|
312
323
|
|