@wordpress/editor 14.1.0 → 14.3.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 +16 -12
- package/README.md +28 -7
- package/build/bindings/pattern-overrides.js +8 -5
- package/build/bindings/pattern-overrides.js.map +1 -1
- package/build/bindings/post-meta.js +4 -0
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +2 -0
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/document-bar/index.js +11 -4
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/editor-interface/index.js +6 -3
- package/build/components/editor-interface/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-record-item.js +4 -12
- package/build/components/entities-saved-states/entity-record-item.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/global-keyboard-shortcuts/index.js +1 -1
- package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build/components/global-styles-provider/index.js +6 -65
- package/build/components/global-styles-provider/index.js.map +1 -1
- package/build/components/header/index.js +6 -2
- package/build/components/header/index.js.map +1 -1
- package/build/components/index.js +10 -2
- package/build/components/index.js.map +1 -1
- package/build/components/inserter-sidebar/index.js +10 -21
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/list-view-sidebar/index.js +19 -47
- package/build/components/list-view-sidebar/index.js.map +1 -1
- package/build/components/page-attributes/parent.js +2 -1
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/post-actions/actions.js +371 -452
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +7 -2
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-excerpt/index.js +2 -1
- package/build/components/post-excerpt/index.js.map +1 -1
- package/build/components/post-excerpt/panel.js +3 -2
- package/build/components/post-excerpt/panel.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-panel/index.js +1 -1
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-saved-state/index.js +11 -1
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/index.js +3 -0
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-slug/check.js +8 -1
- package/build/components/post-slug/check.js.map +1 -1
- package/build/components/post-slug/index.js +6 -0
- package/build/components/post-slug/index.js.map +1 -1
- package/build/components/post-status/index.js +4 -2
- package/build/components/post-status/index.js.map +1 -1
- package/build/components/post-sticky/index.js +9 -13
- package/build/components/post-sticky/index.js.map +1 -1
- package/build/components/post-template/create-new-template-modal.js +2 -0
- package/build/components/post-template/create-new-template-modal.js.map +1 -1
- package/build/components/post-title/index.js +5 -13
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +1 -1
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/index.native.js +0 -4
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +7 -4
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/save-publish-panels/index.js +30 -16
- package/build/components/save-publish-panels/index.js.map +1 -1
- package/build/components/sidebar/index.js +4 -1
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar/post-summary.js +2 -4
- package/build/components/sidebar/post-summary.js.map +1 -1
- package/build/components/template-content-panel/index.js +29 -4
- package/build/components/template-content-panel/index.js.map +1 -1
- package/build/components/template-part-content-panel/index.js +70 -0
- package/build/components/template-part-content-panel/index.js.map +1 -0
- package/build/components/visual-editor/index.js +1 -1
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/dataviews/actions/delete-post.js +96 -0
- package/build/dataviews/actions/delete-post.js.map +1 -0
- package/build/{components/post-actions/export-pattern-action.js → dataviews/actions/export-pattern.js} +11 -20
- package/build/dataviews/actions/export-pattern.js.map +1 -0
- package/build/dataviews/actions/index.js +32 -0
- package/build/dataviews/actions/index.js.map +1 -0
- package/build/dataviews/actions/reset-post.js +111 -0
- package/build/dataviews/actions/reset-post.js.map +1 -0
- package/build/dataviews/actions/utils.js +50 -0
- package/build/dataviews/actions/utils.js.map +1 -0
- package/build/dataviews/store/private-actions.js.map +1 -1
- package/build/dataviews/store/private-selectors.js +6 -6
- package/build/dataviews/store/private-selectors.js.map +1 -1
- package/build/dataviews/store/reducer.js +6 -2
- package/build/dataviews/store/reducer.js.map +1 -1
- package/build/dataviews/types.js +6 -0
- package/build/dataviews/types.js.map +1 -0
- package/build/hooks/pattern-overrides.js +3 -3
- package/build/hooks/pattern-overrides.js.map +1 -1
- package/build/lock-unlock.js +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/private-apis.js +2 -0
- package/build/private-apis.js.map +1 -1
- package/build/private-apis.native.js +0 -2
- package/build/private-apis.native.js.map +1 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/private-actions.js +9 -5
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +0 -18
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/utils/is-template-revertable.js +6 -8
- package/build/store/utils/is-template-revertable.js.map +1 -1
- package/build-module/bindings/pattern-overrides.js +8 -5
- package/build-module/bindings/pattern-overrides.js.map +1 -1
- package/build-module/bindings/post-meta.js +4 -0
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +2 -0
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/document-bar/index.js +11 -4
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/editor-interface/index.js +6 -3
- package/build-module/components/editor-interface/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +6 -14
- package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +1 -1
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/index.js +1 -1
- package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/global-styles-provider/index.js +7 -66
- package/build-module/components/global-styles-provider/index.js.map +1 -1
- package/build-module/components/header/index.js +6 -2
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/index.js +11 -2
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inserter-sidebar/index.js +11 -22
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/list-view-sidebar/index.js +20 -49
- package/build-module/components/list-view-sidebar/index.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +2 -1
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/post-actions/actions.js +370 -450
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +7 -2
- package/build-module/components/post-actions/index.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-preview-button/index.js +1 -1
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +1 -1
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +11 -1
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/index.js +3 -0
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-slug/check.js +9 -0
- package/build-module/components/post-slug/check.js.map +1 -1
- package/build-module/components/post-slug/index.js +6 -0
- package/build-module/components/post-slug/index.js.map +1 -1
- package/build-module/components/post-status/index.js +3 -2
- package/build-module/components/post-status/index.js.map +1 -1
- package/build-module/components/post-sticky/index.js +10 -14
- package/build-module/components/post-sticky/index.js.map +1 -1
- package/build-module/components/post-template/create-new-template-modal.js +2 -0
- package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
- package/build-module/components/post-title/index.js +5 -13
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +1 -1
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +0 -4
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +7 -4
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/save-publish-panels/index.js +30 -16
- package/build-module/components/save-publish-panels/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +4 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-summary.js +2 -4
- package/build-module/components/sidebar/post-summary.js.map +1 -1
- package/build-module/components/template-content-panel/index.js +30 -5
- package/build-module/components/template-content-panel/index.js.map +1 -1
- package/build-module/components/template-part-content-panel/index.js +63 -0
- package/build-module/components/template-part-content-panel/index.js.map +1 -0
- package/build-module/components/visual-editor/index.js +1 -1
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/dataviews/actions/delete-post.js +87 -0
- package/build-module/dataviews/actions/delete-post.js.map +1 -0
- package/build-module/{components/post-actions/export-pattern-action.js → dataviews/actions/export-pattern.js} +10 -19
- package/build-module/dataviews/actions/export-pattern.js.map +1 -0
- package/build-module/dataviews/actions/index.js +24 -0
- package/build-module/dataviews/actions/index.js.map +1 -0
- package/build-module/dataviews/actions/reset-post.js +104 -0
- package/build-module/dataviews/actions/reset-post.js.map +1 -0
- package/build-module/dataviews/actions/utils.js +41 -0
- package/build-module/dataviews/actions/utils.js.map +1 -0
- package/build-module/dataviews/store/private-actions.js.map +1 -1
- package/build-module/dataviews/store/private-selectors.js +5 -5
- package/build-module/dataviews/store/private-selectors.js.map +1 -1
- package/build-module/dataviews/store/reducer.js +6 -2
- package/build-module/dataviews/store/reducer.js.map +1 -1
- package/build-module/dataviews/types.js +2 -0
- package/build-module/dataviews/types.js.map +1 -0
- package/build-module/hooks/pattern-overrides.js +4 -2
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/lock-unlock.js +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/private-apis.js +2 -0
- package/build-module/private-apis.js.map +1 -1
- package/build-module/private-apis.native.js +0 -2
- package/build-module/private-apis.native.js.map +1 -1
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/private-actions.js +9 -5
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +0 -17
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/utils/is-template-revertable.js +6 -8
- package/build-module/store/utils/is-template-revertable.js.map +1 -1
- package/build-style/style-rtl.css +26 -76
- package/build-style/style.css +26 -76
- package/build-types/bindings/index.d.ts +2 -0
- package/build-types/bindings/index.d.ts.map +1 -0
- package/build-types/bindings/pattern-overrides.d.ts +18 -0
- package/build-types/bindings/pattern-overrides.d.ts.map +1 -0
- package/build-types/bindings/post-meta.d.ts +25 -0
- package/build-types/bindings/post-meta.d.ts.map +1 -0
- package/build-types/components/autocompleters/index.d.ts +2 -0
- package/build-types/components/autocompleters/index.d.ts.map +1 -0
- package/build-types/components/autocompleters/user.d.ts +6 -0
- package/build-types/components/autocompleters/user.d.ts.map +1 -0
- package/build-types/components/autosave-monitor/index.d.ts +15 -0
- package/build-types/components/autosave-monitor/index.d.ts.map +1 -0
- package/build-types/components/block-manager/category.d.ts +6 -0
- package/build-types/components/block-manager/category.d.ts.map +1 -0
- package/build-types/components/block-manager/checklist.d.ts +7 -0
- package/build-types/components/block-manager/checklist.d.ts.map +1 -0
- package/build-types/components/block-manager/index.d.ts +3 -0
- package/build-types/components/block-manager/index.d.ts.map +1 -0
- package/build-types/components/block-removal-warnings/index.d.ts +2 -0
- package/build-types/components/block-removal-warnings/index.d.ts.map +1 -0
- package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts +2 -0
- package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts.map +1 -0
- package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts +65 -0
- package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts.map +1 -0
- package/build-types/components/blog-title/index.d.ts +2 -0
- package/build-types/components/blog-title/index.d.ts.map +1 -0
- package/build-types/components/character-count/index.d.ts +7 -0
- package/build-types/components/character-count/index.d.ts.map +1 -0
- package/build-types/components/collapsible-block-toolbar/index.d.ts +6 -0
- package/build-types/components/collapsible-block-toolbar/index.d.ts.map +1 -0
- package/build-types/components/commands/index.d.ts +2 -0
- package/build-types/components/commands/index.d.ts.map +1 -0
- package/build-types/components/create-template-part-modal/index.d.ts +14 -0
- package/build-types/components/create-template-part-modal/index.d.ts.map +1 -0
- package/build-types/components/create-template-part-modal/utils.d.ts +4 -0
- package/build-types/components/create-template-part-modal/utils.d.ts.map +1 -0
- package/build-types/components/deprecated.d.ts +182 -0
- package/build-types/components/deprecated.d.ts.map +1 -0
- package/build-types/components/document-bar/index.d.ts +22 -0
- package/build-types/components/document-bar/index.d.ts.map +1 -0
- package/build-types/components/document-outline/check.d.ts +12 -0
- package/build-types/components/document-outline/check.d.ts.map +1 -0
- package/build-types/components/document-outline/index.d.ts +16 -0
- package/build-types/components/document-outline/index.d.ts.map +1 -0
- package/build-types/components/document-outline/item.d.ts +9 -0
- package/build-types/components/document-outline/item.d.ts.map +1 -0
- package/build-types/components/document-tools/index.d.ts +6 -0
- package/build-types/components/document-tools/index.d.ts.map +1 -0
- package/build-types/components/editor/index.d.ts +14 -0
- package/build-types/components/editor/index.d.ts.map +1 -0
- package/build-types/components/editor-history/redo.d.ts +4 -0
- package/build-types/components/editor-history/redo.d.ts.map +1 -0
- package/build-types/components/editor-history/undo.d.ts +4 -0
- package/build-types/components/editor-history/undo.d.ts.map +1 -0
- package/build-types/components/editor-interface/content-slot-fill.d.ts +3 -0
- package/build-types/components/editor-interface/content-slot-fill.d.ts.map +1 -0
- package/build-types/components/editor-interface/index.d.ts +17 -0
- package/build-types/components/editor-interface/index.d.ts.map +1 -0
- package/build-types/components/editor-notices/index.d.ts +13 -0
- package/build-types/components/editor-notices/index.d.ts.map +1 -0
- package/build-types/components/editor-snackbars/index.d.ts +7 -0
- package/build-types/components/editor-snackbars/index.d.ts.map +1 -0
- package/build-types/components/entities-saved-states/entity-record-item.d.ts +6 -0
- package/build-types/components/entities-saved-states/entity-record-item.d.ts.map +1 -0
- package/build-types/components/entities-saved-states/entity-type-list.d.ts +6 -0
- package/build-types/components/entities-saved-states/entity-type-list.d.ts.map +1 -0
- package/build-types/components/entities-saved-states/hooks/use-is-dirty.d.ts +2 -0
- package/build-types/components/entities-saved-states/hooks/use-is-dirty.d.ts.map +1 -0
- package/build-types/components/entities-saved-states/index.d.ts +43 -0
- package/build-types/components/entities-saved-states/index.d.ts.map +1 -0
- package/build-types/components/error-boundary/index.d.ts +14 -0
- package/build-types/components/error-boundary/index.d.ts.map +1 -0
- package/build-types/components/global-keyboard-shortcuts/index.d.ts +9 -0
- package/build-types/components/global-keyboard-shortcuts/index.d.ts.map +1 -0
- package/build-types/components/global-keyboard-shortcuts/register-shortcuts.d.ts +8 -0
- package/build-types/components/global-keyboard-shortcuts/register-shortcuts.d.ts.map +1 -0
- package/build-types/components/global-styles-provider/index.d.ts +20 -0
- package/build-types/components/global-styles-provider/index.d.ts.map +1 -0
- package/build-types/components/header/back-button.d.ts +6 -0
- package/build-types/components/header/back-button.d.ts.map +1 -0
- package/build-types/components/header/index.d.ts +10 -0
- package/build-types/components/header/index.d.ts.map +1 -0
- package/build-types/components/index.d.ts +108 -0
- package/build-types/components/index.d.ts.map +1 -0
- package/build-types/components/inserter-sidebar/index.d.ts +2 -0
- package/build-types/components/inserter-sidebar/index.d.ts.map +1 -0
- package/build-types/components/keyboard-shortcut-help-modal/config.d.ts +26 -0
- package/build-types/components/keyboard-shortcut-help-modal/config.d.ts.map +1 -0
- package/build-types/components/keyboard-shortcut-help-modal/dynamic-shortcut.d.ts +5 -0
- package/build-types/components/keyboard-shortcut-help-modal/dynamic-shortcut.d.ts.map +1 -0
- package/build-types/components/keyboard-shortcut-help-modal/index.d.ts +3 -0
- package/build-types/components/keyboard-shortcut-help-modal/index.d.ts.map +1 -0
- package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts +8 -0
- package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts.map +1 -0
- package/build-types/components/list-view-sidebar/index.d.ts +2 -0
- package/build-types/components/list-view-sidebar/index.d.ts.map +1 -0
- package/build-types/components/list-view-sidebar/list-view-outline.d.ts +2 -0
- package/build-types/components/list-view-sidebar/list-view-outline.d.ts.map +1 -0
- package/build-types/components/local-autosave-monitor/index.d.ts +3 -0
- package/build-types/components/local-autosave-monitor/index.d.ts.map +1 -0
- package/build-types/components/media-categories/index.d.ts +7 -0
- package/build-types/components/media-categories/index.d.ts.map +1 -0
- package/build-types/components/mode-switcher/index.d.ts +3 -0
- package/build-types/components/mode-switcher/index.d.ts.map +1 -0
- package/build-types/components/more-menu/copy-content-menu-item.d.ts +2 -0
- package/build-types/components/more-menu/copy-content-menu-item.d.ts.map +1 -0
- package/build-types/components/more-menu/index.d.ts +2 -0
- package/build-types/components/more-menu/index.d.ts.map +1 -0
- package/build-types/components/more-menu/tools-more-menu-group.d.ts +6 -0
- package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -0
- package/build-types/components/more-menu/view-more-menu-group.d.ts +6 -0
- package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -0
- package/build-types/components/page-attributes/check.d.ts +13 -0
- package/build-types/components/page-attributes/check.d.ts.map +1 -0
- package/build-types/components/page-attributes/order.d.ts +9 -0
- package/build-types/components/page-attributes/order.d.ts.map +1 -0
- package/build-types/components/page-attributes/panel.d.ts +7 -0
- package/build-types/components/page-attributes/panel.d.ts.map +1 -0
- package/build-types/components/page-attributes/parent.d.ts +11 -0
- package/build-types/components/page-attributes/parent.d.ts.map +1 -0
- package/build-types/components/pattern-duplicate-modal/index.d.ts +3 -0
- package/build-types/components/pattern-duplicate-modal/index.d.ts.map +1 -0
- package/build-types/components/pattern-overrides-panel/index.d.ts +2 -0
- package/build-types/components/pattern-overrides-panel/index.d.ts.map +1 -0
- package/build-types/components/pattern-rename-modal/index.d.ts +3 -0
- package/build-types/components/pattern-rename-modal/index.d.ts.map +1 -0
- package/build-types/components/plugin-document-setting-panel/index.d.ts +69 -0
- package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -0
- package/build-types/components/plugin-more-menu-item/index.d.ts +3 -0
- package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -0
- package/build-types/components/plugin-post-publish-panel/index.d.ts +47 -0
- package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -0
- package/build-types/components/plugin-post-status-info/index.d.ts +57 -0
- package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -0
- package/build-types/components/plugin-pre-publish-panel/index.d.ts +50 -0
- package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -0
- package/build-types/components/plugin-sidebar/index.d.ts +73 -0
- package/build-types/components/plugin-sidebar/index.d.ts.map +1 -0
- package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts +52 -0
- package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts.map +1 -0
- package/build-types/components/post-actions/actions.d.ts +31 -0
- package/build-types/components/post-actions/actions.d.ts.map +1 -0
- package/build-types/components/post-actions/index.d.ts +5 -0
- package/build-types/components/post-actions/index.d.ts.map +1 -0
- package/build-types/components/post-author/check.d.ts +13 -0
- package/build-types/components/post-author/check.d.ts.map +1 -0
- package/build-types/components/post-author/combobox.d.ts +2 -0
- package/build-types/components/post-author/combobox.d.ts.map +1 -0
- package/build-types/components/post-author/constants.d.ts +9 -0
- package/build-types/components/post-author/constants.d.ts.map +1 -0
- package/build-types/components/post-author/hook.d.ts +6 -0
- package/build-types/components/post-author/hook.d.ts.map +1 -0
- package/build-types/components/post-author/index.d.ts +8 -0
- package/build-types/components/post-author/index.d.ts.map +1 -0
- package/build-types/components/post-author/panel.d.ts +8 -0
- package/build-types/components/post-author/panel.d.ts.map +1 -0
- package/build-types/components/post-author/select.d.ts +2 -0
- package/build-types/components/post-author/select.d.ts.map +1 -0
- package/build-types/components/post-card-panel/index.d.ts +4 -0
- package/build-types/components/post-card-panel/index.d.ts.map +1 -0
- package/build-types/components/post-comments/index.d.ts +3 -0
- package/build-types/components/post-comments/index.d.ts.map +1 -0
- package/build-types/components/post-content-information/index.d.ts +2 -0
- package/build-types/components/post-content-information/index.d.ts.map +1 -0
- package/build-types/components/post-discussion/panel.d.ts +10 -0
- package/build-types/components/post-discussion/panel.d.ts.map +1 -0
- package/build-types/components/post-excerpt/check.d.ts +13 -0
- package/build-types/components/post-excerpt/check.d.ts.map +1 -0
- package/build-types/components/post-excerpt/index.d.ts +15 -0
- package/build-types/components/post-excerpt/index.d.ts.map +1 -0
- package/build-types/components/post-excerpt/panel.d.ts +8 -0
- package/build-types/components/post-excerpt/panel.d.ts.map +1 -0
- package/build-types/components/post-excerpt/plugin.d.ts +53 -0
- package/build-types/components/post-excerpt/plugin.d.ts.map +1 -0
- package/build-types/components/post-featured-image/check.d.ts +14 -0
- package/build-types/components/post-featured-image/check.d.ts.map +1 -0
- package/build-types/components/post-featured-image/index.d.ts +3 -0
- package/build-types/components/post-featured-image/index.d.ts.map +1 -0
- package/build-types/components/post-featured-image/panel.d.ts +13 -0
- package/build-types/components/post-featured-image/panel.d.ts.map +1 -0
- package/build-types/components/post-format/check.d.ts +5 -0
- package/build-types/components/post-format/check.d.ts.map +1 -0
- package/build-types/components/post-format/index.d.ts +16 -0
- package/build-types/components/post-format/index.d.ts.map +1 -0
- package/build-types/components/post-format/panel.d.ts +8 -0
- package/build-types/components/post-format/panel.d.ts.map +1 -0
- package/build-types/components/post-last-edited-panel/index.d.ts +2 -0
- package/build-types/components/post-last-edited-panel/index.d.ts.map +1 -0
- package/build-types/components/post-last-revision/check.d.ts +13 -0
- package/build-types/components/post-last-revision/check.d.ts.map +1 -0
- package/build-types/components/post-last-revision/index.d.ts +9 -0
- package/build-types/components/post-last-revision/index.d.ts.map +1 -0
- package/build-types/components/post-last-revision/panel.d.ts +8 -0
- package/build-types/components/post-last-revision/panel.d.ts.map +1 -0
- package/build-types/components/post-locked-modal/index.d.ts +8 -0
- package/build-types/components/post-locked-modal/index.d.ts.map +1 -0
- package/build-types/components/post-panel-row/index.d.ts +3 -0
- package/build-types/components/post-panel-row/index.d.ts.map +1 -0
- package/build-types/components/post-panel-section/index.d.ts +6 -0
- package/build-types/components/post-panel-section/index.d.ts.map +1 -0
- package/build-types/components/post-pending-status/check.d.ts +15 -0
- package/build-types/components/post-pending-status/check.d.ts.map +1 -0
- package/build-types/components/post-pending-status/index.d.ts +8 -0
- package/build-types/components/post-pending-status/index.d.ts.map +1 -0
- package/build-types/components/post-pingbacks/index.d.ts +3 -0
- package/build-types/components/post-pingbacks/index.d.ts.map +1 -0
- package/build-types/components/post-preview-button/index.d.ts +23 -0
- package/build-types/components/post-preview-button/index.d.ts.map +1 -0
- package/build-types/components/post-publish-button/index.d.ts +17 -0
- package/build-types/components/post-publish-button/index.d.ts.map +1 -0
- package/build-types/components/post-publish-button/label.d.ts +7 -0
- package/build-types/components/post-publish-button/label.d.ts.map +1 -0
- package/build-types/components/post-publish-button/post-publish-button-or-toggle.d.ts +17 -0
- package/build-types/components/post-publish-button/post-publish-button-or-toggle.d.ts.map +1 -0
- package/build-types/components/post-publish-panel/index.d.ts +10 -0
- package/build-types/components/post-publish-panel/index.d.ts.map +1 -0
- package/build-types/components/post-publish-panel/maybe-category-panel.d.ts +3 -0
- package/build-types/components/post-publish-panel/maybe-category-panel.d.ts.map +1 -0
- package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts +2 -0
- package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts.map +1 -0
- package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts +3 -0
- package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts.map +1 -0
- package/build-types/components/post-publish-panel/maybe-upload-media.d.ts +2 -0
- package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -0
- package/build-types/components/post-publish-panel/postpublish.d.ts +3 -0
- package/build-types/components/post-publish-panel/postpublish.d.ts.map +1 -0
- package/build-types/components/post-publish-panel/prepublish.d.ts +5 -0
- package/build-types/components/post-publish-panel/prepublish.d.ts.map +1 -0
- package/build-types/components/post-saved-state/index.d.ts +13 -0
- package/build-types/components/post-saved-state/index.d.ts.map +1 -0
- package/build-types/components/post-schedule/check.d.ts +12 -0
- package/build-types/components/post-schedule/check.d.ts.map +1 -0
- package/build-types/components/post-schedule/index.d.ts +17 -0
- package/build-types/components/post-schedule/index.d.ts.map +1 -0
- package/build-types/components/post-schedule/label.d.ts +25 -0
- package/build-types/components/post-schedule/label.d.ts.map +1 -0
- package/build-types/components/post-schedule/panel.d.ts +7 -0
- package/build-types/components/post-schedule/panel.d.ts.map +1 -0
- package/build-types/components/post-slug/check.d.ts +12 -0
- package/build-types/components/post-slug/check.d.ts.map +1 -0
- package/build-types/components/post-slug/index.d.ts +7 -0
- package/build-types/components/post-slug/index.d.ts.map +1 -0
- package/build-types/components/post-slug/panel.d.ts +3 -0
- package/build-types/components/post-slug/panel.d.ts.map +1 -0
- package/build-types/components/post-status/index.d.ts +6 -0
- package/build-types/components/post-status/index.d.ts.map +1 -0
- package/build-types/components/post-sticky/check.d.ts +12 -0
- package/build-types/components/post-sticky/check.d.ts.map +1 -0
- package/build-types/components/post-sticky/index.d.ts +7 -0
- package/build-types/components/post-sticky/index.d.ts.map +1 -0
- package/build-types/components/post-sticky/panel.d.ts +3 -0
- package/build-types/components/post-sticky/panel.d.ts.map +1 -0
- package/build-types/components/post-switch-to-draft-button/index.d.ts +7 -0
- package/build-types/components/post-switch-to-draft-button/index.d.ts.map +1 -0
- package/build-types/components/post-sync-status/index.d.ts +7 -0
- package/build-types/components/post-sync-status/index.d.ts.map +1 -0
- package/build-types/components/post-taxonomies/check.d.ts +12 -0
- package/build-types/components/post-taxonomies/check.d.ts.map +1 -0
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts +64 -0
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -0
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +102 -0
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -0
- package/build-types/components/post-taxonomies/index.d.ts +5 -0
- package/build-types/components/post-taxonomies/index.d.ts.map +1 -0
- package/build-types/components/post-taxonomies/most-used-terms.d.ts +5 -0
- package/build-types/components/post-taxonomies/most-used-terms.d.ts.map +1 -0
- package/build-types/components/post-taxonomies/panel.d.ts +3 -0
- package/build-types/components/post-taxonomies/panel.d.ts.map +1 -0
- package/build-types/components/post-template/block-theme.d.ts +4 -0
- package/build-types/components/post-template/block-theme.d.ts.map +1 -0
- package/build-types/components/post-template/classic-theme.d.ts +3 -0
- package/build-types/components/post-template/classic-theme.d.ts.map +1 -0
- package/build-types/components/post-template/create-new-template-modal.d.ts +4 -0
- package/build-types/components/post-template/create-new-template-modal.d.ts.map +1 -0
- package/build-types/components/post-template/create-new-template.d.ts +4 -0
- package/build-types/components/post-template/create-new-template.d.ts.map +1 -0
- package/build-types/components/post-template/hooks.d.ts +8 -0
- package/build-types/components/post-template/hooks.d.ts.map +1 -0
- package/build-types/components/post-template/panel.d.ts +7 -0
- package/build-types/components/post-template/panel.d.ts.map +1 -0
- package/build-types/components/post-template/reset-default-template.d.ts +4 -0
- package/build-types/components/post-template/reset-default-template.d.ts.map +1 -0
- package/build-types/components/post-template/swap-template-button.d.ts +4 -0
- package/build-types/components/post-template/swap-template-button.d.ts.map +1 -0
- package/build-types/components/post-text-editor/index.d.ts +7 -0
- package/build-types/components/post-text-editor/index.d.ts.map +1 -0
- package/build-types/components/post-title/constants.d.ts +3 -0
- package/build-types/components/post-title/constants.d.ts.map +1 -0
- package/build-types/components/post-title/index.d.ts +3 -0
- package/build-types/components/post-title/index.d.ts.map +1 -0
- package/build-types/components/post-title/post-title-raw.d.ts +3 -0
- package/build-types/components/post-title/post-title-raw.d.ts.map +1 -0
- package/build-types/components/post-title/use-post-title-focus.d.ts +9 -0
- package/build-types/components/post-title/use-post-title-focus.d.ts.map +1 -0
- package/build-types/components/post-title/use-post-title.d.ts +7 -0
- package/build-types/components/post-title/use-post-title.d.ts.map +1 -0
- package/build-types/components/post-transform-panel/hooks.d.ts +2 -0
- package/build-types/components/post-transform-panel/hooks.d.ts.map +1 -0
- package/build-types/components/post-transform-panel/index.d.ts +2 -0
- package/build-types/components/post-transform-panel/index.d.ts.map +1 -0
- package/build-types/components/post-trash/check.d.ts +12 -0
- package/build-types/components/post-trash/check.d.ts.map +1 -0
- package/build-types/components/post-trash/index.d.ts +7 -0
- package/build-types/components/post-trash/index.d.ts.map +1 -0
- package/build-types/components/post-type-support-check/index.d.ts +18 -0
- package/build-types/components/post-type-support-check/index.d.ts.map +1 -0
- package/build-types/components/post-url/check.d.ts +12 -0
- package/build-types/components/post-url/check.d.ts.map +1 -0
- package/build-types/components/post-url/index.d.ts +14 -0
- package/build-types/components/post-url/index.d.ts.map +1 -0
- package/build-types/components/post-url/label.d.ts +13 -0
- package/build-types/components/post-url/label.d.ts.map +1 -0
- package/build-types/components/post-url/panel.d.ts +7 -0
- package/build-types/components/post-url/panel.d.ts.map +1 -0
- package/build-types/components/post-view-link/index.d.ts +2 -0
- package/build-types/components/post-view-link/index.d.ts.map +1 -0
- package/build-types/components/post-visibility/check.d.ts +13 -0
- package/build-types/components/post-visibility/check.d.ts.map +1 -0
- package/build-types/components/post-visibility/index.d.ts +11 -0
- package/build-types/components/post-visibility/index.d.ts.map +1 -0
- package/build-types/components/post-visibility/label.d.ts +13 -0
- package/build-types/components/post-visibility/label.d.ts.map +1 -0
- package/build-types/components/post-visibility/utils.d.ts +21 -0
- package/build-types/components/post-visibility/utils.d.ts.map +1 -0
- package/build-types/components/posts-per-page/index.d.ts +2 -0
- package/build-types/components/posts-per-page/index.d.ts.map +1 -0
- package/build-types/components/preferences-modal/enable-panel.d.ts +3 -0
- package/build-types/components/preferences-modal/enable-panel.d.ts.map +1 -0
- package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts +14 -0
- package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -0
- package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts +3 -0
- package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts.map +1 -0
- package/build-types/components/preferences-modal/index.d.ts +4 -0
- package/build-types/components/preferences-modal/index.d.ts.map +1 -0
- package/build-types/components/preview-dropdown/index.d.ts +5 -0
- package/build-types/components/preview-dropdown/index.d.ts.map +1 -0
- package/build-types/components/provider/disable-non-page-content-blocks.d.ts +6 -0
- package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -0
- package/build-types/components/provider/index.d.ts +65 -0
- package/build-types/components/provider/index.d.ts.map +1 -0
- package/build-types/components/provider/navigation-block-editing-mode.d.ts +9 -0
- package/build-types/components/provider/navigation-block-editing-mode.d.ts.map +1 -0
- package/build-types/components/provider/use-auto-switch-editor-sidebars.d.ts +7 -0
- package/build-types/components/provider/use-auto-switch-editor-sidebars.d.ts.map +1 -0
- package/build-types/components/provider/use-block-editor-settings.d.ts +13 -0
- package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -0
- package/build-types/components/provider/use-hide-blocks-from-inserter.d.ts +9 -0
- package/build-types/components/provider/use-hide-blocks-from-inserter.d.ts.map +1 -0
- package/build-types/components/provider/with-registry-provider.d.ts +3 -0
- package/build-types/components/provider/with-registry-provider.d.ts.map +1 -0
- package/build-types/components/resizable-editor/index.d.ts +8 -0
- package/build-types/components/resizable-editor/index.d.ts.map +1 -0
- package/build-types/components/resizable-editor/resize-handle.d.ts +5 -0
- package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -0
- package/build-types/components/save-publish-panels/index.d.ts +11 -0
- package/build-types/components/save-publish-panels/index.d.ts.map +1 -0
- package/build-types/components/sidebar/constants.d.ts +5 -0
- package/build-types/components/sidebar/constants.d.ts.map +1 -0
- package/build-types/components/sidebar/header.d.ts +3 -0
- package/build-types/components/sidebar/header.d.ts.map +1 -0
- package/build-types/components/sidebar/index.d.ts +6 -0
- package/build-types/components/sidebar/index.d.ts.map +1 -0
- package/build-types/components/sidebar/post-summary.d.ts +4 -0
- package/build-types/components/sidebar/post-summary.d.ts.map +1 -0
- package/build-types/components/site-discussion/index.d.ts +2 -0
- package/build-types/components/site-discussion/index.d.ts.map +1 -0
- package/build-types/components/start-page-options/index.d.ts +2 -0
- package/build-types/components/start-page-options/index.d.ts.map +1 -0
- package/build-types/components/start-template-options/index.d.ts +2 -0
- package/build-types/components/start-template-options/index.d.ts.map +1 -0
- package/build-types/components/table-of-contents/index.d.ts +7 -0
- package/build-types/components/table-of-contents/index.d.ts.map +1 -0
- package/build-types/components/table-of-contents/panel.d.ts +6 -0
- package/build-types/components/table-of-contents/panel.d.ts.map +1 -0
- package/build-types/components/template-content-panel/index.d.ts +4 -0
- package/build-types/components/template-content-panel/index.d.ts.map +1 -0
- package/build-types/components/template-part-content-panel/index.d.ts +2 -0
- package/build-types/components/template-part-content-panel/index.d.ts.map +1 -0
- package/build-types/components/template-part-menu-items/convert-to-regular.d.ts +5 -0
- package/build-types/components/template-part-menu-items/convert-to-regular.d.ts.map +1 -0
- package/build-types/components/template-part-menu-items/convert-to-template-part.d.ts +5 -0
- package/build-types/components/template-part-menu-items/convert-to-template-part.d.ts.map +1 -0
- package/build-types/components/template-part-menu-items/index.d.ts +2 -0
- package/build-types/components/template-part-menu-items/index.d.ts.map +1 -0
- package/build-types/components/template-validation-notice/index.d.ts +2 -0
- package/build-types/components/template-validation-notice/index.d.ts.map +1 -0
- package/build-types/components/text-editor/index.d.ts +4 -0
- package/build-types/components/text-editor/index.d.ts.map +1 -0
- package/build-types/components/theme-support-check/index.d.ts +14 -0
- package/build-types/components/theme-support-check/index.d.ts.map +1 -0
- package/build-types/components/time-to-read/index.d.ts +7 -0
- package/build-types/components/time-to-read/index.d.ts.map +1 -0
- package/build-types/components/unsaved-changes-warning/index.d.ts +8 -0
- package/build-types/components/unsaved-changes-warning/index.d.ts.map +1 -0
- package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts +18 -0
- package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -0
- package/build-types/components/visual-editor/index.d.ts +10 -0
- package/build-types/components/visual-editor/index.d.ts.map +1 -0
- package/build-types/components/word-count/index.d.ts +7 -0
- package/build-types/components/word-count/index.d.ts.map +1 -0
- package/build-types/dataviews/actions/delete-post.d.ts +5 -0
- package/build-types/dataviews/actions/delete-post.d.ts.map +1 -0
- package/build-types/dataviews/actions/export-pattern.d.ts +8 -0
- package/build-types/dataviews/actions/export-pattern.d.ts.map +1 -0
- package/build-types/dataviews/actions/index.d.ts +2 -0
- package/build-types/dataviews/actions/index.d.ts.map +1 -0
- package/build-types/dataviews/actions/reset-post.d.ts +5 -0
- package/build-types/dataviews/actions/reset-post.d.ts.map +1 -0
- package/build-types/dataviews/actions/utils.d.ts +11 -0
- package/build-types/dataviews/actions/utils.d.ts.map +1 -0
- package/build-types/dataviews/api.d.ts +27 -0
- package/build-types/dataviews/api.d.ts.map +1 -0
- package/build-types/dataviews/store/private-actions.d.ts +2 -2
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
- package/build-types/dataviews/store/private-selectors.d.ts +2 -5
- package/build-types/dataviews/store/private-selectors.d.ts.map +1 -1
- package/build-types/dataviews/store/reducer.d.ts +5 -1
- package/build-types/dataviews/store/reducer.d.ts.map +1 -1
- package/build-types/dataviews/types.d.ts +34 -0
- package/build-types/dataviews/types.d.ts.map +1 -0
- package/build-types/hooks/custom-sources-backwards-compatibility.d.ts +10 -0
- package/build-types/hooks/custom-sources-backwards-compatibility.d.ts.map +1 -0
- package/build-types/hooks/default-autocompleters.d.ts +2 -0
- package/build-types/hooks/default-autocompleters.d.ts.map +1 -0
- package/build-types/hooks/index.d.ts +2 -0
- package/build-types/hooks/index.d.ts.map +1 -0
- package/build-types/hooks/media-upload.d.ts +2 -0
- package/build-types/hooks/media-upload.d.ts.map +1 -0
- package/build-types/hooks/pattern-overrides.d.ts +2 -0
- package/build-types/hooks/pattern-overrides.d.ts.map +1 -0
- package/build-types/hooks/use-select-nearest-editable-block.d.ts +4 -0
- package/build-types/hooks/use-select-nearest-editable-block.d.ts.map +1 -0
- package/build-types/index.d.ts +6 -0
- package/build-types/index.d.ts.map +1 -0
- package/build-types/lock-unlock.d.ts +3 -0
- package/build-types/lock-unlock.d.ts.map +1 -0
- package/build-types/private-apis.d.ts +2 -0
- package/build-types/private-apis.d.ts.map +1 -0
- package/build-types/store/actions.d.ts +367 -0
- package/build-types/store/actions.d.ts.map +1 -0
- package/build-types/store/constants.d.ts +31 -0
- package/build-types/store/constants.d.ts.map +1 -0
- package/build-types/store/defaults.d.ts +21 -0
- package/build-types/store/defaults.d.ts.map +1 -0
- package/build-types/store/index.d.ts +17 -0
- package/build-types/store/index.d.ts.map +1 -0
- package/build-types/store/local-autosave.d.ts +4 -0
- package/build-types/store/local-autosave.d.ts.map +1 -0
- package/build-types/store/private-actions.d.ts +37 -0
- package/build-types/store/private-actions.d.ts.map +1 -0
- package/build-types/store/private-selectors.d.ts +24 -0
- package/build-types/store/private-selectors.d.ts.map +1 -0
- package/build-types/store/reducer.d.ts +228 -0
- package/build-types/store/reducer.d.ts.map +1 -0
- package/build-types/store/selectors.d.ts +854 -0
- package/build-types/store/selectors.d.ts.map +1 -0
- package/build-types/store/utils/get-filtered-template-parts.d.ts +3 -0
- package/build-types/store/utils/get-filtered-template-parts.d.ts.map +1 -0
- package/build-types/store/utils/is-template-revertable.d.ts +8 -0
- package/build-types/store/utils/is-template-revertable.d.ts.map +1 -0
- package/build-types/store/utils/notice-builder.d.ts +27 -0
- package/build-types/store/utils/notice-builder.d.ts.map +1 -0
- package/build-types/utils/get-template-part-icon.d.ts +9 -0
- package/build-types/utils/get-template-part-icon.d.ts.map +1 -0
- package/build-types/utils/index.d.ts +5 -0
- package/build-types/utils/index.d.ts.map +1 -0
- package/build-types/utils/media-upload/index.d.ts +21 -0
- package/build-types/utils/media-upload/index.d.ts.map +1 -0
- package/build-types/utils/set-nested-value.d.ts +20 -0
- package/build-types/utils/set-nested-value.d.ts.map +1 -0
- package/build-types/utils/terms.d.ts +12 -0
- package/build-types/utils/terms.d.ts.map +1 -0
- package/build-types/utils/url.d.ts +18 -0
- package/build-types/utils/url.d.ts.map +1 -0
- package/package.json +36 -35
- package/src/bindings/pattern-overrides.js +9 -10
- package/src/bindings/post-meta.js +5 -0
- package/src/components/create-template-part-modal/index.js +2 -0
- package/src/components/create-template-part-modal/style.scss +0 -6
- package/src/components/document-bar/index.js +11 -4
- package/src/components/editor-interface/index.js +19 -8
- package/src/components/entities-saved-states/entity-record-item.js +4 -14
- package/src/components/entities-saved-states/index.js +1 -1
- package/src/components/entities-saved-states/style.scss +0 -13
- package/src/components/global-keyboard-shortcuts/index.js +1 -1
- package/src/components/global-styles-provider/index.js +7 -90
- package/src/components/header/index.js +2 -1
- package/src/components/index.js +11 -2
- package/src/components/inserter-sidebar/index.js +4 -24
- package/src/components/list-view-sidebar/index.js +34 -62
- package/src/components/list-view-sidebar/style.scss +0 -34
- package/src/components/page-attributes/parent.js +6 -3
- package/src/components/post-actions/actions.js +495 -621
- package/src/components/post-actions/index.js +4 -2
- package/src/components/post-card-panel/style.scss +1 -0
- package/src/components/post-excerpt/index.js +4 -1
- package/src/components/post-excerpt/panel.js +3 -2
- package/src/components/post-featured-image/style.scss +15 -0
- package/src/components/post-panel-row/style.scss +1 -0
- package/src/components/post-preview-button/index.js +1 -1
- package/src/components/post-publish-panel/index.js +1 -1
- package/src/components/post-publish-panel/style.scss +1 -1
- package/src/components/post-saved-state/index.js +11 -1
- package/src/components/post-schedule/index.js +5 -0
- package/src/components/post-slug/check.js +8 -0
- package/src/components/post-slug/index.js +5 -0
- package/src/components/post-status/index.js +3 -1
- package/src/components/post-sticky/index.js +10 -13
- package/src/components/post-sticky/style.scss +3 -2
- package/src/components/post-taxonomies/README.md +1 -1
- package/src/components/post-template/create-new-template-modal.js +2 -0
- package/src/components/post-title/index.js +5 -12
- package/src/components/post-url/style.scss +4 -0
- package/src/components/preview-dropdown/index.js +1 -1
- package/src/components/provider/index.native.js +3 -11
- package/src/components/provider/use-block-editor-settings.js +10 -5
- package/src/components/save-publish-panels/index.js +33 -23
- package/src/components/sidebar/index.js +3 -3
- package/src/components/sidebar/post-summary.js +0 -4
- package/src/components/template-content-panel/index.js +29 -5
- package/src/components/template-part-content-panel/index.js +62 -0
- package/src/components/visual-editor/index.js +1 -1
- package/src/components/visual-editor/style.scss +3 -1
- package/src/dataviews/actions/delete-post.tsx +107 -0
- package/src/{components/post-actions/export-pattern-action.js → dataviews/actions/export-pattern.tsx} +19 -19
- package/src/dataviews/actions/index.ts +25 -0
- package/src/dataviews/actions/reset-post.tsx +144 -0
- package/src/dataviews/actions/utils.ts +54 -0
- package/src/dataviews/store/private-actions.ts +2 -2
- package/src/dataviews/store/private-selectors.ts +13 -6
- package/src/dataviews/store/reducer.ts +12 -5
- package/src/dataviews/types.ts +33 -0
- package/src/hooks/pattern-overrides.js +6 -4
- package/src/lock-unlock.js +1 -1
- package/src/private-apis.js +2 -0
- package/src/private-apis.native.js +0 -2
- package/src/store/private-actions.js +49 -21
- package/src/store/private-selectors.js +0 -25
- package/src/store/utils/is-template-revertable.js +8 -8
- package/src/style.scss +0 -1
- package/tsconfig.json +3 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/post-actions/export-pattern-action.js.map +0 -1
- package/build/components/post-actions/export-pattern-action.native.js +0 -11
- package/build/components/post-actions/export-pattern-action.native.js.map +0 -1
- package/build/components/template-areas/index.js +0 -84
- package/build/components/template-areas/index.js.map +0 -1
- package/build-module/components/post-actions/export-pattern-action.js.map +0 -1
- package/build-module/components/post-actions/export-pattern-action.native.js +0 -5
- package/build-module/components/post-actions/export-pattern-action.native.js.map +0 -1
- package/build-module/components/template-areas/index.js +0 -78
- package/build-module/components/template-areas/index.js.map +0 -1
- package/src/components/post-actions/export-pattern-action.native.js +0 -4
- package/src/components/template-areas/index.js +0 -94
- package/src/components/template-areas/style.scss +0 -22
- /package/src/store/{constants.js → constants.ts} +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useSelect } from '@wordpress/data';
|
|
5
|
+
import { useMemo } from '@wordpress/element';
|
|
6
|
+
import { store as blocksStore } from '@wordpress/blocks';
|
|
7
|
+
import {
|
|
8
|
+
store as blockEditorStore,
|
|
9
|
+
privateApis as blockEditorPrivateApis,
|
|
10
|
+
} from '@wordpress/block-editor';
|
|
11
|
+
import { PanelBody } from '@wordpress/components';
|
|
12
|
+
import { __ } from '@wordpress/i18n';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Internal dependencies
|
|
16
|
+
*/
|
|
17
|
+
import { unlock } from '../../lock-unlock';
|
|
18
|
+
import { TEMPLATE_PART_POST_TYPE } from '../../store/constants';
|
|
19
|
+
import { store as editorStore } from '../../store';
|
|
20
|
+
|
|
21
|
+
const { BlockQuickNavigation } = unlock( blockEditorPrivateApis );
|
|
22
|
+
|
|
23
|
+
function TemplatePartContentPanelInner() {
|
|
24
|
+
const blockTypes = useSelect( ( select ) => {
|
|
25
|
+
const { getBlockTypes } = select( blocksStore );
|
|
26
|
+
return getBlockTypes();
|
|
27
|
+
}, [] );
|
|
28
|
+
const themeBlockNames = useMemo( () => {
|
|
29
|
+
return blockTypes
|
|
30
|
+
.filter( ( blockType ) => {
|
|
31
|
+
return blockType.category === 'theme';
|
|
32
|
+
} )
|
|
33
|
+
.map( ( { name } ) => name );
|
|
34
|
+
}, [ blockTypes ] );
|
|
35
|
+
const themeBlocks = useSelect(
|
|
36
|
+
( select ) => {
|
|
37
|
+
const { getBlocksByName } = select( blockEditorStore );
|
|
38
|
+
return getBlocksByName( themeBlockNames );
|
|
39
|
+
},
|
|
40
|
+
[ themeBlockNames ]
|
|
41
|
+
);
|
|
42
|
+
if ( themeBlocks.length === 0 ) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
return (
|
|
46
|
+
<PanelBody title={ __( 'Content' ) }>
|
|
47
|
+
<BlockQuickNavigation clientIds={ themeBlocks } />
|
|
48
|
+
</PanelBody>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export default function TemplatePartContentPanel() {
|
|
53
|
+
const postType = useSelect( ( select ) => {
|
|
54
|
+
const { getCurrentPostType } = select( editorStore );
|
|
55
|
+
return getCurrentPostType();
|
|
56
|
+
}, [] );
|
|
57
|
+
if ( postType !== TEMPLATE_PART_POST_TYPE ) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return <TemplatePartContentPanelInner />;
|
|
62
|
+
}
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
height: 100%;
|
|
4
4
|
display: block;
|
|
5
5
|
background-color: $gray-300;
|
|
6
|
+
// Make this a stacking context to contain the z-index of children elements.
|
|
7
|
+
isolation: isolate;
|
|
6
8
|
|
|
7
9
|
// Centralize the editor horizontally (flex-direction is column).
|
|
8
10
|
align-items: center;
|
|
@@ -17,7 +19,7 @@
|
|
|
17
19
|
|
|
18
20
|
// In the iframed canvas this keeps extra scrollbars from appearing (when block toolbars overflow). In the
|
|
19
21
|
// legacy (non-iframed) canvas, overflow must not be hidden in order to maintain support for sticky positioning.
|
|
20
|
-
|
|
22
|
+
&.is-iframed {
|
|
21
23
|
overflow: hidden;
|
|
22
24
|
}
|
|
23
25
|
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { trash } from '@wordpress/icons';
|
|
5
|
+
import { useDispatch } from '@wordpress/data';
|
|
6
|
+
import { __, _n, sprintf } from '@wordpress/i18n';
|
|
7
|
+
import { useState } from '@wordpress/element';
|
|
8
|
+
import {
|
|
9
|
+
Button,
|
|
10
|
+
__experimentalText as Text,
|
|
11
|
+
__experimentalHStack as HStack,
|
|
12
|
+
__experimentalVStack as VStack,
|
|
13
|
+
} from '@wordpress/components';
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
import { privateApis as patternsPrivateApis } from '@wordpress/patterns';
|
|
16
|
+
import type { Action } from '@wordpress/dataviews';
|
|
17
|
+
import type { StoreDescriptor } from '@wordpress/data';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Internal dependencies
|
|
21
|
+
*/
|
|
22
|
+
import {
|
|
23
|
+
isTemplateRemovable,
|
|
24
|
+
getItemTitle,
|
|
25
|
+
isTemplateOrTemplatePart,
|
|
26
|
+
} from './utils';
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
import { store as editorStore } from '../../store';
|
|
29
|
+
import { unlock } from '../../lock-unlock';
|
|
30
|
+
import type { Post } from '../types';
|
|
31
|
+
|
|
32
|
+
const { PATTERN_TYPES } = unlock( patternsPrivateApis );
|
|
33
|
+
|
|
34
|
+
// This action is used for templates, patterns and template parts.
|
|
35
|
+
// Every other post type uses the similar `trashPostAction` which
|
|
36
|
+
// moves the post to trash.
|
|
37
|
+
const deletePostAction: Action< Post > = {
|
|
38
|
+
id: 'delete-post',
|
|
39
|
+
label: __( 'Delete' ),
|
|
40
|
+
isPrimary: true,
|
|
41
|
+
icon: trash,
|
|
42
|
+
isEligible( post ) {
|
|
43
|
+
if ( isTemplateOrTemplatePart( post ) ) {
|
|
44
|
+
return isTemplateRemovable( post );
|
|
45
|
+
}
|
|
46
|
+
// We can only remove user patterns.
|
|
47
|
+
return post.type === PATTERN_TYPES.user;
|
|
48
|
+
},
|
|
49
|
+
supportsBulk: true,
|
|
50
|
+
hideModalHeader: true,
|
|
51
|
+
RenderModal: ( { items, closeModal, onActionPerformed } ) => {
|
|
52
|
+
const [ isBusy, setIsBusy ] = useState( false );
|
|
53
|
+
const { removeTemplates } = unlock(
|
|
54
|
+
useDispatch( editorStore as StoreDescriptor )
|
|
55
|
+
);
|
|
56
|
+
return (
|
|
57
|
+
<VStack spacing="5">
|
|
58
|
+
<Text>
|
|
59
|
+
{ items.length > 1
|
|
60
|
+
? sprintf(
|
|
61
|
+
// translators: %d: number of items to delete.
|
|
62
|
+
_n(
|
|
63
|
+
'Delete %d item?',
|
|
64
|
+
'Delete %d items?',
|
|
65
|
+
items.length
|
|
66
|
+
),
|
|
67
|
+
items.length
|
|
68
|
+
)
|
|
69
|
+
: sprintf(
|
|
70
|
+
// translators: %s: The template or template part's titles
|
|
71
|
+
__( 'Delete "%s"?' ),
|
|
72
|
+
getItemTitle( items[ 0 ] )
|
|
73
|
+
) }
|
|
74
|
+
</Text>
|
|
75
|
+
<HStack justify="right">
|
|
76
|
+
<Button
|
|
77
|
+
variant="tertiary"
|
|
78
|
+
onClick={ closeModal }
|
|
79
|
+
disabled={ isBusy }
|
|
80
|
+
accessibleWhenDisabled
|
|
81
|
+
>
|
|
82
|
+
{ __( 'Cancel' ) }
|
|
83
|
+
</Button>
|
|
84
|
+
<Button
|
|
85
|
+
variant="primary"
|
|
86
|
+
onClick={ async () => {
|
|
87
|
+
setIsBusy( true );
|
|
88
|
+
await removeTemplates( items, {
|
|
89
|
+
allowUndo: false,
|
|
90
|
+
} );
|
|
91
|
+
onActionPerformed?.( items );
|
|
92
|
+
setIsBusy( false );
|
|
93
|
+
closeModal?.();
|
|
94
|
+
} }
|
|
95
|
+
isBusy={ isBusy }
|
|
96
|
+
disabled={ isBusy }
|
|
97
|
+
accessibleWhenDisabled
|
|
98
|
+
>
|
|
99
|
+
{ __( 'Delete' ) }
|
|
100
|
+
</Button>
|
|
101
|
+
</HStack>
|
|
102
|
+
</VStack>
|
|
103
|
+
);
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export default deletePostAction;
|
|
@@ -9,50 +9,48 @@ import { downloadZip } from 'client-zip';
|
|
|
9
9
|
*/
|
|
10
10
|
import { downloadBlob } from '@wordpress/blob';
|
|
11
11
|
import { __ } from '@wordpress/i18n';
|
|
12
|
-
import {
|
|
12
|
+
import type { Action } from '@wordpress/dataviews';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Internal dependencies
|
|
16
16
|
*/
|
|
17
|
-
import {
|
|
17
|
+
import type { Pattern } from '../types';
|
|
18
|
+
import { getItemTitle } from './utils';
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
const { PATTERN_TYPES } = unlock( patternsPrivateApis );
|
|
21
|
-
|
|
22
|
-
function getJsonFromItem( item ) {
|
|
20
|
+
function getJsonFromItem( item: Pattern ) {
|
|
23
21
|
return JSON.stringify(
|
|
24
22
|
{
|
|
25
23
|
__file: item.type,
|
|
26
|
-
title: item
|
|
27
|
-
content:
|
|
28
|
-
|
|
24
|
+
title: getItemTitle( item ),
|
|
25
|
+
content:
|
|
26
|
+
typeof item.content === 'string'
|
|
27
|
+
? item.content
|
|
28
|
+
: item.content?.raw,
|
|
29
|
+
syncStatus: item.wp_pattern_sync_status,
|
|
29
30
|
},
|
|
30
31
|
null,
|
|
31
32
|
2
|
|
32
33
|
);
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
const exportPattern: Action< Pattern > = {
|
|
36
37
|
id: 'export-pattern',
|
|
37
38
|
label: __( 'Export as JSON' ),
|
|
38
39
|
supportsBulk: true,
|
|
39
|
-
isEligible: ( item ) =>
|
|
40
|
-
if ( ! item.type ) {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
return item.type === PATTERN_TYPES.user;
|
|
44
|
-
},
|
|
40
|
+
isEligible: ( item ) => item.type === 'wp_block',
|
|
45
41
|
callback: async ( items ) => {
|
|
46
42
|
if ( items.length === 1 ) {
|
|
47
43
|
return downloadBlob(
|
|
48
|
-
`${ kebabCase(
|
|
44
|
+
`${ kebabCase(
|
|
45
|
+
getItemTitle( items[ 0 ] ) || items[ 0 ].slug
|
|
46
|
+
) }.json`,
|
|
49
47
|
getJsonFromItem( items[ 0 ] ),
|
|
50
48
|
'application/json'
|
|
51
49
|
);
|
|
52
50
|
}
|
|
53
|
-
const nameCount = {};
|
|
51
|
+
const nameCount: Record< string, number > = {};
|
|
54
52
|
const filesToZip = items.map( ( item ) => {
|
|
55
|
-
const name = kebabCase( item
|
|
53
|
+
const name = kebabCase( getItemTitle( item ) || item.slug );
|
|
56
54
|
nameCount[ name ] = ( nameCount[ name ] || 0 ) + 1;
|
|
57
55
|
return {
|
|
58
56
|
name: `${
|
|
@@ -72,3 +70,5 @@ export const exportPatternAsJSONAction = {
|
|
|
72
70
|
);
|
|
73
71
|
},
|
|
74
72
|
};
|
|
73
|
+
|
|
74
|
+
export default exportPattern;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { type StoreDescriptor, dispatch } from '@wordpress/data';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import deletePost from './delete-post';
|
|
10
|
+
import exportPattern from './export-pattern';
|
|
11
|
+
import resetPost from './reset-post';
|
|
12
|
+
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
import { store as editorStore } from '../../store';
|
|
15
|
+
import { unlock } from '../../lock-unlock';
|
|
16
|
+
|
|
17
|
+
export default function registerDefaultActions() {
|
|
18
|
+
const { registerEntityAction } = unlock(
|
|
19
|
+
dispatch( editorStore as StoreDescriptor )
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
registerEntityAction( 'postType', 'wp_block', exportPattern );
|
|
23
|
+
registerEntityAction( 'postType', '*', resetPost );
|
|
24
|
+
registerEntityAction( 'postType', '*', deletePost );
|
|
25
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { backup } from '@wordpress/icons';
|
|
5
|
+
import { useDispatch } from '@wordpress/data';
|
|
6
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
7
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
8
|
+
import { store as noticesStore } from '@wordpress/notices';
|
|
9
|
+
import { useState } from '@wordpress/element';
|
|
10
|
+
import {
|
|
11
|
+
Button,
|
|
12
|
+
__experimentalText as Text,
|
|
13
|
+
__experimentalHStack as HStack,
|
|
14
|
+
__experimentalVStack as VStack,
|
|
15
|
+
} from '@wordpress/components';
|
|
16
|
+
import type { Action } from '@wordpress/dataviews';
|
|
17
|
+
import type { StoreDescriptor } from '@wordpress/data';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Internal dependencies
|
|
21
|
+
*/
|
|
22
|
+
import { TEMPLATE_POST_TYPE, TEMPLATE_ORIGINS } from '../../store/constants';
|
|
23
|
+
import { store as editorStore } from '../../store';
|
|
24
|
+
import { unlock } from '../../lock-unlock';
|
|
25
|
+
import type { Post, CoreDataError } from '../types';
|
|
26
|
+
import { isTemplateOrTemplatePart, getItemTitle } from './utils';
|
|
27
|
+
|
|
28
|
+
const resetPost: Action< Post > = {
|
|
29
|
+
id: 'reset-post',
|
|
30
|
+
label: __( 'Reset' ),
|
|
31
|
+
isEligible: ( item ) => {
|
|
32
|
+
return (
|
|
33
|
+
isTemplateOrTemplatePart( item ) &&
|
|
34
|
+
item?.source === TEMPLATE_ORIGINS.custom &&
|
|
35
|
+
item?.has_theme_file
|
|
36
|
+
);
|
|
37
|
+
},
|
|
38
|
+
icon: backup,
|
|
39
|
+
supportsBulk: true,
|
|
40
|
+
hideModalHeader: true,
|
|
41
|
+
RenderModal: ( { items, closeModal, onActionPerformed } ) => {
|
|
42
|
+
const [ isBusy, setIsBusy ] = useState( false );
|
|
43
|
+
const { revertTemplate } = unlock(
|
|
44
|
+
useDispatch( editorStore as StoreDescriptor )
|
|
45
|
+
);
|
|
46
|
+
const { saveEditedEntityRecord } = useDispatch( coreStore );
|
|
47
|
+
const { createSuccessNotice, createErrorNotice } =
|
|
48
|
+
useDispatch( noticesStore );
|
|
49
|
+
const onConfirm = async () => {
|
|
50
|
+
try {
|
|
51
|
+
for ( const template of items ) {
|
|
52
|
+
await revertTemplate( template, {
|
|
53
|
+
allowUndo: false,
|
|
54
|
+
} );
|
|
55
|
+
await saveEditedEntityRecord(
|
|
56
|
+
'postType',
|
|
57
|
+
template.type,
|
|
58
|
+
template.id
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
createSuccessNotice(
|
|
62
|
+
items.length > 1
|
|
63
|
+
? sprintf(
|
|
64
|
+
/* translators: The number of items. */
|
|
65
|
+
__( '%s items reset.' ),
|
|
66
|
+
items.length
|
|
67
|
+
)
|
|
68
|
+
: sprintf(
|
|
69
|
+
/* translators: The template/part's name. */
|
|
70
|
+
__( '"%s" reset.' ),
|
|
71
|
+
getItemTitle( items[ 0 ] )
|
|
72
|
+
),
|
|
73
|
+
{
|
|
74
|
+
type: 'snackbar',
|
|
75
|
+
id: 'revert-template-action',
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
} catch ( error ) {
|
|
79
|
+
let fallbackErrorMessage;
|
|
80
|
+
if ( items[ 0 ].type === TEMPLATE_POST_TYPE ) {
|
|
81
|
+
fallbackErrorMessage =
|
|
82
|
+
items.length === 1
|
|
83
|
+
? __(
|
|
84
|
+
'An error occurred while reverting the template.'
|
|
85
|
+
)
|
|
86
|
+
: __(
|
|
87
|
+
'An error occurred while reverting the templates.'
|
|
88
|
+
);
|
|
89
|
+
} else {
|
|
90
|
+
fallbackErrorMessage =
|
|
91
|
+
items.length === 1
|
|
92
|
+
? __(
|
|
93
|
+
'An error occurred while reverting the template part.'
|
|
94
|
+
)
|
|
95
|
+
: __(
|
|
96
|
+
'An error occurred while reverting the template parts.'
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const typedError = error as CoreDataError;
|
|
101
|
+
const errorMessage =
|
|
102
|
+
typedError.message && typedError.code !== 'unknown_error'
|
|
103
|
+
? typedError.message
|
|
104
|
+
: fallbackErrorMessage;
|
|
105
|
+
|
|
106
|
+
createErrorNotice( errorMessage, { type: 'snackbar' } );
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
return (
|
|
110
|
+
<VStack spacing="5">
|
|
111
|
+
<Text>
|
|
112
|
+
{ __( 'Reset to default and clear all customizations?' ) }
|
|
113
|
+
</Text>
|
|
114
|
+
<HStack justify="right">
|
|
115
|
+
<Button
|
|
116
|
+
variant="tertiary"
|
|
117
|
+
onClick={ closeModal }
|
|
118
|
+
disabled={ isBusy }
|
|
119
|
+
accessibleWhenDisabled
|
|
120
|
+
>
|
|
121
|
+
{ __( 'Cancel' ) }
|
|
122
|
+
</Button>
|
|
123
|
+
<Button
|
|
124
|
+
variant="primary"
|
|
125
|
+
onClick={ async () => {
|
|
126
|
+
setIsBusy( true );
|
|
127
|
+
await onConfirm();
|
|
128
|
+
onActionPerformed?.( items );
|
|
129
|
+
setIsBusy( false );
|
|
130
|
+
closeModal?.();
|
|
131
|
+
} }
|
|
132
|
+
isBusy={ isBusy }
|
|
133
|
+
disabled={ isBusy }
|
|
134
|
+
accessibleWhenDisabled
|
|
135
|
+
>
|
|
136
|
+
{ __( 'Reset' ) }
|
|
137
|
+
</Button>
|
|
138
|
+
</HStack>
|
|
139
|
+
</VStack>
|
|
140
|
+
);
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export default resetPost;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import {
|
|
10
|
+
TEMPLATE_ORIGINS,
|
|
11
|
+
TEMPLATE_PART_POST_TYPE,
|
|
12
|
+
TEMPLATE_POST_TYPE,
|
|
13
|
+
} from '../../store/constants';
|
|
14
|
+
|
|
15
|
+
import type { Post, TemplateOrTemplatePart } from '../types';
|
|
16
|
+
|
|
17
|
+
export function isTemplateOrTemplatePart(
|
|
18
|
+
p: Post
|
|
19
|
+
): p is TemplateOrTemplatePart {
|
|
20
|
+
return p.type === TEMPLATE_POST_TYPE || p.type === TEMPLATE_PART_POST_TYPE;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function getItemTitle( item: Post ) {
|
|
24
|
+
if ( typeof item.title === 'string' ) {
|
|
25
|
+
return decodeEntities( item.title );
|
|
26
|
+
}
|
|
27
|
+
if ( 'rendered' in item.title ) {
|
|
28
|
+
return decodeEntities( item.title.rendered );
|
|
29
|
+
}
|
|
30
|
+
if ( 'raw' in item.title ) {
|
|
31
|
+
return decodeEntities( item.title.raw );
|
|
32
|
+
}
|
|
33
|
+
return '';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Check if a template is removable.
|
|
38
|
+
*
|
|
39
|
+
* @param template The template entity to check.
|
|
40
|
+
* @return Whether the template is removable.
|
|
41
|
+
*/
|
|
42
|
+
export function isTemplateRemovable( template: TemplateOrTemplatePart ) {
|
|
43
|
+
if ( ! template ) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
// In patterns list page we map the templates parts to a different object
|
|
47
|
+
// than the one returned from the endpoint. This is why we need to check for
|
|
48
|
+
// two props whether is custom or has a theme file.
|
|
49
|
+
return (
|
|
50
|
+
[ template.source, template.source ].includes(
|
|
51
|
+
TEMPLATE_ORIGINS.custom
|
|
52
|
+
) && ! template.has_theme_file
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type { Action
|
|
4
|
+
import type { Action } from '@wordpress/dataviews';
|
|
5
5
|
|
|
6
|
-
export function registerEntityAction< Item
|
|
6
|
+
export function registerEntityAction< Item >(
|
|
7
7
|
kind: string,
|
|
8
8
|
name: string,
|
|
9
9
|
config: Action< Item >
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import { createSelector } from '@wordpress/data';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import type { State } from './reducer';
|
|
10
10
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
export const getEntityActions = createSelector(
|
|
12
|
+
( state: State, kind: string, name: string ) => {
|
|
13
|
+
return [
|
|
14
|
+
...( state.actions[ kind ]?.[ name ] ?? [] ),
|
|
15
|
+
...( state.actions[ kind ]?.[ '*' ] ?? [] ),
|
|
16
|
+
];
|
|
17
|
+
},
|
|
18
|
+
( state: State, kind: string, name: string ) => [
|
|
19
|
+
state.actions[ kind ]?.[ name ],
|
|
20
|
+
state.actions[ kind ]?.[ '*' ],
|
|
21
|
+
]
|
|
22
|
+
);
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { combineReducers } from '@wordpress/data';
|
|
5
|
-
import { __ } from '@wordpress/i18n';
|
|
6
5
|
import type { Action } from '@wordpress/dataviews';
|
|
7
6
|
|
|
8
7
|
type ReduxAction =
|
|
@@ -20,8 +19,13 @@ function actions( state: ActionState = {}, action: ReduxAction ) {
|
|
|
20
19
|
return {
|
|
21
20
|
...state,
|
|
22
21
|
[ action.kind ]: {
|
|
22
|
+
...state[ action.kind ],
|
|
23
23
|
[ action.name ]: [
|
|
24
|
-
...(
|
|
24
|
+
...(
|
|
25
|
+
state[ action.kind ]?.[ action.name ] ?? []
|
|
26
|
+
).filter(
|
|
27
|
+
( _action ) => _action.id !== action.config.id
|
|
28
|
+
),
|
|
25
29
|
action.config,
|
|
26
30
|
],
|
|
27
31
|
},
|
|
@@ -29,9 +33,12 @@ function actions( state: ActionState = {}, action: ReduxAction ) {
|
|
|
29
33
|
case 'UNREGISTER_ENTITY_ACTION': {
|
|
30
34
|
return {
|
|
31
35
|
...state,
|
|
32
|
-
[ action.kind ]:
|
|
33
|
-
state[ action.kind ]
|
|
34
|
-
|
|
36
|
+
[ action.kind ]: {
|
|
37
|
+
...state[ action.kind ],
|
|
38
|
+
[ action.name ]: (
|
|
39
|
+
state[ action.kind ]?.[ action.name ] ?? []
|
|
40
|
+
).filter( ( _action ) => _action.id !== action.actionId ),
|
|
41
|
+
},
|
|
35
42
|
};
|
|
36
43
|
}
|
|
37
44
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
type PostStatus =
|
|
2
|
+
| 'published'
|
|
3
|
+
| 'draft'
|
|
4
|
+
| 'pending'
|
|
5
|
+
| 'private'
|
|
6
|
+
| 'future'
|
|
7
|
+
| 'auto-draft'
|
|
8
|
+
| 'trash';
|
|
9
|
+
|
|
10
|
+
export interface BasePost {
|
|
11
|
+
status?: PostStatus;
|
|
12
|
+
title: string | { rendered: string } | { raw: string };
|
|
13
|
+
type: string;
|
|
14
|
+
id: string | number;
|
|
15
|
+
}
|
|
16
|
+
export interface TemplateOrTemplatePart extends BasePost {
|
|
17
|
+
type: 'wp_template' | 'wp_template_part';
|
|
18
|
+
source: string;
|
|
19
|
+
has_theme_file: boolean;
|
|
20
|
+
id: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface Pattern extends BasePost {
|
|
24
|
+
slug: string;
|
|
25
|
+
title: { raw: string };
|
|
26
|
+
content: { raw: string } | string;
|
|
27
|
+
wp_pattern_sync_status: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type Post = TemplateOrTemplatePart | Pattern | BasePost;
|
|
31
|
+
|
|
32
|
+
// Will be unnecessary after typescript 5.0 upgrade.
|
|
33
|
+
export type CoreDataError = { message?: string; code?: string };
|
|
@@ -14,6 +14,8 @@ import { store as blocksStore } from '@wordpress/blocks';
|
|
|
14
14
|
import { store as editorStore } from '../store';
|
|
15
15
|
import { unlock } from '../lock-unlock';
|
|
16
16
|
|
|
17
|
+
/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */
|
|
18
|
+
|
|
17
19
|
const {
|
|
18
20
|
PatternOverridesControls,
|
|
19
21
|
ResetOverridesControl,
|
|
@@ -34,9 +36,8 @@ const {
|
|
|
34
36
|
*/
|
|
35
37
|
const withPatternOverrideControls = createHigherOrderComponent(
|
|
36
38
|
( BlockEdit ) => ( props ) => {
|
|
37
|
-
const isSupportedBlock =
|
|
38
|
-
PARTIAL_SYNCING_SUPPORTED_BLOCKS
|
|
39
|
-
).includes( props.name );
|
|
39
|
+
const isSupportedBlock =
|
|
40
|
+
!! PARTIAL_SYNCING_SUPPORTED_BLOCKS[ props.name ];
|
|
40
41
|
|
|
41
42
|
return (
|
|
42
43
|
<>
|
|
@@ -47,7 +48,8 @@ const withPatternOverrideControls = createHigherOrderComponent(
|
|
|
47
48
|
{ isSupportedBlock && <PatternOverridesBlockControls /> }
|
|
48
49
|
</>
|
|
49
50
|
);
|
|
50
|
-
}
|
|
51
|
+
},
|
|
52
|
+
'withPatternOverrideControls'
|
|
51
53
|
);
|
|
52
54
|
|
|
53
55
|
// Split into a separate component to avoid a store subscription
|
package/src/lock-unlock.js
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';
|
|
5
5
|
export const { lock, unlock } =
|
|
6
6
|
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
|
|
7
|
-
'I
|
|
7
|
+
'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',
|
|
8
8
|
'@wordpress/editor'
|
|
9
9
|
);
|
package/src/private-apis.js
CHANGED
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
mergeBaseAndUserConfigs,
|
|
24
24
|
GlobalStylesProvider,
|
|
25
25
|
} from './components/global-styles-provider';
|
|
26
|
+
import registerDefaultActions from './dataviews/actions';
|
|
26
27
|
|
|
27
28
|
const { store: interfaceStore, ...remainingInterfaceApis } = interfaceApis;
|
|
28
29
|
|
|
@@ -41,6 +42,7 @@ lock( privateApis, {
|
|
|
41
42
|
ToolsMoreMenuGroup,
|
|
42
43
|
ViewMoreMenuGroup,
|
|
43
44
|
ResizableEditor,
|
|
45
|
+
registerDefaultActions,
|
|
44
46
|
|
|
45
47
|
// This is a temporary private API while we're updating the site editor to use EditorProvider.
|
|
46
48
|
useBlockEditorSettings,
|
|
@@ -12,7 +12,6 @@ import { EntitiesSavedStatesExtensible } from './components/entities-saved-state
|
|
|
12
12
|
import useBlockEditorSettings from './components/provider/use-block-editor-settings';
|
|
13
13
|
import PluginPostExcerpt from './components/post-excerpt/plugin';
|
|
14
14
|
import PreferencesModal from './components/preferences-modal';
|
|
15
|
-
import { usePostActions } from './components/post-actions/actions';
|
|
16
15
|
import ToolsMoreMenuGroup from './components/more-menu/tools-more-menu-group';
|
|
17
16
|
import ViewMoreMenuGroup from './components/more-menu/view-more-menu-group';
|
|
18
17
|
|
|
@@ -24,7 +23,6 @@ lock( privateApis, {
|
|
|
24
23
|
EntitiesSavedStatesExtensible,
|
|
25
24
|
PluginPostExcerpt,
|
|
26
25
|
PreferencesModal,
|
|
27
|
-
usePostActions,
|
|
28
26
|
ToolsMoreMenuGroup,
|
|
29
27
|
ViewMoreMenuGroup,
|
|
30
28
|
|