@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/dataviews/store/private-actions.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { Action, Field } from '@wordpress/dataviews';\nimport { doAction } from '@wordpress/hooks';\nimport type { PostType } from '@wordpress/fields';\nimport {\n\tviewPost,\n\tviewPostRevisions,\n\tduplicatePost,\n\tduplicatePattern,\n\treorderPage,\n\texportPattern,\n\tpermanentlyDeletePost,\n\trestorePost,\n\ttrashPost,\n\trenamePost,\n\tresetPost,\n\tdeletePost,\n\tduplicateTemplatePart,\n\tfeaturedImageField,\n\tdateField,\n\tparentField,\n\tpasswordField,\n\tcommentStatusField,\n\tpingStatusField,\n\tdiscussionField,\n\tslugField,\n\tstatusField,\n\tauthorField,\n\ttitleField,\n\ttemplateField,\n\ttemplateTitleField,\n\tpageTitleField,\n\tpatternTitleField,\n} from '@wordpress/fields';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport postPreviewField from '../fields/content-preview';\nimport { unlock } from '../../lock-unlock';\n\nexport function registerEntityAction< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Action< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityAction(\n\tkind: string,\n\tname: string,\n\tactionId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tactionId,\n\t};\n}\n\nexport function registerEntityField< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Field< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_FIELD' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityField(\n\tkind: string,\n\tname: string,\n\tfieldId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_FIELD' as const,\n\t\tkind,\n\t\tname,\n\t\tfieldId,\n\t};\n}\n\nexport function setIsReady( kind: string, name: string ) {\n\treturn {\n\t\ttype: 'SET_IS_READY' as const,\n\t\tkind,\n\t\tname,\n\t};\n}\n\nexport const registerPostTypeSchema =\n\t( postType: string ) =>\n\tasync ( { registry }: { registry: any } ) => {\n\t\tconst isReady = unlock( registry.select( editorStore ) ).isEntityReady(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\t\tif ( isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\tunlock( registry.dispatch( editorStore ) ).setIsReady(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\n\t\tconst postTypeConfig = ( await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getPostType( postType ) ) as PostType;\n\n\t\tconst canCreate = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: postType,\n\t\t\t} );\n\t\tconst currentTheme = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getCurrentTheme();\n\n\t\tlet canDuplicate =\n\t\t\t! [ 'wp_block', 'wp_template_part' ].includes(\n\t\t\t\tpostTypeConfig.slug\n\t\t\t) &&\n\t\t\tcanCreate &&\n\t\t\tduplicatePost;\n\n\t\t// @ts-ignore\n\t\tif ( ! globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t// Outside Gutenberg, disable duplication except for wp_template.\n\t\t\tif ( 'wp_template' !== postTypeConfig.slug ) {\n\t\t\t\tcanDuplicate = undefined;\n\t\t\t}\n\t\t}\n\n\t\tconst actions = [\n\t\t\tpostTypeConfig.viewable ? viewPost : undefined,\n\t\t\t!! postTypeConfig.supports?.revisions\n\t\t\t\t? viewPostRevisions\n\t\t\t\t: undefined,\n\t\t\t// @ts-ignore\n\t\t\tcanDuplicate,\n\t\t\tpostTypeConfig.slug === 'wp_template_part' &&\n\t\t\tcanCreate &&\n\t\t\tcurrentTheme?.is_block_theme\n\t\t\t\t? duplicateTemplatePart\n\t\t\t\t: undefined,\n\t\t\tcanCreate && postTypeConfig.slug === 'wp_block'\n\t\t\t\t? duplicatePattern\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.supports?.title ? renamePost : undefined,\n\t\t\tpostTypeConfig.supports?.[ 'page-attributes' ]\n\t\t\t\t? reorderPage\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.slug === 'wp_block' ? exportPattern : undefined,\n\t\t\trestorePost,\n\t\t\tresetPost,\n\t\t\tdeletePost,\n\t\t\ttrashPost,\n\t\t\tpermanentlyDeletePost,\n\t\t].filter( Boolean );\n\n\t\tconst fields = [\n\t\t\tpostTypeConfig.supports?.thumbnail &&\n\t\t\t\tcurrentTheme?.theme_supports?.[ 'post-thumbnails' ] &&\n\t\t\t\tfeaturedImageField,\n\t\t\tpostTypeConfig.supports?.author && authorField,\n\t\t\tstatusField,\n\t\t\tdateField,\n\t\t\tslugField,\n\t\t\tpostTypeConfig.supports?.[ 'page-attributes' ] && parentField,\n\t\t\tpostTypeConfig.supports?.comments && commentStatusField,\n\t\t\tpostTypeConfig.supports?.trackbacks && pingStatusField,\n\t\t\t( postTypeConfig.supports?.comments ||\n\t\t\t\tpostTypeConfig.supports?.trackbacks ) &&\n\t\t\t\tdiscussionField,\n\t\t\ttemplateField,\n\t\t\tpasswordField,\n\t\t\tpostTypeConfig.supports?.editor &&\n\t\t\t\tpostTypeConfig.viewable &&\n\t\t\t\tpostPreviewField,\n\t\t].filter( Boolean );\n\t\tif ( postTypeConfig.supports?.title ) {\n\t\t\tlet _titleField;\n\t\t\tif ( postType === 'page' ) {\n\t\t\t\t_titleField = pageTitleField;\n\t\t\t} else if ( postType === 'wp_template' ) {\n\t\t\t\t_titleField = templateTitleField;\n\t\t\t} else if ( postType === 'wp_block' ) {\n\t\t\t\t_titleField = patternTitleField;\n\t\t\t} else {\n\t\t\t\t_titleField = titleField;\n\t\t\t}\n\t\t\tfields.push( _titleField );\n\t\t}\n\n\t\tregistry.batch( () => {\n\t\t\tactions.forEach( ( action ) => {\n\t\t\t\tunlock( registry.dispatch( editorStore ) ).registerEntityAction(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\taction\n\t\t\t\t);\n\t\t\t} );\n\t\t\tfields.forEach( ( field ) => {\n\t\t\t\tunlock( registry.dispatch( editorStore ) ).registerEntityField(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tfield\n\t\t\t\t);\n\t\t\t} );\n\t\t} );\n\n\t\tdoAction( 'core.registerPostTypeSchema', postType );\n\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,IACf,OAAO;AACN,oBAAc;AAAA,IACf;AACA,WAAO,KAAM,WAAY;AAAA,EAC1B;AAEA,WAAS,MAAO,MAAM;AACrB,YAAQ,QAAS,CAAE,WAAY;AAC9B,qCAAQ,SAAS,SAAU,aAAAF,KAAY,CAAE,EAAE;AAAA,QAC1C;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,IACD,CAAE;AACF,WAAO,QAAS,CAAE,UAAW;AAC5B,qCAAQ,SAAS,SAAU,aAAAA,KAAY,CAAE,EAAE;AAAA,QAC1C;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,IACD,CAAE;AAAA,EACH,CAAE;AAEF,6BAAU,+BAA+B,QAAS;AACnD;",
|
|
6
6
|
"names": ["editorStore", "coreStore", "postPreviewField"]
|
|
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/dataviews/store/private-selectors.ts
|
|
19
21
|
var private_selectors_exports = {};
|
|
20
22
|
__export(private_selectors_exports, {
|
|
21
23
|
getEntityActions: () => getEntityActions,
|
|
@@ -23,7 +25,7 @@ __export(private_selectors_exports, {
|
|
|
23
25
|
isEntityReady: () => isEntityReady
|
|
24
26
|
});
|
|
25
27
|
module.exports = __toCommonJS(private_selectors_exports);
|
|
26
|
-
|
|
28
|
+
var EMPTY_ARRAY = [];
|
|
27
29
|
function getEntityActions(state, kind, name) {
|
|
28
30
|
return state.actions[kind]?.[name] ?? EMPTY_ARRAY;
|
|
29
31
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/dataviews/store/private-selectors.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { State } from './reducer';\n\nconst EMPTY_ARRAY = [] as [];\n\nexport function getEntityActions( state: State, kind: string, name: string ) {\n\treturn state.actions[ kind ]?.[ name ] ?? EMPTY_ARRAY;\n}\n\nexport function getEntityFields( state: State, kind: string, name: string ) {\n\treturn state.fields[ kind ]?.[ name ] ?? EMPTY_ARRAY;\n}\n\nexport function isEntityReady( state: State, kind: string, name: string ) {\n\treturn state.isReady[ kind ]?.[ name ];\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,IAAM,cAAc,CAAC;AAEd,SAAS,iBAAkB,OAAc,MAAc,MAAe;AAC5E,SAAO,MAAM,QAAS,IAAK,IAAK,IAAK,KAAK;AAC3C;AAEO,SAAS,gBAAiB,OAAc,MAAc,MAAe;AAC3E,SAAO,MAAM,OAAQ,IAAK,IAAK,IAAK,KAAK;AAC1C;AAEO,SAAS,cAAe,OAAc,MAAc,MAAe;AACzE,SAAO,MAAM,QAAS,IAAK,IAAK,IAAK;AACtC;",
|
|
6
6
|
"names": []
|
|
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/dataviews/store/reducer.ts
|
|
19
21
|
var reducer_exports = {};
|
|
20
22
|
__export(reducer_exports, {
|
|
21
23
|
default: () => reducer_default
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/dataviews/store/reducer.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\nimport type { Action, Field } from '@wordpress/dataviews';\n\ntype ReduxAction =\n\t| ReturnType< typeof import('./private-actions').registerEntityAction >\n\t| ReturnType< typeof import('./private-actions').unregisterEntityAction >\n\t| ReturnType< typeof import('./private-actions').registerEntityField >\n\t| ReturnType< typeof import('./private-actions').unregisterEntityField >\n\t| ReturnType< typeof import('./private-actions').setIsReady >;\n\nexport type ActionState = Record< string, Record< string, Action< any >[] > >;\nexport type FieldsState = Record< string, Record< string, Field< any >[] > >;\nexport type ReadyState = Record< string, Record< string, boolean > >;\nexport type State = {\n\tactions: ActionState;\n\tfields: FieldsState;\n\tisReady: ReadyState;\n};\n\nfunction isReady( state: ReadyState = {}, action: ReduxAction ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_READY':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.kind ]: {\n\t\t\t\t\t...state[ action.kind ],\n\t\t\t\t\t[ action.name ]: true,\n\t\t\t\t},\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\nfunction actions( state: ActionState = {}, action: ReduxAction ) {\n\tswitch ( action.type ) {\n\t\tcase 'REGISTER_ENTITY_ACTION':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.kind ]: {\n\t\t\t\t\t...state[ action.kind ],\n\t\t\t\t\t[ action.name ]: [\n\t\t\t\t\t\t...(\n\t\t\t\t\t\t\tstate[ action.kind ]?.[ action.name ] ?? []\n\t\t\t\t\t\t).filter(\n\t\t\t\t\t\t\t( _action ) => _action.id !== action.config.id\n\t\t\t\t\t\t),\n\t\t\t\t\t\taction.config,\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'UNREGISTER_ENTITY_ACTION': {\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.kind ]: {\n\t\t\t\t\t...state[ action.kind ],\n\t\t\t\t\t[ action.name ]: (\n\t\t\t\t\t\tstate[ action.kind ]?.[ action.name ] ?? []\n\t\t\t\t\t).filter( ( _action ) => _action.id !== action.actionId ),\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t}\n\n\treturn state;\n}\n\nfunction fields( state: FieldsState = {}, action: ReduxAction ) {\n\tswitch ( action.type ) {\n\t\tcase 'REGISTER_ENTITY_FIELD':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.kind ]: {\n\t\t\t\t\t...state[ action.kind ],\n\t\t\t\t\t[ action.name ]: [\n\t\t\t\t\t\t...(\n\t\t\t\t\t\t\tstate[ action.kind ]?.[ action.name ] ?? []\n\t\t\t\t\t\t).filter(\n\t\t\t\t\t\t\t( _field ) => _field.id !== action.config.id\n\t\t\t\t\t\t),\n\t\t\t\t\t\taction.config,\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'UNREGISTER_ENTITY_FIELD':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.kind ]: {\n\t\t\t\t\t...state[ action.kind ],\n\t\t\t\t\t[ action.name ]: (\n\t\t\t\t\t\tstate[ action.kind ]?.[ action.name ] ?? []\n\t\t\t\t\t).filter( ( _field ) => _field.id !== action.fieldId ),\n\t\t\t\t},\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tactions,\n\tfields,\n\tisReady,\n} );\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAgC;AAmBhC,SAAS,QAAS,QAAoB,CAAC,GAAG,QAAsB;AAC/D,UAAS,OAAO,MAAO;AAAA,IACtB,KAAK;AACJ,aAAO;AAAA,QACN,GAAG;AAAA,QACH,CAAE,OAAO,IAAK,GAAG;AAAA,UAChB,GAAG,MAAO,OAAO,IAAK;AAAA,UACtB,CAAE,OAAO,IAAK,GAAG;AAAA,QAClB;AAAA,MACD;AAAA,EACF;AAEA,SAAO;AACR;AAEA,SAAS,QAAS,QAAqB,CAAC,GAAG,QAAsB;AAChE,UAAS,OAAO,MAAO;AAAA,IACtB,KAAK;AACJ,aAAO;AAAA,QACN,GAAG;AAAA,QACH,CAAE,OAAO,IAAK,GAAG;AAAA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ACtD;AAAA,MACD;AAAA,EACF;AAEA,SAAO;AACR;AAEA,IAAO,sBAAQ,6BAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AACD,CAAE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
// packages/editor/src/hooks/custom-sources-backwards-compatibility.js
|
|
3
4
|
var import_data = require("@wordpress/data");
|
|
4
5
|
var import_core_data = require("@wordpress/core-data");
|
|
5
6
|
var import_element = require("@wordpress/element");
|
|
6
7
|
var import_compose = require("@wordpress/compose");
|
|
7
8
|
var import_hooks = require("@wordpress/hooks");
|
|
8
9
|
var import_store = require("../store");
|
|
9
|
-
|
|
10
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
11
|
+
var createWithMetaAttributeSource = (metaAttributes) => (0, import_compose.createHigherOrderComponent)(
|
|
10
12
|
(BlockEdit) => ({ attributes, setAttributes, ...props }) => {
|
|
11
13
|
const postType = (0, import_data.useSelect)(
|
|
12
14
|
(select) => select(import_store.store).getCurrentPostType(),
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/hooks/custom-sources-backwards-compatibility.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\n\n/** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */\n/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */\n\n/**\n * Object whose keys are the names of block attributes, where each value\n * represents the meta key to which the block attribute is intended to save.\n *\n * @see https://developer.wordpress.org/reference/functions/register_meta/\n *\n * @typedef {Object<string,string>} WPMetaAttributeMapping\n */\n\n/**\n * Given a mapping of attribute names (meta source attributes) to their\n * associated meta key, returns a higher order component that overrides its\n * `attributes` and `setAttributes` props to sync any changes with the edited\n * post's meta keys.\n *\n * @param {WPMetaAttributeMapping} metaAttributes Meta attribute mapping.\n *\n * @return {WPHigherOrderComponent} Higher-order component.\n */\nconst createWithMetaAttributeSource = ( metaAttributes ) =>\n\tcreateHigherOrderComponent(\n\t\t( BlockEdit ) =>\n\t\t\t( { attributes, setAttributes, ...props } ) => {\n\t\t\t\tconst postType = useSelect(\n\t\t\t\t\t( select ) => select( editorStore ).getCurrentPostType(),\n\t\t\t\t\t[]\n\t\t\t\t);\n\t\t\t\tconst [ meta, setMeta ] = useEntityProp(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\t'meta'\n\t\t\t\t);\n\n\t\t\t\tconst mergedAttributes = useMemo(\n\t\t\t\t\t() => ( {\n\t\t\t\t\t\t...attributes,\n\t\t\t\t\t\t...Object.fromEntries(\n\t\t\t\t\t\t\tObject.entries( metaAttributes ).map(\n\t\t\t\t\t\t\t\t( [ attributeKey, metaKey ] ) => [\n\t\t\t\t\t\t\t\t\tattributeKey,\n\t\t\t\t\t\t\t\t\tmeta[ metaKey ],\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t} ),\n\t\t\t\t\t[ attributes, meta ]\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<BlockEdit\n\t\t\t\t\t\tattributes={ mergedAttributes }\n\t\t\t\t\t\tsetAttributes={ ( nextAttributes ) => {\n\t\t\t\t\t\t\tconst nextMeta = Object.fromEntries(\n\t\t\t\t\t\t\t\tObject.entries( nextAttributes ?? {} )\n\t\t\t\t\t\t\t\t\t.filter(\n\t\t\t\t\t\t\t\t\t\t// Filter to intersection of keys between the updated\n\t\t\t\t\t\t\t\t\t\t// attributes and those with an associated meta key.\n\t\t\t\t\t\t\t\t\t\t( [ key ] ) => key in metaAttributes\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t.map( ( [ attributeKey, value ] ) => [\n\t\t\t\t\t\t\t\t\t\t// Rename the keys to the expected meta key name.\n\t\t\t\t\t\t\t\t\t\tmetaAttributes[ attributeKey ],\n\t\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\t] )\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( Object.entries( nextMeta ).length ) {\n\t\t\t\t\t\t\t\tsetMeta( nextMeta );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsetAttributes( nextAttributes );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t},\n\t\t'withMetaAttributeSource'\n\t);\n\n/**\n * Filters a registered block's settings to enhance a block's `edit` component\n * to upgrade meta-sourced attributes to use the post's meta entity property.\n *\n * @param {WPBlockSettings} settings Registered block settings.\n *\n * @return {WPBlockSettings} Filtered block settings.\n */\nfunction shimAttributeSource( settings ) {\n\t/** @type {WPMetaAttributeMapping} */\n\tconst metaAttributes = Object.fromEntries(\n\t\tObject.entries( settings.attributes ?? {} )\n\t\t\t.filter( ( [ , { source } ] ) => source === 'meta' )\n\t\t\t.map( ( [ attributeKey, { meta } ] ) => [ attributeKey, meta ] )\n\t);\n\tif ( Object.entries( metaAttributes ).length ) {\n\t\tsettings.edit = createWithMetaAttributeSource( metaAttributes )(\n\t\t\tsettings.edit\n\t\t);\n\t}\n\n\treturn settings;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/custom-sources-backwards-compatibility/shim-attribute-source',\n\tshimAttributeSource\n);\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;AAGA,kBAA0B;AAC1B,uBAA8B;AAC9B,qBAAwB;AACxB,qBAA2C;AAC3C,mBAA0B;AAK1B,mBAAqC;AAsDh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,MAAO,EAClD,IAAK,CAAE,CAAE,cAAc,EAAE,KAAK,CAAE,MAAO,CAAE,cAAc,IAAK,CAAE;AAAA,EACjE;AACA,MAAK,OAAO,QAAS,cAAe,EAAE,QAAS;AAC9C,aAAS,OAAO,8BAA+B,cAAe;AAAA,MAC7D,SAAS;AAAA,IACV;AAAA,EACD;AAEA,SAAO;AACR;AAAA,IAEA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
|
|
6
6
|
"names": ["editorStore"]
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/hooks/default-autocompleters.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { userAutocompleter } from '../components';\n\nfunction setDefaultCompleters( completers = [] ) {\n\t// Provide copies so filters may directly modify them.\n\tcompleters.push( { ...userAutocompleter } );\n\n\treturn completers;\n}\n\naddFilter(\n\t'editor.Autocomplete.completers',\n\t'editor/autocompleters/set-default-completers',\n\tsetDefaultCompleters\n);\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;AAGA,mBAA0B;AAK1B,wBAAkC;AAElC,SAAS,qBAAsB,aAAa,CAAC,GAAI;AAEhD,aAAW,KAAM,EAAE,GAAG,oCAAkB,CAAE;AAE1C,SAAO;AACR;AAAA,IAEA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/hooks/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
3
|
+
// packages/editor/src/hooks/index.js
|
|
2
4
|
var import_custom_sources_backwards_compatibility = require("./custom-sources-backwards-compatibility");
|
|
3
5
|
var import_default_autocompleters = require("./default-autocompleters");
|
|
4
6
|
var import_media_upload = require("./media-upload");
|
package/build/hooks/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/hooks/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport './custom-sources-backwards-compatibility';\nimport './default-autocompleters';\nimport './media-upload';\nimport './pattern-overrides';\nimport './navigation-link-view-button';\nimport './template-part-navigation-edit-button';\nimport './push-changes-to-global-styles';\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;AAGA,oDAAO;AACP,oCAAO;AACP,0BAAO;AACP,+BAAO;AACP,yCAAO;AACP,kDAAO;AACP,2CAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
3
|
+
// packages/editor/src/hooks/media-upload.js
|
|
2
4
|
var import_hooks = require("@wordpress/hooks");
|
|
3
5
|
var import_media_utils = require("@wordpress/media-utils");
|
|
4
6
|
var import_lock_unlock = require("../lock-unlock");
|
|
5
|
-
|
|
7
|
+
var { MediaUploadModal: MediaUploadModalComponent } = (0, import_lock_unlock.unlock)(
|
|
6
8
|
import_media_utils.privateApis
|
|
7
9
|
);
|
|
8
10
|
if (window.__experimentalDataViewsMediaModal) {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/hooks/media-upload.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tMediaUpload,\n\tprivateApis as mediaUtilsPrivateApis,\n} from '@wordpress/media-utils';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\nconst { MediaUploadModal: MediaUploadModalComponent } = unlock(\n\tmediaUtilsPrivateApis\n);\n\nif ( window.__experimentalDataViewsMediaModal ) {\n\t// Create a new filter for the MediaUploadModal component\n\taddFilter(\n\t\t'editor.MediaUploadModal',\n\t\t'core/editor/components/media-upload-modal',\n\t\t() => {\n\t\t\treturn MediaUploadModalComponent;\n\t\t}\n\t);\n}\naddFilter( 'editor.MediaUpload', 'core/editor/components/media-upload', () => {\n\treturn MediaUpload;\n} );\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;AAGA,mBAA0B;AAC1B,yBAGO;AAKP,yBAAuB;AAEvB,IAAM,EAAE,kBAAkB,0BAA0B,QAAI;AAAA,EACvD,mBAAAA;AACD;AAEA,IAAK,OAAO,mCAAoC;AAE/C;AAAA,IACC;AAAA,IACA;AAAA,IACA,MAAM;AACL,aAAO;AAAA,IACR;AAAA,EACD;AACD;AAAA,IACA,wBAAW,sBAAsB,uCAAuC,MAAM;AAC7E,SAAO;AACR,CAAE;",
|
|
6
6
|
"names": ["mediaUtilsPrivateApis"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
// packages/editor/src/hooks/navigation-link-view-button.js
|
|
3
4
|
var import_hooks = require("@wordpress/hooks");
|
|
4
5
|
var import_compose = require("@wordpress/compose");
|
|
5
6
|
var import_element = require("@wordpress/element");
|
|
@@ -7,7 +8,8 @@ var import_i18n = require("@wordpress/i18n");
|
|
|
7
8
|
var import_block_editor = require("@wordpress/block-editor");
|
|
8
9
|
var import_components = require("@wordpress/components");
|
|
9
10
|
var import_data = require("@wordpress/data");
|
|
10
|
-
|
|
11
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
12
|
+
var SUPPORTED_BLOCKS = ["core/navigation-link", "core/navigation-submenu"];
|
|
11
13
|
function NavigationViewButton({ attributes }) {
|
|
12
14
|
const { kind, id, type } = attributes;
|
|
13
15
|
const blockEditingMode = (0, import_block_editor.useBlockEditingMode)();
|
|
@@ -36,7 +38,7 @@ function NavigationViewButton({ attributes }) {
|
|
|
36
38
|
}
|
|
37
39
|
) }) });
|
|
38
40
|
}
|
|
39
|
-
|
|
41
|
+
var withNavigationViewButton = (0, import_compose.createHigherOrderComponent)(
|
|
40
42
|
(BlockEdit) => (props) => {
|
|
41
43
|
const isSupportedBlock = SUPPORTED_BLOCKS.includes(props.name);
|
|
42
44
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/hooks/navigation-link-view-button.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useCallback } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__unstableBlockToolbarLastItem as BlockToolbarLastItem,\n\tstore as blockEditorStore,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { ToolbarButton, ToolbarGroup } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n// Target blocks that should have the View button.\nconst SUPPORTED_BLOCKS = [ 'core/navigation-link', 'core/navigation-submenu' ];\n\n/**\n * Component that renders the View button for navigation blocks.\n *\n * @param {Object} props Component props.\n * @param {Object} props.attributes Block attributes.\n * @return {JSX.Element|null} The View button component or null if not applicable.\n */\nfunction NavigationViewButton( { attributes } ) {\n\tconst { kind, id, type } = attributes;\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst onNavigateToEntityRecord = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().onNavigateToEntityRecord,\n\t\t[]\n\t);\n\n\tconst onViewPage = useCallback( () => {\n\t\tif (\n\t\t\tkind === 'post-type' &&\n\t\t\ttype === 'page' &&\n\t\t\tid &&\n\t\t\tonNavigateToEntityRecord\n\t\t) {\n\t\t\tonNavigateToEntityRecord( {\n\t\t\t\tpostId: id,\n\t\t\t\tpostType: type,\n\t\t\t} );\n\t\t}\n\t}, [ kind, id, type, onNavigateToEntityRecord ] );\n\n\t// Only show for page-type links, when navigation is available, and when in contentOnly mode.\n\tif (\n\t\tkind !== 'post-type' ||\n\t\ttype !== 'page' ||\n\t\t! id ||\n\t\t! onNavigateToEntityRecord ||\n\t\tblockEditingMode !== 'contentOnly'\n\t) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockToolbarLastItem>\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tname=\"view\"\n\t\t\t\t\ttitle={ __( 'View' ) }\n\t\t\t\t\tonClick={ onViewPage }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'View' ) }\n\t\t\t\t</ToolbarButton>\n\t\t\t</ToolbarGroup>\n\t\t</BlockToolbarLastItem>\n\t);\n}\n\n/**\n * Higher-order component that adds the View button to navigation blocks.\n */\nconst withNavigationViewButton = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst isSupportedBlock = SUPPORTED_BLOCKS.includes( props.name );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit key=\"edit\" { ...props } />\n\t\t\t\t{ props.isSelected && isSupportedBlock && (\n\t\t\t\t\t<NavigationViewButton { ...props } />\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t},\n\t'withNavigationViewButton'\n);\n\n// Register the filter.\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/with-navigation-view-button',\n\twithNavigationViewButton\n);\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;AAGA,mBAA0B;AAC1B,qBAA2C;AAC3C,qBAA4B;AAC5B,kBAAmB;AACnB,0BAIO;AACP,wBAA4C;AAC5C,kBAA0B;AAkDtB;AA/CJ,IAAM,mBAAmB,CAAE,wBAAwB,yBAA0B;AAS7E,SAAS,qBAAsB,EAAE,WAAW,GAAI;AAC/C,QAAM,EAAE,MAAM,IAAI,KAAK,IAAI;AAC3B,QAAM,uBAAmB,yCAAoB;AAE7C,QAAM,+BAA2B;AAAA,IAChC,CAAE,WACD,OAAQ,oBAAAA,KAAiB,EAAE,YAAY,EAAE;AAAA,IAC1C,CAAC;AAAA,EACF;AAEA,QAAM,iBAAa,4BAAa,MAAM;AACrC,QACC,SAAS,eACT,SAAS,UACT,MACA,0BACC;AACD,+BAA0B;AAAA,QACzB,QAAQ;AAAA,QACR,UAAU;AAAA,MACX,CAAE;AAAA,IACH;AAAA,EACD,GAAG,CAAE,MAAM,IAAI,MAAM,wBAAyB,CAAE;AAGhD,MACC,SAAS,eACT,SAAS,UACT,CAAE,MACF,CAAE,4BACF,qBAAqB,eACpB;AACD,WAAO;AAAA,EACR;AAEA,SACC,4CAAC,oBAAAC,gCAAA,EACA,sDAAC,kCACA;AAAA,IAAC;AAAA;AAAA,MACA,MAAK;AAAA,MACL,WAAQ,gBAAI,MAAO;AAAA,MACnB,SAAU;AAAA,MAER,8BAAI,MAAO;AAAA;AAAA,EACd,GACD,GACD;AAEF;AAKA,IAAM,+BAA2B;AAAA,EAChC,CAAE,cAAe,CAAE,UAAW;AAC7B,UAAM,mBAAmB,iBAAiB,SAAU,MAAM,IAAK;AAE/D,WACC,4EACC;AAAA,kDAAC,aAAuB,GAAG,SAAZ,MAAoB;AAAA,MACjC,MAAM,cAAc,oBACrB,4CAAC,wBAAuB,GAAG,OAAQ;AAAA,OAErC;AAAA,EAEF;AAAA,EACA;AACD;AAAA,IAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
|
|
6
6
|
"names": ["blockEditorStore", "BlockToolbarLastItem"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
// packages/editor/src/hooks/pattern-overrides.js
|
|
3
4
|
var import_hooks = require("@wordpress/hooks");
|
|
4
5
|
var import_patterns = require("@wordpress/patterns");
|
|
5
6
|
var import_compose = require("@wordpress/compose");
|
|
@@ -8,21 +9,20 @@ var import_data = require("@wordpress/data");
|
|
|
8
9
|
var import_blocks = require("@wordpress/blocks");
|
|
9
10
|
var import_store = require("../store");
|
|
10
11
|
var import_lock_unlock = require("../lock-unlock");
|
|
11
|
-
|
|
12
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
13
|
+
var {
|
|
12
14
|
PatternOverridesControls,
|
|
13
15
|
ResetOverridesControl,
|
|
14
|
-
PatternOverridesBlockControls,
|
|
15
16
|
PATTERN_TYPES,
|
|
16
17
|
PARTIAL_SYNCING_SUPPORTED_BLOCKS,
|
|
17
18
|
PATTERN_SYNC_TYPES
|
|
18
19
|
} = (0, import_lock_unlock.unlock)(import_patterns.privateApis);
|
|
19
|
-
|
|
20
|
+
var withPatternOverrideControls = (0, import_compose.createHigherOrderComponent)(
|
|
20
21
|
(BlockEdit) => (props) => {
|
|
21
22
|
const isSupportedBlock = !!PARTIAL_SYNCING_SUPPORTED_BLOCKS[props.name];
|
|
22
23
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
23
24
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BlockEdit, { ...props }, "edit"),
|
|
24
|
-
props.isSelected && isSupportedBlock && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ControlsWithStoreSubscription, { ...props })
|
|
25
|
-
isSupportedBlock && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PatternOverridesBlockControls, {})
|
|
25
|
+
props.isSelected && isSupportedBlock && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ControlsWithStoreSubscription, { ...props })
|
|
26
26
|
] });
|
|
27
27
|
},
|
|
28
28
|
"withPatternOverrideControls"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/hooks/pattern-overrides.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { privateApis as patternsPrivateApis } from '@wordpress/patterns';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useBlockEditingMode } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { getBlockBindingsSource } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\n/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */\n\nconst {\n\tPatternOverridesControls,\n\tResetOverridesControl,\n\
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { privateApis as patternsPrivateApis } from '@wordpress/patterns';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useBlockEditingMode } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { getBlockBindingsSource } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\n/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */\n\nconst {\n\tPatternOverridesControls,\n\tResetOverridesControl,\n\tPATTERN_TYPES,\n\tPARTIAL_SYNCING_SUPPORTED_BLOCKS,\n\tPATTERN_SYNC_TYPES,\n} = unlock( patternsPrivateApis );\n\n/**\n * Override the default edit UI to include a new block inspector control for\n * assigning a partial syncing controls to supported blocks in the pattern editor.\n * Currently, only the `core/paragraph` block is supported.\n *\n * @param {Component} BlockEdit Original component.\n *\n * @return {Component} Wrapped component.\n */\nconst withPatternOverrideControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst isSupportedBlock =\n\t\t\t!! PARTIAL_SYNCING_SUPPORTED_BLOCKS[ props.name ];\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit key=\"edit\" { ...props } />\n\t\t\t\t{ props.isSelected && isSupportedBlock && (\n\t\t\t\t\t<ControlsWithStoreSubscription { ...props } />\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t},\n\t'withPatternOverrideControls'\n);\n\n// Split into a separate component to avoid a store subscription\n// on every block.\nfunction ControlsWithStoreSubscription( props ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst { hasPatternOverridesSource, isEditingSyncedPattern } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType, getEditedPostAttribute } =\n\t\t\t\tselect( editorStore );\n\n\t\t\treturn {\n\t\t\t\t// For editing link to the site editor if the theme and user permissions support it.\n\t\t\t\thasPatternOverridesSource: !! getBlockBindingsSource(\n\t\t\t\t\t'core/pattern-overrides'\n\t\t\t\t),\n\t\t\t\tisEditingSyncedPattern:\n\t\t\t\t\tgetCurrentPostType() === PATTERN_TYPES.user &&\n\t\t\t\t\tgetEditedPostAttribute( 'meta' )?.wp_pattern_sync_status !==\n\t\t\t\t\t\tPATTERN_SYNC_TYPES.unsynced &&\n\t\t\t\t\tgetEditedPostAttribute( 'wp_pattern_sync_status' ) !==\n\t\t\t\t\t\tPATTERN_SYNC_TYPES.unsynced,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst bindings = props.attributes.metadata?.bindings;\n\tconst hasPatternBindings =\n\t\t!! bindings &&\n\t\tObject.values( bindings ).some(\n\t\t\t( binding ) => binding.source === 'core/pattern-overrides'\n\t\t);\n\n\tconst shouldShowPatternOverridesControls =\n\t\tisEditingSyncedPattern && blockEditingMode === 'default';\n\tconst shouldShowResetOverridesControl =\n\t\t! isEditingSyncedPattern &&\n\t\t!! props.attributes.metadata?.name &&\n\t\tblockEditingMode !== 'disabled' &&\n\t\thasPatternBindings;\n\n\tif ( ! hasPatternOverridesSource ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ shouldShowPatternOverridesControls && (\n\t\t\t\t<PatternOverridesControls { ...props } />\n\t\t\t) }\n\t\t\t{ shouldShowResetOverridesControl && (\n\t\t\t\t<ResetOverridesControl { ...props } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/with-pattern-override-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AqB,cACrB;AAED,MAAK,CAAE,2BAA4B;AAClC,WAAO;AAAA,EACR;AAEA,SACC,4EACG;AAAA,0CACD,4CAAC,4BAA2B,GAAG,OAAQ;AAAA,IAEtC,mCACD,4CAAC,yBAAwB,GAAG,OAAQ;AAAA,KAEtC;AAEF;AAAA,IAEA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
|
|
6
6
|
"names": ["patternsPrivateApis", "editorStore"]
|
|
7
7
|
}
|
|
@@ -21,7 +21,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
22
|
mod
|
|
23
23
|
));
|
|
24
|
-
|
|
24
|
+
|
|
25
|
+
// packages/editor/src/hooks/push-changes-to-global-styles/index.js
|
|
25
26
|
var import_hooks = require("@wordpress/hooks");
|
|
26
27
|
var import_compose = require("@wordpress/compose");
|
|
27
28
|
var import_block_editor = require("@wordpress/block-editor");
|
|
@@ -35,12 +36,13 @@ var import_core_data = require("@wordpress/core-data");
|
|
|
35
36
|
var import_lock_unlock = require("../../lock-unlock");
|
|
36
37
|
var import_set_nested_value = __toESM(require("../../utils/set-nested-value"));
|
|
37
38
|
var import_hooks2 = require("../../components/global-styles/hooks");
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
|
+
var { cleanEmptyObject } = (0, import_lock_unlock.unlock)(import_block_editor.privateApis);
|
|
41
|
+
var STYLE_PROPERTY = {
|
|
40
42
|
...import_blocks.__EXPERIMENTAL_STYLE_PROPERTY,
|
|
41
43
|
blockGap: { value: ["spacing", "blockGap"] }
|
|
42
44
|
};
|
|
43
|
-
|
|
45
|
+
var STYLE_PATH_TO_CSS_VAR_INFIX = {
|
|
44
46
|
"border.color": "color",
|
|
45
47
|
"color.background": "color",
|
|
46
48
|
"color.text": "color",
|
|
@@ -87,7 +89,7 @@ const STYLE_PATH_TO_CSS_VAR_INFIX = {
|
|
|
87
89
|
"typography.fontSize": "font-size",
|
|
88
90
|
"typography.fontFamily": "font-family"
|
|
89
91
|
};
|
|
90
|
-
|
|
92
|
+
var STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {
|
|
91
93
|
"border.color": "borderColor",
|
|
92
94
|
"color.background": "backgroundColor",
|
|
93
95
|
"color.text": "textColor",
|
|
@@ -95,16 +97,16 @@ const STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {
|
|
|
95
97
|
"typography.fontSize": "fontSize",
|
|
96
98
|
"typography.fontFamily": "fontFamily"
|
|
97
99
|
};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
+
var SUPPORTED_STYLES = ["border", "color", "spacing", "typography"];
|
|
101
|
+
var getValueFromObjectPath = (object, path) => {
|
|
100
102
|
let value = object;
|
|
101
103
|
path.forEach((fieldName) => {
|
|
102
104
|
value = value?.[fieldName];
|
|
103
105
|
});
|
|
104
106
|
return value;
|
|
105
107
|
};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
var flatBorderProperties = ["borderColor", "borderWidth", "borderStyle"];
|
|
109
|
+
var sides = ["top", "right", "bottom", "left"];
|
|
108
110
|
function getBorderStyleChanges(border, presetColor, userStyle) {
|
|
109
111
|
if (!border && !presetColor) {
|
|
110
112
|
return [];
|
|
@@ -308,7 +310,7 @@ function PushChangesToGlobalStyles(props) {
|
|
|
308
310
|
}
|
|
309
311
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.InspectorAdvancedControls, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PushChangesToGlobalStylesControl, { ...props }) });
|
|
310
312
|
}
|
|
311
|
-
|
|
313
|
+
var withPushChangesToGlobalStyles = (0, import_compose.createHigherOrderComponent)(
|
|
312
314
|
(BlockEdit) => (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
313
315
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BlockEdit, { ...props }, "edit"),
|
|
314
316
|
props.isSelected && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PushChangesToGlobalStyles, { ...props })
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hooks/push-changes-to-global-styles/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport {\n\tInspectorAdvancedControls,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { BaseControl, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__EXPERIMENTAL_STYLE_PROPERTY,\n\tgetBlockType,\n\thasBlockSupport,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport setNestedValue from '../../utils/set-nested-value';\nimport { useGlobalStyles } from '../../components/global-styles/hooks';\n\nconst { cleanEmptyObject } = unlock( blockEditorPrivateApis );\n\n// Block Gap is a special case and isn't defined within the blocks\n// style properties config. We'll add it here to allow it to be pushed\n// to global styles as well.\nconst STYLE_PROPERTY = {\n\t...__EXPERIMENTAL_STYLE_PROPERTY,\n\tblockGap: { value: [ 'spacing', 'blockGap' ] },\n};\n\n// TODO: Temporary duplication of constant in @wordpress/block-editor. Can be\n// removed by moving PushChangesToGlobalStylesControl to\n// @wordpress/block-editor.\nconst STYLE_PATH_TO_CSS_VAR_INFIX = {\n\t'border.color': 'color',\n\t'color.background': 'color',\n\t'color.text': 'color',\n\t'elements.link.color.text': 'color',\n\t'elements.link.:hover.color.text': 'color',\n\t'elements.link.typography.fontFamily': 'font-family',\n\t'elements.link.typography.fontSize': 'font-size',\n\t'elements.button.color.text': 'color',\n\t'elements.button.color.background': 'color',\n\t'elements.button.typography.fontFamily': 'font-family',\n\t'elements.button.typography.fontSize': 'font-size',\n\t'elements.caption.color.text': 'color',\n\t'elements.heading.color': 'color',\n\t'elements.heading.color.background': 'color',\n\t'elements.heading.typography.fontFamily': 'font-family',\n\t'elements.heading.gradient': 'gradient',\n\t'elements.heading.color.gradient': 'gradient',\n\t'elements.h1.color': 'color',\n\t'elements.h1.color.background': 'color',\n\t'elements.h1.typography.fontFamily': 'font-family',\n\t'elements.h1.color.gradient': 'gradient',\n\t'elements.h2.color': 'color',\n\t'elements.h2.color.background': 'color',\n\t'elements.h2.typography.fontFamily': 'font-family',\n\t'elements.h2.color.gradient': 'gradient',\n\t'elements.h3.color': 'color',\n\t'elements.h3.color.background': 'color',\n\t'elements.h3.typography.fontFamily': 'font-family',\n\t'elements.h3.color.gradient': 'gradient',\n\t'elements.h4.color': 'color',\n\t'elements.h4.color.background': 'color',\n\t'elements.h4.typography.fontFamily': 'font-family',\n\t'elements.h4.color.gradient': 'gradient',\n\t'elements.h5.color': 'color',\n\t'elements.h5.color.background': 'color',\n\t'elements.h5.typography.fontFamily': 'font-family',\n\t'elements.h5.color.gradient': 'gradient',\n\t'elements.h6.color': 'color',\n\t'elements.h6.color.background': 'color',\n\t'elements.h6.typography.fontFamily': 'font-family',\n\t'elements.h6.color.gradient': 'gradient',\n\t'color.gradient': 'gradient',\n\tblockGap: 'spacing',\n\t'typography.fontSize': 'font-size',\n\t'typography.fontFamily': 'font-family',\n};\n\n// TODO: Temporary duplication of constant in @wordpress/block-editor. Can be\n// removed by moving PushChangesToGlobalStylesControl to\n// @wordpress/block-editor.\nconst STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {\n\t'border.color': 'borderColor',\n\t'color.background': 'backgroundColor',\n\t'color.text': 'textColor',\n\t'color.gradient': 'gradient',\n\t'typography.fontSize': 'fontSize',\n\t'typography.fontFamily': 'fontFamily',\n};\n\nconst SUPPORTED_STYLES = [ 'border', 'color', 'spacing', 'typography' ];\n\nconst getValueFromObjectPath = ( object, path ) => {\n\tlet value = object;\n\tpath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\n};\n\nconst flatBorderProperties = [ 'borderColor', 'borderWidth', 'borderStyle' ];\nconst sides = [ 'top', 'right', 'bottom', 'left' ];\n\nfunction getBorderStyleChanges( border, presetColor, userStyle ) {\n\tif ( ! border && ! presetColor ) {\n\t\treturn [];\n\t}\n\n\tconst changes = [\n\t\t...getFallbackBorderStyleChange( 'top', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'right', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'bottom', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'left', border, userStyle ),\n\t];\n\n\t// Handle a flat border i.e. all sides the same, CSS shorthand.\n\tconst { color: customColor, style, width } = border || {};\n\tconst hasColorOrWidth = presetColor || customColor || width;\n\n\tif ( hasColorOrWidth && ! style ) {\n\t\t// Global Styles need individual side configurations to overcome\n\t\t// theme.json configurations which are per side as well.\n\t\tsides.forEach( ( side ) => {\n\t\t\t// Only add fallback border-style if global styles don't already\n\t\t\t// have something set.\n\t\t\tif ( ! userStyle?.[ side ]?.style ) {\n\t\t\t\tchanges.push( {\n\t\t\t\t\tpath: [ 'border', side, 'style' ],\n\t\t\t\t\tvalue: 'solid',\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t}\n\n\treturn changes;\n}\n\nfunction getFallbackBorderStyleChange( side, border, globalBorderStyle ) {\n\tif ( ! border?.[ side ] || globalBorderStyle?.[ side ]?.style ) {\n\t\treturn [];\n\t}\n\n\tconst { color, style, width } = border[ side ];\n\tconst hasColorOrWidth = color || width;\n\n\tif ( ! hasColorOrWidth || style ) {\n\t\treturn [];\n\t}\n\n\treturn [ { path: [ 'border', side, 'style' ], value: 'solid' } ];\n}\n\nfunction useChangesToPush( name, attributes, userConfig ) {\n\tconst supports = useSelect(\n\t\t( select ) => {\n\t\t\treturn unlock( select( blocksStore ) ).getSupportedStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\tconst blockUserConfig = userConfig?.styles?.blocks?.[ name ];\n\n\treturn useMemo( () => {\n\t\tconst changes = supports.flatMap( ( key ) => {\n\t\t\tif ( ! STYLE_PROPERTY[ key ] ) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst { value: path } = STYLE_PROPERTY[ key ];\n\t\t\tconst presetAttributeKey = path.join( '.' );\n\t\t\tconst presetAttributeValue =\n\t\t\t\tattributes[\n\t\t\t\t\tSTYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE[ presetAttributeKey ]\n\t\t\t\t];\n\t\t\tconst value = presetAttributeValue\n\t\t\t\t? `var:preset|${ STYLE_PATH_TO_CSS_VAR_INFIX[ presetAttributeKey ] }|${ presetAttributeValue }`\n\t\t\t\t: getValueFromObjectPath( attributes.style, path );\n\n\t\t\t// Links only have a single support entry but have two element\n\t\t\t// style properties, color and hover color. The following check\n\t\t\t// will add the hover color to the changes if required.\n\t\t\tif ( key === 'linkColor' ) {\n\t\t\t\tconst linkChanges = value ? [ { path, value } ] : [];\n\t\t\t\tconst hoverPath = [\n\t\t\t\t\t'elements',\n\t\t\t\t\t'link',\n\t\t\t\t\t':hover',\n\t\t\t\t\t'color',\n\t\t\t\t\t'text',\n\t\t\t\t];\n\t\t\t\tconst hoverValue = getValueFromObjectPath(\n\t\t\t\t\tattributes.style,\n\t\t\t\t\thoverPath\n\t\t\t\t);\n\n\t\t\t\tif ( hoverValue ) {\n\t\t\t\t\tlinkChanges.push( { path: hoverPath, value: hoverValue } );\n\t\t\t\t}\n\n\t\t\t\treturn linkChanges;\n\t\t\t}\n\n\t\t\t// The shorthand border styles can't be mapped directly as global\n\t\t\t// styles requires longhand config.\n\t\t\tif ( flatBorderProperties.includes( key ) && value ) {\n\t\t\t\t// The shorthand config path is included to clear the block attribute.\n\t\t\t\tconst borderChanges = [ { path, value } ];\n\t\t\t\tsides.forEach( ( side ) => {\n\t\t\t\t\tconst currentPath = [ ...path ];\n\t\t\t\t\tcurrentPath.splice( -1, 0, side );\n\t\t\t\t\tborderChanges.push( { path: currentPath, value } );\n\t\t\t\t} );\n\t\t\t\treturn borderChanges;\n\t\t\t}\n\n\t\t\treturn value ? [ { path, value } ] : [];\n\t\t} );\n\n\t\t// To ensure display of a visible border, global styles require a\n\t\t// default border style if a border color or width is present.\n\t\tgetBorderStyleChanges(\n\t\t\tattributes.style?.border,\n\t\t\tattributes.borderColor,\n\t\t\tblockUserConfig?.border\n\t\t).forEach( ( change ) => changes.push( change ) );\n\n\t\treturn changes;\n\t}, [ supports, attributes, blockUserConfig ] );\n}\n\nfunction PushChangesToGlobalStylesControl( {\n\tname,\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst { user: userConfig, setUser: setUserConfig } = useGlobalStyles();\n\n\tconst changes = useChangesToPush( name, attributes, userConfig );\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst pushChanges = useCallback( () => {\n\t\tif ( changes.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( changes.length > 0 ) {\n\t\t\tconst { style: blockStyles } = attributes;\n\n\t\t\tconst newBlockStyles = structuredClone( blockStyles );\n\t\t\tconst newUserConfig = structuredClone( userConfig );\n\n\t\t\tfor ( const { path, value } of changes ) {\n\t\t\t\tsetNestedValue( newBlockStyles, path, undefined );\n\t\t\t\tsetNestedValue(\n\t\t\t\t\tnewUserConfig,\n\t\t\t\t\t[ 'styles', 'blocks', name, ...path ],\n\t\t\t\t\tvalue\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst newBlockAttributes = {\n\t\t\t\tborderColor: undefined,\n\t\t\t\tbackgroundColor: undefined,\n\t\t\t\ttextColor: undefined,\n\t\t\t\tgradient: undefined,\n\t\t\t\tfontSize: undefined,\n\t\t\t\tfontFamily: undefined,\n\t\t\t\tstyle: cleanEmptyObject( newBlockStyles ),\n\t\t\t};\n\n\t\t\t// @wordpress/core-data doesn't support editing multiple entity types in\n\t\t\t// a single undo level. So for now, we disable @wordpress/core-data undo\n\t\t\t// tracking and implement our own Undo button in the snackbar\n\t\t\t// notification.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( newBlockAttributes );\n\t\t\tsetUserConfig( newUserConfig, { undoIgnore: true } );\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t\t__( '%s styles applied.' ),\n\t\t\t\t\tgetBlockType( name ).title\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick() {\n\t\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tsetAttributes( attributes );\n\t\t\t\t\t\t\t\tsetUserConfig( userConfig, {\n\t\t\t\t\t\t\t\t\tundoIgnore: true,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}, [\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tattributes,\n\t\tchanges,\n\t\tcreateSuccessNotice,\n\t\tname,\n\t\tsetAttributes,\n\t\tsetUserConfig,\n\t\tuserConfig,\n\t] );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tclassName=\"editor-push-changes-to-global-styles-control\"\n\t\t\thelp={ sprintf(\n\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t__(\n\t\t\t\t\t'Apply this block\u2019s typography, spacing, dimensions, and color styles to all %s blocks.'\n\t\t\t\t),\n\t\t\t\tgetBlockType( name ).title\n\t\t\t) }\n\t\t>\n\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t{ __( 'Styles' ) }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\taccessibleWhenDisabled\n\t\t\t\tdisabled={ changes.length === 0 }\n\t\t\t\tonClick={ pushChanges }\n\t\t\t>\n\t\t\t\t{ __( 'Apply globally' ) }\n\t\t\t</Button>\n\t\t</BaseControl>\n\t);\n}\n\nfunction PushChangesToGlobalStyles( props ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst isBlockBasedTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t[]\n\t);\n\tconst supportsStyles = SUPPORTED_STYLES.some( ( feature ) =>\n\t\thasBlockSupport( props.name, feature )\n\t);\n\tconst isDisplayed =\n\t\tblockEditingMode === 'default' && supportsStyles && isBlockBasedTheme;\n\n\tif ( ! isDisplayed ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<InspectorAdvancedControls>\n\t\t\t<PushChangesToGlobalStylesControl { ...props } />\n\t\t</InspectorAdvancedControls>\n\t);\n}\n\nconst withPushChangesToGlobalStyles = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => (\n\t\t<>\n\t\t\t<BlockEdit key=\"edit\" { ...props } />\n\t\t\t{ props.isSelected && <PushChangesToGlobalStyles { ...props } /> }\n\t\t</>\n\t)\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/push-changes-to-global-styles',\n\twithPushChangesToGlobalStyles\n);\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAGA,mBAA0B;AAC1B,qBAA2C;AAC3C,0BA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SAAS,0BAA2B,OAAQ;AAC3C,QAAM,uBAAmB,yCAAoB;AAC7C,QAAM,wBAAoB;AAAA,IACzB,CAAE,WAAY,OAAQ,iBAAAC,KAAU,EAAE,gBAAgB,GAAG;AAAA,IACrD,CAAC;AAAA,EACF;AACA,QAAM,iBAAiB,iBAAiB;AAAA,IAAM,CAAE,gBAC/C,+BAAiB,MAAM,MAAM,OAAQ;AAAA,EACtC;AACA,QAAM,cACL,qBAAqB,aAAa,kBAAkB;AAErD,MAAK,CAAE,aAAc;AACpB,WAAO;AAAA,EACR;AAEA,SACC,4CAAC,iDACA,sDAAC,oCAAmC,GAAG,OAAQ,GAChD;AAEF;AAEA,IAAM,oCAAgC;AAAA,EACrC,CAAE,cAAe,CAAE,UAClB,4EACC;AAAA,gDAAC,aAAuB,GAAG,SAAZ,MAAoB;AAAA,IACjC,MAAM,cAAc,4CAAC,6BAA4B,GAAG,OAAQ;AAAA,KAC/D;AAEF;AAAA,IAEA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
|
|
6
6
|
"names": ["import_hooks", "blockEditorPrivateApis", "blocksStore", "blockEditorStore", "noticesStore", "setNestedValue", "coreStore"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
// packages/editor/src/hooks/template-part-navigation-edit-button.js
|
|
3
4
|
var import_hooks = require("@wordpress/hooks");
|
|
4
5
|
var import_compose = require("@wordpress/compose");
|
|
5
6
|
var import_element = require("@wordpress/element");
|
|
@@ -8,9 +9,10 @@ var import_block_editor = require("@wordpress/block-editor");
|
|
|
8
9
|
var import_components = require("@wordpress/components");
|
|
9
10
|
var import_data = require("@wordpress/data");
|
|
10
11
|
var import_interface = require("@wordpress/interface");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
13
|
+
var NAVIGATION_BLOCK_NAME = "core/navigation";
|
|
14
|
+
var TEMPLATE_PART_BLOCK_NAME = "core/template-part";
|
|
15
|
+
var BLOCK_INSPECTOR_AREA = "edit-post/block";
|
|
14
16
|
function TemplatePartNavigationEditButton({ clientId }) {
|
|
15
17
|
const { selectBlock, flashBlock } = (0, import_data.useDispatch)(import_block_editor.store);
|
|
16
18
|
const { enableComplementaryArea } = (0, import_data.useDispatch)(import_interface.store);
|
|
@@ -68,7 +70,7 @@ function TemplatePartNavigationEditButton({ clientId }) {
|
|
|
68
70
|
)
|
|
69
71
|
] }) });
|
|
70
72
|
}
|
|
71
|
-
|
|
73
|
+
var withTemplatePartNavigationEditButton = (0, import_compose.createHigherOrderComponent)(
|
|
72
74
|
(BlockEdit) => (props) => {
|
|
73
75
|
const isTemplatePart = props.name === TEMPLATE_PART_BLOCK_NAME;
|
|
74
76
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/hooks/template-part-navigation-edit-button.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useCallback } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tToolbarButton,\n\tToolbarGroup,\n\t__experimentalDivider as Divider,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n// Block name constants\nconst NAVIGATION_BLOCK_NAME = 'core/navigation';\nconst TEMPLATE_PART_BLOCK_NAME = 'core/template-part';\n\n// Complementary area identifier for the block inspector\nconst BLOCK_INSPECTOR_AREA = 'edit-post/block';\n\n/**\n * Component that renders the \"Edit navigation\" button for template parts\n * that contain navigation blocks.\n *\n * @param {Object} props Component props.\n * @param {string} props.clientId The template part block client ID.\n * @return {JSX.Element|null} The Edit navigation button component or null if not applicable.\n */\nfunction TemplatePartNavigationEditButton( { clientId } ) {\n\tconst { selectBlock, flashBlock } = useDispatch( blockEditorStore );\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\tconst {\n\t\thasNavigationBlocks,\n\t\tfirstNavigationBlockId,\n\t\tisNavigationEditable,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetClientIdsOfDescendants,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst descendants = getClientIdsOfDescendants( clientId );\n\t\t\tconst navigationBlocksInTemplatePart = descendants.filter(\n\t\t\t\t( blockId ) => getBlockName( blockId ) === NAVIGATION_BLOCK_NAME\n\t\t\t);\n\n\t\t\tconst _hasNavigationBlocks =\n\t\t\t\tnavigationBlocksInTemplatePart.length > 0;\n\t\t\tconst _firstNavigationBlockId = _hasNavigationBlocks\n\t\t\t\t? navigationBlocksInTemplatePart[ 0 ]\n\t\t\t\t: null;\n\n\t\t\treturn {\n\t\t\t\thasNavigationBlocks: _hasNavigationBlocks,\n\t\t\t\tfirstNavigationBlockId: _firstNavigationBlockId,\n\t\t\t\t// We can't use the useBlockEditingMode hook here because the current\n\t\t\t\t// context is the template part, not the navigation block.\n\t\t\t\tisNavigationEditable:\n\t\t\t\t\tgetBlockEditingMode( _firstNavigationBlockId ) !==\n\t\t\t\t\t'disabled',\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst onEditNavigation = useCallback( () => {\n\t\tif ( firstNavigationBlockId ) {\n\t\t\t// Select the first Navigation block\n\t\t\tselectBlock( firstNavigationBlockId );\n\n\t\t\t// Flash the block for 500ms to make it obvious\n\t\t\tflashBlock( firstNavigationBlockId, 500 );\n\n\t\t\t// Enable the complementary area (inspector)\n\t\t\tenableComplementaryArea( 'core', BLOCK_INSPECTOR_AREA );\n\t\t}\n\t}, [\n\t\tfirstNavigationBlockId,\n\t\tselectBlock,\n\t\tflashBlock,\n\t\tenableComplementaryArea,\n\t] );\n\n\t// Only show if template part contains navigation blocks and they are editable\n\tif ( ! hasNavigationBlocks || ! isNavigationEditable ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockControls group=\"other\">\n\t\t\t<ToolbarGroup>\n\t\t\t\t{ /*\n\t\t\t\t * Add a vertical divider to visually separate the \"Edit navigation\"\n\t\t\t\t * button from the template part's \"Edit\" button. Both buttons share\n\t\t\t\t * the same toolbar group (\"other\"), so without this divider they\n\t\t\t\t * would appear directly adjacent with no visual separation.\n\t\t\t\t */ }\n\t\t\t\t<Divider orientation=\"vertical\" marginEnd={ 3 } />\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tlabel={ __( 'Edit navigation' ) }\n\t\t\t\t\tonClick={ onEditNavigation }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Edit navigation' ) }\n\t\t\t\t</ToolbarButton>\n\t\t\t</ToolbarGroup>\n\t\t</BlockControls>\n\t);\n}\n\n/**\n * Higher-order component that adds the Edit navigation button to template part blocks.\n */\nconst withTemplatePartNavigationEditButton = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst isTemplatePart = props.name === TEMPLATE_PART_BLOCK_NAME;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit key=\"edit\" { ...props } />\n\t\t\t\t{ props.isSelected && isTemplatePart && (\n\t\t\t\t\t<TemplatePartNavigationEditButton\n\t\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t},\n\t'withTemplatePartNavigationEditButton'\n);\n\n// Register the filter.\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/with-template-part-navigation-edit-button',\n\twithTemplatePartNavigationEditButton\n);\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;AAGA,mBAA0B;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Q,aAAY,YAAW,WAAY,GAAI;AAAA,IAChD;AAAA,MAAC;AAAA;AAAA,QACA,WAAQ,gBAAI,iBAAkB;AAAA,QAC9B,SAAU;AAAA,QAER,8BAAI,iBAAkB;AAAA;AAAA,IACzB;AAAA,KACD,GACD;AAEF;AAKA,IAAM,2CAAuC;AAAA,EAC5C,CAAE,cAAe,CAAE,UAAW;AAC7B,UAAM,iBAAiB,MAAM,SAAS;AAEtC,WACC,4EACC;AAAA,kDAAC,aAAuB,GAAG,SAAZ,MAAoB;AAAA,MACjC,MAAM,cAAc,kBACrB;AAAA,QAAC;AAAA;AAAA,UACA,UAAW,MAAM;AAAA;AAAA,MAClB;AAAA,OAEF;AAAA,EAEF;AAAA,EACA;AACD;AAAA,IAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
|
|
6
6
|
"names": ["blockEditorStore", "interfaceStore", "Divider"]
|
|
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/hooks/use-global-styles-output.js
|
|
19
21
|
var use_global_styles_output_exports = {};
|
|
20
22
|
__export(use_global_styles_output_exports, {
|
|
21
23
|
useGlobalStylesOutput: () => useGlobalStylesOutput,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/hooks/use-global-styles-output.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getBlockTypes, store as blocksStore } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { generateGlobalStyles } from '@wordpress/global-styles-engine';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\nimport { useSetting, useGlobalStyles } from '../components/global-styles';\n\n/**\n * Returns the global styles output based on the provided global styles config.\n *\n * @param {Object} mergedConfig The merged global styles config.\n * @param {boolean} disableRootPadding Disable root padding styles.\n *\n * @return {Array} Array of stylesheets and settings.\n */\nexport function useGlobalStylesOutputWithConfig(\n\tmergedConfig = {},\n\tdisableRootPadding = false\n) {\n\tconst blockGap = useSetting( 'spacing.blockGap' );\n\tconst hasBlockGapSupport = blockGap !== null;\n\tconst hasFallbackGapSupport = ! hasBlockGapSupport;\n\n\tconst { disableLayoutStyles, getBlockStyles } = useSelect( ( select ) => {\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst { getBlockStyles: getBlockStylesSelector } =\n\t\t\tselect( blocksStore );\n\t\tconst settings = getEditorSettings();\n\t\treturn {\n\t\t\tdisableLayoutStyles: !! settings?.disableLayoutStyles,\n\t\t\tgetBlockStyles: getBlockStylesSelector,\n\t\t};\n\t}, [] );\n\n\treturn useMemo( () => {\n\t\tif ( ! mergedConfig?.styles || ! mergedConfig?.settings ) {\n\t\t\treturn [ [], {} ];\n\t\t}\n\n\t\tconst blockTypes = getBlockTypes();\n\n\t\treturn generateGlobalStyles( mergedConfig, blockTypes, {\n\t\t\thasBlockGapSupport,\n\t\t\thasFallbackGapSupport,\n\t\t\tdisableLayoutStyles,\n\t\t\tdisableRootPadding,\n\t\t\tgetBlockStyles,\n\t\t} );\n\t}, [\n\t\thasBlockGapSupport,\n\t\thasFallbackGapSupport,\n\t\tmergedConfig,\n\t\tdisableLayoutStyles,\n\t\tdisableRootPadding,\n\t\tgetBlockStyles,\n\t] );\n}\n\n/**\n * Returns the global styles output based on the current state of global styles config loaded in the editor context.\n *\n * @param {boolean} disableRootPadding Disable root padding styles.\n *\n * @return {Array} Array of stylesheets and settings.\n */\nexport function useGlobalStylesOutput( disableRootPadding = false ) {\n\tconst { merged: mergedConfig } = useGlobalStyles();\n\treturn useGlobalStylesOutputWithConfig( mergedConfig, disableRootPadding );\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAoD;AACpD,kBAA0B;AAC1B,qBAAwB;AACxB,kCAAqC;AAKrC,mBAAqC;AACrC,2BAA4C;AAUrC,SAAS,gCACf,eAAe,CAAC,GAChB,qBAAqB,OACpB;AACD,QAAM,eAAW,iCAAY,kBAAmB;AAChD,QAAM,qBAAqB,aAAa;AACxC,QAAM,wBAAwB,CAAE;AAEhC,QAAM,EAAE,qBAAqB,eAAe,QAAI,uBAAW,CAAE,WAAY;AACxE,UAAM,EAAE,kBAAkB,IAAI,OAAQ,aAAAA,KAAY;AAClD,UAAM,EAAE,gBAAgB,uBAAuB,IAC9C,OAAQ,cAAAC,KAAY;AACrB,UAAM,WAAW,kBAAkB;AACnC,WAAO;AAAA,MACN,qBAAqB,CAAC,CAAE,UAAU;AAAA,MAClC,gBAAgB;AAAA,IACjB;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,aAAO,wBAAS,MAAM;AACrB,QAAK,CAAE,cAAc,UAAU,CAAE,cAAc,UAAW;AACzD,aAAO,CAAE,CAAC,GAAG,CAAC,CAAE;AAAA,IACjB;AAEA,UAAM,iBAAa,6BAAc;AAEjC,eAAO,kDAAsB,cAAc,YAAY;AAAA,MACtD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,CAAE;AAAA,EACH,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACH;AASO,SAAS,sBAAuB,qBAAqB,OAAQ;AACnE,QAAM,EAAE,QAAQ,aAAa,QAAI,sCAAgB;AACjD,SAAO,gCAAiC,cAAc,kBAAmB;AAC1E;",
|
|
6
6
|
"names": ["editorStore", "blocksStore"]
|
|
7
7
|
}
|
package/build/index.js
CHANGED
|
@@ -17,6 +17,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// packages/editor/src/index.js
|
|
20
22
|
var index_exports = {};
|
|
21
23
|
__export(index_exports, {
|
|
22
24
|
store: () => import_store.store,
|
package/build/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport './hooks';\n\nexport { storeConfig, store } from './store';\nexport * from './components';\nexport * from './utils';\nexport * from './private-apis';\nexport * from './dataviews/api';\n\n/*\n * Backward compatibility\n */\nexport { transformStyles } from '@wordpress/block-editor';\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAAO;AAEP,mBAAmC;AACnC,0BAAc,yBANd;AAOA,0BAAc,oBAPd;AAQA,0BAAc,2BARd;AASA,0BAAc,4BATd;AAcA,0BAAgC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/lock-unlock.js
CHANGED
|
@@ -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/lock-unlock.js
|
|
19
21
|
var lock_unlock_exports = {};
|
|
20
22
|
__export(lock_unlock_exports, {
|
|
21
23
|
lock: () => lock,
|
|
@@ -23,7 +25,7 @@ __export(lock_unlock_exports, {
|
|
|
23
25
|
});
|
|
24
26
|
module.exports = __toCommonJS(lock_unlock_exports);
|
|
25
27
|
var import_private_apis = require("@wordpress/private-apis");
|
|
26
|
-
|
|
28
|
+
var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
|
|
27
29
|
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
|
|
28
30
|
"@wordpress/editor"
|
|
29
31
|
);
|
package/build/lock-unlock.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/lock-unlock.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/editor'\n\t);\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAAiE;AAC1D,IAAM,EAAE,MAAM,OAAO,QAC3B;AAAA,EACC;AAAA,EACA;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|