@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BlockSettingsMenuControls","MenuItem","compose","jsx","_jsx","isEverySelectedBlockAllowed","selected","allowed","filter","id","includes","length","shouldRenderItem","selectedBlocks","allowedBlocks","Array","isArray","PluginBlockSettingsMenuItem","icon","label","onClick","small","role","children","onClose","undefined"],"sources":["@wordpress/editor/src/components/block-settings-menu/plugin-block-settings-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockSettingsMenuControls } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\n\nconst isEverySelectedBlockAllowed = ( selected, allowed ) =>\n\tselected.filter( ( id ) => ! allowed.includes( id ) ).length === 0;\n\n/**\n * Plugins may want to add an item to the menu either for every block\n * or only for the specific ones provided in the `allowedBlocks` component property.\n *\n * If there are multiple blocks selected the item will be rendered if every block\n * is of one allowed type (not necessarily the same).\n *\n * @param {string[]} selectedBlocks Array containing the names of the blocks selected\n * @param {string[]} allowedBlocks Array containing the names of the blocks allowed\n * @return {boolean} Whether the item will be rendered or not.\n */\nconst shouldRenderItem = ( selectedBlocks, allowedBlocks ) =>\n\t! Array.isArray( allowedBlocks ) ||\n\tisEverySelectedBlockAllowed( selectedBlocks, allowedBlocks );\n\n/**\n * Renders a new item in the block settings menu.\n *\n * @param {Object} props Component props.\n * @param {Array} [props.allowedBlocks] An array containing a list of block names for which the item should be shown. If not present, it'll be rendered for any block. If multiple blocks are selected, it'll be shown if and only if all of them are in the allowed list.\n * @param {WPBlockTypeIconRender} [props.icon] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.\n * @param {string} props.label The menu item text.\n * @param {Function} props.onClick Callback function to be executed when the user click the menu item.\n * @param {boolean} [props.small] Whether to render the label or not.\n * @param {string} [props.role] The ARIA role for the menu item.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginBlockSettingsMenuItem = wp.editor.PluginBlockSettingsMenuItem;\n *\n * function doOnClick(){\n * \t// To be called when the user clicks the menu item.\n * }\n *\n * function MyPluginBlockSettingsMenuItem() {\n * \treturn React.createElement(\n * \t\tPluginBlockSettingsMenuItem,\n * \t\t{\n * \t\t\tallowedBlocks: [ 'core/paragraph' ],\n * \t\t\ticon: 'dashicon-name',\n * \t\t\tlabel: __( 'Menu item text' ),\n * \t\t\tonClick: doOnClick,\n * \t\t}\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginBlockSettingsMenuItem } from '@wordpress/editor';\n *\n * const doOnClick = ( ) => {\n * // To be called when the user clicks the menu item.\n * };\n *\n * const MyPluginBlockSettingsMenuItem = () => (\n * <PluginBlockSettingsMenuItem\n * \t\tallowedBlocks={ [ 'core/paragraph' ] }\n * \t\ticon='dashicon-name'\n * \t\tlabel={ __( 'Menu item text' ) }\n * \t\tonClick={ doOnClick } />\n * );\n * ```\n *\n * @return {React.ReactNode} The rendered component.\n */\nconst PluginBlockSettingsMenuItem = ( {\n\tallowedBlocks,\n\ticon,\n\tlabel,\n\tonClick,\n\tsmall,\n\trole,\n} ) => (\n\t<BlockSettingsMenuControls>\n\t\t{ ( { selectedBlocks, onClose } ) => {\n\t\t\tif ( ! shouldRenderItem( selectedBlocks, allowedBlocks ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ compose( onClick, onClose ) }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ small ? label : undefined }\n\t\t\t\t\trole={ role }\n\t\t\t\t>\n\t\t\t\t\t{ ! small && label }\n\t\t\t\t</MenuItem>\n\t\t\t);\n\t\t} }\n\t</BlockSettingsMenuControls>\n);\n\nexport default PluginBlockSettingsMenuItem;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,yBAAyB,QAAQ,yBAAyB;AACnE,SAASC,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,OAAO,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE7C,MAAMC,2BAA2B,GAAGA,CAAEC,QAAQ,EAAEC,OAAO,KACtDD,QAAQ,CAACE,MAAM,CAAIC,EAAE,IAAM,CAAEF,OAAO,CAACG,QAAQ,CAAED,EAAG,CAAE,CAAC,CAACE,MAAM,KAAK,CAAC;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAAEC,cAAc,EAAEC,aAAa,KACvD,CAAEC,KAAK,CAACC,OAAO,CAAEF,aAAc,CAAC,IAChCT,2BAA2B,CAAEQ,cAAc,EAAEC,aAAc,CAAC;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,2BAA2B,GAAGA,CAAE;EACrCH,aAAa;EACbI,IAAI;EACJC,KAAK;EACLC,OAAO;EACPC,KAAK;EACLC;AACD,CAAC,kBACAlB,IAAA,CAACJ,yBAAyB;EAAAuB,QAAA,EACvBA,CAAE;IAAEV,cAAc;IAAEW;EAAQ,CAAC,KAAM;IACpC,IAAK,CAAEZ,gBAAgB,CAAEC,cAAc,EAAEC,aAAc,CAAC,EAAG;MAC1D,OAAO,IAAI;IACZ;IACA,oBACCV,IAAA,CAACH,QAAQ;MACRmB,OAAO,EAAGlB,OAAO,CAAEkB,OAAO,EAAEI,OAAQ,CAAG;MACvCN,IAAI,EAAGA,IAAM;MACbC,KAAK,EAAGE,KAAK,GAAGF,KAAK,GAAGM,SAAW;MACnCH,IAAI,EAAGA,IAAM;MAAAC,QAAA,EAEX,CAAEF,KAAK,IAAIF;IAAK,CACT,CAAC;EAEb;AAAC,CACyB,CAC3B;AAED,eAAeF,2BAA2B","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["BlockSettingsMenuControls","MenuItem","compose","jsx","_jsx","isEverySelectedBlockAllowed","selected","allowed","filter","id","includes","length","shouldRenderItem","selectedBlocks","allowedBlocks","Array","isArray","PluginBlockSettingsMenuItem","icon","label","onClick","small","role","children","onClose","undefined"],"sources":["@wordpress/editor/src/components/block-settings-menu/plugin-block-settings-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockSettingsMenuControls } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\n\nconst isEverySelectedBlockAllowed = ( selected, allowed ) =>\n\tselected.filter( ( id ) => ! allowed.includes( id ) ).length === 0;\n\n/**\n * Plugins may want to add an item to the menu either for every block\n * or only for the specific ones provided in the `allowedBlocks` component property.\n *\n * If there are multiple blocks selected the item will be rendered if every block\n * is of one allowed type (not necessarily the same).\n *\n * @param {string[]} selectedBlocks Array containing the names of the blocks selected\n * @param {string[]} allowedBlocks Array containing the names of the blocks allowed\n * @return {boolean} Whether the item will be rendered or not.\n */\nconst shouldRenderItem = ( selectedBlocks, allowedBlocks ) =>\n\t! Array.isArray( allowedBlocks ) ||\n\tisEverySelectedBlockAllowed( selectedBlocks, allowedBlocks );\n\n/**\n * Renders a new item in the block settings menu.\n *\n * @param {Object} props Component props.\n * @param {Array} [props.allowedBlocks] An array containing a list of block names for which the item should be shown. If not present, it'll be rendered for any block. If multiple blocks are selected, it'll be shown if and only if all of them are in the allowed list.\n * @param {WPBlockTypeIconRender} [props.icon] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.\n * @param {string} props.label The menu item text.\n * @param {Function} props.onClick Callback function to be executed when the user click the menu item.\n * @param {boolean} [props.small] Whether to render the label or not.\n * @param {string} [props.role] The ARIA role for the menu item.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginBlockSettingsMenuItem = wp.editor.PluginBlockSettingsMenuItem;\n *\n * function doOnClick(){\n * \t// To be called when the user clicks the menu item.\n * }\n *\n * function MyPluginBlockSettingsMenuItem() {\n * \treturn React.createElement(\n * \t\tPluginBlockSettingsMenuItem,\n * \t\t{\n * \t\t\tallowedBlocks: [ 'core/paragraph' ],\n * \t\t\ticon: 'dashicon-name',\n * \t\t\tlabel: __( 'Menu item text' ),\n * \t\t\tonClick: doOnClick,\n * \t\t}\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginBlockSettingsMenuItem } from '@wordpress/editor';\n *\n * const doOnClick = ( ) => {\n * // To be called when the user clicks the menu item.\n * };\n *\n * const MyPluginBlockSettingsMenuItem = () => (\n * <PluginBlockSettingsMenuItem\n * \t\tallowedBlocks={ [ 'core/paragraph' ] }\n * \t\ticon='dashicon-name'\n * \t\tlabel={ __( 'Menu item text' ) }\n * \t\tonClick={ doOnClick } />\n * );\n * ```\n *\n * @return {React.ReactNode} The rendered component.\n */\nconst PluginBlockSettingsMenuItem = ( {\n\tallowedBlocks,\n\ticon,\n\tlabel,\n\tonClick,\n\tsmall,\n\trole,\n} ) => (\n\t<BlockSettingsMenuControls>\n\t\t{ ( { selectedBlocks, onClose } ) => {\n\t\t\tif ( ! shouldRenderItem( selectedBlocks, allowedBlocks ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ compose( onClick, onClose ) }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ small ? label : undefined }\n\t\t\t\t\trole={ role }\n\t\t\t\t>\n\t\t\t\t\t{ ! small && label }\n\t\t\t\t</MenuItem>\n\t\t\t);\n\t\t} }\n\t</BlockSettingsMenuControls>\n);\n\nexport default PluginBlockSettingsMenuItem;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,yBAAyB,QAAQ,yBAAyB;AACnE,SAASC,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,OAAO,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE7C,MAAMC,2BAA2B,GAAGA,CAAEC,QAAQ,EAAEC,OAAO,KACtDD,QAAQ,CAACE,MAAM,CAAIC,EAAE,IAAM,CAAEF,OAAO,CAACG,QAAQ,CAAED,EAAG,CAAE,CAAC,CAACE,MAAM,KAAK,CAAC;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAAEC,cAAc,EAAEC,aAAa,KACvD,CAAEC,KAAK,CAACC,OAAO,CAAEF,aAAc,CAAC,IAChCT,2BAA2B,CAAEQ,cAAc,EAAEC,aAAc,CAAC;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,2BAA2B,GAAGA,CAAE;EACrCH,aAAa;EACbI,IAAI;EACJC,KAAK;EACLC,OAAO;EACPC,KAAK;EACLC;AACD,CAAC,kBACAlB,IAAA,CAACJ,yBAAyB;EAAAuB,QAAA,EACvBA,CAAE;IAAEV,cAAc;IAAEW;EAAQ,CAAC,KAAM;IACpC,IAAK,CAAEZ,gBAAgB,CAAEC,cAAc,EAAEC,aAAc,CAAC,EAAG;MAC1D,OAAO,IAAI;IACZ;IACA,oBACCV,IAAA,CAACH,QAAQ;MACRmB,OAAO,EAAGlB,OAAO,CAAEkB,OAAO,EAAEI,OAAQ,CAAG;MACvCN,IAAI,EAAGA,IAAM;MACbC,KAAK,EAAGE,KAAK,GAAGF,KAAK,GAAGM,SAAW;MACnCH,IAAI,EAAGA,IAAM;MAAAC,QAAA,EAEX,CAAEF,KAAK,IAAIF;IAAK,CACT,CAAC;EAEb;AAAC,CACyB,CAC3B;AAED,eAAeF,2BAA2B","ignoreList":[]}
|
|
@@ -45,7 +45,7 @@ export function AddComment({
|
|
|
45
45
|
}
|
|
46
46
|
return /*#__PURE__*/_jsxs(VStack, {
|
|
47
47
|
spacing: "3",
|
|
48
|
-
className: "editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread",
|
|
48
|
+
className: "editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread editor-collab-sidebar-panel__focus-thread",
|
|
49
49
|
children: [/*#__PURE__*/_jsx(HStack, {
|
|
50
50
|
alignment: "left",
|
|
51
51
|
spacing: "3",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_x","useSelect","__experimentalHStack","HStack","__experimentalVStack","VStack","store","blockEditorStore","CommentAuthorInfo","CommentForm","jsx","_jsx","jsxs","_jsxs","AddComment","onSubmit","showCommentBoard","setShowCommentBoard","clientId","blockCommentId","select","getSelectedBlock","selectedBlock","attributes","undefined","spacing","className","children","alignment","inputComment","onCancel","submitButtonText"],"sources":["@wordpress/editor/src/components/collab-sidebar/add-comment.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport CommentAuthorInfo from './comment-author-info';\nimport CommentForm from './comment-form';\n\n/**\n * Renders the UI for adding a comment in the Gutenberg editor's collaboration sidebar.\n *\n * @param {Object} props - The component props.\n * @param {Function} props.onSubmit - A callback function to be called when the user submits a comment.\n * @param {boolean} props.showCommentBoard - The function to edit the comment.\n * @param {Function} props.setShowCommentBoard - The function to delete the comment.\n * @return {React.ReactNode} The rendered comment input UI.\n */\nexport function AddComment( {\n\tonSubmit,\n\tshowCommentBoard,\n\tsetShowCommentBoard,\n} ) {\n\tconst { clientId, blockCommentId } = useSelect( ( select ) => {\n\t\tconst { getSelectedBlock } = select( blockEditorStore );\n\t\tconst selectedBlock = getSelectedBlock();\n\t\treturn {\n\t\t\tclientId: selectedBlock?.clientId,\n\t\t\tblockCommentId: selectedBlock?.attributes?.blockCommentId,\n\t\t};\n\t} );\n\n\tif ( ! showCommentBoard || ! clientId || undefined !== blockCommentId ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack\n\t\t\tspacing=\"3\"\n\t\t\tclassName=\"editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread\"\n\t\t>\n\t\t\t<HStack alignment=\"left\" spacing=\"3\">\n\t\t\t\t<CommentAuthorInfo />\n\t\t\t</HStack>\n\t\t\t<CommentForm\n\t\t\t\tonSubmit={ ( inputComment ) => {\n\t\t\t\t\tonSubmit( inputComment );\n\t\t\t\t} }\n\t\t\t\tonCancel={ () => {\n\t\t\t\t\tsetShowCommentBoard( false );\n\t\t\t\t} }\n\t\t\t\tsubmitButtonText={ _x( 'Comment', 'Add comment button' ) }\n\t\t\t/>\n\t\t</VStack>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,OAAOC,WAAW,MAAM,gBAAgB;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AASA,OAAO,SAASC,UAAUA,CAAE;EAC3BC,QAAQ;EACRC,gBAAgB;EAChBC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC,QAAQ;IAAEC;EAAe,CAAC,GAAGlB,SAAS,CAAImB,MAAM,IAAM;IAC7D,MAAM;MAAEC;IAAiB,CAAC,GAAGD,MAAM,CAAEb,gBAAiB,CAAC;IACvD,MAAMe,aAAa,GAAGD,gBAAgB,CAAC,CAAC;IACxC,OAAO;MACNH,QAAQ,EAAEI,aAAa,EAAEJ,QAAQ;MACjCC,cAAc,EAAEG,aAAa,EAAEC,UAAU,EAAEJ;IAC5C,CAAC;EACF,CAAE,CAAC;EAEH,IAAK,CAAEH,gBAAgB,IAAI,CAAEE,QAAQ,IAAIM,SAAS,KAAKL,cAAc,EAAG;IACvE,OAAO,IAAI;EACZ;EAEA,oBACCN,KAAA,CAACR,MAAM;IACNoB,OAAO,EAAC,GAAG;IACXC,SAAS,EAAC,
|
|
1
|
+
{"version":3,"names":["_x","useSelect","__experimentalHStack","HStack","__experimentalVStack","VStack","store","blockEditorStore","CommentAuthorInfo","CommentForm","jsx","_jsx","jsxs","_jsxs","AddComment","onSubmit","showCommentBoard","setShowCommentBoard","clientId","blockCommentId","select","getSelectedBlock","selectedBlock","attributes","undefined","spacing","className","children","alignment","inputComment","onCancel","submitButtonText"],"sources":["@wordpress/editor/src/components/collab-sidebar/add-comment.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport CommentAuthorInfo from './comment-author-info';\nimport CommentForm from './comment-form';\n\n/**\n * Renders the UI for adding a comment in the Gutenberg editor's collaboration sidebar.\n *\n * @param {Object} props - The component props.\n * @param {Function} props.onSubmit - A callback function to be called when the user submits a comment.\n * @param {boolean} props.showCommentBoard - The function to edit the comment.\n * @param {Function} props.setShowCommentBoard - The function to delete the comment.\n * @return {React.ReactNode} The rendered comment input UI.\n */\nexport function AddComment( {\n\tonSubmit,\n\tshowCommentBoard,\n\tsetShowCommentBoard,\n} ) {\n\tconst { clientId, blockCommentId } = useSelect( ( select ) => {\n\t\tconst { getSelectedBlock } = select( blockEditorStore );\n\t\tconst selectedBlock = getSelectedBlock();\n\t\treturn {\n\t\t\tclientId: selectedBlock?.clientId,\n\t\t\tblockCommentId: selectedBlock?.attributes?.blockCommentId,\n\t\t};\n\t} );\n\n\tif ( ! showCommentBoard || ! clientId || undefined !== blockCommentId ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack\n\t\t\tspacing=\"3\"\n\t\t\tclassName=\"editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread editor-collab-sidebar-panel__focus-thread\"\n\t\t>\n\t\t\t<HStack alignment=\"left\" spacing=\"3\">\n\t\t\t\t<CommentAuthorInfo />\n\t\t\t</HStack>\n\t\t\t<CommentForm\n\t\t\t\tonSubmit={ ( inputComment ) => {\n\t\t\t\t\tonSubmit( inputComment );\n\t\t\t\t} }\n\t\t\t\tonCancel={ () => {\n\t\t\t\t\tsetShowCommentBoard( false );\n\t\t\t\t} }\n\t\t\t\tsubmitButtonText={ _x( 'Comment', 'Add comment button' ) }\n\t\t\t/>\n\t\t</VStack>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,OAAOC,WAAW,MAAM,gBAAgB;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AASA,OAAO,SAASC,UAAUA,CAAE;EAC3BC,QAAQ;EACRC,gBAAgB;EAChBC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC,QAAQ;IAAEC;EAAe,CAAC,GAAGlB,SAAS,CAAImB,MAAM,IAAM;IAC7D,MAAM;MAAEC;IAAiB,CAAC,GAAGD,MAAM,CAAEb,gBAAiB,CAAC;IACvD,MAAMe,aAAa,GAAGD,gBAAgB,CAAC,CAAC;IACxC,OAAO;MACNH,QAAQ,EAAEI,aAAa,EAAEJ,QAAQ;MACjCC,cAAc,EAAEG,aAAa,EAAEC,UAAU,EAAEJ;IAC5C,CAAC;EACF,CAAE,CAAC;EAEH,IAAK,CAAEH,gBAAgB,IAAI,CAAEE,QAAQ,IAAIM,SAAS,KAAKL,cAAc,EAAG;IACvE,OAAO,IAAI;EACZ;EAEA,oBACCN,KAAA,CAACR,MAAM;IACNoB,OAAO,EAAC,GAAG;IACXC,SAAS,EAAC,0HAA0H;IAAAC,QAAA,gBAEpIhB,IAAA,CAACR,MAAM;MAACyB,SAAS,EAAC,MAAM;MAACH,OAAO,EAAC,GAAG;MAAAE,QAAA,eACnChB,IAAA,CAACH,iBAAiB,IAAE;IAAC,CACd,CAAC,eACTG,IAAA,CAACF,WAAW;MACXM,QAAQ,EAAKc,YAAY,IAAM;QAC9Bd,QAAQ,CAAEc,YAAa,CAAC;MACzB,CAAG;MACHC,QAAQ,EAAGA,CAAA,KAAM;QAChBb,mBAAmB,CAAE,KAAM,CAAC;MAC7B,CAAG;MACHc,gBAAgB,EAAG/B,EAAE,CAAE,SAAS,EAAE,oBAAqB;IAAG,CAC1D,CAAC;EAAA,CACK,CAAC;AAEX","ignoreList":[]}
|
|
@@ -18,9 +18,14 @@ const AddCommentButton = ({
|
|
|
18
18
|
onClick
|
|
19
19
|
}) => {
|
|
20
20
|
return /*#__PURE__*/_jsx(CommentIconSlotFill.Fill, {
|
|
21
|
-
children:
|
|
21
|
+
children: ({
|
|
22
|
+
onClose
|
|
23
|
+
}) => /*#__PURE__*/_jsx(MenuItem, {
|
|
22
24
|
icon: commentIcon,
|
|
23
|
-
onClick:
|
|
25
|
+
onClick: () => {
|
|
26
|
+
onClick();
|
|
27
|
+
onClose();
|
|
28
|
+
},
|
|
24
29
|
"aria-haspopup": "dialog",
|
|
25
30
|
children: _x('Comment', 'Add comment button')
|
|
26
31
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MenuItem","_x","comment","commentIcon","privateApis","blockEditorPrivateApis","unlock","jsx","_jsx","CommentIconSlotFill","AddCommentButton","onClick","Fill","children","icon"],"sources":["@wordpress/editor/src/components/collab-sidebar/comment-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { _x } from '@wordpress/i18n';\nimport { comment as commentIcon } from '@wordpress/icons';\n\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { CommentIconSlotFill } = unlock( blockEditorPrivateApis );\n\nconst AddCommentButton = ( { onClick } ) => {\n\treturn (\n\t\t<CommentIconSlotFill.Fill>\n\t\t\t<MenuItem\n\t\t\t\ticon={ commentIcon }\n\t\t\t\tonClick={
|
|
1
|
+
{"version":3,"names":["MenuItem","_x","comment","commentIcon","privateApis","blockEditorPrivateApis","unlock","jsx","_jsx","CommentIconSlotFill","AddCommentButton","onClick","Fill","children","onClose","icon"],"sources":["@wordpress/editor/src/components/collab-sidebar/comment-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { _x } from '@wordpress/i18n';\nimport { comment as commentIcon } from '@wordpress/icons';\n\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { CommentIconSlotFill } = unlock( blockEditorPrivateApis );\n\nconst AddCommentButton = ( { onClick } ) => {\n\treturn (\n\t\t<CommentIconSlotFill.Fill>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<MenuItem\n\t\t\t\t\ticon={ commentIcon }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tonClick();\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t>\n\t\t\t\t\t{ _x( 'Comment', 'Add comment button' ) }\n\t\t\t\t</MenuItem>\n\t\t\t) }\n\t\t</CommentIconSlotFill.Fill>\n\t);\n};\n\nexport default AddCommentButton;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,OAAO,IAAIC,WAAW,QAAQ,kBAAkB;AAEzD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,MAAM;EAAEC;AAAoB,CAAC,GAAGH,MAAM,CAAED,sBAAuB,CAAC;AAEhE,MAAMK,gBAAgB,GAAGA,CAAE;EAAEC;AAAQ,CAAC,KAAM;EAC3C,oBACCH,IAAA,CAACC,mBAAmB,CAACG,IAAI;IAAAC,QAAA,EACtBA,CAAE;MAAEC;IAAQ,CAAC,kBACdN,IAAA,CAACR,QAAQ;MACRe,IAAI,EAAGZ,WAAa;MACpBQ,OAAO,EAAGA,CAAA,KAAM;QACfA,OAAO,CAAC,CAAC;QACTG,OAAO,CAAC,CAAC;MACV,CAAG;MACH,iBAAc,QAAQ;MAAAD,QAAA,EAEpBZ,EAAE,CAAE,SAAS,EAAE,oBAAqB;IAAC,CAC9B;EACV,CACwB,CAAC;AAE7B,CAAC;AAED,eAAeS,gBAAgB","ignoreList":[]}
|
|
@@ -43,7 +43,10 @@ function CommentForm({
|
|
|
43
43
|
__next40pxDefaultSize: true,
|
|
44
44
|
accessibleWhenDisabled: true,
|
|
45
45
|
variant: "primary",
|
|
46
|
-
onClick: () =>
|
|
46
|
+
onClick: () => {
|
|
47
|
+
onSubmit(inputComment);
|
|
48
|
+
setInputComment('');
|
|
49
|
+
},
|
|
47
50
|
disabled: 0 === sanitizeCommentString(inputComment).length,
|
|
48
51
|
text: submitButtonText
|
|
49
52
|
}), /*#__PURE__*/_jsx(Button, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useState","__experimentalHStack","HStack","Button","TextareaControl","_x","sanitizeCommentString","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","CommentForm","onSubmit","onCancel","thread","submitButtonText","_thread$content$raw","inputComment","setInputComment","content","raw","children","__next40pxDefaultSize","__nextHasNoMarginBottom","value","onChange","alignment","spacing","justify","accessibleWhenDisabled","variant","onClick","disabled","length","text"],"sources":["@wordpress/editor/src/components/collab-sidebar/comment-form.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport {\n\t__experimentalHStack as HStack,\n\tButton,\n\tTextareaControl,\n} from '@wordpress/components';\nimport { _x } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { sanitizeCommentString } from './utils';\n\n/**\n * EditComment component.\n *\n * @param {Object} props - The component props.\n * @param {Function} props.onSubmit - The function to call when updating the comment.\n * @param {Function} props.onCancel - The function to call when canceling the comment update.\n * @param {Object} props.thread - The comment thread object.\n * @param {string} props.submitButtonText - The text to display on the submit button.\n * @return {React.ReactNode} The CommentForm component.\n */\nfunction CommentForm( { onSubmit, onCancel, thread, submitButtonText } ) {\n\tconst [ inputComment, setInputComment ] = useState(\n\t\tthread?.content?.raw ?? ''\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<TextareaControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tvalue={ inputComment ?? '' }\n\t\t\t\tonChange={ setInputComment }\n\t\t\t/>\n\t\t\t<HStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tonClick={ () =>
|
|
1
|
+
{"version":3,"names":["useState","__experimentalHStack","HStack","Button","TextareaControl","_x","sanitizeCommentString","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","CommentForm","onSubmit","onCancel","thread","submitButtonText","_thread$content$raw","inputComment","setInputComment","content","raw","children","__next40pxDefaultSize","__nextHasNoMarginBottom","value","onChange","alignment","spacing","justify","accessibleWhenDisabled","variant","onClick","disabled","length","text"],"sources":["@wordpress/editor/src/components/collab-sidebar/comment-form.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport {\n\t__experimentalHStack as HStack,\n\tButton,\n\tTextareaControl,\n} from '@wordpress/components';\nimport { _x } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { sanitizeCommentString } from './utils';\n\n/**\n * EditComment component.\n *\n * @param {Object} props - The component props.\n * @param {Function} props.onSubmit - The function to call when updating the comment.\n * @param {Function} props.onCancel - The function to call when canceling the comment update.\n * @param {Object} props.thread - The comment thread object.\n * @param {string} props.submitButtonText - The text to display on the submit button.\n * @return {React.ReactNode} The CommentForm component.\n */\nfunction CommentForm( { onSubmit, onCancel, thread, submitButtonText } ) {\n\tconst [ inputComment, setInputComment ] = useState(\n\t\tthread?.content?.raw ?? ''\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<TextareaControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tvalue={ inputComment ?? '' }\n\t\t\t\tonChange={ setInputComment }\n\t\t\t/>\n\t\t\t<HStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tonSubmit( inputComment );\n\t\t\t\t\t\tsetInputComment( '' );\n\t\t\t\t\t} }\n\t\t\t\t\tdisabled={\n\t\t\t\t\t\t0 === sanitizeCommentString( inputComment ).length\n\t\t\t\t\t}\n\t\t\t\t\ttext={ submitButtonText }\n\t\t\t\t/>\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\tonClick={ onCancel }\n\t\t\t\t\ttext={ _x( 'Cancel', 'Cancel comment button' ) }\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t</>\n\t);\n}\n\nexport default CommentForm;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,MAAM,EACNC,eAAe,QACT,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,qBAAqB,QAAQ,SAAS;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAUA,SAASC,WAAWA,CAAE;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC,MAAM;EAAEC;AAAiB,CAAC,EAAG;EAAA,IAAAC,mBAAA;EACxE,MAAM,CAAEC,YAAY,EAAEC,eAAe,CAAE,GAAGpB,QAAQ,EAAAkB,mBAAA,GACjDF,MAAM,EAAEK,OAAO,EAAEC,GAAG,cAAAJ,mBAAA,cAAAA,mBAAA,GAAI,EACzB,CAAC;EAED,oBACCR,KAAA,CAAAE,SAAA;IAAAW,QAAA,gBACCf,IAAA,CAACJ,eAAe;MACfoB,qBAAqB;MACrBC,uBAAuB;MACvBC,KAAK,EAAGP,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAI,EAAI;MAC5BQ,QAAQ,EAAGP;IAAiB,CAC5B,CAAC,eACFV,KAAA,CAACR,MAAM;MAAC0B,SAAS,EAAC,MAAM;MAACC,OAAO,EAAC,GAAG;MAACC,OAAO,EAAC,YAAY;MAAAP,QAAA,gBACxDf,IAAA,CAACL,MAAM;QACNqB,qBAAqB;QACrBO,sBAAsB;QACtBC,OAAO,EAAC,SAAS;QACjBC,OAAO,EAAGA,CAAA,KAAM;UACfnB,QAAQ,CAAEK,YAAa,CAAC;UACxBC,eAAe,CAAE,EAAG,CAAC;QACtB,CAAG;QACHc,QAAQ,EACP,CAAC,KAAK5B,qBAAqB,CAAEa,YAAa,CAAC,CAACgB,MAC5C;QACDC,IAAI,EAAGnB;MAAkB,CACzB,CAAC,eACFT,IAAA,CAACL,MAAM;QACNqB,qBAAqB;QACrBQ,OAAO,EAAC,UAAU;QAClBC,OAAO,EAAGlB,QAAU;QACpBqB,IAAI,EAAG/B,EAAE,CAAE,QAAQ,EAAE,uBAAwB;MAAG,CAChD,CAAC;IAAA,CACK,CAAC;EAAA,CACR,CAAC;AAEL;AAEA,eAAeQ,WAAW","ignoreList":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* wp:polyfill */
|
|
1
2
|
/**
|
|
2
3
|
* External dependencies
|
|
3
4
|
*/
|
|
@@ -9,7 +10,7 @@ import clsx from 'clsx';
|
|
|
9
10
|
import { useState, RawHTML } from '@wordpress/element';
|
|
10
11
|
import { __experimentalHStack as HStack, __experimentalVStack as VStack, __experimentalConfirmDialog as ConfirmDialog, Button, DropdownMenu, Tooltip } from '@wordpress/components';
|
|
11
12
|
import { Icon, check, published, moreVertical } from '@wordpress/icons';
|
|
12
|
-
import { __, _x } from '@wordpress/i18n';
|
|
13
|
+
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
13
14
|
import { useSelect } from '@wordpress/data';
|
|
14
15
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
15
16
|
|
|
@@ -22,115 +23,42 @@ import CommentForm from './comment-form';
|
|
|
22
23
|
/**
|
|
23
24
|
* Renders the Comments component.
|
|
24
25
|
*
|
|
25
|
-
* @param {Object} props
|
|
26
|
-
* @param {Array} props.threads
|
|
27
|
-
* @param {Function} props.onEditComment
|
|
28
|
-
* @param {Function} props.onAddReply
|
|
29
|
-
* @param {Function} props.onCommentDelete
|
|
30
|
-
* @param {Function} props.onCommentResolve
|
|
26
|
+
* @param {Object} props - The component props.
|
|
27
|
+
* @param {Array} props.threads - The array of comment threads.
|
|
28
|
+
* @param {Function} props.onEditComment - The function to handle comment editing.
|
|
29
|
+
* @param {Function} props.onAddReply - The function to add a reply to a comment.
|
|
30
|
+
* @param {Function} props.onCommentDelete - The function to delete a comment.
|
|
31
|
+
* @param {Function} props.onCommentResolve - The function to mark a comment as resolved.
|
|
32
|
+
* @param {boolean} props.showCommentBoard - Whether to show the comment board.
|
|
33
|
+
* @param {Function} props.setShowCommentBoard - The function to set the comment board visibility.
|
|
31
34
|
* @return {React.ReactNode} The rendered Comments component.
|
|
32
35
|
*/
|
|
33
|
-
import { jsx as _jsx,
|
|
36
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
34
37
|
export function Comments({
|
|
35
38
|
threads,
|
|
36
39
|
onEditComment,
|
|
37
40
|
onAddReply,
|
|
38
41
|
onCommentDelete,
|
|
39
|
-
onCommentResolve
|
|
42
|
+
onCommentResolve,
|
|
43
|
+
showCommentBoard,
|
|
44
|
+
setShowCommentBoard
|
|
40
45
|
}) {
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
53
|
-
const handleCancelDelete = () => {
|
|
54
|
-
setActionState(false);
|
|
55
|
-
setIsConfirmDialogOpen(false);
|
|
56
|
-
};
|
|
57
|
-
const blockCommentId = useSelect(select => {
|
|
58
|
-
var _select$getBlock$attr;
|
|
59
|
-
const clientID = select(blockEditorStore).getSelectedBlockClientId();
|
|
60
|
-
return (_select$getBlock$attr = select(blockEditorStore).getBlock(clientID)?.attributes?.blockCommentId) !== null && _select$getBlock$attr !== void 0 ? _select$getBlock$attr : false;
|
|
46
|
+
const {
|
|
47
|
+
blockCommentId
|
|
48
|
+
} = useSelect(select => {
|
|
49
|
+
const {
|
|
50
|
+
getBlockAttributes,
|
|
51
|
+
getSelectedBlockClientId
|
|
52
|
+
} = select(blockEditorStore);
|
|
53
|
+
const _clientId = getSelectedBlockClientId();
|
|
54
|
+
return {
|
|
55
|
+
blockCommentId: _clientId ? getBlockAttributes(_clientId)?.blockCommentId : null
|
|
56
|
+
};
|
|
61
57
|
}, []);
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
var _parentThread$status;
|
|
67
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
68
|
-
children: [/*#__PURE__*/_jsx(CommentHeader, {
|
|
69
|
-
thread: thread,
|
|
70
|
-
onResolve: () => {
|
|
71
|
-
var _parentThread$id;
|
|
72
|
-
setActionState({
|
|
73
|
-
action: 'resolve',
|
|
74
|
-
id: (_parentThread$id = parentThread?.id) !== null && _parentThread$id !== void 0 ? _parentThread$id : thread.id
|
|
75
|
-
});
|
|
76
|
-
setIsConfirmDialogOpen(true);
|
|
77
|
-
},
|
|
78
|
-
onEdit: () => setActionState({
|
|
79
|
-
action: 'edit',
|
|
80
|
-
id: thread.id
|
|
81
|
-
}),
|
|
82
|
-
onDelete: () => {
|
|
83
|
-
setActionState({
|
|
84
|
-
action: 'delete',
|
|
85
|
-
id: thread.id
|
|
86
|
-
});
|
|
87
|
-
setIsConfirmDialogOpen(true);
|
|
88
|
-
},
|
|
89
|
-
onReply: !parentThread ? () => setActionState({
|
|
90
|
-
action: 'reply',
|
|
91
|
-
id: thread.id
|
|
92
|
-
}) : undefined,
|
|
93
|
-
status: (_parentThread$status = parentThread?.status) !== null && _parentThread$status !== void 0 ? _parentThread$status : thread.status
|
|
94
|
-
}), /*#__PURE__*/_jsx(HStack, {
|
|
95
|
-
alignment: "left",
|
|
96
|
-
spacing: "3",
|
|
97
|
-
justify: "flex-start",
|
|
98
|
-
className: "editor-collab-sidebar-panel__user-comment",
|
|
99
|
-
children: /*#__PURE__*/_jsxs(VStack, {
|
|
100
|
-
spacing: "3",
|
|
101
|
-
className: "editor-collab-sidebar-panel__comment-field",
|
|
102
|
-
children: ['edit' === actionState?.action && thread.id === actionState?.id && /*#__PURE__*/_jsx(CommentForm, {
|
|
103
|
-
onSubmit: value => {
|
|
104
|
-
onEditComment(thread.id, value);
|
|
105
|
-
setActionState(false);
|
|
106
|
-
},
|
|
107
|
-
onCancel: () => setActionState(false),
|
|
108
|
-
thread: thread,
|
|
109
|
-
submitButtonText: _x('Update', 'verb')
|
|
110
|
-
}), (!actionState || 'edit' !== actionState?.action) && /*#__PURE__*/_jsx(RawHTML, {
|
|
111
|
-
children: thread?.content?.raw
|
|
112
|
-
})]
|
|
113
|
-
})
|
|
114
|
-
}), 'resolve' === actionState?.action && thread.id === actionState?.id && /*#__PURE__*/_jsx(ConfirmDialog, {
|
|
115
|
-
isOpen: isConfirmDialogOpen,
|
|
116
|
-
onConfirm: handleConfirmResolve,
|
|
117
|
-
onCancel: handleCancelDelete,
|
|
118
|
-
confirmButtonText: "Yes",
|
|
119
|
-
cancelButtonText: "No",
|
|
120
|
-
children:
|
|
121
|
-
// translators: message displayed when confirming an action
|
|
122
|
-
__('Are you sure you want to mark this comment as resolved?')
|
|
123
|
-
}), 'delete' === actionState?.action && thread.id === actionState?.id && /*#__PURE__*/_jsx(ConfirmDialog, {
|
|
124
|
-
isOpen: isConfirmDialogOpen,
|
|
125
|
-
onConfirm: handleConfirmDelete,
|
|
126
|
-
onCancel: handleCancelDelete,
|
|
127
|
-
confirmButtonText: "Yes",
|
|
128
|
-
cancelButtonText: "No",
|
|
129
|
-
children:
|
|
130
|
-
// translators: message displayed when confirming an action
|
|
131
|
-
__('Are you sure you want to delete this comment?')
|
|
132
|
-
})]
|
|
133
|
-
});
|
|
58
|
+
const [focusThread, setFocusThread] = useState(showCommentBoard && blockCommentId ? blockCommentId : null);
|
|
59
|
+
const clearThreadFocus = () => {
|
|
60
|
+
setFocusThread(null);
|
|
61
|
+
setShowCommentBoard(false);
|
|
134
62
|
};
|
|
135
63
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
136
64
|
children: [
|
|
@@ -143,114 +71,200 @@ export function Comments({
|
|
|
143
71
|
children:
|
|
144
72
|
// translators: message displayed when there are no comments available
|
|
145
73
|
__('No comments available')
|
|
146
|
-
}), Array.isArray(threads) && threads.length > 0 && threads.map(thread => /*#__PURE__*/
|
|
74
|
+
}), Array.isArray(threads) && threads.length > 0 && threads.map(thread => /*#__PURE__*/_jsx(VStack, {
|
|
147
75
|
className: clsx('editor-collab-sidebar-panel__thread', {
|
|
148
|
-
'editor-collab-sidebar-panel__active-thread': blockCommentId && blockCommentId === thread.id
|
|
76
|
+
'editor-collab-sidebar-panel__active-thread': blockCommentId && blockCommentId === thread.id,
|
|
77
|
+
'editor-collab-sidebar-panel__focus-thread': focusThread && focusThread === thread.id
|
|
149
78
|
}),
|
|
150
79
|
id: thread.id,
|
|
151
80
|
spacing: "3",
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
81
|
+
onClick: () => setFocusThread(thread.id),
|
|
82
|
+
children: /*#__PURE__*/_jsx(Thread, {
|
|
83
|
+
thread: thread,
|
|
84
|
+
onAddReply: onAddReply,
|
|
85
|
+
onCommentDelete: onCommentDelete,
|
|
86
|
+
onCommentResolve: onCommentResolve,
|
|
87
|
+
onEditComment: onEditComment,
|
|
88
|
+
isFocused: focusThread === thread.id,
|
|
89
|
+
clearThreadFocus: clearThreadFocus
|
|
90
|
+
})
|
|
91
|
+
}, thread.id))]
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function Thread({
|
|
95
|
+
thread,
|
|
96
|
+
onEditComment,
|
|
97
|
+
onAddReply,
|
|
98
|
+
onCommentDelete,
|
|
99
|
+
onCommentResolve,
|
|
100
|
+
isFocused,
|
|
101
|
+
clearThreadFocus
|
|
102
|
+
}) {
|
|
103
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
104
|
+
children: [/*#__PURE__*/_jsx(CommentBoard, {
|
|
105
|
+
thread: thread,
|
|
106
|
+
onResolve: onCommentResolve,
|
|
107
|
+
onEdit: onEditComment,
|
|
108
|
+
onDelete: onCommentDelete,
|
|
109
|
+
status: thread.status
|
|
110
|
+
}), 0 < thread?.reply?.length && /*#__PURE__*/_jsxs(_Fragment, {
|
|
111
|
+
children: [!isFocused && /*#__PURE__*/_jsx(VStack, {
|
|
112
|
+
className: "editor-collab-sidebar-panel__show-more-reply",
|
|
113
|
+
children: sprintf(
|
|
114
|
+
// translators: 1: number of replies.
|
|
115
|
+
_x('%s more replies..', 'Show replies button'), thread?.reply?.length)
|
|
116
|
+
}), isFocused && thread.reply.map(reply => /*#__PURE__*/_jsxs(VStack, {
|
|
155
117
|
className: "editor-collab-sidebar-panel__child-thread",
|
|
156
118
|
id: reply.id,
|
|
157
119
|
spacing: "2",
|
|
158
|
-
children: /*#__PURE__*/_jsx(CommentBoard, {
|
|
120
|
+
children: ['approved' !== thread.status && /*#__PURE__*/_jsx(CommentBoard, {
|
|
159
121
|
thread: reply,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
spacing: "2",
|
|
165
|
-
children: [/*#__PURE__*/_jsx(HStack, {
|
|
166
|
-
alignment: "left",
|
|
167
|
-
spacing: "3",
|
|
168
|
-
justify: "flex-start",
|
|
169
|
-
children: /*#__PURE__*/_jsx(CommentAuthorInfo, {})
|
|
170
|
-
}), /*#__PURE__*/_jsx(VStack, {
|
|
171
|
-
spacing: "3",
|
|
172
|
-
className: "editor-collab-sidebar-panel__comment-field",
|
|
173
|
-
children: /*#__PURE__*/_jsx(CommentForm, {
|
|
174
|
-
onSubmit: inputComment => {
|
|
175
|
-
onAddReply(inputComment, thread.id);
|
|
176
|
-
setActionState(false);
|
|
177
|
-
},
|
|
178
|
-
onCancel: () => setActionState(false),
|
|
179
|
-
submitButtonText: _x('Reply', 'Add reply comment')
|
|
180
|
-
})
|
|
122
|
+
onEdit: onEditComment,
|
|
123
|
+
onDelete: onCommentDelete
|
|
124
|
+
}), 'approved' === thread.status && /*#__PURE__*/_jsx(CommentBoard, {
|
|
125
|
+
thread: reply
|
|
181
126
|
})]
|
|
127
|
+
}, reply.id))]
|
|
128
|
+
}), 'approved' !== thread.status && isFocused && /*#__PURE__*/_jsxs(VStack, {
|
|
129
|
+
className: "editor-collab-sidebar-panel__child-thread",
|
|
130
|
+
spacing: "2",
|
|
131
|
+
children: [/*#__PURE__*/_jsx(HStack, {
|
|
132
|
+
alignment: "left",
|
|
133
|
+
spacing: "3",
|
|
134
|
+
justify: "flex-start",
|
|
135
|
+
children: /*#__PURE__*/_jsx(CommentAuthorInfo, {})
|
|
136
|
+
}), /*#__PURE__*/_jsx(VStack, {
|
|
137
|
+
spacing: "3",
|
|
138
|
+
className: "editor-collab-sidebar-panel__comment-field",
|
|
139
|
+
children: /*#__PURE__*/_jsx(CommentForm, {
|
|
140
|
+
onSubmit: inputComment => {
|
|
141
|
+
onAddReply(inputComment, thread.id);
|
|
142
|
+
},
|
|
143
|
+
onCancel: event => {
|
|
144
|
+
event.stopPropagation(); // Prevent the parent onClick from being triggered
|
|
145
|
+
clearThreadFocus();
|
|
146
|
+
},
|
|
147
|
+
submitButtonText: _x('Reply', 'Add reply comment')
|
|
148
|
+
})
|
|
182
149
|
})]
|
|
183
|
-
}
|
|
150
|
+
})]
|
|
184
151
|
});
|
|
185
152
|
}
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Renders the header of a comment in the collaboration sidebar.
|
|
189
|
-
*
|
|
190
|
-
* @param {Object} props - The component props.
|
|
191
|
-
* @param {Object} props.thread - The comment thread object.
|
|
192
|
-
* @param {Function} props.onResolve - The function to resolve the comment.
|
|
193
|
-
* @param {Function} props.onEdit - The function to edit the comment.
|
|
194
|
-
* @param {Function} props.onDelete - The function to delete the comment.
|
|
195
|
-
* @param {Function} props.onReply - The function to reply to the comment.
|
|
196
|
-
* @param {string} props.status - The status of the comment.
|
|
197
|
-
* @return {React.ReactNode} The rendered comment header.
|
|
198
|
-
*/
|
|
199
|
-
function CommentHeader({
|
|
153
|
+
const CommentBoard = ({
|
|
200
154
|
thread,
|
|
201
155
|
onResolve,
|
|
202
156
|
onEdit,
|
|
203
157
|
onDelete,
|
|
204
|
-
onReply,
|
|
205
158
|
status
|
|
206
|
-
}) {
|
|
207
|
-
const
|
|
159
|
+
}) => {
|
|
160
|
+
const [actionState, setActionState] = useState(false);
|
|
161
|
+
const [showConfirmDialog, setShowConfirmDialog] = useState(false);
|
|
162
|
+
const handleConfirmDelete = () => {
|
|
163
|
+
onDelete(thread.id);
|
|
164
|
+
setActionState(false);
|
|
165
|
+
setShowConfirmDialog(false);
|
|
166
|
+
};
|
|
167
|
+
const handleConfirmResolve = () => {
|
|
168
|
+
onResolve(thread.id);
|
|
169
|
+
setActionState(false);
|
|
170
|
+
setShowConfirmDialog(false);
|
|
171
|
+
};
|
|
172
|
+
const handleCancel = () => {
|
|
173
|
+
setActionState(false);
|
|
174
|
+
setShowConfirmDialog(false);
|
|
175
|
+
};
|
|
176
|
+
const actions = [onEdit && {
|
|
208
177
|
title: _x('Edit', 'Edit comment'),
|
|
209
|
-
onClick:
|
|
210
|
-
|
|
178
|
+
onClick: () => {
|
|
179
|
+
setActionState('edit');
|
|
180
|
+
}
|
|
181
|
+
}, onDelete && {
|
|
211
182
|
title: _x('Delete', 'Delete comment'),
|
|
212
|
-
onClick:
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
183
|
+
onClick: () => {
|
|
184
|
+
setActionState('delete');
|
|
185
|
+
setShowConfirmDialog(true);
|
|
186
|
+
}
|
|
216
187
|
}];
|
|
217
|
-
const moreActions = actions.filter(item => item
|
|
218
|
-
return /*#__PURE__*/_jsxs(
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
188
|
+
const moreActions = actions.filter(item => item?.onClick);
|
|
189
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
190
|
+
children: [/*#__PURE__*/_jsxs(HStack, {
|
|
191
|
+
alignment: "left",
|
|
192
|
+
spacing: "3",
|
|
193
|
+
justify: "flex-start",
|
|
194
|
+
children: [/*#__PURE__*/_jsx(CommentAuthorInfo, {
|
|
195
|
+
avatar: thread?.author_avatar_urls?.[48],
|
|
196
|
+
name: thread?.author_name,
|
|
197
|
+
date: thread?.date
|
|
198
|
+
}), /*#__PURE__*/_jsxs("span", {
|
|
199
|
+
className: "editor-collab-sidebar-panel__comment-status",
|
|
200
|
+
children: [status !== 'approved' && /*#__PURE__*/_jsxs(HStack, {
|
|
201
|
+
alignment: "right",
|
|
202
|
+
justify: "flex-end",
|
|
203
|
+
spacing: "0",
|
|
204
|
+
children: [0 === thread?.parent && onResolve && /*#__PURE__*/_jsx(Button, {
|
|
205
|
+
label: _x('Resolve', 'Mark comment as resolved'),
|
|
206
|
+
__next40pxDefaultSize: true,
|
|
207
|
+
icon: published,
|
|
208
|
+
onClick: () => {
|
|
209
|
+
setActionState('resolve');
|
|
210
|
+
setShowConfirmDialog(true);
|
|
211
|
+
},
|
|
212
|
+
showTooltip: true
|
|
213
|
+
}), 0 < moreActions.length && /*#__PURE__*/_jsx(DropdownMenu, {
|
|
214
|
+
icon: moreVertical,
|
|
215
|
+
label: _x('Select an action', 'Select comment action'),
|
|
216
|
+
className: "editor-collab-sidebar-panel__comment-dropdown-menu",
|
|
217
|
+
controls: moreActions
|
|
218
|
+
})]
|
|
219
|
+
}), status === 'approved' &&
|
|
220
|
+
/*#__PURE__*/
|
|
221
|
+
// translators: tooltip for resolved comment
|
|
222
|
+
_jsx(Tooltip, {
|
|
223
|
+
text: __('Resolved'),
|
|
224
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
225
|
+
icon: check
|
|
226
|
+
})
|
|
243
227
|
})]
|
|
244
|
-
}), status === 'approved' &&
|
|
245
|
-
/*#__PURE__*/
|
|
246
|
-
// translators: tooltip for resolved comment
|
|
247
|
-
_jsx(Tooltip, {
|
|
248
|
-
text: __('Resolved'),
|
|
249
|
-
children: /*#__PURE__*/_jsx(Icon, {
|
|
250
|
-
icon: check
|
|
251
|
-
})
|
|
252
228
|
})]
|
|
229
|
+
}), /*#__PURE__*/_jsx(HStack, {
|
|
230
|
+
alignment: "left",
|
|
231
|
+
spacing: "3",
|
|
232
|
+
justify: "flex-start",
|
|
233
|
+
className: "editor-collab-sidebar-panel__user-comment",
|
|
234
|
+
children: /*#__PURE__*/_jsxs(VStack, {
|
|
235
|
+
spacing: "3",
|
|
236
|
+
className: "editor-collab-sidebar-panel__comment-field",
|
|
237
|
+
children: ['edit' === actionState && /*#__PURE__*/_jsx(CommentForm, {
|
|
238
|
+
onSubmit: value => {
|
|
239
|
+
onEdit(thread.id, value);
|
|
240
|
+
setActionState(false);
|
|
241
|
+
},
|
|
242
|
+
onCancel: () => handleCancel(),
|
|
243
|
+
thread: thread,
|
|
244
|
+
submitButtonText: _x('Update', 'verb')
|
|
245
|
+
}), 'edit' !== actionState && /*#__PURE__*/_jsx(RawHTML, {
|
|
246
|
+
children: thread?.content?.raw
|
|
247
|
+
})]
|
|
248
|
+
})
|
|
249
|
+
}), 'resolve' === actionState && /*#__PURE__*/_jsx(ConfirmDialog, {
|
|
250
|
+
isOpen: showConfirmDialog,
|
|
251
|
+
onConfirm: handleConfirmResolve,
|
|
252
|
+
onCancel: handleCancel,
|
|
253
|
+
confirmButtonText: "Yes",
|
|
254
|
+
cancelButtonText: "No",
|
|
255
|
+
children:
|
|
256
|
+
// translators: message displayed when confirming an action
|
|
257
|
+
__('Are you sure you want to mark this comment as resolved?')
|
|
258
|
+
}), 'delete' === actionState && /*#__PURE__*/_jsx(ConfirmDialog, {
|
|
259
|
+
isOpen: showConfirmDialog,
|
|
260
|
+
onConfirm: handleConfirmDelete,
|
|
261
|
+
onCancel: handleCancel,
|
|
262
|
+
confirmButtonText: "Yes",
|
|
263
|
+
cancelButtonText: "No",
|
|
264
|
+
children:
|
|
265
|
+
// translators: message displayed when confirming an action
|
|
266
|
+
__('Are you sure you want to delete this comment?')
|
|
253
267
|
})]
|
|
254
268
|
});
|
|
255
|
-
}
|
|
269
|
+
};
|
|
256
270
|
//# sourceMappingURL=comments.js.map
|