@wordpress/editor 14.12.0 → 14.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/README.md +120 -99
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build/components/collab-sidebar/add-comment.js +17 -65
- package/build/components/collab-sidebar/add-comment.js.map +1 -1
- package/build/components/collab-sidebar/comment-author-info.js +76 -0
- package/build/components/collab-sidebar/comment-author-info.js.map +1 -0
- package/build/components/collab-sidebar/comment-button-toolbar.js +2 -2
- package/build/components/collab-sidebar/comment-button-toolbar.js.map +1 -1
- package/build/components/collab-sidebar/comment-button.js +2 -2
- package/build/components/collab-sidebar/comment-button.js.map +1 -1
- package/build/components/collab-sidebar/comment-form.js +64 -0
- package/build/components/collab-sidebar/comment-form.js.map +1 -0
- package/build/components/collab-sidebar/comments.js +33 -91
- package/build/components/collab-sidebar/comments.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +1 -2
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/document-bar/index.js +10 -3
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-outline/check.js +4 -4
- package/build/components/document-outline/check.js.map +1 -1
- package/build/components/document-outline/index.js +8 -8
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-tools/index.js +1 -1
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-history/redo.js +1 -1
- package/build/components/editor-history/redo.js.map +1 -1
- package/build/components/editor-history/undo.js +1 -1
- package/build/components/editor-history/undo.js.map +1 -1
- package/build/components/editor-interface/content-slot-fill.js +1 -10
- package/build/components/editor-interface/content-slot-fill.js.map +1 -1
- package/build/components/editor-interface/index.js +3 -9
- package/build/components/editor-interface/index.js.map +1 -1
- package/build/components/editor-notices/index.js +1 -1
- package/build/components/editor-notices/index.js.map +1 -1
- package/build/components/editor-snackbars/index.js +1 -1
- package/build/components/editor-snackbars/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-record-item.js +9 -1
- package/build/components/entities-saved-states/entity-record-item.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/page-attributes/check.js +3 -3
- package/build/components/page-attributes/check.js.map +1 -1
- package/build/components/page-attributes/order.js +1 -1
- package/build/components/page-attributes/order.js.map +1 -1
- package/build/components/page-attributes/panel.js +1 -1
- package/build/components/page-attributes/panel.js.map +1 -1
- package/build/components/page-attributes/parent.js +1 -1
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/plugin-document-setting-panel/index.js +2 -2
- package/build/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/plugin-more-menu-item/index.js +2 -1
- package/build/components/plugin-more-menu-item/index.js.map +1 -1
- package/build/components/plugin-post-publish-panel/index.js +2 -2
- package/build/components/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/plugin-post-status-info/index.js +4 -4
- package/build/components/plugin-post-status-info/index.js.map +1 -1
- package/build/components/plugin-pre-publish-panel/index.js +2 -2
- package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/plugin-preview-menu-item/index.js +2 -1
- package/build/components/plugin-preview-menu-item/index.js.map +1 -1
- package/build/components/plugin-sidebar/index.js +1 -0
- package/build/components/plugin-sidebar/index.js.map +1 -1
- package/build/components/plugin-sidebar-more-menu-item/index.js +2 -1
- package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build/components/post-actions/actions.js +3 -3
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-author/check.js +3 -3
- package/build/components/post-author/check.js.map +1 -1
- package/build/components/post-author/index.js +1 -1
- package/build/components/post-author/index.js.map +1 -1
- package/build/components/post-author/panel.js +1 -1
- package/build/components/post-author/panel.js.map +1 -1
- package/build/components/post-card-panel/index.js +9 -4
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-comments/index.js +1 -1
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-discussion/panel.js +1 -1
- package/build/components/post-discussion/panel.js.map +1 -1
- package/build/components/post-excerpt/check.js +3 -3
- package/build/components/post-excerpt/check.js.map +1 -1
- package/build/components/post-excerpt/panel.js +1 -1
- package/build/components/post-excerpt/panel.js.map +1 -1
- package/build/components/post-excerpt/plugin.js +4 -4
- package/build/components/post-excerpt/plugin.js.map +1 -1
- package/build/components/post-featured-image/check.js +3 -3
- package/build/components/post-featured-image/check.js.map +1 -1
- package/build/components/post-featured-image/index.js +39 -9
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-featured-image/panel.js +1 -1
- package/build/components/post-featured-image/panel.js.map +1 -1
- package/build/components/post-fields/index.js +70 -0
- package/build/components/post-fields/index.js.map +1 -0
- package/build/components/post-format/check.js +9 -12
- package/build/components/post-format/check.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-format/panel.js +1 -1
- package/build/components/post-format/panel.js.map +1 -1
- package/build/components/post-last-revision/check.js +3 -3
- package/build/components/post-last-revision/check.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-last-revision/panel.js +1 -1
- package/build/components/post-last-revision/panel.js.map +1 -1
- package/build/components/post-locked-modal/index.js +1 -1
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-pending-status/check.js +3 -3
- package/build/components/post-pending-status/check.js.map +1 -1
- package/build/components/post-pending-status/index.js +1 -1
- package/build/components/post-pending-status/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-panel/index.js +5 -2
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-schedule/check.js +3 -3
- package/build/components/post-schedule/check.js.map +1 -1
- package/build/components/post-schedule/index.js +1 -1
- package/build/components/post-schedule/index.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-schedule/panel.js +1 -1
- package/build/components/post-schedule/panel.js.map +1 -1
- package/build/components/post-slug/check.js +3 -3
- package/build/components/post-slug/check.js.map +1 -1
- package/build/components/post-slug/index.js +1 -1
- package/build/components/post-slug/index.js.map +1 -1
- package/build/components/post-sticky/check.js +3 -3
- package/build/components/post-sticky/check.js.map +1 -1
- package/build/components/post-sticky/index.js +1 -1
- package/build/components/post-sticky/index.js.map +1 -1
- package/build/components/post-switch-to-draft-button/index.js +1 -1
- package/build/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build/components/post-sync-status/index.js +1 -1
- package/build/components/post-sync-status/index.js.map +1 -1
- package/build/components/post-taxonomies/check.js +3 -3
- package/build/components/post-taxonomies/check.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/panel.js +16 -13
- package/build/components/post-taxonomies/panel.js.map +1 -1
- package/build/components/post-template/classic-theme.js +2 -2
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-template/panel.js +1 -1
- package/build/components/post-template/panel.js.map +1 -1
- package/build/components/post-text-editor/index.js +1 -1
- package/build/components/post-text-editor/index.js.map +1 -1
- package/build/components/post-title/index.js +20 -18
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/post-title-raw.js +1 -1
- package/build/components/post-title/post-title-raw.js.map +1 -1
- package/build/components/post-trash/check.js +3 -3
- package/build/components/post-trash/check.js.map +1 -1
- package/build/components/post-trash/index.js +1 -1
- package/build/components/post-trash/index.js.map +1 -1
- package/build/components/post-type-support-check/index.js +6 -6
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/post-url/check.js +3 -3
- package/build/components/post-url/check.js.map +1 -1
- package/build/components/post-url/index.js +1 -1
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/label.js +1 -1
- package/build/components/post-url/label.js.map +1 -1
- package/build/components/post-url/panel.js +1 -1
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/post-visibility/check.js +1 -1
- package/build/components/post-visibility/check.js.map +1 -1
- package/build/components/post-visibility/index.js +1 -1
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/components/preferences-modal/block-visibility.js +87 -0
- package/build/components/preferences-modal/block-visibility.js.map +1 -0
- package/build/components/preferences-modal/enable-panel.js +27 -19
- package/build/components/preferences-modal/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/enable-publish-sidebar.js +13 -10
- package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
- package/build/components/preferences-modal/index.js +2 -2
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/provider/index.js +14 -8
- package/build/components/provider/index.js.map +1 -1
- package/build/components/table-of-contents/index.js +1 -1
- package/build/components/table-of-contents/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +4 -4
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/components/time-to-read/index.js +1 -1
- package/build/components/time-to-read/index.js.map +1 -1
- package/build/components/unsaved-changes-warning/index.js +1 -1
- package/build/components/unsaved-changes-warning/index.js.map +1 -1
- package/build/components/word-count/index.js +1 -1
- package/build/components/word-count/index.js.map +1 -1
- package/build/components/zoom-out-toggle/index.js +8 -3
- package/build/components/zoom-out-toggle/index.js.map +1 -1
- package/build/dataviews/api.js +41 -0
- package/build/dataviews/api.js.map +1 -1
- package/build/dataviews/store/private-actions.js +26 -4
- package/build/dataviews/store/private-actions.js.map +1 -1
- package/build/dataviews/store/private-selectors.js +5 -0
- package/build/dataviews/store/private-selectors.js.map +1 -1
- package/build/dataviews/store/reducer.js +23 -0
- package/build/dataviews/store/reducer.js.map +1 -1
- package/build/private-apis.js +4 -0
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +11 -9
- package/build/store/actions.js.map +1 -1
- package/build/store/private-selectors.js +5 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.native.js +1 -0
- package/build/store/reducer.native.js.map +1 -1
- package/build/store/selectors.js +34 -42
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-template-info.js +60 -0
- package/build/utils/get-template-info.js.map +1 -0
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build-module/components/collab-sidebar/add-comment.js +18 -67
- package/build-module/components/collab-sidebar/add-comment.js.map +1 -1
- package/build-module/components/collab-sidebar/comment-author-info.js +71 -0
- package/build-module/components/collab-sidebar/comment-author-info.js.map +1 -0
- package/build-module/components/collab-sidebar/comment-button-toolbar.js +2 -2
- package/build-module/components/collab-sidebar/comment-button-toolbar.js.map +1 -1
- package/build-module/components/collab-sidebar/comment-button.js +2 -2
- package/build-module/components/collab-sidebar/comment-button.js.map +1 -1
- package/build-module/components/collab-sidebar/comment-form.js +59 -0
- package/build-module/components/collab-sidebar/comment-form.js.map +1 -0
- package/build-module/components/collab-sidebar/comments.js +33 -91
- package/build-module/components/collab-sidebar/comments.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/document-bar/index.js +10 -3
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-outline/check.js +4 -4
- package/build-module/components/document-outline/check.js.map +1 -1
- package/build-module/components/document-outline/index.js +8 -8
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-tools/index.js +1 -1
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor-history/redo.js +1 -1
- package/build-module/components/editor-history/redo.js.map +1 -1
- package/build-module/components/editor-history/undo.js +1 -1
- package/build-module/components/editor-history/undo.js.map +1 -1
- package/build-module/components/editor-interface/content-slot-fill.js +2 -11
- package/build-module/components/editor-interface/content-slot-fill.js.map +1 -1
- package/build-module/components/editor-interface/index.js +4 -10
- package/build-module/components/editor-interface/index.js.map +1 -1
- package/build-module/components/editor-notices/index.js +1 -1
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js +1 -1
- package/build-module/components/editor-snackbars/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +9 -1
- package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +2 -2
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/page-attributes/check.js +3 -3
- package/build-module/components/page-attributes/check.js.map +1 -1
- package/build-module/components/page-attributes/order.js +1 -1
- package/build-module/components/page-attributes/order.js.map +1 -1
- package/build-module/components/page-attributes/panel.js +1 -1
- package/build-module/components/page-attributes/panel.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +1 -1
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/plugin-document-setting-panel/index.js +2 -2
- package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/components/plugin-more-menu-item/index.js +2 -1
- package/build-module/components/plugin-more-menu-item/index.js.map +1 -1
- package/build-module/components/plugin-post-publish-panel/index.js +2 -2
- package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
- package/build-module/components/plugin-post-status-info/index.js +4 -4
- package/build-module/components/plugin-post-status-info/index.js.map +1 -1
- package/build-module/components/plugin-pre-publish-panel/index.js +2 -2
- package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/plugin-preview-menu-item/index.js +2 -1
- package/build-module/components/plugin-preview-menu-item/index.js.map +1 -1
- package/build-module/components/plugin-sidebar/index.js +1 -0
- package/build-module/components/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/plugin-sidebar-more-menu-item/index.js +2 -1
- package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build-module/components/post-actions/actions.js +3 -3
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-author/check.js +3 -3
- package/build-module/components/post-author/check.js.map +1 -1
- package/build-module/components/post-author/index.js +1 -1
- package/build-module/components/post-author/index.js.map +1 -1
- package/build-module/components/post-author/panel.js +1 -1
- package/build-module/components/post-author/panel.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +9 -4
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-comments/index.js +1 -1
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-discussion/panel.js +1 -1
- package/build-module/components/post-discussion/panel.js.map +1 -1
- package/build-module/components/post-excerpt/check.js +3 -3
- package/build-module/components/post-excerpt/check.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js +1 -1
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-excerpt/plugin.js +4 -4
- package/build-module/components/post-excerpt/plugin.js.map +1 -1
- package/build-module/components/post-featured-image/check.js +3 -3
- package/build-module/components/post-featured-image/check.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +40 -10
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-featured-image/panel.js +1 -1
- package/build-module/components/post-featured-image/panel.js.map +1 -1
- package/build-module/components/post-fields/index.js +62 -0
- package/build-module/components/post-fields/index.js.map +1 -0
- package/build-module/components/post-format/check.js +10 -11
- package/build-module/components/post-format/check.js.map +1 -1
- package/build-module/components/post-format/index.js +1 -1
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-format/panel.js +1 -1
- package/build-module/components/post-format/panel.js.map +1 -1
- package/build-module/components/post-last-revision/check.js +3 -3
- package/build-module/components/post-last-revision/check.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-last-revision/panel.js +1 -1
- package/build-module/components/post-last-revision/panel.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +1 -1
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-pending-status/check.js +3 -3
- package/build-module/components/post-pending-status/check.js.map +1 -1
- package/build-module/components/post-pending-status/index.js +1 -1
- package/build-module/components/post-pending-status/index.js.map +1 -1
- package/build-module/components/post-preview-button/index.js +1 -1
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +5 -2
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-schedule/check.js +3 -3
- package/build-module/components/post-schedule/check.js.map +1 -1
- package/build-module/components/post-schedule/index.js +1 -1
- package/build-module/components/post-schedule/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-schedule/panel.js +1 -1
- package/build-module/components/post-schedule/panel.js.map +1 -1
- package/build-module/components/post-slug/check.js +3 -3
- package/build-module/components/post-slug/check.js.map +1 -1
- package/build-module/components/post-slug/index.js +1 -1
- package/build-module/components/post-slug/index.js.map +1 -1
- package/build-module/components/post-sticky/check.js +3 -3
- package/build-module/components/post-sticky/check.js.map +1 -1
- package/build-module/components/post-sticky/index.js +1 -1
- package/build-module/components/post-sticky/index.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-sync-status/index.js +1 -1
- package/build-module/components/post-sync-status/index.js.map +1 -1
- package/build-module/components/post-taxonomies/check.js +3 -3
- package/build-module/components/post-taxonomies/check.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/panel.js +17 -12
- package/build-module/components/post-taxonomies/panel.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +2 -2
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/panel.js +1 -1
- package/build-module/components/post-template/panel.js.map +1 -1
- package/build-module/components/post-text-editor/index.js +1 -1
- package/build-module/components/post-text-editor/index.js.map +1 -1
- package/build-module/components/post-title/index.js +20 -18
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/post-title-raw.js +1 -1
- package/build-module/components/post-title/post-title-raw.js.map +1 -1
- package/build-module/components/post-trash/check.js +3 -3
- package/build-module/components/post-trash/check.js.map +1 -1
- package/build-module/components/post-trash/index.js +1 -1
- package/build-module/components/post-trash/index.js.map +1 -1
- package/build-module/components/post-type-support-check/index.js +6 -6
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/post-url/check.js +3 -3
- package/build-module/components/post-url/check.js.map +1 -1
- package/build-module/components/post-url/index.js +1 -1
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/label.js +1 -1
- package/build-module/components/post-url/label.js.map +1 -1
- package/build-module/components/post-url/panel.js +1 -1
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/post-visibility/check.js +1 -1
- package/build-module/components/post-visibility/check.js.map +1 -1
- package/build-module/components/post-visibility/index.js +1 -1
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/components/preferences-modal/block-visibility.js +80 -0
- package/build-module/components/preferences-modal/block-visibility.js.map +1 -0
- package/build-module/components/preferences-modal/enable-panel.js +27 -19
- package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
- package/build-module/components/preferences-modal/enable-publish-sidebar.js +13 -10
- package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +2 -2
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/provider/index.js +14 -8
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/table-of-contents/index.js +1 -1
- package/build-module/components/table-of-contents/index.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +4 -4
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/components/time-to-read/index.js +1 -1
- package/build-module/components/time-to-read/index.js.map +1 -1
- package/build-module/components/unsaved-changes-warning/index.js +1 -1
- package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
- package/build-module/components/word-count/index.js +1 -1
- package/build-module/components/word-count/index.js.map +1 -1
- package/build-module/components/zoom-out-toggle/index.js +8 -3
- package/build-module/components/zoom-out-toggle/index.js.map +1 -1
- package/build-module/dataviews/api.js +39 -0
- package/build-module/dataviews/api.js.map +1 -1
- package/build-module/dataviews/store/private-actions.js +23 -3
- package/build-module/dataviews/store/private-actions.js.map +1 -1
- package/build-module/dataviews/store/private-selectors.js +4 -0
- package/build-module/dataviews/store/private-selectors.js.map +1 -1
- package/build-module/dataviews/store/reducer.js +23 -0
- package/build-module/dataviews/store/reducer.js.map +1 -1
- package/build-module/private-apis.js +4 -0
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +11 -9
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-selectors.js +6 -3
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.native.js +2 -1
- package/build-module/store/reducer.native.js.map +1 -1
- package/build-module/store/selectors.js +33 -39
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-template-info.js +51 -0
- package/build-module/utils/get-template-info.js.map +1 -0
- package/build-style/style-rtl.css +11 -81
- package/build-style/style.css +11 -81
- package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts +2 -2
- package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/add-comment.d.ts +2 -2
- package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comment-author-info.d.ts +17 -0
- package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/comment-form.d.ts +18 -0
- package/build-types/components/collab-sidebar/comment-form.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/comments.d.ts +2 -2
- package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
- package/build-types/components/create-template-part-modal/index.d.ts.map +1 -1
- package/build-types/components/document-bar/index.d.ts +2 -2
- package/build-types/components/document-bar/index.d.ts.map +1 -1
- package/build-types/components/document-outline/check.d.ts +5 -5
- package/build-types/components/document-outline/check.d.ts.map +1 -1
- package/build-types/components/document-outline/index.d.ts +4 -6
- package/build-types/components/document-outline/index.d.ts.map +1 -1
- package/build-types/components/document-tools/index.d.ts.map +1 -1
- package/build-types/components/editor-interface/content-slot-fill.d.ts +12 -1
- package/build-types/components/editor-interface/content-slot-fill.d.ts.map +1 -1
- package/build-types/components/editor-interface/index.d.ts.map +1 -1
- package/build-types/components/editor-notices/index.d.ts +2 -2
- package/build-types/components/editor-notices/index.d.ts.map +1 -1
- package/build-types/components/editor-snackbars/index.d.ts +2 -2
- package/build-types/components/editor-snackbars/index.d.ts.map +1 -1
- package/build-types/components/entities-saved-states/entity-record-item.d.ts.map +1 -1
- package/build-types/components/entities-saved-states/index.d.ts +4 -4
- package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
- package/build-types/components/header/back-button.d.ts.map +1 -1
- package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -1
- package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -1
- package/build-types/components/page-attributes/check.d.ts +5 -5
- package/build-types/components/page-attributes/check.d.ts.map +1 -1
- package/build-types/components/page-attributes/order.d.ts +2 -2
- package/build-types/components/page-attributes/order.d.ts.map +1 -1
- package/build-types/components/page-attributes/panel.d.ts +2 -2
- package/build-types/components/page-attributes/panel.d.ts.map +1 -1
- package/build-types/components/page-attributes/parent.d.ts +2 -2
- package/build-types/components/page-attributes/parent.d.ts.map +1 -1
- package/build-types/components/plugin-document-setting-panel/index.d.ts +4 -4
- package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -1
- package/build-types/components/plugin-more-menu-item/index.d.ts +4 -2
- package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -1
- package/build-types/components/plugin-post-publish-panel/index.d.ts +4 -4
- package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -1
- package/build-types/components/plugin-post-status-info/index.d.ts +6 -6
- package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -1
- package/build-types/components/plugin-pre-publish-panel/index.d.ts +4 -4
- package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -1
- package/build-types/components/plugin-preview-menu-item/index.d.ts +4 -2
- package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -1
- package/build-types/components/plugin-sidebar/index.d.ts +2 -0
- package/build-types/components/plugin-sidebar/index.d.ts.map +1 -1
- package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts +4 -2
- package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts.map +1 -1
- package/build-types/components/post-author/check.d.ts +5 -5
- package/build-types/components/post-author/check.d.ts.map +1 -1
- package/build-types/components/post-author/index.d.ts +2 -2
- package/build-types/components/post-author/index.d.ts.map +1 -1
- package/build-types/components/post-author/panel.d.ts +2 -2
- 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-discussion/panel.d.ts +2 -2
- package/build-types/components/post-discussion/panel.d.ts.map +1 -1
- package/build-types/components/post-excerpt/check.d.ts +5 -5
- package/build-types/components/post-excerpt/check.d.ts.map +1 -1
- package/build-types/components/post-excerpt/panel.d.ts +2 -2
- package/build-types/components/post-excerpt/panel.d.ts.map +1 -1
- package/build-types/components/post-excerpt/plugin.d.ts +6 -6
- package/build-types/components/post-excerpt/plugin.d.ts.map +1 -1
- package/build-types/components/post-featured-image/check.d.ts +5 -5
- package/build-types/components/post-featured-image/check.d.ts.map +1 -1
- package/build-types/components/post-featured-image/panel.d.ts +2 -2
- package/build-types/components/post-featured-image/panel.d.ts.map +1 -1
- package/build-types/components/post-fields/index.d.ts +12 -0
- package/build-types/components/post-fields/index.d.ts.map +1 -0
- package/build-types/components/post-format/check.d.ts +11 -4
- package/build-types/components/post-format/check.d.ts.map +1 -1
- package/build-types/components/post-format/index.d.ts +2 -2
- package/build-types/components/post-format/index.d.ts.map +1 -1
- package/build-types/components/post-format/panel.d.ts +2 -2
- package/build-types/components/post-format/panel.d.ts.map +1 -1
- package/build-types/components/post-last-revision/check.d.ts +5 -5
- package/build-types/components/post-last-revision/check.d.ts.map +1 -1
- package/build-types/components/post-last-revision/index.d.ts +2 -2
- package/build-types/components/post-last-revision/index.d.ts.map +1 -1
- package/build-types/components/post-last-revision/panel.d.ts +2 -2
- package/build-types/components/post-last-revision/panel.d.ts.map +1 -1
- package/build-types/components/post-locked-modal/index.d.ts +2 -2
- package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
- package/build-types/components/post-pending-status/check.d.ts +5 -5
- package/build-types/components/post-pending-status/check.d.ts.map +1 -1
- package/build-types/components/post-pending-status/index.d.ts +2 -2
- package/build-types/components/post-pending-status/index.d.ts.map +1 -1
- package/build-types/components/post-preview-button/index.d.ts +2 -2
- package/build-types/components/post-preview-button/index.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/index.d.ts.map +1 -1
- package/build-types/components/post-schedule/check.d.ts +5 -5
- package/build-types/components/post-schedule/check.d.ts.map +1 -1
- package/build-types/components/post-schedule/index.d.ts +2 -2
- package/build-types/components/post-schedule/index.d.ts.map +1 -1
- package/build-types/components/post-schedule/label.d.ts +2 -2
- package/build-types/components/post-schedule/label.d.ts.map +1 -1
- package/build-types/components/post-schedule/panel.d.ts +2 -2
- package/build-types/components/post-schedule/panel.d.ts.map +1 -1
- package/build-types/components/post-slug/check.d.ts +5 -5
- package/build-types/components/post-slug/check.d.ts.map +1 -1
- package/build-types/components/post-slug/index.d.ts +2 -2
- package/build-types/components/post-slug/index.d.ts.map +1 -1
- package/build-types/components/post-sticky/check.d.ts +5 -5
- package/build-types/components/post-sticky/check.d.ts.map +1 -1
- package/build-types/components/post-sticky/index.d.ts +2 -2
- package/build-types/components/post-sticky/index.d.ts.map +1 -1
- package/build-types/components/post-switch-to-draft-button/index.d.ts +2 -2
- package/build-types/components/post-switch-to-draft-button/index.d.ts.map +1 -1
- package/build-types/components/post-sync-status/index.d.ts +2 -2
- package/build-types/components/post-sync-status/index.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/check.d.ts +5 -5
- package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts +2 -2
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/panel.d.ts +6 -2
- package/build-types/components/post-taxonomies/panel.d.ts.map +1 -1
- package/build-types/components/post-template/panel.d.ts +2 -2
- package/build-types/components/post-template/panel.d.ts.map +1 -1
- package/build-types/components/post-text-editor/index.d.ts +2 -2
- package/build-types/components/post-text-editor/index.d.ts.map +1 -1
- package/build-types/components/post-title/index.d.ts +1 -1
- package/build-types/components/post-trash/check.d.ts +5 -5
- package/build-types/components/post-trash/check.d.ts.map +1 -1
- package/build-types/components/post-trash/index.d.ts +2 -2
- package/build-types/components/post-trash/index.d.ts.map +1 -1
- package/build-types/components/post-type-support-check/index.d.ts +8 -8
- package/build-types/components/post-type-support-check/index.d.ts.map +1 -1
- package/build-types/components/post-url/check.d.ts +5 -5
- package/build-types/components/post-url/check.d.ts.map +1 -1
- package/build-types/components/post-url/index.d.ts +2 -2
- package/build-types/components/post-url/index.d.ts.map +1 -1
- package/build-types/components/post-url/label.d.ts +2 -2
- package/build-types/components/post-url/label.d.ts.map +1 -1
- package/build-types/components/post-url/panel.d.ts +2 -2
- package/build-types/components/post-url/panel.d.ts.map +1 -1
- package/build-types/components/post-visibility/check.d.ts +2 -2
- package/build-types/components/post-visibility/check.d.ts.map +1 -1
- package/build-types/components/post-visibility/index.d.ts +2 -2
- package/build-types/components/post-visibility/index.d.ts.map +1 -1
- package/build-types/components/preferences-modal/block-visibility.d.ts +2 -0
- package/build-types/components/preferences-modal/block-visibility.d.ts.map +1 -0
- package/build-types/components/preferences-modal/enable-panel.d.ts +1 -2
- package/build-types/components/preferences-modal/enable-panel.d.ts.map +1 -1
- package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -1
- package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts +1 -2
- package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts +2 -2
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
- package/build-types/components/theme-support-check/index.d.ts +6 -6
- package/build-types/components/theme-support-check/index.d.ts.map +1 -1
- package/build-types/components/time-to-read/index.d.ts +2 -2
- package/build-types/components/time-to-read/index.d.ts.map +1 -1
- package/build-types/components/unsaved-changes-warning/index.d.ts +2 -2
- package/build-types/components/unsaved-changes-warning/index.d.ts.map +1 -1
- package/build-types/components/word-count/index.d.ts +2 -2
- package/build-types/components/word-count/index.d.ts.map +1 -1
- package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -1
- package/build-types/dataviews/api.d.ts +24 -0
- package/build-types/dataviews/api.d.ts.map +1 -1
- package/build-types/dataviews/store/private-actions.d.ts +14 -2
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
- package/build-types/dataviews/store/private-selectors.d.ts +1 -0
- package/build-types/dataviews/store/private-selectors.d.ts.map +1 -1
- package/build-types/dataviews/store/reducer.d.ts +10 -2
- package/build-types/dataviews/store/reducer.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/store/actions.d.ts +7 -5
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts +1 -0
- package/build-types/store/private-selectors.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts +5 -0
- package/build-types/store/reducer.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +4 -11
- package/build-types/store/selectors.d.ts.map +1 -1
- package/build-types/utils/get-template-info.d.ts +6 -0
- package/build-types/utils/get-template-info.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -1
- package/src/components/collab-sidebar/add-comment.js +21 -78
- package/src/components/collab-sidebar/comment-author-info.js +68 -0
- package/src/components/collab-sidebar/comment-button-toolbar.js +3 -3
- package/src/components/collab-sidebar/comment-button.js +3 -3
- package/src/components/collab-sidebar/comment-form.js +62 -0
- package/src/components/collab-sidebar/comments.js +39 -101
- package/src/components/create-template-part-modal/index.js +3 -2
- package/src/components/document-bar/index.js +12 -3
- package/src/components/document-outline/check.js +4 -4
- package/src/components/document-outline/index.js +9 -9
- package/src/components/document-tools/index.js +3 -2
- package/src/components/editor-history/redo.js +1 -1
- package/src/components/editor-history/undo.js +1 -1
- package/src/components/editor-interface/content-slot-fill.js +4 -9
- package/src/components/editor-interface/index.js +1 -11
- package/src/components/editor-notices/index.js +1 -1
- package/src/components/editor-snackbars/index.js +1 -1
- package/src/components/entities-saved-states/entity-record-item.js +12 -4
- package/src/components/entities-saved-states/index.js +2 -2
- package/src/components/header/style.scss +2 -1
- package/src/components/page-attributes/check.js +3 -3
- package/src/components/page-attributes/order.js +1 -1
- package/src/components/page-attributes/panel.js +1 -1
- package/src/components/page-attributes/parent.js +1 -1
- package/src/components/plugin-document-setting-panel/index.js +2 -2
- package/src/components/plugin-more-menu-item/index.js +2 -1
- package/src/components/plugin-post-publish-panel/index.js +2 -2
- package/src/components/plugin-post-status-info/index.js +4 -4
- package/src/components/plugin-pre-publish-panel/index.js +2 -2
- package/src/components/plugin-preview-menu-item/index.js +2 -1
- package/src/components/plugin-sidebar/index.js +1 -0
- package/src/components/plugin-sidebar-more-menu-item/index.js +2 -2
- package/src/components/post-actions/actions.js +3 -3
- package/src/components/post-author/check.js +3 -3
- package/src/components/post-author/index.js +1 -1
- package/src/components/post-author/panel.js +1 -1
- package/src/components/post-card-panel/index.js +18 -5
- package/src/components/post-comments/index.js +1 -1
- package/src/components/post-discussion/panel.js +1 -1
- package/src/components/post-excerpt/check.js +3 -3
- package/src/components/post-excerpt/panel.js +1 -1
- package/src/components/post-excerpt/plugin.js +4 -4
- package/src/components/post-featured-image/check.js +3 -3
- package/src/components/post-featured-image/index.js +107 -43
- package/src/components/post-featured-image/panel.js +1 -1
- package/src/components/post-featured-image/style.scss +23 -13
- package/src/components/post-fields/index.ts +76 -0
- package/src/components/post-format/check.js +9 -11
- package/src/components/post-format/index.js +1 -1
- package/src/components/post-format/panel.js +1 -1
- package/src/components/post-last-revision/check.js +3 -3
- package/src/components/post-last-revision/index.js +1 -1
- package/src/components/post-last-revision/panel.js +1 -1
- package/src/components/post-locked-modal/index.js +1 -1
- package/src/components/post-pending-status/check.js +3 -3
- package/src/components/post-pending-status/index.js +1 -1
- package/src/components/post-preview-button/index.js +1 -1
- package/src/components/post-publish-panel/index.js +7 -3
- package/src/components/post-schedule/check.js +3 -3
- package/src/components/post-schedule/index.js +1 -1
- package/src/components/post-schedule/label.js +1 -1
- package/src/components/post-schedule/panel.js +1 -1
- package/src/components/post-slug/check.js +3 -3
- package/src/components/post-slug/index.js +1 -1
- package/src/components/post-sticky/check.js +3 -3
- package/src/components/post-sticky/index.js +1 -1
- package/src/components/post-switch-to-draft-button/index.js +1 -1
- package/src/components/post-sync-status/index.js +1 -1
- package/src/components/post-taxonomies/check.js +3 -3
- package/src/components/post-taxonomies/flat-term-selector.js +1 -1
- package/src/components/post-taxonomies/panel.js +15 -12
- package/src/components/post-template/classic-theme.js +2 -2
- package/src/components/post-template/panel.js +1 -1
- package/src/components/post-text-editor/index.js +1 -1
- package/src/components/post-title/index.js +20 -18
- package/src/components/post-title/post-title-raw.js +1 -1
- package/src/components/post-trash/check.js +3 -3
- package/src/components/post-trash/index.js +1 -1
- package/src/components/post-type-support-check/index.js +6 -6
- package/src/components/post-url/check.js +3 -3
- package/src/components/post-url/index.js +1 -1
- package/src/components/post-url/label.js +1 -1
- package/src/components/post-url/panel.js +1 -1
- package/src/components/post-visibility/check.js +1 -1
- package/src/components/post-visibility/index.js +1 -1
- package/src/components/preferences-modal/block-visibility.js +96 -0
- package/src/components/preferences-modal/enable-panel.js +27 -17
- package/src/components/preferences-modal/enable-publish-sidebar.js +18 -15
- package/src/components/preferences-modal/index.js +2 -2
- package/src/components/provider/index.js +55 -30
- package/src/components/table-of-contents/index.js +1 -1
- package/src/components/theme-support-check/index.js +4 -4
- package/src/components/time-to-read/index.js +1 -1
- package/src/components/unsaved-changes-warning/index.js +1 -1
- package/src/components/word-count/index.js +1 -1
- package/src/components/zoom-out-toggle/index.js +26 -13
- package/src/dataviews/api.js +41 -0
- package/src/dataviews/store/private-actions.ts +57 -3
- package/src/dataviews/store/private-selectors.ts +4 -0
- package/src/dataviews/store/reducer.ts +38 -1
- package/src/private-apis.js +4 -1
- package/src/store/actions.js +13 -9
- package/src/store/private-selectors.js +13 -8
- package/src/store/reducer.native.js +2 -0
- package/src/store/selectors.js +80 -62
- package/src/store/test/selectors.js +0 -255
- package/src/style.scss +0 -1
- package/src/utils/get-template-info.js +52 -0
- package/src/utils/test/get-template-info.js +224 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/block-manager/category.js +0 -107
- package/build/components/block-manager/category.js.map +0 -1
- package/build/components/block-manager/checklist.js +0 -35
- package/build/components/block-manager/checklist.js.map +0 -1
- package/build/components/block-manager/index.js +0 -115
- package/build/components/block-manager/index.js.map +0 -1
- package/build-module/components/block-manager/category.js +0 -99
- package/build-module/components/block-manager/category.js.map +0 -1
- package/build-module/components/block-manager/checklist.js +0 -28
- package/build-module/components/block-manager/checklist.js.map +0 -1
- package/build-module/components/block-manager/index.js +0 -107
- package/build-module/components/block-manager/index.js.map +0 -1
- package/build-types/components/block-manager/category.d.ts +0 -6
- package/build-types/components/block-manager/category.d.ts.map +0 -1
- package/build-types/components/block-manager/checklist.d.ts +0 -7
- package/build-types/components/block-manager/checklist.d.ts.map +0 -1
- package/build-types/components/block-manager/index.d.ts +0 -2
- package/build-types/components/block-manager/index.d.ts.map +0 -1
- package/src/components/block-manager/category.js +0 -96
- package/src/components/block-manager/checklist.js +0 -30
- package/src/components/block-manager/index.js +0 -145
- package/src/components/block-manager/style.scss +0 -82
|
@@ -12,6 +12,7 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
12
12
|
*/
|
|
13
13
|
import { store as editorStore } from '../../store';
|
|
14
14
|
import { unlock } from '../../lock-unlock';
|
|
15
|
+
import { getTemplateInfo } from '../../utils/get-template-info';
|
|
15
16
|
|
|
16
17
|
export default function EntityRecordItem( { record, checked, onChange } ) {
|
|
17
18
|
const { name, kind, title, key } = record;
|
|
@@ -33,11 +34,18 @@ export default function EntityRecordItem( { record, checked, onChange } ) {
|
|
|
33
34
|
name,
|
|
34
35
|
key
|
|
35
36
|
);
|
|
37
|
+
|
|
38
|
+
const { default_template_types: templateTypes = [] } =
|
|
39
|
+
select( coreStore ).getEntityRecord(
|
|
40
|
+
'root',
|
|
41
|
+
'__unstableBase'
|
|
42
|
+
) ?? {};
|
|
43
|
+
|
|
36
44
|
return {
|
|
37
|
-
entityRecordTitle:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
entityRecordTitle: getTemplateInfo( {
|
|
46
|
+
template,
|
|
47
|
+
templateTypes,
|
|
48
|
+
} ).title,
|
|
41
49
|
hasPostMetaChanges: unlock(
|
|
42
50
|
select( editorStore )
|
|
43
51
|
).hasPostMetaChanges( name, key ),
|
|
@@ -33,7 +33,7 @@ function identity( values ) {
|
|
|
33
33
|
* @param {Function} props.close The function to close the dialog.
|
|
34
34
|
* @param {Function} props.renderDialog The function to render the dialog.
|
|
35
35
|
*
|
|
36
|
-
* @return {
|
|
36
|
+
* @return {React.ReactNode} The rendered component.
|
|
37
37
|
*/
|
|
38
38
|
export default function EntitiesSavedStates( {
|
|
39
39
|
close,
|
|
@@ -64,7 +64,7 @@ export default function EntitiesSavedStates( {
|
|
|
64
64
|
* @param {Function} props.setUnselectedEntities Function to set unselected entities.
|
|
65
65
|
* @param {Array} props.unselectedEntities Array of unselected entities.
|
|
66
66
|
*
|
|
67
|
-
* @return {
|
|
67
|
+
* @return {React.ReactNode} The rendered component.
|
|
68
68
|
*/
|
|
69
69
|
export function EntitiesSavedStatesExtensible( {
|
|
70
70
|
additionalPrompt = undefined,
|
|
@@ -256,7 +256,8 @@
|
|
|
256
256
|
|
|
257
257
|
& > .editor-header__toolbar .editor-document-tools__document-overview-toggle,
|
|
258
258
|
& > .editor-header__settings > .editor-preview-dropdown,
|
|
259
|
-
& > .editor-header__settings > .interface-pinned-items
|
|
259
|
+
& > .editor-header__settings > .interface-pinned-items,
|
|
260
|
+
& > .editor-header__settings > .editor-zoom-out-toggle {
|
|
260
261
|
display: none;
|
|
261
262
|
}
|
|
262
263
|
|
|
@@ -12,10 +12,10 @@ import { store as editorStore } from '../../store';
|
|
|
12
12
|
/**
|
|
13
13
|
* Wrapper component that renders its children only if the post type supports page attributes.
|
|
14
14
|
*
|
|
15
|
-
* @param {Object}
|
|
16
|
-
* @param {
|
|
15
|
+
* @param {Object} props - The component props.
|
|
16
|
+
* @param {React.ReactElement} props.children - The child components to render.
|
|
17
17
|
*
|
|
18
|
-
* @return {
|
|
18
|
+
* @return {React.ReactElement} The rendered child components or null if page attributes are not supported.
|
|
19
19
|
*/
|
|
20
20
|
export function PageAttributesCheck( { children } ) {
|
|
21
21
|
const supportsPageAttributes = useSelect( ( select ) => {
|
|
@@ -59,7 +59,7 @@ function PageAttributesOrder() {
|
|
|
59
59
|
* for setting the order of a given page.
|
|
60
60
|
* The component is now not used in core but was kept for backward compatibility.
|
|
61
61
|
*
|
|
62
|
-
* @return {
|
|
62
|
+
* @return {React.ReactNode} The rendered component.
|
|
63
63
|
*/
|
|
64
64
|
export default function PageAttributesOrderWithChecks() {
|
|
65
65
|
return (
|
|
@@ -33,7 +33,7 @@ function AttributesPanel() {
|
|
|
33
33
|
/**
|
|
34
34
|
* Renders the Page Attributes Panel component.
|
|
35
35
|
*
|
|
36
|
-
* @return {
|
|
36
|
+
* @return {React.ReactNode} The rendered component.
|
|
37
37
|
*/
|
|
38
38
|
export default function PageAttributesPanel() {
|
|
39
39
|
return (
|
|
@@ -56,7 +56,7 @@ export const getItemPriority = ( name, searchValue ) => {
|
|
|
56
56
|
* Renders the Page Attributes Parent component. A dropdown menu in an editor interface
|
|
57
57
|
* for selecting the parent page of a given page.
|
|
58
58
|
*
|
|
59
|
-
* @return {
|
|
59
|
+
* @return {React.ReactNode} The component to be rendered. Return null if post type is not hierarchical.
|
|
60
60
|
*/
|
|
61
61
|
export function PageAttributesParent() {
|
|
62
62
|
const { editPost } = useDispatch( editorStore );
|
|
@@ -22,7 +22,7 @@ const { Fill, Slot } = createSlotFill( 'PluginDocumentSettingPanel' );
|
|
|
22
22
|
* @param {string} [props.className] An optional class name added to the row.
|
|
23
23
|
* @param {string} [props.title] The title of the panel
|
|
24
24
|
* @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
|
|
25
|
-
* @param {
|
|
25
|
+
* @param {React.ReactNode} props.children Children to be rendered
|
|
26
26
|
*
|
|
27
27
|
* @example
|
|
28
28
|
* ```js
|
|
@@ -64,7 +64,7 @@ const { Fill, Slot } = createSlotFill( 'PluginDocumentSettingPanel' );
|
|
|
64
64
|
* registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } );
|
|
65
65
|
* ```
|
|
66
66
|
*
|
|
67
|
-
* @return {
|
|
67
|
+
* @return {React.ReactNode} The component to be rendered.
|
|
68
68
|
*/
|
|
69
69
|
const PluginDocumentSettingPanel = ( {
|
|
70
70
|
name,
|
|
@@ -10,6 +10,7 @@ import { ActionItem } from '@wordpress/interface';
|
|
|
10
10
|
* The text within the component appears as the menu item label.
|
|
11
11
|
*
|
|
12
12
|
* @param {Object} props Component properties.
|
|
13
|
+
* @param {React.ReactNode} [props.children] Children to be rendered.
|
|
13
14
|
* @param {string} [props.href] When `href` is provided then the menu item is represented as an anchor rather than button. It corresponds to the `href` attribute of the anchor.
|
|
14
15
|
* @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
|
|
15
16
|
* @param {Function} [props.onClick=noop] The callback function to be executed when the user clicks the menu item.
|
|
@@ -59,7 +60,7 @@ import { ActionItem } from '@wordpress/interface';
|
|
|
59
60
|
* );
|
|
60
61
|
* ```
|
|
61
62
|
*
|
|
62
|
-
* @return {
|
|
63
|
+
* @return {React.ReactNode} The rendered component.
|
|
63
64
|
*/
|
|
64
65
|
export default function PluginMoreMenuItem( props ) {
|
|
65
66
|
const context = usePluginContext();
|
|
@@ -15,7 +15,7 @@ const { Fill, Slot } = createSlotFill( 'PluginPostPublishPanel' );
|
|
|
15
15
|
* @param {string} [props.title] Title displayed at the top of the panel.
|
|
16
16
|
* @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened. When no title is provided it is always opened.
|
|
17
17
|
* @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
|
|
18
|
-
* @param {
|
|
18
|
+
* @param {React.ReactNode} props.children Children to be rendered
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
21
|
* ```jsx
|
|
@@ -34,7 +34,7 @@ const { Fill, Slot } = createSlotFill( 'PluginPostPublishPanel' );
|
|
|
34
34
|
* );
|
|
35
35
|
* ```
|
|
36
36
|
*
|
|
37
|
-
* @return {
|
|
37
|
+
* @return {React.ReactNode} The rendered component.
|
|
38
38
|
*/
|
|
39
39
|
const PluginPostPublishPanel = ( {
|
|
40
40
|
children,
|
|
@@ -14,9 +14,9 @@ const { Fill, Slot } = createSlotFill( 'PluginPostStatusInfo' );
|
|
|
14
14
|
* It should be noted that this is named and implemented around the function it serves
|
|
15
15
|
* and not its location, which may change in future iterations.
|
|
16
16
|
*
|
|
17
|
-
* @param {Object}
|
|
18
|
-
* @param {string}
|
|
19
|
-
* @param {
|
|
17
|
+
* @param {Object} props Component properties.
|
|
18
|
+
* @param {string} [props.className] An optional class name added to the row.
|
|
19
|
+
* @param {React.ReactNode} props.children Children to be rendered.
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
22
|
* ```js
|
|
@@ -50,7 +50,7 @@ const { Fill, Slot } = createSlotFill( 'PluginPostStatusInfo' );
|
|
|
50
50
|
* );
|
|
51
51
|
* ```
|
|
52
52
|
*
|
|
53
|
-
* @return {
|
|
53
|
+
* @return {React.ReactNode} The rendered component.
|
|
54
54
|
*/
|
|
55
55
|
const PluginPostStatusInfo = ( { children, className } ) => (
|
|
56
56
|
<Fill>
|
|
@@ -18,7 +18,7 @@ const { Fill, Slot } = createSlotFill( 'PluginPrePublishPanel' );
|
|
|
18
18
|
* @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/)
|
|
19
19
|
* icon slug string, or an SVG WP element, to be rendered when
|
|
20
20
|
* the sidebar is pinned to toolbar.
|
|
21
|
-
* @param {
|
|
21
|
+
* @param {React.ReactNode} props.children Children to be rendered
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
24
|
* ```jsx
|
|
@@ -37,7 +37,7 @@ const { Fill, Slot } = createSlotFill( 'PluginPrePublishPanel' );
|
|
|
37
37
|
* );
|
|
38
38
|
* ```
|
|
39
39
|
*
|
|
40
|
-
* @return {
|
|
40
|
+
* @return {React.ReactNode} The rendered component.
|
|
41
41
|
*/
|
|
42
42
|
const PluginPrePublishPanel = ( {
|
|
43
43
|
children,
|
|
@@ -10,6 +10,7 @@ import { ActionItem } from '@wordpress/interface';
|
|
|
10
10
|
* The text within the component appears as the menu item label.
|
|
11
11
|
*
|
|
12
12
|
* @param {Object} props Component properties.
|
|
13
|
+
* @param {React.ReactNode} [props.children] Children to be rendered.
|
|
13
14
|
* @param {string} [props.href] When `href` is provided, the menu item is rendered as an anchor instead of a button. It corresponds to the `href` attribute of the anchor.
|
|
14
15
|
* @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The icon to be rendered to the left of the menu item label. Can be a Dashicon slug or an SVG WP element.
|
|
15
16
|
* @param {Function} [props.onClick] The callback function to be executed when the user clicks the menu item.
|
|
@@ -38,7 +39,7 @@ import { ActionItem } from '@wordpress/interface';
|
|
|
38
39
|
* } );
|
|
39
40
|
* ```
|
|
40
41
|
*
|
|
41
|
-
* @return {
|
|
42
|
+
* @return {React.ReactNode} The rendered menu item component.
|
|
42
43
|
*/
|
|
43
44
|
export default function PluginPreviewMenuItem( props ) {
|
|
44
45
|
const context = usePluginContext();
|
|
@@ -16,6 +16,7 @@ import { ComplementaryArea } from '@wordpress/interface';
|
|
|
16
16
|
*
|
|
17
17
|
* @param {Object} props Element props.
|
|
18
18
|
* @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.
|
|
19
|
+
* @param {React.ReactNode} [props.children] Children to be rendered.
|
|
19
20
|
* @param {string} [props.className] An optional class name added to the sidebar body.
|
|
20
21
|
* @param {string} props.title Title displayed at the top of the sidebar.
|
|
21
22
|
* @param {boolean} [props.isPinnable=true] Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item.
|
|
@@ -10,6 +10,7 @@ import { ComplementaryAreaMoreMenuItem } from '@wordpress/interface';
|
|
|
10
10
|
*
|
|
11
11
|
* @param {Object} props Component props.
|
|
12
12
|
* @param {string} props.target A string identifying the target sidebar you wish to be activated by this menu item. Must be the same as the `name` prop you have given to that sidebar.
|
|
13
|
+
* @param {React.ReactNode} [props.children] Children to be rendered.
|
|
13
14
|
* @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
|
|
14
15
|
*
|
|
15
16
|
* @example
|
|
@@ -48,9 +49,8 @@ import { ComplementaryAreaMoreMenuItem } from '@wordpress/interface';
|
|
|
48
49
|
* );
|
|
49
50
|
* ```
|
|
50
51
|
*
|
|
51
|
-
* @return {
|
|
52
|
+
* @return {React.ReactNode} The rendered component.
|
|
52
53
|
*/
|
|
53
|
-
|
|
54
54
|
export default function PluginSidebarMoreMenuItem( props ) {
|
|
55
55
|
return (
|
|
56
56
|
<ComplementaryAreaMoreMenuItem
|
|
@@ -21,10 +21,10 @@ export function usePostActions( { postType, onActionPerformed, context } ) {
|
|
|
21
21
|
[ postType ]
|
|
22
22
|
);
|
|
23
23
|
|
|
24
|
-
const {
|
|
24
|
+
const { registerPostTypeSchema } = unlock( useDispatch( editorStore ) );
|
|
25
25
|
useEffect( () => {
|
|
26
|
-
|
|
27
|
-
}, [
|
|
26
|
+
registerPostTypeSchema( postType );
|
|
27
|
+
}, [ registerPostTypeSchema, postType ] );
|
|
28
28
|
|
|
29
29
|
return useMemo( () => {
|
|
30
30
|
// Filter actions based on provided context. If not provided
|
|
@@ -14,10 +14,10 @@ import { AUTHORS_QUERY } from './constants';
|
|
|
14
14
|
/**
|
|
15
15
|
* Wrapper component that renders its children only if the post type supports the author.
|
|
16
16
|
*
|
|
17
|
-
* @param {Object}
|
|
18
|
-
* @param {
|
|
17
|
+
* @param {Object} props The component props.
|
|
18
|
+
* @param {React.ReactNode} props.children Children to be rendered.
|
|
19
19
|
*
|
|
20
|
-
* @return {
|
|
20
|
+
* @return {React.ReactNode} The component to be rendered. Return `null` if the post type doesn't
|
|
21
21
|
* supports the author or if there are no authors available.
|
|
22
22
|
*/
|
|
23
23
|
export default function PostAuthorCheck( { children } ) {
|
|
@@ -16,7 +16,7 @@ const minimumUsersForCombobox = 25;
|
|
|
16
16
|
/**
|
|
17
17
|
* Renders the component for selecting the post author.
|
|
18
18
|
*
|
|
19
|
-
* @return {
|
|
19
|
+
* @return {React.ReactNode} The rendered component.
|
|
20
20
|
*/
|
|
21
21
|
function PostAuthor() {
|
|
22
22
|
const showCombobox = useSelect( ( select ) => {
|
|
@@ -39,7 +39,7 @@ function PostAuthorToggle( { isOpen, onClick } ) {
|
|
|
39
39
|
/**
|
|
40
40
|
* Renders the Post Author Panel component.
|
|
41
41
|
*
|
|
42
|
-
* @return {
|
|
42
|
+
* @return {React.ReactNode} The rendered component.
|
|
43
43
|
*/
|
|
44
44
|
export function PostAuthor() {
|
|
45
45
|
// Use internal state instead of a ref to make sure that the component
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
import { unlock } from '../../lock-unlock';
|
|
23
23
|
import PostActions from '../post-actions';
|
|
24
24
|
import usePageTypeBadge from '../../utils/pageTypeBadge';
|
|
25
|
+
import { getTemplateInfo } from '../../utils/get-template-info';
|
|
25
26
|
|
|
26
27
|
export default function PostCardPanel( {
|
|
27
28
|
postType,
|
|
@@ -30,17 +31,29 @@ export default function PostCardPanel( {
|
|
|
30
31
|
} ) {
|
|
31
32
|
const { title, icon } = useSelect(
|
|
32
33
|
( select ) => {
|
|
33
|
-
const { __experimentalGetTemplateInfo } = select( editorStore );
|
|
34
34
|
const { getEditedEntityRecord } = select( coreStore );
|
|
35
35
|
const _record = getEditedEntityRecord(
|
|
36
36
|
'postType',
|
|
37
37
|
postType,
|
|
38
38
|
postId
|
|
39
39
|
);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
|
|
41
|
+
const { default_template_types: templateTypes = [] } =
|
|
42
|
+
select( coreStore ).getEntityRecord(
|
|
43
|
+
'root',
|
|
44
|
+
'__unstableBase'
|
|
45
|
+
) ?? {};
|
|
46
|
+
|
|
47
|
+
const _templateInfo = [
|
|
48
|
+
TEMPLATE_POST_TYPE,
|
|
49
|
+
TEMPLATE_PART_POST_TYPE,
|
|
50
|
+
].includes( postType )
|
|
51
|
+
? getTemplateInfo( {
|
|
52
|
+
template: _record,
|
|
53
|
+
templateTypes,
|
|
54
|
+
} )
|
|
55
|
+
: {};
|
|
56
|
+
|
|
44
57
|
return {
|
|
45
58
|
title: _templateInfo?.title || _record?.title,
|
|
46
59
|
icon: unlock( select( editorStore ) ).getPostIcon( postType, {
|
|
@@ -93,7 +93,7 @@ function PostDiscussionToggle( { isOpen, onClick } ) {
|
|
|
93
93
|
* checks whether the current post has support for the
|
|
94
94
|
* above and if the `discussion-panel` panel is enabled.
|
|
95
95
|
*
|
|
96
|
-
* @return {
|
|
96
|
+
* @return {React.ReactNode} The rendered PostDiscussionPanel component.
|
|
97
97
|
*/
|
|
98
98
|
export default function PostDiscussionPanel() {
|
|
99
99
|
const { isEnabled } = useSelect( ( select ) => {
|
|
@@ -6,10 +6,10 @@ import PostTypeSupportCheck from '../post-type-support-check';
|
|
|
6
6
|
/**
|
|
7
7
|
* Component for checking if the post type supports the excerpt field.
|
|
8
8
|
*
|
|
9
|
-
* @param {Object}
|
|
10
|
-
* @param {
|
|
9
|
+
* @param {Object} props Props.
|
|
10
|
+
* @param {React.ReactNode} props.children Children to be rendered.
|
|
11
11
|
*
|
|
12
|
-
* @return {
|
|
12
|
+
* @return {React.ReactNode} The rendered component.
|
|
13
13
|
*/
|
|
14
14
|
function PostExcerptCheck( { children } ) {
|
|
15
15
|
return (
|
|
@@ -83,7 +83,7 @@ function ExcerptPanel() {
|
|
|
83
83
|
/**
|
|
84
84
|
* Is rendered if the post type supports excerpts and allows editing the excerpt.
|
|
85
85
|
*
|
|
86
|
-
* @return {
|
|
86
|
+
* @return {React.ReactNode} The rendered PostExcerptPanel component.
|
|
87
87
|
*/
|
|
88
88
|
export default function PostExcerptPanel() {
|
|
89
89
|
return (
|
|
@@ -12,9 +12,9 @@ const { Fill, Slot } = createSlotFill( 'PluginPostExcerpt' );
|
|
|
12
12
|
/**
|
|
13
13
|
* Renders a post excerpt panel in the post sidebar.
|
|
14
14
|
*
|
|
15
|
-
* @param {Object}
|
|
16
|
-
* @param {string}
|
|
17
|
-
* @param {
|
|
15
|
+
* @param {Object} props Component properties.
|
|
16
|
+
* @param {string} [props.className] An optional class name added to the row.
|
|
17
|
+
* @param {React.ReactNode} props.children Children to be rendered.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* ```js
|
|
@@ -46,7 +46,7 @@ const { Fill, Slot } = createSlotFill( 'PluginPostExcerpt' );
|
|
|
46
46
|
* );
|
|
47
47
|
* ```
|
|
48
48
|
*
|
|
49
|
-
* @return {
|
|
49
|
+
* @return {React.ReactNode} The rendered component.
|
|
50
50
|
*/
|
|
51
51
|
const PluginPostExcerpt = ( { children, className } ) => {
|
|
52
52
|
return (
|
|
@@ -8,10 +8,10 @@ import ThemeSupportCheck from '../theme-support-check';
|
|
|
8
8
|
* Wrapper component that renders its children only if the post type supports a featured image
|
|
9
9
|
* and the theme supports post thumbnails.
|
|
10
10
|
*
|
|
11
|
-
* @param {Object}
|
|
12
|
-
* @param {
|
|
11
|
+
* @param {Object} props Props.
|
|
12
|
+
* @param {React.ReactNode} props.children Children to be rendered.
|
|
13
13
|
*
|
|
14
|
-
* @return {
|
|
14
|
+
* @return {React.ReactNode} The rendered component.
|
|
15
15
|
*/
|
|
16
16
|
function PostFeaturedImageCheck( { children } ) {
|
|
17
17
|
return (
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* WordPress dependencies
|
|
3
8
|
*/
|
|
@@ -10,6 +15,7 @@ import {
|
|
|
10
15
|
withNotices,
|
|
11
16
|
withFilters,
|
|
12
17
|
__experimentalHStack as HStack,
|
|
18
|
+
Notice,
|
|
13
19
|
} from '@wordpress/components';
|
|
14
20
|
import { isBlobURL } from '@wordpress/blob';
|
|
15
21
|
import { useState, useRef } from '@wordpress/element';
|
|
@@ -94,8 +100,9 @@ function PostFeaturedImage( {
|
|
|
94
100
|
postType,
|
|
95
101
|
noticeUI,
|
|
96
102
|
noticeOperations,
|
|
103
|
+
isRequestingFeaturedImageMedia,
|
|
97
104
|
} ) {
|
|
98
|
-
const
|
|
105
|
+
const returnsFocusRef = useRef( false );
|
|
99
106
|
const [ isLoading, setIsLoading ] = useState( false );
|
|
100
107
|
const { getSettings } = useSelect( blockEditorStore );
|
|
101
108
|
const { mediaSourceUrl } = getMediaDetails( media, currentPostId );
|
|
@@ -150,6 +157,16 @@ function PostFeaturedImage( {
|
|
|
150
157
|
);
|
|
151
158
|
}
|
|
152
159
|
|
|
160
|
+
function returnFocus( node ) {
|
|
161
|
+
if ( returnsFocusRef.current && node ) {
|
|
162
|
+
node.focus();
|
|
163
|
+
returnsFocusRef.current = false;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const isMissingMedia =
|
|
168
|
+
! isRequestingFeaturedImageMedia && !! featuredImageId && ! media;
|
|
169
|
+
|
|
153
170
|
return (
|
|
154
171
|
<PostFeaturedImageCheck>
|
|
155
172
|
{ noticeUI }
|
|
@@ -174,52 +191,83 @@ function PostFeaturedImage( {
|
|
|
174
191
|
modalClass="editor-post-featured-image__media-modal"
|
|
175
192
|
render={ ( { open } ) => (
|
|
176
193
|
<div className="editor-post-featured-image__container">
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
(
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
194
|
+
{ isMissingMedia ? (
|
|
195
|
+
<Notice
|
|
196
|
+
status="warning"
|
|
197
|
+
isDismissible={ false }
|
|
198
|
+
>
|
|
199
|
+
{ __(
|
|
200
|
+
'Could not retrieve the featured image data.'
|
|
201
|
+
) }
|
|
202
|
+
</Notice>
|
|
203
|
+
) : (
|
|
204
|
+
<Button
|
|
205
|
+
__next40pxDefaultSize
|
|
206
|
+
ref={ returnFocus }
|
|
207
|
+
className={
|
|
208
|
+
! featuredImageId
|
|
209
|
+
? 'editor-post-featured-image__toggle'
|
|
210
|
+
: 'editor-post-featured-image__preview'
|
|
211
|
+
}
|
|
212
|
+
onClick={ open }
|
|
213
|
+
aria-label={
|
|
214
|
+
! featuredImageId
|
|
215
|
+
? null
|
|
216
|
+
: __(
|
|
217
|
+
'Edit or replace the featured image'
|
|
218
|
+
)
|
|
219
|
+
}
|
|
220
|
+
aria-describedby={
|
|
221
|
+
! featuredImageId
|
|
222
|
+
? null
|
|
223
|
+
: `editor-post-featured-image-${ featuredImageId }-describedby`
|
|
224
|
+
}
|
|
225
|
+
aria-haspopup="dialog"
|
|
226
|
+
disabled={ isLoading }
|
|
227
|
+
accessibleWhenDisabled
|
|
228
|
+
>
|
|
229
|
+
{ !! featuredImageId && media && (
|
|
230
|
+
<img
|
|
231
|
+
className="editor-post-featured-image__preview-image"
|
|
232
|
+
src={ mediaSourceUrl }
|
|
233
|
+
alt={ getImageDescription(
|
|
234
|
+
media
|
|
235
|
+
) }
|
|
236
|
+
/>
|
|
237
|
+
) }
|
|
238
|
+
{ ( isLoading ||
|
|
239
|
+
isRequestingFeaturedImageMedia ) && (
|
|
240
|
+
<Spinner />
|
|
241
|
+
) }
|
|
242
|
+
{ ! featuredImageId &&
|
|
243
|
+
! isLoading &&
|
|
244
|
+
( postType?.labels
|
|
245
|
+
?.set_featured_image ||
|
|
246
|
+
DEFAULT_SET_FEATURE_IMAGE_LABEL ) }
|
|
247
|
+
</Button>
|
|
248
|
+
) }
|
|
216
249
|
{ !! featuredImageId && (
|
|
217
|
-
<HStack
|
|
250
|
+
<HStack
|
|
251
|
+
className={ clsx(
|
|
252
|
+
'editor-post-featured-image__actions',
|
|
253
|
+
{
|
|
254
|
+
'editor-post-featured-image__actions-missing-image':
|
|
255
|
+
isMissingMedia,
|
|
256
|
+
'editor-post-featured-image__actions-is-requesting-image':
|
|
257
|
+
isRequestingFeaturedImageMedia,
|
|
258
|
+
}
|
|
259
|
+
) }
|
|
260
|
+
>
|
|
218
261
|
<Button
|
|
219
262
|
__next40pxDefaultSize
|
|
220
263
|
className="editor-post-featured-image__action"
|
|
221
264
|
onClick={ open }
|
|
222
265
|
aria-haspopup="dialog"
|
|
266
|
+
variant={
|
|
267
|
+
isMissingMedia
|
|
268
|
+
? 'secondary'
|
|
269
|
+
: undefined
|
|
270
|
+
}
|
|
223
271
|
>
|
|
224
272
|
{ __( 'Replace' ) }
|
|
225
273
|
</Button>
|
|
@@ -228,8 +276,17 @@ function PostFeaturedImage( {
|
|
|
228
276
|
className="editor-post-featured-image__action"
|
|
229
277
|
onClick={ () => {
|
|
230
278
|
onRemoveImage();
|
|
231
|
-
|
|
279
|
+
// Signal that the toggle button should be focused,
|
|
280
|
+
// when it is rendered. Can't focus it directly here
|
|
281
|
+
// because it's rendered conditionally.
|
|
282
|
+
returnsFocusRef.current = true;
|
|
232
283
|
} }
|
|
284
|
+
variant={
|
|
285
|
+
isMissingMedia
|
|
286
|
+
? 'secondary'
|
|
287
|
+
: undefined
|
|
288
|
+
}
|
|
289
|
+
isDestructive={ isMissingMedia }
|
|
233
290
|
>
|
|
234
291
|
{ __( 'Remove' ) }
|
|
235
292
|
</Button>
|
|
@@ -247,7 +304,8 @@ function PostFeaturedImage( {
|
|
|
247
304
|
}
|
|
248
305
|
|
|
249
306
|
const applyWithSelect = withSelect( ( select ) => {
|
|
250
|
-
const { getMedia, getPostType } =
|
|
307
|
+
const { getMedia, getPostType, hasFinishedResolution } =
|
|
308
|
+
select( coreStore );
|
|
251
309
|
const { getCurrentPostId, getEditedPostAttribute } = select( editorStore );
|
|
252
310
|
const featuredImageId = getEditedPostAttribute( 'featured_media' );
|
|
253
311
|
|
|
@@ -258,6 +316,12 @@ const applyWithSelect = withSelect( ( select ) => {
|
|
|
258
316
|
currentPostId: getCurrentPostId(),
|
|
259
317
|
postType: getPostType( getEditedPostAttribute( 'type' ) ),
|
|
260
318
|
featuredImageId,
|
|
319
|
+
isRequestingFeaturedImageMedia:
|
|
320
|
+
!! featuredImageId &&
|
|
321
|
+
! hasFinishedResolution( 'getMedia', [
|
|
322
|
+
featuredImageId,
|
|
323
|
+
{ context: 'view' },
|
|
324
|
+
] ),
|
|
261
325
|
};
|
|
262
326
|
} );
|
|
263
327
|
|
|
@@ -21,7 +21,7 @@ const PANEL_NAME = 'featured-image';
|
|
|
21
21
|
* @param {Object} props Props.
|
|
22
22
|
* @param {boolean} props.withPanelBody Whether to include the panel body. Default true.
|
|
23
23
|
*
|
|
24
|
-
* @return {
|
|
24
|
+
* @return {React.ReactNode} The component to be rendered.
|
|
25
25
|
* Return Null if the editor panel is disabled for featured image.
|
|
26
26
|
*/
|
|
27
27
|
export default function PostFeaturedImagePanel( { withPanelBody = true } ) {
|