@wordpress/editor 14.34.0 → 14.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/README.md +1 -1
- package/build/bindings/api.js +2 -0
- package/build/bindings/api.js.map +1 -1
- package/build/bindings/pattern-overrides.js +3 -1
- package/build/bindings/pattern-overrides.js.map +1 -1
- package/build/bindings/post-data.js +50 -64
- package/build/bindings/post-data.js.map +3 -3
- package/build/bindings/post-meta.js +47 -39
- package/build/bindings/post-meta.js.map +2 -2
- package/build/bindings/term-data.js +3 -1
- package/build/bindings/term-data.js.map +1 -1
- package/build/components/autocompleters/index.js +2 -0
- package/build/components/autocompleters/index.js.map +1 -1
- package/build/components/autocompleters/user.js +3 -1
- package/build/components/autocompleters/user.js.map +1 -1
- package/build/components/autosave-monitor/index.js +4 -2
- package/build/components/autosave-monitor/index.js.map +1 -1
- package/build/components/block-removal-warnings/index.js +6 -4
- package/build/components/block-removal-warnings/index.js.map +1 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +6 -4
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build/components/block-visibility/index.js +5 -3
- package/build/components/block-visibility/index.js.map +1 -1
- package/build/components/blog-title/index.js +4 -2
- package/build/components/blog-title/index.js.map +1 -1
- package/build/components/character-count/index.js +2 -0
- package/build/components/character-count/index.js.map +1 -1
- package/build/components/collab-sidebar/add-comment.js +21 -17
- package/build/components/collab-sidebar/add-comment.js.map +2 -2
- package/build/components/collab-sidebar/comment-author-info.js +4 -2
- package/build/components/collab-sidebar/comment-author-info.js.map +2 -2
- package/build/components/collab-sidebar/comment-form.js +17 -6
- package/build/components/collab-sidebar/comment-form.js.map +2 -2
- package/build/components/collab-sidebar/comment-indicator-toolbar.js +14 -26
- package/build/components/collab-sidebar/comment-indicator-toolbar.js.map +3 -3
- package/build/components/collab-sidebar/comment-menu-item.js +40 -8
- package/build/components/collab-sidebar/comment-menu-item.js.map +3 -3
- package/build/components/collab-sidebar/comments.js +386 -325
- package/build/components/collab-sidebar/comments.js.map +3 -3
- package/build/components/collab-sidebar/constants.js +5 -3
- package/build/components/collab-sidebar/constants.js.map +1 -1
- package/build/components/collab-sidebar/hooks.js +8 -4
- package/build/components/collab-sidebar/hooks.js.map +2 -2
- package/build/components/collab-sidebar/index.js +53 -27
- package/build/components/collab-sidebar/index.js.map +3 -3
- package/build/components/collab-sidebar/utils.js +4 -2
- package/build/components/collab-sidebar/utils.js.map +2 -2
- package/build/components/collapsible-block-toolbar/index.js +4 -2
- package/build/components/collapsible-block-toolbar/index.js.map +1 -1
- package/build/components/commands/index.js +22 -8
- package/build/components/commands/index.js.map +2 -2
- package/build/components/deprecated.js +55 -53
- package/build/components/deprecated.js.map +1 -1
- package/build/components/document-bar/index.js +4 -2
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-outline/check.js +2 -0
- package/build/components/document-outline/check.js.map +1 -1
- package/build/components/document-outline/index.js +9 -7
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-outline/item.js +4 -2
- package/build/components/document-outline/item.js.map +1 -1
- package/build/components/document-tools/index.js +3 -1
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor/index.js +14 -4
- package/build/components/editor/index.js.map +3 -3
- package/build/components/editor-history/redo.js +3 -1
- package/build/components/editor-history/redo.js.map +1 -1
- package/build/components/editor-history/undo.js +3 -1
- package/build/components/editor-history/undo.js.map +1 -1
- package/build/components/editor-interface/index.js +4 -2
- package/build/components/editor-interface/index.js.map +1 -1
- package/build/components/editor-notices/index.js +3 -1
- package/build/components/editor-notices/index.js.map +1 -1
- package/build/components/editor-snackbars/index.js +4 -2
- package/build/components/editor-snackbars/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-record-item.js +3 -1
- package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js +3 -1
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js +3 -1
- 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 +2 -2
- package/build/components/error-boundary/index.js +5 -3
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/index.js +2 -0
- package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js +3 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build/components/global-styles/block-link.js +2 -0
- package/build/components/global-styles/block-link.js.map +1 -1
- package/build/components/global-styles/header.js +3 -1
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/hooks.js +3 -1
- package/build/components/global-styles/hooks.js.map +2 -2
- package/build/components/global-styles/index.js +3 -1
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/menu.js +3 -1
- package/build/components/global-styles/menu.js.map +1 -1
- package/build/components/global-styles-provider/index.js +3 -1
- package/build/components/global-styles-provider/index.js.map +1 -1
- package/build/components/global-styles-renderer/index.js +2 -0
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/global-styles-sidebar/default-sidebar.js +3 -1
- package/build/components/global-styles-sidebar/default-sidebar.js.map +1 -1
- package/build/components/global-styles-sidebar/index.js +3 -1
- package/build/components/global-styles-sidebar/index.js.map +1 -1
- package/build/components/global-styles-sidebar/welcome-guide-image.js +2 -0
- package/build/components/global-styles-sidebar/welcome-guide-image.js.map +1 -1
- package/build/components/global-styles-sidebar/welcome-guide.js +3 -1
- package/build/components/global-styles-sidebar/welcome-guide.js.map +1 -1
- package/build/components/header/back-button.js +8 -6
- package/build/components/header/back-button.js.map +1 -1
- package/build/components/header/index.js +5 -3
- package/build/components/header/index.js.map +1 -1
- package/build/components/index.js +4 -2
- package/build/components/index.js.map +2 -2
- package/build/components/inserter-sidebar/index.js +4 -2
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +3 -1
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +7 -5
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +3 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/list-view-sidebar/index.js +4 -2
- package/build/components/list-view-sidebar/index.js.map +1 -1
- package/build/components/list-view-sidebar/list-view-outline.js +3 -1
- package/build/components/list-view-sidebar/list-view-outline.js.map +1 -1
- package/build/components/local-autosave-monitor/index.js +6 -4
- package/build/components/local-autosave-monitor/index.js.map +1 -1
- package/build/components/media-categories/index.js +8 -6
- package/build/components/media-categories/index.js.map +1 -1
- package/build/components/mode-switcher/index.js +4 -2
- package/build/components/mode-switcher/index.js.map +1 -1
- package/build/components/more-menu/copy-content-menu-item.js +3 -1
- package/build/components/more-menu/copy-content-menu-item.js.map +1 -1
- package/build/components/more-menu/index.js +4 -2
- package/build/components/more-menu/index.js.map +2 -2
- package/build/components/more-menu/tools-more-menu-group.js +4 -2
- package/build/components/more-menu/tools-more-menu-group.js.map +1 -1
- package/build/components/more-menu/view-more-menu-group.js +4 -2
- package/build/components/more-menu/view-more-menu-group.js.map +1 -1
- package/build/components/page-attributes/check.js +2 -0
- package/build/components/page-attributes/check.js.map +1 -1
- package/build/components/page-attributes/order.js +3 -1
- package/build/components/page-attributes/order.js.map +1 -1
- package/build/components/page-attributes/panel.js +4 -2
- package/build/components/page-attributes/panel.js.map +1 -1
- package/build/components/page-attributes/parent.js +4 -2
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/pattern-duplicate-modal/index.js +5 -3
- package/build/components/pattern-duplicate-modal/index.js.map +1 -1
- package/build/components/pattern-overrides-panel/index.js +4 -2
- package/build/components/pattern-overrides-panel/index.js.map +1 -1
- package/build/components/pattern-rename-modal/index.js +5 -3
- package/build/components/pattern-rename-modal/index.js.map +1 -1
- package/build/components/plugin-document-setting-panel/index.js +5 -3
- package/build/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/plugin-more-menu-item/index.js +3 -1
- package/build/components/plugin-more-menu-item/index.js.map +1 -1
- package/build/components/plugin-post-publish-panel/index.js +5 -3
- package/build/components/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/plugin-post-status-info/index.js +5 -3
- package/build/components/plugin-post-status-info/index.js.map +1 -1
- package/build/components/plugin-pre-publish-panel/index.js +5 -3
- package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/plugin-preview-menu-item/index.js +3 -1
- package/build/components/plugin-preview-menu-item/index.js.map +1 -1
- package/build/components/plugin-sidebar/index.js +3 -1
- package/build/components/plugin-sidebar/index.js.map +1 -1
- package/build/components/plugin-sidebar-more-menu-item/index.js +3 -1
- package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build/components/post-actions/actions.js +3 -1
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +4 -2
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-actions/set-as-homepage.js +5 -3
- package/build/components/post-actions/set-as-homepage.js.map +1 -1
- package/build/components/post-actions/set-as-posts-page.js +5 -3
- package/build/components/post-actions/set-as-posts-page.js.map +1 -1
- package/build/components/post-author/check.js +3 -1
- package/build/components/post-author/check.js.map +1 -1
- package/build/components/post-author/combobox.js +3 -1
- package/build/components/post-author/combobox.js.map +1 -1
- package/build/components/post-author/constants.js +4 -2
- package/build/components/post-author/constants.js.map +1 -1
- package/build/components/post-author/hook.js +2 -0
- package/build/components/post-author/hook.js.map +1 -1
- package/build/components/post-author/index.js +4 -2
- package/build/components/post-author/index.js.map +1 -1
- package/build/components/post-author/panel.js +3 -1
- package/build/components/post-author/panel.js.map +1 -1
- package/build/components/post-author/select.js +3 -1
- package/build/components/post-author/select.js.map +1 -1
- package/build/components/post-card-panel/index.js +4 -2
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-comments/index.js +4 -2
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-content-information/index.js +4 -2
- package/build/components/post-content-information/index.js.map +1 -1
- package/build/components/post-discussion/panel.js +4 -2
- package/build/components/post-discussion/panel.js.map +1 -1
- package/build/components/post-excerpt/check.js +3 -1
- package/build/components/post-excerpt/check.js.map +1 -1
- package/build/components/post-excerpt/index.js +3 -1
- package/build/components/post-excerpt/index.js.map +1 -1
- package/build/components/post-excerpt/panel.js +4 -2
- package/build/components/post-excerpt/panel.js.map +1 -1
- package/build/components/post-excerpt/plugin.js +5 -3
- package/build/components/post-excerpt/plugin.js.map +1 -1
- package/build/components/post-featured-image/check.js +3 -1
- package/build/components/post-featured-image/check.js.map +1 -1
- package/build/components/post-featured-image/index.js +10 -8
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-featured-image/panel.js +4 -2
- package/build/components/post-featured-image/panel.js.map +1 -1
- package/build/components/post-fields/index.js +2 -0
- package/build/components/post-fields/index.js.map +1 -1
- package/build/components/post-format/check.js +3 -1
- package/build/components/post-format/check.js.map +1 -1
- package/build/components/post-format/index.js +4 -2
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-format/panel.js +3 -1
- package/build/components/post-format/panel.js.map +1 -1
- package/build/components/post-last-edited-panel/index.js +3 -1
- package/build/components/post-last-edited-panel/index.js.map +1 -1
- package/build/components/post-last-revision/check.js +3 -1
- package/build/components/post-last-revision/check.js.map +1 -1
- package/build/components/post-last-revision/index.js +3 -1
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-last-revision/panel.js +3 -1
- package/build/components/post-last-revision/panel.js.map +1 -1
- package/build/components/post-locked-modal/index.js +3 -1
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-panel-row/index.js +4 -2
- package/build/components/post-panel-row/index.js.map +1 -1
- package/build/components/post-panel-section/index.js +3 -1
- package/build/components/post-panel-section/index.js.map +1 -1
- package/build/components/post-pending-status/check.js +2 -0
- package/build/components/post-pending-status/check.js.map +1 -1
- package/build/components/post-pending-status/index.js +3 -1
- package/build/components/post-pending-status/index.js.map +1 -1
- package/build/components/post-pingbacks/index.js +3 -1
- package/build/components/post-pingbacks/index.js.map +1 -1
- package/build/components/post-preview-button/index.js +3 -1
- package/build/components/post-preview-button/index.js.map +1 -1
- package/build/components/post-publish-button/index.js +6 -4
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-button/label.js +2 -0
- package/build/components/post-publish-button/label.js.map +1 -1
- package/build/components/post-publish-button/post-publish-button-or-toggle.js +5 -3
- package/build/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
- package/build/components/post-publish-panel/index.js +5 -3
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-category-panel.js +3 -1
- package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +5 -3
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-tags-panel.js +5 -3
- package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +3 -1
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/post-publish-panel/media-util.js +2 -0
- package/build/components/post-publish-panel/media-util.js.map +1 -1
- package/build/components/post-publish-panel/postpublish.js +6 -4
- package/build/components/post-publish-panel/postpublish.js.map +1 -1
- package/build/components/post-publish-panel/prepublish.js +3 -1
- package/build/components/post-publish-panel/prepublish.js.map +1 -1
- package/build/components/post-saved-state/index.js +3 -1
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/check.js +2 -0
- package/build/components/post-schedule/check.js.map +1 -1
- package/build/components/post-schedule/index.js +4 -2
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-schedule/label.js +2 -0
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-schedule/panel.js +4 -2
- package/build/components/post-schedule/panel.js.map +1 -1
- package/build/components/post-status/index.js +6 -4
- package/build/components/post-status/index.js.map +1 -1
- package/build/components/post-sticky/check.js +2 -0
- package/build/components/post-sticky/check.js.map +1 -1
- package/build/components/post-sticky/index.js +3 -1
- package/build/components/post-sticky/index.js.map +1 -1
- package/build/components/post-sticky/panel.js +3 -1
- package/build/components/post-sticky/panel.js.map +1 -1
- package/build/components/post-switch-to-draft-button/index.js +3 -1
- package/build/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build/components/post-sync-status/index.js +3 -1
- package/build/components/post-sync-status/index.js.map +1 -1
- package/build/components/post-taxonomies/check.js +2 -0
- package/build/components/post-taxonomies/check.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +9 -7
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +8 -6
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +4 -2
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js +5 -3
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-taxonomies/panel.js +3 -1
- package/build/components/post-taxonomies/panel.js.map +1 -1
- package/build/components/post-template/block-theme.js +3 -1
- package/build/components/post-template/block-theme.js.map +1 -1
- package/build/components/post-template/classic-theme.js +3 -1
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-template/create-new-template-modal.js +4 -2
- package/build/components/post-template/create-new-template-modal.js.map +1 -1
- package/build/components/post-template/create-new-template.js +3 -1
- package/build/components/post-template/create-new-template.js.map +1 -1
- package/build/components/post-template/hooks.js +2 -0
- package/build/components/post-template/hooks.js.map +1 -1
- package/build/components/post-template/panel.js +12 -7
- package/build/components/post-template/panel.js.map +2 -2
- package/build/components/post-template/reset-default-template.js +3 -1
- package/build/components/post-template/reset-default-template.js.map +1 -1
- package/build/components/post-template/swap-template-button.js +3 -1
- package/build/components/post-template/swap-template-button.js.map +1 -1
- package/build/components/post-text-editor/index.js +3 -1
- package/build/components/post-text-editor/index.js.map +1 -1
- package/build/components/post-title/constants.js +4 -2
- package/build/components/post-title/constants.js.map +1 -1
- package/build/components/post-title/index.js +25 -14
- package/build/components/post-title/index.js.map +2 -2
- package/build/components/post-title/post-title-raw.js +3 -1
- package/build/components/post-title/post-title-raw.js.map +1 -1
- package/build/components/post-title/use-post-title-focus.js +2 -0
- package/build/components/post-title/use-post-title-focus.js.map +1 -1
- package/build/components/post-title/use-post-title.js +2 -0
- package/build/components/post-title/use-post-title.js.map +1 -1
- package/build/components/post-transform-panel/hooks.js +3 -1
- package/build/components/post-transform-panel/hooks.js.map +1 -1
- package/build/components/post-transform-panel/index.js +3 -1
- package/build/components/post-transform-panel/index.js.map +1 -1
- package/build/components/post-trash/check.js +2 -0
- package/build/components/post-trash/check.js.map +1 -1
- package/build/components/post-trash/index.js +3 -1
- package/build/components/post-trash/index.js.map +1 -1
- package/build/components/post-type-support-check/index.js +2 -0
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/post-url/check.js +2 -0
- package/build/components/post-url/check.js.map +1 -1
- package/build/components/post-url/index.js +3 -1
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/label.js +2 -0
- package/build/components/post-url/label.js.map +1 -1
- package/build/components/post-url/panel.js +3 -1
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/post-view-link/index.js +3 -1
- package/build/components/post-view-link/index.js.map +1 -1
- package/build/components/post-visibility/check.js +2 -0
- package/build/components/post-visibility/check.js.map +1 -1
- package/build/components/post-visibility/index.js +3 -1
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/components/post-visibility/label.js +2 -0
- package/build/components/post-visibility/label.js.map +1 -1
- package/build/components/post-visibility/utils.js +3 -1
- package/build/components/post-visibility/utils.js.map +1 -1
- package/build/components/posts-per-page/index.js +3 -1
- package/build/components/posts-per-page/index.js.map +1 -1
- package/build/components/preferences-modal/enable-panel.js +4 -2
- package/build/components/preferences-modal/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/enable-plugin-document-setting-panel.js +5 -3
- package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
- package/build/components/preferences-modal/enable-publish-sidebar.js +4 -2
- package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
- package/build/components/preferences-modal/index.js +5 -3
- package/build/components/preferences-modal/index.js.map +2 -2
- package/build/components/preview-dropdown/index.js +3 -1
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/disable-non-page-content-blocks.js +2 -0
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/index.js +8 -6
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/navigation-block-editing-mode.js +2 -0
- package/build/components/provider/navigation-block-editing-mode.js.map +1 -1
- package/build/components/provider/use-auto-switch-editor-sidebars.js +2 -0
- package/build/components/provider/use-auto-switch-editor-sidebars.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +5 -3
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/provider/use-hide-blocks-from-inserter.js +3 -1
- package/build/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
- package/build/components/provider/use-post-content-blocks.js +3 -1
- package/build/components/provider/use-post-content-blocks.js.map +1 -1
- package/build/components/provider/with-registry-provider.js +4 -2
- package/build/components/provider/with-registry-provider.js.map +1 -1
- package/build/components/resizable-editor/index.js +4 -2
- package/build/components/resizable-editor/index.js.map +1 -1
- package/build/components/resizable-editor/resize-handle.js +4 -2
- package/build/components/resizable-editor/resize-handle.js.map +1 -1
- package/build/components/save-publish-panels/index.js +5 -3
- package/build/components/save-publish-panels/index.js.map +1 -1
- package/build/components/sidebar/constants.js +3 -1
- package/build/components/sidebar/constants.js.map +1 -1
- package/build/components/sidebar/header.js +5 -3
- package/build/components/sidebar/header.js.map +1 -1
- package/build/components/sidebar/index.js +7 -5
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar/post-summary.js +4 -2
- package/build/components/sidebar/post-summary.js.map +1 -1
- package/build/components/site-discussion/index.js +4 -2
- package/build/components/site-discussion/index.js.map +1 -1
- package/build/components/start-page-options/index.js +7 -6
- package/build/components/start-page-options/index.js.map +2 -2
- package/build/components/start-template-options/index.js +3 -1
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/style-book/categories.js +2 -0
- package/build/components/style-book/categories.js.map +1 -1
- package/build/components/style-book/color-examples.js +4 -2
- package/build/components/style-book/color-examples.js.map +1 -1
- package/build/components/style-book/constants.js +9 -7
- package/build/components/style-book/constants.js.map +1 -1
- package/build/components/style-book/duotone-examples.js +4 -2
- package/build/components/style-book/duotone-examples.js.map +1 -1
- package/build/components/style-book/examples.js +3 -1
- package/build/components/style-book/examples.js.map +1 -1
- package/build/components/style-book/index.js +13 -11
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/style-book/types.js +2 -0
- package/build/components/style-book/types.js.map +1 -1
- package/build/components/styles-canvas/index.js +3 -1
- package/build/components/styles-canvas/index.js.map +1 -1
- package/build/components/styles-canvas/revisions.js +4 -2
- package/build/components/styles-canvas/revisions.js.map +1 -1
- package/build/components/styles-canvas/style-book.js +3 -1
- package/build/components/styles-canvas/style-book.js.map +1 -1
- package/build/components/table-of-contents/index.js +3 -1
- package/build/components/table-of-contents/index.js.map +1 -1
- package/build/components/table-of-contents/panel.js +3 -1
- package/build/components/table-of-contents/panel.js.map +1 -1
- package/build/components/template-content-panel/index.js +6 -4
- package/build/components/template-content-panel/index.js.map +1 -1
- package/build/components/template-part-content-panel/index.js +4 -2
- package/build/components/template-part-content-panel/index.js.map +1 -1
- package/build/components/template-part-menu-items/convert-to-regular.js +3 -1
- package/build/components/template-part-menu-items/convert-to-regular.js.map +1 -1
- package/build/components/template-part-menu-items/convert-to-template-part.js +3 -1
- package/build/components/template-part-menu-items/convert-to-template-part.js.map +1 -1
- package/build/components/template-part-menu-items/index.js +3 -1
- package/build/components/template-part-menu-items/index.js.map +1 -1
- package/build/components/template-validation-notice/index.js +3 -1
- package/build/components/template-validation-notice/index.js.map +1 -1
- package/build/components/text-editor/index.js +3 -1
- package/build/components/text-editor/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +2 -0
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/components/time-to-read/index.js +4 -2
- package/build/components/time-to-read/index.js.map +1 -1
- package/build/components/unsaved-changes-warning/index.js +2 -0
- package/build/components/unsaved-changes-warning/index.js.map +1 -1
- package/build/components/visual-editor/edit-template-blocks-notification.js +3 -1
- package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
- package/build/components/visual-editor/index.js +34 -13
- package/build/components/visual-editor/index.js.map +2 -2
- package/build/components/visual-editor/use-edit-content-only-section-exit.js +65 -0
- package/build/components/visual-editor/use-edit-content-only-section-exit.js.map +7 -0
- package/build/components/visual-editor/use-padding-appender.js +75 -0
- package/build/components/visual-editor/use-padding-appender.js.map +7 -0
- package/build/components/visual-editor/use-select-nearest-editable-block.js +3 -1
- package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build/components/visual-editor/use-zoom-out-mode-exit.js +2 -0
- package/build/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -1
- package/build/components/word-count/index.js +3 -1
- package/build/components/word-count/index.js.map +1 -1
- package/build/components/zoom-out-toggle/index.js +4 -2
- package/build/components/zoom-out-toggle/index.js.map +1 -1
- package/build/dataviews/api.js +2 -0
- package/build/dataviews/api.js.map +1 -1
- package/build/dataviews/fields/content-preview/content-preview-view.js +5 -3
- package/build/dataviews/fields/content-preview/content-preview-view.js.map +3 -3
- package/build/dataviews/fields/content-preview/index.js +3 -1
- package/build/dataviews/fields/content-preview/index.js.map +1 -1
- package/build/dataviews/store/private-actions.js +3 -1
- package/build/dataviews/store/private-actions.js.map +1 -1
- package/build/dataviews/store/private-selectors.js +3 -1
- package/build/dataviews/store/private-selectors.js.map +1 -1
- package/build/dataviews/store/reducer.js +2 -0
- package/build/dataviews/store/reducer.js.map +1 -1
- package/build/hooks/custom-sources-backwards-compatibility.js +4 -2
- package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build/hooks/default-autocompleters.js +2 -0
- package/build/hooks/default-autocompleters.js.map +1 -1
- package/build/hooks/index.js +2 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/media-upload.js +3 -1
- package/build/hooks/media-upload.js.map +1 -1
- package/build/hooks/navigation-link-view-button.js +5 -3
- package/build/hooks/navigation-link-view-button.js.map +1 -1
- package/build/hooks/pattern-overrides.js +6 -6
- package/build/hooks/pattern-overrides.js.map +2 -2
- package/build/hooks/push-changes-to-global-styles/index.js +12 -10
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/template-part-navigation-edit-button.js +7 -5
- package/build/hooks/template-part-navigation-edit-button.js.map +1 -1
- package/build/hooks/use-global-styles-output.js +2 -0
- package/build/hooks/use-global-styles-output.js.map +1 -1
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/lock-unlock.js +3 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/private-apis.js +4 -2
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +54 -52
- package/build/store/actions.js.map +2 -2
- package/build/store/constants.js +15 -13
- package/build/store/constants.js.map +1 -1
- package/build/store/defaults.js +3 -1
- package/build/store/defaults.js.map +1 -1
- package/build/store/index.js +4 -2
- package/build/store/index.js.map +1 -1
- package/build/store/local-autosave.js +2 -0
- package/build/store/local-autosave.js.map +1 -1
- package/build/store/private-actions.js +17 -7
- package/build/store/private-actions.js.map +2 -2
- package/build/store/private-selectors.js +15 -8
- package/build/store/private-selectors.js.map +2 -2
- package/build/store/reducer.js +12 -0
- package/build/store/reducer.js.map +2 -2
- package/build/store/selectors.js +80 -78
- package/build/store/selectors.js.map +2 -2
- package/build/store/utils/is-template-revertable.js +2 -0
- package/build/store/utils/is-template-revertable.js.map +1 -1
- package/build/store/utils/notice-builder.js +2 -0
- package/build/store/utils/notice-builder.js.map +1 -1
- package/build/utils/get-item-title.js +2 -0
- package/build/utils/get-item-title.js.map +1 -1
- package/build/utils/get-template-info.js +4 -2
- package/build/utils/get-template-info.js.map +1 -1
- package/build/utils/get-template-part-icon.js +2 -0
- package/build/utils/get-template-part-icon.js.map +1 -1
- package/build/utils/index.js +2 -0
- package/build/utils/index.js.map +1 -1
- package/build/utils/media-sideload/index.js +3 -1
- package/build/utils/media-sideload/index.js.map +1 -1
- package/build/utils/media-upload/index.js +3 -1
- package/build/utils/media-upload/index.js.map +1 -1
- package/build/utils/pageTypeBadge.js +2 -0
- package/build/utils/pageTypeBadge.js.map +1 -1
- package/build/utils/search-templates.js +2 -0
- package/build/utils/search-templates.js.map +1 -1
- package/build/utils/set-nested-value.js +2 -0
- package/build/utils/set-nested-value.js.map +1 -1
- package/build/utils/terms.js +5 -3
- package/build/utils/terms.js.map +1 -1
- package/build/utils/url.js +2 -0
- package/build/utils/url.js.map +1 -1
- package/build-module/bindings/api.js +1 -0
- package/build-module/bindings/api.js.map +1 -1
- package/build-module/bindings/pattern-overrides.js +2 -1
- package/build-module/bindings/pattern-overrides.js.map +1 -1
- package/build-module/bindings/post-data.js +49 -64
- package/build-module/bindings/post-data.js.map +2 -2
- package/build-module/bindings/post-meta.js +46 -39
- package/build-module/bindings/post-meta.js.map +2 -2
- package/build-module/bindings/term-data.js +2 -1
- package/build-module/bindings/term-data.js.map +1 -1
- package/build-module/components/autocompleters/index.js +1 -0
- package/build-module/components/autocompleters/index.js.map +1 -1
- package/build-module/components/autocompleters/user.js +2 -1
- package/build-module/components/autocompleters/user.js.map +1 -1
- package/build-module/components/autosave-monitor/index.js +3 -2
- package/build-module/components/autosave-monitor/index.js.map +1 -1
- package/build-module/components/block-removal-warnings/index.js +5 -4
- package/build-module/components/block-removal-warnings/index.js.map +1 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +5 -4
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build-module/components/block-visibility/index.js +4 -3
- package/build-module/components/block-visibility/index.js.map +1 -1
- package/build-module/components/blog-title/index.js +3 -2
- package/build-module/components/blog-title/index.js.map +1 -1
- package/build-module/components/character-count/index.js +1 -0
- package/build-module/components/character-count/index.js.map +1 -1
- package/build-module/components/collab-sidebar/add-comment.js +21 -18
- package/build-module/components/collab-sidebar/add-comment.js.map +2 -2
- package/build-module/components/collab-sidebar/comment-author-info.js +3 -2
- package/build-module/components/collab-sidebar/comment-author-info.js.map +2 -2
- package/build-module/components/collab-sidebar/comment-form.js +16 -6
- package/build-module/components/collab-sidebar/comment-form.js.map +2 -2
- package/build-module/components/collab-sidebar/comment-indicator-toolbar.js +19 -28
- package/build-module/components/collab-sidebar/comment-indicator-toolbar.js.map +2 -2
- package/build-module/components/collab-sidebar/comment-menu-item.js +43 -9
- package/build-module/components/collab-sidebar/comment-menu-item.js.map +2 -2
- package/build-module/components/collab-sidebar/comments.js +387 -326
- package/build-module/components/collab-sidebar/comments.js.map +2 -2
- package/build-module/components/collab-sidebar/constants.js +4 -3
- package/build-module/components/collab-sidebar/constants.js.map +1 -1
- package/build-module/components/collab-sidebar/hooks.js +7 -4
- package/build-module/components/collab-sidebar/hooks.js.map +2 -2
- package/build-module/components/collab-sidebar/index.js +52 -27
- package/build-module/components/collab-sidebar/index.js.map +2 -2
- package/build-module/components/collab-sidebar/utils.js +3 -2
- package/build-module/components/collab-sidebar/utils.js.map +2 -2
- package/build-module/components/collapsible-block-toolbar/index.js +3 -2
- package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
- package/build-module/components/commands/index.js +21 -8
- package/build-module/components/commands/index.js.map +2 -2
- package/build-module/components/deprecated.js +54 -53
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/document-bar/index.js +3 -2
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-outline/check.js +1 -0
- package/build-module/components/document-outline/check.js.map +1 -1
- package/build-module/components/document-outline/index.js +8 -7
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-outline/item.js +3 -2
- package/build-module/components/document-outline/item.js.map +1 -1
- package/build-module/components/document-tools/index.js +2 -1
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor/index.js +13 -4
- package/build-module/components/editor/index.js.map +2 -2
- package/build-module/components/editor-history/redo.js +2 -1
- package/build-module/components/editor-history/redo.js.map +1 -1
- package/build-module/components/editor-history/undo.js +2 -1
- package/build-module/components/editor-history/undo.js.map +1 -1
- package/build-module/components/editor-interface/index.js +3 -2
- package/build-module/components/editor-interface/index.js.map +1 -1
- package/build-module/components/editor-notices/index.js +2 -1
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js +3 -2
- package/build-module/components/editor-snackbars/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +2 -1
- package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-type-list.js +2 -1
- 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 +2 -1
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +2 -1
- package/build-module/components/entities-saved-states/index.js.map +2 -2
- package/build-module/components/error-boundary/index.js +4 -3
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/index.js +1 -0
- package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +2 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build-module/components/global-styles/block-link.js +1 -0
- package/build-module/components/global-styles/block-link.js.map +1 -1
- package/build-module/components/global-styles/header.js +2 -1
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +2 -1
- package/build-module/components/global-styles/hooks.js.map +2 -2
- package/build-module/components/global-styles/index.js +3 -2
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/menu.js +2 -1
- package/build-module/components/global-styles/menu.js.map +1 -1
- package/build-module/components/global-styles-provider/index.js +2 -1
- package/build-module/components/global-styles-provider/index.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js +1 -0
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/global-styles-sidebar/default-sidebar.js +2 -1
- package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -1
- package/build-module/components/global-styles-sidebar/index.js +2 -1
- package/build-module/components/global-styles-sidebar/index.js.map +1 -1
- package/build-module/components/global-styles-sidebar/welcome-guide-image.js +1 -0
- package/build-module/components/global-styles-sidebar/welcome-guide-image.js.map +1 -1
- package/build-module/components/global-styles-sidebar/welcome-guide.js +2 -1
- package/build-module/components/global-styles-sidebar/welcome-guide.js.map +1 -1
- package/build-module/components/header/back-button.js +7 -6
- package/build-module/components/header/back-button.js.map +1 -1
- package/build-module/components/header/index.js +4 -3
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/index.js +3 -2
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inserter-sidebar/index.js +3 -2
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +2 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +6 -5
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +5 -4
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/list-view-sidebar/index.js +3 -2
- package/build-module/components/list-view-sidebar/index.js.map +1 -1
- package/build-module/components/list-view-sidebar/list-view-outline.js +2 -1
- package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
- package/build-module/components/local-autosave-monitor/index.js +5 -4
- package/build-module/components/local-autosave-monitor/index.js.map +1 -1
- package/build-module/components/media-categories/index.js +7 -6
- package/build-module/components/media-categories/index.js.map +1 -1
- package/build-module/components/mode-switcher/index.js +3 -2
- package/build-module/components/mode-switcher/index.js.map +1 -1
- package/build-module/components/more-menu/copy-content-menu-item.js +2 -1
- package/build-module/components/more-menu/copy-content-menu-item.js.map +1 -1
- package/build-module/components/more-menu/index.js +3 -2
- package/build-module/components/more-menu/index.js.map +2 -2
- package/build-module/components/more-menu/tools-more-menu-group.js +3 -2
- package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -1
- package/build-module/components/more-menu/view-more-menu-group.js +3 -2
- package/build-module/components/more-menu/view-more-menu-group.js.map +1 -1
- package/build-module/components/page-attributes/check.js +1 -0
- package/build-module/components/page-attributes/check.js.map +1 -1
- package/build-module/components/page-attributes/order.js +2 -1
- package/build-module/components/page-attributes/order.js.map +1 -1
- package/build-module/components/page-attributes/panel.js +3 -2
- package/build-module/components/page-attributes/panel.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +3 -2
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/pattern-duplicate-modal/index.js +4 -3
- package/build-module/components/pattern-duplicate-modal/index.js.map +1 -1
- package/build-module/components/pattern-overrides-panel/index.js +3 -2
- package/build-module/components/pattern-overrides-panel/index.js.map +1 -1
- package/build-module/components/pattern-rename-modal/index.js +4 -3
- package/build-module/components/pattern-rename-modal/index.js.map +1 -1
- package/build-module/components/plugin-document-setting-panel/index.js +4 -3
- package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/components/plugin-more-menu-item/index.js +2 -1
- package/build-module/components/plugin-more-menu-item/index.js.map +1 -1
- package/build-module/components/plugin-post-publish-panel/index.js +4 -3
- package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
- package/build-module/components/plugin-post-status-info/index.js +4 -3
- package/build-module/components/plugin-post-status-info/index.js.map +1 -1
- package/build-module/components/plugin-pre-publish-panel/index.js +4 -3
- package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/plugin-preview-menu-item/index.js +2 -1
- package/build-module/components/plugin-preview-menu-item/index.js.map +1 -1
- package/build-module/components/plugin-sidebar/index.js +2 -1
- package/build-module/components/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/plugin-sidebar-more-menu-item/index.js +2 -1
- package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build-module/components/post-actions/actions.js +2 -1
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +3 -2
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-actions/set-as-homepage.js +4 -3
- package/build-module/components/post-actions/set-as-homepage.js.map +1 -1
- package/build-module/components/post-actions/set-as-posts-page.js +4 -3
- package/build-module/components/post-actions/set-as-posts-page.js.map +1 -1
- package/build-module/components/post-author/check.js +2 -1
- package/build-module/components/post-author/check.js.map +1 -1
- package/build-module/components/post-author/combobox.js +2 -1
- package/build-module/components/post-author/combobox.js.map +1 -1
- package/build-module/components/post-author/constants.js +3 -2
- package/build-module/components/post-author/constants.js.map +1 -1
- 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-author/index.js +3 -2
- package/build-module/components/post-author/index.js.map +1 -1
- package/build-module/components/post-author/panel.js +2 -1
- package/build-module/components/post-author/panel.js.map +1 -1
- package/build-module/components/post-author/select.js +2 -1
- package/build-module/components/post-author/select.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +3 -2
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-comments/index.js +3 -2
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-content-information/index.js +3 -2
- package/build-module/components/post-content-information/index.js.map +1 -1
- package/build-module/components/post-discussion/panel.js +3 -2
- package/build-module/components/post-discussion/panel.js.map +1 -1
- package/build-module/components/post-excerpt/check.js +2 -1
- package/build-module/components/post-excerpt/check.js.map +1 -1
- package/build-module/components/post-excerpt/index.js +2 -1
- package/build-module/components/post-excerpt/index.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js +3 -2
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-excerpt/plugin.js +4 -3
- package/build-module/components/post-excerpt/plugin.js.map +1 -1
- package/build-module/components/post-featured-image/check.js +2 -1
- package/build-module/components/post-featured-image/check.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +9 -8
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-featured-image/panel.js +3 -2
- package/build-module/components/post-featured-image/panel.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/check.js +2 -1
- package/build-module/components/post-format/check.js.map +1 -1
- package/build-module/components/post-format/index.js +3 -2
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-format/panel.js +2 -1
- package/build-module/components/post-format/panel.js.map +1 -1
- package/build-module/components/post-last-edited-panel/index.js +2 -1
- package/build-module/components/post-last-edited-panel/index.js.map +1 -1
- package/build-module/components/post-last-revision/check.js +2 -1
- package/build-module/components/post-last-revision/check.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +2 -1
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-last-revision/panel.js +2 -1
- package/build-module/components/post-last-revision/panel.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +2 -1
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-panel-row/index.js +3 -2
- package/build-module/components/post-panel-row/index.js.map +1 -1
- package/build-module/components/post-panel-section/index.js +2 -1
- package/build-module/components/post-panel-section/index.js.map +1 -1
- package/build-module/components/post-pending-status/check.js +1 -0
- package/build-module/components/post-pending-status/check.js.map +1 -1
- package/build-module/components/post-pending-status/index.js +2 -1
- package/build-module/components/post-pending-status/index.js.map +1 -1
- package/build-module/components/post-pingbacks/index.js +2 -1
- package/build-module/components/post-pingbacks/index.js.map +1 -1
- package/build-module/components/post-preview-button/index.js +2 -1
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +5 -4
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/label.js +1 -0
- package/build-module/components/post-publish-button/label.js.map +1 -1
- package/build-module/components/post-publish-button/post-publish-button-or-toggle.js +4 -3
- package/build-module/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +4 -3
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js +2 -1
- 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 +4 -3
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-tags-panel.js +4 -3
- package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js +2 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/post-publish-panel/media-util.js +1 -0
- package/build-module/components/post-publish-panel/media-util.js.map +1 -1
- package/build-module/components/post-publish-panel/postpublish.js +5 -4
- package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
- package/build-module/components/post-publish-panel/prepublish.js +2 -1
- package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +2 -1
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/check.js +1 -0
- package/build-module/components/post-schedule/check.js.map +1 -1
- package/build-module/components/post-schedule/index.js +3 -2
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-schedule/label.js +1 -0
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-schedule/panel.js +3 -2
- package/build-module/components/post-schedule/panel.js.map +1 -1
- package/build-module/components/post-status/index.js +5 -4
- package/build-module/components/post-status/index.js.map +1 -1
- package/build-module/components/post-sticky/check.js +1 -0
- package/build-module/components/post-sticky/check.js.map +1 -1
- package/build-module/components/post-sticky/index.js +2 -1
- package/build-module/components/post-sticky/index.js.map +1 -1
- package/build-module/components/post-sticky/panel.js +2 -1
- package/build-module/components/post-sticky/panel.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +2 -1
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-sync-status/index.js +2 -1
- package/build-module/components/post-sync-status/index.js.map +1 -1
- package/build-module/components/post-taxonomies/check.js +1 -0
- package/build-module/components/post-taxonomies/check.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +8 -7
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +7 -6
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +3 -2
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +4 -3
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-taxonomies/panel.js +2 -1
- package/build-module/components/post-taxonomies/panel.js.map +1 -1
- package/build-module/components/post-template/block-theme.js +2 -1
- package/build-module/components/post-template/block-theme.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +2 -1
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/create-new-template-modal.js +3 -2
- package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
- package/build-module/components/post-template/create-new-template.js +2 -1
- package/build-module/components/post-template/create-new-template.js.map +1 -1
- package/build-module/components/post-template/hooks.js +1 -0
- package/build-module/components/post-template/hooks.js.map +1 -1
- package/build-module/components/post-template/panel.js +11 -7
- package/build-module/components/post-template/panel.js.map +2 -2
- package/build-module/components/post-template/reset-default-template.js +2 -1
- package/build-module/components/post-template/reset-default-template.js.map +1 -1
- package/build-module/components/post-template/swap-template-button.js +2 -1
- package/build-module/components/post-template/swap-template-button.js.map +1 -1
- package/build-module/components/post-text-editor/index.js +2 -1
- package/build-module/components/post-text-editor/index.js.map +1 -1
- package/build-module/components/post-title/constants.js +3 -2
- package/build-module/components/post-title/constants.js.map +1 -1
- package/build-module/components/post-title/index.js +21 -11
- package/build-module/components/post-title/index.js.map +2 -2
- package/build-module/components/post-title/post-title-raw.js +2 -1
- package/build-module/components/post-title/post-title-raw.js.map +1 -1
- package/build-module/components/post-title/use-post-title-focus.js +1 -0
- package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
- package/build-module/components/post-title/use-post-title.js +1 -0
- package/build-module/components/post-title/use-post-title.js.map +1 -1
- package/build-module/components/post-transform-panel/hooks.js +2 -1
- package/build-module/components/post-transform-panel/hooks.js.map +1 -1
- package/build-module/components/post-transform-panel/index.js +2 -1
- package/build-module/components/post-transform-panel/index.js.map +1 -1
- package/build-module/components/post-trash/check.js +1 -0
- package/build-module/components/post-trash/check.js.map +1 -1
- package/build-module/components/post-trash/index.js +2 -1
- package/build-module/components/post-trash/index.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/post-url/check.js +1 -0
- package/build-module/components/post-url/check.js.map +1 -1
- package/build-module/components/post-url/index.js +2 -1
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/label.js +1 -0
- package/build-module/components/post-url/label.js.map +1 -1
- package/build-module/components/post-url/panel.js +2 -1
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/post-view-link/index.js +2 -1
- package/build-module/components/post-view-link/index.js.map +1 -1
- package/build-module/components/post-visibility/check.js +1 -0
- package/build-module/components/post-visibility/check.js.map +1 -1
- package/build-module/components/post-visibility/index.js +2 -1
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/components/post-visibility/label.js +1 -0
- package/build-module/components/post-visibility/label.js.map +1 -1
- package/build-module/components/post-visibility/utils.js +2 -1
- package/build-module/components/post-visibility/utils.js.map +1 -1
- package/build-module/components/posts-per-page/index.js +2 -1
- package/build-module/components/posts-per-page/index.js.map +1 -1
- package/build-module/components/preferences-modal/enable-panel.js +3 -2
- package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
- package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js +4 -3
- package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
- package/build-module/components/preferences-modal/enable-publish-sidebar.js +3 -2
- package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +4 -3
- package/build-module/components/preferences-modal/index.js.map +2 -2
- package/build-module/components/preview-dropdown/index.js +2 -1
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js +1 -0
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/provider/index.js +7 -6
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/navigation-block-editing-mode.js +1 -0
- package/build-module/components/provider/navigation-block-editing-mode.js.map +1 -1
- package/build-module/components/provider/use-auto-switch-editor-sidebars.js +1 -0
- package/build-module/components/provider/use-auto-switch-editor-sidebars.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +4 -3
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/provider/use-hide-blocks-from-inserter.js +2 -1
- package/build-module/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
- package/build-module/components/provider/use-post-content-blocks.js +2 -1
- package/build-module/components/provider/use-post-content-blocks.js.map +1 -1
- package/build-module/components/provider/with-registry-provider.js +3 -2
- package/build-module/components/provider/with-registry-provider.js.map +1 -1
- package/build-module/components/resizable-editor/index.js +3 -2
- package/build-module/components/resizable-editor/index.js.map +1 -1
- package/build-module/components/resizable-editor/resize-handle.js +3 -2
- package/build-module/components/resizable-editor/resize-handle.js.map +1 -1
- package/build-module/components/save-publish-panels/index.js +4 -3
- package/build-module/components/save-publish-panels/index.js.map +1 -1
- package/build-module/components/sidebar/constants.js +2 -1
- package/build-module/components/sidebar/constants.js.map +1 -1
- package/build-module/components/sidebar/header.js +4 -3
- package/build-module/components/sidebar/header.js.map +1 -1
- package/build-module/components/sidebar/index.js +6 -5
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-summary.js +3 -2
- package/build-module/components/sidebar/post-summary.js.map +1 -1
- package/build-module/components/site-discussion/index.js +3 -2
- package/build-module/components/site-discussion/index.js.map +1 -1
- package/build-module/components/start-page-options/index.js +7 -7
- package/build-module/components/start-page-options/index.js.map +2 -2
- package/build-module/components/start-template-options/index.js +2 -1
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/style-book/categories.js +1 -0
- package/build-module/components/style-book/categories.js.map +1 -1
- package/build-module/components/style-book/color-examples.js +3 -2
- package/build-module/components/style-book/color-examples.js.map +1 -1
- package/build-module/components/style-book/constants.js +8 -7
- package/build-module/components/style-book/constants.js.map +1 -1
- package/build-module/components/style-book/duotone-examples.js +3 -2
- package/build-module/components/style-book/duotone-examples.js.map +1 -1
- package/build-module/components/style-book/examples.js +2 -1
- package/build-module/components/style-book/examples.js.map +1 -1
- package/build-module/components/style-book/index.js +12 -11
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/styles-canvas/index.js +2 -1
- package/build-module/components/styles-canvas/index.js.map +1 -1
- package/build-module/components/styles-canvas/revisions.js +3 -2
- package/build-module/components/styles-canvas/revisions.js.map +1 -1
- package/build-module/components/styles-canvas/style-book.js +2 -1
- package/build-module/components/styles-canvas/style-book.js.map +1 -1
- package/build-module/components/table-of-contents/index.js +2 -1
- package/build-module/components/table-of-contents/index.js.map +1 -1
- package/build-module/components/table-of-contents/panel.js +2 -1
- package/build-module/components/table-of-contents/panel.js.map +1 -1
- package/build-module/components/template-content-panel/index.js +5 -4
- package/build-module/components/template-content-panel/index.js.map +1 -1
- package/build-module/components/template-part-content-panel/index.js +3 -2
- package/build-module/components/template-part-content-panel/index.js.map +1 -1
- package/build-module/components/template-part-menu-items/convert-to-regular.js +2 -1
- package/build-module/components/template-part-menu-items/convert-to-regular.js.map +1 -1
- package/build-module/components/template-part-menu-items/convert-to-template-part.js +2 -1
- package/build-module/components/template-part-menu-items/convert-to-template-part.js.map +1 -1
- package/build-module/components/template-part-menu-items/index.js +2 -1
- package/build-module/components/template-part-menu-items/index.js.map +1 -1
- package/build-module/components/template-validation-notice/index.js +2 -1
- package/build-module/components/template-validation-notice/index.js.map +1 -1
- package/build-module/components/text-editor/index.js +2 -1
- package/build-module/components/text-editor/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/time-to-read/index.js +3 -2
- package/build-module/components/time-to-read/index.js.map +1 -1
- package/build-module/components/unsaved-changes-warning/index.js +1 -0
- package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
- package/build-module/components/visual-editor/edit-template-blocks-notification.js +2 -1
- package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
- package/build-module/components/visual-editor/index.js +33 -13
- package/build-module/components/visual-editor/index.js.map +2 -2
- package/build-module/components/visual-editor/use-edit-content-only-section-exit.js +40 -0
- package/build-module/components/visual-editor/use-edit-content-only-section-exit.js.map +7 -0
- package/build-module/components/visual-editor/use-padding-appender.js +50 -0
- package/build-module/components/visual-editor/use-padding-appender.js.map +7 -0
- package/build-module/components/visual-editor/use-select-nearest-editable-block.js +2 -1
- package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build-module/components/visual-editor/use-zoom-out-mode-exit.js +1 -0
- package/build-module/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -1
- package/build-module/components/word-count/index.js +2 -1
- package/build-module/components/word-count/index.js.map +1 -1
- package/build-module/components/zoom-out-toggle/index.js +3 -2
- package/build-module/components/zoom-out-toggle/index.js.map +1 -1
- package/build-module/dataviews/api.js +1 -0
- package/build-module/dataviews/api.js.map +1 -1
- package/build-module/dataviews/fields/content-preview/content-preview-view.js +5 -5
- package/build-module/dataviews/fields/content-preview/content-preview-view.js.map +2 -2
- package/build-module/dataviews/fields/content-preview/index.js +2 -1
- package/build-module/dataviews/fields/content-preview/index.js.map +1 -1
- package/build-module/dataviews/store/private-actions.js +2 -1
- package/build-module/dataviews/store/private-actions.js.map +1 -1
- package/build-module/dataviews/store/private-selectors.js +2 -1
- package/build-module/dataviews/store/private-selectors.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 +3 -2
- package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build-module/hooks/default-autocompleters.js +1 -0
- package/build-module/hooks/default-autocompleters.js.map +1 -1
- package/build-module/hooks/index.js +1 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/media-upload.js +2 -1
- package/build-module/hooks/media-upload.js.map +1 -1
- package/build-module/hooks/navigation-link-view-button.js +4 -3
- package/build-module/hooks/navigation-link-view-button.js.map +1 -1
- package/build-module/hooks/pattern-overrides.js +5 -6
- package/build-module/hooks/pattern-overrides.js.map +2 -2
- package/build-module/hooks/push-changes-to-global-styles/index.js +11 -10
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/template-part-navigation-edit-button.js +6 -5
- package/build-module/hooks/template-part-navigation-edit-button.js.map +1 -1
- package/build-module/hooks/use-global-styles-output.js +1 -0
- package/build-module/hooks/use-global-styles-output.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/lock-unlock.js +2 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/private-apis.js +3 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +53 -52
- package/build-module/store/actions.js.map +2 -2
- package/build-module/store/constants.js +14 -13
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/defaults.js +2 -1
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/index.js +3 -2
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/local-autosave.js +1 -0
- package/build-module/store/local-autosave.js.map +1 -1
- package/build-module/store/private-actions.js +15 -7
- package/build-module/store/private-actions.js.map +2 -2
- package/build-module/store/private-selectors.js +13 -8
- package/build-module/store/private-selectors.js.map +2 -2
- package/build-module/store/reducer.js +10 -0
- package/build-module/store/reducer.js.map +2 -2
- package/build-module/store/selectors.js +79 -78
- package/build-module/store/selectors.js.map +2 -2
- package/build-module/store/utils/is-template-revertable.js +1 -0
- package/build-module/store/utils/is-template-revertable.js.map +1 -1
- package/build-module/store/utils/notice-builder.js +1 -0
- package/build-module/store/utils/notice-builder.js.map +1 -1
- package/build-module/utils/get-item-title.js +1 -0
- package/build-module/utils/get-item-title.js.map +1 -1
- package/build-module/utils/get-template-info.js +3 -2
- package/build-module/utils/get-template-info.js.map +1 -1
- package/build-module/utils/get-template-part-icon.js +1 -0
- package/build-module/utils/get-template-part-icon.js.map +1 -1
- package/build-module/utils/index.js +1 -0
- package/build-module/utils/index.js.map +1 -1
- package/build-module/utils/media-sideload/index.js +2 -1
- package/build-module/utils/media-sideload/index.js.map +1 -1
- package/build-module/utils/media-upload/index.js +2 -1
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/build-module/utils/pageTypeBadge.js +1 -0
- package/build-module/utils/pageTypeBadge.js.map +1 -1
- package/build-module/utils/search-templates.js +1 -0
- package/build-module/utils/search-templates.js.map +1 -1
- package/build-module/utils/set-nested-value.js +1 -0
- package/build-module/utils/set-nested-value.js.map +1 -1
- package/build-module/utils/terms.js +4 -3
- package/build-module/utils/terms.js.map +1 -1
- package/build-module/utils/url.js +1 -0
- package/build-module/utils/url.js.map +1 -1
- package/build-style/style-rtl.css +58 -82
- package/build-style/style.css +58 -82
- package/build-types/bindings/post-data.d.ts +18 -8
- package/build-types/bindings/post-meta.d.ts +1 -7
- package/build-types/components/collab-sidebar/add-comment.d.ts +3 -3
- package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comment-form.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comment-menu-item.d.ts +3 -2
- package/build-types/components/collab-sidebar/comment-menu-item.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comments.d.ts +3 -3
- package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/hooks.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
- package/build-types/components/commands/index.d.ts.map +1 -1
- package/build-types/components/editor/index.d.ts.map +1 -1
- package/build-types/components/entities-saved-states/index.d.ts +2 -2
- package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
- package/build-types/components/global-styles/hooks.d.ts +6 -6
- package/build-types/components/global-styles/hooks.d.ts.map +1 -1
- package/build-types/components/header/back-button.d.ts.map +1 -1
- package/build-types/components/local-autosave-monitor/index.d.ts.map +1 -1
- package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -1
- package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -1
- package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -1
- package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -1
- package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -1
- package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -1
- package/build-types/components/post-excerpt/plugin.d.ts.map +1 -1
- package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
- package/build-types/components/post-publish-button/index.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +1 -10
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
- package/build-types/components/post-template/panel.d.ts.map +1 -1
- package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -1
- package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
- package/build-types/components/start-page-options/index.d.ts.map +1 -1
- package/build-types/components/style-book/color-examples.d.ts.map +1 -1
- package/build-types/components/style-book/duotone-examples.d.ts.map +1 -1
- package/build-types/components/visual-editor/index.d.ts.map +1 -1
- package/build-types/components/visual-editor/use-edit-content-only-section-exit.d.ts +6 -0
- package/build-types/components/visual-editor/use-edit-content-only-section-exit.d.ts.map +1 -0
- package/build-types/components/visual-editor/use-padding-appender.d.ts +2 -0
- package/build-types/components/visual-editor/use-padding-appender.d.ts.map +1 -0
- package/build-types/dataviews/fields/content-preview/content-preview-view.d.ts.map +1 -1
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
- package/build-types/store/actions.d.ts +3 -4
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/private-actions.d.ts +7 -0
- package/build-types/store/private-actions.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts +12 -5
- package/build-types/store/private-selectors.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts +10 -0
- package/build-types/store/reducer.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +68 -68
- package/build-types/store/selectors.d.ts.map +1 -1
- package/package.json +40 -40
- package/src/bindings/post-data.js +63 -111
- package/src/bindings/post-meta.js +55 -46
- package/src/bindings/test/post-meta.js +211 -0
- package/src/components/collab-sidebar/add-comment.js +19 -16
- package/src/components/collab-sidebar/comment-author-info.js +1 -1
- package/src/components/collab-sidebar/comment-form.js +16 -4
- package/src/components/collab-sidebar/comment-indicator-toolbar.js +19 -29
- package/src/components/collab-sidebar/comment-menu-item.js +51 -11
- package/src/components/collab-sidebar/comments.js +173 -80
- package/src/components/collab-sidebar/hooks.js +6 -4
- package/src/components/collab-sidebar/index.js +78 -40
- package/src/components/collab-sidebar/style.scss +20 -44
- package/src/components/collab-sidebar/utils.js +3 -2
- package/src/components/commands/index.js +32 -19
- package/src/components/editor/index.js +12 -1
- package/src/components/entities-saved-states/index.js +1 -1
- package/src/components/global-styles/hooks.js +4 -4
- package/src/components/more-menu/index.js +1 -1
- package/src/components/post-template/panel.js +11 -8
- package/src/components/post-title/index.js +22 -9
- package/src/components/preferences-modal/index.js +1 -1
- package/src/components/start-page-options/index.js +5 -6
- package/src/components/start-page-options/style.scss +1 -1
- package/src/components/visual-editor/index.js +36 -6
- package/src/components/visual-editor/use-edit-content-only-section-exit.js +55 -0
- package/src/components/visual-editor/use-padding-appender.js +70 -0
- package/src/dataviews/fields/content-preview/content-preview-view.tsx +2 -5
- package/src/hooks/pattern-overrides.js +0 -2
- package/src/store/actions.js +9 -1
- package/src/store/private-actions.js +13 -0
- package/src/store/private-selectors.js +10 -0
- package/src/store/reducer.js +16 -0
- package/src/store/selectors.js +0 -2
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -16,17 +16,19 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/editor/src/components/post-author/select.js
|
|
19
21
|
var select_exports = {};
|
|
20
22
|
__export(select_exports, {
|
|
21
23
|
default: () => PostAuthorSelect
|
|
22
24
|
});
|
|
23
25
|
module.exports = __toCommonJS(select_exports);
|
|
24
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
26
|
var import_i18n = require("@wordpress/i18n");
|
|
26
27
|
var import_data = require("@wordpress/data");
|
|
27
28
|
var import_components = require("@wordpress/components");
|
|
28
29
|
var import_store = require("../../store");
|
|
29
30
|
var import_hook = require("./hook");
|
|
31
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
30
32
|
function PostAuthorSelect() {
|
|
31
33
|
const { editPost } = (0, import_data.useDispatch)(import_store.store);
|
|
32
34
|
const { authorId, authorOptions } = (0, import_hook.useAuthorsQuery)();
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-author/select.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { SelectControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { useAuthorsQuery } from './hook';\n\nexport default function PostAuthorSelect() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { authorId, authorOptions } = useAuthorsQuery();\n\n\tconst setAuthorId = ( value ) => {\n\t\tconst author = Number( value );\n\t\teditPost( { author } );\n\t};\n\n\treturn (\n\t\t<SelectControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tclassName=\"post-author-selector\"\n\t\t\tlabel={ __( 'Author' ) }\n\t\t\toptions={ authorOptions }\n\t\t\tonChange={ setAuthorId }\n\t\t\tvalue={ authorId }\n\t\t\thideLabelFromVision\n\t\t/>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,kBAA4B;AAC5B,wBAA8B;AAK9B,mBAAqC;AACrC,kBAAgC;AAY9B;AAVa,SAAR,mBAAoC;AAC1C,QAAM,EAAE,SAAS,QAAI,yBAAa,aAAAA,KAAY;AAC9C,QAAM,EAAE,UAAU,cAAc,QAAI,6BAAgB;AAEpD,QAAM,cAAc,CAAE,UAAW;AAChC,UAAM,SAAS,OAAQ,KAAM;AAC7B,aAAU,EAAE,OAAO,CAAE;AAAA,EACtB;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,uBAAqB;AAAA,MACrB,yBAAuB;AAAA,MACvB,WAAU;AAAA,MACV,WAAQ,gBAAI,QAAS;AAAA,MACrB,SAAU;AAAA,MACV,UAAW;AAAA,MACX,OAAQ;AAAA,MACR,qBAAmB;AAAA;AAAA,EACpB;AAEF;",
|
|
6
6
|
"names": ["editorStore"]
|
|
7
7
|
}
|
|
@@ -26,12 +26,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/editor/src/components/post-card-panel/index.js
|
|
29
31
|
var post_card_panel_exports = {};
|
|
30
32
|
__export(post_card_panel_exports, {
|
|
31
33
|
default: () => PostCardPanel
|
|
32
34
|
});
|
|
33
35
|
module.exports = __toCommonJS(post_card_panel_exports);
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
36
|
var import_components = require("@wordpress/components");
|
|
36
37
|
var import_core_data = require("@wordpress/core-data");
|
|
37
38
|
var import_data = require("@wordpress/data");
|
|
@@ -44,7 +45,8 @@ var import_lock_unlock = require("../../lock-unlock");
|
|
|
44
45
|
var import_post_actions = __toESM(require("../post-actions"));
|
|
45
46
|
var import_pageTypeBadge = __toESM(require("../../utils/pageTypeBadge"));
|
|
46
47
|
var import_get_template_info = require("../../utils/get-template-info");
|
|
47
|
-
|
|
48
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
49
|
+
var { Badge } = (0, import_lock_unlock.unlock)(import_components.privateApis);
|
|
48
50
|
function PostCardPanel({
|
|
49
51
|
postType,
|
|
50
52
|
postId,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-card-panel/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tIcon,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalText as Text,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../store/constants';\nimport { unlock } from '../../lock-unlock';\nimport PostActions from '../post-actions';\nimport usePageTypeBadge from '../../utils/pageTypeBadge';\nimport { getTemplateInfo } from '../../utils/get-template-info';\nconst { Badge } = unlock( componentsPrivateApis );\n\n/**\n * Renders a title of the post type and the available quick actions available within a 3-dot dropdown.\n *\n * @param {Object} props - Component props.\n * @param {string} [props.postType] - The post type string.\n * @param {string|string[]} [props.postId] - The post id or list of post ids.\n * @param {Function} [props.onActionPerformed] - A callback function for when a quick action is performed.\n * @return {React.ReactNode} The rendered component.\n */\nexport default function PostCardPanel( {\n\tpostType,\n\tpostId,\n\tonActionPerformed,\n} ) {\n\tconst postIds = useMemo(\n\t\t() => ( Array.isArray( postId ) ? postId : [ postId ] ),\n\t\t[ postId ]\n\t);\n\tconst { postTitle, icon, labels } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getCurrentTheme, getPostType } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst { getPostIcon } = unlock( select( editorStore ) );\n\t\t\tlet _title = '';\n\t\t\tconst _record = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostIds[ 0 ]\n\t\t\t);\n\t\t\tif ( postIds.length === 1 ) {\n\t\t\t\tconst { default_template_types: templateTypes = [] } =\n\t\t\t\t\tgetCurrentTheme() ?? {};\n\n\t\t\t\tconst _templateInfo = [\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t].includes( postType )\n\t\t\t\t\t? getTemplateInfo( {\n\t\t\t\t\t\t\ttemplate: _record,\n\t\t\t\t\t\t\ttemplateTypes,\n\t\t\t\t\t } )\n\t\t\t\t\t: {};\n\t\t\t\t_title = _templateInfo?.title || _record?.title;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tpostTitle: _title,\n\t\t\t\ticon: getPostIcon( postType, {\n\t\t\t\t\tarea: _record?.area,\n\t\t\t\t} ),\n\t\t\t\tlabels: getPostType( postType )?.labels,\n\t\t\t};\n\t\t},\n\t\t[ postIds, postType ]\n\t);\n\n\tconst pageTypeBadge = usePageTypeBadge( postId );\n\tlet title = __( 'No title' );\n\tif ( labels?.name && postIds.length > 1 ) {\n\t\ttitle = sprintf(\n\t\t\t// translators: %1$d number of selected items %2$s: Name of the plural post type e.g: \"Posts\".\n\t\t\t__( '%1$d %2$s' ),\n\t\t\tpostIds.length,\n\t\t\tlabels?.name\n\t\t);\n\t} else if ( postTitle ) {\n\t\ttitle = stripHTML( postTitle );\n\t}\n\n\treturn (\n\t\t<VStack spacing={ 1 } className=\"editor-post-card-panel\">\n\t\t\t<HStack\n\t\t\t\tspacing={ 2 }\n\t\t\t\tclassName=\"editor-post-card-panel__header\"\n\t\t\t\talign=\"flex-start\"\n\t\t\t>\n\t\t\t\t<Icon className=\"editor-post-card-panel__icon\" icon={ icon } />\n\t\t\t\t<Text\n\t\t\t\t\tnumberOfLines={ 2 }\n\t\t\t\t\ttruncate\n\t\t\t\t\tclassName=\"editor-post-card-panel__title\"\n\t\t\t\t\tas=\"h2\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"editor-post-card-panel__title-name\">\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</span>\n\t\t\t\t\t{ pageTypeBadge && postIds.length === 1 && (\n\t\t\t\t\t\t<Badge>{ pageTypeBadge }</Badge>\n\t\t\t\t\t) }\n\t\t\t\t</Text>\n\t\t\t\t{ postIds.length === 1 && (\n\t\t\t\t\t<PostActions\n\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\tpostId={ postIds[ 0 ] }\n\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t\t{ postIds.length > 1 && (\n\t\t\t\t<Text className=\"editor-post-card-panel__description\">\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t// translators: %s: Name of the plural post type e.g: \"Posts\".\n\t\t\t\t\t\t__( 'Changes will be applied to all selected %s.' ),\n\t\t\t\t\t\tlabels?.name.toLowerCase()\n\t\t\t\t\t) }\n\t\t\t\t</Text>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAMO;AACP,uBAAmC;AACnC,kBAA0B;AAC1B,qBAAwB;AACxB,kBAA4B;AAC5B,iBAAiD;AAKjD,mBAAqC;AACrC,uBAGO;AACP,yBAAuB;AACvB,0BAAwB;AACxB,2BAA6B;AAC7B,+BAAgC;AA+E5B;AA9EJ,IAAM,EAAE,MAAM,QAAI,2BAAQ,kBAAAA,WAAsB;AAWjC,SAAR,cAAgC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,cAAU;AAAA,IACf,MAAQ,MAAM,QAAS,MAAO,IAAI,SAAS,CAAE,MAAO;AAAA,IACpD,CAAE,MAAO;AAAA,EACV;AACA,QAAM,EAAE,WAAW,MAAM,OAAO,QAAI;AAAA,IACnC,CAAE,WAAY;AACb,YAAM,EAAE,uBAAuB,iBAAiB,YAAY,IA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AgB;AAAA,cAChB,UAAQ;AAAA,cACR,WAAU;AAAA,cACV,IAAG;AAAA,cAEH;AAAA,4DAAC,UAAK,WAAU,sCACb,iBACH;AAAA,gBACE,iBAAiB,QAAQ,WAAW,KACrC,4CAAC,SAAQ,yBAAe;AAAA;AAAA;AAAA,UAE1B;AAAA,UACE,QAAQ,WAAW,KACpB;AAAA,YAAC,oBAAAC;AAAA,YAAA;AAAA,cACA;AAAA,cACA,QAAS,QAAS,CAAE;AAAA,cACpB;AAAA;AAAA,UACD;AAAA;AAAA;AAAA,IAEF;AAAA,IACE,QAAQ,SAAS,KAClB,4CAAC,kBAAAD,oBAAA,EAAK,WAAU,uCACb;AAAA;AAAA,UAED,gBAAI,6CAA8C;AAAA,MAClD,QAAQ,KAAK,YAAY;AAAA,IAC1B,GACD;AAAA,KAEF;AAEF;",
|
|
6
6
|
"names": ["componentsPrivateApis", "coreStore", "editorStore", "usePageTypeBadge", "stripHTML", "VStack", "HStack", "Text", "PostActions"]
|
|
7
7
|
}
|
|
@@ -16,17 +16,19 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/editor/src/components/post-comments/index.js
|
|
19
21
|
var post_comments_exports = {};
|
|
20
22
|
__export(post_comments_exports, {
|
|
21
23
|
default: () => post_comments_default
|
|
22
24
|
});
|
|
23
25
|
module.exports = __toCommonJS(post_comments_exports);
|
|
24
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
26
|
var import_i18n = require("@wordpress/i18n");
|
|
26
27
|
var import_components = require("@wordpress/components");
|
|
27
28
|
var import_data = require("@wordpress/data");
|
|
28
29
|
var import_store = require("../../store");
|
|
29
|
-
|
|
30
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
|
+
var COMMENT_OPTIONS = [
|
|
30
32
|
{
|
|
31
33
|
label: (0, import_i18n._x)("Open", 'Adjective: e.g. "Comments are open"'),
|
|
32
34
|
value: "open",
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-comments/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tRadioControl,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nconst COMMENT_OPTIONS = [\n\t{\n\t\tlabel: _x( 'Open', 'Adjective: e.g. \"Comments are open\"' ),\n\t\tvalue: 'open',\n\t\tdescription: __( 'Visitors can add new comments and replies.' ),\n\t},\n\t{\n\t\tlabel: __( 'Closed' ),\n\t\tvalue: 'closed',\n\t\tdescription: [\n\t\t\t__( 'Visitors cannot add new comments or replies.' ),\n\t\t\t__( 'Existing comments remain visible.' ),\n\t\t].join( ' ' ),\n\t},\n];\n\nfunction PostComments() {\n\tconst commentStatus = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'comment_status' ) ??\n\t\t\t'open',\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\tconst handleStatus = ( newCommentStatus ) =>\n\t\teditPost( {\n\t\t\tcomment_status: newCommentStatus,\n\t\t} );\n\n\treturn (\n\t\t<form>\n\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t<RadioControl\n\t\t\t\t\tclassName=\"editor-change-status__options\"\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\tlabel={ __( 'Comment status' ) }\n\t\t\t\t\toptions={ COMMENT_OPTIONS }\n\t\t\t\t\tonChange={ handleStatus }\n\t\t\t\t\tselected={ commentStatus }\n\t\t\t\t/>\n\t\t\t</VStack>\n\t\t</form>\n\t);\n}\n\n/**\n * A form for managing comment status.\n *\n * @return {React.ReactNode} The rendered PostComments component.\n */\nexport default PostComments;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuB;AACvB,wBAGO;AACP,kBAAuC;AAKvC,mBAAqC;AAkCjC;AAhCJ,IAAM,kBAAkB;AAAA,EACvB;AAAA,IACC,WAAO,gBAAI,QAAQ,qCAAsC;AAAA,IACzD,OAAO;AAAA,IACP,iBAAa,gBAAI,4CAA6C;AAAA,EAC/D;AAAA,EACA;AAAA,IACC,WAAO,gBAAI,QAAS;AAAA,IACpB,OAAO;AAAA,IACP,aAAa;AAAA,UACZ,gBAAI,8CAA+C;AAAA,UACnD,gBAAI,mCAAoC;AAAA,IACzC,EAAE,KAAM,GAAI;AAAA,EACb;AACD;AAEA,SAAS,eAAe;AACvB,QAAM,oBAAgB;AAAA,IACrB,CAAE,WACD,OAAQ,aAAAA,KAAY,EAAE,uBAAwB,gBAAiB,KAC/D;AAAA,IACD,CAAC;AAAA,EACF;AACA,QAAM,EAAE,SAAS,QAAI,yBAAa,aAAAA,KAAY;AAC9C,QAAM,eAAe,CAAE,qBACtB,SAAU;AAAA,IACT,gBAAgB;AAAA,EACjB,CAAE;AAEH,SACC,4CAAC,UACA,sDAAC,kBAAAC,sBAAA,EAAO,SAAU,GACjB;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,qBAAmB;AAAA,MACnB,WAAQ,gBAAI,gBAAiB;AAAA,MAC7B,SAAU;AAAA,MACV,UAAW;AAAA,MACX,UAAW;AAAA;AAAA,EACZ,GACD,GACD;AAEF;AAOA,IAAO,wBAAQ;",
|
|
6
6
|
"names": ["editorStore", "VStack"]
|
|
7
7
|
}
|
|
@@ -16,12 +16,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/editor/src/components/post-content-information/index.js
|
|
19
21
|
var post_content_information_exports = {};
|
|
20
22
|
__export(post_content_information_exports, {
|
|
21
23
|
default: () => PostContentInformation
|
|
22
24
|
});
|
|
23
25
|
module.exports = __toCommonJS(post_content_information_exports);
|
|
24
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
26
|
var import_components = require("@wordpress/components");
|
|
26
27
|
var import_data = require("@wordpress/data");
|
|
27
28
|
var import_i18n = require("@wordpress/i18n");
|
|
@@ -30,7 +31,8 @@ var import_element = require("@wordpress/element");
|
|
|
30
31
|
var import_core_data = require("@wordpress/core-data");
|
|
31
32
|
var import_store = require("../../store");
|
|
32
33
|
var import_constants = require("../../store/constants");
|
|
33
|
-
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var AVERAGE_READING_RATE = 189;
|
|
34
36
|
function PostContentInformation() {
|
|
35
37
|
const { postContent } = (0, import_data.useSelect)((select) => {
|
|
36
38
|
const { getEditedPostAttribute, getCurrentPostType, getCurrentPostId } = select(import_store.store);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-content-information/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalText as Text } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { __, _x, _n, sprintf } from '@wordpress/i18n';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../store/constants';\n\n// Taken from packages/editor/src/components/time-to-read/index.js.\nconst AVERAGE_READING_RATE = 189;\n\n// This component renders the wordcount and reading time for the post.\nexport default function PostContentInformation() {\n\tconst { postContent } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, getCurrentPostType, getCurrentPostId } =\n\t\t\tselect( editorStore );\n\t\tconst { canUser } = select( coreStore );\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst siteSettings = canUser( 'read', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} )\n\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\tconst postType = getCurrentPostType();\n\t\tconst _id = getCurrentPostId();\n\t\tconst isPostsPage = +_id === siteSettings?.page_for_posts;\n\t\tconst showPostContentInfo =\n\t\t\t! isPostsPage &&\n\t\t\t! [ TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE ].includes(\n\t\t\t\tpostType\n\t\t\t);\n\t\treturn {\n\t\t\tpostContent:\n\t\t\t\tshowPostContentInfo && getEditedPostAttribute( 'content' ),\n\t\t};\n\t}, [] );\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\tconst wordsCounted = useMemo(\n\t\t() => ( postContent ? wordCount( postContent, wordCountType ) : 0 ),\n\t\t[ postContent, wordCountType ]\n\t);\n\tif ( ! wordsCounted ) {\n\t\treturn null;\n\t}\n\tconst readingTime = Math.round( wordsCounted / AVERAGE_READING_RATE );\n\tconst wordsCountText = sprintf(\n\t\t// translators: %s: the number of words in the post.\n\t\t_n( '%s word', '%s words', wordsCounted ),\n\t\twordsCounted.toLocaleString()\n\t);\n\tconst minutesText =\n\t\treadingTime <= 1\n\t\t\t? __( '1 minute' )\n\t\t\t: sprintf(\n\t\t\t\t\t/* translators: %s: the number of minutes to read the post. */\n\t\t\t\t\t_n( '%s minute', '%s minutes', readingTime ),\n\t\t\t\t\treadingTime.toLocaleString()\n\t\t\t );\n\treturn (\n\t\t<div className=\"editor-post-content-information\">\n\t\t\t<Text>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t/* translators: 1: How many words a post has. 2: the number of minutes to read the post (e.g. 130 words, 2 minutes read time.) */\n\t\t\t\t\t__( '%1$s, %2$s read time.' ),\n\t\t\t\t\twordsCountText,\n\t\t\t\t\tminutesText\n\t\t\t\t) }\n\t\t\t</Text>\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAA2C;AAC3C,kBAA0B;AAC1B,kBAAoC;AACpC,uBAAmC;AACnC,qBAAwB;AACxB,uBAAmC;AAKnC,mBAAqC;AACrC,uBAGO;AA6DJ;AA1DH,IAAM,uBAAuB;AAGd,SAAR,yBAA0C;AAChD,QAAM,EAAE,YAAY,QAAI,uBAAW,CAAE,WAAY;AAChD,UAAM,EAAE,wBAAwB,oBAAoB,iBAAiB,IACpE,OAAQ,aAAAA,KAAY;AACrB,UAAM,EAAE,QAAQ,IAAI,OAAQ,iBAAAC,KAAU;AACtC,UAAM,EAAE,gBAAgB,IAAI,OAAQ,iBAAAA,KAAU;AAC9C,UAAM,eAAe,QAAS,QAAQ;AAAA,MACrC,MAAM;AAAA,MACN,MAAM;AAAA,IACP,CAAE,IACC,gBAAiB,QAAQ,MAAO,IAChC;AACH,UAAM,WAAW,mBAAmB;AACpC,UAAM,MAAM,iBAAiB;AAC7B,UAAM,cAAc,CAAC,QAAQ,cAAc;AAC3C,UAAM,sBACL,CAAE,eACF,CAAE,CAAE,qCAAoB,wCAAwB,EAAE;AAAA,MACjD;AAAA,IACD;AACD,WAAO;AAAA,MACN,aACC,uBAAuB,uBAAwB,SAAU;AAAA,IAC3D;AAAA,EACD,GAAG,CAAC,CAAE;AAON,QAAM,oBAAgB,gBAAI,SAAS,oCAAqC;AACxE,QAAM,mBAAe;AAAA,IACpB,MAAQ,kBAAc,iBAAAC,OAAW,aAAa,aAAc,IAAI;AAAA,IAChE,CAAE,aAAa,aAAc;AAAA,EAC9B;AACA,MAAK,CAAE,cAAe;AACrB,WAAO;AAAA,EACR;AACA,QAAM,cAAc,KAAK,MAAO,eAAe,oBAAqB;AACpE,QAAM,qBAAiB;AAAA;AAAA,QAEtB,gBAAI,WAAW,YAAY,YAAa;AAAA,IACxC,aAAa,eAAe;AAAA,EAC7B;AACA,QAAM,cACL,eAAe,QACZ,gBAAI,UAAW,QACf;AAAA;AAAA,QAEA,gBAAI,aAAa,cAAc,WAAY;AAAA,IAC3C,YAAY,eAAe;AAAA,EAC3B;AACJ,SACC,4CAAC,SAAI,WAAU,mCACd,sDAAC,kBAAAC,oBAAA,EACE;AAAA;AAAA,QAED,gBAAI,uBAAwB;AAAA,IAC5B;AAAA,IACA;AAAA,EACD,GACD,GACD;AAEF;",
|
|
6
6
|
"names": ["editorStore", "coreStore", "wordCount", "Text"]
|
|
7
7
|
}
|
|
@@ -26,12 +26,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/editor/src/components/post-discussion/panel.js
|
|
29
31
|
var panel_exports = {};
|
|
30
32
|
__export(panel_exports, {
|
|
31
33
|
default: () => PostDiscussionPanel
|
|
32
34
|
});
|
|
33
35
|
module.exports = __toCommonJS(panel_exports);
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
36
|
var import_i18n = require("@wordpress/i18n");
|
|
36
37
|
var import_components = require("@wordpress/components");
|
|
37
38
|
var import_data = require("@wordpress/data");
|
|
@@ -43,7 +44,8 @@ var import_post_type_support_check = __toESM(require("../post-type-support-check
|
|
|
43
44
|
var import_post_comments = __toESM(require("../post-comments"));
|
|
44
45
|
var import_post_pingbacks = __toESM(require("../post-pingbacks"));
|
|
45
46
|
var import_post_panel_row = __toESM(require("../post-panel-row"));
|
|
46
|
-
|
|
47
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
48
|
+
var PANEL_NAME = "discussion-panel";
|
|
47
49
|
function ModalContents({ onClose }) {
|
|
48
50
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "editor-post-discussion", children: [
|
|
49
51
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-discussion/panel.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tDropdown,\n\tButton,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport PostComments from '../post-comments';\nimport PostPingbacks from '../post-pingbacks';\nimport PostPanelRow from '../post-panel-row';\n\nconst PANEL_NAME = 'discussion-panel';\n\nfunction ModalContents( { onClose } ) {\n\treturn (\n\t\t<div className=\"editor-post-discussion\">\n\t\t\t<InspectorPopoverHeader\n\t\t\t\ttitle={ __( 'Discussion' ) }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"comments\">\n\t\t\t\t\t<PostComments />\n\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"trackbacks\">\n\t\t\t\t\t<PostPingbacks />\n\t\t\t\t</PostTypeSupportCheck>\n\t\t\t</VStack>\n\t\t</div>\n\t);\n}\n\nfunction PostDiscussionToggle( { isOpen, onClick } ) {\n\tconst {\n\t\tcommentStatus,\n\t\tpingStatus,\n\t\tcommentsSupported,\n\t\ttrackbacksSupported,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\t\treturn {\n\t\t\tcommentStatus: getEditedPostAttribute( 'comment_status' ) ?? 'open',\n\t\t\tpingStatus: getEditedPostAttribute( 'ping_status' ) ?? 'open',\n\t\t\tcommentsSupported: !! postType.supports.comments,\n\t\t\ttrackbacksSupported: !! postType.supports.trackbacks,\n\t\t};\n\t}, [] );\n\tlet label;\n\tif ( commentStatus === 'open' ) {\n\t\tif ( pingStatus === 'open' ) {\n\t\t\tlabel = _x( 'Open', 'Adjective: e.g. \"Comments are open\"' );\n\t\t} else {\n\t\t\tlabel = trackbacksSupported\n\t\t\t\t? __( 'Comments only' )\n\t\t\t\t: _x( 'Open', 'Adjective: e.g. \"Comments are open\"' );\n\t\t}\n\t} else if ( pingStatus === 'open' ) {\n\t\tlabel = commentsSupported ? __( 'Pings only' ) : __( 'Pings enabled' );\n\t} else {\n\t\tlabel = __( 'Closed' );\n\t}\n\treturn (\n\t\t<Button\n\t\t\tsize=\"compact\"\n\t\t\tclassName=\"editor-post-discussion__panel-toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-label={ __( 'Change discussion options' ) }\n\t\t\taria-expanded={ isOpen }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n\n/**\n * This component allows to update comment and pingback\n * settings for the current post. Internally there are\n * checks whether the current post has support for the\n * above and if the `discussion-panel` panel is enabled.\n *\n * @return {React.ReactNode} The rendered PostDiscussionPanel component.\n */\nexport default function PostDiscussionPanel() {\n\tconst { isEnabled } = useSelect( ( select ) => {\n\t\tconst { isEditorPanelEnabled } = select( editorStore );\n\t\treturn {\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys={ [ 'comments', 'trackbacks' ] }>\n\t\t\t<PostPanelRow label={ __( 'Discussion' ) } ref={ setPopoverAnchor }>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tclassName=\"editor-post-discussion__panel-dropdown\"\n\t\t\t\t\tcontentClassName=\"editor-post-discussion__panel-dialog\"\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<PostDiscussionToggle\n\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<ModalContents onClose={ onClose } />\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PostPanelRow>\n\t\t</PostTypeSupportCheck>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuB;AACvB,wBAIO;AACP,kBAA0B;AAC1B,qBAAkC;AAClC,0BAA+E;AAC/E,uBAAmC;AAKnC,mBAAqC;AACrC,qCAAiC;AACjC,2BAAyB;AACzB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"PostComments", "PostPingbacks", "editorStore", "coreStore", "PostPanelRow"]
|
|
7
7
|
}
|
|
@@ -26,13 +26,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/editor/src/components/post-excerpt/check.js
|
|
29
31
|
var check_exports = {};
|
|
30
32
|
__export(check_exports, {
|
|
31
33
|
default: () => check_default
|
|
32
34
|
});
|
|
33
35
|
module.exports = __toCommonJS(check_exports);
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
36
|
var import_post_type_support_check = __toESM(require("../post-type-support-check"));
|
|
37
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
38
|
function PostExcerptCheck({ children }) {
|
|
37
39
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_type_support_check.default, { supportKeys: "excerpt", children });
|
|
38
40
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-excerpt/check.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\n\n/**\n * Component for checking if the post type supports the excerpt field.\n *\n * @param {Object} props Props.\n * @param {React.ReactNode} props.children Children to be rendered.\n *\n * @return {React.ReactNode} The rendered component.\n */\nfunction PostExcerptCheck( { children } ) {\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"excerpt\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nexport default PostExcerptCheck;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qCAAiC;AAY/B;AAFF,SAAS,iBAAkB,EAAE,SAAS,GAAI;AACzC,SACC,4CAAC,+BAAAA,SAAA,EAAqB,aAAY,WAC/B,UACH;AAEF;AAEA,IAAO,gBAAQ;",
|
|
6
6
|
"names": ["PostTypeSupportCheck"]
|
|
7
7
|
}
|
|
@@ -16,18 +16,20 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/editor/src/components/post-excerpt/index.js
|
|
19
21
|
var post_excerpt_exports = {};
|
|
20
22
|
__export(post_excerpt_exports, {
|
|
21
23
|
default: () => PostExcerpt
|
|
22
24
|
});
|
|
23
25
|
module.exports = __toCommonJS(post_excerpt_exports);
|
|
24
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
26
|
var import_i18n = require("@wordpress/i18n");
|
|
26
27
|
var import_components = require("@wordpress/components");
|
|
27
28
|
var import_data = require("@wordpress/data");
|
|
28
29
|
var import_element = require("@wordpress/element");
|
|
29
30
|
var import_html_entities = require("@wordpress/html-entities");
|
|
30
31
|
var import_store = require("../../store");
|
|
32
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
33
|
function PostExcerpt({
|
|
32
34
|
hideLabelFromVision = false,
|
|
33
35
|
updateOnBlur = false
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-excerpt/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { ExternalLink, TextareaControl } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders an editable textarea for the post excerpt.\n * Templates, template parts and patterns use the `excerpt` field as a description semantically.\n * Additionally templates and template parts override the `excerpt` field as `description` in\n * REST API. So this component handles proper labeling and updating the edited entity.\n *\n * @param {Object} props - Component props.\n * @param {boolean} [props.hideLabelFromVision=false] - Whether to visually hide the textarea's label.\n * @param {boolean} [props.updateOnBlur=false] - Whether to update the post on change or use local state and update on blur.\n */\nexport default function PostExcerpt( {\n\thideLabelFromVision = false,\n\tupdateOnBlur = false,\n} ) {\n\tconst { excerpt, shouldUseDescriptionLabel, usedAttribute } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType, getEditedPostAttribute } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst postType = getCurrentPostType();\n\t\t\t// This special case is unfortunate, but the REST API of wp_template and wp_template_part\n\t\t\t// support the excerpt field through the \"description\" field rather than \"excerpt\".\n\t\t\tconst _usedAttribute = [\n\t\t\t\t'wp_template',\n\t\t\t\t'wp_template_part',\n\t\t\t].includes( postType )\n\t\t\t\t? 'description'\n\t\t\t\t: 'excerpt';\n\t\t\treturn {\n\t\t\t\texcerpt: getEditedPostAttribute( _usedAttribute ),\n\t\t\t\t// There are special cases where we want to label the excerpt as a description.\n\t\t\t\tshouldUseDescriptionLabel: [\n\t\t\t\t\t'wp_template',\n\t\t\t\t\t'wp_template_part',\n\t\t\t\t\t'wp_block',\n\t\t\t\t].includes( postType ),\n\t\t\t\tusedAttribute: _usedAttribute,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ localExcerpt, setLocalExcerpt ] = useState(\n\t\tdecodeEntities( excerpt )\n\t);\n\tconst updatePost = ( value ) => {\n\t\teditPost( { [ usedAttribute ]: value } );\n\t};\n\tconst label = shouldUseDescriptionLabel\n\t\t? __( 'Write a description (optional)' )\n\t\t: __( 'Write an excerpt (optional)' );\n\n\treturn (\n\t\t<div className=\"editor-post-excerpt\">\n\t\t\t<TextareaControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ label }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tclassName=\"editor-post-excerpt__textarea\"\n\t\t\t\tonChange={ updateOnBlur ? setLocalExcerpt : updatePost }\n\t\t\t\tonBlur={\n\t\t\t\t\tupdateOnBlur ? () => updatePost( localExcerpt ) : undefined\n\t\t\t\t}\n\t\t\t\tvalue={ updateOnBlur ? localExcerpt : excerpt }\n\t\t\t\thelp={\n\t\t\t\t\t! shouldUseDescriptionLabel ? (\n\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Learn more about manual excerpts' ) }\n\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t__( 'Write a description' )\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,wBAA8C;AAC9C,kBAAuC;AACvC,qBAAyB;AACzB,2BAA+B;AAK/B,mBAAqC;AAmE/B;AAvDS,SAAR,YAA8B;AAAA,EACpC,sBAAsB;AAAA,EACtB,eAAe;AAChB,GAAI;AACH,QAAM,EAAE,SAAS,2BAA2B,cAAc,QAAI;AAAA,IAC7D,CAAE,WAAY;AACb,YAAM,EAAE,oBAAoB,uBAAuB,IAClD,OAAQ,aAAAA,KAAY;AACrB,YAAM,WAAW,mBAAmB;AAGpC,YAAM,iBAAiB;AAAA,QACtB;AAAA,QACA;AAAA,MACD,EAAE,SAAU,QAAS,IAClB,gBACA;AACH,aAAO;AAAA,QACN,SAAS,uBAAwB,cAAe;AAAA;AAAA,QAEhD,2BAA2B;AAAA,UAC1B;AAAA,UACA;AAAA,UACA;AAAA,QACD,EAAE,SAAU,QAAS;AAAA,QACrB,eAAe;AAAA,MAChB;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AACA,QAAM,EAAE,SAAS,QAAI,yBAAa,aAAAA,KAAY;AAC9C,QAAM,CAAE,cAAc,eAAgB,QAAI;AAAA,QACzC,qCAAgB,OAAQ;AAAA,EACzB;AACA,QAAM,aAAa,CAAE,UAAW;AAC/B,aAAU,EAAE,CAAE,aAAc,GAAG,MAAM,CAAE;AAAA,EACxC;AACA,QAAM,QAAQ,gCACX,gBAAI,gCAAiC,QACrC,gBAAI,6BAA8B;AAErC,SACC,4CAAC,SAAI,WAAU,uBACd;AAAA,IAAC;AAAA;AAAA,MACA,yBAAuB;AAAA,MACvB;AAAA,MACA;AAAA,MACA,WAAU;AAAA,MACV,UAAW,eAAe,kBAAkB;AAAA,MAC5C,QACC,eAAe,MAAM,WAAY,YAAa,IAAI;AAAA,MAEnD,OAAQ,eAAe,eAAe;AAAA,MACtC,MACC,CAAE,4BACD;AAAA,QAAC;AAAA;AAAA,UACA,UAAO;AAAA,YACN;AAAA,UACD;AAAA,UAEE,8BAAI,kCAAmC;AAAA;AAAA,MAC1C,QAEA,gBAAI,qBAAsB;AAAA;AAAA,EAG7B,GACD;AAEF;",
|
|
6
6
|
"names": ["editorStore"]
|
|
7
7
|
}
|
|
@@ -26,13 +26,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/editor/src/components/post-excerpt/panel.js
|
|
29
31
|
var panel_exports = {};
|
|
30
32
|
__export(panel_exports, {
|
|
31
33
|
PrivatePostExcerptPanel: () => PrivatePostExcerptPanel,
|
|
32
34
|
default: () => PostExcerptPanel
|
|
33
35
|
});
|
|
34
36
|
module.exports = __toCommonJS(panel_exports);
|
|
35
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
37
|
var import_i18n = require("@wordpress/i18n");
|
|
37
38
|
var import_components = require("@wordpress/components");
|
|
38
39
|
var import_data = require("@wordpress/data");
|
|
@@ -46,7 +47,8 @@ var import_plugin = __toESM(require("./plugin"));
|
|
|
46
47
|
var import_constants = require("../../store/constants");
|
|
47
48
|
var import_store = require("../../store");
|
|
48
49
|
var import_get_template_info = require("../../utils/get-template-info");
|
|
49
|
-
|
|
50
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
51
|
+
var PANEL_NAME = "post-excerpt";
|
|
50
52
|
function ExcerptPanel() {
|
|
51
53
|
const { isOpened, isEnabled, postType } = (0, import_data.useSelect)((select) => {
|
|
52
54
|
const {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-excerpt/panel.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tPanelBody,\n\t__experimentalText as Text,\n\tDropdown,\n\tButton,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useMemo, useState } from '@wordpress/element';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport PostExcerptForm from './index';\nimport PostExcerptCheck from './check';\nimport PluginPostExcerpt from './plugin';\nimport { TEMPLATE_ORIGINS } from '../../store/constants';\nimport { store as editorStore } from '../../store';\nimport { getTemplateInfo } from '../../utils/get-template-info';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-excerpt';\n\nfunction ExcerptPanel() {\n\tconst { isOpened, isEnabled, postType } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisEditorPanelOpened,\n\t\t\tisEditorPanelEnabled,\n\t\t\tgetCurrentPostType,\n\t\t} = select( editorStore );\n\n\t\treturn {\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\tconst toggleExcerptPanel = () => toggleEditorPanelOpened( PANEL_NAME );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\t// There are special cases where we want to label the excerpt as a description.\n\tconst shouldUseDescriptionLabel = [\n\t\t'wp_template',\n\t\t'wp_template_part',\n\t\t'wp_block',\n\t].includes( postType );\n\n\treturn (\n\t\t<PanelBody\n\t\t\ttitle={\n\t\t\t\tshouldUseDescriptionLabel\n\t\t\t\t\t? __( 'Description' )\n\t\t\t\t\t: __( 'Excerpt' )\n\t\t\t}\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ toggleExcerptPanel }\n\t\t>\n\t\t\t<PluginPostExcerpt.Slot>\n\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PostExcerptForm />\n\t\t\t\t\t\t{ fills }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostExcerpt.Slot>\n\t\t</PanelBody>\n\t);\n}\n\n/**\n * Is rendered if the post type supports excerpts and allows editing the excerpt.\n *\n * @return {React.ReactNode} The rendered PostExcerptPanel component.\n */\nexport default function PostExcerptPanel() {\n\treturn (\n\t\t<PostExcerptCheck>\n\t\t\t<ExcerptPanel />\n\t\t</PostExcerptCheck>\n\t);\n}\n\nexport function PrivatePostExcerptPanel() {\n\treturn (\n\t\t<PostExcerptCheck>\n\t\t\t<PrivateExcerpt />\n\t\t</PostExcerptCheck>\n\t);\n}\n\nfunction PrivateExcerpt() {\n\tconst { shouldRender, excerpt, shouldBeUsedAsDescription, allowEditing } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst {\n\t\t\t\tgetCurrentPostType,\n\t\t\t\tgetCurrentPostId,\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t\tisEditorPanelEnabled,\n\t\t\t} = select( editorStore );\n\t\t\tconst postType = getCurrentPostType();\n\t\t\tconst isTemplateOrTemplatePart = [\n\t\t\t\t'wp_template',\n\t\t\t\t'wp_template_part',\n\t\t\t].includes( postType );\n\t\t\tconst isPattern = postType === 'wp_block';\n\t\t\t// These post types use the `excerpt` field as a description semantically, so we need to\n\t\t\t// handle proper labeling and some flows where we should always render them as text.\n\t\t\tconst _shouldBeUsedAsDescription =\n\t\t\t\tisTemplateOrTemplatePart || isPattern;\n\t\t\tconst _usedAttribute = isTemplateOrTemplatePart\n\t\t\t\t? 'description'\n\t\t\t\t: 'excerpt';\n\t\t\tconst _excerpt = getEditedPostAttribute( _usedAttribute );\n\t\t\t// We need to fetch the entity in this case to check if we'll allow editing.\n\t\t\tconst template =\n\t\t\t\tisTemplateOrTemplatePart &&\n\t\t\t\tselect( coreStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tgetCurrentPostId()\n\t\t\t\t);\n\t\t\tconst fallback =\n\t\t\t\t! _excerpt && isTemplateOrTemplatePart\n\t\t\t\t\t? getTemplateInfo( {\n\t\t\t\t\t\t\ttemplate,\n\t\t\t\t\t\t\ttemplateTypes:\n\t\t\t\t\t\t\t\tselect( coreStore ).getCurrentTheme()\n\t\t\t\t\t\t\t\t\t?.default_template_types,\n\t\t\t\t\t } )?.description\n\t\t\t\t\t: undefined;\n\t\t\t// For post types that use excerpt as description, we do not abide\n\t\t\t// by the `isEnabled` panel flag in order to render them as text.\n\t\t\tconst _shouldRender =\n\t\t\t\tisEditorPanelEnabled( PANEL_NAME ) ||\n\t\t\t\t_shouldBeUsedAsDescription;\n\t\t\treturn {\n\t\t\t\texcerpt: _excerpt ?? fallback,\n\t\t\t\tshouldRender: _shouldRender,\n\t\t\t\tshouldBeUsedAsDescription: _shouldBeUsedAsDescription,\n\t\t\t\t// If we should render, allow editing for all post types that are not used as description.\n\t\t\t\t// For the rest allow editing only for user generated entities.\n\t\t\t\tallowEditing:\n\t\t\t\t\t_shouldRender &&\n\t\t\t\t\t( ! _shouldBeUsedAsDescription ||\n\t\t\t\t\t\tisPattern ||\n\t\t\t\t\t\t( template &&\n\t\t\t\t\t\t\ttemplate.source === TEMPLATE_ORIGINS.custom &&\n\t\t\t\t\t\t\t! template.has_theme_file &&\n\t\t\t\t\t\t\ttemplate.is_custom ) ),\n\t\t\t};\n\t\t}, [] );\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst label = shouldBeUsedAsDescription\n\t\t? __( 'Description' )\n\t\t: __( 'Excerpt' );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\t'aria-label': label,\n\t\t\theaderTitle: label,\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor, label ]\n\t);\n\tif ( ! shouldRender ) {\n\t\treturn false;\n\t}\n\tconst excerptText = !! excerpt && (\n\t\t<Text align=\"left\" numberOfLines={ 4 } truncate={ allowEditing }>\n\t\t\t{ decodeEntities( excerpt ) }\n\t\t</Text>\n\t);\n\tif ( ! allowEditing ) {\n\t\treturn excerptText;\n\t}\n\tconst excerptPlaceholder = shouldBeUsedAsDescription\n\t\t? __( 'Add a description\u2026' )\n\t\t: __( 'Add an excerpt\u2026' );\n\tconst triggerEditLabel = shouldBeUsedAsDescription\n\t\t? __( 'Edit description' )\n\t\t: __( 'Edit excerpt' );\n\treturn (\n\t\t<VStack>\n\t\t\t{ excerptText }\n\t\t\t<Dropdown\n\t\t\t\tclassName=\"editor-post-excerpt__dropdown\"\n\t\t\t\tcontentClassName=\"editor-post-excerpt__dropdown__content\"\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tfocusOnMount\n\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\trenderToggle={ ( { onToggle } ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ excerptText ? triggerEditLabel : excerptPlaceholder }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\ttitle={ label }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t\t<PluginPostExcerpt.Slot>\n\t\t\t\t\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<PostExcerptForm\n\t\t\t\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\t\t\t\tupdateOnBlur\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</PluginPostExcerpt.Slot>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</VStack>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,wBAMO;AACP,kBAAuC;AACvC,qBAAkC;AAClC,0BAA+E;AAC/E,uBAAmC;AACnC,2BAA+B;AAK/B,mBAA4B;AAC5B,mBAA6B;AAC7B,oBAA8B;AAC9B,uBAAiC;AACjC,m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BAAqB,gCACxB,gBAAI,yBAAqB,QACzB,gBAAI,sBAAkB;AACzB,QAAM,mBAAmB,gCACtB,gBAAI,kBAAmB,QACvB,gBAAI,cAAe;AACtB,SACC,6CAAC,kBAAAC,sBAAA,EACE;AAAA;AAAA,IACF;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,kBAAiB;AAAA,QACjB;AAAA,QACA,cAAY;AAAA,QACZ,KAAM;AAAA,QACN,cAAe,CAAE,EAAE,SAAS,MAC3B;AAAA,UAAC;AAAA;AAAA,YACA,uBAAqB;AAAA,YACrB,SAAU;AAAA,YACV,SAAQ;AAAA,YAEN,wBAAc,mBAAmB;AAAA;AAAA,QACpC;AAAA,QAED,eAAgB,CAAE,EAAE,QAAQ,MAC3B,4EACC;AAAA;AAAA,YAAC,oBAAAC;AAAA,YAAA;AAAA,cACA,OAAQ;AAAA,cACR;AAAA;AAAA,UACD;AAAA,UAEA,4CAAC,kBAAAD,sBAAA,EAAO,SAAU,GACjB,sDAAC,cAAAL,QAAkB,MAAlB,EACE,WAAE,UACH,4EACC;AAAA;AAAA,cAAC,aAAAC;AAAA,cAAA;AAAA,gBACA,qBAAmB;AAAA,gBACnB,cAAY;AAAA;AAAA,YACb;AAAA,YACE;AAAA,aACH,GAEF,GACD;AAAA,WACD;AAAA;AAAA,IAEF;AAAA,KACD;AAEF;",
|
|
6
6
|
"names": ["editorStore", "PluginPostExcerpt", "PostExcerptForm", "PostExcerptCheck", "coreStore", "Text", "VStack", "InspectorPopoverHeader"]
|
|
7
7
|
}
|
|
@@ -16,15 +16,17 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/editor/src/components/post-excerpt/plugin.js
|
|
19
21
|
var plugin_exports = {};
|
|
20
22
|
__export(plugin_exports, {
|
|
21
23
|
default: () => plugin_default
|
|
22
24
|
});
|
|
23
25
|
module.exports = __toCommonJS(plugin_exports);
|
|
24
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
26
|
var import_components = require("@wordpress/components");
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
+
var { Fill, Slot } = (0, import_components.createSlotFill)("PluginPostExcerpt");
|
|
29
|
+
var PluginPostExcerpt = ({ children, className }) => {
|
|
28
30
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fill, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.PanelRow, { className, children }) });
|
|
29
31
|
};
|
|
30
32
|
PluginPostExcerpt.Slot = Slot;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-excerpt/plugin.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * Defines as extensibility slot for the Excerpt panel.\n */\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelRow } from '@wordpress/components';\n\nconst { Fill, Slot } = createSlotFill( 'PluginPostExcerpt' );\n\n/**\n * Renders a post excerpt panel in the post sidebar.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {React.ReactNode} props.children Children to be rendered.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginPostExcerpt = wp.editPost.__experimentalPluginPostExcerpt;\n *\n * function MyPluginPostExcerpt() {\n * \treturn React.createElement(\n * \t\tPluginPostExcerpt,\n * \t\t{\n * \t\t\tclassName: 'my-plugin-post-excerpt',\n * \t\t},\n * \t\t__( 'Post excerpt custom content' )\n * \t)\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { __experimentalPluginPostExcerpt as PluginPostExcerpt } from '@wordpress/edit-post';\n *\n * const MyPluginPostExcerpt = () => (\n * \t<PluginPostExcerpt className=\"my-plugin-post-excerpt\">\n * \t\t{ __( 'Post excerpt custom content' ) }\n * \t</PluginPostExcerpt>\n * );\n * ```\n *\n * @return {React.ReactNode} The rendered component.\n */\nconst PluginPostExcerpt = ( { children, className } ) => {\n\treturn (\n\t\t<Fill>\n\t\t\t<PanelRow className={ className }>{ children }</PanelRow>\n\t\t</Fill>\n\t);\n};\n\nPluginPostExcerpt.Slot = Slot;\n\nexport default PluginPostExcerpt;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,wBAAyC;AA8CtC;AA5CH,IAAM,EAAE,MAAM,KAAK,QAAI,kCAAgB,mBAAoB;AAyC3D,IAAM,oBAAoB,CAAE,EAAE,UAAU,UAAU,MAAO;AACxD,SACC,4CAAC,QACA,sDAAC,8BAAS,WAA0B,UAAU,GAC/C;AAEF;AAEA,kBAAkB,OAAO;AAEzB,IAAO,iBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -26,14 +26,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/editor/src/components/post-featured-image/check.js
|
|
29
31
|
var check_exports = {};
|
|
30
32
|
__export(check_exports, {
|
|
31
33
|
default: () => check_default
|
|
32
34
|
});
|
|
33
35
|
module.exports = __toCommonJS(check_exports);
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
36
|
var import_post_type_support_check = __toESM(require("../post-type-support-check"));
|
|
36
37
|
var import_theme_support_check = __toESM(require("../theme-support-check"));
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
39
|
function PostFeaturedImageCheck({ children }) {
|
|
38
40
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_theme_support_check.default, { supportKeys: "post-thumbnails", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_type_support_check.default, { supportKeys: "thumbnail", children }) });
|
|
39
41
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-featured-image/check.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport ThemeSupportCheck from '../theme-support-check';\n\n/**\n * Wrapper component that renders its children only if the post type supports a featured image\n * and the theme supports post thumbnails.\n *\n * @param {Object} props Props.\n * @param {React.ReactNode} props.children Children to be rendered.\n *\n * @return {React.ReactNode} The rendered component.\n */\nfunction PostFeaturedImageCheck( { children } ) {\n\treturn (\n\t\t<ThemeSupportCheck supportKeys=\"post-thumbnails\">\n\t\t\t<PostTypeSupportCheck supportKeys=\"thumbnail\">\n\t\t\t\t{ children }\n\t\t\t</PostTypeSupportCheck>\n\t\t</ThemeSupportCheck>\n\t);\n}\n\nexport default PostFeaturedImageCheck;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qCAAiC;AACjC,iCAA8B;AAc3B;AAHH,SAAS,uBAAwB,EAAE,SAAS,GAAI;AAC/C,SACC,4CAAC,2BAAAA,SAAA,EAAkB,aAAY,mBAC9B,sDAAC,+BAAAC,SAAA,EAAqB,aAAY,aAC/B,UACH,GACD;AAEF;AAEA,IAAO,gBAAQ;",
|
|
6
6
|
"names": ["ThemeSupportCheck", "PostTypeSupportCheck"]
|
|
7
7
|
}
|
|
@@ -26,12 +26,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/editor/src/components/post-featured-image/index.js
|
|
29
31
|
var post_featured_image_exports = {};
|
|
30
32
|
__export(post_featured_image_exports, {
|
|
31
33
|
default: () => post_featured_image_default
|
|
32
34
|
});
|
|
33
35
|
module.exports = __toCommonJS(post_featured_image_exports);
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
36
|
var import_clsx = __toESM(require("clsx"));
|
|
36
37
|
var import_i18n = require("@wordpress/i18n");
|
|
37
38
|
var import_hooks = require("@wordpress/hooks");
|
|
@@ -45,11 +46,12 @@ var import_core_data = require("@wordpress/core-data");
|
|
|
45
46
|
var import_lock_unlock = require("../../lock-unlock");
|
|
46
47
|
var import_check = __toESM(require("./check"));
|
|
47
48
|
var import_store = require("../../store");
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
|
+
var { MediaUploadModal } = (0, import_lock_unlock.unlock)(import_block_editor.privateApis);
|
|
51
|
+
var ALLOWED_MEDIA_TYPES = ["image"];
|
|
52
|
+
var DEFAULT_FEATURE_IMAGE_LABEL = (0, import_i18n.__)("Featured image");
|
|
53
|
+
var DEFAULT_SET_FEATURE_IMAGE_LABEL = (0, import_i18n.__)("Add a featured image");
|
|
54
|
+
var instructions = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: (0, import_i18n.__)(
|
|
53
55
|
"To edit the featured image, you need permission to upload media."
|
|
54
56
|
) });
|
|
55
57
|
function ConditionalMediaUpload({ render, ...props }) {
|
|
@@ -282,7 +284,7 @@ function PostFeaturedImage({
|
|
|
282
284
|
] })
|
|
283
285
|
] });
|
|
284
286
|
}
|
|
285
|
-
|
|
287
|
+
var applyWithSelect = (0, import_data.withSelect)((select) => {
|
|
286
288
|
const { getEntityRecord, getPostType, hasFinishedResolution } = select(import_core_data.store);
|
|
287
289
|
const { getCurrentPostId, getEditedPostAttribute } = select(import_store.store);
|
|
288
290
|
const featuredImageId = getEditedPostAttribute("featured_media");
|
|
@@ -301,7 +303,7 @@ const applyWithSelect = (0, import_data.withSelect)((select) => {
|
|
|
301
303
|
])
|
|
302
304
|
};
|
|
303
305
|
});
|
|
304
|
-
|
|
306
|
+
var applyWithDispatch = (0, import_data.withDispatch)(
|
|
305
307
|
(dispatch, { noticeOperations }, { select }) => {
|
|
306
308
|
const { editPost } = dispatch(import_store.store);
|
|
307
309
|
return {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-featured-image/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { applyFilters } from '@wordpress/hooks';\nimport {\n\tDropZone,\n\tButton,\n\tSpinner,\n\twithNotices,\n\twithFilters,\n\t__experimentalHStack as HStack,\n\tNotice,\n} from '@wordpress/components';\nimport { isBlobURL } from '@wordpress/blob';\nimport { useState, useRef } from '@wordpress/element';\nimport { compose } from '@wordpress/compose';\nimport { useSelect, withDispatch, withSelect } from '@wordpress/data';\nimport {\n\tMediaUpload,\n\tMediaUploadCheck,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport PostFeaturedImageCheck from './check';\nimport { store as editorStore } from '../../store';\n\nconst { MediaUploadModal } = unlock( blockEditorPrivateApis );\n\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\n// Used when labels from post type were not yet loaded or when they are not present.\nconst DEFAULT_FEATURE_IMAGE_LABEL = __( 'Featured image' );\nconst DEFAULT_SET_FEATURE_IMAGE_LABEL = __( 'Add a featured image' );\n\nconst instructions = (\n\t<p>\n\t\t{ __(\n\t\t\t'To edit the featured image, you need permission to upload media.'\n\t\t) }\n\t</p>\n);\n\n/**\n * Conditional Media component that uses MediaUploadModal when experiment is enabled,\n * otherwise falls back to MediaUpload.\n *\n * @param {Object} root0 Component props.\n * @param {Function} root0.render Render prop function that receives { open } object.\n * @return {JSX.Element} The component.\n */\nfunction ConditionalMediaUpload( { render, ...props } ) {\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst mediaUpload = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings().mediaUpload;\n\t}, [] );\n\n\tif ( window.__experimentalDataViewsMediaModal ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ render && render( { open: () => setIsModalOpen( true ) } ) }\n\t\t\t\t<MediaUploadModal\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tisOpen={ isModalOpen }\n\t\t\t\t\tonClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\tprops.onClose?.();\n\t\t\t\t\t} }\n\t\t\t\t\tonSelect={ ( media ) => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\tprops.onSelect?.( media );\n\t\t\t\t\t} }\n\t\t\t\t\tonUpload={ mediaUpload }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn <MediaUpload { ...props } render={ render } />;\n}\n\nfunction getMediaDetails( media, postId ) {\n\tif ( ! media ) {\n\t\treturn {};\n\t}\n\n\tconst defaultSize = applyFilters(\n\t\t'editor.PostFeaturedImage.imageSize',\n\t\t'large',\n\t\tmedia.id,\n\t\tpostId\n\t);\n\tif ( defaultSize in ( media?.media_details?.sizes ?? {} ) ) {\n\t\treturn {\n\t\t\tmediaWidth: media.media_details.sizes[ defaultSize ].width,\n\t\t\tmediaHeight: media.media_details.sizes[ defaultSize ].height,\n\t\t\tmediaSourceUrl: media.media_details.sizes[ defaultSize ].source_url,\n\t\t};\n\t}\n\n\t// Use fallbackSize when defaultSize is not available.\n\tconst fallbackSize = applyFilters(\n\t\t'editor.PostFeaturedImage.imageSize',\n\t\t'thumbnail',\n\t\tmedia.id,\n\t\tpostId\n\t);\n\tif ( fallbackSize in ( media?.media_details?.sizes ?? {} ) ) {\n\t\treturn {\n\t\t\tmediaWidth: media.media_details.sizes[ fallbackSize ].width,\n\t\t\tmediaHeight: media.media_details.sizes[ fallbackSize ].height,\n\t\t\tmediaSourceUrl:\n\t\t\t\tmedia.media_details.sizes[ fallbackSize ].source_url,\n\t\t};\n\t}\n\n\t// Use full image size when fallbackSize and defaultSize are not available.\n\treturn {\n\t\tmediaWidth: media.media_details.width,\n\t\tmediaHeight: media.media_details.height,\n\t\tmediaSourceUrl: media.source_url,\n\t};\n}\n\nfunction PostFeaturedImage( {\n\tcurrentPostId,\n\tfeaturedImageId,\n\tonUpdateImage,\n\tonRemoveImage,\n\tmedia,\n\tpostType,\n\tnoticeUI,\n\tnoticeOperations,\n\tisRequestingFeaturedImageMedia,\n} ) {\n\tconst returnsFocusRef = useRef( false );\n\tconst [ isLoading, setIsLoading ] = useState( false );\n\tconst { getSettings } = useSelect( blockEditorStore );\n\tconst { mediaSourceUrl } = getMediaDetails( media, currentPostId );\n\n\tfunction onDropFiles( filesList ) {\n\t\tgetSettings().mediaUpload( {\n\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\tfilesList,\n\t\t\tonFileChange( [ image ] ) {\n\t\t\t\tif ( isBlobURL( image?.url ) ) {\n\t\t\t\t\tsetIsLoading( true );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( image ) {\n\t\t\t\t\tonUpdateImage( image );\n\t\t\t\t}\n\t\t\t\tsetIsLoading( false );\n\t\t\t},\n\t\t\tonError( message ) {\n\t\t\t\tnoticeOperations.removeAllNotices();\n\t\t\t\tnoticeOperations.createErrorNotice( message );\n\t\t\t},\n\t\t\tmultiple: false,\n\t\t} );\n\t}\n\n\t/**\n\t * Generates the featured image alt text for this editing context.\n\t *\n\t * @param {Object} imageMedia The image media object.\n\t * @param {string} imageMedia.alt_text The alternative text of the image.\n\t * @param {Object} imageMedia.media_details The media details of the image.\n\t * @param {Object} imageMedia.media_details.sizes The sizes of the image.\n\t * @param {Object} imageMedia.media_details.sizes.full The full size details of the image.\n\t * @param {string} imageMedia.media_details.sizes.full.file The file name of the full size image.\n\t * @param {string} imageMedia.slug The slug of the image.\n\t * @return {string} The featured image alt text.\n\t */\n\tfunction getImageDescription( imageMedia ) {\n\t\tif ( imageMedia.alt_text ) {\n\t\t\treturn sprintf(\n\t\t\t\t// Translators: %s: The selected image alt text.\n\t\t\t\t__( 'Current image: %s' ),\n\t\t\t\timageMedia.alt_text\n\t\t\t);\n\t\t}\n\t\treturn sprintf(\n\t\t\t// Translators: %s: The selected image filename.\n\t\t\t__(\n\t\t\t\t'The current image has no alternative text. The file name is: %s'\n\t\t\t),\n\t\t\timageMedia.media_details.sizes?.full?.file || imageMedia.slug\n\t\t);\n\t}\n\n\tfunction returnFocus( node ) {\n\t\tif ( returnsFocusRef.current && node ) {\n\t\t\tnode.focus();\n\t\t\treturnsFocusRef.current = false;\n\t\t}\n\t}\n\n\tconst isMissingMedia =\n\t\t! isRequestingFeaturedImageMedia && !! featuredImageId && ! media;\n\n\treturn (\n\t\t<PostFeaturedImageCheck>\n\t\t\t{ noticeUI }\n\t\t\t<div className=\"editor-post-featured-image\">\n\t\t\t\t{ media && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tid={ `editor-post-featured-image-${ featuredImageId }-describedby` }\n\t\t\t\t\t\tclassName=\"hidden\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ getImageDescription( media ) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t<MediaUploadCheck fallback={ instructions }>\n\t\t\t\t\t<ConditionalMediaUpload\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\tpostType?.labels?.featured_image ||\n\t\t\t\t\t\t\tDEFAULT_FEATURE_IMAGE_LABEL\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonSelect={ onUpdateImage }\n\t\t\t\t\t\tunstableFeaturedImageFlow\n\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\tmodalClass=\"editor-post-featured-image__media-modal\"\n\t\t\t\t\t\trender={ ( { open } ) => (\n\t\t\t\t\t\t\t<div className=\"editor-post-featured-image__container\">\n\t\t\t\t\t\t\t\t{ isMissingMedia ? (\n\t\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t'Could not retrieve the featured image data.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\tref={ returnFocus }\n\t\t\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\t\t\t! featuredImageId\n\t\t\t\t\t\t\t\t\t\t\t\t? 'editor-post-featured-image__toggle'\n\t\t\t\t\t\t\t\t\t\t\t\t: 'editor-post-featured-image__preview'\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\t\t\t\t! featuredImageId\n\t\t\t\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Edit or replace the featured image'\n\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\t\t\t\t\t! featuredImageId\n\t\t\t\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t\t\t\t: `editor-post-featured-image-${ featuredImageId }-describedby`\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\t\t\t\tdisabled={ isLoading }\n\t\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ !! featuredImageId && media && (\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-post-featured-image__preview-image\"\n\t\t\t\t\t\t\t\t\t\t\t\tsrc={ mediaSourceUrl }\n\t\t\t\t\t\t\t\t\t\t\t\talt={ getImageDescription(\n\t\t\t\t\t\t\t\t\t\t\t\t\tmedia\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t{ ( isLoading ||\n\t\t\t\t\t\t\t\t\t\t\tisRequestingFeaturedImageMedia ) && (\n\t\t\t\t\t\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t{ ! featuredImageId &&\n\t\t\t\t\t\t\t\t\t\t\t! isLoading &&\n\t\t\t\t\t\t\t\t\t\t\t( postType?.labels\n\t\t\t\t\t\t\t\t\t\t\t\t?.set_featured_image ||\n\t\t\t\t\t\t\t\t\t\t\t\tDEFAULT_SET_FEATURE_IMAGE_LABEL ) }\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ !! featuredImageId && (\n\t\t\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t\t'editor-post-featured-image__actions',\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t'editor-post-featured-image__actions-missing-image':\n\t\t\t\t\t\t\t\t\t\t\t\t\tisMissingMedia,\n\t\t\t\t\t\t\t\t\t\t\t\t'editor-post-featured-image__actions-is-requesting-image':\n\t\t\t\t\t\t\t\t\t\t\t\t\tisRequestingFeaturedImageMedia,\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-post-featured-image__action\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\t\t\tisMissingMedia\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 'secondary'\n\t\t\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Replace' ) }\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-post-featured-image__action\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\tonRemoveImage();\n\t\t\t\t\t\t\t\t\t\t\t\t// Signal that the toggle button should be focused,\n\t\t\t\t\t\t\t\t\t\t\t\t// when it is rendered. Can't focus it directly here\n\t\t\t\t\t\t\t\t\t\t\t\t// because it's rendered conditionally.\n\t\t\t\t\t\t\t\t\t\t\t\treturnsFocusRef.current = true;\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\t\t\tisMissingMedia\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 'secondary'\n\t\t\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tisDestructive={ isMissingMedia }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Remove' ) }\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<DropZone onFilesDrop={ onDropFiles } />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tvalue={ featuredImageId }\n\t\t\t\t\t/>\n\t\t\t\t</MediaUploadCheck>\n\t\t\t</div>\n\t\t</PostFeaturedImageCheck>\n\t);\n}\n\nconst applyWithSelect = withSelect( ( select ) => {\n\tconst { getEntityRecord, getPostType, hasFinishedResolution } =\n\t\tselect( coreStore );\n\tconst { getCurrentPostId, getEditedPostAttribute } = select( editorStore );\n\tconst featuredImageId = getEditedPostAttribute( 'featured_media' );\n\n\treturn {\n\t\tmedia: featuredImageId\n\t\t\t? getEntityRecord( 'postType', 'attachment', featuredImageId, {\n\t\t\t\t\tcontext: 'view',\n\t\t\t } )\n\t\t\t: null,\n\t\tcurrentPostId: getCurrentPostId(),\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\tfeaturedImageId,\n\t\tisRequestingFeaturedImageMedia:\n\t\t\t!! featuredImageId &&\n\t\t\t! hasFinishedResolution( 'getEntityRecord', [\n\t\t\t\t'postType',\n\t\t\t\t'attachment',\n\t\t\t\tfeaturedImageId,\n\t\t\t\t{ context: 'view' },\n\t\t\t] ),\n\t};\n} );\n\nconst applyWithDispatch = withDispatch(\n\t( dispatch, { noticeOperations }, { select } ) => {\n\t\tconst { editPost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tonUpdateImage( image ) {\n\t\t\t\teditPost( { featured_media: image.id } );\n\t\t\t},\n\t\t\tonDropImage( filesList ) {\n\t\t\t\tselect( blockEditorStore )\n\t\t\t\t\t.getSettings()\n\t\t\t\t\t.mediaUpload( {\n\t\t\t\t\t\tallowedTypes: [ 'image' ],\n\t\t\t\t\t\tfilesList,\n\t\t\t\t\t\tonFileChange( [ image ] ) {\n\t\t\t\t\t\t\teditPost( { featured_media: image.id } );\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonError( message ) {\n\t\t\t\t\t\t\tnoticeOperations.removeAllNotices();\n\t\t\t\t\t\t\tnoticeOperations.createErrorNotice( message );\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmultiple: false,\n\t\t\t\t\t} );\n\t\t\t},\n\t\t\tonRemoveImage() {\n\t\t\t\teditPost( { featured_media: 0 } );\n\t\t\t},\n\t\t};\n\t}\n);\n\n/**\n * Renders the component for managing the featured image of a post.\n *\n * @param {Object} props Props.\n * @param {number} props.currentPostId ID of the current post.\n * @param {number} props.featuredImageId ID of the featured image.\n * @param {Function} props.onUpdateImage Function to call when the image is updated.\n * @param {Function} props.onRemoveImage Function to call when the image is removed.\n * @param {Object} props.media The media object representing the featured image.\n * @param {string} props.postType Post type.\n * @param {Element} props.noticeUI UI for displaying notices.\n * @param {Object} props.noticeOperations Operations for managing notices.\n *\n * @return {Element} Component to be rendered .\n */\nexport default compose(\n\twithNotices,\n\tapplyWithSelect,\n\tapplyWithDispatch,\n\twithFilters( 'editor.PostFeaturedImage' )\n)( PostFeaturedImage );\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,kBAA4B;AAC5B,mBAA6B;AAC7B,wBAQO;AACP,kBAA0B;AAC1B,qBAAiC;AACjC,qBAAwB;AACxB,kBAAoD;AACpD,0BAKO;AACP,uBAAmC;AAKnC,yB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is", "blockEditorStore", "PostFeaturedImageCheck", "HStack", "clsx", "coreStore", "editorStore"]
|
|
7
7
|
}
|
|
@@ -26,12 +26,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/editor/src/components/post-featured-image/panel.js
|
|
29
31
|
var panel_exports = {};
|
|
30
32
|
__export(panel_exports, {
|
|
31
33
|
default: () => PostFeaturedImagePanel
|
|
32
34
|
});
|
|
33
35
|
module.exports = __toCommonJS(panel_exports);
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
36
|
var import_i18n = require("@wordpress/i18n");
|
|
36
37
|
var import_components = require("@wordpress/components");
|
|
37
38
|
var import_data = require("@wordpress/data");
|
|
@@ -39,7 +40,8 @@ var import_core_data = require("@wordpress/core-data");
|
|
|
39
40
|
var import_store = require("../../store");
|
|
40
41
|
var import_index = __toESM(require("./index"));
|
|
41
42
|
var import_check = __toESM(require("./check"));
|
|
42
|
-
|
|
43
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
|
+
var PANEL_NAME = "featured-image";
|
|
43
45
|
function PostFeaturedImagePanel({ withPanelBody = true }) {
|
|
44
46
|
const { postType, isEnabled, isOpened } = (0, import_data.useSelect)((select) => {
|
|
45
47
|
const {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-featured-image/panel.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostFeaturedImage from './index';\nimport PostFeaturedImageCheck from './check';\n\nconst PANEL_NAME = 'featured-image';\n\n/**\n * Renders the panel for the post featured image.\n *\n * @param {Object} props Props.\n * @param {boolean} props.withPanelBody Whether to include the panel body. Default true.\n *\n * @return {React.ReactNode} The component to be rendered.\n * Return Null if the editor panel is disabled for featured image.\n */\nexport default function PostFeaturedImagePanel( { withPanelBody = true } ) {\n\tconst { postType, isEnabled, isOpened } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEditedPostAttribute,\n\t\t\tisEditorPanelEnabled,\n\t\t\tisEditorPanelOpened,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\n\t\treturn {\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tif ( ! withPanelBody ) {\n\t\treturn (\n\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t<PostFeaturedImage />\n\t\t\t</PostFeaturedImageCheck>\n\t\t);\n\t}\n\n\treturn (\n\t\t<PostFeaturedImageCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={\n\t\t\t\t\tpostType?.labels?.featured_image ?? __( 'Featured image' )\n\t\t\t\t}\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ () => toggleEditorPanelOpened( PANEL_NAME ) }\n\t\t\t>\n\t\t\t\t<PostFeaturedImage />\n\t\t\t</PanelBody>\n\t\t</PostFeaturedImageCheck>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,wBAA0B;AAC1B,kBAAuC;AACvC,uBAAmC;AAKnC,mBAAqC;AACrC,mBAA8B;AAC9B,mBAAmC;AAsC/B;AApCJ,IAAM,aAAa;AAWJ,SAAR,uBAAyC,EAAE,gBAAgB,KAAK,GAAI;AAC1E,QAAM,EAAE,UAAU,WAAW,SAAS,QAAI,uBAAW,CAAE,WAAY;AAClE,UAAM;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACD,IAAI,OAAQ,aAAAA,KAAY;AACxB,UAAM,EAAE,YAAY,IAAI,OAAQ,iBAAAC,KAAU;AAE1C,WAAO;AAAA,MACN,UAAU,YAAa,uBAAwB,MAAO,CAAE;AAAA,MACxD,WAAW,qBAAsB,UAAW;AAAA,MAC5C,UAAU,oBAAqB,UAAW;AAAA,IAC3C;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,QAAM,EAAE,wBAAwB,QAAI,yBAAa,aAAAD,KAAY;AAE7D,MAAK,CAAE,WAAY;AAClB,WAAO;AAAA,EACR;AAEA,MAAK,CAAE,eAAgB;AACtB,WACC,4CAAC,aAAAE,SAAA,EACA,sDAAC,aAAAC,SAAA,EAAkB,GACpB;AAAA,EAEF;AAEA,SACC,4CAAC,aAAAD,SAAA,EACA;AAAA,IAAC;AAAA;AAAA,MACA,OACC,UAAU,QAAQ,sBAAkB,gBAAI,gBAAiB;AAAA,MAE1D,QAAS;AAAA,MACT,UAAW,MAAM,wBAAyB,UAAW;AAAA,MAErD,sDAAC,aAAAC,SAAA,EAAkB;AAAA;AAAA,EACpB,GACD;AAEF;",
|
|
6
6
|
"names": ["editorStore", "coreStore", "PostFeaturedImageCheck", "PostFeaturedImage"]
|
|
7
7
|
}
|