@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/utils/pageTypeBadge.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Custom hook to get the page type badge for the current post on edit site view.\n *\n * @param {number|string} postId postId of the current post being edited.\n */\nexport default function usePageTypeBadge( postId ) {\n\tconst { isFrontPage, isPostsPage } = useSelect( ( select ) => {\n\t\tconst { canUser, getEditedEntityRecord } = select( coreStore );\n\t\tconst siteSettings = canUser( 'read', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} )\n\t\t\t? getEditedEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\n\t\tconst _postId = parseInt( postId, 10 );\n\n\t\treturn {\n\t\t\tisFrontPage: siteSettings?.page_on_front === _postId,\n\t\t\tisPostsPage: siteSettings?.page_for_posts === _postId,\n\t\t};\n\t} );\n\n\tif ( isFrontPage ) {\n\t\treturn __( 'Homepage' );\n\t} else if ( isPostsPage ) {\n\t\treturn __( 'Posts Page' );\n\t}\n\n\treturn false;\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,kBAA0B;AAC1B,uBAAmC;AAOpB,SAAR,iBAAmC,QAAS;AAClD,QAAM,EAAE,aAAa,YAAY,QAAI,uBAAW,CAAE,WAAY;AAC7D,UAAM,EAAE,SAAS,sBAAsB,IAAI,OAAQ,iBAAAA,KAAU;AAC7D,UAAM,eAAe,QAAS,QAAQ;AAAA,MACrC,MAAM;AAAA,MACN,MAAM;AAAA,IACP,CAAE,IACC,sBAAuB,QAAQ,MAAO,IACtC;AAEH,UAAM,UAAU,SAAU,QAAQ,EAAG;AAErC,WAAO;AAAA,MACN,aAAa,cAAc,kBAAkB;AAAA,MAC7C,aAAa,cAAc,mBAAmB;AAAA,IAC/C;AAAA,EACD,CAAE;AAEF,MAAK,aAAc;AAClB,eAAO,gBAAI,UAAW;AAAA,EACvB,WAAY,aAAc;AACzB,eAAO,gBAAI,YAAa;AAAA,EACzB;AAEA,SAAO;AACR;",
|
|
6
6
|
"names": ["coreStore"]
|
|
7
7
|
}
|
|
@@ -26,6 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/editor/src/utils/search-templates.js
|
|
29
31
|
var search_templates_exports = {};
|
|
30
32
|
__export(search_templates_exports, {
|
|
31
33
|
searchTemplates: () => searchTemplates
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/search-templates.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * Sanitizes the search input string.\n *\n * @param {string} input The search input to normalize.\n *\n * @return {string} The normalized search input.\n */\nfunction normalizeSearchInput( input = '' ) {\n\t// Disregard diacritics.\n\tinput = removeAccents( input );\n\n\t// Trim & Lowercase.\n\tinput = input.trim().toLowerCase();\n\n\treturn input;\n}\n\n/**\n * Get the search rank for a given template and a specific search term.\n *\n * @param {Object} template Template to rank\n * @param {string} searchValue Search term\n *\n * @return {number} A template search rank\n */\nfunction getTemplateSearchRank( template, searchValue ) {\n\tconst normalizedSearchValue = normalizeSearchInput( searchValue );\n\tconst normalizedTitle = normalizeSearchInput( template.title );\n\n\tlet rank = 0;\n\n\tif ( normalizedSearchValue === normalizedTitle ) {\n\t\trank += 30;\n\t} else if ( normalizedTitle.startsWith( normalizedSearchValue ) ) {\n\t\trank += 20;\n\t} else {\n\t\tconst searchTerms = normalizedSearchValue.split( ' ' );\n\t\tconst hasMatchedTerms = searchTerms.every( ( searchTerm ) =>\n\t\t\tnormalizedTitle.includes( searchTerm )\n\t\t);\n\n\t\t// Prefer template with every search word in the title.\n\t\tif ( hasMatchedTerms ) {\n\t\t\trank += 10;\n\t\t}\n\t}\n\n\treturn rank;\n}\n\n/**\n * Filters a template list given a search term.\n *\n * @param {Array} templates Item list\n * @param {string} searchValue Search input.\n *\n * @return {Array} Filtered template list.\n */\nexport function searchTemplates( templates = [], searchValue = '' ) {\n\tif ( ! searchValue ) {\n\t\treturn templates;\n\t}\n\n\tconst rankedTemplates = templates\n\t\t.map( ( template ) => {\n\t\t\treturn [ template, getTemplateSearchRank( template, searchValue ) ];\n\t\t} )\n\t\t.filter( ( [ , rank ] ) => rank > 0 );\n\n\trankedTemplates.sort( ( [ , rank1 ], [ , rank2 ] ) => rank2 - rank1 );\n\treturn rankedTemplates.map( ( [ template ] ) => template );\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,4BAA0B;AAS1B,SAAS,qBAAsB,QAAQ,IAAK;AAE3C,cAAQ,sBAAAA,SAAe,KAAM;AAG7B,UAAQ,MAAM,KAAK,EAAE,YAAY;AAEjC,SAAO;AACR;AAUA,SAAS,sBAAuB,UAAU,aAAc;AACvD,QAAM,wBAAwB,qBAAsB,WAAY;AAChE,QAAM,kBAAkB,qBAAsB,SAAS,KAAM;AAE7D,MAAI,OAAO;AAEX,MAAK,0BAA0B,iBAAkB;AAChD,YAAQ;AAAA,EACT,WAAY,gBAAgB,WAAY,qBAAsB,GAAI;AACjE,YAAQ;AAAA,EACT,OAAO;AACN,UAAM,cAAc,sBAAsB,MAAO,GAAI;AACrD,UAAM,kBAAkB,YAAY;AAAA,MAAO,CAAE,eAC5C,gBAAgB,SAAU,UAAW;AAAA,IACtC;AAGA,QAAK,iBAAkB;AACtB,cAAQ;AAAA,IACT;AAAA,EACD;AAEA,SAAO;AACR;AAUO,SAAS,gBAAiB,YAAY,CAAC,GAAG,cAAc,IAAK;AACnE,MAAK,CAAE,aAAc;AACpB,WAAO;AAAA,EACR;AAEA,QAAM,kBAAkB,UACtB,IAAK,CAAE,aAAc;AACrB,WAAO,CAAE,UAAU,sBAAuB,UAAU,WAAY,CAAE;AAAA,EACnE,CAAE,EACD,OAAQ,CAAE,CAAE,EAAE,IAAK,MAAO,OAAO,CAAE;AAErC,kBAAgB,KAAM,CAAE,CAAE,EAAE,KAAM,GAAG,CAAE,EAAE,KAAM,MAAO,QAAQ,KAAM;AACpE,SAAO,gBAAgB,IAAK,CAAE,CAAE,QAAS,MAAO,QAAS;AAC1D;",
|
|
6
6
|
"names": ["removeAccents"]
|
|
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/utils/set-nested-value.js
|
|
19
21
|
var set_nested_value_exports = {};
|
|
20
22
|
__export(set_nested_value_exports, {
|
|
21
23
|
default: () => setNestedValue
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/set-nested-value.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * Sets the value at path of object.\n * If a portion of path doesn\u2019t exist, it\u2019s created.\n * Arrays are created for missing index properties while objects are created\n * for all other missing properties.\n *\n * This function intentionally mutates the input object.\n *\n * Inspired by _.set().\n *\n * @see https://lodash.com/docs/4.17.15#set\n *\n * @todo Needs to be deduplicated with its copy in `@wordpress/core-data`.\n *\n * @param {Object} object Object to modify\n * @param {Array} path Path of the property to set.\n * @param {*} value Value to set.\n */\nexport default function setNestedValue( object, path, value ) {\n\tif ( ! object || typeof object !== 'object' ) {\n\t\treturn object;\n\t}\n\n\tpath.reduce( ( acc, key, idx ) => {\n\t\tif ( acc[ key ] === undefined ) {\n\t\t\tif ( Number.isInteger( path[ idx + 1 ] ) ) {\n\t\t\t\tacc[ key ] = [];\n\t\t\t} else {\n\t\t\t\tacc[ key ] = {};\n\t\t\t}\n\t\t}\n\t\tif ( idx === path.length - 1 ) {\n\t\t\tacc[ key ] = value;\n\t\t}\n\t\treturn acc[ key ];\n\t}, object );\n\n\treturn object;\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBe,SAAR,eAAiC,QAAQ,MAAM,OAAQ;AAC7D,MAAK,CAAE,UAAU,OAAO,WAAW,UAAW;AAC7C,WAAO;AAAA,EACR;AAEA,OAAK,OAAQ,CAAE,KAAK,KAAK,QAAS;AACjC,QAAK,IAAK,GAAI,MAAM,QAAY;AAC/B,UAAK,OAAO,UAAW,KAAM,MAAM,CAAE,CAAE,GAAI;AAC1C,YAAK,GAAI,IAAI,CAAC;AAAA,MACf,OAAO;AACN,YAAK,GAAI,IAAI,CAAC;AAAA,MACf;AAAA,IACD;AACA,QAAK,QAAQ,KAAK,SAAS,GAAI;AAC9B,UAAK,GAAI,IAAI;AAAA,IACd;AACA,WAAO,IAAK,GAAI;AAAA,EACjB,GAAG,MAAO;AAEV,SAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/utils/terms.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/utils/terms.js
|
|
19
21
|
var terms_exports = {};
|
|
20
22
|
__export(terms_exports, {
|
|
21
23
|
buildTermsTree: () => buildTermsTree,
|
|
@@ -60,16 +62,16 @@ function buildTermsTree(flatTerms) {
|
|
|
60
62
|
};
|
|
61
63
|
return fillWithChildren(termsByParent["0"] || []);
|
|
62
64
|
}
|
|
63
|
-
|
|
65
|
+
var unescapeString = (arg) => {
|
|
64
66
|
return (0, import_html_entities.decodeEntities)(arg);
|
|
65
67
|
};
|
|
66
|
-
|
|
68
|
+
var unescapeTerm = (term) => {
|
|
67
69
|
return {
|
|
68
70
|
...term,
|
|
69
71
|
name: unescapeString(term.name)
|
|
70
72
|
};
|
|
71
73
|
};
|
|
72
|
-
|
|
74
|
+
var unescapeTerms = (terms) => {
|
|
73
75
|
return (terms ?? []).map(unescapeTerm);
|
|
74
76
|
};
|
|
75
77
|
// Annotate the CommonJS export names for ESM import in node:
|
package/build/utils/terms.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/terms.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Returns terms in a tree form.\n *\n * @param {Array} flatTerms Array of terms in flat format.\n *\n * @return {Array} Array of terms in tree format.\n */\nexport function buildTermsTree( flatTerms ) {\n\tconst flatTermsWithParentAndChildren = flatTerms.map( ( term ) => {\n\t\treturn {\n\t\t\tchildren: [],\n\t\t\tparent: undefined,\n\t\t\t...term,\n\t\t};\n\t} );\n\n\t// All terms should have a `parent` because we're about to index them by it.\n\tif (\n\t\tflatTermsWithParentAndChildren.some(\n\t\t\t( { parent } ) => parent === undefined\n\t\t)\n\t) {\n\t\treturn flatTermsWithParentAndChildren;\n\t}\n\n\tconst termsByParent = flatTermsWithParentAndChildren.reduce(\n\t\t( acc, term ) => {\n\t\t\tconst { parent } = term;\n\t\t\tif ( ! acc[ parent ] ) {\n\t\t\t\tacc[ parent ] = [];\n\t\t\t}\n\t\t\tacc[ parent ].push( term );\n\t\t\treturn acc;\n\t\t},\n\t\t{}\n\t);\n\n\tconst fillWithChildren = ( terms ) => {\n\t\treturn terms.map( ( term ) => {\n\t\t\tconst children = termsByParent[ term.id ];\n\t\t\treturn {\n\t\t\t\t...term,\n\t\t\t\tchildren:\n\t\t\t\t\tchildren && children.length\n\t\t\t\t\t\t? fillWithChildren( children )\n\t\t\t\t\t\t: [],\n\t\t\t};\n\t\t} );\n\t};\n\n\treturn fillWithChildren( termsByParent[ '0' ] || [] );\n}\n\nexport const unescapeString = ( arg ) => {\n\treturn decodeEntities( arg );\n};\n\n/**\n * Returns a term object with name unescaped.\n *\n * @param {Object} term The term object to unescape.\n *\n * @return {Object} Term object with name property unescaped.\n */\nexport const unescapeTerm = ( term ) => {\n\treturn {\n\t\t...term,\n\t\tname: unescapeString( term.name ),\n\t};\n};\n\n/**\n * Returns an array of term objects with names unescaped.\n * The unescape of each term is performed using the unescapeTerm function.\n *\n * @param {Object[]} terms Array of term objects to unescape.\n *\n * @return {Object[]} Array of term objects unescaped.\n */\nexport const unescapeTerms = ( terms ) => {\n\treturn ( terms ?? [] ).map( unescapeTerm );\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,2BAA+B;AASxB,SAAS,eAAgB,WAAY;AAC3C,QAAM,iCAAiC,UAAU,IAAK,CAAE,SAAU;AACjE,WAAO;AAAA,MACN,UAAU,CAAC;AAAA,MACX,QAAQ;AAAA,MACR,GAAG;AAAA,IACJ;AAAA,EACD,CAAE;AAGF,MACC,+BAA+B;AAAA,IAC9B,CAAE,EAAE,OAAO,MAAO,WAAW;AAAA,EAC9B,GACC;AACD,WAAO;AAAA,EACR;AAEA,QAAM,gBAAgB,+BAA+B;AAAA,IACpD,CAAE,KAAK,SAAU;AAChB,YAAM,EAAE,OAAO,IAAI;AACnB,UAAK,CAAE,IAAK,MAAO,GAAI;AACtB,YAAK,MAAO,IAAI,CAAC;AAAA,MAClB;AACA,UAAK,MAAO,EAAE,KAAM,IAAK;AACzB,aAAO;AAAA,IACR;AAAA,IACA,CAAC;AAAA,EACF;AAEA,QAAM,mBAAmB,CAAE,UAAW;AACrC,WAAO,MAAM,IAAK,CAAE,SAAU;AAC7B,YAAM,WAAW,cAAe,KAAK,EAAG;AACxC,aAAO;AAAA,QACN,GAAG;AAAA,QACH,UACC,YAAY,SAAS,SAClB,iBAAkB,QAAS,IAC3B,CAAC;AAAA,MACN;AAAA,IACD,CAAE;AAAA,EACH;AAEA,SAAO,iBAAkB,cAAe,GAAI,KAAK,CAAC,CAAE;AACrD;AAEO,IAAM,iBAAiB,CAAE,QAAS;AACxC,aAAO,qCAAgB,GAAI;AAC5B;AASO,IAAM,eAAe,CAAE,SAAU;AACvC,SAAO;AAAA,IACN,GAAG;AAAA,IACH,MAAM,eAAgB,KAAK,IAAK;AAAA,EACjC;AACD;AAUO,IAAM,gBAAgB,CAAE,UAAW;AACzC,UAAS,SAAS,CAAC,GAAI,IAAK,YAAa;AAC1C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/utils/url.js
CHANGED
|
@@ -26,6 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/editor/src/utils/url.js
|
|
29
31
|
var url_exports = {};
|
|
30
32
|
__export(url_exports, {
|
|
31
33
|
cleanForSlug: () => cleanForSlug
|
package/build/utils/url.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/url.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { cleanForSlug as urlCleanForSlug } from '@wordpress/url';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Performs some basic cleanup of a string for use as a post slug\n *\n * This replicates some of what sanitize_title() does in WordPress core, but\n * is only designed to approximate what the slug will be.\n *\n * Converts Latin-1 Supplement and Latin Extended-A letters to basic Latin letters.\n * Removes combining diacritical marks. Converts whitespace, periods,\n * and forward slashes to hyphens. Removes any remaining non-word characters\n * except hyphens and underscores. Converts remaining string to lowercase.\n * It does not account for octets, HTML entities, or other encoded characters.\n *\n * @param {string} string Title or slug to be processed\n *\n * @return {string} Processed string\n */\nexport function cleanForSlug( string ) {\n\tdeprecated( 'wp.editor.cleanForSlug', {\n\t\tsince: '12.7',\n\t\tplugin: 'Gutenberg',\n\t\talternative: 'wp.url.cleanForSlug',\n\t} );\n\treturn urlCleanForSlug( string );\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,iBAAgD;AAChD,wBAAuB;AAkBhB,SAAS,aAAc,QAAS;AACtC,wBAAAA,SAAY,0BAA0B;AAAA,IACrC,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,aAAa;AAAA,EACd,CAAE;AACF,aAAO,WAAAC,cAAiB,MAAO;AAChC;",
|
|
6
6
|
"names": ["deprecated", "urlCleanForSlug"]
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/bindings/api.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { registerBlockBindingsSource } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport patternOverrides from './pattern-overrides';\nimport postData from './post-data';\nimport postMeta from './post-meta';\nimport termData from './term-data';\n\n/**\n * Function to register core block bindings sources provided by the editor.\n *\n * @example\n * ```js\n * import { registerCoreBlockBindingsSources } from '@wordpress/editor';\n *\n * registerCoreBlockBindingsSources();\n * ```\n */\nexport function registerCoreBlockBindingsSources() {\n\tregisterBlockBindingsSource( patternOverrides );\n\tregisterBlockBindingsSource( postData );\n\tregisterBlockBindingsSource( postMeta );\n\tregisterBlockBindingsSource( termData );\n}\n"],
|
|
5
|
-
"mappings": "AAGA,SAAS,mCAAmC;AAK5C,OAAO,sBAAsB;AAC7B,OAAO,cAAc;AACrB,OAAO,cAAc;AACrB,OAAO,cAAc;AAYd,SAAS,mCAAmC;AAClD,8BAA6B,gBAAiB;AAC9C,8BAA6B,QAAS;AACtC,8BAA6B,QAAS;AACtC,8BAA6B,QAAS;AACvC;",
|
|
5
|
+
"mappings": ";AAGA,SAAS,mCAAmC;AAK5C,OAAO,sBAAsB;AAC7B,OAAO,cAAc;AACrB,OAAO,cAAc;AACrB,OAAO,cAAc;AAYd,SAAS,mCAAmC;AAClD,8BAA6B,gBAAiB;AAC9C,8BAA6B,QAAS;AACtC,8BAA6B,QAAS;AACtC,8BAA6B,QAAS;AACvC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
// packages/editor/src/bindings/pattern-overrides.js
|
|
1
2
|
import { store as blockEditorStore } from "@wordpress/block-editor";
|
|
2
|
-
|
|
3
|
+
var CONTENT = "content";
|
|
3
4
|
var pattern_overrides_default = {
|
|
4
5
|
name: "core/pattern-overrides",
|
|
5
6
|
getValues({ select, clientId, context, bindings }) {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/bindings/pattern-overrides.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nconst CONTENT = 'content';\n\n/**\n * @type {WPBlockBindingsSource}\n */\nexport default {\n\tname: 'core/pattern-overrides',\n\tgetValues( { select, clientId, context, bindings } ) {\n\t\tconst patternOverridesContent = context[ 'pattern/overrides' ];\n\t\tconst { getBlockAttributes } = select( blockEditorStore );\n\t\tconst currentBlockAttributes = getBlockAttributes( clientId );\n\n\t\tconst overridesValues = {};\n\t\tfor ( const attributeName of Object.keys( bindings ) ) {\n\t\t\tconst overridableValue =\n\t\t\t\tpatternOverridesContent?.[\n\t\t\t\t\tcurrentBlockAttributes?.metadata?.name\n\t\t\t\t]?.[ attributeName ];\n\n\t\t\t// If it has not been overridden, return the original value.\n\t\t\t// Check undefined because empty string is a valid value.\n\t\t\tif ( overridableValue === undefined ) {\n\t\t\t\toverridesValues[ attributeName ] =\n\t\t\t\t\tcurrentBlockAttributes[ attributeName ];\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\toverridesValues[ attributeName ] =\n\t\t\t\t\toverridableValue === '' ? undefined : overridableValue;\n\t\t\t}\n\t\t}\n\t\treturn overridesValues;\n\t},\n\tsetValues( { select, dispatch, clientId, bindings } ) {\n\t\tconst { getBlockAttributes, getBlockParentsByBlockName, getBlocks } =\n\t\t\tselect( blockEditorStore );\n\t\tconst currentBlockAttributes = getBlockAttributes( clientId );\n\t\tconst blockName = currentBlockAttributes?.metadata?.name;\n\t\tif ( ! blockName ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst [ patternClientId ] = getBlockParentsByBlockName(\n\t\t\tclientId,\n\t\t\t'core/block',\n\t\t\ttrue\n\t\t);\n\n\t\t// Extract the updated attributes from the source bindings.\n\t\tconst attributes = Object.entries( bindings ).reduce(\n\t\t\t( attrs, [ key, { newValue } ] ) => {\n\t\t\t\tattrs[ key ] = newValue;\n\t\t\t\treturn attrs;\n\t\t\t},\n\t\t\t{}\n\t\t);\n\n\t\t// If there is no pattern client ID, sync blocks with the same name and same attributes.\n\t\tif ( ! patternClientId ) {\n\t\t\tconst syncBlocksWithSameName = ( blocks ) => {\n\t\t\t\tfor ( const block of blocks ) {\n\t\t\t\t\tif ( block.attributes?.metadata?.name === blockName ) {\n\t\t\t\t\t\tdispatch( blockEditorStore ).updateBlockAttributes(\n\t\t\t\t\t\t\tblock.clientId,\n\t\t\t\t\t\t\tattributes\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tsyncBlocksWithSameName( block.innerBlocks );\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tsyncBlocksWithSameName( getBlocks() );\n\t\t\treturn;\n\t\t}\n\t\tconst currentBindingValue =\n\t\t\tgetBlockAttributes( patternClientId )?.[ CONTENT ];\n\n\t\tdispatch( blockEditorStore ).updateBlockAttributes( patternClientId, {\n\t\t\t[ CONTENT ]: {\n\t\t\t\t...currentBindingValue,\n\t\t\t\t[ blockName ]: {\n\t\t\t\t\t...currentBindingValue?.[ blockName ],\n\t\t\t\t\t...Object.entries( attributes ).reduce(\n\t\t\t\t\t\t( acc, [ key, value ] ) => {\n\t\t\t\t\t\t\t// TODO: We need a way to represent `undefined` in the serialized overrides.\n\t\t\t\t\t\t\t// Also see: https://github.com/WordPress/gutenberg/pull/57249#discussion_r1452987871\n\t\t\t\t\t\t\t// We use an empty string to represent undefined for now until\n\t\t\t\t\t\t\t// we support a richer format for overrides and the block bindings API.\n\t\t\t\t\t\t\tacc[ key ] = value === undefined ? '' : value;\n\t\t\t\t\t\t\treturn acc;\n\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\tcanUserEditValue: () => true,\n};\n"],
|
|
5
|
-
"mappings": "AAGA,SAAS,SAAS,wBAAwB;AAE1C,
|
|
5
|
+
"mappings": ";AAGA,SAAS,SAAS,wBAAwB;AAE1C,IAAM,UAAU;AAKhB,IAAO,4BAAQ;AAAA,EACd,MAAM;AAAA,EACN,UAAW,EAAE,QAAQ,UAAU,SAAS,SAAS,GAAI;AACpD,UAAM,0BAA0B,QAAS,mBAAoB;AAC7D,UAAM,EAAE,mBAAmB,IAAI,OAAQ,gBAAiB;AACxD,UAAM,yBAAyB,mBAAoB,QAAS;AAE5D,UAAM,kBAAkB,CAAC;AACzB,eAAY,iBAAiB,OAAO,KAAM,QAAS,GAAI;AACtD,YAAM,mBACL,0BACC,wBAAwB,UAAU,IACnC,IAAK,aAAc;AAIpB,UAAK,qBAAqB,QAAY;AACrC,wBAAiB,aAAc,IAC9B,uBAAwB,aAAc;AACvC;AAAA,MACD,OAAO;AACN,wBAAiB,aAAc,IAC9B,qBAAqB,KAAK,SAAY;AAAA,MACxC;AAAA,IACD;AACA,WAAO;AAAA,EACR;AAAA,EACA,UAAW,EAAE,QAAQ,UAAU,UAAU,SAAS,GAAI;AACrD,UAAM,EAAE,oBAAoB,4BAA4B,UAAU,IACjE,OAAQ,gBAAiB;AAC1B,UAAM,yBAAyB,mBAAoB,QAAS;AAC5D,UAAM,YAAY,wBAAwB,UAAU;AACpD,QAAK,CAAE,WAAY;AAClB;AAAA,IACD;AAEA,UAAM,CAAE,eAAgB,IAAI;AAAA,MAC3B;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAGA,UAAM,aAAa,OAAO,QAAS,QAAS,EAAE;AAAA,MAC7C,CAAE,OAAO,CAAE,KAAK,EAAE,SAAS,CAAE,MAAO;AACnC,cAAO,GAAI,IAAI;AACf,eAAO;AAAA,MACR;AAAA,MACA,CAAC;AAAA,IACF;AAGA,QAAK,CAAE,iBAAkB;AACxB,YAAM,yBAAyB,CAAE,WAAY;AAC5C,mBAAY,SAAS,QAAS;AAC7B,cAAK,MAAM,YAAY,UAAU,SAAS,WAAY;AACrD,qBAAU,gBAAiB,EAAE;AAAA,cAC5B,MAAM;AAAA,cACN;AAAA,YACD;AAAA,UACD;AACA,iCAAwB,MAAM,WAAY;AAAA,QAC3C;AAAA,MACD;AAEA,6BAAwB,UAAU,CAAE;AACpC;AAAA,IACD;AACA,UAAM,sBACL,mBAAoB,eAAgB,IAAK,OAAQ;AAElD,aAAU,gBAAiB,EAAE,sBAAuB,iBAAiB;AAAA,MACpE,CAAE,OAAQ,GAAG;AAAA,QACZ,GAAG;AAAA,QACH,CAAE,SAAU,GAAG;AAAA,UACd,GAAG,sBAAuB,SAAU;AAAA,UACpC,GAAG,OAAO,QAAS,UAAW,EAAE;AAAA,YAC/B,CAAE,KAAK,CAAE,KAAK,KAAM,MAAO;AAK1B,kBAAK,GAAI,IAAI,UAAU,SAAY,KAAK;AACxC,qBAAO;AAAA,YACR;AAAA,YACA,CAAC;AAAA,UACF;AAAA,QACD;AAAA,MACD;AAAA,IACD,CAAE;AAAA,EACH;AAAA,EACA,kBAAkB,MAAM;AACzB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,63 +1,61 @@
|
|
|
1
|
+
// packages/editor/src/bindings/post-data.js
|
|
1
2
|
import { __ } from "@wordpress/i18n";
|
|
2
3
|
import { store as coreDataStore } from "@wordpress/core-data";
|
|
3
4
|
import { store as blockEditorStore } from "@wordpress/block-editor";
|
|
4
|
-
|
|
5
|
+
var NAVIGATION_BLOCK_TYPES = [
|
|
5
6
|
"core/navigation-link",
|
|
6
7
|
"core/navigation-submenu"
|
|
7
8
|
];
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
var postDataFields = [
|
|
10
|
+
{
|
|
11
|
+
label: __("Post Date"),
|
|
12
|
+
args: { field: "date" },
|
|
13
|
+
type: "string"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
label: __("Post Modified Date"),
|
|
17
|
+
args: { field: "modified" },
|
|
18
|
+
type: "string"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
label: __("Post Link"),
|
|
22
|
+
args: { field: "link" },
|
|
23
|
+
type: "string"
|
|
22
24
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
];
|
|
26
|
+
var post_data_default = {
|
|
27
|
+
name: "core/post-data",
|
|
28
|
+
getValues({ select, context, bindings, clientId }) {
|
|
29
|
+
const allowedFields = postDataFields.map(
|
|
30
|
+
(field) => field.args.field
|
|
31
|
+
);
|
|
32
|
+
const { getBlockAttributes, getBlockName } = select(blockEditorStore);
|
|
33
|
+
const blockName = getBlockName?.(clientId);
|
|
34
|
+
const isNavigationBlock = NAVIGATION_BLOCK_TYPES.includes(blockName);
|
|
35
|
+
let postId, postType;
|
|
36
|
+
if (isNavigationBlock) {
|
|
37
|
+
const blockAttributes = getBlockAttributes?.(clientId);
|
|
38
|
+
postId = blockAttributes?.id;
|
|
39
|
+
postType = blockAttributes?.type;
|
|
40
|
+
} else {
|
|
41
|
+
postId = context?.postId;
|
|
42
|
+
postType = context?.postType;
|
|
43
|
+
}
|
|
44
|
+
const { getEditedEntityRecord } = select(coreDataStore);
|
|
45
|
+
const entityDataValues = getEditedEntityRecord(
|
|
25
46
|
"postType",
|
|
26
47
|
postType,
|
|
27
48
|
postId
|
|
28
49
|
);
|
|
29
|
-
dataFields = {
|
|
30
|
-
date: {
|
|
31
|
-
label: __("Post Date"),
|
|
32
|
-
value: entityDataValues?.date,
|
|
33
|
-
type: "string"
|
|
34
|
-
},
|
|
35
|
-
modified: {
|
|
36
|
-
label: __("Post Modified Date"),
|
|
37
|
-
value: entityDataValues?.modified,
|
|
38
|
-
type: "string"
|
|
39
|
-
},
|
|
40
|
-
link: {
|
|
41
|
-
label: __("Post Link"),
|
|
42
|
-
value: entityDataValues?.link,
|
|
43
|
-
type: "string"
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
if (!Object.keys(dataFields || {}).length) {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
return dataFields;
|
|
51
|
-
}
|
|
52
|
-
var post_data_default = {
|
|
53
|
-
name: "core/post-data",
|
|
54
|
-
getValues({ select, context, bindings, clientId }) {
|
|
55
|
-
const dataFields = getPostDataFields(select, context, clientId);
|
|
56
50
|
const newValues = {};
|
|
57
|
-
for (const [attributeName,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
51
|
+
for (const [attributeName, binding] of Object.entries(bindings)) {
|
|
52
|
+
if (!allowedFields.includes(binding.args.field)) {
|
|
53
|
+
newValues[attributeName] = {};
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
newValues[attributeName] = entityDataValues?.[binding.args.field] ?? postDataFields.find(
|
|
57
|
+
(field) => field.args.field === binding.args.field
|
|
58
|
+
).label;
|
|
61
59
|
}
|
|
62
60
|
return newValues;
|
|
63
61
|
},
|
|
@@ -78,7 +76,7 @@ var post_data_default = {
|
|
|
78
76
|
newData
|
|
79
77
|
);
|
|
80
78
|
},
|
|
81
|
-
canUserEditValue({ select, context
|
|
79
|
+
canUserEditValue({ select, context }) {
|
|
82
80
|
const { getBlockName, getSelectedBlockClientId } = select(blockEditorStore);
|
|
83
81
|
const clientId = getSelectedBlockClientId();
|
|
84
82
|
const blockName = getBlockName?.(clientId);
|
|
@@ -91,10 +89,6 @@ var post_data_default = {
|
|
|
91
89
|
if (!context?.postType) {
|
|
92
90
|
return false;
|
|
93
91
|
}
|
|
94
|
-
const fieldValue = getPostDataFields(select, context, void 0)?.[args.field]?.value;
|
|
95
|
-
if (fieldValue === void 0) {
|
|
96
|
-
return false;
|
|
97
|
-
}
|
|
98
92
|
const canUserEdit = select(coreDataStore).canUser("update", {
|
|
99
93
|
kind: "postType",
|
|
100
94
|
name: context?.postType,
|
|
@@ -105,7 +99,7 @@ var post_data_default = {
|
|
|
105
99
|
}
|
|
106
100
|
return true;
|
|
107
101
|
},
|
|
108
|
-
getFieldsList({ select
|
|
102
|
+
getFieldsList({ select }) {
|
|
109
103
|
const selectedBlock = select(blockEditorStore).getSelectedBlock();
|
|
110
104
|
if (selectedBlock?.name !== "core/post-date") {
|
|
111
105
|
return [];
|
|
@@ -113,16 +107,7 @@ var post_data_default = {
|
|
|
113
107
|
if (NAVIGATION_BLOCK_TYPES.includes(selectedBlock?.name)) {
|
|
114
108
|
return [];
|
|
115
109
|
}
|
|
116
|
-
|
|
117
|
-
const postDataFields = getPostDataFields(select, context, clientId);
|
|
118
|
-
if (!postDataFields) {
|
|
119
|
-
return [];
|
|
120
|
-
}
|
|
121
|
-
return Object.entries(postDataFields).map(([key, field]) => ({
|
|
122
|
-
label: field.label,
|
|
123
|
-
type: field.type,
|
|
124
|
-
args: { field: key }
|
|
125
|
-
}));
|
|
110
|
+
return postDataFields;
|
|
126
111
|
}
|
|
127
112
|
};
|
|
128
113
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/bindings/post-data.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n// Navigation block types that use special handling for backwards compatibility\nconst NAVIGATION_BLOCK_TYPES = [\n\t'core/navigation-link',\n\t'core/navigation-submenu',\n];\n\
|
|
5
|
-
"mappings": "AAGA,SAAS,UAAU;AACnB,SAAS,SAAS,qBAAqB;AACvC,SAAS,SAAS,wBAAwB;AAG1C,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n// Navigation block types that use special handling for backwards compatibility\nconst NAVIGATION_BLOCK_TYPES = [\n\t'core/navigation-link',\n\t'core/navigation-submenu',\n];\n\nconst postDataFields = [\n\t{\n\t\tlabel: __( 'Post Date' ),\n\t\targs: { field: 'date' },\n\t\ttype: 'string',\n\t},\n\t{\n\t\tlabel: __( 'Post Modified Date' ),\n\t\targs: { field: 'modified' },\n\t\ttype: 'string',\n\t},\n\t{\n\t\tlabel: __( 'Post Link' ),\n\t\targs: { field: 'link' },\n\t\ttype: 'string',\n\t},\n];\n\n/**\n * @type {WPBlockBindingsSource}\n */\nexport default {\n\tname: 'core/post-data',\n\tgetValues( { select, context, bindings, clientId } ) {\n\t\tconst allowedFields = postDataFields.map(\n\t\t\t( field ) => field.args.field\n\t\t);\n\n\t\t/*\n\t\t * BACKWARDS COMPATIBILITY: Hardcoded exception for navigation blocks.\n\t\t * Required for WordPress 6.9+ navigation blocks. DO NOT REMOVE.\n\t\t */\n\t\tconst { getBlockAttributes, getBlockName } = select( blockEditorStore );\n\t\tconst blockName = getBlockName?.( clientId );\n\t\tconst isNavigationBlock = NAVIGATION_BLOCK_TYPES.includes( blockName );\n\n\t\tlet postId, postType;\n\n\t\tif ( isNavigationBlock ) {\n\t\t\t// Navigation blocks: read from block attributes\n\t\t\tconst blockAttributes = getBlockAttributes?.( clientId );\n\t\t\tpostId = blockAttributes?.id;\n\t\t\tpostType = blockAttributes?.type;\n\t\t} else {\n\t\t\t// All other blocks: use context\n\t\t\tpostId = context?.postId;\n\t\t\tpostType = context?.postType;\n\t\t}\n\n\t\tconst { getEditedEntityRecord } = select( coreDataStore );\n\t\tconst entityDataValues = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tpostId\n\t\t);\n\n\t\tconst newValues = {};\n\t\tfor ( const [ attributeName, binding ] of Object.entries( bindings ) ) {\n\t\t\tif ( ! allowedFields.includes( binding.args.field ) ) {\n\t\t\t\tnewValues[ attributeName ] = {};\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnewValues[ attributeName ] =\n\t\t\t\tentityDataValues?.[ binding.args.field ] ??\n\t\t\t\tpostDataFields.find(\n\t\t\t\t\t( field ) => field.args.field === binding.args.field\n\t\t\t\t).label;\n\t\t}\n\t\treturn newValues;\n\t},\n\tsetValues( { dispatch, context, bindings, clientId, select } ) {\n\t\tconst { getBlockName } = select( blockEditorStore );\n\n\t\tconst blockName = getBlockName?.( clientId );\n\n\t\t// Navigaton block types are read-only.\n\t\t// See https://github.com/WordPress/gutenberg/pull/72165.\n\t\tif ( NAVIGATION_BLOCK_TYPES.includes( blockName ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tconst newData = {};\n\t\tObject.values( bindings ).forEach( ( { args, newValue } ) => {\n\t\t\tnewData[ args.field ] = newValue;\n\t\t} );\n\n\t\tdispatch( coreDataStore ).editEntityRecord(\n\t\t\t'postType',\n\t\t\tcontext?.postType,\n\t\t\tcontext?.postId,\n\t\t\tnewData\n\t\t);\n\t},\n\tcanUserEditValue( { select, context } ) {\n\t\tconst { getBlockName, getSelectedBlockClientId } =\n\t\t\tselect( blockEditorStore );\n\t\tconst clientId = getSelectedBlockClientId();\n\t\tconst blockName = getBlockName?.( clientId );\n\n\t\t// Navigaton block types are read-only.\n\t\t// See https://github.com/WordPress/gutenberg/pull/72165.\n\t\tif ( NAVIGATION_BLOCK_TYPES.includes( blockName ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Lock editing in query loop.\n\t\tif ( context?.query || context?.queryId ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Lock editing when `postType` is not defined.\n\t\tif ( ! context?.postType ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check that the user has the capability to edit post data.\n\t\tconst canUserEdit = select( coreDataStore ).canUser( 'update', {\n\t\t\tkind: 'postType',\n\t\t\tname: context?.postType,\n\t\t\tid: context?.postId,\n\t\t} );\n\t\tif ( ! canUserEdit ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t},\n\tgetFieldsList( { select } ) {\n\t\tconst selectedBlock = select( blockEditorStore ).getSelectedBlock();\n\t\tif ( selectedBlock?.name !== 'core/post-date' ) {\n\t\t\treturn [];\n\t\t}\n\t\t// Exit early for navigation blocks (read-only)\n\t\tif ( NAVIGATION_BLOCK_TYPES.includes( selectedBlock?.name ) ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn postDataFields;\n\t},\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,46 +1,53 @@
|
|
|
1
|
+
// packages/editor/src/bindings/post-meta.js
|
|
1
2
|
import { store as coreDataStore } from "@wordpress/core-data";
|
|
2
3
|
import { store as editorStore } from "../store";
|
|
3
4
|
import { unlock } from "../lock-unlock";
|
|
4
5
|
function getPostMetaFields(select, context) {
|
|
5
|
-
const { getEditedEntityRecord } = select(coreDataStore);
|
|
6
6
|
const { getRegisteredPostMeta } = unlock(select(coreDataStore));
|
|
7
|
-
let entityMetaValues;
|
|
8
|
-
if (context?.postType && context?.postId) {
|
|
9
|
-
entityMetaValues = getEditedEntityRecord(
|
|
10
|
-
"postType",
|
|
11
|
-
context?.postType,
|
|
12
|
-
context?.postId
|
|
13
|
-
).meta;
|
|
14
|
-
}
|
|
15
7
|
const registeredFields = getRegisteredPostMeta(context?.postType);
|
|
16
|
-
const metaFields =
|
|
17
|
-
Object.entries(registeredFields
|
|
18
|
-
if (key
|
|
19
|
-
|
|
20
|
-
label: props.title || key,
|
|
21
|
-
value: (
|
|
22
|
-
// When using the entity value, an empty string IS a valid value.
|
|
23
|
-
entityMetaValues?.[key] ?? // When using the default, an empty string IS NOT a valid value.
|
|
24
|
-
(props.default || void 0)
|
|
25
|
-
),
|
|
26
|
-
type: props.type
|
|
27
|
-
};
|
|
8
|
+
const metaFields = [];
|
|
9
|
+
Object.entries(registeredFields).forEach(([key, props]) => {
|
|
10
|
+
if (key === "footnotes" || key.charAt(0) === "_") {
|
|
11
|
+
return;
|
|
28
12
|
}
|
|
13
|
+
metaFields.push({
|
|
14
|
+
label: props.title || key,
|
|
15
|
+
args: { key },
|
|
16
|
+
default: props.default,
|
|
17
|
+
type: props.type
|
|
18
|
+
});
|
|
29
19
|
});
|
|
30
|
-
if (!Object.keys(metaFields || {}).length) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
20
|
return metaFields;
|
|
34
21
|
}
|
|
22
|
+
function getValue({ select, context, args }) {
|
|
23
|
+
const metaFields = getPostMetaFields(select, context);
|
|
24
|
+
const metaField = metaFields.find(
|
|
25
|
+
(field) => field.args.key === args.key
|
|
26
|
+
);
|
|
27
|
+
if (!metaField) {
|
|
28
|
+
return args.key;
|
|
29
|
+
}
|
|
30
|
+
if (!context?.postId) {
|
|
31
|
+
return metaField.default || metaField.label || args.key;
|
|
32
|
+
}
|
|
33
|
+
const { getEditedEntityRecord } = select(coreDataStore);
|
|
34
|
+
const entityMetaValues = getEditedEntityRecord(
|
|
35
|
+
"postType",
|
|
36
|
+
context?.postType,
|
|
37
|
+
context?.postId
|
|
38
|
+
).meta;
|
|
39
|
+
return entityMetaValues?.[args.key] ?? metaField?.label ?? args.key;
|
|
40
|
+
}
|
|
35
41
|
var post_meta_default = {
|
|
36
42
|
name: "core/post-meta",
|
|
37
43
|
getValues({ select, context, bindings }) {
|
|
38
|
-
const metaFields = getPostMetaFields(select, context);
|
|
39
44
|
const newValues = {};
|
|
40
|
-
for (const [attributeName,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
for (const [attributeName, binding] of Object.entries(bindings)) {
|
|
46
|
+
newValues[attributeName] = getValue({
|
|
47
|
+
select,
|
|
48
|
+
context,
|
|
49
|
+
args: binding.args
|
|
50
|
+
});
|
|
44
51
|
}
|
|
45
52
|
return newValues;
|
|
46
53
|
},
|
|
@@ -65,8 +72,11 @@ var post_meta_default = {
|
|
|
65
72
|
if (!context?.postType) {
|
|
66
73
|
return false;
|
|
67
74
|
}
|
|
68
|
-
const
|
|
69
|
-
|
|
75
|
+
const metaFields = getPostMetaFields(select, context);
|
|
76
|
+
const hasMatchingMetaField = metaFields.some(
|
|
77
|
+
(field) => field.args.key === args.key
|
|
78
|
+
);
|
|
79
|
+
if (!hasMatchingMetaField) {
|
|
70
80
|
return false;
|
|
71
81
|
}
|
|
72
82
|
const areCustomFieldsEnabled = select(editorStore).getEditorSettings().enableCustomFields;
|
|
@@ -85,14 +95,11 @@ var post_meta_default = {
|
|
|
85
95
|
},
|
|
86
96
|
getFieldsList({ select, context }) {
|
|
87
97
|
const metaFields = getPostMetaFields(select, context);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
type: field.type,
|
|
94
|
-
args: { key }
|
|
95
|
-
}));
|
|
98
|
+
return metaFields.map(
|
|
99
|
+
({ default: defaultProp, ...otherProps }) => ({
|
|
100
|
+
...otherProps
|
|
101
|
+
})
|
|
102
|
+
);
|
|
96
103
|
}
|
|
97
104
|
};
|
|
98
105
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/bindings/post-meta.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Gets a list of post meta fields with their values and labels\n * to be consumed in the needed callbacks.\n * If the value is not available based on context, like in templates,\n * it falls back to the default value, label, or key.\n *\n * @param {Object} select The select function from the data store.\n * @param {Object} context The context provided.\n * @return {Object} List of post meta fields with their value and label.\n *\n * @example\n * ```js\n * {\n * field_1_key: {\n * label: 'Field 1 Label',\n * value: 'Field 1 Value',\n * },\n * field_2_key: {\n * label: 'Field 2 Label',\n * value: 'Field 2 Value',\n * },\n * ...\n * }\n * ```\n */\nfunction getPostMetaFields( select, context ) {\n\tconst {
|
|
5
|
-
"mappings": "AAGA,SAAS,SAAS,qBAAqB;AAKvC,SAAS,SAAS,mBAAmB;AACrC,SAAS,cAAc;AA2BvB,SAAS,kBAAmB,QAAQ,SAAU;AAC7C,QAAM,EAAE,sBAAsB,IAAI,OAAQ,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Gets a list of post meta fields with their values and labels\n * to be consumed in the needed callbacks.\n * If the value is not available based on context, like in templates,\n * it falls back to the default value, label, or key.\n *\n * @param {Object} select The select function from the data store.\n * @param {Object} context The context provided.\n * @return {Object} List of post meta fields with their value and label.\n *\n * @example\n * ```js\n * {\n * field_1_key: {\n * label: 'Field 1 Label',\n * value: 'Field 1 Value',\n * },\n * field_2_key: {\n * label: 'Field 2 Label',\n * value: 'Field 2 Value',\n * },\n * ...\n * }\n * ```\n */\nfunction getPostMetaFields( select, context ) {\n\tconst { getRegisteredPostMeta } = unlock( select( coreDataStore ) );\n\n\tconst registeredFields = getRegisteredPostMeta( context?.postType );\n\tconst metaFields = [];\n\tObject.entries( registeredFields ).forEach( ( [ key, props ] ) => {\n\t\t// Don't include footnotes or private fields.\n\t\tif ( key === 'footnotes' || key.charAt( 0 ) === '_' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tmetaFields.push( {\n\t\t\tlabel: props.title || key,\n\t\t\targs: { key },\n\t\t\tdefault: props.default,\n\t\t\ttype: props.type,\n\t\t} );\n\t} );\n\n\treturn metaFields;\n}\n\nfunction getValue( { select, context, args } ) {\n\tconst metaFields = getPostMetaFields( select, context );\n\tconst metaField = metaFields.find(\n\t\t( field ) => field.args.key === args.key\n\t);\n\n\t// If the meta field was not found, it's either protected, inaccessible, or simply doesn't exist.\n\tif ( ! metaField ) {\n\t\treturn args.key;\n\t}\n\n\t// Without a postId, we cannot look up a meta value.\n\tif ( ! context?.postId ) {\n\t\t// Return the default value for the meta field if available.\n\t\treturn metaField.default || metaField.label || args.key;\n\t}\n\n\tconst { getEditedEntityRecord } = select( coreDataStore );\n\tconst entityMetaValues = getEditedEntityRecord(\n\t\t'postType',\n\t\tcontext?.postType,\n\t\tcontext?.postId\n\t).meta;\n\n\treturn entityMetaValues?.[ args.key ] ?? metaField?.label ?? args.key;\n}\n\n/**\n * @type {WPBlockBindingsSource}\n */\nexport default {\n\tname: 'core/post-meta',\n\tgetValues( { select, context, bindings } ) {\n\t\tconst newValues = {};\n\t\tfor ( const [ attributeName, binding ] of Object.entries( bindings ) ) {\n\t\t\tnewValues[ attributeName ] = getValue( {\n\t\t\t\tselect,\n\t\t\t\tcontext,\n\t\t\t\targs: binding.args,\n\t\t\t} );\n\t\t}\n\t\treturn newValues;\n\t},\n\tsetValues( { dispatch, context, bindings } ) {\n\t\tconst newMeta = {};\n\t\tObject.values( bindings ).forEach( ( { args, newValue } ) => {\n\t\t\tnewMeta[ args.key ] = newValue;\n\t\t} );\n\n\t\tdispatch( coreDataStore ).editEntityRecord(\n\t\t\t'postType',\n\t\t\tcontext?.postType,\n\t\t\tcontext?.postId,\n\t\t\t{\n\t\t\t\tmeta: newMeta,\n\t\t\t}\n\t\t);\n\t},\n\tcanUserEditValue( { select, context, args } ) {\n\t\t// Lock editing in query loop.\n\t\tif ( context?.query || context?.queryId ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Lock editing when `postType` is not defined.\n\t\tif ( ! context?.postType ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst metaFields = getPostMetaFields( select, context );\n\t\tconst hasMatchingMetaField = metaFields.some(\n\t\t\t( field ) => field.args.key === args.key\n\t\t);\n\t\tif ( ! hasMatchingMetaField ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check that custom fields metabox is not enabled.\n\t\tconst areCustomFieldsEnabled =\n\t\t\tselect( editorStore ).getEditorSettings().enableCustomFields;\n\t\tif ( areCustomFieldsEnabled ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check that the user has the capability to edit post meta.\n\t\tconst canUserEdit = select( coreDataStore ).canUser( 'update', {\n\t\t\tkind: 'postType',\n\t\t\tname: context?.postType,\n\t\t\tid: context?.postId,\n\t\t} );\n\t\tif ( ! canUserEdit ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t},\n\tgetFieldsList( { select, context } ) {\n\t\tconst metaFields = getPostMetaFields( select, context );\n\t\t// Remove 'default' property from meta fields.\n\t\treturn metaFields.map(\n\t\t\t( { default: defaultProp, ...otherProps } ) => ( {\n\t\t\t\t...otherProps,\n\t\t\t} )\n\t\t);\n\t},\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
// packages/editor/src/bindings/term-data.js
|
|
1
2
|
import { __ } from "@wordpress/i18n";
|
|
2
3
|
import { store as coreDataStore } from "@wordpress/core-data";
|
|
3
4
|
import { store as blockEditorStore } from "@wordpress/block-editor";
|
|
4
|
-
|
|
5
|
+
var NAVIGATION_BLOCK_TYPES = [
|
|
5
6
|
"core/navigation-link",
|
|
6
7
|
"core/navigation-submenu"
|
|
7
8
|
];
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/bindings/term-data.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n// Navigation block types that use special handling for backwards compatibility\nconst NAVIGATION_BLOCK_TYPES = [\n\t'core/navigation-link',\n\t'core/navigation-submenu',\n];\n\n/**\n * Creates the data fields object with the given term data values and ID value.\n *\n * @param {Object} termDataValues The term data values.\n * @param {string|number} idValue The ID value to use.\n * @return {Object} The data fields object.\n */\nfunction createDataFields( termDataValues, idValue ) {\n\treturn {\n\t\tid: {\n\t\t\tlabel: __( 'Term ID' ),\n\t\t\tvalue: idValue,\n\t\t\ttype: 'string',\n\t\t},\n\t\tname: {\n\t\t\tlabel: __( 'Name' ),\n\t\t\tvalue: termDataValues?.name,\n\t\t\ttype: 'string',\n\t\t},\n\t\tslug: {\n\t\t\tlabel: __( 'Slug' ),\n\t\t\tvalue: termDataValues?.slug,\n\t\t\ttype: 'string',\n\t\t},\n\t\tlink: {\n\t\t\tlabel: __( 'Link' ),\n\t\t\tvalue: termDataValues?.link,\n\t\t\ttype: 'string',\n\t\t},\n\t\tdescription: {\n\t\t\tlabel: __( 'Description' ),\n\t\t\tvalue: termDataValues?.description,\n\t\t\ttype: 'string',\n\t\t},\n\t\tparent: {\n\t\t\tlabel: __( 'Parent ID' ),\n\t\t\tvalue: termDataValues?.parent,\n\t\t\ttype: 'string',\n\t\t},\n\t\tcount: {\n\t\t\tlabel: __( 'Count' ),\n\t\t\tvalue: `(${ termDataValues?.count ?? 0 })`,\n\t\t\ttype: 'string',\n\t\t},\n\t};\n}\n\n/**\n * Gets a list of term data fields with their values and labels\n * to be consumed in the needed callbacks.\n * If the value is not available based on context, like in templates,\n * it falls back to the default value, label, or key.\n *\n * @param {Object} select The select function from the data store.\n * @param {Object} context The context provided.\n * @param {string} clientId The block client ID used to read attributes.\n * @return {Object} List of term data fields with their value and label.\n *\n * @example\n * ```js\n * {\n * name: {\n * label: 'Term Name',\n * value: 'Category Name',\n * },\n * count: {\n * label: 'Term Count',\n * value: 5,\n * },\n * ...\n * }\n * ```\n */\nfunction getTermDataFields( select, context, clientId ) {\n\tconst { getEntityRecord } = select( coreDataStore );\n\tconst { getBlockAttributes, getBlockName } = select( blockEditorStore );\n\n\tlet termDataValues, dataFields;\n\n\t/*\n\t * BACKWARDS COMPATIBILITY: Hardcoded exception for navigation blocks.\n\t * Required for WordPress 6.9+ navigation blocks. DO NOT REMOVE.\n\t */\n\tconst blockName = getBlockName?.( clientId );\n\tconst isNavigationBlock = NAVIGATION_BLOCK_TYPES.includes( blockName );\n\n\tlet termId, taxonomy;\n\n\tif ( isNavigationBlock ) {\n\t\t// Navigation blocks: read from block attributes\n\t\tconst blockAttributes = getBlockAttributes?.( clientId );\n\t\ttermId = blockAttributes?.id;\n\t\tconst typeFromAttributes = blockAttributes?.type;\n\t\ttaxonomy =\n\t\t\ttypeFromAttributes === 'tag' ? 'post_tag' : typeFromAttributes;\n\t} else {\n\t\t// All other blocks: use context\n\t\ttermId = context?.termId;\n\t\ttaxonomy = context?.taxonomy;\n\t}\n\n\tif ( taxonomy && termId ) {\n\t\ttermDataValues = getEntityRecord( 'taxonomy', taxonomy, termId );\n\n\t\tif ( ! termDataValues && context?.termData ) {\n\t\t\ttermDataValues = context.termData;\n\t\t}\n\n\t\tif ( termDataValues ) {\n\t\t\tdataFields = createDataFields( termDataValues, termId );\n\t\t}\n\t} else if ( context?.termData ) {\n\t\ttermDataValues = context.termData;\n\t\tdataFields = createDataFields(\n\t\t\ttermDataValues,\n\t\t\ttermDataValues?.term_id\n\t\t);\n\t}\n\n\tif ( ! dataFields || ! Object.keys( dataFields ).length ) {\n\t\treturn null;\n\t}\n\n\treturn dataFields;\n}\n\n/**\n * @type {WPBlockBindingsSource}\n */\nexport default {\n\tname: 'core/term-data',\n\tusesContext: [ 'taxonomy', 'termId', 'termData' ],\n\tgetValues( { select, context, bindings, clientId } ) {\n\t\tconst dataFields = getTermDataFields( select, context, clientId );\n\n\t\tconst newValues = {};\n\t\tfor ( const [ attributeName, source ] of Object.entries( bindings ) ) {\n\t\t\t// Use the value, the field label, or the field key.\n\t\t\tconst fieldKey = source.args.field;\n\t\t\tconst { value: fieldValue, label: fieldLabel } =\n\t\t\t\tdataFields?.[ fieldKey ] || {};\n\t\t\tnewValues[ attributeName ] = fieldValue ?? fieldLabel ?? fieldKey;\n\t\t}\n\t\treturn newValues;\n\t},\n\t// eslint-disable-next-line no-unused-vars\n\tsetValues( { dispatch, context, bindings } ) {\n\t\t// Terms are typically not editable through block bindings in most contexts.\n\t\treturn false;\n\t},\n\tcanUserEditValue( { select, context, args } ) {\n\t\tconst { getBlockName, getSelectedBlockClientId } =\n\t\t\tselect( blockEditorStore );\n\n\t\tconst clientId = getSelectedBlockClientId();\n\t\tconst blockName = getBlockName?.( clientId );\n\n\t\t// Navigaton block types are read-only.\n\t\t// See https://github.com/WordPress/gutenberg/pull/72165.\n\t\tif ( NAVIGATION_BLOCK_TYPES.includes( blockName ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Terms are typically read-only when displayed.\n\t\tif ( context?.termQuery ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Lock editing when `taxonomy` or `termId` is not defined.\n\t\tif ( ! context?.taxonomy || ! context?.termId ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst fieldValue = getTermDataFields( select, context, undefined )?.[\n\t\t\targs.field\n\t\t]?.value;\n\t\t// Empty string or `false` could be a valid value, so we need to check if the field value is undefined.\n\t\tif ( fieldValue === undefined ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn false;\n\t},\n\tgetFieldsList( { select, context } ) {\n\t\tconst clientId = select( blockEditorStore ).getSelectedBlockClientId();\n\t\tconst termDataFields = getTermDataFields( select, context, clientId );\n\t\tif ( ! termDataFields ) {\n\t\t\treturn [];\n\t\t}\n\t\treturn Object.entries( termDataFields ).map( ( [ key, field ] ) => ( {\n\t\t\tlabel: field.label,\n\t\t\ttype: field.type,\n\t\t\targs: { field: key },\n\t\t} ) );\n\t},\n};\n"],
|
|
5
|
-
"mappings": "AAGA,SAAS,UAAU;AACnB,SAAS,SAAS,qBAAqB;AACvC,SAAS,SAAS,wBAAwB;AAG1C,
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/autocompleters/index.js"],
|
|
4
4
|
"sourcesContent": ["export { default as userAutocompleter } from './user';\n"],
|
|
5
|
-
"mappings": "AAAA,SAAoB,WAAXA,gBAAoC;",
|
|
5
|
+
"mappings": ";AAAA,SAAoB,WAAXA,gBAAoC;",
|
|
6
6
|
"names": ["default"]
|
|
7
7
|
}
|