@wordpress/editor 14.13.1-next.cd6172eb0.0 → 14.15.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 +4 -0
- package/LICENSE.md +1 -1
- package/README.md +1 -0
- package/build/bindings/pattern-overrides.js +1 -0
- package/build/bindings/pattern-overrides.js.map +1 -1
- package/build/bindings/post-meta.js +1 -0
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/autocompleters/user.js +1 -0
- package/build/components/autocompleters/user.js.map +1 -1
- package/build/components/block-removal-warnings/index.js +1 -0
- package/build/components/block-removal-warnings/index.js.map +1 -1
- package/build/components/block-settings-menu/content-only-settings-menu.js +1 -0
- package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -0
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build/components/collab-sidebar/add-comment.js +1 -1
- package/build/components/collab-sidebar/add-comment.js.map +1 -1
- package/build/components/collab-sidebar/comment-button.js +7 -2
- package/build/components/collab-sidebar/comment-button.js.map +1 -1
- package/build/components/collab-sidebar/comment-form.js +4 -1
- package/build/components/collab-sidebar/comment-form.js.map +1 -1
- package/build/components/collab-sidebar/comments.js +199 -185
- package/build/components/collab-sidebar/comments.js.map +1 -1
- package/build/components/collab-sidebar/index.js +11 -4
- package/build/components/collab-sidebar/index.js.map +1 -1
- package/build/components/collab-sidebar/utils.js +1 -0
- package/build/components/collab-sidebar/utils.js.map +1 -1
- package/build/components/commands/index.js +28 -0
- package/build/components/commands/index.js.map +1 -1
- package/build/components/deprecated.js +1 -0
- package/build/components/deprecated.js.map +1 -1
- package/build/components/document-bar/index.js +5 -2
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-outline/index.js +1 -0
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-tools/index.js +3 -6
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-help/index.native.js +1 -0
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/editor-help/intro-to-blocks.native.js +1 -1
- package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build/components/editor-notices/index.js +1 -0
- package/build/components/editor-notices/index.js.map +1 -1
- package/build/components/editor-snackbars/index.js +1 -0
- package/build/components/editor-snackbars/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js +1 -0
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js +1 -0
- package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build/components/entities-saved-states/index.js +3 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/error-boundary/index.js +26 -13
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/error-boundary/index.native.js +1 -1
- package/build/components/error-boundary/index.native.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +1 -0
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +1 -0
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/list-view-sidebar/index.js +1 -0
- package/build/components/list-view-sidebar/index.js.map +1 -1
- package/build/components/local-autosave-monitor/index.js +1 -0
- package/build/components/local-autosave-monitor/index.js.map +1 -1
- package/build/components/mode-switcher/index.js +1 -0
- package/build/components/mode-switcher/index.js.map +1 -1
- package/build/components/more-menu/index.js +0 -1
- package/build/components/more-menu/index.js.map +1 -1
- package/build/components/page-attributes/parent.js +1 -0
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/post-actions/actions.js +10 -4
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +80 -91
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-actions/set-as-homepage.js +23 -34
- package/build/components/post-actions/set-as-homepage.js.map +1 -1
- package/build/components/post-actions/set-as-posts-page.js +154 -0
- package/build/components/post-actions/set-as-posts-page.js.map +1 -0
- package/build/components/post-author/hook.js +1 -0
- package/build/components/post-author/hook.js.map +1 -1
- package/build/components/post-card-panel/index.js +64 -24
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-fields/index.js +1 -0
- package/build/components/post-fields/index.js.map +1 -1
- package/build/components/post-format/index.js +1 -0
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-format/panel.js +1 -0
- package/build/components/post-format/panel.js.map +1 -1
- package/build/components/post-publish-button/index.js +1 -0
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-category-panel.js +1 -0
- package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +1 -0
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +2 -1
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/post-publish-panel/media-util.js +1 -0
- package/build/components/post-publish-panel/media-util.js.map +1 -1
- package/build/components/post-publish-panel/prepublish.js +1 -1
- package/build/components/post-publish-panel/prepublish.js.map +1 -1
- package/build/components/post-saved-state/index.js +1 -0
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/index.js +1 -0
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +1 -0
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +1 -0
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +1 -0
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js +1 -0
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-template/classic-theme.js +1 -0
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-template/swap-template-button.js +1 -0
- package/build/components/post-template/swap-template-button.js.map +1 -1
- package/build/components/post-transform-panel/hooks.js +1 -0
- package/build/components/post-transform-panel/hooks.js.map +1 -1
- package/build/components/post-type-support-check/index.js +1 -0
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/preferences-modal/block-visibility.js +1 -0
- package/build/components/preferences-modal/block-visibility.js.map +1 -1
- package/build/components/preferences-modal/index.js +3 -4
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +0 -1
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/disable-non-page-content-blocks.js +66 -13
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/index.js +9 -13
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +1 -0
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +4 -1
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/sidebar/index.js +1 -0
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/start-page-options/index.js +20 -106
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/start-template-options/index.js +1 -0
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/template-part-content-panel/index.js +1 -0
- package/build/components/template-part-content-panel/index.js.map +1 -1
- package/build/components/template-part-menu-items/index.js +2 -10
- package/build/components/template-part-menu-items/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +1 -0
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/components/visual-editor/use-select-nearest-editable-block.js +1 -0
- package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build/dataviews/store/private-actions.js +16 -2
- package/build/dataviews/store/private-actions.js.map +1 -1
- package/build/dataviews/store/reducer.js +1 -0
- package/build/dataviews/store/reducer.js.map +1 -1
- package/build/hooks/custom-sources-backwards-compatibility.js +1 -0
- package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build/hooks/pattern-overrides.js +1 -0
- package/build/hooks/pattern-overrides.js.map +1 -1
- package/build/store/actions.js +1 -2
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +1 -3
- package/build/store/constants.js.map +1 -1
- package/build/store/private-actions.js +2 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +1 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +1 -0
- package/build/store/reducer.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 +1 -0
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils/notice-builder.js +3 -8
- package/build/store/utils/notice-builder.js.map +1 -1
- package/build/utils/get-item-title.js +32 -0
- package/build/utils/get-item-title.js.map +1 -0
- package/build/utils/get-template-info.js +1 -0
- package/build/utils/get-template-info.js.map +1 -1
- package/build/utils/media-sideload/index.js +21 -0
- package/build/utils/media-sideload/index.js.map +1 -0
- package/build/utils/media-sideload/index.native.js +8 -0
- package/build/utils/media-sideload/index.native.js.map +1 -0
- package/build/utils/media-upload/index.js +5 -2
- package/build/utils/media-upload/index.js.map +1 -1
- package/build/utils/pageTypeBadge.js +6 -12
- package/build/utils/pageTypeBadge.js.map +1 -1
- package/build/utils/terms.js +1 -0
- package/build/utils/terms.js.map +1 -1
- package/build-module/bindings/pattern-overrides.js +1 -0
- package/build-module/bindings/pattern-overrides.js.map +1 -1
- package/build-module/bindings/post-meta.js +1 -0
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/autocompleters/user.js +1 -0
- package/build-module/components/autocompleters/user.js.map +1 -1
- package/build-module/components/block-removal-warnings/index.js +1 -0
- package/build-module/components/block-removal-warnings/index.js.map +1 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js +1 -0
- package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -0
- 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 +1 -1
- package/build-module/components/collab-sidebar/add-comment.js.map +1 -1
- package/build-module/components/collab-sidebar/comment-button.js +7 -2
- package/build-module/components/collab-sidebar/comment-button.js.map +1 -1
- package/build-module/components/collab-sidebar/comment-form.js +4 -1
- package/build-module/components/collab-sidebar/comment-form.js.map +1 -1
- package/build-module/components/collab-sidebar/comments.js +201 -187
- package/build-module/components/collab-sidebar/comments.js.map +1 -1
- package/build-module/components/collab-sidebar/index.js +11 -4
- package/build-module/components/collab-sidebar/index.js.map +1 -1
- package/build-module/components/collab-sidebar/utils.js +1 -0
- package/build-module/components/collab-sidebar/utils.js.map +1 -1
- package/build-module/components/commands/index.js +28 -0
- package/build-module/components/commands/index.js.map +1 -1
- package/build-module/components/deprecated.js +1 -0
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/document-bar/index.js +5 -2
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-outline/index.js +1 -0
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-tools/index.js +4 -7
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor-help/index.native.js +1 -0
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-help/intro-to-blocks.native.js +1 -1
- package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build-module/components/editor-notices/index.js +1 -0
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js +1 -0
- package/build-module/components/editor-snackbars/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-type-list.js +1 -0
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +1 -0
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +3 -1
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +28 -15
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/error-boundary/index.native.js +2 -2
- package/build-module/components/error-boundary/index.native.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/list-view-sidebar/index.js +1 -0
- package/build-module/components/list-view-sidebar/index.js.map +1 -1
- package/build-module/components/local-autosave-monitor/index.js +1 -0
- package/build-module/components/local-autosave-monitor/index.js.map +1 -1
- package/build-module/components/mode-switcher/index.js +1 -0
- package/build-module/components/mode-switcher/index.js.map +1 -1
- package/build-module/components/more-menu/index.js +0 -1
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +1 -0
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/post-actions/actions.js +10 -4
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +81 -93
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-actions/set-as-homepage.js +22 -33
- package/build-module/components/post-actions/set-as-homepage.js.map +1 -1
- package/build-module/components/post-actions/set-as-posts-page.js +146 -0
- package/build-module/components/post-actions/set-as-posts-page.js.map +1 -0
- package/build-module/components/post-author/hook.js +1 -0
- package/build-module/components/post-author/hook.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +66 -26
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-fields/index.js +1 -0
- package/build-module/components/post-fields/index.js.map +1 -1
- package/build-module/components/post-format/index.js +1 -0
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-format/panel.js +1 -0
- package/build-module/components/post-format/panel.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +1 -0
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js +1 -0
- package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js +1 -0
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js +3 -2
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/post-publish-panel/media-util.js +1 -0
- package/build-module/components/post-publish-panel/media-util.js.map +1 -1
- package/build-module/components/post-publish-panel/prepublish.js +1 -1
- package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +1 -0
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/index.js +1 -0
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +1 -0
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +1 -0
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +1 -0
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +1 -0
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +1 -0
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/swap-template-button.js +1 -0
- package/build-module/components/post-template/swap-template-button.js.map +1 -1
- package/build-module/components/post-transform-panel/hooks.js +1 -0
- package/build-module/components/post-transform-panel/hooks.js.map +1 -1
- package/build-module/components/post-type-support-check/index.js +1 -0
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/preferences-modal/block-visibility.js +1 -0
- package/build-module/components/preferences-modal/block-visibility.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +3 -4
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +0 -1
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js +66 -13
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/provider/index.js +10 -14
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +1 -0
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +4 -1
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/sidebar/index.js +1 -0
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/start-page-options/index.js +21 -106
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +1 -0
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/template-part-content-panel/index.js +1 -0
- package/build-module/components/template-part-content-panel/index.js.map +1 -1
- package/build-module/components/template-part-menu-items/index.js +2 -10
- package/build-module/components/template-part-menu-items/index.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +1 -0
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/components/visual-editor/use-select-nearest-editable-block.js +1 -0
- package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build-module/dataviews/store/private-actions.js +16 -2
- package/build-module/dataviews/store/private-actions.js.map +1 -1
- package/build-module/dataviews/store/reducer.js +1 -0
- package/build-module/dataviews/store/reducer.js.map +1 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js +1 -0
- package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build-module/hooks/pattern-overrides.js +1 -0
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/store/actions.js +1 -2
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +0 -2
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/private-actions.js +2 -1
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +1 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +1 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/reducer.native.js +1 -0
- package/build-module/store/reducer.native.js.map +1 -1
- package/build-module/store/selectors.js +1 -0
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils/notice-builder.js +3 -8
- package/build-module/store/utils/notice-builder.js.map +1 -1
- package/build-module/utils/get-item-title.js +26 -0
- package/build-module/utils/get-item-title.js.map +1 -0
- package/build-module/utils/get-template-info.js +1 -0
- package/build-module/utils/get-template-info.js.map +1 -1
- package/build-module/utils/media-sideload/index.js +14 -0
- package/build-module/utils/media-sideload/index.js.map +1 -0
- package/build-module/utils/media-sideload/index.native.js +2 -0
- package/build-module/utils/media-sideload/index.native.js.map +1 -0
- package/build-module/utils/media-upload/index.js +5 -2
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/build-module/utils/pageTypeBadge.js +6 -12
- package/build-module/utils/pageTypeBadge.js.map +1 -1
- package/build-module/utils/terms.js +1 -0
- package/build-module/utils/terms.js.map +1 -1
- package/build-style/style-rtl.css +26 -27
- package/build-style/style.css +26 -27
- package/build-types/components/autocompleters/user.d.ts +7 -1
- package/build-types/components/autocompleters/user.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comment-button.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comment-form.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comments.d.ts +11 -7
- package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/constants.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
- package/build-types/components/commands/index.d.ts.map +1 -1
- package/build-types/components/document-bar/index.d.ts.map +1 -1
- package/build-types/components/document-tools/index.d.ts.map +1 -1
- package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
- package/build-types/components/error-boundary/index.d.ts.map +1 -1
- package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts +1 -1
- package/build-types/components/media-categories/index.d.ts.map +1 -1
- package/build-types/components/more-menu/index.d.ts.map +1 -1
- package/build-types/components/pattern-duplicate-modal/index.d.ts.map +1 -1
- package/build-types/components/pattern-rename-modal/index.d.ts.map +1 -1
- package/build-types/components/post-actions/actions.d.ts.map +1 -1
- package/build-types/components/post-actions/index.d.ts +5 -0
- package/build-types/components/post-actions/index.d.ts.map +1 -1
- package/build-types/components/post-actions/set-as-homepage.d.ts.map +1 -1
- package/build-types/components/post-actions/set-as-posts-page.d.ts +10 -0
- package/build-types/components/post-actions/set-as-posts-page.d.ts.map +1 -0
- package/build-types/components/post-card-panel/index.d.ts +13 -4
- package/build-types/components/post-card-panel/index.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts +4 -4
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +4 -4
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
- package/build-types/components/post-title/constants.d.ts.map +1 -1
- package/build-types/components/preferences-modal/index.d.ts.map +1 -1
- package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
- package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
- package/build-types/components/start-page-options/index.d.ts +1 -2
- package/build-types/components/start-page-options/index.d.ts.map +1 -1
- package/build-types/dataviews/api.d.ts.map +1 -1
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
- package/build-types/dataviews/store/reducer.d.ts +1 -1
- package/build-types/hooks/custom-sources-backwards-compatibility.d.ts.map +1 -1
- package/build-types/hooks/pattern-overrides.d.ts.map +1 -1
- package/build-types/store/actions.d.ts +7 -9
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/constants.d.ts +0 -2
- package/build-types/store/constants.d.ts.map +1 -1
- package/build-types/store/private-actions.d.ts +1 -1
- package/build-types/store/private-actions.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts +20 -4
- package/build-types/store/private-selectors.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts +1 -1
- package/build-types/store/selectors.d.ts +376 -76
- package/build-types/store/selectors.d.ts.map +1 -1
- package/build-types/store/utils/notice-builder.d.ts.map +1 -1
- package/build-types/utils/get-item-title.d.ts +10 -0
- package/build-types/utils/get-item-title.d.ts.map +1 -0
- package/build-types/utils/media-sideload/index.d.ts +3 -0
- package/build-types/utils/media-sideload/index.d.ts.map +1 -0
- package/build-types/utils/media-upload/index.d.ts +3 -1
- package/build-types/utils/media-upload/index.d.ts.map +1 -1
- package/build-types/utils/pageTypeBadge.d.ts +3 -1
- package/build-types/utils/pageTypeBadge.d.ts.map +1 -1
- package/package.json +37 -37
- package/src/components/collab-sidebar/add-comment.js +1 -1
- package/src/components/collab-sidebar/comment-button.js +12 -7
- package/src/components/collab-sidebar/comment-form.js +4 -1
- package/src/components/collab-sidebar/comments.js +260 -243
- package/src/components/collab-sidebar/index.js +10 -2
- package/src/components/collab-sidebar/style.scss +10 -1
- package/src/components/commands/index.js +29 -0
- package/src/components/document-bar/index.js +5 -2
- package/src/components/document-tools/index.js +3 -6
- package/src/components/document-tools/style.scss +0 -6
- package/src/components/editor-help/intro-to-blocks.native.js +1 -1
- package/src/components/entities-saved-states/index.js +5 -1
- package/src/components/error-boundary/index.js +30 -16
- package/src/components/error-boundary/index.native.js +2 -2
- package/src/components/error-boundary/style.scss +5 -1
- package/src/components/more-menu/index.js +0 -1
- package/src/components/post-actions/actions.js +12 -4
- package/src/components/post-actions/index.js +90 -94
- package/src/components/post-actions/set-as-homepage.js +29 -45
- package/src/components/post-actions/set-as-posts-page.js +164 -0
- package/src/components/post-card-panel/index.js +71 -33
- package/src/components/post-card-panel/style.scss +8 -12
- package/src/components/post-publish-panel/maybe-upload-media.js +2 -2
- package/src/components/post-publish-panel/prepublish.js +1 -1
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
- package/src/components/preferences-modal/index.js +8 -13
- package/src/components/preview-dropdown/index.js +0 -1
- package/src/components/provider/disable-non-page-content-blocks.js +64 -13
- package/src/components/provider/index.js +13 -27
- package/src/components/provider/use-block-editor-settings.js +3 -0
- package/src/components/start-page-options/index.js +28 -119
- package/src/components/template-part-menu-items/index.js +2 -11
- package/src/dataviews/store/private-actions.ts +23 -8
- package/src/store/actions.js +0 -2
- package/src/store/constants.ts +0 -2
- package/src/store/private-actions.js +1 -1
- package/src/store/utils/notice-builder.js +3 -8
- package/src/store/utils/test/notice-builder.js +3 -4
- package/src/utils/get-item-title.js +25 -0
- package/src/utils/media-sideload/index.js +13 -0
- package/src/utils/media-sideload/index.native.js +1 -0
- package/src/utils/media-upload/index.js +4 -1
- package/src/utils/pageTypeBadge.js +7 -10
- package/tsconfig.json +1 -4
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
Tooltip,
|
|
17
17
|
} from '@wordpress/components';
|
|
18
18
|
import { Icon, check, published, moreVertical } from '@wordpress/icons';
|
|
19
|
-
import { __, _x } from '@wordpress/i18n';
|
|
19
|
+
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
20
20
|
import { useSelect } from '@wordpress/data';
|
|
21
21
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
22
22
|
|
|
@@ -29,12 +29,14 @@ import CommentForm from './comment-form';
|
|
|
29
29
|
/**
|
|
30
30
|
* Renders the Comments component.
|
|
31
31
|
*
|
|
32
|
-
* @param {Object} props
|
|
33
|
-
* @param {Array} props.threads
|
|
34
|
-
* @param {Function} props.onEditComment
|
|
35
|
-
* @param {Function} props.onAddReply
|
|
36
|
-
* @param {Function} props.onCommentDelete
|
|
37
|
-
* @param {Function} props.onCommentResolve
|
|
32
|
+
* @param {Object} props - The component props.
|
|
33
|
+
* @param {Array} props.threads - The array of comment threads.
|
|
34
|
+
* @param {Function} props.onEditComment - The function to handle comment editing.
|
|
35
|
+
* @param {Function} props.onAddReply - The function to add a reply to a comment.
|
|
36
|
+
* @param {Function} props.onCommentDelete - The function to delete a comment.
|
|
37
|
+
* @param {Function} props.onCommentResolve - The function to mark a comment as resolved.
|
|
38
|
+
* @param {boolean} props.showCommentBoard - Whether to show the comment board.
|
|
39
|
+
* @param {Function} props.setShowCommentBoard - The function to set the comment board visibility.
|
|
38
40
|
* @return {React.ReactNode} The rendered Comments component.
|
|
39
41
|
*/
|
|
40
42
|
export function Comments( {
|
|
@@ -43,129 +45,28 @@ export function Comments( {
|
|
|
43
45
|
onAddReply,
|
|
44
46
|
onCommentDelete,
|
|
45
47
|
onCommentResolve,
|
|
48
|
+
showCommentBoard,
|
|
49
|
+
setShowCommentBoard,
|
|
46
50
|
} ) {
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
onCommentDelete( actionState.id );
|
|
52
|
-
setActionState( false );
|
|
53
|
-
setIsConfirmDialogOpen( false );
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const handleConfirmResolve = () => {
|
|
57
|
-
onCommentResolve( actionState.id );
|
|
58
|
-
setActionState( false );
|
|
59
|
-
setIsConfirmDialogOpen( false );
|
|
60
|
-
};
|
|
51
|
+
const { blockCommentId } = useSelect( ( select ) => {
|
|
52
|
+
const { getBlockAttributes, getSelectedBlockClientId } =
|
|
53
|
+
select( blockEditorStore );
|
|
54
|
+
const _clientId = getSelectedBlockClientId();
|
|
61
55
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const blockCommentId = useSelect( ( select ) => {
|
|
68
|
-
const clientID = select( blockEditorStore ).getSelectedBlockClientId();
|
|
69
|
-
return (
|
|
70
|
-
select( blockEditorStore ).getBlock( clientID )?.attributes
|
|
71
|
-
?.blockCommentId ?? false
|
|
72
|
-
);
|
|
56
|
+
return {
|
|
57
|
+
blockCommentId: _clientId
|
|
58
|
+
? getBlockAttributes( _clientId )?.blockCommentId
|
|
59
|
+
: null,
|
|
60
|
+
};
|
|
73
61
|
}, [] );
|
|
74
62
|
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
action: 'resolve',
|
|
83
|
-
id: parentThread?.id ?? thread.id,
|
|
84
|
-
} );
|
|
85
|
-
setIsConfirmDialogOpen( true );
|
|
86
|
-
} }
|
|
87
|
-
onEdit={ () =>
|
|
88
|
-
setActionState( { action: 'edit', id: thread.id } )
|
|
89
|
-
}
|
|
90
|
-
onDelete={ () => {
|
|
91
|
-
setActionState( { action: 'delete', id: thread.id } );
|
|
92
|
-
setIsConfirmDialogOpen( true );
|
|
93
|
-
} }
|
|
94
|
-
onReply={
|
|
95
|
-
! parentThread
|
|
96
|
-
? () =>
|
|
97
|
-
setActionState( {
|
|
98
|
-
action: 'reply',
|
|
99
|
-
id: thread.id,
|
|
100
|
-
} )
|
|
101
|
-
: undefined
|
|
102
|
-
}
|
|
103
|
-
status={ parentThread?.status ?? thread.status }
|
|
104
|
-
/>
|
|
105
|
-
<HStack
|
|
106
|
-
alignment="left"
|
|
107
|
-
spacing="3"
|
|
108
|
-
justify="flex-start"
|
|
109
|
-
className="editor-collab-sidebar-panel__user-comment"
|
|
110
|
-
>
|
|
111
|
-
<VStack
|
|
112
|
-
spacing="3"
|
|
113
|
-
className="editor-collab-sidebar-panel__comment-field"
|
|
114
|
-
>
|
|
115
|
-
{ 'edit' === actionState?.action &&
|
|
116
|
-
thread.id === actionState?.id && (
|
|
117
|
-
<CommentForm
|
|
118
|
-
onSubmit={ ( value ) => {
|
|
119
|
-
onEditComment( thread.id, value );
|
|
120
|
-
setActionState( false );
|
|
121
|
-
} }
|
|
122
|
-
onCancel={ () => setActionState( false ) }
|
|
123
|
-
thread={ thread }
|
|
124
|
-
submitButtonText={ _x( 'Update', 'verb' ) }
|
|
125
|
-
/>
|
|
126
|
-
) }
|
|
127
|
-
{ ( ! actionState ||
|
|
128
|
-
'edit' !== actionState?.action ) && (
|
|
129
|
-
<RawHTML>{ thread?.content?.raw }</RawHTML>
|
|
130
|
-
) }
|
|
131
|
-
</VStack>
|
|
132
|
-
</HStack>
|
|
133
|
-
{ 'resolve' === actionState?.action &&
|
|
134
|
-
thread.id === actionState?.id && (
|
|
135
|
-
<ConfirmDialog
|
|
136
|
-
isOpen={ isConfirmDialogOpen }
|
|
137
|
-
onConfirm={ handleConfirmResolve }
|
|
138
|
-
onCancel={ handleCancelDelete }
|
|
139
|
-
confirmButtonText="Yes"
|
|
140
|
-
cancelButtonText="No"
|
|
141
|
-
>
|
|
142
|
-
{
|
|
143
|
-
// translators: message displayed when confirming an action
|
|
144
|
-
__(
|
|
145
|
-
'Are you sure you want to mark this comment as resolved?'
|
|
146
|
-
)
|
|
147
|
-
}
|
|
148
|
-
</ConfirmDialog>
|
|
149
|
-
) }
|
|
150
|
-
{ 'delete' === actionState?.action &&
|
|
151
|
-
thread.id === actionState?.id && (
|
|
152
|
-
<ConfirmDialog
|
|
153
|
-
isOpen={ isConfirmDialogOpen }
|
|
154
|
-
onConfirm={ handleConfirmDelete }
|
|
155
|
-
onCancel={ handleCancelDelete }
|
|
156
|
-
confirmButtonText="Yes"
|
|
157
|
-
cancelButtonText="No"
|
|
158
|
-
>
|
|
159
|
-
{
|
|
160
|
-
// translators: message displayed when confirming an action
|
|
161
|
-
__(
|
|
162
|
-
'Are you sure you want to delete this comment?'
|
|
163
|
-
)
|
|
164
|
-
}
|
|
165
|
-
</ConfirmDialog>
|
|
166
|
-
) }
|
|
167
|
-
</>
|
|
168
|
-
);
|
|
63
|
+
const [ focusThread, setFocusThread ] = useState(
|
|
64
|
+
showCommentBoard && blockCommentId ? blockCommentId : null
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
const clearThreadFocus = () => {
|
|
68
|
+
setFocusThread( null );
|
|
69
|
+
setShowCommentBoard( false );
|
|
169
70
|
};
|
|
170
71
|
|
|
171
72
|
return (
|
|
@@ -186,7 +87,6 @@ export function Comments( {
|
|
|
186
87
|
</VStack>
|
|
187
88
|
)
|
|
188
89
|
}
|
|
189
|
-
|
|
190
90
|
{ Array.isArray( threads ) &&
|
|
191
91
|
threads.length > 0 &&
|
|
192
92
|
threads.map( ( thread ) => (
|
|
@@ -198,145 +98,262 @@ export function Comments( {
|
|
|
198
98
|
'editor-collab-sidebar-panel__active-thread':
|
|
199
99
|
blockCommentId &&
|
|
200
100
|
blockCommentId === thread.id,
|
|
101
|
+
'editor-collab-sidebar-panel__focus-thread':
|
|
102
|
+
focusThread && focusThread === thread.id,
|
|
201
103
|
}
|
|
202
104
|
) }
|
|
203
105
|
id={ thread.id }
|
|
204
106
|
spacing="3"
|
|
107
|
+
onClick={ () => setFocusThread( thread.id ) }
|
|
205
108
|
>
|
|
206
|
-
<
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
109
|
+
<Thread
|
|
110
|
+
thread={ thread }
|
|
111
|
+
onAddReply={ onAddReply }
|
|
112
|
+
onCommentDelete={ onCommentDelete }
|
|
113
|
+
onCommentResolve={ onCommentResolve }
|
|
114
|
+
onEditComment={ onEditComment }
|
|
115
|
+
isFocused={ focusThread === thread.id }
|
|
116
|
+
clearThreadFocus={ clearThreadFocus }
|
|
117
|
+
/>
|
|
118
|
+
</VStack>
|
|
119
|
+
) ) }
|
|
120
|
+
</>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function Thread( {
|
|
125
|
+
thread,
|
|
126
|
+
onEditComment,
|
|
127
|
+
onAddReply,
|
|
128
|
+
onCommentDelete,
|
|
129
|
+
onCommentResolve,
|
|
130
|
+
isFocused,
|
|
131
|
+
clearThreadFocus,
|
|
132
|
+
} ) {
|
|
133
|
+
return (
|
|
134
|
+
<>
|
|
135
|
+
<CommentBoard
|
|
136
|
+
thread={ thread }
|
|
137
|
+
onResolve={ onCommentResolve }
|
|
138
|
+
onEdit={ onEditComment }
|
|
139
|
+
onDelete={ onCommentDelete }
|
|
140
|
+
status={ thread.status }
|
|
141
|
+
/>
|
|
142
|
+
{ 0 < thread?.reply?.length && (
|
|
143
|
+
<>
|
|
144
|
+
{ ! isFocused && (
|
|
145
|
+
<VStack className="editor-collab-sidebar-panel__show-more-reply">
|
|
146
|
+
{ sprintf(
|
|
147
|
+
// translators: 1: number of replies.
|
|
148
|
+
_x(
|
|
149
|
+
'%s more replies..',
|
|
150
|
+
'Show replies button'
|
|
151
|
+
),
|
|
152
|
+
thread?.reply?.length
|
|
153
|
+
) }
|
|
154
|
+
</VStack>
|
|
155
|
+
) }
|
|
156
|
+
|
|
157
|
+
{ isFocused &&
|
|
158
|
+
thread.reply.map( ( reply ) => (
|
|
159
|
+
<VStack
|
|
160
|
+
key={ reply.id }
|
|
161
|
+
className="editor-collab-sidebar-panel__child-thread"
|
|
162
|
+
id={ reply.id }
|
|
163
|
+
spacing="2"
|
|
164
|
+
>
|
|
165
|
+
{ 'approved' !== thread.status && (
|
|
215
166
|
<CommentBoard
|
|
216
167
|
thread={ reply }
|
|
217
|
-
|
|
168
|
+
onEdit={ onEditComment }
|
|
169
|
+
onDelete={ onCommentDelete }
|
|
218
170
|
/>
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
'Reply',
|
|
251
|
-
'Add reply comment'
|
|
252
|
-
) }
|
|
253
|
-
/>
|
|
254
|
-
</VStack>
|
|
255
|
-
</VStack>
|
|
171
|
+
) }
|
|
172
|
+
{ 'approved' === thread.status && (
|
|
173
|
+
<CommentBoard thread={ reply } />
|
|
174
|
+
) }
|
|
175
|
+
</VStack>
|
|
176
|
+
) ) }
|
|
177
|
+
</>
|
|
178
|
+
) }
|
|
179
|
+
{ 'approved' !== thread.status && isFocused && (
|
|
180
|
+
<VStack
|
|
181
|
+
className="editor-collab-sidebar-panel__child-thread"
|
|
182
|
+
spacing="2"
|
|
183
|
+
>
|
|
184
|
+
<HStack alignment="left" spacing="3" justify="flex-start">
|
|
185
|
+
<CommentAuthorInfo />
|
|
186
|
+
</HStack>
|
|
187
|
+
<VStack
|
|
188
|
+
spacing="3"
|
|
189
|
+
className="editor-collab-sidebar-panel__comment-field"
|
|
190
|
+
>
|
|
191
|
+
<CommentForm
|
|
192
|
+
onSubmit={ ( inputComment ) => {
|
|
193
|
+
onAddReply( inputComment, thread.id );
|
|
194
|
+
} }
|
|
195
|
+
onCancel={ ( event ) => {
|
|
196
|
+
event.stopPropagation(); // Prevent the parent onClick from being triggered
|
|
197
|
+
clearThreadFocus();
|
|
198
|
+
} }
|
|
199
|
+
submitButtonText={ _x(
|
|
200
|
+
'Reply',
|
|
201
|
+
'Add reply comment'
|
|
256
202
|
) }
|
|
203
|
+
/>
|
|
257
204
|
</VStack>
|
|
258
|
-
|
|
205
|
+
</VStack>
|
|
206
|
+
) }
|
|
259
207
|
</>
|
|
260
208
|
);
|
|
261
209
|
}
|
|
262
210
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}
|
|
211
|
+
const CommentBoard = ( { thread, onResolve, onEdit, onDelete, status } ) => {
|
|
212
|
+
const [ actionState, setActionState ] = useState( false );
|
|
213
|
+
const [ showConfirmDialog, setShowConfirmDialog ] = useState( false );
|
|
214
|
+
|
|
215
|
+
const handleConfirmDelete = () => {
|
|
216
|
+
onDelete( thread.id );
|
|
217
|
+
setActionState( false );
|
|
218
|
+
setShowConfirmDialog( false );
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
const handleConfirmResolve = () => {
|
|
222
|
+
onResolve( thread.id );
|
|
223
|
+
setActionState( false );
|
|
224
|
+
setShowConfirmDialog( false );
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
const handleCancel = () => {
|
|
228
|
+
setActionState( false );
|
|
229
|
+
setShowConfirmDialog( false );
|
|
230
|
+
};
|
|
231
|
+
|
|
283
232
|
const actions = [
|
|
284
|
-
{
|
|
233
|
+
onEdit && {
|
|
285
234
|
title: _x( 'Edit', 'Edit comment' ),
|
|
286
|
-
onClick:
|
|
235
|
+
onClick: () => {
|
|
236
|
+
setActionState( 'edit' );
|
|
237
|
+
},
|
|
287
238
|
},
|
|
288
|
-
{
|
|
239
|
+
onDelete && {
|
|
289
240
|
title: _x( 'Delete', 'Delete comment' ),
|
|
290
|
-
onClick:
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
onClick: onReply,
|
|
241
|
+
onClick: () => {
|
|
242
|
+
setActionState( 'delete' );
|
|
243
|
+
setShowConfirmDialog( true );
|
|
244
|
+
},
|
|
295
245
|
},
|
|
296
246
|
];
|
|
297
247
|
|
|
298
|
-
const moreActions = actions.filter( ( item ) => item
|
|
248
|
+
const moreActions = actions.filter( ( item ) => item?.onClick );
|
|
299
249
|
|
|
300
250
|
return (
|
|
301
|
-
|
|
302
|
-
<
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
251
|
+
<>
|
|
252
|
+
<HStack alignment="left" spacing="3" justify="flex-start">
|
|
253
|
+
<CommentAuthorInfo
|
|
254
|
+
avatar={ thread?.author_avatar_urls?.[ 48 ] }
|
|
255
|
+
name={ thread?.author_name }
|
|
256
|
+
date={ thread?.date }
|
|
257
|
+
/>
|
|
258
|
+
<span className="editor-collab-sidebar-panel__comment-status">
|
|
259
|
+
{ status !== 'approved' && (
|
|
260
|
+
<HStack
|
|
261
|
+
alignment="right"
|
|
262
|
+
justify="flex-end"
|
|
263
|
+
spacing="0"
|
|
264
|
+
>
|
|
265
|
+
{ 0 === thread?.parent && onResolve && (
|
|
266
|
+
<Button
|
|
267
|
+
label={ _x(
|
|
268
|
+
'Resolve',
|
|
269
|
+
'Mark comment as resolved'
|
|
270
|
+
) }
|
|
271
|
+
__next40pxDefaultSize
|
|
272
|
+
icon={ published }
|
|
273
|
+
onClick={ () => {
|
|
274
|
+
setActionState( 'resolve' );
|
|
275
|
+
setShowConfirmDialog( true );
|
|
276
|
+
} }
|
|
277
|
+
showTooltip
|
|
278
|
+
/>
|
|
279
|
+
) }
|
|
280
|
+
{ 0 < moreActions.length && (
|
|
281
|
+
<DropdownMenu
|
|
282
|
+
icon={ moreVertical }
|
|
283
|
+
label={ _x(
|
|
284
|
+
'Select an action',
|
|
285
|
+
'Select comment action'
|
|
286
|
+
) }
|
|
287
|
+
className="editor-collab-sidebar-panel__comment-dropdown-menu"
|
|
288
|
+
controls={ moreActions }
|
|
289
|
+
/>
|
|
327
290
|
) }
|
|
328
|
-
|
|
329
|
-
|
|
291
|
+
</HStack>
|
|
292
|
+
) }
|
|
293
|
+
{ status === 'approved' && (
|
|
294
|
+
// translators: tooltip for resolved comment
|
|
295
|
+
<Tooltip text={ __( 'Resolved' ) }>
|
|
296
|
+
<Icon icon={ check } />
|
|
297
|
+
</Tooltip>
|
|
298
|
+
) }
|
|
299
|
+
</span>
|
|
300
|
+
</HStack>
|
|
301
|
+
<HStack
|
|
302
|
+
alignment="left"
|
|
303
|
+
spacing="3"
|
|
304
|
+
justify="flex-start"
|
|
305
|
+
className="editor-collab-sidebar-panel__user-comment"
|
|
306
|
+
>
|
|
307
|
+
<VStack
|
|
308
|
+
spacing="3"
|
|
309
|
+
className="editor-collab-sidebar-panel__comment-field"
|
|
310
|
+
>
|
|
311
|
+
{ 'edit' === actionState && (
|
|
312
|
+
<CommentForm
|
|
313
|
+
onSubmit={ ( value ) => {
|
|
314
|
+
onEdit( thread.id, value );
|
|
315
|
+
setActionState( false );
|
|
316
|
+
} }
|
|
317
|
+
onCancel={ () => handleCancel() }
|
|
318
|
+
thread={ thread }
|
|
319
|
+
submitButtonText={ _x( 'Update', 'verb' ) }
|
|
330
320
|
/>
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
321
|
+
) }
|
|
322
|
+
{ 'edit' !== actionState && (
|
|
323
|
+
<RawHTML>{ thread?.content?.raw }</RawHTML>
|
|
324
|
+
) }
|
|
325
|
+
</VStack>
|
|
326
|
+
</HStack>
|
|
327
|
+
{ 'resolve' === actionState && (
|
|
328
|
+
<ConfirmDialog
|
|
329
|
+
isOpen={ showConfirmDialog }
|
|
330
|
+
onConfirm={ handleConfirmResolve }
|
|
331
|
+
onCancel={ handleCancel }
|
|
332
|
+
confirmButtonText="Yes"
|
|
333
|
+
cancelButtonText="No"
|
|
334
|
+
>
|
|
335
|
+
{
|
|
336
|
+
// translators: message displayed when confirming an action
|
|
337
|
+
__(
|
|
338
|
+
'Are you sure you want to mark this comment as resolved?'
|
|
339
|
+
)
|
|
340
|
+
}
|
|
341
|
+
</ConfirmDialog>
|
|
342
|
+
) }
|
|
343
|
+
{ 'delete' === actionState && (
|
|
344
|
+
<ConfirmDialog
|
|
345
|
+
isOpen={ showConfirmDialog }
|
|
346
|
+
onConfirm={ handleConfirmDelete }
|
|
347
|
+
onCancel={ handleCancel }
|
|
348
|
+
confirmButtonText="Yes"
|
|
349
|
+
cancelButtonText="No"
|
|
350
|
+
>
|
|
351
|
+
{
|
|
352
|
+
// translators: message displayed when confirming an action
|
|
353
|
+
__( 'Are you sure you want to delete this comment?' )
|
|
354
|
+
}
|
|
355
|
+
</ConfirmDialog>
|
|
356
|
+
) }
|
|
357
|
+
</>
|
|
341
358
|
);
|
|
342
|
-
}
|
|
359
|
+
};
|
|
@@ -203,11 +203,14 @@ function CollabSidebarContent( {
|
|
|
203
203
|
setShowCommentBoard={ setShowCommentBoard }
|
|
204
204
|
/>
|
|
205
205
|
<Comments
|
|
206
|
+
key={ getSelectedBlockClientId() }
|
|
206
207
|
threads={ comments }
|
|
207
208
|
onEditComment={ onEditComment }
|
|
208
209
|
onAddReply={ addNewComment }
|
|
209
210
|
onCommentDelete={ onCommentDelete }
|
|
210
211
|
onCommentResolve={ onCommentResolve }
|
|
212
|
+
showCommentBoard={ showCommentBoard }
|
|
213
|
+
setShowCommentBoard={ setShowCommentBoard }
|
|
211
214
|
/>
|
|
212
215
|
</div>
|
|
213
216
|
);
|
|
@@ -293,17 +296,22 @@ export default function CollabSidebar() {
|
|
|
293
296
|
return { resultComments: [], sortedThreads: [] };
|
|
294
297
|
}
|
|
295
298
|
|
|
299
|
+
const updatedResult = result.map( ( item ) => ( {
|
|
300
|
+
...item,
|
|
301
|
+
reply: [ ...item.reply ].reverse(),
|
|
302
|
+
} ) );
|
|
303
|
+
|
|
296
304
|
const blockCommentIds = getCommentIdsFromBlocks( blocks );
|
|
297
305
|
|
|
298
306
|
const threadIdMap = new Map(
|
|
299
|
-
|
|
307
|
+
updatedResult.map( ( thread ) => [ thread.id, thread ] )
|
|
300
308
|
);
|
|
301
309
|
|
|
302
310
|
const sortedComments = blockCommentIds
|
|
303
311
|
.map( ( id ) => threadIdMap.get( id ) )
|
|
304
312
|
.filter( ( thread ) => thread !== undefined );
|
|
305
313
|
|
|
306
|
-
return { resultComments:
|
|
314
|
+
return { resultComments: updatedResult, sortedThreads: sortedComments };
|
|
307
315
|
}, [ threads, blocks ] );
|
|
308
316
|
|
|
309
317
|
// Get the global styles to set the background color of the sidebar.
|
|
@@ -18,13 +18,17 @@
|
|
|
18
18
|
position: relative;
|
|
19
19
|
padding: $grid-unit-20;
|
|
20
20
|
border-radius: $radius-large;
|
|
21
|
-
border:
|
|
21
|
+
border: 1.5px solid $gray-300;
|
|
22
22
|
background-color: $gray-100;
|
|
23
23
|
margin-bottom: $grid-unit-20;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
&__active-thread {
|
|
27
27
|
border: 1.5px solid #3858e9;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&__focus-thread {
|
|
31
|
+
border: 1.5px solid #3858e9;
|
|
28
32
|
background-color: $white;
|
|
29
33
|
box-shadow: 0 5.5px 7.8px -0.3px rgba(0, 0, 0, 0.102);
|
|
30
34
|
}
|
|
@@ -121,4 +125,9 @@
|
|
|
121
125
|
}
|
|
122
126
|
}
|
|
123
127
|
|
|
128
|
+
&__show-more-reply {
|
|
129
|
+
font-weight: 500;
|
|
130
|
+
font-style: italic;
|
|
131
|
+
padding: 0;
|
|
132
|
+
}
|
|
124
133
|
}
|
|
@@ -25,6 +25,7 @@ import { store as noticesStore } from '@wordpress/notices';
|
|
|
25
25
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
26
26
|
import { store as coreStore, useEntityRecord } from '@wordpress/core-data';
|
|
27
27
|
import { store as interfaceStore } from '@wordpress/interface';
|
|
28
|
+
import { getPath } from '@wordpress/url';
|
|
28
29
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
29
30
|
|
|
30
31
|
/**
|
|
@@ -90,6 +91,19 @@ const getEditorCommandLoader = () =>
|
|
|
90
91
|
const { openModal, enableComplementaryArea, disableComplementaryArea } =
|
|
91
92
|
useDispatch( interfaceStore );
|
|
92
93
|
const { getCurrentPostId } = useSelect( editorStore );
|
|
94
|
+
const { isBlockBasedTheme, canCreateTemplate } = useSelect(
|
|
95
|
+
( select ) => {
|
|
96
|
+
return {
|
|
97
|
+
isBlockBasedTheme:
|
|
98
|
+
select( coreStore ).getCurrentTheme()?.is_block_theme,
|
|
99
|
+
canCreateTemplate: select( coreStore ).canUser( 'create', {
|
|
100
|
+
kind: 'postType',
|
|
101
|
+
name: 'wp_template',
|
|
102
|
+
} ),
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
[]
|
|
106
|
+
);
|
|
93
107
|
const allowSwitchEditorMode =
|
|
94
108
|
isCodeEditingEnabled && isRichEditingEnabled;
|
|
95
109
|
|
|
@@ -271,6 +285,21 @@ const getEditorCommandLoader = () =>
|
|
|
271
285
|
},
|
|
272
286
|
} );
|
|
273
287
|
}
|
|
288
|
+
if ( canCreateTemplate && isBlockBasedTheme ) {
|
|
289
|
+
const isSiteEditor = getPath( window.location.href )?.includes(
|
|
290
|
+
'site-editor.php'
|
|
291
|
+
);
|
|
292
|
+
if ( ! isSiteEditor ) {
|
|
293
|
+
commands.push( {
|
|
294
|
+
name: 'core/go-to-site-editor',
|
|
295
|
+
label: __( 'Open Site Editor' ),
|
|
296
|
+
callback: ( { close } ) => {
|
|
297
|
+
close();
|
|
298
|
+
document.location = 'site-editor.php';
|
|
299
|
+
},
|
|
300
|
+
} );
|
|
301
|
+
}
|
|
302
|
+
}
|
|
274
303
|
|
|
275
304
|
return {
|
|
276
305
|
commands,
|