@wordpress/editor 14.8.8 → 14.10.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 +4 -0
- package/build/bindings/api.js +0 -29
- package/build/bindings/api.js.map +1 -1
- package/build/components/autocompleters/user.js.map +1 -1
- package/build/components/block-manager/index.js +2 -2
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/block-settings-menu/content-only-settings-menu.js +15 -18
- package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
- package/build/components/commands/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/create-template-part-modal/utils.js.map +1 -1
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-outline/item.js.map +1 -1
- package/build/components/document-tools/index.js +2 -7
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/entities-saved-states/index.js +1 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/header/index.js +19 -16
- package/build/components/header/index.js.map +1 -1
- package/build/components/inserter-sidebar/index.js +8 -9
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/media-categories/index.js.map +1 -1
- package/build/components/page-attributes/parent.js +1 -1
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-content-information/index.js +1 -1
- package/build/components/post-content-information/index.js.map +1 -1
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-format/index.js +1 -1
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-last-revision/index.js +1 -1
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-locked-modal/index.js +2 -2
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-preview-button/index.js +1 -1
- package/build/components/post-preview-button/index.js.map +1 -1
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +1 -0
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/post-publish-panel/media-util.js +1 -0
- package/build/components/post-publish-panel/media-util.js.map +1 -1
- package/build/components/post-publish-panel/postpublish.js +1 -1
- package/build/components/post-publish-panel/postpublish.js.map +1 -1
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +4 -4
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +3 -2
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +1 -1
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/panel.js.map +1 -1
- package/build/components/post-template/classic-theme.js +2 -4
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-text-editor/index.js.map +1 -1
- package/build/components/post-title/index.js +15 -19
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/index.native.js +2 -2
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-url/index.js +76 -63
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/panel.js +46 -26
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/disable-non-page-content-blocks.js +17 -18
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/index.js +1 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-post-content-blocks.js +34 -0
- package/build/components/provider/use-post-content-blocks.js.map +1 -0
- package/build/components/resizable-editor/resize-handle.js +4 -0
- package/build/components/resizable-editor/resize-handle.js.map +1 -1
- package/build/components/time-to-read/index.js +1 -1
- package/build/components/time-to-read/index.js.map +1 -1
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build/components/zoom-out-toggle/index.js +1 -1
- package/build/components/zoom-out-toggle/index.js.map +1 -1
- package/build/dataviews/actions/duplicate-template-part.js +1 -1
- package/build/dataviews/actions/duplicate-template-part.js.map +1 -1
- package/build/dataviews/store/private-actions.js +2 -7
- package/build/dataviews/store/private-actions.js.map +1 -1
- package/build/private-apis.js +0 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +46 -6
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +1 -0
- package/build/store/constants.js.map +1 -1
- package/build/store/local-autosave.js.map +1 -1
- package/build/store/private-actions.js +7 -6
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +3 -3
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/selectors.js +21 -0
- package/build/store/selectors.js.map +1 -1
- package/build/utils/media-upload/index.js.map +1 -1
- package/build-module/bindings/api.js +1 -29
- package/build-module/bindings/api.js.map +1 -1
- package/build-module/components/autocompleters/user.js +1 -3
- package/build-module/components/autocompleters/user.js.map +1 -1
- package/build-module/components/block-manager/category.js +1 -2
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/block-manager/checklist.js +1 -2
- package/build-module/components/block-manager/checklist.js.map +1 -1
- package/build-module/components/block-manager/index.js +3 -4
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js +15 -21
- package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
- package/build-module/components/blog-title/index.js +1 -3
- package/build-module/components/blog-title/index.js.map +1 -1
- package/build-module/components/collapsible-block-toolbar/index.js +1 -3
- package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
- package/build-module/components/commands/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +1 -2
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/utils.js.map +1 -1
- package/build-module/components/document-bar/index.js +1 -2
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-outline/index.js +1 -2
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-outline/item.js +1 -2
- package/build-module/components/document-outline/item.js.map +1 -1
- package/build-module/components/document-tools/index.js +3 -10
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor/index.js +1 -3
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-help/add-blocks.native.js +1 -3
- package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/customize-blocks.native.js +1 -3
- package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js +1 -2
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build-module/components/editor-help/index.native.js +1 -3
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-help/intro-to-blocks.native.js +1 -3
- package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/move-blocks.native.js +1 -3
- package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/remove-blocks.native.js +1 -3
- package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/view-sections.native.js +1 -2
- package/build-module/components/editor-help/view-sections.native.js.map +1 -1
- package/build-module/components/editor-interface/index.js +1 -3
- package/build-module/components/editor-interface/index.js.map +1 -1
- package/build-module/components/editor-notices/index.js +1 -3
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +1 -3
- 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 +1 -2
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +2 -3
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/error-boundary/index.native.js +1 -2
- package/build-module/components/error-boundary/index.native.js.map +1 -1
- package/build-module/components/header/index.js +20 -18
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/inserter-sidebar/index.js +8 -9
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -2
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -3
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/list-view-sidebar/list-view-outline.js +1 -3
- package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
- package/build-module/components/media-categories/index.js.map +1 -1
- package/build-module/components/more-menu/index.js +1 -3
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/offline-status/index.native.js +1 -2
- package/build-module/components/offline-status/index.native.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +2 -3
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/plugin-document-setting-panel/index.js +1 -3
- package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/components/post-actions/index.js +1 -3
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-author/panel.js +1 -2
- package/build-module/components/post-author/panel.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +1 -2
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-content-information/index.js +1 -1
- package/build-module/components/post-content-information/index.js.map +1 -1
- package/build-module/components/post-discussion/panel.js +1 -2
- package/build-module/components/post-discussion/panel.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js +1 -3
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +1 -2
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-format/index.js +2 -3
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-format/panel.js +1 -2
- package/build-module/components/post-format/panel.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +1 -1
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +3 -5
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-panel-row/index.js +1 -2
- package/build-module/components/post-panel-row/index.js.map +1 -1
- package/build-module/components/post-preview-button/index.js +2 -4
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +1 -2
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +1 -3
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js +1 -2
- 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 +2 -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 +1 -2
- 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 -2
- 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 +2 -4
- package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
- package/build-module/components/post-publish-panel/prepublish.js +1 -3
- package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +1 -2
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-status/index.js +1 -3
- package/build-module/components/post-status/index.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +1 -3
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +5 -7
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +4 -4
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +1 -1
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +1 -2
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-taxonomies/panel.js.map +1 -1
- package/build-module/components/post-template/block-theme.js +1 -3
- package/build-module/components/post-template/block-theme.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +3 -6
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/create-new-template-modal.js +1 -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 +1 -3
- package/build-module/components/post-template/create-new-template.js.map +1 -1
- package/build-module/components/post-template/swap-template-button.js +1 -3
- package/build-module/components/post-template/swap-template-button.js.map +1 -1
- package/build-module/components/post-text-editor/index.js +1 -3
- package/build-module/components/post-text-editor/index.js.map +1 -1
- package/build-module/components/post-title/index.js +15 -19
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/index.native.js +2 -2
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/post-trash/index.js +1 -2
- package/build-module/components/post-trash/index.js.map +1 -1
- package/build-module/components/post-url/index.js +78 -66
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/panel.js +48 -28
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/post-visibility/index.js +1 -2
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/components/posts-per-page/index.js +1 -3
- package/build-module/components/posts-per-page/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +1 -3
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +1 -3
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js +17 -18
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/provider/index.js +2 -4
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +1 -3
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-post-content-blocks.js +27 -0
- package/build-module/components/provider/use-post-content-blocks.js.map +1 -0
- package/build-module/components/resizable-editor/resize-handle.js +5 -3
- package/build-module/components/resizable-editor/resize-handle.js.map +1 -1
- package/build-module/components/save-publish-panels/index.js +1 -3
- package/build-module/components/save-publish-panels/index.js.map +1 -1
- package/build-module/components/sidebar/header.js +1 -2
- package/build-module/components/sidebar/header.js.map +1 -1
- package/build-module/components/sidebar/index.js +1 -2
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-summary.js +1 -3
- package/build-module/components/sidebar/post-summary.js.map +1 -1
- package/build-module/components/site-discussion/index.js +1 -3
- package/build-module/components/site-discussion/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +1 -2
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/table-of-contents/panel.js +1 -3
- package/build-module/components/table-of-contents/panel.js.map +1 -1
- package/build-module/components/template-part-menu-items/convert-to-template-part.js +1 -3
- package/build-module/components/template-part-menu-items/convert-to-template-part.js.map +1 -1
- package/build-module/components/template-validation-notice/index.js +1 -3
- package/build-module/components/template-validation-notice/index.js.map +1 -1
- package/build-module/components/text-editor/index.js +1 -2
- package/build-module/components/text-editor/index.js.map +1 -1
- package/build-module/components/time-to-read/index.js +1 -1
- package/build-module/components/time-to-read/index.js.map +1 -1
- package/build-module/components/visual-editor/index.js +1 -3
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build-module/components/zoom-out-toggle/index.js +1 -1
- package/build-module/components/zoom-out-toggle/index.js.map +1 -1
- package/build-module/dataviews/actions/duplicate-template-part.js +1 -1
- package/build-module/dataviews/actions/duplicate-template-part.js.map +1 -1
- package/build-module/dataviews/store/private-actions.js +4 -8
- package/build-module/dataviews/store/private-actions.js.map +1 -1
- package/build-module/hooks/pattern-overrides.js +1 -3
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/private-apis.js +1 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +44 -6
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +1 -0
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/local-autosave.js.map +1 -1
- package/build-module/store/private-actions.js +7 -6
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +2 -2
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/selectors.js +21 -0
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/build-style/style-rtl.css +29 -6
- package/build-style/style.css +29 -6
- package/build-types/bindings/api.d.ts +0 -13
- package/build-types/bindings/api.d.ts.map +1 -1
- package/build-types/components/document-tools/index.d.ts.map +1 -1
- package/build-types/components/header/index.d.ts.map +1 -1
- package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
- package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
- package/build-types/components/post-url/index.d.ts.map +1 -1
- package/build-types/components/post-url/panel.d.ts.map +1 -1
- package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/provider/use-post-content-blocks.d.ts +2 -0
- package/build-types/components/provider/use-post-content-blocks.d.ts.map +1 -0
- package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/store/actions.d.ts +2 -17
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts +2 -2
- package/build-types/store/private-selectors.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +21 -0
- package/build-types/store/selectors.d.ts.map +1 -1
- package/package.json +38 -38
- package/src/bindings/api.js +1 -32
- package/src/components/block-settings-menu/content-only-settings-menu.js +19 -19
- package/src/components/document-tools/index.js +2 -5
- package/src/components/header/index.js +24 -13
- package/src/components/inserter-sidebar/index.js +8 -11
- package/src/components/post-saved-state/test/__snapshots__/index.js.snap +1 -1
- package/src/components/post-taxonomies/hierarchical-term-selector.js +1 -0
- package/src/components/post-template/classic-theme.js +1 -2
- package/src/components/post-url/index.js +67 -55
- package/src/components/post-url/panel.js +57 -33
- package/src/components/post-url/style.scss +21 -3
- package/src/components/provider/disable-non-page-content-blocks.js +20 -34
- package/src/components/provider/index.js +1 -0
- package/src/components/provider/use-post-content-blocks.js +42 -0
- package/src/components/resizable-editor/resize-handle.js +5 -0
- package/src/components/zoom-out-toggle/index.js +1 -1
- package/src/dataviews/store/private-actions.ts +7 -7
- package/src/private-apis.js +1 -5
- package/src/store/actions.js +51 -7
- package/src/store/private-selectors.js +2 -2
- package/src/store/selectors.js +21 -0
- package/src/store/test/actions.js +76 -0
- package/src/store/test/reducer.js +0 -22
- package/tsconfig.tsbuildinfo +1 -1
- package/build/dataviews/actions/delete-post.js +0 -98
- package/build/dataviews/actions/delete-post.js.map +0 -1
- package/build/dataviews/actions/rename-post.js +0 -125
- package/build/dataviews/actions/rename-post.js.map +0 -1
- package/build/dataviews/actions/reset-post.js +0 -113
- package/build/dataviews/actions/reset-post.js.map +0 -1
- package/build/dataviews/actions/restore-post.js +0 -112
- package/build/dataviews/actions/restore-post.js.map +0 -1
- package/build/dataviews/actions/trash-post.js +0 -144
- package/build/dataviews/actions/trash-post.js.map +0 -1
- package/build/dataviews/fields/index.js +0 -32
- package/build/dataviews/fields/index.js.map +0 -1
- package/build-module/dataviews/actions/delete-post.js +0 -89
- package/build-module/dataviews/actions/delete-post.js.map +0 -1
- package/build-module/dataviews/actions/rename-post.js +0 -118
- package/build-module/dataviews/actions/rename-post.js.map +0 -1
- package/build-module/dataviews/actions/reset-post.js +0 -106
- package/build-module/dataviews/actions/reset-post.js.map +0 -1
- package/build-module/dataviews/actions/restore-post.js +0 -104
- package/build-module/dataviews/actions/restore-post.js.map +0 -1
- package/build-module/dataviews/actions/trash-post.js +0 -137
- package/build-module/dataviews/actions/trash-post.js.map +0 -1
- package/build-module/dataviews/fields/index.js +0 -26
- package/build-module/dataviews/fields/index.js.map +0 -1
- package/build-types/dataviews/actions/delete-post.d.ts +0 -5
- package/build-types/dataviews/actions/delete-post.d.ts.map +0 -1
- package/build-types/dataviews/actions/rename-post.d.ts +0 -5
- package/build-types/dataviews/actions/rename-post.d.ts.map +0 -1
- package/build-types/dataviews/actions/reset-post.d.ts +0 -5
- package/build-types/dataviews/actions/reset-post.d.ts.map +0 -1
- package/build-types/dataviews/actions/restore-post.d.ts +0 -5
- package/build-types/dataviews/actions/restore-post.d.ts.map +0 -1
- package/build-types/dataviews/actions/trash-post.d.ts +0 -5
- package/build-types/dataviews/actions/trash-post.d.ts.map +0 -1
- package/build-types/dataviews/fields/index.d.ts +0 -8
- package/build-types/dataviews/fields/index.d.ts.map +0 -1
- package/src/dataviews/actions/delete-post.tsx +0 -109
- package/src/dataviews/actions/rename-post.tsx +0 -146
- package/src/dataviews/actions/reset-post.tsx +0 -147
- package/src/dataviews/actions/restore-post.tsx +0 -134
- package/src/dataviews/actions/trash-post.tsx +0 -198
- package/src/dataviews/fields/index.ts +0 -26
|
@@ -177,8 +177,7 @@ function PostTemplateDropdownContent( { onClose } ) {
|
|
|
177
177
|
{ canEdit && onNavigateToEntityRecord && (
|
|
178
178
|
<p>
|
|
179
179
|
<Button
|
|
180
|
-
|
|
181
|
-
__next40pxDefaultSize={ false }
|
|
180
|
+
__next40pxDefaultSize
|
|
182
181
|
variant="link"
|
|
183
182
|
onClick={ () => {
|
|
184
183
|
onNavigateToEntityRecord( {
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import { store as noticesStore } from '@wordpress/notices';
|
|
18
18
|
import { copySmall } from '@wordpress/icons';
|
|
19
19
|
import { store as coreStore } from '@wordpress/core-data';
|
|
20
|
-
import { useCopyToClipboard } from '@wordpress/compose';
|
|
20
|
+
import { useCopyToClipboard, useInstanceId } from '@wordpress/compose';
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Internal dependencies
|
|
@@ -70,25 +70,29 @@ export default function PostURL( { onClose } ) {
|
|
|
70
70
|
const { createNotice } = useDispatch( noticesStore );
|
|
71
71
|
const [ forceEmptyField, setForceEmptyField ] = useState( false );
|
|
72
72
|
const copyButtonRef = useCopyToClipboard( permalink, () => {
|
|
73
|
-
createNotice( 'info', __( 'Copied
|
|
73
|
+
createNotice( 'info', __( 'Copied Permalink to clipboard.' ), {
|
|
74
74
|
isDismissible: true,
|
|
75
75
|
type: 'snackbar',
|
|
76
76
|
} );
|
|
77
77
|
} );
|
|
78
|
+
const postUrlSlugDescriptionId =
|
|
79
|
+
'editor-post-url__slug-descriotion-' + useInstanceId( PostURL );
|
|
80
|
+
|
|
78
81
|
return (
|
|
79
82
|
<div className="editor-post-url">
|
|
80
83
|
<InspectorPopoverHeader
|
|
81
|
-
title={ __( '
|
|
84
|
+
title={ __( 'Slug' ) }
|
|
82
85
|
onClose={ onClose }
|
|
83
86
|
/>
|
|
84
87
|
<VStack spacing={ 3 }>
|
|
85
88
|
{ isEditable && (
|
|
86
|
-
<
|
|
89
|
+
<p className="editor-post-url__intro">
|
|
87
90
|
{ createInterpolateElement(
|
|
88
91
|
__(
|
|
89
|
-
'Customize the last part of the
|
|
92
|
+
'<span>Customize the last part of the Permalink.</span> <a>Learn more.</a>'
|
|
90
93
|
),
|
|
91
94
|
{
|
|
95
|
+
span: <span id={ postUrlSlugDescriptionId } />,
|
|
92
96
|
a: (
|
|
93
97
|
<ExternalLink
|
|
94
98
|
href={ __(
|
|
@@ -98,59 +102,67 @@ export default function PostURL( { onClose } ) {
|
|
|
98
102
|
),
|
|
99
103
|
}
|
|
100
104
|
) }
|
|
101
|
-
</
|
|
105
|
+
</p>
|
|
102
106
|
) }
|
|
103
107
|
<div>
|
|
104
108
|
{ isEditable && (
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
suffix={
|
|
113
|
-
<InputControlSuffixWrapper variant="control">
|
|
114
|
-
<Button
|
|
115
|
-
icon={ copySmall }
|
|
116
|
-
ref={ copyButtonRef }
|
|
117
|
-
size="small"
|
|
118
|
-
label="Copy"
|
|
119
|
-
/>
|
|
120
|
-
</InputControlSuffixWrapper>
|
|
121
|
-
}
|
|
122
|
-
label={ __( 'Link' ) }
|
|
123
|
-
hideLabelFromVision
|
|
124
|
-
value={ forceEmptyField ? '' : postSlug }
|
|
125
|
-
autoComplete="off"
|
|
126
|
-
spellCheck="false"
|
|
127
|
-
type="text"
|
|
128
|
-
className="editor-post-url__input"
|
|
129
|
-
onChange={ ( newValue ) => {
|
|
130
|
-
editPost( { slug: newValue } );
|
|
131
|
-
// When we delete the field the permalink gets
|
|
132
|
-
// reverted to the original value.
|
|
133
|
-
// The forceEmptyField logic allows the user to have
|
|
134
|
-
// the field temporarily empty while typing.
|
|
135
|
-
if ( ! newValue ) {
|
|
136
|
-
if ( ! forceEmptyField ) {
|
|
137
|
-
setForceEmptyField( true );
|
|
138
|
-
}
|
|
139
|
-
return;
|
|
109
|
+
<>
|
|
110
|
+
<InputControl
|
|
111
|
+
__next40pxDefaultSize
|
|
112
|
+
prefix={
|
|
113
|
+
<InputControlPrefixWrapper>
|
|
114
|
+
/
|
|
115
|
+
</InputControlPrefixWrapper>
|
|
140
116
|
}
|
|
141
|
-
|
|
142
|
-
|
|
117
|
+
suffix={
|
|
118
|
+
<InputControlSuffixWrapper variant="control">
|
|
119
|
+
<Button
|
|
120
|
+
icon={ copySmall }
|
|
121
|
+
ref={ copyButtonRef }
|
|
122
|
+
size="small"
|
|
123
|
+
label="Copy"
|
|
124
|
+
/>
|
|
125
|
+
</InputControlSuffixWrapper>
|
|
143
126
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
127
|
+
label={ __( 'Slug' ) }
|
|
128
|
+
hideLabelFromVision
|
|
129
|
+
value={ forceEmptyField ? '' : postSlug }
|
|
130
|
+
autoComplete="off"
|
|
131
|
+
spellCheck="false"
|
|
132
|
+
type="text"
|
|
133
|
+
className="editor-post-url__input"
|
|
134
|
+
onChange={ ( newValue ) => {
|
|
135
|
+
editPost( { slug: newValue } );
|
|
136
|
+
// When we delete the field the permalink gets
|
|
137
|
+
// reverted to the original value.
|
|
138
|
+
// The forceEmptyField logic allows the user to have
|
|
139
|
+
// the field temporarily empty while typing.
|
|
140
|
+
if ( ! newValue ) {
|
|
141
|
+
if ( ! forceEmptyField ) {
|
|
142
|
+
setForceEmptyField( true );
|
|
143
|
+
}
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
if ( forceEmptyField ) {
|
|
147
|
+
setForceEmptyField( false );
|
|
148
|
+
}
|
|
149
|
+
} }
|
|
150
|
+
onBlur={ ( event ) => {
|
|
151
|
+
editPost( {
|
|
152
|
+
slug: cleanForSlug(
|
|
153
|
+
event.target.value
|
|
154
|
+
),
|
|
155
|
+
} );
|
|
156
|
+
if ( forceEmptyField ) {
|
|
157
|
+
setForceEmptyField( false );
|
|
158
|
+
}
|
|
159
|
+
} }
|
|
160
|
+
aria-describedby={ postUrlSlugDescriptionId }
|
|
161
|
+
/>
|
|
162
|
+
<p className="editor-post-url__permalink">
|
|
163
|
+
<span className="editor-post-url__permalink-visual-label">
|
|
164
|
+
{ __( 'Permalink:' ) }
|
|
165
|
+
</span>
|
|
154
166
|
<ExternalLink
|
|
155
167
|
className="editor-post-url__link"
|
|
156
168
|
href={ postLink }
|
|
@@ -166,8 +178,8 @@ export default function PostURL( { onClose } ) {
|
|
|
166
178
|
{ permalinkSuffix }
|
|
167
179
|
</span>
|
|
168
180
|
</ExternalLink>
|
|
169
|
-
|
|
170
|
-
|
|
181
|
+
</p>
|
|
182
|
+
</>
|
|
171
183
|
) }
|
|
172
184
|
{ ! isEditable && (
|
|
173
185
|
<ExternalLink
|
|
@@ -3,11 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useMemo, useState } from '@wordpress/element';
|
|
5
5
|
import { useSelect } from '@wordpress/data';
|
|
6
|
-
import {
|
|
7
|
-
Dropdown,
|
|
8
|
-
Button,
|
|
9
|
-
__experimentalTruncate as Truncate,
|
|
10
|
-
} from '@wordpress/components';
|
|
6
|
+
import { Dropdown, Button, ExternalLink } from '@wordpress/components';
|
|
11
7
|
import { __, sprintf } from '@wordpress/i18n';
|
|
12
8
|
import { safeDecodeURIComponent } from '@wordpress/url';
|
|
13
9
|
import { store as coreStore } from '@wordpress/core-data';
|
|
@@ -26,6 +22,20 @@ import { store as editorStore } from '../../store';
|
|
|
26
22
|
* @return {JSX.Element} The rendered PostURLPanel component.
|
|
27
23
|
*/
|
|
28
24
|
export default function PostURLPanel() {
|
|
25
|
+
const { isFrontPage } = useSelect( ( select ) => {
|
|
26
|
+
const { getCurrentPostId } = select( editorStore );
|
|
27
|
+
const { getEditedEntityRecord, canUser } = select( coreStore );
|
|
28
|
+
const siteSettings = canUser( 'read', {
|
|
29
|
+
kind: 'root',
|
|
30
|
+
name: 'site',
|
|
31
|
+
} )
|
|
32
|
+
? getEditedEntityRecord( 'root', 'site' )
|
|
33
|
+
: undefined;
|
|
34
|
+
const _id = getCurrentPostId();
|
|
35
|
+
return {
|
|
36
|
+
isFrontPage: siteSettings?.page_on_front === _id,
|
|
37
|
+
};
|
|
38
|
+
}, [] );
|
|
29
39
|
// Use internal state instead of a ref to make sure that the component
|
|
30
40
|
// re-renders when the popover's anchor updates.
|
|
31
41
|
const [ popoverAnchor, setPopoverAnchor ] = useState( null );
|
|
@@ -42,41 +52,38 @@ export default function PostURLPanel() {
|
|
|
42
52
|
[ popoverAnchor ]
|
|
43
53
|
);
|
|
44
54
|
|
|
55
|
+
const label = isFrontPage ? __( 'Link' ) : __( 'Slug' );
|
|
56
|
+
|
|
45
57
|
return (
|
|
46
58
|
<PostURLCheck>
|
|
47
|
-
<PostPanelRow label={
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
<PostPanelRow label={ label } ref={ setPopoverAnchor }>
|
|
60
|
+
{ ! isFrontPage && (
|
|
61
|
+
<Dropdown
|
|
62
|
+
popoverProps={ popoverProps }
|
|
63
|
+
className="editor-post-url__panel-dropdown"
|
|
64
|
+
contentClassName="editor-post-url__panel-dialog"
|
|
65
|
+
focusOnMount
|
|
66
|
+
renderToggle={ ( { isOpen, onToggle } ) => (
|
|
67
|
+
<PostURLToggle
|
|
68
|
+
isOpen={ isOpen }
|
|
69
|
+
onClick={ onToggle }
|
|
70
|
+
/>
|
|
71
|
+
) }
|
|
72
|
+
renderContent={ ( { onClose } ) => (
|
|
73
|
+
<PostURL onClose={ onClose } />
|
|
74
|
+
) }
|
|
75
|
+
/>
|
|
76
|
+
) }
|
|
77
|
+
{ isFrontPage && <FrontPageLink /> }
|
|
60
78
|
</PostPanelRow>
|
|
61
79
|
</PostURLCheck>
|
|
62
80
|
);
|
|
63
81
|
}
|
|
64
82
|
|
|
65
83
|
function PostURLToggle( { isOpen, onClick } ) {
|
|
66
|
-
const { slug
|
|
67
|
-
const { getCurrentPostId, getCurrentPost } = select( editorStore );
|
|
68
|
-
const { getEditedEntityRecord, canUser } = select( coreStore );
|
|
69
|
-
const siteSettings = canUser( 'read', {
|
|
70
|
-
kind: 'root',
|
|
71
|
-
name: 'site',
|
|
72
|
-
} )
|
|
73
|
-
? getEditedEntityRecord( 'root', 'site' )
|
|
74
|
-
: undefined;
|
|
75
|
-
const _id = getCurrentPostId();
|
|
84
|
+
const { slug } = useSelect( ( select ) => {
|
|
76
85
|
return {
|
|
77
86
|
slug: select( editorStore ).getEditedPostSlug(),
|
|
78
|
-
isFrontPage: siteSettings?.page_on_front === _id,
|
|
79
|
-
postLink: getCurrentPost()?.link,
|
|
80
87
|
};
|
|
81
88
|
}, [] );
|
|
82
89
|
const decodedSlug = safeDecodeURIComponent( slug );
|
|
@@ -90,9 +97,26 @@ function PostURLToggle( { isOpen, onClick } ) {
|
|
|
90
97
|
aria-label={ sprintf( __( 'Change link: %s' ), decodedSlug ) }
|
|
91
98
|
onClick={ onClick }
|
|
92
99
|
>
|
|
93
|
-
|
|
94
|
-
{ isFrontPage ? postLink : `/${ decodedSlug }` }
|
|
95
|
-
</Truncate>
|
|
100
|
+
<>{ decodedSlug }</>
|
|
96
101
|
</Button>
|
|
97
102
|
);
|
|
98
103
|
}
|
|
104
|
+
|
|
105
|
+
function FrontPageLink() {
|
|
106
|
+
const { postLink } = useSelect( ( select ) => {
|
|
107
|
+
const { getCurrentPost } = select( editorStore );
|
|
108
|
+
return {
|
|
109
|
+
postLink: getCurrentPost()?.link,
|
|
110
|
+
};
|
|
111
|
+
}, [] );
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<ExternalLink
|
|
115
|
+
className="editor-post-url__front-page-link"
|
|
116
|
+
href={ postLink }
|
|
117
|
+
target="_blank"
|
|
118
|
+
>
|
|
119
|
+
{ postLink }
|
|
120
|
+
</ExternalLink>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
@@ -9,14 +9,19 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
/* rtl:begin:ignore */
|
|
12
|
-
.editor-post-url__link
|
|
12
|
+
.editor-post-url__link,
|
|
13
|
+
.editor-post-url__front-page-link {
|
|
13
14
|
direction: ltr;
|
|
14
15
|
word-break: break-word;
|
|
15
|
-
margin-top: $grid-unit-05;
|
|
16
|
-
color: $gray-700;
|
|
17
16
|
}
|
|
18
17
|
/* rtl:end:ignore */
|
|
19
18
|
|
|
19
|
+
.editor-post-url__front-page-link {
|
|
20
|
+
// Match padding on tertiary buttons for alignment.
|
|
21
|
+
padding: $grid-unit-15 * 0.5 0 $grid-unit-15 * 0.5 $grid-unit-15;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
20
25
|
.editor-post-url__link-slug {
|
|
21
26
|
font-weight: 600;
|
|
22
27
|
}
|
|
@@ -30,3 +35,16 @@
|
|
|
30
35
|
.editor-post-url__panel-toggle {
|
|
31
36
|
word-break: break-word;
|
|
32
37
|
}
|
|
38
|
+
|
|
39
|
+
.editor-post-url__intro {
|
|
40
|
+
margin: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.editor-post-url__permalink {
|
|
44
|
+
margin-top: $grid-unit-10;
|
|
45
|
+
margin-bottom: 0;
|
|
46
|
+
|
|
47
|
+
&-visual-label {
|
|
48
|
+
display: block;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -3,52 +3,32 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useSelect, useRegistry } from '@wordpress/data';
|
|
5
5
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
6
|
-
import { useEffect
|
|
7
|
-
import { applyFilters } from '@wordpress/hooks';
|
|
6
|
+
import { useEffect } from '@wordpress/element';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Internal dependencies
|
|
11
10
|
*/
|
|
12
|
-
import
|
|
13
|
-
import { unlock } from '../../lock-unlock';
|
|
14
|
-
|
|
15
|
-
const POST_CONTENT_BLOCK_TYPES = [
|
|
16
|
-
'core/post-title',
|
|
17
|
-
'core/post-featured-image',
|
|
18
|
-
'core/post-content',
|
|
19
|
-
];
|
|
11
|
+
import usePostContentBlocks from './use-post-content-blocks';
|
|
20
12
|
|
|
21
13
|
/**
|
|
22
14
|
* Component that when rendered, makes it so that the site editor allows only
|
|
23
15
|
* page content to be edited.
|
|
24
16
|
*/
|
|
25
17
|
export default function DisableNonPageContentBlocks() {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
'core/template-part',
|
|
33
|
-
],
|
|
34
|
-
[]
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
// Note that there are two separate subscriptions because the result for each
|
|
38
|
-
// returns a new array.
|
|
39
|
-
const contentOnlyIds = useSelect(
|
|
18
|
+
const contentOnlyIds = usePostContentBlocks();
|
|
19
|
+
const templateParts = useSelect( ( select ) => {
|
|
20
|
+
const { getBlocksByName } = select( blockEditorStore );
|
|
21
|
+
return getBlocksByName( 'core/template-part' );
|
|
22
|
+
}, [] );
|
|
23
|
+
const disabledIds = useSelect(
|
|
40
24
|
( select ) => {
|
|
41
|
-
const {
|
|
42
|
-
return
|
|
25
|
+
const { getBlockOrder } = select( blockEditorStore );
|
|
26
|
+
return templateParts.flatMap( ( clientId ) =>
|
|
27
|
+
getBlockOrder( clientId )
|
|
28
|
+
);
|
|
43
29
|
},
|
|
44
|
-
[
|
|
30
|
+
[ templateParts ]
|
|
45
31
|
);
|
|
46
|
-
const disabledIds = useSelect( ( select ) => {
|
|
47
|
-
const { getBlocksByName, getBlockOrder } = select( blockEditorStore );
|
|
48
|
-
return getBlocksByName( 'core/template-part' ).flatMap( ( clientId ) =>
|
|
49
|
-
getBlockOrder( clientId )
|
|
50
|
-
);
|
|
51
|
-
}, [] );
|
|
52
32
|
|
|
53
33
|
const registry = useRegistry();
|
|
54
34
|
|
|
@@ -61,6 +41,9 @@ export default function DisableNonPageContentBlocks() {
|
|
|
61
41
|
for ( const clientId of contentOnlyIds ) {
|
|
62
42
|
setBlockEditingMode( clientId, 'contentOnly' );
|
|
63
43
|
}
|
|
44
|
+
for ( const clientId of templateParts ) {
|
|
45
|
+
setBlockEditingMode( clientId, 'contentOnly' );
|
|
46
|
+
}
|
|
64
47
|
for ( const clientId of disabledIds ) {
|
|
65
48
|
setBlockEditingMode( clientId, 'disabled' );
|
|
66
49
|
}
|
|
@@ -72,12 +55,15 @@ export default function DisableNonPageContentBlocks() {
|
|
|
72
55
|
for ( const clientId of contentOnlyIds ) {
|
|
73
56
|
unsetBlockEditingMode( clientId );
|
|
74
57
|
}
|
|
58
|
+
for ( const clientId of templateParts ) {
|
|
59
|
+
unsetBlockEditingMode( clientId );
|
|
60
|
+
}
|
|
75
61
|
for ( const clientId of disabledIds ) {
|
|
76
62
|
unsetBlockEditingMode( clientId );
|
|
77
63
|
}
|
|
78
64
|
} );
|
|
79
65
|
};
|
|
80
|
-
}, [ contentOnlyIds, disabledIds, registry ] );
|
|
66
|
+
}, [ templateParts, contentOnlyIds, disabledIds, registry ] );
|
|
81
67
|
|
|
82
68
|
return null;
|
|
83
69
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useSelect } from '@wordpress/data';
|
|
5
|
+
import { useMemo } from '@wordpress/element';
|
|
6
|
+
import { applyFilters } from '@wordpress/hooks';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { store as editorStore } from '../../store';
|
|
12
|
+
import { unlock } from '../../lock-unlock';
|
|
13
|
+
|
|
14
|
+
const POST_CONTENT_BLOCK_TYPES = [
|
|
15
|
+
'core/post-title',
|
|
16
|
+
'core/post-featured-image',
|
|
17
|
+
'core/post-content',
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
export default function usePostContentBlocks() {
|
|
21
|
+
const contentOnlyBlockTypes = useMemo(
|
|
22
|
+
() => [
|
|
23
|
+
...applyFilters(
|
|
24
|
+
'editor.postContentBlockTypes',
|
|
25
|
+
POST_CONTENT_BLOCK_TYPES
|
|
26
|
+
),
|
|
27
|
+
],
|
|
28
|
+
[]
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
// Note that there are two separate subscriptions because the result for each
|
|
32
|
+
// returns a new array.
|
|
33
|
+
const contentOnlyIds = useSelect(
|
|
34
|
+
( select ) => {
|
|
35
|
+
const { getPostBlocksByName } = unlock( select( editorStore ) );
|
|
36
|
+
return getPostBlocksByName( contentOnlyBlockTypes );
|
|
37
|
+
},
|
|
38
|
+
[ contentOnlyBlockTypes ]
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
return contentOnlyIds;
|
|
42
|
+
}
|
|
@@ -15,6 +15,11 @@ export default function ResizeHandle( { direction, resizeWidthBy } ) {
|
|
|
15
15
|
function handleKeyDown( event ) {
|
|
16
16
|
const { keyCode } = event;
|
|
17
17
|
|
|
18
|
+
if ( keyCode !== LEFT && keyCode !== RIGHT ) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
event.preventDefault();
|
|
22
|
+
|
|
18
23
|
if (
|
|
19
24
|
( direction === 'left' && keyCode === LEFT ) ||
|
|
20
25
|
( direction === 'right' && keyCode === RIGHT )
|
|
@@ -8,11 +8,6 @@ import { doAction } from '@wordpress/hooks';
|
|
|
8
8
|
/**
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
11
|
-
import duplicateTemplatePart from '../actions/duplicate-template-part';
|
|
12
|
-
import resetPost from '../actions/reset-post';
|
|
13
|
-
import trashPost from '../actions/trash-post';
|
|
14
|
-
import renamePost from '../actions/rename-post';
|
|
15
|
-
import restorePost from '../actions/restore-post';
|
|
16
11
|
import type { PostType } from '../types';
|
|
17
12
|
import { store as editorStore } from '../../store';
|
|
18
13
|
import { unlock } from '../../lock-unlock';
|
|
@@ -24,8 +19,13 @@ import {
|
|
|
24
19
|
reorderPage,
|
|
25
20
|
exportPattern,
|
|
26
21
|
permanentlyDeletePost,
|
|
22
|
+
restorePost,
|
|
23
|
+
trashPost,
|
|
24
|
+
renamePost,
|
|
25
|
+
resetPost,
|
|
26
|
+
deletePost,
|
|
27
27
|
} from '@wordpress/fields';
|
|
28
|
-
import
|
|
28
|
+
import duplicateTemplatePart from '../actions/duplicate-template-part';
|
|
29
29
|
|
|
30
30
|
export function registerEntityAction< Item >(
|
|
31
31
|
kind: string,
|
|
@@ -117,8 +117,8 @@ export const registerPostTypeActions =
|
|
|
117
117
|
? reorderPage
|
|
118
118
|
: undefined,
|
|
119
119
|
postTypeConfig.slug === 'wp_block' ? exportPattern : undefined,
|
|
120
|
-
resetPost,
|
|
121
120
|
restorePost,
|
|
121
|
+
resetPost,
|
|
122
122
|
deletePost,
|
|
123
123
|
trashPost,
|
|
124
124
|
permanentlyDeletePost,
|
package/src/private-apis.js
CHANGED
|
@@ -23,10 +23,7 @@ import {
|
|
|
23
23
|
mergeBaseAndUserConfigs,
|
|
24
24
|
GlobalStylesProvider,
|
|
25
25
|
} from './components/global-styles-provider';
|
|
26
|
-
import {
|
|
27
|
-
registerCoreBlockBindingsSources,
|
|
28
|
-
bootstrapBlockBindingsSourcesFromServer,
|
|
29
|
-
} from './bindings/api';
|
|
26
|
+
import { registerCoreBlockBindingsSources } from './bindings/api';
|
|
30
27
|
|
|
31
28
|
const { store: interfaceStore, ...remainingInterfaceApis } = interfaceApis;
|
|
32
29
|
|
|
@@ -47,7 +44,6 @@ lock( privateApis, {
|
|
|
47
44
|
ViewMoreMenuGroup,
|
|
48
45
|
ResizableEditor,
|
|
49
46
|
registerCoreBlockBindingsSources,
|
|
50
|
-
bootstrapBlockBindingsSourcesFromServer,
|
|
51
47
|
|
|
52
48
|
// This is a temporary private API while we're updating the site editor to use EditorProvider.
|
|
53
49
|
interfaceStore,
|
package/src/store/actions.js
CHANGED
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
getNotificationArgumentsForSaveFail,
|
|
31
31
|
getNotificationArgumentsForTrashFail,
|
|
32
32
|
} from './utils/notice-builder';
|
|
33
|
-
|
|
33
|
+
import { unlock } from '../lock-unlock';
|
|
34
34
|
/**
|
|
35
35
|
* Returns an action generator used in signalling that editor has initialized with
|
|
36
36
|
* the specified post object and editor settings.
|
|
@@ -159,6 +159,29 @@ export function setEditedPost( postType, postId ) {
|
|
|
159
159
|
*
|
|
160
160
|
* @param {Object} edits Post attributes to edit.
|
|
161
161
|
* @param {Object} options Options for the edit.
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```js
|
|
165
|
+
* // Update the post title
|
|
166
|
+
* wp.data.dispatch( 'core/editor' ).editPost( { title: `${ newTitle }` } );
|
|
167
|
+
* ```
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
*```js
|
|
171
|
+
* // Get specific media size based on the featured media ID
|
|
172
|
+
* // Note: change sizes?.large for any registered size
|
|
173
|
+
* const getFeaturedMediaUrl = useSelect( ( select ) => {
|
|
174
|
+
* const getFeaturedMediaId =
|
|
175
|
+
* select( 'core/editor' ).getEditedPostAttribute( 'featured_media' );
|
|
176
|
+
* const getMedia = select( 'core' ).getMedia( getFeaturedMediaId );
|
|
177
|
+
*
|
|
178
|
+
* return (
|
|
179
|
+
* getMedia?.media_details?.sizes?.large?.source_url || getMedia?.source_url || ''
|
|
180
|
+
* );
|
|
181
|
+
* }, [] );
|
|
182
|
+
* ```
|
|
183
|
+
*
|
|
184
|
+
* @return {Object} Action object
|
|
162
185
|
*/
|
|
163
186
|
export const editPost =
|
|
164
187
|
( edits, options ) =>
|
|
@@ -255,7 +278,11 @@ export const savePost =
|
|
|
255
278
|
|
|
256
279
|
if ( ! error ) {
|
|
257
280
|
try {
|
|
258
|
-
await doActionAsync(
|
|
281
|
+
await doActionAsync(
|
|
282
|
+
'editor.savePost',
|
|
283
|
+
{ id: previousRecord.id },
|
|
284
|
+
options
|
|
285
|
+
);
|
|
259
286
|
} catch ( err ) {
|
|
260
287
|
error = err;
|
|
261
288
|
}
|
|
@@ -741,15 +768,32 @@ export function removeEditorPanel( panelName ) {
|
|
|
741
768
|
* use an object.
|
|
742
769
|
* @param {string} value.rootClientId The root client ID to insert at.
|
|
743
770
|
* @param {number} value.insertionIndex The index to insert at.
|
|
771
|
+
* @param {string} value.filterValue A query to filter the inserter results.
|
|
772
|
+
* @param {Function} value.onSelect A callback when an item is selected.
|
|
773
|
+
* @param {string} value.tab The tab to open in the inserter.
|
|
774
|
+
* @param {string} value.category The category to initialize in the inserter.
|
|
744
775
|
*
|
|
745
776
|
* @return {Object} Action object.
|
|
746
777
|
*/
|
|
747
|
-
export
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
778
|
+
export const setIsInserterOpened =
|
|
779
|
+
( value ) =>
|
|
780
|
+
( { dispatch, registry } ) => {
|
|
781
|
+
if (
|
|
782
|
+
typeof value === 'object' &&
|
|
783
|
+
value.hasOwnProperty( 'rootClientId' ) &&
|
|
784
|
+
value.hasOwnProperty( 'insertionIndex' )
|
|
785
|
+
) {
|
|
786
|
+
unlock( registry.dispatch( blockEditorStore ) ).setInsertionPoint( {
|
|
787
|
+
rootClientId: value.rootClientId,
|
|
788
|
+
index: value.insertionIndex,
|
|
789
|
+
} );
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
dispatch( {
|
|
793
|
+
type: 'SET_IS_INSERTER_OPENED',
|
|
794
|
+
value,
|
|
795
|
+
} );
|
|
751
796
|
};
|
|
752
|
-
}
|
|
753
797
|
|
|
754
798
|
/**
|
|
755
799
|
* Returns an action object used to open/close the list view.
|
|
@@ -37,13 +37,13 @@ const EMPTY_INSERTION_POINT = {
|
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* Get the
|
|
40
|
+
* Get the inserter.
|
|
41
41
|
*
|
|
42
42
|
* @param {Object} state Global application state.
|
|
43
43
|
*
|
|
44
44
|
* @return {Object} The root client ID, index to insert at and starting filter value.
|
|
45
45
|
*/
|
|
46
|
-
export const
|
|
46
|
+
export const getInserter = createRegistrySelector( ( select ) =>
|
|
47
47
|
createSelector(
|
|
48
48
|
( state ) => {
|
|
49
49
|
if ( typeof state.blockInserterPanel === 'object' ) {
|