@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
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __experimentalVStack as VStack } from '@wordpress/components';
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
import { dateI18n, getSettings as getDateSettings } from '@wordpress/date';
|
|
7
|
+
import { useEntityProp, store as coreStore } from '@wordpress/core-data';
|
|
8
|
+
import { useSelect } from '@wordpress/data';
|
|
9
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Render author information for a comment.
|
|
13
|
+
*
|
|
14
|
+
* @param {Object} props - Component properties.
|
|
15
|
+
* @param {string} props.avatar - URL of the author's avatar.
|
|
16
|
+
* @param {string} props.name - Name of the author.
|
|
17
|
+
* @param {string} props.date - Date of the comment.
|
|
18
|
+
*
|
|
19
|
+
* @return {React.ReactNode} The JSX element representing the author's information.
|
|
20
|
+
*/
|
|
21
|
+
function CommentAuthorInfo( { avatar, name, date } ) {
|
|
22
|
+
const dateSettings = getDateSettings();
|
|
23
|
+
const [ dateTimeFormat = dateSettings.formats.time ] = useEntityProp(
|
|
24
|
+
'root',
|
|
25
|
+
'site',
|
|
26
|
+
'time_format'
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const { currentUserAvatar, currentUserName } = useSelect( ( select ) => {
|
|
30
|
+
const userData = select( coreStore ).getCurrentUser();
|
|
31
|
+
|
|
32
|
+
const { getSettings } = select( blockEditorStore );
|
|
33
|
+
const { __experimentalDiscussionSettings } = getSettings();
|
|
34
|
+
const defaultAvatar = __experimentalDiscussionSettings?.avatarURL;
|
|
35
|
+
return {
|
|
36
|
+
currentUserAvatar: userData?.avatar_urls[ 48 ] ?? defaultAvatar,
|
|
37
|
+
currentUserName: userData?.name,
|
|
38
|
+
};
|
|
39
|
+
}, [] );
|
|
40
|
+
|
|
41
|
+
const currentDate = new Date();
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<>
|
|
45
|
+
<img
|
|
46
|
+
src={ avatar ?? currentUserAvatar }
|
|
47
|
+
className="editor-collab-sidebar-panel__user-avatar"
|
|
48
|
+
// translators: alt text for user avatar image
|
|
49
|
+
alt={ __( 'User avatar' ) }
|
|
50
|
+
width={ 32 }
|
|
51
|
+
height={ 32 }
|
|
52
|
+
/>
|
|
53
|
+
<VStack spacing="0">
|
|
54
|
+
<span className="editor-collab-sidebar-panel__user-name">
|
|
55
|
+
{ name ?? currentUserName }
|
|
56
|
+
</span>
|
|
57
|
+
<time
|
|
58
|
+
dateTime={ dateI18n( 'c', date ?? currentDate ) }
|
|
59
|
+
className="editor-collab-sidebar-panel__user-time"
|
|
60
|
+
>
|
|
61
|
+
{ dateI18n( dateTimeFormat, date ?? currentDate ) }
|
|
62
|
+
</time>
|
|
63
|
+
</VStack>
|
|
64
|
+
</>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export default CommentAuthorInfo;
|
|
@@ -11,18 +11,18 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
|
11
11
|
*/
|
|
12
12
|
import { unlock } from '../../lock-unlock';
|
|
13
13
|
|
|
14
|
-
const {
|
|
14
|
+
const { CommentIconToolbarSlotFill } = unlock( blockEditorPrivateApis );
|
|
15
15
|
|
|
16
16
|
const AddCommentToolbarButton = ( { onClick } ) => {
|
|
17
17
|
return (
|
|
18
|
-
<
|
|
18
|
+
<CommentIconToolbarSlotFill.Fill>
|
|
19
19
|
<ToolbarButton
|
|
20
20
|
accessibleWhenDisabled
|
|
21
21
|
icon={ commentIcon }
|
|
22
22
|
label={ _x( 'Comment', 'View comment' ) }
|
|
23
23
|
onClick={ onClick }
|
|
24
24
|
/>
|
|
25
|
-
</
|
|
25
|
+
</CommentIconToolbarSlotFill.Fill>
|
|
26
26
|
);
|
|
27
27
|
};
|
|
28
28
|
|
|
@@ -12,11 +12,11 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
|
12
12
|
*/
|
|
13
13
|
import { unlock } from '../../lock-unlock';
|
|
14
14
|
|
|
15
|
-
const {
|
|
15
|
+
const { CommentIconSlotFill } = unlock( blockEditorPrivateApis );
|
|
16
16
|
|
|
17
17
|
const AddCommentButton = ( { onClick } ) => {
|
|
18
18
|
return (
|
|
19
|
-
<
|
|
19
|
+
<CommentIconSlotFill.Fill>
|
|
20
20
|
<MenuItem
|
|
21
21
|
icon={ commentIcon }
|
|
22
22
|
onClick={ onClick }
|
|
@@ -24,7 +24,7 @@ const AddCommentButton = ( { onClick } ) => {
|
|
|
24
24
|
>
|
|
25
25
|
{ _x( 'Comment', 'Add comment button' ) }
|
|
26
26
|
</MenuItem>
|
|
27
|
-
</
|
|
27
|
+
</CommentIconSlotFill.Fill>
|
|
28
28
|
);
|
|
29
29
|
};
|
|
30
30
|
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useState } from '@wordpress/element';
|
|
5
|
+
import {
|
|
6
|
+
__experimentalHStack as HStack,
|
|
7
|
+
Button,
|
|
8
|
+
TextareaControl,
|
|
9
|
+
} from '@wordpress/components';
|
|
10
|
+
import { _x } from '@wordpress/i18n';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Internal dependencies
|
|
14
|
+
*/
|
|
15
|
+
import { sanitizeCommentString } from './utils';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* EditComment component.
|
|
19
|
+
*
|
|
20
|
+
* @param {Object} props - The component props.
|
|
21
|
+
* @param {Function} props.onSubmit - The function to call when updating the comment.
|
|
22
|
+
* @param {Function} props.onCancel - The function to call when canceling the comment update.
|
|
23
|
+
* @param {Object} props.thread - The comment thread object.
|
|
24
|
+
* @param {string} props.submitButtonText - The text to display on the submit button.
|
|
25
|
+
* @return {React.ReactNode} The CommentForm component.
|
|
26
|
+
*/
|
|
27
|
+
function CommentForm( { onSubmit, onCancel, thread, submitButtonText } ) {
|
|
28
|
+
const [ inputComment, setInputComment ] = useState(
|
|
29
|
+
thread?.content?.raw ?? ''
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<>
|
|
34
|
+
<TextareaControl
|
|
35
|
+
__next40pxDefaultSize
|
|
36
|
+
__nextHasNoMarginBottom
|
|
37
|
+
value={ inputComment ?? '' }
|
|
38
|
+
onChange={ setInputComment }
|
|
39
|
+
/>
|
|
40
|
+
<HStack alignment="left" spacing="3" justify="flex-start">
|
|
41
|
+
<Button
|
|
42
|
+
__next40pxDefaultSize
|
|
43
|
+
accessibleWhenDisabled
|
|
44
|
+
variant="primary"
|
|
45
|
+
onClick={ () => onSubmit( inputComment ) }
|
|
46
|
+
disabled={
|
|
47
|
+
0 === sanitizeCommentString( inputComment ).length
|
|
48
|
+
}
|
|
49
|
+
text={ submitButtonText }
|
|
50
|
+
/>
|
|
51
|
+
<Button
|
|
52
|
+
__next40pxDefaultSize
|
|
53
|
+
variant="tertiary"
|
|
54
|
+
onClick={ onCancel }
|
|
55
|
+
text={ _x( 'Cancel', 'Cancel comment button' ) }
|
|
56
|
+
/>
|
|
57
|
+
</HStack>
|
|
58
|
+
</>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export default CommentForm;
|
|
@@ -13,24 +13,18 @@ import {
|
|
|
13
13
|
__experimentalConfirmDialog as ConfirmDialog,
|
|
14
14
|
Button,
|
|
15
15
|
DropdownMenu,
|
|
16
|
-
TextareaControl,
|
|
17
16
|
Tooltip,
|
|
18
17
|
} from '@wordpress/components';
|
|
19
|
-
import {
|
|
20
|
-
dateI18n,
|
|
21
|
-
format,
|
|
22
|
-
getSettings as getDateSettings,
|
|
23
|
-
} from '@wordpress/date';
|
|
24
18
|
import { Icon, check, published, moreVertical } from '@wordpress/icons';
|
|
25
19
|
import { __, _x } from '@wordpress/i18n';
|
|
26
20
|
import { useSelect } from '@wordpress/data';
|
|
27
|
-
import { useEntityProp } from '@wordpress/core-data';
|
|
28
21
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
29
22
|
|
|
30
23
|
/**
|
|
31
24
|
* Internal dependencies
|
|
32
25
|
*/
|
|
33
|
-
import
|
|
26
|
+
import CommentAuthorInfo from './comment-author-info';
|
|
27
|
+
import CommentForm from './comment-form';
|
|
34
28
|
|
|
35
29
|
/**
|
|
36
30
|
* Renders the Comments component.
|
|
@@ -41,7 +35,7 @@ import { sanitizeCommentString } from './utils';
|
|
|
41
35
|
* @param {Function} props.onAddReply - The function to add a reply to a comment.
|
|
42
36
|
* @param {Function} props.onCommentDelete - The function to delete a comment.
|
|
43
37
|
* @param {Function} props.onCommentResolve - The function to mark a comment as resolved.
|
|
44
|
-
* @return {
|
|
38
|
+
* @return {React.ReactNode} The rendered Comments component.
|
|
45
39
|
*/
|
|
46
40
|
export function Comments( {
|
|
47
41
|
threads,
|
|
@@ -127,6 +121,7 @@ export function Comments( {
|
|
|
127
121
|
} }
|
|
128
122
|
onCancel={ () => setActionState( false ) }
|
|
129
123
|
thread={ thread }
|
|
124
|
+
submitButtonText={ _x( 'Update', 'verb' ) }
|
|
130
125
|
/>
|
|
131
126
|
) }
|
|
132
127
|
{ ( ! actionState ||
|
|
@@ -209,14 +204,33 @@ export function Comments( {
|
|
|
209
204
|
spacing="3"
|
|
210
205
|
>
|
|
211
206
|
<CommentBoard thread={ thread } />
|
|
207
|
+
{ 0 < thread?.reply?.length &&
|
|
208
|
+
thread.reply.map( ( reply ) => (
|
|
209
|
+
<VStack
|
|
210
|
+
key={ reply.id }
|
|
211
|
+
className="editor-collab-sidebar-panel__child-thread"
|
|
212
|
+
id={ reply.id }
|
|
213
|
+
spacing="2"
|
|
214
|
+
>
|
|
215
|
+
<CommentBoard
|
|
216
|
+
thread={ reply }
|
|
217
|
+
parentThread={ thread }
|
|
218
|
+
/>
|
|
219
|
+
</VStack>
|
|
220
|
+
) ) }
|
|
212
221
|
{ 'reply' === actionState?.action &&
|
|
213
222
|
thread.id === actionState?.id && (
|
|
214
|
-
<
|
|
215
|
-
|
|
216
|
-
spacing="
|
|
217
|
-
justify="flex-start"
|
|
218
|
-
className="editor-collab-sidebar-panel__user-comment"
|
|
223
|
+
<VStack
|
|
224
|
+
className="editor-collab-sidebar-panel__child-thread"
|
|
225
|
+
spacing="2"
|
|
219
226
|
>
|
|
227
|
+
<HStack
|
|
228
|
+
alignment="left"
|
|
229
|
+
spacing="3"
|
|
230
|
+
justify="flex-start"
|
|
231
|
+
>
|
|
232
|
+
<CommentAuthorInfo />
|
|
233
|
+
</HStack>
|
|
220
234
|
<VStack
|
|
221
235
|
spacing="3"
|
|
222
236
|
className="editor-collab-sidebar-panel__comment-field"
|
|
@@ -232,75 +246,20 @@ export function Comments( {
|
|
|
232
246
|
onCancel={ () =>
|
|
233
247
|
setActionState( false )
|
|
234
248
|
}
|
|
249
|
+
submitButtonText={ _x(
|
|
250
|
+
'Reply',
|
|
251
|
+
'Add reply comment'
|
|
252
|
+
) }
|
|
235
253
|
/>
|
|
236
254
|
</VStack>
|
|
237
|
-
</HStack>
|
|
238
|
-
) }
|
|
239
|
-
{ 0 < thread?.reply?.length &&
|
|
240
|
-
thread.reply.map( ( reply ) => (
|
|
241
|
-
<VStack
|
|
242
|
-
key={ reply.id }
|
|
243
|
-
className="editor-collab-sidebar-panel__child-thread"
|
|
244
|
-
id={ reply.id }
|
|
245
|
-
spacing="2"
|
|
246
|
-
>
|
|
247
|
-
<CommentBoard
|
|
248
|
-
thread={ reply }
|
|
249
|
-
parentThread={ thread }
|
|
250
|
-
/>
|
|
251
255
|
</VStack>
|
|
252
|
-
)
|
|
256
|
+
) }
|
|
253
257
|
</VStack>
|
|
254
258
|
) ) }
|
|
255
259
|
</>
|
|
256
260
|
);
|
|
257
261
|
}
|
|
258
262
|
|
|
259
|
-
/**
|
|
260
|
-
* EditComment component.
|
|
261
|
-
*
|
|
262
|
-
* @param {Object} props - The component props.
|
|
263
|
-
* @param {Function} props.onSubmit - The function to call when updating the comment.
|
|
264
|
-
* @param {Function} props.onCancel - The function to call when canceling the comment update.
|
|
265
|
-
* @param {Object} props.thread - The comment thread object.
|
|
266
|
-
* @return {JSX.Element} The CommentForm component.
|
|
267
|
-
*/
|
|
268
|
-
function CommentForm( { onSubmit, onCancel, thread } ) {
|
|
269
|
-
const [ inputComment, setInputComment ] = useState(
|
|
270
|
-
thread?.content?.raw ?? ''
|
|
271
|
-
);
|
|
272
|
-
|
|
273
|
-
return (
|
|
274
|
-
<>
|
|
275
|
-
<TextareaControl
|
|
276
|
-
__nextHasNoMarginBottom
|
|
277
|
-
value={ inputComment ?? '' }
|
|
278
|
-
onChange={ setInputComment }
|
|
279
|
-
/>
|
|
280
|
-
<VStack alignment="left" spacing="3" justify="flex-start">
|
|
281
|
-
<HStack alignment="left" spacing="3" justify="flex-start">
|
|
282
|
-
<Button
|
|
283
|
-
__next40pxDefaultSize
|
|
284
|
-
accessibleWhenDisabled
|
|
285
|
-
variant="primary"
|
|
286
|
-
onClick={ () => onSubmit( inputComment ) }
|
|
287
|
-
disabled={
|
|
288
|
-
0 === sanitizeCommentString( inputComment ).length
|
|
289
|
-
}
|
|
290
|
-
>
|
|
291
|
-
{ thread
|
|
292
|
-
? _x( 'Update', 'verb' )
|
|
293
|
-
: _x( 'Reply', 'Add reply comment' ) }
|
|
294
|
-
</Button>
|
|
295
|
-
<Button __next40pxDefaultSize onClick={ onCancel }>
|
|
296
|
-
{ _x( 'Cancel', 'Cancel comment edit' ) }
|
|
297
|
-
</Button>
|
|
298
|
-
</HStack>
|
|
299
|
-
</VStack>
|
|
300
|
-
</>
|
|
301
|
-
);
|
|
302
|
-
}
|
|
303
|
-
|
|
304
263
|
/**
|
|
305
264
|
* Renders the header of a comment in the collaboration sidebar.
|
|
306
265
|
*
|
|
@@ -311,7 +270,7 @@ function CommentForm( { onSubmit, onCancel, thread } ) {
|
|
|
311
270
|
* @param {Function} props.onDelete - The function to delete the comment.
|
|
312
271
|
* @param {Function} props.onReply - The function to reply to the comment.
|
|
313
272
|
* @param {string} props.status - The status of the comment.
|
|
314
|
-
* @return {
|
|
273
|
+
* @return {React.ReactNode} The rendered comment header.
|
|
315
274
|
*/
|
|
316
275
|
function CommentHeader( {
|
|
317
276
|
thread,
|
|
@@ -321,13 +280,6 @@ function CommentHeader( {
|
|
|
321
280
|
onReply,
|
|
322
281
|
status,
|
|
323
282
|
} ) {
|
|
324
|
-
const dateSettings = getDateSettings();
|
|
325
|
-
const [ dateTimeFormat = dateSettings.formats.time ] = useEntityProp(
|
|
326
|
-
'root',
|
|
327
|
-
'site',
|
|
328
|
-
'time_format'
|
|
329
|
-
);
|
|
330
|
-
|
|
331
283
|
const actions = [
|
|
332
284
|
{
|
|
333
285
|
title: _x( 'Edit', 'Edit comment' ),
|
|
@@ -347,29 +299,15 @@ function CommentHeader( {
|
|
|
347
299
|
|
|
348
300
|
return (
|
|
349
301
|
<HStack alignment="left" spacing="3" justify="flex-start">
|
|
350
|
-
<
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
alt={ __( 'User avatar' ) }
|
|
355
|
-
width={ 32 }
|
|
356
|
-
height={ 32 }
|
|
302
|
+
<CommentAuthorInfo
|
|
303
|
+
avatar={ thread?.author_avatar_urls?.[ 48 ] }
|
|
304
|
+
name={ thread?.author_name }
|
|
305
|
+
date={ thread?.date }
|
|
357
306
|
/>
|
|
358
|
-
<VStack spacing="0">
|
|
359
|
-
<span className="editor-collab-sidebar-panel__user-name">
|
|
360
|
-
{ thread.author_name }
|
|
361
|
-
</span>
|
|
362
|
-
<time
|
|
363
|
-
dateTime={ format( 'h:i A', thread.date ) }
|
|
364
|
-
className="editor-collab-sidebar-panel__user-time"
|
|
365
|
-
>
|
|
366
|
-
{ dateI18n( dateTimeFormat, thread.date ) }
|
|
367
|
-
</time>
|
|
368
|
-
</VStack>
|
|
369
307
|
<span className="editor-collab-sidebar-panel__comment-status">
|
|
370
308
|
{ status !== 'approved' && (
|
|
371
309
|
<HStack alignment="right" justify="flex-end" spacing="0">
|
|
372
|
-
{ 0 === thread
|
|
310
|
+
{ 0 === thread?.parent && onResolve && (
|
|
373
311
|
<Button
|
|
374
312
|
label={ _x(
|
|
375
313
|
'Resolve',
|
|
@@ -27,7 +27,6 @@ import { serialize } from '@wordpress/blocks';
|
|
|
27
27
|
/**
|
|
28
28
|
* Internal dependencies
|
|
29
29
|
*/
|
|
30
|
-
import { store as editorStore } from '../../store';
|
|
31
30
|
import {
|
|
32
31
|
TEMPLATE_PART_POST_TYPE,
|
|
33
32
|
TEMPLATE_PART_AREA_DEFAULT_CATEGORY,
|
|
@@ -81,9 +80,11 @@ export function CreateTemplatePartModalContents( {
|
|
|
81
80
|
|
|
82
81
|
const templatePartAreas = useSelect(
|
|
83
82
|
( select ) =>
|
|
84
|
-
select(
|
|
83
|
+
select( coreStore ).getEntityRecord( 'root', '__unstableBase' )
|
|
84
|
+
?.default_template_part_areas || [],
|
|
85
85
|
[]
|
|
86
86
|
);
|
|
87
|
+
|
|
87
88
|
async function createTemplatePart() {
|
|
88
89
|
if ( ! title || isSubmitting ) {
|
|
89
90
|
return;
|
|
@@ -29,6 +29,7 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
29
29
|
import { TEMPLATE_POST_TYPES } from '../../store/constants';
|
|
30
30
|
import { store as editorStore } from '../../store';
|
|
31
31
|
import usePageTypeBadge from '../../utils/pageTypeBadge';
|
|
32
|
+
import { getTemplateInfo } from '../../utils/get-template-info';
|
|
32
33
|
|
|
33
34
|
/** @typedef {import("@wordpress/components").IconType} IconType */
|
|
34
35
|
|
|
@@ -49,7 +50,7 @@ const MotionButton = motion( Button );
|
|
|
49
50
|
* @param {IconType} props.icon An icon for the document, no default.
|
|
50
51
|
* (A default icon indicating the document post type is no longer used.)
|
|
51
52
|
*
|
|
52
|
-
* @return {
|
|
53
|
+
* @return {React.ReactNode} The rendered DocumentBar component.
|
|
53
54
|
*/
|
|
54
55
|
export default function DocumentBar( props ) {
|
|
55
56
|
const {
|
|
@@ -65,9 +66,9 @@ export default function DocumentBar( props ) {
|
|
|
65
66
|
getCurrentPostType,
|
|
66
67
|
getCurrentPostId,
|
|
67
68
|
getEditorSettings,
|
|
68
|
-
__experimentalGetTemplateInfo: getTemplateInfo,
|
|
69
69
|
getRenderingMode,
|
|
70
70
|
} = select( editorStore );
|
|
71
|
+
|
|
71
72
|
const {
|
|
72
73
|
getEditedEntityRecord,
|
|
73
74
|
getPostType,
|
|
@@ -80,7 +81,15 @@ export default function DocumentBar( props ) {
|
|
|
80
81
|
_postType,
|
|
81
82
|
_postId
|
|
82
83
|
);
|
|
83
|
-
|
|
84
|
+
|
|
85
|
+
const { default_template_types: templateTypes = [] } =
|
|
86
|
+
select( coreStore ).getEntityRecord( 'root', '__unstableBase' ) ??
|
|
87
|
+
{};
|
|
88
|
+
|
|
89
|
+
const _templateInfo = getTemplateInfo( {
|
|
90
|
+
templateTypes,
|
|
91
|
+
template: _document,
|
|
92
|
+
} );
|
|
84
93
|
const _postTypeLabel = getPostType( _postType )?.labels?.singular_name;
|
|
85
94
|
|
|
86
95
|
return {
|
|
@@ -7,10 +7,10 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
|
7
7
|
/**
|
|
8
8
|
* Component check if there are any headings (core/heading blocks) present in the document.
|
|
9
9
|
*
|
|
10
|
-
* @param {Object}
|
|
11
|
-
* @param {
|
|
10
|
+
* @param {Object} props Props.
|
|
11
|
+
* @param {React.ReactElement} props.children Children to be rendered.
|
|
12
12
|
*
|
|
13
|
-
* @return {
|
|
13
|
+
* @return {React.ReactElement} The component to be rendered or null if there are headings.
|
|
14
14
|
*/
|
|
15
15
|
export default function DocumentOutlineCheck( { children } ) {
|
|
16
16
|
const hasHeadings = useSelect( ( select ) => {
|
|
@@ -19,7 +19,7 @@ export default function DocumentOutlineCheck( { children } ) {
|
|
|
19
19
|
return getGlobalBlockCount( 'core/heading' ) > 0;
|
|
20
20
|
} );
|
|
21
21
|
|
|
22
|
-
if ( hasHeadings ) {
|
|
22
|
+
if ( ! hasHeadings ) {
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
6
|
+
import { useRef } from '@wordpress/element';
|
|
6
7
|
import { create, getTextContent } from '@wordpress/rich-text';
|
|
7
8
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
8
9
|
import { store as coreStore } from '@wordpress/core-data';
|
|
@@ -102,19 +103,17 @@ const isEmptyHeading = ( heading ) =>
|
|
|
102
103
|
* Renders a document outline component.
|
|
103
104
|
*
|
|
104
105
|
* @param {Object} props Props.
|
|
105
|
-
* @param {Function} props.onSelect Function to be called when an outline item is selected
|
|
106
|
-
* @param {boolean} props.isTitleSupported Indicates whether the title is supported.
|
|
106
|
+
* @param {Function} props.onSelect Function to be called when an outline item is selected
|
|
107
107
|
* @param {boolean} props.hasOutlineItemsDisabled Indicates whether the outline items are disabled.
|
|
108
108
|
*
|
|
109
|
-
* @return {
|
|
109
|
+
* @return {React.ReactNode} The rendered component.
|
|
110
110
|
*/
|
|
111
111
|
export default function DocumentOutline( {
|
|
112
112
|
onSelect,
|
|
113
|
-
isTitleSupported,
|
|
114
113
|
hasOutlineItemsDisabled,
|
|
115
114
|
} ) {
|
|
116
115
|
const { selectBlock } = useDispatch( blockEditorStore );
|
|
117
|
-
const { blocks, title } = useSelect( ( select ) => {
|
|
116
|
+
const { blocks, title, isTitleSupported } = useSelect( ( select ) => {
|
|
118
117
|
const { getBlocks } = select( blockEditorStore );
|
|
119
118
|
const { getEditedPostAttribute } = select( editorStore );
|
|
120
119
|
const { getPostType } = select( coreStore );
|
|
@@ -127,6 +126,8 @@ export default function DocumentOutline( {
|
|
|
127
126
|
};
|
|
128
127
|
} );
|
|
129
128
|
|
|
129
|
+
const prevHeadingLevelRef = useRef( 1 );
|
|
130
|
+
|
|
130
131
|
const headings = computeOutlineHeadings( blocks );
|
|
131
132
|
if ( headings.length < 1 ) {
|
|
132
133
|
return (
|
|
@@ -141,8 +142,6 @@ export default function DocumentOutline( {
|
|
|
141
142
|
);
|
|
142
143
|
}
|
|
143
144
|
|
|
144
|
-
let prevHeadingLevel = 1;
|
|
145
|
-
|
|
146
145
|
// Not great but it's the simplest way to locate the title right now.
|
|
147
146
|
const titleNode = document.querySelector( '.editor-post-title__input' );
|
|
148
147
|
const hasTitle = isTitleSupported && title && titleNode;
|
|
@@ -172,7 +171,8 @@ export default function DocumentOutline( {
|
|
|
172
171
|
{ headings.map( ( item, index ) => {
|
|
173
172
|
// Headings remain the same, go up by one, or down by any amount.
|
|
174
173
|
// Otherwise there are missing levels.
|
|
175
|
-
const isIncorrectLevel =
|
|
174
|
+
const isIncorrectLevel =
|
|
175
|
+
item.level > prevHeadingLevelRef.current + 1;
|
|
176
176
|
|
|
177
177
|
const isValid =
|
|
178
178
|
! item.isEmpty &&
|
|
@@ -180,7 +180,7 @@ export default function DocumentOutline( {
|
|
|
180
180
|
!! item.level &&
|
|
181
181
|
( item.level !== 1 ||
|
|
182
182
|
( ! hasMultipleH1 && ! hasTitle ) );
|
|
183
|
-
|
|
183
|
+
prevHeadingLevelRef.current = item.level;
|
|
184
184
|
|
|
185
185
|
return (
|
|
186
186
|
<DocumentOutlineItem
|
|
@@ -60,8 +60,9 @@ function DocumentTools( { className, disableBlockTools = false } ) {
|
|
|
60
60
|
isDistractionFree: get( 'core', 'distractionFree' ),
|
|
61
61
|
isVisualMode: getEditorMode() === 'visual',
|
|
62
62
|
showTools:
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
!! window?.__experimentalEditorWriteMode &&
|
|
64
|
+
( getRenderingMode() !== 'post-only' ||
|
|
65
|
+
getCurrentPostType() === 'wp_template' ),
|
|
65
66
|
};
|
|
66
67
|
}, [] );
|
|
67
68
|
|
|
@@ -50,6 +50,6 @@ function EditorHistoryRedo( props, ref ) {
|
|
|
50
50
|
* @param {Object} props - Props.
|
|
51
51
|
* @param {Ref} ref - Forwarded ref.
|
|
52
52
|
*
|
|
53
|
-
* @return {
|
|
53
|
+
* @return {React.ReactNode} The rendered component.
|
|
54
54
|
*/
|
|
55
55
|
export default forwardRef( EditorHistoryRedo );
|
|
@@ -46,6 +46,6 @@ function EditorHistoryUndo( props, ref ) {
|
|
|
46
46
|
* @param {Object} props - Props.
|
|
47
47
|
* @param {Ref} ref - Forwarded ref.
|
|
48
48
|
*
|
|
49
|
-
* @return {
|
|
49
|
+
* @return {React.ReactNode} The rendered component.
|
|
50
50
|
*/
|
|
51
51
|
export default forwardRef( EditorHistoryUndo );
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { createSlotFill } from '@wordpress/components';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { unlock } from '../../lock-unlock';
|
|
10
|
-
|
|
11
|
-
const { createPrivateSlotFill } = unlock( componentsPrivateApis );
|
|
12
|
-
const SLOT_FILL_NAME = 'EditCanvasContainerSlot';
|
|
13
|
-
const EditorContentSlotFill = createPrivateSlotFill( SLOT_FILL_NAME );
|
|
6
|
+
const EditorContentSlotFill = createSlotFill(
|
|
7
|
+
Symbol( 'EditCanvasContainerSlot' )
|
|
8
|
+
);
|
|
14
9
|
|
|
15
10
|
export default EditorContentSlotFill;
|
|
@@ -10,11 +10,7 @@ import { InterfaceSkeleton, ComplementaryArea } from '@wordpress/interface';
|
|
|
10
10
|
import { useSelect } from '@wordpress/data';
|
|
11
11
|
import { __, _x } from '@wordpress/i18n';
|
|
12
12
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
13
|
-
import {
|
|
14
|
-
store as blockEditorStore,
|
|
15
|
-
BlockBreadcrumb,
|
|
16
|
-
BlockToolbar,
|
|
17
|
-
} from '@wordpress/block-editor';
|
|
13
|
+
import { BlockBreadcrumb, BlockToolbar } from '@wordpress/block-editor';
|
|
18
14
|
import { useViewportMatch } from '@wordpress/compose';
|
|
19
15
|
import { useState, useCallback } from '@wordpress/element';
|
|
20
16
|
|
|
@@ -31,8 +27,6 @@ import TextEditor from '../text-editor';
|
|
|
31
27
|
import VisualEditor from '../visual-editor';
|
|
32
28
|
import EditorContentSlotFill from './content-slot-fill';
|
|
33
29
|
|
|
34
|
-
import { unlock } from '../../lock-unlock';
|
|
35
|
-
|
|
36
30
|
const interfaceLabels = {
|
|
37
31
|
/* translators: accessibility text for the editor top bar landmark region. */
|
|
38
32
|
header: __( 'Editor top bar' ),
|
|
@@ -69,13 +63,11 @@ export default function EditorInterface( {
|
|
|
69
63
|
isPreviewMode,
|
|
70
64
|
showBlockBreadcrumbs,
|
|
71
65
|
documentLabel,
|
|
72
|
-
isZoomOut,
|
|
73
66
|
} = useSelect( ( select ) => {
|
|
74
67
|
const { get } = select( preferencesStore );
|
|
75
68
|
const { getEditorSettings, getPostTypeLabel } = select( editorStore );
|
|
76
69
|
const editorSettings = getEditorSettings();
|
|
77
70
|
const postTypeLabel = getPostTypeLabel();
|
|
78
|
-
const { isZoomOut: _isZoomOut } = unlock( select( blockEditorStore ) );
|
|
79
71
|
|
|
80
72
|
return {
|
|
81
73
|
mode: select( editorStore ).getEditorMode(),
|
|
@@ -88,7 +80,6 @@ export default function EditorInterface( {
|
|
|
88
80
|
documentLabel:
|
|
89
81
|
// translators: Default label for the Document in the Block Breadcrumb.
|
|
90
82
|
postTypeLabel || _x( 'Document', 'noun, breadcrumb' ),
|
|
91
|
-
isZoomOut: _isZoomOut(),
|
|
92
83
|
};
|
|
93
84
|
}, [] );
|
|
94
85
|
const isLargeViewport = useViewportMatch( 'medium' );
|
|
@@ -197,7 +188,6 @@ export default function EditorInterface( {
|
|
|
197
188
|
isLargeViewport &&
|
|
198
189
|
showBlockBreadcrumbs &&
|
|
199
190
|
isRichEditingEnabled &&
|
|
200
|
-
! isZoomOut &&
|
|
201
191
|
mode === 'visual' && (
|
|
202
192
|
<BlockBreadcrumb rootLabelText={ documentLabel } />
|
|
203
193
|
)
|
|
@@ -18,7 +18,7 @@ import TemplateValidationNotice from '../template-validation-notice';
|
|
|
18
18
|
* <EditorNotices />
|
|
19
19
|
* ```
|
|
20
20
|
*
|
|
21
|
-
* @return {
|
|
21
|
+
* @return {React.ReactNode} The rendered EditorNotices component.
|
|
22
22
|
*/
|
|
23
23
|
export function EditorNotices() {
|
|
24
24
|
const { notices } = useSelect(
|
|
@@ -11,7 +11,7 @@ const MAX_VISIBLE_NOTICES = -3;
|
|
|
11
11
|
/**
|
|
12
12
|
* Renders the editor snackbars component.
|
|
13
13
|
*
|
|
14
|
-
* @return {
|
|
14
|
+
* @return {React.ReactNode} The rendered component.
|
|
15
15
|
*/
|
|
16
16
|
export default function EditorSnackbars() {
|
|
17
17
|
const notices = useSelect(
|