@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
|
@@ -26,22 +26,24 @@ 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-publish-button/index.js
|
|
29
31
|
var post_publish_button_exports = {};
|
|
30
32
|
__export(post_publish_button_exports, {
|
|
31
33
|
PostPublishButton: () => PostPublishButton,
|
|
32
34
|
default: () => post_publish_button_default
|
|
33
35
|
});
|
|
34
36
|
module.exports = __toCommonJS(post_publish_button_exports);
|
|
35
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
37
|
var import_components = require("@wordpress/components");
|
|
37
38
|
var import_element = require("@wordpress/element");
|
|
38
39
|
var import_data = require("@wordpress/data");
|
|
39
40
|
var import_compose = require("@wordpress/compose");
|
|
40
41
|
var import_label = __toESM(require("./label"));
|
|
41
42
|
var import_store = require("../../store");
|
|
42
|
-
|
|
43
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
|
+
var noop = () => {
|
|
43
45
|
};
|
|
44
|
-
|
|
46
|
+
var PostPublishButton = class extends import_element.Component {
|
|
45
47
|
constructor(props) {
|
|
46
48
|
super(props);
|
|
47
49
|
this.createOnClick = this.createOnClick.bind(this);
|
|
@@ -152,7 +154,7 @@ class PostPublishButton extends import_element.Component {
|
|
|
152
154
|
}
|
|
153
155
|
) });
|
|
154
156
|
}
|
|
155
|
-
}
|
|
157
|
+
};
|
|
156
158
|
var post_publish_button_default = (0, import_compose.compose)([
|
|
157
159
|
(0, import_data.withSelect)((select) => {
|
|
158
160
|
const {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-publish-button/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { Component } from '@wordpress/element';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport PublishButtonLabel from './label';\nimport { store as editorStore } from '../../store';\n\nconst noop = () => {};\n\nexport class PostPublishButton extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.createOnClick = this.createOnClick.bind( this );\n\t\tthis.closeEntitiesSavedStates =\n\t\t\tthis.closeEntitiesSavedStates.bind( this );\n\n\t\tthis.state = {\n\t\t\tentitiesSavedStatesCallback: false,\n\t\t};\n\t}\n\n\tcreateOnClick( callback ) {\n\t\treturn ( ...args ) => {\n\t\t\tconst { hasNonPostEntityChanges, setEntitiesSavedStatesCallback } =\n\t\t\t\tthis.props;\n\t\t\t// If a post with non-post entities is published, but the user\n\t\t\t// elects to not save changes to the non-post entities, those\n\t\t\t// entities will still be dirty when the Publish button is clicked.\n\t\t\t// We also need to check that the `setEntitiesSavedStatesCallback`\n\t\t\t// prop was passed. See https://github.com/WordPress/gutenberg/pull/37383\n\t\t\tif ( hasNonPostEntityChanges && setEntitiesSavedStatesCallback ) {\n\t\t\t\t// The modal for multiple entity saving will open,\n\t\t\t\t// hold the callback for saving/publishing the post\n\t\t\t\t// so that we can call it if the post entity is checked.\n\t\t\t\tthis.setState( {\n\t\t\t\t\tentitiesSavedStatesCallback: () => callback( ...args ),\n\t\t\t\t} );\n\n\t\t\t\t// Open the save panel by setting its callback.\n\t\t\t\t// To set a function on the useState hook, we must set it\n\t\t\t\t// with another function (() => myFunction). Passing the\n\t\t\t\t// function on its own will cause an error when called.\n\t\t\t\tsetEntitiesSavedStatesCallback(\n\t\t\t\t\t() => this.closeEntitiesSavedStates\n\t\t\t\t);\n\t\t\t\treturn noop;\n\t\t\t}\n\n\t\t\treturn callback( ...args );\n\t\t};\n\t}\n\n\tcloseEntitiesSavedStates( savedEntities ) {\n\t\tconst { postType, postId } = this.props;\n\t\tconst { entitiesSavedStatesCallback } = this.state;\n\t\tthis.setState( { entitiesSavedStatesCallback: false }, () => {\n\t\t\tif (\n\t\t\t\tsavedEntities &&\n\t\t\t\tsavedEntities.some(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind === 'postType' &&\n\t\t\t\t\t\telt.name === postType &&\n\t\t\t\t\t\telt.key === postId\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// The post entity was checked, call the held callback from `createOnClick`.\n\t\t\t\tentitiesSavedStatesCallback();\n\t\t\t}\n\t\t} );\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tforceIsDirty,\n\t\t\thasPublishAction,\n\t\t\tisBeingScheduled,\n\t\t\tisOpen,\n\t\t\tisPostSavingLocked,\n\t\t\tisPublishable,\n\t\t\tisPublished,\n\t\t\tisSaveable,\n\t\t\tisSaving,\n\t\t\tisAutoSaving,\n\t\t\tisToggle,\n\t\t\tsavePostStatus,\n\t\t\tonSubmit = noop,\n\t\t\tonToggle,\n\t\t\tvisibility,\n\t\t\thasNonPostEntityChanges,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t\tpostStatus,\n\t\t\tpostStatusHasChanged,\n\t\t} = this.props;\n\n\t\tconst isButtonDisabled =\n\t\t\t( isSaving ||\n\t\t\t\t! isSaveable ||\n\t\t\t\tisPostSavingLocked ||\n\t\t\t\t( ! isPublishable && ! forceIsDirty ) ) &&\n\t\t\t( ! hasNonPostEntityChanges || isSavingNonPostEntityChanges );\n\n\t\tconst isToggleDisabled =\n\t\t\t( isPublished ||\n\t\t\t\tisSaving ||\n\t\t\t\t! isSaveable ||\n\t\t\t\t( ! isPublishable && ! forceIsDirty ) ) &&\n\t\t\t( ! hasNonPostEntityChanges || isSavingNonPostEntityChanges );\n\n\t\t// If the new status has not changed explicitly, we derive it from\n\t\t// other factors, like having a publish action, etc.. We need to preserve\n\t\t// this because it affects when to show the pre and post publish panels.\n\t\t// If it has changed though explicitly, we need to respect that.\n\t\tlet publishStatus = 'publish';\n\t\tif ( postStatusHasChanged ) {\n\t\t\tpublishStatus = postStatus;\n\t\t} else if ( ! hasPublishAction ) {\n\t\t\tpublishStatus = 'pending';\n\t\t} else if ( visibility === 'private' ) {\n\t\t\tpublishStatus = 'private';\n\t\t} else if ( isBeingScheduled ) {\n\t\t\tpublishStatus = 'future';\n\t\t}\n\n\t\tconst onClickButton = () => {\n\t\t\tif ( isButtonDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonSubmit();\n\t\t\tsavePostStatus( publishStatus );\n\t\t};\n\n\t\t// Callback to open the publish panel.\n\t\tconst onClickToggle = () => {\n\t\t\tif ( isToggleDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonToggle();\n\t\t};\n\n\t\tconst buttonProps = {\n\t\t\t'aria-disabled': isButtonDisabled,\n\t\t\tclassName: 'editor-post-publish-button',\n\t\t\tisBusy: ! isAutoSaving && isSaving,\n\t\t\tvariant: 'primary',\n\t\t\tonClick: this.createOnClick( onClickButton ),\n\t\t\t'aria-haspopup': hasNonPostEntityChanges ? 'dialog' : undefined,\n\t\t};\n\n\t\tconst toggleProps = {\n\t\t\t'aria-disabled': isToggleDisabled,\n\t\t\t'aria-expanded': isOpen,\n\t\t\tclassName: 'editor-post-publish-panel__toggle',\n\t\t\tisBusy: isSaving && isPublished,\n\t\t\tvariant: 'primary',\n\t\t\tsize: 'compact',\n\t\t\tonClick: this.createOnClick( onClickToggle ),\n\t\t\t'aria-haspopup': hasNonPostEntityChanges ? 'dialog' : undefined,\n\t\t};\n\t\tconst componentProps = isToggle ? toggleProps : buttonProps;\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Button\n\t\t\t\t\t{ ...componentProps }\n\t\t\t\t\tclassName={ `${ componentProps.className } editor-post-publish-button__button` }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t>\n\t\t\t\t\t<PublishButtonLabel />\n\t\t\t\t</Button>\n\t\t\t</>\n\t\t);\n\t}\n}\n\n/**\n * Renders the publish button.\n */\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tisSavingPost,\n\t\t\tisAutosavingPost,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tgetEditedPostVisibility,\n\t\t\tisCurrentPostPublished,\n\t\t\tisEditedPostSaveable,\n\t\t\tisEditedPostPublishable,\n\t\t\tisPostSavingLocked,\n\t\t\tgetCurrentPost,\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentPostId,\n\t\t\thasNonPostEntityChanges,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetPostEdits,\n\t\t} = select( editorStore );\n\t\treturn {\n\t\t\tisSaving: isSavingPost(),\n\t\t\tisAutoSaving: isAutosavingPost(),\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tvisibility: getEditedPostVisibility(),\n\t\t\tisSaveable: isEditedPostSaveable(),\n\t\t\tisPostSavingLocked: isPostSavingLocked(),\n\t\t\tisPublishable: isEditedPostPublishable(),\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tpostStatus: getEditedPostAttribute( 'status' ),\n\t\t\tpostStatusHasChanged: getPostEdits()?.status,\n\t\t\thasNonPostEntityChanges: hasNonPostEntityChanges(),\n\t\t\tisSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, savePost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tsavePostStatus: ( status ) => {\n\t\t\t\teditPost( { status }, { undoIgnore: true } );\n\t\t\t\tsavePost();\n\t\t\t},\n\t\t};\n\t} ),\n] )( PostPublishButton );\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAuB;AACvB,qBAA0B;AAC1B,kBAAyC;AACzC,qBAAwB;AAKxB,mBAA+B;AAC/B,mBAAqC;AA4JlC;AA1JH,IAAM,OAAO,MAAM;AAAC;AAEb,IAAM,oBAAN,cAAgC,yBAAU;AAAA,EAChD,YAAa,OAAQ;AACpB,UAAO,KAAM;AAEb,SAAK,gBAAgB,KAAK,cAAc,KAAM,IAAK;AACnD,SAAK,2BACJ,KAAK,yBAAyB,KAAM,IAAK;AAE1C,SAAK,QAAQ;AAAA,MACZ,6BAA6B;AAAA,IAC9B;AAAA,EACD;AAAA,EAEA,cAAe,UAAW;AACzB,WAAO,IAAK,SAAU;AACrB,YAAM,EA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AoB,mBAAmB;AAAA,MACvC,eAAe,wBAAwB;AAAA,MACvC,aAAa,uBAAuB;AAAA,MACpC,kBACC,eAAe,EAAE,SAAU,mBAAoB,KAAK;AAAA,MACrD,UAAU,mBAAmB;AAAA,MAC7B,QAAQ,iBAAiB;AAAA,MACzB,YAAY,uBAAwB,QAAS;AAAA,MAC7C,sBAAsB,aAAa,GAAG;AAAA,MACtC,yBAAyB,wBAAwB;AAAA,MACjD,8BAA8B,6BAA6B;AAAA,IAC5D;AAAA,EACD,CAAE;AAAA,MACF,0BAAc,CAAE,aAAc;AAC7B,UAAM,EAAE,UAAU,SAAS,IAAI,SAAU,aAAAA,KAAY;AACrD,WAAO;AAAA,MACN,gBAAgB,CAAE,WAAY;AAC7B,iBAAU,EAAE,OAAO,GAAG,EAAE,YAAY,KAAK,CAAE;AAC3C,iBAAS;AAAA,MACV;AAAA,IACD;AAAA,EACD,CAAE;AACH,CAAE,EAAG,iBAAkB;",
|
|
6
6
|
"names": ["PublishButtonLabel", "editorStore"]
|
|
7
7
|
}
|
|
@@ -16,6 +16,8 @@ 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-publish-button/label.js
|
|
19
21
|
var label_exports = {};
|
|
20
22
|
__export(label_exports, {
|
|
21
23
|
default: () => PublishButtonLabel
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-publish-button/label.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders the label for the publish button.\n *\n * @return {string} The label for the publish button.\n */\nexport default function PublishButtonLabel() {\n\tconst isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );\n\tconst {\n\t\tisPublished,\n\t\tisBeingScheduled,\n\t\tisSaving,\n\t\tisPublishing,\n\t\thasPublishAction,\n\t\tisAutosaving,\n\t\thasNonPostEntityChanges,\n\t\tpostStatusHasChanged,\n\t\tpostStatus,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisCurrentPostPublished,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tisSavingPost,\n\t\t\tisPublishingPost,\n\t\t\tgetCurrentPost,\n\t\t\tgetCurrentPostType,\n\t\t\tisAutosavingPost,\n\t\t\tgetPostEdits,\n\t\t\tgetEditedPostAttribute,\n\t\t} = select( editorStore );\n\t\treturn {\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisSaving: isSavingPost(),\n\t\t\tisPublishing: isPublishingPost(),\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tisAutosaving: isAutosavingPost(),\n\t\t\thasNonPostEntityChanges:\n\t\t\t\tselect( editorStore ).hasNonPostEntityChanges(),\n\t\t\tpostStatusHasChanged: !! getPostEdits()?.status,\n\t\t\tpostStatus: getEditedPostAttribute( 'status' ),\n\t\t};\n\t}, [] );\n\tif ( isPublishing ) {\n\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\treturn __( 'Publishing\u2026' );\n\t} else if (\n\t\t( isPublished || isBeingScheduled ) &&\n\t\tisSaving &&\n\t\t! isAutosaving\n\t) {\n\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\treturn __( 'Saving\u2026' );\n\t}\n\tif ( ! hasPublishAction ) {\n\t\t// TODO: this is because \"Submit for review\" string is too long in some languages.\n\t\t// @see https://github.com/WordPress/gutenberg/issues/10475\n\t\treturn isSmallerThanMediumViewport\n\t\t\t? __( 'Publish' )\n\t\t\t: __( 'Submit for Review' );\n\t}\n\tif (\n\t\thasNonPostEntityChanges ||\n\t\tisPublished ||\n\t\t( postStatusHasChanged &&\n\t\t\t! [ 'future', 'publish' ].includes( postStatus ) ) ||\n\t\t( ! postStatusHasChanged && postStatus === 'future' )\n\t) {\n\t\treturn __( 'Save' );\n\t}\n\tif ( isBeingScheduled ) {\n\t\treturn __( 'Schedule' );\n\t}\n\treturn __( 'Publish' );\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,kBAA0B;AAC1B,qBAAiC;AAKjC,mBAAqC;AAOtB,SAAR,qBAAsC;AAC5C,QAAM,kCAA8B,iCAAkB,UAAU,GAAI;AACpE,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI,uBAAW,CAAE,WAAY;AAC5B,UAAM;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,IAAI,OAAQ,aAAAA,KAAY;AACxB,WAAO;AAAA,MACN,aAAa,uBAAuB;AAAA,MACpC,kBAAkB,2BAA2B;AAAA,MAC7C,UAAU,aAAa;AAAA,MACvB,cAAc,iBAAiB;AAAA,MAC/B,kBACC,eAAe,EAAE,SAAU,mBAAoB,KAAK;AAAA,MACrD,UAAU,mBAAmB;AAAA,MAC7B,cAAc,iBAAiB;AAAA,MAC/B,yBACC,OAAQ,aAAAA,KAAY,EAAE,wBAAwB;AAAA,MAC/C,sBAAsB,CAAC,CAAE,aAAa,GAAG;AAAA,MACzC,YAAY,uBAAwB,QAAS;AAAA,IAC9C;AAAA,EACD,GAAG,CAAC,CAAE;AACN,MAAK,cAAe;AAEnB,eAAO,gBAAI,kBAAc;AAAA,EAC1B,YACG,eAAe,qBACjB,YACA,CAAE,cACD;AAED,eAAO,gBAAI,cAAU;AAAA,EACtB;AACA,MAAK,CAAE,kBAAmB;AAGzB,WAAO,kCACJ,gBAAI,SAAU,QACd,gBAAI,mBAAoB;AAAA,EAC5B;AACA,MACC,2BACA,eACE,wBACD,CAAE,CAAE,UAAU,SAAU,EAAE,SAAU,UAAW,KAC9C,CAAE,wBAAwB,eAAe,UAC1C;AACD,eAAO,gBAAI,MAAO;AAAA,EACnB;AACA,MAAK,kBAAmB;AACvB,eAAO,gBAAI,UAAW;AAAA,EACvB;AACA,aAAO,gBAAI,SAAU;AACtB;",
|
|
6
6
|
"names": ["editorStore"]
|
|
7
7
|
}
|
|
@@ -26,18 +26,20 @@ 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-publish-button/post-publish-button-or-toggle.js
|
|
29
31
|
var post_publish_button_or_toggle_exports = {};
|
|
30
32
|
__export(post_publish_button_or_toggle_exports, {
|
|
31
33
|
default: () => PostPublishButtonOrToggle
|
|
32
34
|
});
|
|
33
35
|
module.exports = __toCommonJS(post_publish_button_or_toggle_exports);
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
36
|
var import_compose = require("@wordpress/compose");
|
|
36
37
|
var import_data = require("@wordpress/data");
|
|
37
38
|
var import_index = __toESM(require("./index"));
|
|
38
39
|
var import_store = require("../../store");
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
+
var IS_TOGGLE = "toggle";
|
|
42
|
+
var IS_BUTTON = "button";
|
|
41
43
|
function PostPublishButtonOrToggle({
|
|
42
44
|
forceIsDirty,
|
|
43
45
|
setEntitiesSavedStatesCallback
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-publish-button/post-publish-button-or-toggle.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostPublishButton from './index';\nimport { store as editorStore } from '../../store';\n\nconst IS_TOGGLE = 'toggle';\nconst IS_BUTTON = 'button';\n\nexport default function PostPublishButtonOrToggle( {\n\tforceIsDirty,\n\tsetEntitiesSavedStatesCallback,\n} ) {\n\tlet component;\n\tconst isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );\n\tconst { togglePublishSidebar } = useDispatch( editorStore );\n\tconst {\n\t\thasPublishAction,\n\t\tisBeingScheduled,\n\t\tisPending,\n\t\tisPublished,\n\t\tisPublishSidebarEnabled,\n\t\tisPublishSidebarOpened,\n\t\tisScheduled,\n\t\tpostStatus,\n\t\tpostStatusHasChanged,\n\t} = useSelect( ( select ) => {\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\t!! select( editorStore ).getCurrentPost()?._links?.[\n\t\t\t\t\t'wp:action-publish'\n\t\t\t\t],\n\t\t\tisBeingScheduled:\n\t\t\t\tselect( editorStore ).isEditedPostBeingScheduled(),\n\t\t\tisPending: select( editorStore ).isCurrentPostPending(),\n\t\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\t\tisPublishSidebarEnabled:\n\t\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\t\tisPublishSidebarOpened:\n\t\t\t\tselect( editorStore ).isPublishSidebarOpened(),\n\t\t\tisScheduled: select( editorStore ).isCurrentPostScheduled(),\n\t\t\tpostStatus:\n\t\t\t\tselect( editorStore ).getEditedPostAttribute( 'status' ),\n\t\t\tpostStatusHasChanged: select( editorStore ).getPostEdits()?.status,\n\t\t};\n\t}, [] );\n\n\t/**\n\t * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar):\n\t *\n\t * 1) We want to show a BUTTON when the post status is at the _final stage_\n\t * for a particular role (see https://wordpress.org/documentation/article/post-status/):\n\t *\n\t * - is published\n\t * - post status has changed explicitly to something different than 'future' or 'publish'\n\t * - is scheduled to be published\n\t * - is pending and can't be published (but only for viewports >= medium).\n\t * \t Originally, we considered showing a button for pending posts that couldn't be published\n\t * \t (for example, for an author with the contributor role). Some languages can have\n\t * \t long translations for \"Submit for review\", so given the lack of UI real estate available\n\t * \t we decided to take into account the viewport in that case.\n\t * \t See: https://github.com/WordPress/gutenberg/issues/10475\n\t *\n\t * 2) Then, in small viewports, we'll show a TOGGLE.\n\t *\n\t * 3) Finally, we'll use the publish sidebar status to decide:\n\t *\n\t * - if it is enabled, we show a TOGGLE\n\t * - if it is disabled, we show a BUTTON\n\t */\n\tif (\n\t\tisPublished ||\n\t\t( postStatusHasChanged &&\n\t\t\t! [ 'future', 'publish' ].includes( postStatus ) ) ||\n\t\t( isScheduled && isBeingScheduled ) ||\n\t\t( isPending && ! hasPublishAction && ! isSmallerThanMediumViewport )\n\t) {\n\t\tcomponent = IS_BUTTON;\n\t} else if ( isSmallerThanMediumViewport || isPublishSidebarEnabled ) {\n\t\tcomponent = IS_TOGGLE;\n\t} else {\n\t\tcomponent = IS_BUTTON;\n\t}\n\n\treturn (\n\t\t<PostPublishButton\n\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\tisOpen={ isPublishSidebarOpened }\n\t\t\tisToggle={ component === IS_TOGGLE }\n\t\t\tonToggle={ togglePublishSidebar }\n\t\t\tsetEntitiesSavedStatesCallback={ setEntitiesSavedStatesCallback }\n\t\t/>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAiC;AACjC,kBAAuC;AAKvC,mBAA8B;AAC9B,mBAAqC;AAiFnC;AA/EF,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AAW;AAAA,MACX;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": ["editorStore", "PostPublishButton"]
|
|
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-publish-panel/index.js
|
|
29
31
|
var post_publish_panel_exports = {};
|
|
30
32
|
__export(post_publish_panel_exports, {
|
|
31
33
|
PostPublishPanel: () => PostPublishPanel,
|
|
32
34
|
default: () => post_publish_panel_default
|
|
33
35
|
});
|
|
34
36
|
module.exports = __toCommonJS(post_publish_panel_exports);
|
|
35
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
37
|
var import_i18n = require("@wordpress/i18n");
|
|
37
38
|
var import_element = require("@wordpress/element");
|
|
38
39
|
var import_components = require("@wordpress/components");
|
|
@@ -44,7 +45,8 @@ var import_post_publish_button = __toESM(require("../post-publish-button"));
|
|
|
44
45
|
var import_prepublish = __toESM(require("./prepublish"));
|
|
45
46
|
var import_postpublish = __toESM(require("./postpublish"));
|
|
46
47
|
var import_store = require("../../store");
|
|
47
|
-
|
|
48
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
49
|
+
var PostPublishPanel = class extends import_element.Component {
|
|
48
50
|
constructor() {
|
|
49
51
|
super(...arguments);
|
|
50
52
|
this.onSubmit = this.onSubmit.bind(this);
|
|
@@ -140,7 +142,7 @@ class PostPublishPanel extends import_element.Component {
|
|
|
140
142
|
) })
|
|
141
143
|
] });
|
|
142
144
|
}
|
|
143
|
-
}
|
|
145
|
+
};
|
|
144
146
|
var post_publish_panel_default = (0, import_compose.compose)([
|
|
145
147
|
(0, import_data.withSelect)((select) => {
|
|
146
148
|
const { getPostType } = select(import_core_data.store);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-publish-panel/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Component, createRef } from '@wordpress/element';\nimport {\n\tButton,\n\tSpinner,\n\tCheckboxControl,\n\twithFocusReturn,\n\twithConstrainedTabbing,\n} from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { closeSmall } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostPublishButton from '../post-publish-button';\nimport PostPublishPanelPrepublish from './prepublish';\nimport PostPublishPanelPostpublish from './postpublish';\nimport { store as editorStore } from '../../store';\n\nexport class PostPublishPanel extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.onSubmit = this.onSubmit.bind( this );\n\t\tthis.cancelButtonNode = createRef();\n\t}\n\n\tcomponentDidMount() {\n\t\t// This timeout is necessary to make sure the `useEffect` hook of\n\t\t// `useFocusReturn` gets the correct element (the button that opens the\n\t\t// PostPublishPanel) otherwise it will get this button.\n\t\tthis.timeoutID = setTimeout( () => {\n\t\t\tthis.cancelButtonNode.current.focus();\n\t\t}, 0 );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.timeoutID );\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\t// Automatically collapse the publish sidebar when a post\n\t\t// is published and the user makes an edit.\n\t\tif (\n\t\t\t( prevProps.isPublished &&\n\t\t\t\t! this.props.isSaving &&\n\t\t\t\tthis.props.isDirty ) ||\n\t\t\tthis.props.currentPostId !== prevProps.currentPostId\n\t\t) {\n\t\t\tthis.props.onClose();\n\t\t}\n\t}\n\n\tonSubmit() {\n\t\tconst { onClose, hasPublishAction, isPostTypeViewable } = this.props;\n\t\tif ( ! hasPublishAction || ! isPostTypeViewable ) {\n\t\t\tonClose();\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tforceIsDirty,\n\t\t\tisBeingScheduled,\n\t\t\tisPublished,\n\t\t\tisPublishSidebarEnabled,\n\t\t\tisScheduled,\n\t\t\tisSaving,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t\tonClose,\n\t\t\tonTogglePublishSidebar,\n\t\t\tPostPublishExtension,\n\t\t\tPrePublishExtension,\n\t\t\tcurrentPostId,\n\t\t\t...additionalProps\n\t\t} = this.props;\n\t\tconst {\n\t\t\thasPublishAction,\n\t\t\tisDirty,\n\t\t\tisPostTypeViewable,\n\t\t\t...propsForPanel\n\t\t} = additionalProps;\n\t\tconst isPublishedOrScheduled =\n\t\t\tisPublished || ( isScheduled && isBeingScheduled );\n\t\tconst isPrePublish = ! isPublishedOrScheduled && ! isSaving;\n\t\tconst isPostPublish = isPublishedOrScheduled && ! isSaving;\n\t\treturn (\n\t\t\t<div className=\"editor-post-publish-panel\" { ...propsForPanel }>\n\t\t\t\t<div className=\"editor-post-publish-panel__header\">\n\t\t\t\t\t{ isPostPublish ? (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\t\tlabel={ __( 'Close panel' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-cancel-button\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tref={ this.cancelButtonNode }\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t\tdisabled={ isSavingNonPostEntityChanges }\n\t\t\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-publish-button\">\n\t\t\t\t\t\t\t\t<PostPublishButton\n\t\t\t\t\t\t\t\t\tonSubmit={ this.onSubmit }\n\t\t\t\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"editor-post-publish-panel__content\">\n\t\t\t\t\t{ isPrePublish && (\n\t\t\t\t\t\t<PostPublishPanelPrepublish>\n\t\t\t\t\t\t\t{ PrePublishExtension && <PrePublishExtension /> }\n\t\t\t\t\t\t</PostPublishPanelPrepublish>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isPostPublish && (\n\t\t\t\t\t\t<PostPublishPanelPostpublish focusOnMount>\n\t\t\t\t\t\t\t{ PostPublishExtension && <PostPublishExtension /> }\n\t\t\t\t\t\t</PostPublishPanelPostpublish>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isSaving && <Spinner /> }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"editor-post-publish-panel__footer\">\n\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Always show pre-publish checks.' ) }\n\t\t\t\t\t\tchecked={ isPublishSidebarEnabled }\n\t\t\t\t\t\tonChange={ onTogglePublishSidebar }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n}\n\n/**\n * Renders a panel for publishing a post.\n */\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst {\n\t\t\tgetCurrentPost,\n\t\t\tgetCurrentPostId,\n\t\t\tgetEditedPostAttribute,\n\t\t\tisCurrentPostPublished,\n\t\t\tisCurrentPostScheduled,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tisEditedPostDirty,\n\t\t\tisAutosavingPost,\n\t\t\tisSavingPost,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t} = select( editorStore );\n\t\tconst { isPublishSidebarEnabled } = select( editorStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisPostTypeViewable: postType?.viewable,\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisDirty: isEditedPostDirty(),\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\tisPublishSidebarEnabled: isPublishSidebarEnabled(),\n\t\t\tisSaving: isSavingPost() && ! isAutosavingPost(),\n\t\t\tisSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),\n\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t\tcurrentPostId: getCurrentPostId(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { isPublishSidebarEnabled } ) => {\n\t\tconst { disablePublishSidebar, enablePublishSidebar } =\n\t\t\tdispatch( editorStore );\n\t\treturn {\n\t\t\tonTogglePublishSidebar: () => {\n\t\t\t\tif ( isPublishSidebarEnabled ) {\n\t\t\t\t\tdisablePublishSidebar();\n\t\t\t\t} else {\n\t\t\t\t\tenablePublishSidebar();\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t} ),\n\twithFocusReturn,\n\twithConstrainedTabbing,\n] )( PostPublishPanel );\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,qBAAqC;AACrC,wBAMO;AACP,kBAAyC;AACzC,qBAAwB;AACxB,mBAA2B;AAC3B,uBAAmC;AAKnC,iCAA8B;AAC9B,wBAAuC;AACvC,yBAAwC;AACxC,mBAAqC;AAwE/B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AAoB,KAAK;AAAA,MACrD,oBAAoB,UAAU;AAAA,MAC9B,kBAAkB,2BAA2B;AAAA,MAC7C,SAAS,kBAAkB;AAAA,MAC3B,aAAa,uBAAuB;AAAA,MACpC,yBAAyB,wBAAwB;AAAA,MACjD,UAAU,aAAa,KAAK,CAAE,iBAAiB;AAAA,MAC/C,8BAA8B,6BAA6B;AAAA,MAC3D,aAAa,uBAAuB;AAAA,MACpC,eAAe,iBAAiB;AAAA,IACjC;AAAA,EACD,CAAE;AAAA,MACF,0BAAc,CAAE,UAAU,EAAE,wBAAwB,MAAO;AAC1D,UAAM,EAAE,uBAAuB,qBAAqB,IACnD,SAAU,aAAAA,KAAY;AACvB,WAAO;AAAA,MACN,wBAAwB,MAAM;AAC7B,YAAK,yBAA0B;AAC9B,gCAAsB;AAAA,QACvB,OAAO;AACN,+BAAqB;AAAA,QACtB;AAAA,MACD;AAAA,IACD;AAAA,EACD,CAAE;AAAA,EACF;AAAA,EACA;AACD,CAAE,EAAG,gBAAiB;",
|
|
6
6
|
"names": ["PostPublishButton", "PostPublishPanelPrepublish", "PostPublishPanelPostpublish", "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-publish-panel/maybe-category-panel.js
|
|
29
31
|
var maybe_category_panel_exports = {};
|
|
30
32
|
__export(maybe_category_panel_exports, {
|
|
31
33
|
default: () => maybe_category_panel_default
|
|
32
34
|
});
|
|
33
35
|
module.exports = __toCommonJS(maybe_category_panel_exports);
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
36
|
var import_i18n = require("@wordpress/i18n");
|
|
36
37
|
var import_data = require("@wordpress/data");
|
|
37
38
|
var import_components = require("@wordpress/components");
|
|
@@ -39,6 +40,7 @@ var import_core_data = require("@wordpress/core-data");
|
|
|
39
40
|
var import_element = require("@wordpress/element");
|
|
40
41
|
var import_hierarchical_term_selector = __toESM(require("../post-taxonomies/hierarchical-term-selector"));
|
|
41
42
|
var import_store = require("../../store");
|
|
43
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
44
|
function MaybeCategoryPanel() {
|
|
43
45
|
const { hasNoCategory, hasSiteCategories } = (0, import_data.useSelect)((select) => {
|
|
44
46
|
const postType = select(import_store.store).getCurrentPostType();
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-publish-panel/maybe-category-panel.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { PanelBody } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport HierarchicalTermSelector from '../post-taxonomies/hierarchical-term-selector';\nimport { store as editorStore } from '../../store';\n\nfunction MaybeCategoryPanel() {\n\tconst { hasNoCategory, hasSiteCategories } = useSelect( ( select ) => {\n\t\tconst postType = select( editorStore ).getCurrentPostType();\n\t\tconst { canUser, getEntityRecord } = select( coreStore );\n\t\tconst categoriesTaxonomy = getEntityRecord(\n\t\t\t'root',\n\t\t\t'taxonomy',\n\t\t\t'category'\n\t\t);\n\t\tconst defaultCategoryId = canUser( 'read', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} )\n\t\t\t? getEntityRecord( 'root', 'site' )?.default_category\n\t\t\t: undefined;\n\t\tconst defaultCategory = defaultCategoryId\n\t\t\t? getEntityRecord( 'taxonomy', 'category', defaultCategoryId )\n\t\t\t: undefined;\n\t\tconst postTypeSupportsCategories =\n\t\t\tcategoriesTaxonomy &&\n\t\t\tcategoriesTaxonomy.types.some( ( type ) => type === postType );\n\t\tconst categories =\n\t\t\tcategoriesTaxonomy &&\n\t\t\tselect( editorStore ).getEditedPostAttribute(\n\t\t\t\tcategoriesTaxonomy.rest_base\n\t\t\t);\n\t\tconst siteCategories = postTypeSupportsCategories\n\t\t\t? !! select( coreStore ).getEntityRecords( 'taxonomy', 'category', {\n\t\t\t\t\texclude: [ defaultCategoryId ],\n\t\t\t\t\tper_page: 1,\n\t\t\t } )?.length\n\t\t\t: false;\n\n\t\t// This boolean should return true if everything is loaded\n\t\t// ( categoriesTaxonomy, defaultCategory )\n\t\t// and the post has not been assigned a category different than \"uncategorized\".\n\t\tconst noCategory =\n\t\t\t!! categoriesTaxonomy &&\n\t\t\t!! defaultCategory &&\n\t\t\tpostTypeSupportsCategories &&\n\t\t\t( categories?.length === 0 ||\n\t\t\t\t( categories?.length === 1 &&\n\t\t\t\t\tdefaultCategory?.id === categories[ 0 ] ) );\n\n\t\treturn {\n\t\t\thasNoCategory: noCategory,\n\t\t\thasSiteCategories: siteCategories,\n\t\t};\n\t}, [] );\n\n\tconst [ shouldShowPanel, setShouldShowPanel ] = useState( false );\n\tuseEffect( () => {\n\t\t// We use state to avoid hiding the panel if the user edits the categories\n\t\t// and adds one within the panel itself (while visible).\n\t\tif ( hasNoCategory ) {\n\t\t\tsetShouldShowPanel( true );\n\t\t}\n\t}, [ hasNoCategory ] );\n\n\t// We only want to show the category panel:\n\t// if the post type supports categories,\n\t// if the site has categories other than the default category,\n\t// and if the post has no other categories than the default category.\n\tif ( ! shouldShowPanel || ! hasSiteCategories ) {\n\t\treturn null;\n\t}\n\n\tconst panelBodyTitle = [\n\t\t__( 'Suggestion:' ),\n\t\t<span className=\"editor-post-publish-panel__link\" key=\"label\">\n\t\t\t{ __( 'Assign a category' ) }\n\t\t</span>,\n\t];\n\n\treturn (\n\t\t<PanelBody initialOpen={ false } title={ panelBodyTitle }>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<HierarchicalTermSelector slug=\"category\" />\n\t\t</PanelBody>\n\t);\n}\n\nexport default MaybeCategoryPanel;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,kBAA0B;AAC1B,wBAA0B;AAC1B,uBAAmC;AACnC,qBAAoC;AAKpC,wCAAqC;AACrC,mBAAqC;AAuEnC;AArEF,SAAS,qBAAqB;AAC7B,QAAM,EAAE,eAAe,kBAAkB,QAAI,uBAAW,CAAE,WAAY;AACrE,UAAM,WAAW,OAAQ,aAAAA,KAAY,EAAE,mBAAmB;AAC1D,UAAM,EAAE,SAAS,gBAAgB,IAAI,OAAQ,iBAAAC,KAAU;AACvD,UAAM,qBAAqB;AAAA,MAC1B;AAAA,MACA;AAAA,MACA;AAAA,IACD;AACA,UAAM,oBAAoB,QAAS,QAAQ;AAAA,MAC1C,MAAM;AAAA,MACN,MAAM;AAAA,IACP,CAAE,IACC,gBAAiB,QAAQ,MAAO,GAAG,mBACnC;AACH,UAAM,kBAAkB,oBACrB,gBAAiB,YAAY,YAAY,iBAAkB,IAC3D;AACH,UAAM,6BACL,sBACA,mBAAmB,MAAM,KAAM,CAAE,SAAU,SAAS,QAAS;AAC9D,UAAM,aACL,sBACA,OAAQ,aAAAD,KAAY,EAAE;AAAA,MACrB,mBAAmB;AAAA,IACpB;AACD,UAAM,iBAAiB,6BACpB,CAAC,CAAE,OAAQ,iBAAAC,KAAU,EAAE,iBAAkB,YAAY,YAAY;AAAA,MACjE,SAAS,CAAE,iBAAkB;AAAA,MAC7B,UAAU;AAAA,IACV,CAAE,GAAG,SACL;AAKH,UAAM,aACL,CAAC,CAAE,sBACH,CAAC,CAAE,mBACH,+BACE,YAAY,WAAW,KACtB,YAAY,WAAW,KACxB,iBAAiB,OAAO,WAAY,CAAE;AAEzC,WAAO;AAAA,MACN,eAAe;AAAA,MACf,mBAAmB;AAAA,IACpB;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,QAAM,CAAE,iBAAiB,kBAAmB,QAAI,yBAAU,KAAM;AAChE,gCAAW,MAAM;AAGhB,QAAK,eAAgB;AACpB,yBAAoB,IAAK;AAAA,IAC1B;AAAA,EACD,GAAG,CAAE,aAAc,CAAE;AAMrB,MAAK,CAAE,mBAAmB,CAAE,mBAAoB;AAC/C,WAAO;AAAA,EACR;AAEA,QAAM,iBAAiB;AAAA,QACtB,gBAAI,aAAc;AAAA,IAClB,4CAAC,UAAK,WAAU,mCACb,8BAAI,mBAAoB,KAD2B,OAEtD;AAAA,EACD;AAEA,SACC,6CAAC,+BAAU,aAAc,OAAQ,OAAQ,gBACxC;AAAA,gDAAC,OACE;AAAA,MACD;AAAA,IACD,GACD;AAAA,IACA,4CAAC,kCAAAC,SAAA,EAAyB,MAAK,YAAW;AAAA,KAC3C;AAEF;AAEA,IAAO,+BAAQ;",
|
|
6
6
|
"names": ["editorStore", "coreStore", "HierarchicalTermSelector"]
|
|
7
7
|
}
|
|
@@ -16,25 +16,27 @@ 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-publish-panel/maybe-post-format-panel.js
|
|
19
21
|
var maybe_post_format_panel_exports = {};
|
|
20
22
|
__export(maybe_post_format_panel_exports, {
|
|
21
23
|
default: () => PostFormatPanel
|
|
22
24
|
});
|
|
23
25
|
module.exports = __toCommonJS(maybe_post_format_panel_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");
|
|
28
29
|
var import_core_data = require("@wordpress/core-data");
|
|
29
30
|
var import_post_format = require("../post-format");
|
|
30
31
|
var import_store = require("../../store");
|
|
31
|
-
|
|
32
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
+
var getSuggestion = (supportedFormats, suggestedPostFormat) => {
|
|
32
34
|
const formats = import_post_format.POST_FORMATS.filter(
|
|
33
35
|
(format) => supportedFormats?.includes(format.id)
|
|
34
36
|
);
|
|
35
37
|
return formats.find((format) => format.id === suggestedPostFormat);
|
|
36
38
|
};
|
|
37
|
-
|
|
39
|
+
var PostFormatSuggestion = ({
|
|
38
40
|
suggestedPostFormat,
|
|
39
41
|
suggestionText,
|
|
40
42
|
onUpdatePostFormat
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-publish-panel/maybe-post-format-panel.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Button, PanelBody } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { POST_FORMATS } from '../post-format';\nimport { store as editorStore } from '../../store';\n\nconst getSuggestion = ( supportedFormats, suggestedPostFormat ) => {\n\tconst formats = POST_FORMATS.filter( ( format ) =>\n\t\tsupportedFormats?.includes( format.id )\n\t);\n\treturn formats.find( ( format ) => format.id === suggestedPostFormat );\n};\n\nconst PostFormatSuggestion = ( {\n\tsuggestedPostFormat,\n\tsuggestionText,\n\tonUpdatePostFormat,\n} ) => (\n\t<Button\n\t\t__next40pxDefaultSize\n\t\tvariant=\"link\"\n\t\tonClick={ () => onUpdatePostFormat( suggestedPostFormat ) }\n\t>\n\t\t{ suggestionText }\n\t</Button>\n);\n\nexport default function PostFormatPanel() {\n\tconst { currentPostFormat, suggestion } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, getSuggestedPostFormat } =\n\t\t\tselect( editorStore );\n\t\tconst supportedFormats =\n\t\t\tselect( coreStore ).getThemeSupports().formats ?? [];\n\t\treturn {\n\t\t\tcurrentPostFormat: getEditedPostAttribute( 'format' ),\n\t\t\tsuggestion: getSuggestion(\n\t\t\t\tsupportedFormats,\n\t\t\t\tgetSuggestedPostFormat()\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\tconst { editPost } = useDispatch( editorStore );\n\n\tconst onUpdatePostFormat = ( format ) => editPost( { format } );\n\n\tconst panelBodyTitle = [\n\t\t__( 'Suggestion:' ),\n\t\t<span className=\"editor-post-publish-panel__link\" key=\"label\">\n\t\t\t{ __( 'Use a post format' ) }\n\t\t</span>,\n\t];\n\n\tif ( ! suggestion || suggestion.id === currentPostFormat ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody initialOpen={ false } title={ panelBodyTitle }>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<PostFormatSuggestion\n\t\t\t\t\tonUpdatePostFormat={ onUpdatePostFormat }\n\t\t\t\t\tsuggestedPostFormat={ suggestion.id }\n\t\t\t\t\tsuggestionText={ sprintf(\n\t\t\t\t\t\t/* translators: %1s: post format */\n\t\t\t\t\t\t__( 'Apply the \"%1$s\" format.' ),\n\t\t\t\t\t\tsuggestion.caption\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</p>\n\t\t</PanelBody>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAkC;AAClC,kBAAuC;AACvC,kBAA4B;AAC5B,uBAAmC;AAKnC,yBAA6B;AAC7B,mBAAqC;AAcpC;AAZD,IAAM,gBAAgB,CAAE,kBAAkB,wBAAyB;AAClE,QAAM,UAAU,gCAAa;AA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Z;AAAA;AAAA,IACD,GACD;AAAA,KACD;AAEF;",
|
|
6
6
|
"names": ["editorStore", "coreStore"]
|
|
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-publish-panel/maybe-tags-panel.js
|
|
29
31
|
var maybe_tags_panel_exports = {};
|
|
30
32
|
__export(maybe_tags_panel_exports, {
|
|
31
33
|
default: () => maybe_tags_panel_default
|
|
32
34
|
});
|
|
33
35
|
module.exports = __toCommonJS(maybe_tags_panel_exports);
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
36
|
var import_i18n = require("@wordpress/i18n");
|
|
36
37
|
var import_element = require("@wordpress/element");
|
|
37
38
|
var import_data = require("@wordpress/data");
|
|
@@ -39,7 +40,8 @@ var import_components = require("@wordpress/components");
|
|
|
39
40
|
var import_core_data = require("@wordpress/core-data");
|
|
40
41
|
var import_flat_term_selector = __toESM(require("../post-taxonomies/flat-term-selector"));
|
|
41
42
|
var import_store = require("../../store");
|
|
42
|
-
|
|
43
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
|
+
var TagsPanel = () => {
|
|
43
45
|
const tagLabels = (0, import_data.useSelect)((select) => {
|
|
44
46
|
const taxonomy = select(import_core_data.store).getTaxonomy("post_tag");
|
|
45
47
|
return taxonomy?.labels;
|
|
@@ -61,7 +63,7 @@ const TagsPanel = () => {
|
|
|
61
63
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_flat_term_selector.default, { slug: "post_tag", __nextHasNoMarginBottom: true })
|
|
62
64
|
] });
|
|
63
65
|
};
|
|
64
|
-
|
|
66
|
+
var MaybeTagsPanel = () => {
|
|
65
67
|
const { postHasTags, siteHasTags, isPostTypeSupported } = (0, import_data.useSelect)(
|
|
66
68
|
(select) => {
|
|
67
69
|
const postType = select(import_store.store).getCurrentPostType();
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-publish-panel/maybe-tags-panel.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { PanelBody } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport FlatTermSelector from '../post-taxonomies/flat-term-selector';\nimport { store as editorStore } from '../../store';\n\nconst TagsPanel = () => {\n\tconst tagLabels = useSelect( ( select ) => {\n\t\tconst taxonomy = select( coreStore ).getTaxonomy( 'post_tag' );\n\t\treturn taxonomy?.labels;\n\t}, [] );\n\n\tconst addNewItem = tagLabels?.add_new_item ?? __( 'Add tag' );\n\tconst tagLabel = tagLabels?.name ?? __( 'Tags' );\n\n\tconst panelBodyTitle = [\n\t\t__( 'Suggestion:' ),\n\t\t<span className=\"editor-post-publish-panel__link\" key=\"label\">\n\t\t\t{ addNewItem }\n\t\t</span>,\n\t];\n\n\treturn (\n\t\t<PanelBody initialOpen={ false } title={ panelBodyTitle }>\n\t\t\t<p>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t// translators: %s is the taxonomy name (e.g., \"Tags\").\n\t\t\t\t\t__(\n\t\t\t\t\t\t'%s help users and search engines navigate your site and find your content. Add a few keywords to describe your post.'\n\t\t\t\t\t),\n\t\t\t\t\ttagLabel\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<FlatTermSelector slug=\"post_tag\" __nextHasNoMarginBottom />\n\t\t</PanelBody>\n\t);\n};\n\nconst MaybeTagsPanel = () => {\n\tconst { postHasTags, siteHasTags, isPostTypeSupported } = useSelect(\n\t\t( select ) => {\n\t\t\tconst postType = select( editorStore ).getCurrentPostType();\n\t\t\tconst tagsTaxonomy = select( coreStore ).getEntityRecord(\n\t\t\t\t'root',\n\t\t\t\t'taxonomy',\n\t\t\t\t'post_tag'\n\t\t\t);\n\t\t\tconst _isPostTypeSupported =\n\t\t\t\ttagsTaxonomy?.types?.includes( postType );\n\t\t\tconst areTagsFetched = tagsTaxonomy !== undefined;\n\t\t\tconst tags =\n\t\t\t\ttagsTaxonomy &&\n\t\t\t\tselect( editorStore ).getEditedPostAttribute(\n\t\t\t\t\ttagsTaxonomy.rest_base\n\t\t\t\t);\n\t\t\tconst siteTags = _isPostTypeSupported\n\t\t\t\t? !! select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t'taxonomy',\n\t\t\t\t\t\t'post_tag',\n\t\t\t\t\t\t{ per_page: 1 }\n\t\t\t\t )?.length\n\t\t\t\t: false;\n\n\t\t\treturn {\n\t\t\t\tpostHasTags: !! tags?.length,\n\t\t\t\tsiteHasTags: siteTags,\n\t\t\t\tisPostTypeSupported: areTagsFetched && _isPostTypeSupported,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst [ hadTagsWhenOpeningThePanel ] = useState( postHasTags );\n\n\t/**\n\t * We only want to show the tag panel if the post type supports\n\t * tags and the site has tags.\n\t */\n\tif ( ! isPostTypeSupported || ! siteHasTags ) {\n\t\treturn null;\n\t}\n\n\t/*\n\t * We only want to show the tag panel if the post didn't have\n\t * any tags when the user hit the Publish button.\n\t *\n\t * We can't use the prop.postHasTags because it'll change to true\n\t * if the user adds a new tag within the pre-publish panel.\n\t * This would force a re-render and a new prop.postHasTags check,\n\t * hiding this panel and keeping the user from adding\n\t * more than one tag.\n\t */\n\tif ( ! hadTagsWhenOpeningThePanel ) {\n\t\treturn <TagsPanel />;\n\t}\n\n\treturn null;\n};\n\nexport default MaybeTagsPanel;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA4B;AAC5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,aAAa,CAAC,CAAE,MAAM;AAAA,QACtB,aAAa;AAAA,QACb,qBAAqB,kBAAkB;AAAA,MACxC;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AACA,QAAM,CAAE,0BAA2B,QAAI,yBAAU,WAAY;AAM7D,MAAK,CAAE,uBAAuB,CAAE,aAAc;AAC7C,WAAO;AAAA,EACR;AAYA,MAAK,CAAE,4BAA6B;AACnC,WAAO,4CAAC,aAAU;AAAA,EACnB;AAEA,SAAO;AACR;AAEA,IAAO,2BAAQ;",
|
|
6
6
|
"names": ["coreStore", "FlatTermSelector", "editorStore"]
|
|
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-publish-panel/maybe-upload-media.js
|
|
19
21
|
var maybe_upload_media_exports = {};
|
|
20
22
|
__export(maybe_upload_media_exports, {
|
|
21
23
|
default: () => MaybeUploadMediaPanel
|
|
22
24
|
});
|
|
23
25
|
module.exports = __toCommonJS(maybe_upload_media_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");
|
|
@@ -29,6 +30,7 @@ var import_block_editor = require("@wordpress/block-editor");
|
|
|
29
30
|
var import_element = require("@wordpress/element");
|
|
30
31
|
var import_blob = require("@wordpress/blob");
|
|
31
32
|
var import_media_util = require("./media-util");
|
|
33
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
34
|
function flattenBlocks(blocks) {
|
|
33
35
|
const result = [];
|
|
34
36
|
blocks.forEach((block) => {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-publish-panel/maybe-upload-media.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tButton,\n\tSpinner,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useState } from '@wordpress/element';\nimport { isBlobURL } from '@wordpress/blob';\n\n/**\n * Internal dependencies\n */\nimport { fetchMedia } from './media-util';\n\nfunction flattenBlocks( blocks ) {\n\tconst result = [];\n\n\tblocks.forEach( ( block ) => {\n\t\tresult.push( block );\n\t\tresult.push( ...flattenBlocks( block.innerBlocks ) );\n\t} );\n\n\treturn result;\n}\n\n/**\n * Determine whether a block has external media.\n *\n * Different blocks use different attribute names (and potentially\n * different logic as well) in determining whether the media is\n * present, and whether it's external.\n *\n * @param {{name: string, attributes: Object}} block The block.\n * @return {boolean?} Whether the block has external media\n */\nfunction hasExternalMedia( block ) {\n\tif ( block.name === 'core/image' || block.name === 'core/cover' ) {\n\t\treturn block.attributes.url && ! block.attributes.id;\n\t}\n\n\tif ( block.name === 'core/media-text' ) {\n\t\treturn block.attributes.mediaUrl && ! block.attributes.mediaId;\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Retrieve media info from a block.\n *\n * Different blocks use different attribute names, so we need this\n * function to normalize things into a consistent naming scheme.\n *\n * @param {{name: string, attributes: Object}} block The block.\n * @return {{url: ?string, alt: ?string, id: ?number}} The media info for the block.\n */\nfunction getMediaInfo( block ) {\n\tif ( block.name === 'core/image' || block.name === 'core/cover' ) {\n\t\tconst { url, alt, id } = block.attributes;\n\t\treturn { url, alt, id };\n\t}\n\n\tif ( block.name === 'core/media-text' ) {\n\t\tconst { mediaUrl: url, mediaAlt: alt, mediaId: id } = block.attributes;\n\t\treturn { url, alt, id };\n\t}\n\n\treturn {};\n}\n\n// Image component to represent a single image in the upload dialog.\nfunction Image( { clientId, alt, url } ) {\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\treturn (\n\t\t<motion.img\n\t\t\ttabIndex={ 0 }\n\t\t\trole=\"button\"\n\t\t\taria-label={ __( 'Select image block.' ) }\n\t\t\tonClick={ () => {\n\t\t\t\tselectBlock( clientId );\n\t\t\t} }\n\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\tif ( event.key === 'Enter' || event.key === ' ' ) {\n\t\t\t\t\tselectBlock( clientId );\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t} }\n\t\t\tkey={ clientId }\n\t\t\talt={ alt }\n\t\t\tsrc={ url }\n\t\t\tanimate={ { opacity: 1 } }\n\t\t\texit={ { opacity: 0, scale: 0 } }\n\t\t\tstyle={ {\n\t\t\t\twidth: '32px',\n\t\t\t\theight: '32px',\n\t\t\t\tobjectFit: 'cover',\n\t\t\t\tborderRadius: '2px',\n\t\t\t\tcursor: 'pointer',\n\t\t\t} }\n\t\t\twhileHover={ { scale: 1.08 } }\n\t\t/>\n\t);\n}\n\nexport default function MaybeUploadMediaPanel() {\n\tconst [ isUploading, setIsUploading ] = useState( false );\n\tconst [ isAnimating, setIsAnimating ] = useState( false );\n\tconst [ hadUploadError, setHadUploadError ] = useState( false );\n\tconst { editorBlocks, mediaUpload } = useSelect(\n\t\t( select ) => ( {\n\t\t\teditorBlocks: select( blockEditorStore ).getBlocks(),\n\t\t\tmediaUpload: select( blockEditorStore ).getSettings().mediaUpload,\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Get a list of blocks with external media.\n\tconst blocksWithExternalMedia = flattenBlocks( editorBlocks ).filter(\n\t\t( block ) => hasExternalMedia( block )\n\t);\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\n\tif ( ! mediaUpload || ! blocksWithExternalMedia.length ) {\n\t\treturn null;\n\t}\n\n\tconst panelBodyTitle = [\n\t\t__( 'Suggestion:' ),\n\t\t<span className=\"editor-post-publish-panel__link\" key=\"label\">\n\t\t\t{ __( 'External media' ) }\n\t\t</span>,\n\t];\n\n\t/**\n\t * Update an individual block to point to newly-added library media.\n\t *\n\t * Different blocks use different attribute names, so we need this\n\t * function to ensure we modify the correct attributes for each type.\n\t *\n\t * @param {{name: string, attributes: Object}} block The block.\n\t * @param {{id: number, url: string}} media Media library file info.\n\t */\n\tfunction updateBlockWithUploadedMedia( block, media ) {\n\t\tif ( block.name === 'core/image' || block.name === 'core/cover' ) {\n\t\t\tupdateBlockAttributes( block.clientId, {\n\t\t\t\tid: media.id,\n\t\t\t\turl: media.url,\n\t\t\t} );\n\t\t}\n\n\t\tif ( block.name === 'core/media-text' ) {\n\t\t\tupdateBlockAttributes( block.clientId, {\n\t\t\t\tmediaId: media.id,\n\t\t\t\tmediaUrl: media.url,\n\t\t\t} );\n\t\t}\n\t}\n\n\t// Handle fetching and uploading all external media in the post.\n\tfunction uploadImages() {\n\t\tsetIsUploading( true );\n\t\tsetHadUploadError( false );\n\n\t\t// Multiple blocks can be using the same URL, so we\n\t\t// should ensure we only fetch and upload each of them once.\n\t\tconst mediaUrls = new Set(\n\t\t\tblocksWithExternalMedia.map( ( block ) => {\n\t\t\t\tconst { url } = getMediaInfo( block );\n\t\t\t\treturn url;\n\t\t\t} )\n\t\t);\n\n\t\t// Create an upload promise for each URL, that we can wait for in all\n\t\t// blocks that make use of that media.\n\t\tconst uploadPromises = Object.fromEntries(\n\t\t\tObject.entries( fetchMedia( [ ...mediaUrls ] ) ).map(\n\t\t\t\t( [ url, filePromise ] ) => {\n\t\t\t\t\tconst uploadPromise = filePromise.then(\n\t\t\t\t\t\t( blob ) =>\n\t\t\t\t\t\t\tnew Promise( ( resolve, reject ) => {\n\t\t\t\t\t\t\t\tmediaUpload( {\n\t\t\t\t\t\t\t\t\tfilesList: [ blob ],\n\t\t\t\t\t\t\t\t\tonFileChange: ( [ media ] ) => {\n\t\t\t\t\t\t\t\t\t\tif ( isBlobURL( media.url ) ) {\n\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tresolve( media );\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tonError() {\n\t\t\t\t\t\t\t\t\t\treject();\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} )\n\t\t\t\t\t);\n\n\t\t\t\t\treturn [ url, uploadPromise ];\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\n\t\t// Wait for all blocks to be updated with library media.\n\t\tPromise.allSettled(\n\t\t\tblocksWithExternalMedia.map( ( block ) => {\n\t\t\t\tconst { url } = getMediaInfo( block );\n\n\t\t\t\treturn uploadPromises[ url ]\n\t\t\t\t\t.then( ( media ) =>\n\t\t\t\t\t\tupdateBlockWithUploadedMedia( block, media )\n\t\t\t\t\t)\n\t\t\t\t\t.then( () => setIsAnimating( true ) )\n\t\t\t\t\t.catch( () => setHadUploadError( true ) );\n\t\t\t} )\n\t\t).finally( () => {\n\t\t\tsetIsUploading( false );\n\t\t} );\n\t}\n\n\treturn (\n\t\t<PanelBody initialOpen title={ panelBodyTitle }>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<div\n\t\t\t\tstyle={ {\n\t\t\t\t\tdisplay: 'inline-flex',\n\t\t\t\t\tflexWrap: 'wrap',\n\t\t\t\t\tgap: '8px',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<AnimatePresence\n\t\t\t\t\tonExitComplete={ () => setIsAnimating( false ) }\n\t\t\t\t>\n\t\t\t\t\t{ blocksWithExternalMedia.map( ( block ) => {\n\t\t\t\t\t\tconst { url, alt } = getMediaInfo( block );\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Image\n\t\t\t\t\t\t\t\tkey={ block.clientId }\n\t\t\t\t\t\t\t\tclientId={ block.clientId }\n\t\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\t\talt={ alt }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t\t</AnimatePresence>\n\t\t\t\t{ isUploading || isAnimating ? (\n\t\t\t\t\t<Spinner />\n\t\t\t\t) : (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ uploadImages }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ _x( 'Upload', 'verb' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t{ hadUploadError && <p>{ __( 'Upload failed, try again.' ) }</p> }\n\t\t</PanelBody>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAMO;AACP,kBAAuC;AACvC,kBAAuB;AACvB,0BAA0C;AAC1C,qBAAyB;AACzB,kBAA0B;AAK1B,wBAA2B;AA8DzB;AA5DF,SAAS,cAAe,QAAS;AAChC,QAAM,SAAS,CAAC;AAEhB,SAAO,QAAS,CAAE,UAAW;AAC5B,WAAO,KAAM,KAAM;AACnB,WAAO,KAAM,GAAG,cAAe,MAAM,WAAY,CAAE;AAAA,EACpD,CAAE;AAEF,SAAO;AACR;AAYA,SAAS,iBAAkB,OAAQ;AAClC,MAAK,MAAM,SAAS,gBAAgB,MAAM,SAAS,cAAe;AACjE,WAAO,MAAM,WAAW,OAAO,CAAE,MAAM,WAAW;AAAA,EACnD;AAEA,MAAK,MAAM,SAAS,mBAAoB;AACvC,WAAO,MAAM,WAAW,YAAY,CAAE,MAAM,WAAW;AAAA,EACxD;AAEA,SAAO;AACR;AAWA,SAAS,aAAc,OAAQ;AAC9B,MAAK,MAAM,SAAS,gBAAgB,MAAM,SAA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H;AAAA,UACE,eAAe,cAChB,4CAAC,6BAAQ,IAET;AAAA,YAAC;AAAA;AAAA,cACA,MAAK;AAAA,cACL,SAAQ;AAAA,cACR,SAAU;AAAA,cAER,8BAAI,UAAU,MAAO;AAAA;AAAA,UACxB;AAAA;AAAA;AAAA,IAEF;AAAA,IACE,kBAAkB,4CAAC,OAAI,8BAAI,2BAA4B,GAAG;AAAA,KAC7D;AAEF;",
|
|
6
6
|
"names": ["blockEditorStore", "motion", "AnimatePresence"]
|
|
7
7
|
}
|
|
@@ -16,6 +16,8 @@ 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-publish-panel/media-util.js
|
|
19
21
|
var media_util_exports = {};
|
|
20
22
|
__export(media_util_exports, {
|
|
21
23
|
fetchMedia: () => fetchMedia,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-publish-panel/media-util.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * External dependencies\n */\nimport { v4 as uuid } from 'uuid';\n\n/**\n * WordPress dependencies\n */\nimport { getFilename } from '@wordpress/url';\n\n/**\n * Generate a list of unique basenames given a list of URLs.\n *\n * We want all basenames to be unique, since sometimes the extension\n * doesn't reflect the mime type, and may end up getting changed by\n * the server, on upload.\n *\n * @param {string[]} urls The list of URLs\n * @return {Record< string, string >} A URL => basename record.\n */\nexport function generateUniqueBasenames( urls ) {\n\tconst basenames = new Set();\n\n\treturn Object.fromEntries(\n\t\turls.map( ( url ) => {\n\t\t\t// We prefer to match the remote filename, if possible.\n\t\t\tconst filename = getFilename( url );\n\t\t\tlet basename = '';\n\n\t\t\tif ( filename ) {\n\t\t\t\tconst parts = filename.split( '.' );\n\t\t\t\tif ( parts.length > 1 ) {\n\t\t\t\t\t// Assume the last part is the extension.\n\t\t\t\t\tparts.pop();\n\t\t\t\t}\n\t\t\t\tbasename = parts.join( '.' );\n\t\t\t}\n\n\t\t\tif ( ! basename ) {\n\t\t\t\t// It looks like we don't have a basename, so let's use a UUID.\n\t\t\t\tbasename = uuid();\n\t\t\t}\n\n\t\t\tif ( basenames.has( basename ) ) {\n\t\t\t\t// Append a UUID to deduplicate the basename.\n\t\t\t\t// The server will try to deduplicate on its own if we don't do this,\n\t\t\t\t// but it may run into a race condition\n\t\t\t\t// (see https://github.com/WordPress/gutenberg/issues/64899).\n\t\t\t\t// Deduplicating the filenames before uploading is safer.\n\t\t\t\tbasename = `${ basename }-${ uuid() }`;\n\t\t\t}\n\n\t\t\tbasenames.add( basename );\n\n\t\t\treturn [ url, basename ];\n\t\t} )\n\t);\n}\n\n/**\n * Fetch a list of URLs, turning those into promises for files with\n * unique filenames.\n *\n * @param {string[]} urls The list of URLs\n * @return {Record< string, Promise< File > >} A URL => File promise record.\n */\nexport function fetchMedia( urls ) {\n\treturn Object.fromEntries(\n\t\tObject.entries( generateUniqueBasenames( urls ) ).map(\n\t\t\t( [ url, basename ] ) => {\n\t\t\t\tconst filePromise = window\n\t\t\t\t\t.fetch( url.includes( '?' ) ? url : url + '?' )\n\t\t\t\t\t.then( ( response ) => response.blob() )\n\t\t\t\t\t.then( ( blob ) => {\n\t\t\t\t\t\t// The server will reject the upload if it doesn't have an extension,\n\t\t\t\t\t\t// even though it'll rewrite the file name to match the mime type.\n\t\t\t\t\t\t// Here we provide it with a safe extension to get it past that check.\n\t\t\t\t\t\treturn new File( [ blob ], `${ basename }.png`, {\n\t\t\t\t\t\t\ttype: blob.type,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} );\n\n\t\t\t\treturn [ url, filePromise ];\n\t\t\t}\n\t\t)\n\t);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA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__copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/editor/src/components/post-publish-panel/postpublish.js
|
|
29
31
|
var postpublish_exports = {};
|
|
30
32
|
__export(postpublish_exports, {
|
|
31
33
|
default: () => PostPublishPanelPostpublish
|
|
32
34
|
});
|
|
33
35
|
module.exports = __toCommonJS(postpublish_exports);
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
36
|
var import_components = require("@wordpress/components");
|
|
36
37
|
var import_i18n = require("@wordpress/i18n");
|
|
37
38
|
var import_element = require("@wordpress/element");
|
|
@@ -43,9 +44,10 @@ var import_core_data = require("@wordpress/core-data");
|
|
|
43
44
|
var import_icons = require("@wordpress/icons");
|
|
44
45
|
var import_label = __toESM(require("../post-schedule/label"));
|
|
45
46
|
var import_store = require("../../store");
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
48
|
+
var POSTNAME = "%postname%";
|
|
49
|
+
var PAGENAME = "%pagename%";
|
|
50
|
+
var getFuturePostUrl = (post) => {
|
|
49
51
|
const { slug } = post;
|
|
50
52
|
if (post.permalink_template.includes(POSTNAME)) {
|
|
51
53
|
return post.permalink_template.replace(POSTNAME, slug);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-publish-panel/postpublish.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tButton,\n\tTextControl,\n\tExternalLink,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useCallback, useEffect, useState, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { addQueryArgs, safeDecodeURIComponent } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { external } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport PostScheduleLabel from '../post-schedule/label';\nimport { store as editorStore } from '../../store';\n\nconst POSTNAME = '%postname%';\nconst PAGENAME = '%pagename%';\n\n/**\n * Returns URL for a future post.\n *\n * @param {Object} post Post object.\n *\n * @return {string} PostPublish URL.\n */\n\nconst getFuturePostUrl = ( post ) => {\n\tconst { slug } = post;\n\n\tif ( post.permalink_template.includes( POSTNAME ) ) {\n\t\treturn post.permalink_template.replace( POSTNAME, slug );\n\t}\n\n\tif ( post.permalink_template.includes( PAGENAME ) ) {\n\t\treturn post.permalink_template.replace( PAGENAME, slug );\n\t}\n\n\treturn post.permalink_template;\n};\n\nfunction CopyButton( { text } ) {\n\tconst [ showCopyConfirmation, setShowCopyConfirmation ] = useState( false );\n\tconst timeoutIdRef = useRef();\n\tconst ref = useCopyToClipboard( text, () => {\n\t\tsetShowCopyConfirmation( true );\n\t\tif ( timeoutIdRef.current ) {\n\t\t\tclearTimeout( timeoutIdRef.current );\n\t\t}\n\t\ttimeoutIdRef.current = setTimeout( () => {\n\t\t\tsetShowCopyConfirmation( false );\n\t\t}, 4000 );\n\t} );\n\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tif ( timeoutIdRef.current ) {\n\t\t\t\tclearTimeout( timeoutIdRef.current );\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Button __next40pxDefaultSize variant=\"secondary\" ref={ ref }>\n\t\t\t{ showCopyConfirmation ? __( 'Copied!' ) : __( 'Copy' ) }\n\t\t</Button>\n\t);\n}\n\nexport default function PostPublishPanelPostpublish( {\n\tfocusOnMount,\n\tchildren,\n} ) {\n\tconst { post, postType, isScheduled } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetCurrentPost,\n\t\t\tisCurrentPostScheduled,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\n\t\treturn {\n\t\t\tpost: getCurrentPost(),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t};\n\t}, [] );\n\n\tconst postLabel = postType?.labels?.singular_name;\n\tconst viewPostLabel = postType?.labels?.view_item;\n\tconst addNewPostLabel = postType?.labels?.add_new_item;\n\tconst link =\n\t\tpost.status === 'future' ? getFuturePostUrl( post ) : post.link;\n\tconst addLink = addQueryArgs( 'post-new.php', {\n\t\tpost_type: post.type,\n\t} );\n\n\tconst postLinkRef = useCallback(\n\t\t( node ) => {\n\t\t\tif ( focusOnMount && node ) {\n\t\t\t\tnode.focus();\n\t\t\t}\n\t\t},\n\t\t[ focusOnMount ]\n\t);\n\n\tconst postPublishNonLinkHeader = isScheduled ? (\n\t\t<>\n\t\t\t{ __( 'is now scheduled. It will go live on' ) }{ ' ' }\n\t\t\t<PostScheduleLabel />.\n\t\t</>\n\t) : (\n\t\t__( 'is now live.' )\n\t);\n\n\treturn (\n\t\t<div className=\"post-publish-panel__postpublish\">\n\t\t\t<PanelBody className=\"post-publish-panel__postpublish-header\">\n\t\t\t\t<ExternalLink ref={ postLinkRef } href={ link }>\n\t\t\t\t\t{ decodeEntities( post.title ) || __( '(no title)' ) }\n\t\t\t\t</ExternalLink>{ ' ' }\n\t\t\t\t{ postPublishNonLinkHeader }\n\t\t\t</PanelBody>\n\t\t\t<PanelBody>\n\t\t\t\t<p className=\"post-publish-panel__postpublish-subheader\">\n\t\t\t\t\t<strong>{ __( 'What\u2019s next?' ) }</strong>\n\t\t\t\t</p>\n\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address-container\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tclassName=\"post-publish-panel__postpublish-post-address\"\n\t\t\t\t\t\treadOnly\n\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t/* translators: %s: post type singular name */\n\t\t\t\t\t\t\t__( '%s address' ),\n\t\t\t\t\t\t\tpostLabel\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tvalue={ safeDecodeURIComponent( link ) }\n\t\t\t\t\t\tonFocus={ ( event ) => event.target.select() }\n\t\t\t\t\t/>\n\n\t\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address__copy-button-wrap\">\n\t\t\t\t\t\t<CopyButton text={ link } />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"post-publish-panel__postpublish-buttons\">\n\t\t\t\t\t{ ! isScheduled && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\thref={ link }\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\ticonPosition=\"right\"\n\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ viewPostLabel }\n\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant={ isScheduled ? 'primary' : 'secondary' }\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\thref={ addLink }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ addNewPostLabel }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t</PanelBody>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAMO;AACP,kBAA4B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I,YAAa;AAAA,cACjB;AAAA,YACD;AAAA,YACA,WAAQ,mCAAwB,IAAK;AAAA,YACrC,SAAU,CAAE,UAAW,MAAM,OAAO,OAAO;AAAA;AAAA,QAC5C;AAAA,QAEA,4CAAC,SAAI,WAAU,kEACd,sDAAC,cAAW,MAAO,MAAO,GAC3B;AAAA,SACD;AAAA,MAEA,6CAAC,SAAI,WAAU,2CACZ;AAAA,SAAE,eACH;AAAA,UAAC;AAAA;AAAA,YACA,SAAQ;AAAA,YACR,MAAO;AAAA,YACP,uBAAqB;AAAA,YACrB,MAAO;AAAA,YACP,cAAa;AAAA,YACb,QAAO;AAAA,YAEL;AAAA;AAAA,cACF,4CAAC;AAAA,gBAAe,IAAG;AAAA;AAAA,gBAGjB,8BAAI,sBAAuB;AAAA,eAE7B;AAAA;AAAA;AAAA,QACD;AAAA,QAED;AAAA,UAAC;AAAA;AAAA,YACA,SAAU,cAAc,YAAY;AAAA,YACpC,uBAAqB;AAAA,YACrB,MAAO;AAAA,YAEL;AAAA;AAAA,QACH;AAAA,SACD;AAAA,OACD;AAAA,IACE;AAAA,KACH;AAEF;",
|
|
6
6
|
"names": ["editorStore", "coreStore", "PostScheduleLabel"]
|
|
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-publish-panel/prepublish.js
|
|
29
31
|
var prepublish_exports = {};
|
|
30
32
|
__export(prepublish_exports, {
|
|
31
33
|
default: () => prepublish_default
|
|
32
34
|
});
|
|
33
35
|
module.exports = __toCommonJS(prepublish_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");
|
|
@@ -48,6 +49,7 @@ var import_maybe_post_format_panel = __toESM(require("./maybe-post-format-panel"
|
|
|
48
49
|
var import_store = require("../../store");
|
|
49
50
|
var import_maybe_category_panel = __toESM(require("./maybe-category-panel"));
|
|
50
51
|
var import_maybe_upload_media = __toESM(require("./maybe-upload-media"));
|
|
52
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
51
53
|
function PostPublishPanelPrepublish({ children }) {
|
|
52
54
|
const {
|
|
53
55
|
isBeingScheduled,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-publish-panel/prepublish.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Icon, PanelBody } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { wordpress } from '@wordpress/icons';\nimport { filterURLForDisplay } from '@wordpress/url';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport PostVisibility from '../post-visibility';\nimport PostVisibilityLabel from '../post-visibility/label';\nimport PostSchedule from '../post-schedule';\nimport PostScheduleLabel from '../post-schedule/label';\nimport MaybeTagsPanel from './maybe-tags-panel';\nimport MaybePostFormatPanel from './maybe-post-format-panel';\nimport { store as editorStore } from '../../store';\nimport MaybeCategoryPanel from './maybe-category-panel';\nimport MaybeUploadMedia from './maybe-upload-media';\n\nfunction PostPublishPanelPrepublish( { children } ) {\n\tconst {\n\t\tisBeingScheduled,\n\t\tisRequestingSiteIcon,\n\t\thasPublishAction,\n\t\tsiteIconUrl,\n\t\tsiteTitle,\n\t\tsiteHome,\n\t} = useSelect( ( select ) => {\n\t\tconst { getCurrentPost, isEditedPostBeingScheduled } =\n\t\t\tselect( editorStore );\n\t\tconst { getEntityRecord, isResolving } = select( coreStore );\n\t\tconst siteData =\n\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t'root',\n\t\t\t\t'__unstableBase',\n\t\t\t\tundefined,\n\t\t\t] ),\n\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\tsiteTitle: siteData.name,\n\t\t\tsiteHome: siteData.home && filterURLForDisplay( siteData.home ),\n\t\t};\n\t}, [] );\n\n\tlet siteIcon = (\n\t\t<Icon className=\"components-site-icon\" size=\"36px\" icon={ wordpress } />\n\t);\n\n\tif ( siteIconUrl ) {\n\t\tsiteIcon = (\n\t\t\t<img\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"components-site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tsiteIcon = null;\n\t}\n\n\tlet prePublishTitle, prePublishBodyText;\n\n\tif ( ! hasPublishAction ) {\n\t\tprePublishTitle = __( 'Are you ready to submit for review?' );\n\t\tprePublishBodyText = __(\n\t\t\t'Your work will be reviewed and then approved.'\n\t\t);\n\t} else if ( isBeingScheduled ) {\n\t\tprePublishTitle = __( 'Are you ready to schedule?' );\n\t\tprePublishBodyText = __(\n\t\t\t'Your work will be published at the specified date and time.'\n\t\t);\n\t} else {\n\t\tprePublishTitle = __( 'Are you ready to publish?' );\n\t\tprePublishBodyText = __(\n\t\t\t'Double-check your settings before publishing.'\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className=\"editor-post-publish-panel__prepublish\">\n\t\t\t<div>\n\t\t\t\t<strong>{ prePublishTitle }</strong>\n\t\t\t</div>\n\t\t\t<p>{ prePublishBodyText }</p>\n\t\t\t<div className=\"components-site-card\">\n\t\t\t\t{ siteIcon }\n\t\t\t\t<div className=\"components-site-info\">\n\t\t\t\t\t<span className=\"components-site-name\">\n\t\t\t\t\t\t{ decodeEntities( siteTitle ) || __( '(Untitled)' ) }\n\t\t\t\t\t</span>\n\t\t\t\t\t<span className=\"components-site-home\">{ siteHome }</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<MaybeUploadMedia />\n\t\t\t{ hasPublishAction && (\n\t\t\t\t<>\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tinitialOpen={ false }\n\t\t\t\t\t\ttitle={ [\n\t\t\t\t\t\t\t__( 'Visibility:' ),\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName=\"editor-post-publish-panel__link\"\n\t\t\t\t\t\t\t\tkey=\"label\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PostVisibilityLabel />\n\t\t\t\t\t\t\t</span>,\n\t\t\t\t\t\t] }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PostVisibility />\n\t\t\t\t\t</PanelBody>\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tinitialOpen={ false }\n\t\t\t\t\t\ttitle={ [\n\t\t\t\t\t\t\t__( 'Publish:' ),\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName=\"editor-post-publish-panel__link\"\n\t\t\t\t\t\t\t\tkey=\"label\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PostScheduleLabel />\n\t\t\t\t\t\t\t</span>,\n\t\t\t\t\t\t] }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PostSchedule />\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<MaybePostFormatPanel />\n\t\t\t<MaybeTagsPanel />\n\t\t\t<MaybeCategoryPanel />\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nexport default PostPublishPanelPrepublish;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,IAED,4CAAC,+BAAAC,SAAA,EAAqB;AAAA,IACtB,4CAAC,wBAAAC,SAAA,EAAe;AAAA,IAChB,4CAAC,4BAAAC,SAAA,EAAmB;AAAA,IAClB;AAAA,KACH;AAEF;AAEA,IAAO,qBAAQ;",
|
|
6
6
|
"names": ["import_label", "editorStore", "coreStore", "MaybeUploadMedia", "PostVisibilityLabel", "PostVisibility", "PostScheduleLabel", "PostSchedule", "MaybePostFormatPanel", "MaybeTagsPanel", "MaybeCategoryPanel"]
|
|
7
7
|
}
|