@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
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-template/reset-default-template.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseAllowSwitchingTemplates,\n\tuseCurrentTemplateSlug,\n\tuseEditedPostContext,\n} from './hooks';\n\nexport default function ResetDefaultTemplate( { onClick } ) {\n\tconst currentTemplateSlug = useCurrentTemplateSlug();\n\tconst allowSwitchingTemplate = useAllowSwitchingTemplates();\n\tconst { postType, postId } = useEditedPostContext();\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\t// The default template in a post is indicated by an empty string.\n\tif ( ! currentTemplateSlug || ! allowSwitchingTemplate ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\teditEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId,\n\t\t\t\t\t{ template: '' },\n\t\t\t\t\t{ undoIgnore: true }\n\t\t\t\t);\n\t\t\t\tonClick();\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Use default template' ) }\n\t\t</MenuItem>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAyB;AACzB,kBAAmB;AACnB,kBAA4B;AAC5B,uBAAmC;AAKnC,mBAIO;AAYL;AAVa,SAAR,qBAAuC,EAAE,QAAQ,GAAI;AAC3D,QAAM,0BAAsB,qCAAuB;AACnD,QAAM,6BAAyB,yCAA2B;AAC1D,QAAM,EAAE,UAAU,OAAO,QAAI,mCAAqB;AAClD,QAAM,EAAE,iBAAiB,QAAI,yBAAa,iBAAAA,KAAU;AAEpD,MAAK,CAAE,uBAAuB,CAAE,wBAAyB;AACxD,WAAO;AAAA,EACR;AACA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,SAAU,MAAM;AACf;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA,EAAE,UAAU,GAAG;AAAA,UACf,EAAE,YAAY,KAAK;AAAA,QACpB;AACA,gBAAQ;AAAA,MACT;AAAA,MAEE,8BAAI,sBAAuB;AAAA;AAAA,EAC9B;AAEF;",
|
|
6
6
|
"names": ["coreStore"]
|
|
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-template/swap-template-button.js
|
|
19
21
|
var swap_template_button_exports = {};
|
|
20
22
|
__export(swap_template_button_exports, {
|
|
21
23
|
default: () => SwapTemplateButton
|
|
22
24
|
});
|
|
23
25
|
module.exports = __toCommonJS(swap_template_button_exports);
|
|
24
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
26
|
var import_element = require("@wordpress/element");
|
|
26
27
|
var import_html_entities = require("@wordpress/html-entities");
|
|
27
28
|
var import_block_editor = require("@wordpress/block-editor");
|
|
@@ -32,6 +33,7 @@ var import_core_data = require("@wordpress/core-data");
|
|
|
32
33
|
var import_blocks = require("@wordpress/blocks");
|
|
33
34
|
var import_hooks = require("./hooks");
|
|
34
35
|
var import_search_templates = require("../../utils/search-templates");
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
37
|
function SwapTemplateButton({ onClick }) {
|
|
36
38
|
const [showModal, setShowModal] = (0, import_element.useState)(false);
|
|
37
39
|
const { postType, postId } = (0, import_hooks.useEditedPostContext)();
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-template/swap-template-button.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useMemo, useState } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __experimentalBlockPatternsList as BlockPatternsList } from '@wordpress/block-editor';\nimport { MenuItem, Modal, SearchControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { parse } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { useAvailableTemplates, useEditedPostContext } from './hooks';\nimport { searchTemplates } from '../../utils/search-templates';\n\nexport default function SwapTemplateButton( { onClick } ) {\n\tconst [ showModal, setShowModal ] = useState( false );\n\tconst { postType, postId } = useEditedPostContext();\n\tconst availableTemplates = useAvailableTemplates( postType );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\n\tconst onTemplateSelect = async ( template ) => {\n\t\teditEntityRecord(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tpostId,\n\t\t\t{ template: template.name },\n\t\t\t{ undoIgnore: true }\n\t\t);\n\t\tsetShowModal( false ); // Close the template suggestions modal first.\n\t\tonClick();\n\t};\n\treturn (\n\t\t<>\n\t\t\t<MenuItem\n\t\t\t\tdisabled={ ! availableTemplates?.length }\n\t\t\t\taccessibleWhenDisabled\n\t\t\t\tonClick={ () => setShowModal( true ) }\n\t\t\t>\n\t\t\t\t{ __( 'Change template' ) }\n\t\t\t</MenuItem>\n\t\t\t{ showModal && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Choose a template' ) }\n\t\t\t\t\tonRequestClose={ () => setShowModal( false ) }\n\t\t\t\t\toverlayClassName=\"editor-post-template__swap-template-modal\"\n\t\t\t\t\tisFullScreen\n\t\t\t\t>\n\t\t\t\t\t<div className=\"editor-post-template__swap-template-modal-content\">\n\t\t\t\t\t\t<TemplatesList\n\t\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\t\tonSelect={ onTemplateSelect }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction TemplatesList( { postType, onSelect } ) {\n\tconst [ searchValue, setSearchValue ] = useState( '' );\n\tconst availableTemplates = useAvailableTemplates( postType );\n\tconst templatesAsPatterns = useMemo(\n\t\t() =>\n\t\t\tavailableTemplates.map( ( template ) => ( {\n\t\t\t\tname: template.slug,\n\t\t\t\tblocks: parse( template.content.raw ),\n\t\t\t\ttitle: decodeEntities( template.title.rendered ),\n\t\t\t\tid: template.id,\n\t\t\t} ) ),\n\t\t[ availableTemplates ]\n\t);\n\n\tconst filteredBlockTemplates = useMemo( () => {\n\t\treturn searchTemplates( templatesAsPatterns, searchValue );\n\t}, [ templatesAsPatterns, searchValue ] );\n\n\treturn (\n\t\t<>\n\t\t\t<SearchControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tonChange={ setSearchValue }\n\t\t\t\tvalue={ searchValue }\n\t\t\t\tlabel={ __( 'Search' ) }\n\t\t\t\tplaceholder={ __( 'Search' ) }\n\t\t\t\tclassName=\"editor-post-template__swap-template-search\"\n\t\t\t/>\n\t\t\t<BlockPatternsList\n\t\t\t\tlabel={ __( 'Templates' ) }\n\t\t\t\tblockPatterns={ filteredBlockTemplates }\n\t\t\t\tonClickPattern={ onSelect }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAkC;AAClC,2BAA+B;AAC/B,0BAAqE;AACrE,wBAA+C;AAC/C,kBAAmB;AACnB,kBAA4B;AAC5B,uBAAmC;AACnC,oBAAsB;AAKtB,mBAA4D;AAC5D,8BAAgC;AAoB9B;AAlBa,SAAR,mBAAqC,EAAE,QAAQ,GAAI;AACzD,QAAM,CAAE,WAAW,YAAa,QAAI,yBAAU,KAAM;AACpD,QAAM,EAAE,UAAU,OAAO,QAAI,mCAAqB;AAClD,QAAM,yBAAqB,oCAAuB,QAAS;AAC3D,QAAM,EAAE,iBAAiB,QAAI,yBAAa,iBAAAA,KAAU;AAEpD,QAAM,mBAAmB,OAAQ,aAAc;AAC9C;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,EAAE,UAAU,SAAS,KAAK;AAAA,MAC1B,EAAE,YAAY,KAAK;AAAA,IACpB;AACA,iBAAc,KAAM;AACpB,YAAQ;AAAA,EACT;AACA,SACC,4EACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,UAAW,CAAE,oBAAoB;AAAA,QACjC,wBAAsB;AAAA,QACtB,SAAU,MAAM,aAAc,IAAK;AAAA,QAEjC,8BAAI,iBAAkB;AAAA;AAAA,IACzB;AAAA,IACE,aACD;AAAA,MAAC;AAAA;AAAA,QACA,WAAQ,gBAAI,mBAAoB;AAAA,QAChC,gBAAiB,MAAM,aAAc,KAAM;AAAA,QAC3C,kBAAiB;AAAA,QACjB,cAAY;AAAA,QAEZ,sDAAC,SAAI,WAAU,qDACd;AAAA,UAAC;AAAA;AAAA,YACA;AAAA,YACA,UAAW;AAAA;AAAA,QACZ,GACD;AAAA;AAAA,IACD;AAAA,KAEF;AAEF;AAEA,SAAS,cAAe,EAAE,UAAU,SAAS,GAAI;AAChD,QAAM,CAAE,aAAa,cAAe,QAAI,yBAAU,EAAG;AACrD,QAAM,yBAAqB,oCAAuB,QAAS;AAC3D,QAAM,0BAAsB;AAAA,IAC3B,MACC,mBAAmB,IAAK,CAAE,cAAgB;AAAA,MACzC,MAAM,SAAS;AAAA,MACf,YAAQ,qBAAO,SAAS,QAAQ,GAAI;AAAA,MACpC,WAAO,qCAAgB,SAAS,MAAM,QAAS;AAAA,MAC/C,IAAI,SAAS;AAAA,IACd,EAAI;AAAA,IACL,CAAE,kBAAmB;AAAA,EACtB;AAEA,QAAM,6BAAyB,wBAAS,MAAM;AAC7C,eAAO,yCAAiB,qBAAqB,WAAY;AAAA,EAC1D,GAAG,CAAE,qBAAqB,WAAY,CAAE;AAExC,SACC,4EACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,yBAAuB;AAAA,QACvB,UAAW;AAAA,QACX,OAAQ;AAAA,QACR,WAAQ,gBAAI,QAAS;AAAA,QACrB,iBAAc,gBAAI,QAAS;AAAA,QAC3B,WAAU;AAAA;AAAA,IACX;AAAA,IACA;AAAA,MAAC,oBAAAC;AAAA,MAAA;AAAA,QACA,WAAQ,gBAAI,WAAY;AAAA,QACxB,eAAgB;AAAA,QAChB,gBAAiB;AAAA;AAAA,IAClB;AAAA,KACD;AAEF;",
|
|
6
6
|
"names": ["coreStore", "BlockPatternsList"]
|
|
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-text-editor/index.js
|
|
29
31
|
var post_text_editor_exports = {};
|
|
30
32
|
__export(post_text_editor_exports, {
|
|
31
33
|
default: () => PostTextEditor
|
|
32
34
|
});
|
|
33
35
|
module.exports = __toCommonJS(post_text_editor_exports);
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
36
|
var import_react_autosize_textarea = __toESM(require("react-autosize-textarea"));
|
|
36
37
|
var import_i18n = require("@wordpress/i18n");
|
|
37
38
|
var import_core_data = require("@wordpress/core-data");
|
|
@@ -41,6 +42,7 @@ var import_data = require("@wordpress/data");
|
|
|
41
42
|
var import_compose = require("@wordpress/compose");
|
|
42
43
|
var import_components = require("@wordpress/components");
|
|
43
44
|
var import_store = require("../../store");
|
|
45
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
46
|
function PostTextEditor() {
|
|
45
47
|
const instanceId = (0, import_compose.useInstanceId)(PostTextEditor);
|
|
46
48
|
const { content, blocks, type, id } = (0, import_data.useSelect)((select) => {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-text-editor/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * External dependencies\n */\nimport Textarea from 'react-autosize-textarea';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { __unstableSerializeAndClean } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { VisuallyHidden } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Displays the Post Text Editor along with content in Visual and Text mode.\n *\n * @return {React.ReactNode} The rendered PostTextEditor component.\n */\nexport default function PostTextEditor() {\n\tconst instanceId = useInstanceId( PostTextEditor );\n\tconst { content, blocks, type, id } = useSelect( ( select ) => {\n\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\tconst { getCurrentPostType, getCurrentPostId } = select( editorStore );\n\t\tconst _type = getCurrentPostType();\n\t\tconst _id = getCurrentPostId();\n\t\tconst editedRecord = getEditedEntityRecord( 'postType', _type, _id );\n\n\t\treturn {\n\t\t\tcontent: editedRecord?.content,\n\t\t\tblocks: editedRecord?.blocks,\n\t\t\ttype: _type,\n\t\t\tid: _id,\n\t\t};\n\t}, [] );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\t// Replicates the logic found in getEditedPostContent().\n\tconst value = useMemo( () => {\n\t\tif ( content instanceof Function ) {\n\t\t\treturn content( { blocks } );\n\t\t} else if ( blocks ) {\n\t\t\t// If we have parsed blocks already, they should be our source of truth.\n\t\t\t// Parsing applies block deprecations and legacy block conversions that\n\t\t\t// unparsed content will not have.\n\t\t\treturn __unstableSerializeAndClean( blocks );\n\t\t}\n\t\treturn content;\n\t}, [ content, blocks ] );\n\n\treturn (\n\t\t<>\n\t\t\t<VisuallyHidden\n\t\t\t\tas=\"label\"\n\t\t\t\thtmlFor={ `post-content-${ instanceId }` }\n\t\t\t>\n\t\t\t\t{ __( 'Type text or HTML' ) }\n\t\t\t</VisuallyHidden>\n\t\t\t<Textarea\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tdir=\"auto\"\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ ( event ) => {\n\t\t\t\t\teditEntityRecord( 'postType', type, id, {\n\t\t\t\t\t\tcontent: event.target.value,\n\t\t\t\t\t\tblocks: undefined,\n\t\t\t\t\t\tselection: undefined,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tclassName=\"editor-post-text-editor\"\n\t\t\t\tid={ `post-content-${ instanceId }` }\n\t\t\t\tplaceholder={ __( 'Start writing with text or HTML' ) }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qCAAqB;AAKrB,kBAAmB;AACnB,uBAAmC;AACnC,qBAAwB;AACxB,oBAA4C;AAC5C,kBAAuC;AACvC,qBAA8B;AAC9B,wBAA+B;AAK/B,mBAAqC;AAsCnC;AA/Ba,SAAR,iBAAkC;AACxC,QAAM,iBAAa,8BAAe,cAAe;AACjD,QAAM,EAAE,SAAS,QAAQ,MAAM,GAAG,QAAI,uBAAW,CAAE,WAAY;AAC9D,UAAM,EAAE,sBAAsB,IAAI,OAAQ,iBAAAA,KAAU;AACpD,UAAM,EAAE,oBAAoB,iBAAiB,IAAI,OAAQ,aAAAC,KAAY;AACrE,UAAM,QAAQ,mBAAmB;AACjC,UAAM,MAAM,iBAAiB;AAC7B,UAAM,eAAe,sBAAuB,YAAY,OAAO,GAAI;AAEnE,WAAO;AAAA,MACN,SAAS,cAAc;AAAA,MACvB,QAAQ,cAAc;AAAA,MACtB,MAAM;AAAA,MACN,IAAI;AAAA,IACL;AAAA,EACD,GAAG,CAAC,CAAE;AACN,QAAM,EAAE,iBAAiB,QAAI,yBAAa,iBAAAD,KAAU;AAEpD,QAAM,YAAQ,wBAAS,MAAM;AAC5B,QAAK,mBAAmB,UAAW;AAClC,aAAO,QAAS,EAAE,OAAO,CAAE;AAAA,IAC5B,WAAY,QAAS;AAIpB,iBAAO,2CAA6B,MAAO;AAAA,IAC5C;AACA,WAAO;AAAA,EACR,GAAG,CAAE,SAAS,MAAO,CAAE;AAEvB,SACC,4EACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,IAAG;AAAA,QACH,SAAU,gBAAiB,UAAW;AAAA,QAEpC,8BAAI,mBAAoB;AAAA;AAAA,IAC3B;AAAA,IACA;AAAA,MAAC,+BAAAE;AAAA,MAAA;AAAA,QACA,cAAa;AAAA,QACb,KAAI;AAAA,QACJ;AAAA,QACA,UAAW,CAAE,UAAW;AACvB,2BAAkB,YAAY,MAAM,IAAI;AAAA,YACvC,SAAS,MAAM,OAAO;AAAA,YACtB,QAAQ;AAAA,YACR,WAAW;AAAA,UACZ,CAAE;AAAA,QACH;AAAA,QACA,WAAU;AAAA,QACV,IAAK,gBAAiB,UAAW;AAAA,QACjC,iBAAc,gBAAI,iCAAkC;AAAA;AAAA,IACrD;AAAA,KACD;AAEF;",
|
|
6
6
|
"names": ["coreStore", "editorStore", "Textarea"]
|
|
7
7
|
}
|
|
@@ -16,14 +16,16 @@ 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-title/constants.js
|
|
19
21
|
var constants_exports = {};
|
|
20
22
|
__export(constants_exports, {
|
|
21
23
|
DEFAULT_CLASSNAMES: () => DEFAULT_CLASSNAMES,
|
|
22
24
|
REGEXP_NEWLINES: () => REGEXP_NEWLINES
|
|
23
25
|
});
|
|
24
26
|
module.exports = __toCommonJS(constants_exports);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
var DEFAULT_CLASSNAMES = "wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text";
|
|
28
|
+
var REGEXP_NEWLINES = /[\r\n]+/g;
|
|
27
29
|
// Annotate the CommonJS export names for ESM import in node:
|
|
28
30
|
0 && (module.exports = {
|
|
29
31
|
DEFAULT_CLASSNAMES,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-title/constants.js"],
|
|
4
4
|
"sourcesContent": ["export const DEFAULT_CLASSNAMES =\n\t'wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text';\n\nexport const REGEXP_NEWLINES = /[\\r\\n]+/g;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,qBACZ;AAEM,IAAM,kBAAkB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -26,15 +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-title/index.js
|
|
29
31
|
var post_title_exports = {};
|
|
30
32
|
__export(post_title_exports, {
|
|
31
33
|
default: () => post_title_default
|
|
32
34
|
});
|
|
33
35
|
module.exports = __toCommonJS(post_title_exports);
|
|
34
|
-
var import_jsx_runtime = (
|
|
35
|
-
/* eslint-disable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */
|
|
36
|
-
require("react/jsx-runtime")
|
|
37
|
-
);
|
|
38
36
|
var import_clsx = __toESM(require("clsx"));
|
|
39
37
|
var import_i18n = require("@wordpress/i18n");
|
|
40
38
|
var import_element = require("@wordpress/element");
|
|
@@ -50,14 +48,25 @@ var import_constants = require("./constants");
|
|
|
50
48
|
var import_use_post_title_focus = __toESM(require("./use-post-title-focus"));
|
|
51
49
|
var import_use_post_title = __toESM(require("./use-post-title"));
|
|
52
50
|
var import_post_type_support_check = __toESM(require("../post-type-support-check"));
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
51
|
+
var import_lock_unlock = require("../../lock-unlock");
|
|
52
|
+
var import_jsx_runtime = (
|
|
53
|
+
/* eslint-disable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */
|
|
54
|
+
require("react/jsx-runtime")
|
|
55
|
+
);
|
|
56
|
+
var PostTitle = (0, import_element.forwardRef)((_, forwardedRef) => {
|
|
57
|
+
const { placeholder, isEditingContentOnlySection } = (0, import_data.useSelect)(
|
|
58
|
+
(select) => {
|
|
59
|
+
const { getSettings, getEditedContentOnlySection } = (0, import_lock_unlock.unlock)(
|
|
60
|
+
select(import_block_editor.store)
|
|
61
|
+
);
|
|
62
|
+
const { titlePlaceholder } = getSettings();
|
|
63
|
+
return {
|
|
64
|
+
placeholder: titlePlaceholder,
|
|
65
|
+
isEditingContentOnlySection: !!getEditedContentOnlySection()
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
[]
|
|
69
|
+
);
|
|
61
70
|
const [isSelected, setIsSelected] = (0, import_element.useState)(false);
|
|
62
71
|
const { ref: focusRef } = (0, import_use_post_title_focus.default)(forwardedRef);
|
|
63
72
|
const { title, setTitle: onUpdate } = (0, import_use_post_title.default)();
|
|
@@ -149,11 +158,12 @@ const PostTitle = (0, import_element.forwardRef)((_, forwardedRef) => {
|
|
|
149
158
|
const className = (0, import_clsx.default)(import_constants.DEFAULT_CLASSNAMES, {
|
|
150
159
|
"is-selected": isSelected
|
|
151
160
|
});
|
|
161
|
+
const style = isEditingContentOnlySection ? { opacity: 0.2 } : void 0;
|
|
152
162
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
153
163
|
"h1",
|
|
154
164
|
{
|
|
155
165
|
ref: (0, import_compose.useMergeRefs)([richTextRef, focusRef]),
|
|
156
|
-
contentEditable:
|
|
166
|
+
contentEditable: !isEditingContentOnlySection,
|
|
157
167
|
className,
|
|
158
168
|
"aria-label": decodedPlaceholder,
|
|
159
169
|
role: "textbox",
|
|
@@ -161,7 +171,8 @@ const PostTitle = (0, import_element.forwardRef)((_, forwardedRef) => {
|
|
|
161
171
|
onFocus: onSelect,
|
|
162
172
|
onBlur: onUnselect,
|
|
163
173
|
onKeyDown,
|
|
164
|
-
onPaste
|
|
174
|
+
onPaste,
|
|
175
|
+
style
|
|
165
176
|
}
|
|
166
177
|
);
|
|
167
178
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-title/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { forwardRef, useState } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { ENTER } from '@wordpress/keycodes';\nimport { pasteHandler } from '@wordpress/blocks';\nimport {\n\t__unstableUseRichText as useRichText,\n\tcreate,\n\tinsert,\n} from '@wordpress/rich-text';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { DEFAULT_CLASSNAMES, REGEXP_NEWLINES } from './constants';\nimport usePostTitleFocus from './use-post-title-focus';\nimport usePostTitle from './use-post-title';\nimport PostTypeSupportCheck from '../post-type-support-check';\n\nconst PostTitle = forwardRef( ( _, forwardedRef ) => {\n\tconst { placeholder } = useSelect(
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { forwardRef, useState } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { ENTER } from '@wordpress/keycodes';\nimport { pasteHandler } from '@wordpress/blocks';\nimport {\n\t__unstableUseRichText as useRichText,\n\tcreate,\n\tinsert,\n} from '@wordpress/rich-text';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { DEFAULT_CLASSNAMES, REGEXP_NEWLINES } from './constants';\nimport usePostTitleFocus from './use-post-title-focus';\nimport usePostTitle from './use-post-title';\nimport PostTypeSupportCheck from '../post-type-support-check';\n\nimport { unlock } from '../../lock-unlock';\n\nconst PostTitle = forwardRef( ( _, forwardedRef ) => {\n\tconst { placeholder, isEditingContentOnlySection } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSettings, getEditedContentOnlySection } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\tconst { titlePlaceholder } = getSettings();\n\n\t\t\treturn {\n\t\t\t\tplaceholder: titlePlaceholder,\n\t\t\t\tisEditingContentOnlySection: !! getEditedContentOnlySection(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst [ isSelected, setIsSelected ] = useState( false );\n\n\tconst { ref: focusRef } = usePostTitleFocus( forwardedRef );\n\n\tconst { title, setTitle: onUpdate } = usePostTitle();\n\n\tconst [ selection, setSelection ] = useState( {} );\n\n\tconst { clearSelectedBlock, insertBlocks, insertDefaultBlock } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst decodedPlaceholder =\n\t\tdecodeEntities( placeholder ) || __( 'Add title' );\n\n\tconst {\n\t\tvalue,\n\t\tonChange,\n\t\tref: richTextRef,\n\t} = useRichText( {\n\t\tvalue: title,\n\t\tonChange( newValue ) {\n\t\t\tonUpdate( newValue.replace( REGEXP_NEWLINES, ' ' ) );\n\t\t},\n\t\tplaceholder: decodedPlaceholder,\n\t\tselectionStart: selection.start,\n\t\tselectionEnd: selection.end,\n\t\tonSelectionChange( newStart, newEnd ) {\n\t\t\tsetSelection( ( sel ) => {\n\t\t\t\tconst { start, end } = sel;\n\t\t\t\tif ( start === newStart && end === newEnd ) {\n\t\t\t\t\treturn sel;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tstart: newStart,\n\t\t\t\t\tend: newEnd,\n\t\t\t\t};\n\t\t\t} );\n\t\t},\n\t\t__unstableDisableFormats: false,\n\t} );\n\n\tfunction onInsertBlockAfter( blocks ) {\n\t\tinsertBlocks( blocks, 0 );\n\t}\n\n\tfunction onSelect() {\n\t\tsetIsSelected( true );\n\t\tclearSelectedBlock();\n\t}\n\n\tfunction onUnselect() {\n\t\tsetIsSelected( false );\n\t\tsetSelection( {} );\n\t}\n\n\tfunction onEnterPress() {\n\t\tinsertDefaultBlock( undefined, undefined, 0 );\n\t}\n\n\tfunction onKeyDown( event ) {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tonEnterPress();\n\t\t}\n\t}\n\n\tfunction onPaste( event ) {\n\t\tconst clipboardData = event.clipboardData;\n\n\t\tlet plainText = '';\n\t\tlet html = '';\n\n\t\ttry {\n\t\t\tplainText = clipboardData.getData( 'text/plain' );\n\t\t\thtml = clipboardData.getData( 'text/html' );\n\t\t} catch ( error ) {\n\t\t\t// Some browsers like UC Browser paste plain text by default and\n\t\t\t// don't support clipboardData at all, so allow default\n\t\t\t// behaviour.\n\t\t\treturn;\n\t\t}\n\n\t\t// Allows us to ask for this information when we get a report.\n\t\twindow.console.log( 'Received HTML:\\n\\n', html );\n\t\twindow.console.log( 'Received plain text:\\n\\n', plainText );\n\n\t\tconst content = pasteHandler( {\n\t\t\tHTML: html,\n\t\t\tplainText,\n\t\t} );\n\n\t\tevent.preventDefault();\n\n\t\tif ( ! content.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( typeof content !== 'string' ) {\n\t\t\tconst [ firstBlock ] = content;\n\n\t\t\tif (\n\t\t\t\t! title &&\n\t\t\t\t( firstBlock.name === 'core/heading' ||\n\t\t\t\t\tfirstBlock.name === 'core/paragraph' )\n\t\t\t) {\n\t\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t\t// is undesirable.\n\t\t\t\tconst contentNoHTML = stripHTML(\n\t\t\t\t\tfirstBlock.attributes.content\n\t\t\t\t);\n\t\t\t\tonUpdate( contentNoHTML );\n\t\t\t\tonInsertBlockAfter( content.slice( 1 ) );\n\t\t\t} else {\n\t\t\t\tonInsertBlockAfter( content );\n\t\t\t}\n\t\t} else {\n\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t// is undesirable.\n\t\t\tconst contentNoHTML = stripHTML( content );\n\t\t\tonChange( insert( value, create( { html: contentNoHTML } ) ) );\n\t\t}\n\t}\n\n\t// The wp-block className is important for editor styles.\n\t// This same block is used in both the visual and the code editor.\n\tconst className = clsx( DEFAULT_CLASSNAMES, {\n\t\t'is-selected': isSelected,\n\t} );\n\n\t// Because the title is within the editor iframe, we can't use scss styles.\n\t// Instead use an inline style to dim the block when it's disabled.\n\tconst style = isEditingContentOnlySection ? { opacity: 0.2 } : undefined;\n\n\treturn (\n\t\t/* eslint-disable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */\n\t\t<h1\n\t\t\tref={ useMergeRefs( [ richTextRef, focusRef ] ) }\n\t\t\tcontentEditable={ ! isEditingContentOnlySection }\n\t\t\tclassName={ className }\n\t\t\taria-label={ decodedPlaceholder }\n\t\t\trole=\"textbox\"\n\t\t\taria-multiline=\"true\"\n\t\t\tonFocus={ onSelect }\n\t\t\tonBlur={ onUnselect }\n\t\t\tonKeyDown={ onKeyDown }\n\t\t\tonPaste={ onPaste }\n\t\t\tstyle={ style }\n\t\t/>\n\t\t/* eslint-enable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */\n\t);\n} );\n\n/**\n * Renders the `PostTitle` component.\n *\n * @param {Object} _ Unused parameter.\n * @param {Element} forwardedRef Forwarded ref for the component.\n *\n * @return {React.ReactNode} The rendered PostTitle component.\n */\nexport default forwardRef( ( _, forwardedRef ) => (\n\t<PostTypeSupportCheck supportKeys=\"title\">\n\t\t<PostTitle ref={ forwardedRef } />\n\t</PostTypeSupportCheck>\n) );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAIjB,kBAAmB;AACnB,qBAAqC;AACrC,2BAA+B;AAC/B,kBAAuC;AACvC,0BAA0C;AAC1C,sBAAsB;AACtB,oBAA6B;AAC7B,uBAIO;AACP,qBAA6B;AAC7B,iBAAiD;AAKjD,uBAAoD;AACpD,kCAA8B;AAC9B,4BAAyB;AACzB,qCAAiC;AAEjC,yBAAuB;AA2JrB;AAAA;AAAA;AAAA;AAzJF,IAAM,gBAAY,2BAAY,CAAE,GAAG,iBAAkB;AACpD,QAAM,EAAE,aAAa,4BAA4B,QAAI;AAAA,IACpD,CAAE,WAAY;AACb,YAAM,EAAE,aAAa,4BAA4B,QAAI;AAAA,QACpD,OAAQ,oBAAAA,KAAiB;AAAA,MAC1B;AACA,YAAM,EAAE,iBAAiB,IAAI,YAAY;AAEzC,aAAO;AAAA,QACN,aAAa;AAAA,QACb,6BAA6B,CAAC,CAAE,4BAA4B;AAAA,MAC7D;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AAEA,QAAM,CAAE,YAAY,aAAc,QAAI,yBAAU,KAAM;AAEtD,QAAM,EAAE,KAAK,SAAS,QAAI,4BAAAC,SAAmB,YAAa;AAE1D,QAAM,EAAE,OAAO,UAAU,SAAS,QAAI,sBAAAC,SAAa;AAEnD,QAAM,CAAE,WAAW,YAAa,QAAI,yBAAU,CAAC,CAAE;AAEjD,QAAM,EAAE,oBAAoB,cAAc,mBAAmB,QAC5D,yBAAa,oBAAAF,KAAiB;AAE/B,QAAM,yBACL,qCAAgB,WAAY,SAAK,gBAAI,WAAY;AAElD,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA,KAAK;AAAA,EACN,QAAI,iBAAAG,uBAAa;AAAA,IAChB,OAAO;AAAA,IACP,SAAU,UAAW;AACpB,eAAU,SAAS,QAAS,kCAAiB,GAAI,CAAE;AAAA,IACpD;AAAA,IACA,aAAa;AAAA,IACb,gBAAgB,UAAU;AAAA,IAC1B,cAAc,UAAU;AAAA,IACxB,kBAAmB,UAAU,QAAS;AACrC,mBAAc,CAAE,QAAS;AACxB,cAAM,EAAE,OAAO,IAAI,IAAI;AACvB,YAAK,UAAU,YAAY,QAAQ,QAAS;AAC3C,iBAAO;AAAA,QACR;AACA,eAAO;AAAA,UACN,OAAO;AAAA,UACP,KAAK;AAAA,QACN;AAAA,MACD,CAAE;AAAA,IACH;AAAA,IACA,0BAA0B;AAAA,EAC3B,CAAE;AAEF,WAAS,mBAAoB,QAAS;AACrC,iBAAc,QAAQ,CAAE;AAAA,EACzB;AAEA,WAAS,WAAW;AACnB,kBAAe,IAAK;AACpB,uBAAmB;AAAA,EACpB;AAEA,WAAS,aAAa;AACrB,kBAAe,KAAM;AACrB,iBAAc,CAAC,CAAE;AAAA,EAClB;AAEA,WAAS,eAAe;AACvB,uBAAoB,QAAW,QAAW,CAAE;AAAA,EAC7C;AAEA,WAAS,UAAW,OAAQ;AAC3B,QAAK,MAAM,YAAY,uBAAQ;AAC9B,YAAM,eAAe;AACrB,mBAAa;AAAA,IACd;AAAA,EACD;AAEA,WAAS,QAAS,OAAQ;AACzB,UAAM,gBAAgB,MAAM;AAE5B,QAAI,YAAY;AAChB,QAAI,OAAO;AAEX,QAAI;AACH,kBAAY,cAAc,QAAS,YAAa;AAChD,aAAO,cAAc,QAAS,WAAY;AAAA,IAC3C,SAAU,OAAQ;AAIjB;AAAA,IACD;AAGA,WAAO,QAAQ,IAAK,sBAAsB,IAAK;AAC/C,WAAO,QAAQ,IAAK,4BAA4B,SAAU;AAE1D,UAAM,cAAU,4BAAc;AAAA,MAC7B,MAAM;AAAA,MACN;AAAA,IACD,CAAE;AAEF,UAAM,eAAe;AAErB,QAAK,CAAE,QAAQ,QAAS;AACvB;AAAA,IACD;AAEA,QAAK,OAAO,YAAY,UAAW;AAClC,YAAM,CAAE,UAAW,IAAI;AAEvB,UACC,CAAE,UACA,WAAW,SAAS,kBACrB,WAAW,SAAS,mBACpB;AAID,cAAM,oBAAgB,WAAAC;AAAA,UACrB,WAAW,WAAW;AAAA,QACvB;AACA,iBAAU,aAAc;AACxB,2BAAoB,QAAQ,MAAO,CAAE,CAAE;AAAA,MACxC,OAAO;AACN,2BAAoB,OAAQ;AAAA,MAC7B;AAAA,IACD,OAAO;AAIN,YAAM,oBAAgB,WAAAA,qBAAW,OAAQ;AACzC,mBAAU,yBAAQ,WAAO,yBAAQ,EAAE,MAAM,cAAc,CAAE,CAAE,CAAE;AAAA,IAC9D;AAAA,EACD;AAIA,QAAM,gBAAY,YAAAC,SAAM,qCAAoB;AAAA,IAC3C,eAAe;AAAA,EAChB,CAAE;AAIF,QAAM,QAAQ,8BAA8B,EAAE,SAAS,IAAI,IAAI;AAE/D,SAEC;AAAA,IAAC;AAAA;AAAA,MACA,SAAM,6BAAc,CAAE,aAAa,QAAS,CAAE;AAAA,MAC9C,iBAAkB,CAAE;AAAA,MACpB;AAAA,MACA,cAAa;AAAA,MACb,MAAK;AAAA,MACL,kBAAe;AAAA,MACf,SAAU;AAAA,MACV,QAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACD;AAGF,CAAE;AAUF,IAAO,yBAAQ,2BAAY,CAAE,GAAG,iBAC/B,4CAAC,+BAAAC,SAAA,EAAqB,aAAY,SACjC,sDAAC,aAAU,KAAM,cAAe,GACjC,CACC;",
|
|
6
6
|
"names": ["blockEditorStore", "usePostTitleFocus", "usePostTitle", "useRichText", "stripHTML", "clsx", "PostTypeSupportCheck"]
|
|
7
7
|
}
|
|
@@ -26,12 +26,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/editor/src/components/post-title/post-title-raw.js
|
|
29
31
|
var post_title_raw_exports = {};
|
|
30
32
|
__export(post_title_raw_exports, {
|
|
31
33
|
default: () => post_title_raw_default
|
|
32
34
|
});
|
|
33
35
|
module.exports = __toCommonJS(post_title_raw_exports);
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
36
|
var import_clsx = __toESM(require("clsx"));
|
|
36
37
|
var import_components = require("@wordpress/components");
|
|
37
38
|
var import_i18n = require("@wordpress/i18n");
|
|
@@ -42,6 +43,7 @@ var import_element = require("@wordpress/element");
|
|
|
42
43
|
var import_constants = require("./constants");
|
|
43
44
|
var import_use_post_title_focus = __toESM(require("./use-post-title-focus"));
|
|
44
45
|
var import_use_post_title = __toESM(require("./use-post-title"));
|
|
46
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
47
|
function PostTitleRaw(_, forwardedRef) {
|
|
46
48
|
const { placeholder } = (0, import_data.useSelect)((select) => {
|
|
47
49
|
const { getSettings } = select(import_block_editor.store);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-title/post-title-raw.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { TextareaControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useState, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { DEFAULT_CLASSNAMES, REGEXP_NEWLINES } from './constants';\nimport usePostTitleFocus from './use-post-title-focus';\nimport usePostTitle from './use-post-title';\n\n/**\n * Renders a raw post title input field.\n *\n * @param {Object} _ Unused parameter.\n * @param {Element} forwardedRef Reference to the component's DOM node.\n *\n * @return {React.ReactNode} The rendered component.\n */\nfunction PostTitleRaw( _, forwardedRef ) {\n\tconst { placeholder } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { titlePlaceholder } = getSettings();\n\n\t\treturn {\n\t\t\tplaceholder: titlePlaceholder,\n\t\t};\n\t}, [] );\n\n\tconst [ isSelected, setIsSelected ] = useState( false );\n\n\tconst { title, setTitle: onUpdate } = usePostTitle();\n\tconst { ref: focusRef } = usePostTitleFocus( forwardedRef );\n\n\tfunction onChange( value ) {\n\t\tonUpdate( value.replace( REGEXP_NEWLINES, ' ' ) );\n\t}\n\n\tfunction onSelect() {\n\t\tsetIsSelected( true );\n\t}\n\n\tfunction onUnselect() {\n\t\tsetIsSelected( false );\n\t}\n\n\t// The wp-block className is important for editor styles.\n\t// This same block is used in both the visual and the code editor.\n\tconst className = clsx( DEFAULT_CLASSNAMES, {\n\t\t'is-selected': isSelected,\n\t\t'is-raw-text': true,\n\t} );\n\n\tconst decodedPlaceholder =\n\t\tdecodeEntities( placeholder ) || __( 'Add title' );\n\n\treturn (\n\t\t<TextareaControl\n\t\t\tref={ focusRef }\n\t\t\tvalue={ title }\n\t\t\tonChange={ onChange }\n\t\t\tonFocus={ onSelect }\n\t\t\tonBlur={ onUnselect }\n\t\t\tlabel={ placeholder }\n\t\t\tclassName={ className }\n\t\t\tplaceholder={ decodedPlaceholder }\n\t\t\thideLabelFromVision\n\t\t\tautoComplete=\"off\"\n\t\t\tdir=\"auto\"\n\t\t\trows={ 1 }\n\t\t\t__nextHasNoMarginBottom\n\t\t/>\n\t);\n}\n\nexport default forwardRef( PostTitleRaw );\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,wBAAgC;AAChC,kBAAmB;AACnB,2BAA+B;AAC/B,kBAA0B;AAC1B,0BAA0C;AAC1C,qBAAqC;AAKrC,uBAAoD;AACpD,kCAA8B;AAC9B,4BAAyB;AAgDvB;AAtCF,SAAS,aAAc,GAAG,cAAe;AACxC,QAAM,EAAE,YAAY,QAAI,uBAAW,CAAE,WAAY;AAChD,UAAM,EAAE,YAAY,IAAI,OAAQ,oBAAAA,KAAiB;AACjD,UAAM,EAAE,iBAAiB,IAAI,YAAY;AAEzC,WAAO;AAAA,MACN,aAAa;AAAA,IACd;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,QAAM,CAAE,YAAY,aAAc,QAAI,yBAAU,KAAM;AAEtD,QAAM,EAAE,OAAO,UAAU,SAAS,QAAI,sBAAAC,SAAa;AACnD,QAAM,EAAE,KAAK,SAAS,QAAI,4BAAAC,SAAmB,YAAa;AAE1D,WAAS,SAAU,OAAQ;AAC1B,aAAU,MAAM,QAAS,kCAAiB,GAAI,CAAE;AAAA,EACjD;AAEA,WAAS,WAAW;AACnB,kBAAe,IAAK;AAAA,EACrB;AAEA,WAAS,aAAa;AACrB,kBAAe,KAAM;AAAA,EACtB;AAIA,QAAM,gBAAY,YAAAC,SAAM,qCAAoB;AAAA,IAC3C,eAAe;AAAA,IACf,eAAe;AAAA,EAChB,CAAE;AAEF,QAAM,yBACL,qCAAgB,WAAY,SAAK,gBAAI,WAAY;AAElD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,KAAM;AAAA,MACN,OAAQ;AAAA,MACR;AAAA,MACA,SAAU;AAAA,MACV,QAAS;AAAA,MACT,OAAQ;AAAA,MACR;AAAA,MACA,aAAc;AAAA,MACd,qBAAmB;AAAA,MACnB,cAAa;AAAA,MACb,KAAI;AAAA,MACJ,MAAO;AAAA,MACP,yBAAuB;AAAA;AAAA,EACxB;AAEF;AAEA,IAAO,6BAAQ,2BAAY,YAAa;",
|
|
6
6
|
"names": ["blockEditorStore", "usePostTitle", "usePostTitleFocus", "clsx"]
|
|
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-title/use-post-title-focus.js
|
|
19
21
|
var use_post_title_focus_exports = {};
|
|
20
22
|
__export(use_post_title_focus_exports, {
|
|
21
23
|
default: () => usePostTitleFocus
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-title/use-post-title-focus.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect, useImperativeHandle, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Custom hook that manages the focus behavior of the post title input field.\n *\n * @param {Element} forwardedRef - The forwarded ref for the input field.\n *\n * @return {Object} - The ref object.\n */\nexport default function usePostTitleFocus( forwardedRef ) {\n\tconst ref = useRef();\n\n\tconst { isCleanNewPost } = useSelect( ( select ) => {\n\t\tconst { isCleanNewPost: _isCleanNewPost } = select( editorStore );\n\n\t\treturn {\n\t\t\tisCleanNewPost: _isCleanNewPost(),\n\t\t};\n\t}, [] );\n\n\tuseImperativeHandle( forwardedRef, () => ( {\n\t\tfocus: () => {\n\t\t\tref?.current?.focus();\n\t\t},\n\t} ) );\n\n\tuseEffect( () => {\n\t\tif ( ! ref.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { defaultView } = ref.current.ownerDocument;\n\t\tconst { name, parent } = defaultView;\n\t\tconst ownerDocument =\n\t\t\tname === 'editor-canvas' ? parent.document : defaultView.document;\n\t\tconst { activeElement, body } = ownerDocument;\n\n\t\t// Only autofocus the title when the post is entirely empty. This should\n\t\t// only happen for a new post, which means we focus the title on new\n\t\t// post so the author can start typing right away, without needing to\n\t\t// click anything.\n\t\tif ( isCleanNewPost && ( ! activeElement || body === activeElement ) ) {\n\t\t\tref.current.focus();\n\t\t}\n\t}, [ isCleanNewPost ] );\n\n\treturn { ref };\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAuD;AACvD,kBAA0B;AAK1B,mBAAqC;AAStB,SAAR,kBAAoC,cAAe;AACzD,QAAM,UAAM,uBAAO;AAEnB,QAAM,EAAE,eAAe,QAAI,uBAAW,CAAE,WAAY;AACnD,UAAM,EAAE,gBAAgB,gBAAgB,IAAI,OAAQ,aAAAA,KAAY;AAEhE,WAAO;AAAA,MACN,gBAAgB,gBAAgB;AAAA,IACjC;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,0CAAqB,cAAc,OAAQ;AAAA,IAC1C,OAAO,MAAM;AACZ,WAAK,SAAS,MAAM;AAAA,IACrB;AAAA,EACD,EAAI;AAEJ,gCAAW,MAAM;AAChB,QAAK,CAAE,IAAI,SAAU;AACpB;AAAA,IACD;AAEA,UAAM,EAAE,YAAY,IAAI,IAAI,QAAQ;AACpC,UAAM,EAAE,MAAM,OAAO,IAAI;AACzB,UAAM,gBACL,SAAS,kBAAkB,OAAO,WAAW,YAAY;AAC1D,UAAM,EAAE,eAAe,KAAK,IAAI;AAMhC,QAAK,mBAAoB,CAAE,iBAAiB,SAAS,gBAAkB;AACtE,UAAI,QAAQ,MAAM;AAAA,IACnB;AAAA,EACD,GAAG,CAAE,cAAe,CAAE;AAEtB,SAAO,EAAE,IAAI;AACd;",
|
|
6
6
|
"names": ["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-title/use-post-title.js
|
|
19
21
|
var use_post_title_exports = {};
|
|
20
22
|
__export(use_post_title_exports, {
|
|
21
23
|
default: () => usePostTitle
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-title/use-post-title.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Custom hook for managing the post title in the editor.\n *\n * @return {Object} An object containing the current title and a function to update the title.\n */\nexport default function usePostTitle() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { title } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t};\n\t}, [] );\n\n\tfunction updateTitle( newTitle ) {\n\t\teditPost( { title: newTitle } );\n\t}\n\n\treturn { title, setTitle: updateTitle };\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuC;AAIvC,mBAAqC;AAOtB,SAAR,eAAgC;AACtC,QAAM,EAAE,SAAS,QAAI,yBAAa,aAAAA,KAAY;AAC9C,QAAM,EAAE,MAAM,QAAI,uBAAW,CAAE,WAAY;AAC1C,UAAM,EAAE,uBAAuB,IAAI,OAAQ,aAAAA,KAAY;AAEvD,WAAO;AAAA,MACN,OAAO,uBAAwB,OAAQ;AAAA,IACxC;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,WAAS,YAAa,UAAW;AAChC,aAAU,EAAE,OAAO,SAAS,CAAE;AAAA,EAC/B;AAEA,SAAO,EAAE,OAAO,UAAU,YAAY;AACvC;",
|
|
6
6
|
"names": ["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-transform-panel/hooks.js
|
|
19
21
|
var hooks_exports = {};
|
|
20
22
|
__export(hooks_exports, {
|
|
21
23
|
useAvailablePatterns: () => useAvailablePatterns
|
|
@@ -28,7 +30,7 @@ var import_blocks = require("@wordpress/blocks");
|
|
|
28
30
|
var import_patterns = require("@wordpress/patterns");
|
|
29
31
|
var import_lock_unlock = require("../../lock-unlock");
|
|
30
32
|
var import_store = require("../../store");
|
|
31
|
-
|
|
33
|
+
var { EXCLUDED_PATTERN_SOURCES, PATTERN_TYPES } = (0, import_lock_unlock.unlock)(import_patterns.privateApis);
|
|
32
34
|
function injectThemeAttributeInBlockTemplateContent(block, currentThemeStylesheet) {
|
|
33
35
|
block.innerBlocks = block.innerBlocks.map((innerBlock) => {
|
|
34
36
|
return injectThemeAttributeInBlockTemplateContent(
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-transform-panel/hooks.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { parse } from '@wordpress/blocks';\nimport { privateApis as patternsPrivateApis } from '@wordpress/patterns';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\n\nconst { EXCLUDED_PATTERN_SOURCES, PATTERN_TYPES } =\n\tunlock( patternsPrivateApis );\n\nfunction injectThemeAttributeInBlockTemplateContent(\n\tblock,\n\tcurrentThemeStylesheet\n) {\n\tblock.innerBlocks = block.innerBlocks.map( ( innerBlock ) => {\n\t\treturn injectThemeAttributeInBlockTemplateContent(\n\t\t\tinnerBlock,\n\t\t\tcurrentThemeStylesheet\n\t\t);\n\t} );\n\n\tif (\n\t\tblock.name === 'core/template-part' &&\n\t\tblock.attributes.theme === undefined\n\t) {\n\t\tblock.attributes.theme = currentThemeStylesheet;\n\t}\n\treturn block;\n}\n\n/**\n * Filter all patterns and return only the ones that are compatible with the current template.\n *\n * @param {Array} patterns An array of patterns.\n * @param {Object} template The current template. Required values are `area`, `name`, and `slug`.\n * @return {Array} Array of patterns that are compatible with the current template.\n */\nfunction filterPatterns( patterns, template ) {\n\t// Filter out duplicates.\n\tconst filterOutDuplicatesByName = ( currentItem, index, items ) =>\n\t\tindex === items.findIndex( ( item ) => currentItem.name === item.name );\n\n\t// Filter out core/directory patterns not included in theme.json.\n\tconst filterOutExcludedPatternSources = ( pattern ) =>\n\t\t! EXCLUDED_PATTERN_SOURCES.includes( pattern.source );\n\n\t// Looks for patterns that have the same template type as the current template,\n\t// or have a block type that matches the current template area.\n\tconst filterCompatiblePatterns = ( pattern ) =>\n\t\tpattern.templateTypes?.includes( template.slug ) ||\n\t\tpattern.blockTypes?.includes( 'core/template-part/' + template.area );\n\n\treturn patterns.filter( ( pattern, index, items ) => {\n\t\treturn (\n\t\t\tfilterOutDuplicatesByName( pattern, index, items ) &&\n\t\t\tfilterOutExcludedPatternSources( pattern ) &&\n\t\t\tfilterCompatiblePatterns( pattern )\n\t\t);\n\t} );\n}\n\nfunction preparePatterns( patterns, currentThemeStylesheet ) {\n\treturn patterns.map( ( pattern ) => ( {\n\t\t...pattern,\n\t\tkeywords: pattern.keywords || [],\n\t\ttype: PATTERN_TYPES.theme,\n\t\tblocks: parse( pattern.content, {\n\t\t\t__unstableSkipMigrationLogs: true,\n\t\t} ).map( ( block ) =>\n\t\t\tinjectThemeAttributeInBlockTemplateContent(\n\t\t\t\tblock,\n\t\t\t\tcurrentThemeStylesheet\n\t\t\t)\n\t\t),\n\t} ) );\n}\n\nexport function useAvailablePatterns( { area, name, slug } ) {\n\tconst { blockPatterns, restBlockPatterns, currentThemeStylesheet } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst settings = getEditorSettings();\n\n\t\t\treturn {\n\t\t\t\tblockPatterns:\n\t\t\t\t\tsettings.__experimentalAdditionalBlockPatterns ??\n\t\t\t\t\tsettings.__experimentalBlockPatterns,\n\t\t\t\trestBlockPatterns: select( coreStore ).getBlockPatterns(),\n\t\t\t\tcurrentThemeStylesheet:\n\t\t\t\t\tselect( coreStore ).getCurrentTheme().stylesheet,\n\t\t\t};\n\t\t}, [] );\n\n\treturn useMemo( () => {\n\t\tconst mergedPatterns = [\n\t\t\t...( blockPatterns || [] ),\n\t\t\t...( restBlockPatterns || [] ),\n\t\t];\n\t\tconst filteredPatterns = filterPatterns( mergedPatterns, {\n\t\t\tarea,\n\t\t\tname,\n\t\t\tslug,\n\t\t} );\n\t\treturn preparePatterns( filteredPatterns, currentThemeStylesheet );\n\t}, [\n\t\tarea,\n\t\tname,\n\t\tslug,\n\t\tblockPatterns,\n\t\trestBlockPatterns,\n\t\tcurrentThemeStylesheet,\n\t] );\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA0B;AAC1B,qBAAwB;AACxB,uBAAmC;AACnC,oBAAsB;AACtB,sBAAmD;AAKnD,yBAAuB;AACvB,mBAAqC;AAErC,IAAM,EAAE,0BAA0B,cAAc,QAC/C,2BAAQ,gBAAAA,WAAoB;AAE7B,SAAS,2CACR,OACA,wBACC;AACD,QAAM,cAAc,MAAM,YAAY,IAAK,CAAE,eAAgB;AAC5D,WAAO;AAAA,MACN;AAAA,MACA;AAAA,IACD;AAAA,EACD,CAAE;AAEF,MACC,MAAM,SAAS,wBACf,MAAM,WAAW,UAAU,QAC1B;AACD,UAAM,WAAW,QAAQ;AAAA,EAC1B;AACA,SAAO;AACR;AASA,SAAS,eAAgB,UAAU,UAAW;AAE7C,QAAM,4BAA4B,CAAE,aAAa,OAAO,UACvD,UAAU,MAAM,UAAW,CAAE,SAAU,YAAY,SAAS,KAAK,IAAK;AAGvE,QAAM,kCAAkC,CAAE,YACzC,CAAE,yBAAyB,SAAU,QAAQ,MAAO;AAIrD,QAAM,2BAA2B,CAAE,YAClC,QAAQ,eAAe,SAAU,SAAS,IAAK,KAC/C,QAAQ,YAAY,SAAU,wBAAwB,SAAS,IAAK;AAErE,SAAO,SAAS,OAAQ,CAAE,SAAS,OAAO,UAAW;AACpD,WACC,0BAA2B,SAAS,OAAO,KAAM,KACjD,gCAAiC,OAAQ,KACzC,yBAA0B,OAAQ;AAAA,EAEpC,CAAE;AACH;AAEA,SAAS,gBAAiB,UAAU,wBAAyB;AAC5D,SAAO,SAAS,IAAK,CAAE,aAAe;AAAA,IACrC,GAAG;AAAA,IACH,UAAU,QAAQ,YAAY,CAAC;AAAA,IAC/B,MAAM,cAAc;AAAA,IACpB,YAAQ,qBAAO,QAAQ,SAAS;AAAA,MAC/B,6BAA6B;AAAA,IAC9B,CAAE,EAAE;AAAA,MAAK,CAAE,UACV;AAAA,QACC;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,EACD,EAAI;AACL;AAEO,SAAS,qBAAsB,EAAE,MAAM,MAAM,KAAK,GAAI;AAC5D,QAAM,EAAE,eAAe,mBAAmB,uBAAuB,QAChE,uBAAW,CAAE,WAAY;AACxB,UAAM,EAAE,kBAAkB,IAAI,OAAQ,aAAAC,KAAY;AAClD,UAAM,WAAW,kBAAkB;AAEnC,WAAO;AAAA,MACN,eACC,SAAS,yCACT,SAAS;AAAA,MACV,mBAAmB,OAAQ,iBAAAC,KAAU,EAAE,iBAAiB;AAAA,MACxD,wBACC,OAAQ,iBAAAA,KAAU,EAAE,gBAAgB,EAAE;AAAA,IACxC;AAAA,EACD,GAAG,CAAC,CAAE;AAEP,aAAO,wBAAS,MAAM;AACrB,UAAM,iBAAiB;AAAA,MACtB,GAAK,iBAAiB,CAAC;AAAA,MACvB,GAAK,qBAAqB,CAAC;AAAA,IAC5B;AACA,UAAM,mBAAmB,eAAgB,gBAAgB;AAAA,MACxD;AAAA,MACA;AAAA,MACA;AAAA,IACD,CAAE;AACF,WAAO,gBAAiB,kBAAkB,sBAAuB;AAAA,EAClE,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACH;",
|
|
6
6
|
"names": ["patternsPrivateApis", "editorStore", "coreStore"]
|
|
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-transform-panel/index.js
|
|
19
21
|
var post_transform_panel_exports = {};
|
|
20
22
|
__export(post_transform_panel_exports, {
|
|
21
23
|
default: () => PostTransformPanel
|
|
22
24
|
});
|
|
23
25
|
module.exports = __toCommonJS(post_transform_panel_exports);
|
|
24
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
26
|
var import_data = require("@wordpress/data");
|
|
26
27
|
var import_core_data = require("@wordpress/core-data");
|
|
27
28
|
var import_components = require("@wordpress/components");
|
|
@@ -31,6 +32,7 @@ var import_blocks = require("@wordpress/blocks");
|
|
|
31
32
|
var import_store = require("../../store");
|
|
32
33
|
var import_hooks = require("./hooks");
|
|
33
34
|
var import_constants = require("../../store/constants");
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
36
|
function TemplatesList({ availableTemplates, onSelect }) {
|
|
35
37
|
if (!availableTemplates || availableTemplates?.length === 0) {
|
|
36
38
|
return null;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-transform-panel/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { PanelBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalBlockPatternsList as BlockPatternsList } from '@wordpress/block-editor';\nimport { serialize } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { useAvailablePatterns } from './hooks';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../store/constants';\n\nfunction TemplatesList( { availableTemplates, onSelect } ) {\n\tif ( ! availableTemplates || availableTemplates?.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tlabel={ __( 'Templates' ) }\n\t\t\tblockPatterns={ availableTemplates }\n\t\t\tonClickPattern={ onSelect }\n\t\t\tshowTitlesAsTooltip\n\t\t/>\n\t);\n}\n\nfunction PostTransform() {\n\tconst { area, name, slug, postType, postId } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType, getCurrentPostId } = select( editorStore );\n\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\tconst type = getCurrentPostType();\n\t\tconst id = getCurrentPostId();\n\t\tconst record = getEditedEntityRecord( 'postType', type, id );\n\n\t\treturn {\n\t\t\tarea: record?.area,\n\t\t\tname: record?.name,\n\t\t\tslug: record?.slug,\n\t\t\tpostType: type,\n\t\t\tpostId: id,\n\t\t};\n\t}, [] );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst availablePatterns = useAvailablePatterns( { area, name, slug } );\n\tconst onTemplateSelect = async ( selectedTemplate ) => {\n\t\tawait editEntityRecord( 'postType', postType, postId, {\n\t\t\tblocks: selectedTemplate.blocks,\n\t\t\tcontent: serialize( selectedTemplate.blocks ),\n\t\t} );\n\t};\n\tif ( ! availablePatterns?.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tinitialOpen={ postType === TEMPLATE_PART_POST_TYPE }\n\t\t>\n\t\t\t<TemplatesList\n\t\t\t\tavailableTemplates={ availablePatterns }\n\t\t\t\tonSelect={ onTemplateSelect }\n\t\t\t/>\n\t\t</PanelBody>\n\t);\n}\n\nexport default function PostTransformPanel() {\n\tconst { postType } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType } = select( editorStore );\n\t\treturn {\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t}, [] );\n\n\tif (\n\t\t! [ TEMPLATE_PART_POST_TYPE, TEMPLATE_POST_TYPE ].includes( postType )\n\t) {\n\t\treturn null;\n\t}\n\n\treturn <PostTransform />;\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuC;AACvC,uBAAmC;AACnC,wBAA0B;AAC1B,kBAAmB;AACnB,0BAAqE;AACrE,oBAA0B;AAK1B,mBAAqC;AACrC,mBAAqC;AACrC,uBAGO;AAQL;AANF,SAAS,cAAe,EAAE,oBAAoB,SAAS,GAAI;AAC1D,MAAK,CAAE,sBAAsB,oBAAoB,WAAW,GAAI;AAC/D,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IAAC,oBAAAA;AAAA,IAAA;AAAA,MACA,WAAQ,gBAAI,WAAY;AAAA,MACxB,eAAgB;AAAA,MAChB,gBAAiB;AAAA,MACjB,qBAAmB;AAAA;AAAA,EACpB;AAEF;AAEA,SAAS,gBAAgB;AACxB,QAAM,EAAE,MAAM,MAAM,MAAM,UAAU,OAAO,QAAI,uBAAW,CAAE,WAAY;AACvE,UAAM,EAAE,oBAAoB,iBAAiB,IAAI,OAAQ,aAAAC,KAAY;AACrE,UAAM,EAAE,sBAAsB,IAAI,OAAQ,iBAAAC,KAAU;AACpD,UAAM,OAAO,mBAAmB;AAChC,UAAM,KAAK,iBAAiB;AAC5B,UAAM,SAAS,sBAAuB,YAAY,MAAM,EAAG;AAE3D,WAAO;AAAA,MACN,MAAM,QAAQ;AAAA,MACd,MAAM,QAAQ;AAAA,MACd,MAAM,QAAQ;AAAA,MACd,UAAU;AAAA,MACV,QAAQ;AAAA,IACT;AAAA,EACD,GAAG,CAAC,CAAE;AACN,QAAM,EAAE,iBAAiB,QAAI,yBAAa,iBAAAA,KAAU;AACpD,QAAM,wBAAoB,mCAAsB,EAAE,MAAM,MAAM,KAAK,CAAE;AACrE,QAAM,mBAAmB,OAAQ,qBAAsB;AACtD,UAAM,iBAAkB,YAAY,UAAU,QAAQ;AAAA,MACrD,QAAQ,iBAAiB;AAAA,MACzB,aAAS,yBAAW,iBAAiB,MAAO;AAAA,IAC7C,CAAE;AAAA,EACH;AACA,MAAK,CAAE,mBAAmB,QAAS;AAClC,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAQ,gBAAI,QAAS;AAAA,MACrB,aAAc,aAAa;AAAA,MAE3B;AAAA,QAAC;AAAA;AAAA,UACA,oBAAqB;AAAA,UACrB,UAAW;AAAA;AAAA,MACZ;AAAA;AAAA,EACD;AAEF;AAEe,SAAR,qBAAsC;AAC5C,QAAM,EAAE,SAAS,QAAI,uBAAW,CAAE,WAAY;AAC7C,UAAM,EAAE,mBAAmB,IAAI,OAAQ,aAAAD,KAAY;AACnD,WAAO;AAAA,MACN,UAAU,mBAAmB;AAAA,IAC9B;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,MACC,CAAE,CAAE,0CAAyB,mCAAmB,EAAE,SAAU,QAAS,GACpE;AACD,WAAO;AAAA,EACR;AAEA,SAAO,4CAAC,iBAAc;AACvB;",
|
|
6
6
|
"names": ["BlockPatternsList", "editorStore", "coreStore"]
|
|
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-trash/check.js
|
|
19
21
|
var check_exports = {};
|
|
20
22
|
__export(check_exports, {
|
|
21
23
|
default: () => PostTrashCheck
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-trash/check.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { GLOBAL_POST_TYPES } from '../../store/constants';\n\n/**\n * Wrapper component that renders its children only if the post can be trashed.\n *\n * @param {Object} props The component props.\n * @param {React.ReactNode} props.children The child components.\n *\n * @return {React.ReactNode} The rendered child components or null if the post can't be trashed.\n */\nexport default function PostTrashCheck( { children } ) {\n\tconst { canTrashPost } = useSelect( ( select ) => {\n\t\tconst { isEditedPostNew, getCurrentPostId, getCurrentPostType } =\n\t\t\tselect( editorStore );\n\t\tconst { canUser } = select( coreStore );\n\t\tconst postType = getCurrentPostType();\n\t\tconst postId = getCurrentPostId();\n\t\tconst isNew = isEditedPostNew();\n\t\tconst canUserDelete = !! postId\n\t\t\t? canUser( 'delete', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: postType,\n\t\t\t\t\tid: postId,\n\t\t\t } )\n\t\t\t: false;\n\n\t\treturn {\n\t\t\tcanTrashPost:\n\t\t\t\t( ! isNew || postId ) &&\n\t\t\t\tcanUserDelete &&\n\t\t\t\t! GLOBAL_POST_TYPES.includes( postType ),\n\t\t};\n\t}, [] );\n\tif ( ! canTrashPost ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA0B;AAC1B,uBAAmC;AAKnC,mBAAqC;AACrC,uBAAkC;AAUnB,SAAR,eAAiC,EAAE,SAAS,GAAI;AACtD,QAAM,EAAE,aAAa,QAAI,uBAAW,CAAE,WAAY;AACjD,UAAM,EAAE,iBAAiB,kBAAkB,mBAAmB,IAC7D,OAAQ,aAAAA,KAAY;AACrB,UAAM,EAAE,QAAQ,IAAI,OAAQ,iBAAAC,KAAU;AACtC,UAAM,WAAW,mBAAmB;AACpC,UAAM,SAAS,iBAAiB;AAChC,UAAM,QAAQ,gBAAgB;AAC9B,UAAM,gBAAgB,CAAC,CAAE,SACtB,QAAS,UAAU;AAAA,MACnB,MAAM;AAAA,MACN,MAAM;AAAA,MACN,IAAI;AAAA,IACJ,CAAE,IACF;AAEH,WAAO;AAAA,MACN,eACG,CAAE,SAAS,WACb,iBACA,CAAE,mCAAkB,SAAU,QAAS;AAAA,IACzC;AAAA,EACD,GAAG,CAAC,CAAE;AACN,MAAK,CAAE,cAAe;AACrB,WAAO;AAAA,EACR;AAEA,SAAO;AACR;",
|
|
6
6
|
"names": ["editorStore", "coreStore"]
|
|
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-trash/index.js
|
|
29
31
|
var post_trash_exports = {};
|
|
30
32
|
__export(post_trash_exports, {
|
|
31
33
|
default: () => PostTrash
|
|
32
34
|
});
|
|
33
35
|
module.exports = __toCommonJS(post_trash_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");
|
|
38
39
|
var import_element = require("@wordpress/element");
|
|
39
40
|
var import_store = require("../../store");
|
|
40
41
|
var import_check = __toESM(require("./check"));
|
|
42
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
43
|
function PostTrash({ onActionPerformed }) {
|
|
42
44
|
const registry = (0, import_data.useRegistry)();
|
|
43
45
|
const { isNew, isDeleting, postId, title } = (0, import_data.useSelect)((select) => {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-trash/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { useSelect, useDispatch, useRegistry } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostTrashCheck from './check';\n\n/**\n * Displays the Post Trash Button and Confirm Dialog in the Editor.\n *\n * @param {?{onActionPerformed: Object}} An object containing the onActionPerformed function.\n * @return {React.ReactNode} The rendered PostTrash component.\n */\nexport default function PostTrash( { onActionPerformed } ) {\n\tconst registry = useRegistry();\n\tconst { isNew, isDeleting, postId, title } = useSelect( ( select ) => {\n\t\tconst store = select( editorStore );\n\t\treturn {\n\t\t\tisNew: store.isEditedPostNew(),\n\t\t\tisDeleting: store.isDeletingPost(),\n\t\t\tpostId: store.getCurrentPostId(),\n\t\t\ttitle: store.getCurrentPostAttribute( 'title' ),\n\t\t};\n\t}, [] );\n\tconst { trashPost } = useDispatch( editorStore );\n\tconst [ showConfirmDialog, setShowConfirmDialog ] = useState( false );\n\n\tif ( isNew || ! postId ) {\n\t\treturn null;\n\t}\n\n\tconst handleConfirm = async () => {\n\t\tsetShowConfirmDialog( false );\n\t\tawait trashPost();\n\t\tconst item = await registry\n\t\t\t.resolveSelect( editorStore )\n\t\t\t.getCurrentPost();\n\t\t// After the post is trashed, we want to trigger the onActionPerformed callback, so the user is redirect\n\t\t// to the post view depending on if the user is on post editor or site editor.\n\t\tonActionPerformed?.( 'move-to-trash', [ item ] );\n\t};\n\treturn (\n\t\t<PostTrashCheck>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tclassName=\"editor-post-trash\"\n\t\t\t\tisDestructive\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isDeleting }\n\t\t\t\taria-disabled={ isDeleting }\n\t\t\t\tonClick={\n\t\t\t\t\tisDeleting ? undefined : () => setShowConfirmDialog( true )\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t{ __( 'Move to trash' ) }\n\t\t\t</Button>\n\t\t\t<ConfirmDialog\n\t\t\t\tisOpen={ showConfirmDialog }\n\t\t\t\tonConfirm={ handleConfirm }\n\t\t\t\tonCancel={ () => setShowConfirmDialog( false ) }\n\t\t\t\tconfirmButtonText={ __( 'Move to trash' ) }\n\t\t\t\tsize=\"small\"\n\t\t\t>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t// translators: %s: The item's title.\n\t\t\t\t\t__( 'Are you sure you want to move \"%s\" to the trash?' ),\n\t\t\t\t\ttitle\n\t\t\t\t) }\n\t\t\t</ConfirmDialog>\n\t\t</PostTrashCheck>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA4B;AAC5B,wBAGO;AACP,kBAAoD;AACpD,qBAAyB;AAKzB,mBAAqC;AACrC,mBAA2B;AAqCzB;AA7Ba,SAAR,UAA4B,EAAE,kBAAkB,GAAI;AAC1D,QAAM,eAAW,yBAAY;AAC7B,QAAM,EAAE,OAAO,YAAY,QAAQ,MAAM,QAAI,uBAAW,CAAE,WAAY;AACrE,UAAM,QAAQ,OAAQ,aAAAA,KAAY;AAClC,WAAO;AAAA,MACN,OAAO,MAAM,gBAAgB;AAAA,MAC7B,YAAY,MAAM,eAAe;AAAA,MACjC,QAAQ,MAAM,iBAAiB;AAAA,MAC/B,OAAO,MAAM,wBAAyB,OAAQ;AAAA,IAC/C;AAAA,EACD,GAAG,CAAC,CAAE;AACN,QAAM,EAAE,UAAU,QAAI,yBAAa,aAAAA,KAAY;AAC/C,QAAM,CAAE,mBAAmB,oBAAqB,QAAI,yBAAU,KAAM;AAEpE,MAAK,SAAS,CAAE,QAAS;AACxB,WAAO;AAAA,EACR;AAEA,QAAM,gBAAgB,YAAY;AACjC,yBAAsB,KAAM;AAC5B,UAAM,UAAU;AAChB,UAAM,OAAO,MAAM,SACjB,cAAe,aAAAA,KAAY,EAC3B,eAAe;AAGjB,wBAAqB,iBAAiB,CAAE,IAAK,CAAE;AAAA,EAChD;AACA,SACC,6CAAC,aAAAC,SAAA,EACA;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,uBAAqB;AAAA,QACrB,WAAU;AAAA,QACV,eAAa;AAAA,QACb,SAAQ;AAAA,QACR,QAAS;AAAA,QACT,iBAAgB;AAAA,QAChB,SACC,aAAa,SAAY,MAAM,qBAAsB,IAAK;AAAA,QAGzD,8BAAI,eAAgB;AAAA;AAAA,IACvB;AAAA,IACA;AAAA,MAAC,kBAAAC;AAAA,MAAA;AAAA,QACA,QAAS;AAAA,QACT,WAAY;AAAA,QACZ,UAAW,MAAM,qBAAsB,KAAM;AAAA,QAC7C,uBAAoB,gBAAI,eAAgB;AAAA,QACxC,MAAK;AAAA,QAEH;AAAA;AAAA,cAED,gBAAI,kDAAmD;AAAA,UACvD;AAAA,QACD;AAAA;AAAA,IACD;AAAA,KACD;AAEF;",
|
|
6
6
|
"names": ["editorStore", "PostTrashCheck", "ConfirmDialog"]
|
|
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-type-support-check/index.js
|
|
19
21
|
var post_type_support_check_exports = {};
|
|
20
22
|
__export(post_type_support_check_exports, {
|
|
21
23
|
default: () => post_type_support_check_default
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-type-support-check/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction checkSupport( supports = {}, key ) {\n\t// Check for top-level support keys.\n\tif ( supports[ key ] !== undefined ) {\n\t\treturn !! supports[ key ];\n\t}\n\n\tconst [ topKey, subKey ] = key.split( '.' );\n\t// Try to unwrap sub-properties from the superfluous array.\n\tconst [ subProperties ] = Array.isArray( supports[ topKey ] )\n\t\t? supports[ topKey ]\n\t\t: [];\n\n\treturn Array.isArray( subProperties )\n\t\t? subProperties.includes( subKey )\n\t\t: !! subProperties?.[ subKey ];\n}\n\n/**\n * A component which renders its own children only if the current editor post\n * type supports one of the given `supportKeys` prop.\n *\n * @param {Object} props Props.\n * @param {React.ReactNode} props.children Children to be rendered if post\n * type supports.\n * @param {(string|string[])} props.supportKeys String or string array of keys\n * to test.\n *\n * @return {React.ReactNode} The component to be rendered.\n */\nfunction PostTypeSupportCheck( { children, supportKeys } ) {\n\tconst postType = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn getPostType( getEditedPostAttribute( 'type' ) );\n\t}, [] );\n\tlet isSupported = !! postType;\n\tif ( postType ) {\n\t\tisSupported = (\n\t\t\tArray.isArray( supportKeys ) ? supportKeys : [ supportKeys ]\n\t\t).some( ( key ) => checkSupport( postType.supports, key ) );\n\t}\n\n\tif ( ! isSupported ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default PostTypeSupportCheck;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA0B;AAC1B,uBAAmC;AAKnC,mBAAqC;AAErC,SAAS,aAAc,WAAW,CAAC,GAAG,KAAM;AAE3C,MAAK,SAAU,GAAI,MAAM,QAAY;AACpC,WAAO,CAAC,CAAE,SAAU,GAAI;AAAA,EACzB;AAEA,QAAM,CAAE,QAAQ,MAAO,IAAI,IAAI,MAAO,GAAI;AAE1C,QAAM,CAAE,aAAc,IAAI,MAAM,QAAS,SAAU,MAAO,CAAE,IACzD,SAAU,MAAO,IACjB,CAAC;AAEJ,SAAO,MAAM,QAAS,aAAc,IACjC,cAAc,SAAU,MAAO,IAC/B,CAAC,CAAE,gBAAiB,MAAO;AAC/B;AAcA,SAAS,qBAAsB,EAAE,UAAU,YAAY,GAAI;AAC1D,QAAM,eAAW,uBAAW,CAAE,WAAY;AACzC,UAAM,EAAE,uBAAuB,IAAI,OAAQ,aAAAA,KAAY;AACvD,UAAM,EAAE,YAAY,IAAI,OAAQ,iBAAAC,KAAU;AAC1C,WAAO,YAAa,uBAAwB,MAAO,CAAE;AAAA,EACtD,GAAG,CAAC,CAAE;AACN,MAAI,cAAc,CAAC,CAAE;AACrB,MAAK,UAAW;AACf,mBACC,MAAM,QAAS,WAAY,IAAI,cAAc,CAAE,WAAY,GAC1D,KAAM,CAAE,QAAS,aAAc,SAAS,UAAU,GAAI,CAAE;AAAA,EAC3D;AAEA,MAAK,CAAE,aAAc;AACpB,WAAO;AAAA,EACR;AAEA,SAAO;AACR;AAEA,IAAO,kCAAQ;",
|
|
6
6
|
"names": ["editorStore", "coreStore"]
|
|
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-url/check.js
|
|
19
21
|
var check_exports = {};
|
|
20
22
|
__export(check_exports, {
|
|
21
23
|
default: () => PostURLCheck
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-url/check.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Check if the post URL is valid and visible.\n *\n * @param {Object} props The component props.\n * @param {React.ReactNode} props.children The child components.\n *\n * @return {React.ReactNode} The child components if the post URL is valid and visible, otherwise null.\n */\nexport default function PostURLCheck( { children } ) {\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst postTypeSlug = select( editorStore ).getCurrentPostType();\n\t\tconst postType = select( coreStore ).getPostType( postTypeSlug );\n\t\tif ( ! postType?.viewable ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\tif ( ! post.link ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst permalinkParts = select( editorStore ).getPermalinkParts();\n\t\tif ( ! permalinkParts ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA0B;AAC1B,uBAAmC;AAKnC,mBAAqC;AAUtB,SAAR,aAA+B,EAAE,SAAS,GAAI;AACpD,QAAM,gBAAY,uBAAW,CAAE,WAAY;AAC1C,UAAM,eAAe,OAAQ,aAAAA,KAAY,EAAE,mBAAmB;AAC9D,UAAM,WAAW,OAAQ,iBAAAC,KAAU,EAAE,YAAa,YAAa;AAC/D,QAAK,CAAE,UAAU,UAAW;AAC3B,aAAO;AAAA,IACR;AAEA,UAAM,OAAO,OAAQ,aAAAD,KAAY,EAAE,eAAe;AAClD,QAAK,CAAE,KAAK,MAAO;AAClB,aAAO;AAAA,IACR;AAEA,UAAM,iBAAiB,OAAQ,aAAAA,KAAY,EAAE,kBAAkB;AAC/D,QAAK,CAAE,gBAAiB;AACvB,aAAO;AAAA,IACR;AAEA,WAAO;AAAA,EACR,GAAG,CAAC,CAAE;AAEN,MAAK,CAAE,WAAY;AAClB,WAAO;AAAA,EACR;AAEA,SAAO;AACR;",
|
|
6
6
|
"names": ["editorStore", "coreStore"]
|
|
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-url/index.js
|
|
19
21
|
var post_url_exports = {};
|
|
20
22
|
__export(post_url_exports, {
|
|
21
23
|
default: () => PostURL
|
|
22
24
|
});
|
|
23
25
|
module.exports = __toCommonJS(post_url_exports);
|
|
24
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
26
|
var import_data = require("@wordpress/data");
|
|
26
27
|
var import_url = require("@wordpress/url");
|
|
27
28
|
var import_element = require("@wordpress/element");
|
|
@@ -33,6 +34,7 @@ var import_icons = require("@wordpress/icons");
|
|
|
33
34
|
var import_core_data = require("@wordpress/core-data");
|
|
34
35
|
var import_compose = require("@wordpress/compose");
|
|
35
36
|
var import_store = require("../../store");
|
|
37
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
38
|
function PostURL({ onClose }) {
|
|
37
39
|
const {
|
|
38
40
|
isEditable,
|