@wordpress/editor 13.33.0 → 13.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -4
- package/README.md +132 -20
- package/build/bindings/pattern-overrides.js +70 -1
- package/build/bindings/pattern-overrides.js.map +1 -1
- package/build/components/autosave-monitor/index.js +15 -12
- package/build/components/autosave-monitor/index.js.map +1 -1
- package/build/components/block-settings-menu/content-only-settings-menu.js +126 -0
- package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -0
- package/build/components/block-settings-menu/content-only-settings-menu.native.js +11 -0
- package/build/components/block-settings-menu/content-only-settings-menu.native.js.map +1 -0
- package/build/components/character-count/index.js +5 -0
- package/build/components/character-count/index.js.map +1 -1
- package/build/components/collapsible-block-toolbar/index.js +73 -0
- package/build/components/collapsible-block-toolbar/index.js.map +1 -0
- package/build/components/document-bar/index.js +2 -2
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-outline/check.js +8 -0
- package/build/components/document-outline/check.js.map +1 -1
- package/build/components/document-outline/index.js +11 -0
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-outline/item.js +2 -2
- package/build/components/document-outline/item.js.map +1 -1
- package/build/components/document-tools/index.js +15 -25
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-canvas/edit-template-blocks-notification.js +1 -1
- package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build/components/editor-canvas/index.js +19 -8
- package/build/components/editor-canvas/index.js.map +1 -1
- package/build/components/editor-history/redo.js +11 -0
- package/build/components/editor-history/redo.js.map +1 -1
- package/build/components/editor-history/undo.js +11 -0
- package/build/components/editor-history/undo.js.map +1 -1
- package/build/components/editor-snackbars/index.js +6 -0
- package/build/components/editor-snackbars/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/index.js +7 -0
- package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js +35 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build/components/global-styles-provider/index.js +130 -0
- package/build/components/global-styles-provider/index.js.map +1 -0
- package/build/components/header/index.js +147 -0
- package/build/components/header/index.js.map +1 -0
- package/build/components/inserter-sidebar/index.js +56 -34
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +4 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +2 -2
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/list-view-sidebar/index.js +1 -1
- package/build/components/list-view-sidebar/index.js.map +1 -1
- package/build/components/more-menu/copy-content-menu-item.js +59 -0
- package/build/components/more-menu/copy-content-menu-item.js.map +1 -0
- package/build/components/more-menu/index.js +119 -0
- package/build/components/more-menu/index.js.map +1 -0
- package/build/components/more-menu/tools-more-menu-group.js +23 -0
- package/build/components/more-menu/tools-more-menu-group.js.map +1 -0
- package/build/components/more-menu/view-more-menu-group.js +24 -0
- package/build/components/more-menu/view-more-menu-group.js.map +1 -0
- package/build/components/page-attributes/check.js +8 -0
- package/build/components/page-attributes/check.js.map +1 -1
- package/build/components/page-attributes/order.js +7 -0
- package/build/components/page-attributes/order.js.map +1 -1
- package/build/components/page-attributes/panel.js +14 -8
- package/build/components/page-attributes/panel.js.map +1 -1
- package/build/components/page-attributes/parent.js +7 -0
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/plugin-post-publish-panel/index.js +1 -1
- package/build/components/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/plugin-pre-publish-panel/index.js +1 -1
- package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/plugin-sidebar/index.js +1 -1
- package/build/components/plugin-sidebar/index.js.map +1 -1
- package/build/components/post-actions/actions.js +219 -66
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +32 -16
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-author/check.js +9 -0
- package/build/components/post-author/check.js.map +1 -1
- package/build/components/post-author/index.js +6 -0
- package/build/components/post-author/index.js.map +1 -1
- package/build/components/post-author/panel.js +5 -0
- package/build/components/post-author/panel.js.map +1 -1
- package/build/components/post-card-panel/index.js +7 -66
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-comments/index.js +28 -8
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-content-information/index.js +72 -0
- package/build/components/post-content-information/index.js.map +1 -0
- package/build/components/post-discussion/panel.js +104 -20
- package/build/components/post-discussion/panel.js.map +1 -1
- package/build/components/post-excerpt/check.js +0 -19
- package/build/components/post-excerpt/check.js.map +1 -1
- package/build/components/post-excerpt/index.js +52 -12
- package/build/components/post-excerpt/index.js.map +1 -1
- package/build/components/post-excerpt/panel.js +118 -7
- package/build/components/post-excerpt/panel.js.map +1 -1
- package/build/components/post-excerpt/plugin.js +2 -2
- package/build/components/post-excerpt/plugin.js.map +1 -1
- package/build/components/post-featured-image/index.js +1 -1
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-format/panel.js +27 -0
- package/build/components/post-format/panel.js.map +1 -0
- package/build/components/post-last-edited-panel/index.js +33 -0
- package/build/components/post-last-edited-panel/index.js.map +1 -0
- package/build/components/post-panel-row/index.js +2 -2
- package/build/components/post-panel-row/index.js.map +1 -1
- package/build/components/post-panel-section/index.js +28 -0
- package/build/components/post-panel-section/index.js.map +1 -0
- package/build/components/post-pingbacks/index.js +5 -2
- package/build/components/post-pingbacks/index.js.map +1 -1
- package/build/components/post-publish-button/post-publish-button-or-toggle.js +100 -0
- package/build/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -0
- package/build/components/post-saved-state/index.js +2 -2
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/panel.js +1 -1
- package/build/components/post-schedule/panel.js.map +1 -1
- package/build/components/post-slug/panel.js +27 -0
- package/build/components/post-slug/panel.js.map +1 -0
- package/build/components/post-status/index.js +13 -13
- package/build/components/post-status/index.js.map +1 -1
- package/build/components/post-sticky/panel.js +21 -0
- package/build/components/post-sticky/panel.js.map +1 -0
- package/build/components/post-template/block-theme.js +2 -2
- package/build/components/post-template/block-theme.js.map +1 -1
- package/build/components/post-template/classic-theme.js +0 -1
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-template/swap-template-button.js +2 -5
- package/build/components/post-template/swap-template-button.js.map +1 -1
- package/build/components/post-title/index.js +2 -2
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/post-title-raw.js +2 -2
- package/build/components/post-title/post-title-raw.js.map +1 -1
- package/build/components/post-transform-panel/hooks.js +90 -0
- package/build/components/post-transform-panel/hooks.js.map +1 -0
- package/build/components/post-transform-panel/index.js +101 -0
- package/build/components/post-transform-panel/index.js.map +1 -0
- package/build/components/post-trash/panel.js +18 -0
- package/build/components/post-trash/panel.js.map +1 -0
- package/build/components/post-type-support-check/index.js +1 -1
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/post-url/index.js +2 -1
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/panel.js +1 -1
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/preferences-modal/enable-publish-sidebar.js +34 -0
- package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
- package/build/components/preferences-modal/index.js +11 -5
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +3 -1
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/disable-non-page-content-blocks.js +23 -16
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/index.js +3 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +21 -3
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/save-publish-panels/index.js +89 -0
- package/build/components/save-publish-panels/index.js.map +1 -0
- package/build/components/sidebar/constants.js +11 -0
- package/build/components/sidebar/constants.js.map +1 -0
- package/build/components/sidebar/header.js +53 -0
- package/build/components/sidebar/header.js.map +1 -0
- package/build/components/sidebar/index.js +157 -0
- package/build/components/sidebar/index.js.map +1 -0
- package/build/components/sidebar/post-summary.js +84 -0
- package/build/components/sidebar/post-summary.js.map +1 -0
- package/build/components/start-page-options/index.js +10 -8
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/start-template-options/index.js +192 -0
- package/build/components/start-template-options/index.js.map +1 -0
- package/build/components/template-content-panel/index.js +38 -0
- package/build/components/template-content-panel/index.js.map +1 -0
- package/build/hooks/pattern-overrides.js +10 -5
- package/build/hooks/pattern-overrides.js.map +1 -1
- package/build/private-apis.js +19 -8
- package/build/private-apis.js.map +1 -1
- package/build/private-apis.native.js +72 -0
- package/build/private-apis.native.js.map +1 -0
- package/build/store/private-selectors.js +6 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +15 -0
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +3 -1
- package/build/store/selectors.js.map +1 -1
- package/build-module/bindings/pattern-overrides.js +69 -1
- package/build-module/bindings/pattern-overrides.js.map +1 -1
- package/build-module/components/autosave-monitor/index.js +15 -13
- package/build-module/components/autosave-monitor/index.js.map +1 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js +119 -0
- package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -0
- package/build-module/components/block-settings-menu/content-only-settings-menu.native.js +5 -0
- package/build-module/components/block-settings-menu/content-only-settings-menu.native.js.map +1 -0
- package/build-module/components/character-count/index.js +6 -0
- package/build-module/components/character-count/index.js.map +1 -1
- package/build-module/components/collapsible-block-toolbar/index.js +65 -0
- package/build-module/components/collapsible-block-toolbar/index.js.map +1 -0
- package/build-module/components/document-bar/index.js +2 -2
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-outline/check.js +9 -0
- package/build-module/components/document-outline/check.js.map +1 -1
- package/build-module/components/document-outline/index.js +11 -0
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-outline/item.js +2 -2
- package/build-module/components/document-outline/item.js.map +1 -1
- package/build-module/components/document-tools/index.js +17 -27
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js +1 -1
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build-module/components/editor-canvas/index.js +19 -8
- package/build-module/components/editor-canvas/index.js.map +1 -1
- package/build-module/components/editor-history/redo.js +11 -0
- package/build-module/components/editor-history/redo.js.map +1 -1
- package/build-module/components/editor-history/undo.js +11 -0
- package/build-module/components/editor-history/undo.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js +6 -0
- package/build-module/components/editor-snackbars/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/index.js +8 -0
- package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +36 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build-module/components/global-styles-provider/index.js +120 -0
- package/build-module/components/global-styles-provider/index.js.map +1 -0
- package/build-module/components/header/index.js +139 -0
- package/build-module/components/header/index.js.map +1 -0
- package/build-module/components/inserter-sidebar/index.js +59 -37
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +4 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +2 -2
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/list-view-sidebar/index.js +1 -1
- package/build-module/components/list-view-sidebar/index.js.map +1 -1
- package/build-module/components/more-menu/copy-content-menu-item.js +52 -0
- package/build-module/components/more-menu/copy-content-menu-item.js.map +1 -0
- package/build-module/components/more-menu/index.js +111 -0
- package/build-module/components/more-menu/index.js.map +1 -0
- package/build-module/components/more-menu/tools-more-menu-group.js +16 -0
- package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -0
- package/build-module/components/more-menu/view-more-menu-group.js +17 -0
- package/build-module/components/more-menu/view-more-menu-group.js.map +1 -0
- package/build-module/components/page-attributes/check.js +9 -0
- package/build-module/components/page-attributes/check.js.map +1 -1
- package/build-module/components/page-attributes/order.js +7 -0
- package/build-module/components/page-attributes/order.js.map +1 -1
- package/build-module/components/page-attributes/panel.js +13 -6
- package/build-module/components/page-attributes/panel.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +7 -0
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/plugin-post-publish-panel/index.js +1 -1
- package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
- package/build-module/components/plugin-pre-publish-panel/index.js +1 -1
- package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/plugin-sidebar/index.js +1 -1
- package/build-module/components/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/post-actions/actions.js +223 -70
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +33 -17
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-author/check.js +10 -0
- package/build-module/components/post-author/check.js.map +1 -1
- package/build-module/components/post-author/index.js +6 -0
- package/build-module/components/post-author/index.js.map +1 -1
- package/build-module/components/post-author/panel.js +6 -0
- package/build-module/components/post-author/panel.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +9 -67
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-comments/index.js +30 -10
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-content-information/index.js +66 -0
- package/build-module/components/post-content-information/index.js.map +1 -0
- package/build-module/components/post-discussion/panel.js +105 -21
- package/build-module/components/post-discussion/panel.js.map +1 -1
- package/build-module/components/post-excerpt/check.js +0 -19
- package/build-module/components/post-excerpt/check.js.map +1 -1
- package/build-module/components/post-excerpt/index.js +52 -11
- package/build-module/components/post-excerpt/index.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js +118 -8
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-excerpt/plugin.js +2 -2
- package/build-module/components/post-excerpt/plugin.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +1 -1
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-format/panel.js +18 -0
- package/build-module/components/post-format/panel.js.map +1 -0
- package/build-module/components/post-last-edited-panel/index.js +26 -0
- package/build-module/components/post-last-edited-panel/index.js.map +1 -0
- package/build-module/components/post-panel-row/index.js +2 -2
- package/build-module/components/post-panel-row/index.js.map +1 -1
- package/build-module/components/post-panel-section/index.js +20 -0
- package/build-module/components/post-panel-section/index.js.map +1 -0
- package/build-module/components/post-pingbacks/index.js +6 -3
- package/build-module/components/post-pingbacks/index.js.map +1 -1
- package/build-module/components/post-publish-button/post-publish-button-or-toggle.js +91 -0
- package/build-module/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -0
- package/build-module/components/post-saved-state/index.js +2 -2
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/panel.js +1 -1
- package/build-module/components/post-schedule/panel.js.map +1 -1
- package/build-module/components/post-slug/panel.js +18 -0
- package/build-module/components/post-slug/panel.js.map +1 -0
- package/build-module/components/post-status/index.js +13 -13
- package/build-module/components/post-status/index.js.map +1 -1
- package/build-module/components/post-sticky/panel.js +12 -0
- package/build-module/components/post-sticky/panel.js.map +1 -0
- package/build-module/components/post-template/block-theme.js +2 -2
- package/build-module/components/post-template/block-theme.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +0 -1
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/swap-template-button.js +3 -6
- package/build-module/components/post-template/swap-template-button.js.map +1 -1
- package/build-module/components/post-title/index.js +2 -2
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/post-title-raw.js +2 -2
- package/build-module/components/post-title/post-title-raw.js.map +1 -1
- package/build-module/components/post-transform-panel/hooks.js +83 -0
- package/build-module/components/post-transform-panel/hooks.js.map +1 -0
- package/build-module/components/post-transform-panel/index.js +94 -0
- package/build-module/components/post-transform-panel/index.js.map +1 -0
- package/build-module/components/post-trash/panel.js +10 -0
- package/build-module/components/post-trash/panel.js.map +1 -0
- package/build-module/components/post-type-support-check/index.js +1 -1
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/post-url/index.js +2 -1
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/panel.js +1 -1
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/preferences-modal/enable-publish-sidebar.js +27 -0
- package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
- package/build-module/components/preferences-modal/index.js +11 -5
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +3 -1
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js +24 -17
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/provider/index.js +3 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +21 -3
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/save-publish-panels/index.js +80 -0
- package/build-module/components/save-publish-panels/index.js.map +1 -0
- package/build-module/components/sidebar/constants.js +5 -0
- package/build-module/components/sidebar/constants.js.map +1 -0
- package/build-module/components/sidebar/header.js +46 -0
- package/build-module/components/sidebar/header.js.map +1 -0
- package/build-module/components/sidebar/index.js +149 -0
- package/build-module/components/sidebar/index.js.map +1 -0
- package/build-module/components/sidebar/post-summary.js +77 -0
- package/build-module/components/sidebar/post-summary.js.map +1 -0
- package/build-module/components/start-page-options/index.js +10 -8
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +185 -0
- package/build-module/components/start-template-options/index.js.map +1 -0
- package/build-module/components/template-content-panel/index.js +31 -0
- package/build-module/components/template-content-panel/index.js.map +1 -0
- package/build-module/hooks/pattern-overrides.js +10 -5
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/private-apis.js +19 -8
- package/build-module/private-apis.js.map +1 -1
- package/build-module/private-apis.native.js +62 -0
- package/build-module/private-apis.native.js.map +1 -0
- package/build-module/store/private-selectors.js +3 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +14 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +3 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +535 -48
- package/build-style/style.css +535 -48
- package/package.json +38 -36
- package/src/bindings/pattern-overrides.js +83 -1
- package/src/components/autocompleters/style.scss +1 -2
- package/src/components/autosave-monitor/index.js +15 -12
- package/src/components/block-settings-menu/content-only-settings-menu.js +175 -0
- package/src/components/block-settings-menu/content-only-settings-menu.native.js +4 -0
- package/src/components/block-settings-menu/style.scss +4 -0
- package/src/components/character-count/index.js +5 -0
- package/src/components/collapsible-block-toolbar/index.js +77 -0
- package/src/components/collapsible-block-toolbar/style.scss +80 -0
- package/src/components/document-bar/index.js +2 -2
- package/src/components/document-outline/check.js +8 -0
- package/src/components/document-outline/index.js +10 -0
- package/src/components/document-outline/item.js +2 -2
- package/src/components/document-tools/index.js +19 -26
- package/src/components/editor-canvas/edit-template-blocks-notification.js +1 -1
- package/src/components/editor-canvas/index.js +18 -6
- package/src/components/editor-history/redo.js +10 -0
- package/src/components/editor-history/undo.js +10 -0
- package/src/components/editor-snackbars/index.js +5 -0
- package/src/components/entities-saved-states/style.scss +7 -0
- package/src/components/global-keyboard-shortcuts/index.js +7 -0
- package/src/components/global-keyboard-shortcuts/register-shortcuts.js +42 -1
- package/src/components/global-styles-provider/index.js +162 -0
- package/src/components/header/index.js +154 -0
- package/src/components/header/style.scss +231 -0
- package/src/components/inserter-sidebar/index.js +52 -32
- package/src/components/inserter-sidebar/style.scss +10 -3
- package/src/components/keyboard-shortcut-help-modal/config.js +10 -1
- package/src/components/keyboard-shortcut-help-modal/index.js +2 -2
- package/src/components/list-view-sidebar/index.js +1 -1
- package/src/components/list-view-sidebar/style.scss +3 -2
- package/src/components/more-menu/copy-content-menu-item.js +51 -0
- package/src/components/more-menu/index.js +158 -0
- package/src/components/more-menu/tools-more-menu-group.js +11 -0
- package/src/components/more-menu/view-more-menu-group.js +13 -0
- package/src/components/page-attributes/check.js +8 -0
- package/src/components/page-attributes/order.js +6 -0
- package/src/components/page-attributes/panel.js +21 -17
- package/src/components/page-attributes/parent.js +6 -0
- package/src/components/page-attributes/test/order.js +5 -1
- package/src/components/plugin-post-publish-panel/index.js +1 -1
- package/src/components/plugin-pre-publish-panel/index.js +1 -1
- package/src/components/plugin-sidebar/index.js +1 -1
- package/src/components/post-actions/actions.js +373 -152
- package/src/components/post-actions/index.js +34 -33
- package/src/components/post-author/check.js +9 -0
- package/src/components/post-author/index.js +5 -0
- package/src/components/post-author/panel.js +5 -0
- package/src/components/post-card-panel/index.js +40 -141
- package/src/components/post-card-panel/style.scss +2 -6
- package/src/components/post-comments/index.js +47 -9
- package/src/components/post-content-information/index.js +83 -0
- package/src/components/post-content-information/style.scss +6 -0
- package/src/components/post-discussion/panel.js +108 -27
- package/src/components/post-discussion/style.scss +26 -0
- package/src/components/post-excerpt/check.js +0 -18
- package/src/components/post-excerpt/index.js +66 -15
- package/src/components/post-excerpt/panel.js +196 -19
- package/src/components/post-excerpt/plugin.js +2 -2
- package/src/components/post-excerpt/style.scss +24 -0
- package/src/components/post-featured-image/index.js +1 -1
- package/src/components/post-featured-image/style.scss +2 -8
- package/src/components/post-format/panel.js +22 -0
- package/src/components/post-format/style.scss +6 -0
- package/src/components/post-last-edited-panel/index.js +35 -0
- package/src/components/post-last-edited-panel/style.scss +6 -0
- package/src/components/post-last-revision/test/check.js +5 -1
- package/src/components/post-panel-row/index.js +2 -2
- package/src/components/post-panel-row/style.scss +3 -3
- package/src/components/post-panel-section/index.js +19 -0
- package/src/components/post-panel-section/style.scss +3 -0
- package/src/components/post-pingbacks/index.js +11 -2
- package/src/components/post-publish-button/post-publish-button-or-toggle.js +102 -0
- package/src/components/post-publish-button/test/post-publish-button-or-toggle.js +63 -0
- package/src/components/post-publish-panel/style.scss +48 -0
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +225 -75
- package/src/components/post-saved-state/index.js +2 -2
- package/src/components/post-schedule/panel.js +1 -1
- package/src/components/post-schedule/style.scss +2 -4
- package/src/components/post-slug/panel.js +22 -0
- package/src/components/post-slug/style.scss +5 -0
- package/src/components/post-slug/test/index.js +5 -1
- package/src/components/post-status/index.js +88 -80
- package/src/components/post-status/style.scss +0 -1
- package/src/components/post-sticky/panel.js +18 -0
- package/src/components/post-template/block-theme.js +2 -2
- package/src/components/post-template/classic-theme.js +0 -1
- package/src/components/post-template/swap-template-button.js +3 -6
- package/src/components/post-text-editor/style.scss +1 -1
- package/src/components/post-title/index.js +2 -2
- package/src/components/post-title/post-title-raw.js +2 -2
- package/src/components/post-title/style.scss +1 -1
- package/src/components/post-transform-panel/hooks.js +114 -0
- package/src/components/post-transform-panel/index.js +99 -0
- package/src/components/post-trash/panel.js +13 -0
- package/src/components/post-type-support-check/index.js +1 -1
- package/src/components/post-type-support-check/test/index.js +2 -2
- package/src/components/post-url/index.js +1 -0
- package/src/components/post-url/panel.js +1 -1
- package/src/components/preferences-modal/enable-publish-sidebar.js +28 -0
- package/src/components/preferences-modal/index.js +17 -3
- package/src/components/preview-dropdown/index.js +3 -1
- package/src/components/provider/disable-non-page-content-blocks.js +23 -21
- package/src/components/provider/index.js +4 -0
- package/src/components/provider/use-block-editor-settings.js +19 -4
- package/src/components/save-publish-panels/index.js +96 -0
- package/src/components/save-publish-panels/style.scss +36 -0
- package/src/components/sidebar/constants.js +4 -0
- package/src/components/sidebar/header.js +49 -0
- package/src/components/sidebar/index.js +200 -0
- package/src/components/sidebar/post-summary.js +104 -0
- package/src/components/sidebar/style.scss +18 -0
- package/src/components/start-page-options/index.js +12 -5
- package/src/components/start-template-options/index.js +219 -0
- package/src/components/start-template-options/style.scss +55 -0
- package/src/components/template-areas/style.scss +0 -1
- package/src/components/template-content-panel/index.js +36 -0
- package/src/hooks/pattern-overrides.js +12 -6
- package/src/private-apis.js +22 -8
- package/src/private-apis.native.js +61 -0
- package/src/store/private-selectors.js +3 -0
- package/src/store/reducer.js +12 -0
- package/src/store/selectors.js +3 -1
- package/src/style.scss +11 -0
- package/src/components/post-slug/test/check.js +0 -17
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 13.35.0 (2024-05-16)
|
|
6
|
+
|
|
7
|
+
### Internal
|
|
8
|
+
|
|
9
|
+
- Replaced `classnames` package with the faster and smaller `clsx` package ([#61138](https://github.com/WordPress/gutenberg/pull/61138)).
|
|
10
|
+
|
|
11
|
+
## 13.34.0 (2024-05-02)
|
|
12
|
+
|
|
5
13
|
## 13.33.0 (2024-04-19)
|
|
6
14
|
|
|
7
15
|
## 13.32.0 (2024-04-03)
|
|
@@ -122,7 +130,7 @@
|
|
|
122
130
|
|
|
123
131
|
### Deprecations
|
|
124
132
|
|
|
125
|
-
-
|
|
133
|
+
- Deprecated `cleanForSlug` that is now part of `@wordpress/url`.
|
|
126
134
|
|
|
127
135
|
## 12.2.0 (2022-02-10)
|
|
128
136
|
|
|
@@ -136,7 +144,7 @@
|
|
|
136
144
|
|
|
137
145
|
### Deprecations
|
|
138
146
|
|
|
139
|
-
-
|
|
147
|
+
- the `createUndoLevel` and `refreshPost` actions were marked as deprecated. They were already defunct and acting as noops.
|
|
140
148
|
|
|
141
149
|
## 12.1.0 (2022-01-27)
|
|
142
150
|
|
|
@@ -161,8 +169,8 @@
|
|
|
161
169
|
|
|
162
170
|
### Breaking Changes
|
|
163
171
|
|
|
164
|
-
- Drop support for Internet Explorer 11 ([#31110](https://github.com/WordPress/gutenberg/pull/31110)). Learn more at https://make.wordpress.org/core/2021/04/22/ie-11-support-phase-out-plan
|
|
165
|
-
- Increase the minimum Node.js version to v12 matching Long Term Support releases ([#31270](https://github.com/WordPress/gutenberg/pull/31270)). Learn more at https://nodejs.org/en/about/releases
|
|
172
|
+
- Drop support for Internet Explorer 11 ([#31110](https://github.com/WordPress/gutenberg/pull/31110)). Learn more at <https://make.wordpress.org/core/2021/04/22/ie-11-support-phase-out-plan/>.
|
|
173
|
+
- Increase the minimum Node.js version to v12 matching Long Term Support releases ([#31270](https://github.com/WordPress/gutenberg/pull/31270)). Learn more at <https://nodejs.org/en/about/releases/>.
|
|
166
174
|
|
|
167
175
|
## 9.26.0 (2021-03-17)
|
|
168
176
|
|
package/README.md
CHANGED
|
@@ -128,7 +128,14 @@ Example:
|
|
|
128
128
|
|
|
129
129
|
### AutosaveMonitor
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
Monitors the changes made to the edited post and triggers autosave if necessary.
|
|
132
|
+
|
|
133
|
+
The logic is straightforward: a check is performed every `props.interval` seconds. If any changes are detected, `props.autosave()` is called. The time between the change and the autosave varies but is no larger than `props.interval` seconds. Refer to the code below for more details, such as the specific way of detecting changes.
|
|
134
|
+
|
|
135
|
+
There are two caveats:
|
|
136
|
+
|
|
137
|
+
- If `props.isAutosaveable` happens to be false at a time of checking for changes, the check is retried every second.
|
|
138
|
+
- The timer may be disabled by setting `props.disableIntervalChecks` to `true`. In that mode, any change will immediately trigger `props.autosave()`.
|
|
132
139
|
|
|
133
140
|
_Usage_
|
|
134
141
|
|
|
@@ -136,6 +143,15 @@ _Usage_
|
|
|
136
143
|
<AutosaveMonitor interval={ 30000 } />
|
|
137
144
|
```
|
|
138
145
|
|
|
146
|
+
_Parameters_
|
|
147
|
+
|
|
148
|
+
- _props_ `Object`: - The properties passed to the component.
|
|
149
|
+
- _props.autosave_ `Function`: - The function to call when changes need to be saved.
|
|
150
|
+
- _props.interval_ `number`: - The maximum time in seconds between an unsaved change and an autosave.
|
|
151
|
+
- _props.isAutosaveable_ `boolean`: - If false, the check for changes is retried every second.
|
|
152
|
+
- _props.disableIntervalChecks_ `boolean`: - If true, disables the timer and any change will immediately trigger `props.autosave()`.
|
|
153
|
+
- _props.isDirty_ `boolean`: - Indicates if there are unsaved changes.
|
|
154
|
+
|
|
139
155
|
### BlockAlignmentToolbar
|
|
140
156
|
|
|
141
157
|
> **Deprecated** since 5.3, use `wp.blockEditor.BlockAlignmentToolbar` instead.
|
|
@@ -194,7 +210,11 @@ _Usage_
|
|
|
194
210
|
|
|
195
211
|
### CharacterCount
|
|
196
212
|
|
|
197
|
-
|
|
213
|
+
Renders the character count of the post content.
|
|
214
|
+
|
|
215
|
+
_Returns_
|
|
216
|
+
|
|
217
|
+
- `number`: The character count.
|
|
198
218
|
|
|
199
219
|
### cleanForSlug
|
|
200
220
|
|
|
@@ -238,27 +258,71 @@ Undocumented declaration.
|
|
|
238
258
|
|
|
239
259
|
### DocumentOutline
|
|
240
260
|
|
|
241
|
-
|
|
261
|
+
Renders a document outline component.
|
|
262
|
+
|
|
263
|
+
_Parameters_
|
|
264
|
+
|
|
265
|
+
- _props_ `Object`: Props.
|
|
266
|
+
- _props.onSelect_ `Function`: Function to be called when an outline item is selected.
|
|
267
|
+
- _props.isTitleSupported_ `boolean`: Indicates whether the title is supported.
|
|
268
|
+
- _props.hasOutlineItemsDisabled_ `boolean`: Indicates whether the outline items are disabled.
|
|
269
|
+
|
|
270
|
+
_Returns_
|
|
271
|
+
|
|
272
|
+
- `Component`: The component to be rendered.
|
|
242
273
|
|
|
243
274
|
### DocumentOutlineCheck
|
|
244
275
|
|
|
245
|
-
|
|
276
|
+
Component check if there are any headings (core/heading blocks) present in the document.
|
|
277
|
+
|
|
278
|
+
_Parameters_
|
|
279
|
+
|
|
280
|
+
- _props_ `Object`: Props.
|
|
281
|
+
- _props.children_ `Element`: Children to be rendered.
|
|
282
|
+
|
|
283
|
+
_Returns_
|
|
284
|
+
|
|
285
|
+
- `Component|null`: The component to be rendered or null if there are headings.
|
|
246
286
|
|
|
247
287
|
### EditorHistoryRedo
|
|
248
288
|
|
|
249
|
-
|
|
289
|
+
Renders the redo button for the editor history.
|
|
290
|
+
|
|
291
|
+
_Parameters_
|
|
292
|
+
|
|
293
|
+
- _props_ `Object`: - Props.
|
|
294
|
+
- _ref_ `Ref`: - Forwarded ref.
|
|
295
|
+
|
|
296
|
+
_Returns_
|
|
297
|
+
|
|
298
|
+
- `Component`: The component to be rendered.
|
|
250
299
|
|
|
251
300
|
### EditorHistoryUndo
|
|
252
301
|
|
|
253
|
-
|
|
302
|
+
Renders the undo button for the editor history.
|
|
303
|
+
|
|
304
|
+
_Parameters_
|
|
305
|
+
|
|
306
|
+
- _props_ `Object`: - Props.
|
|
307
|
+
- _ref_ `Ref`: - Forwarded ref.
|
|
308
|
+
|
|
309
|
+
_Returns_
|
|
310
|
+
|
|
311
|
+
- `Component`: The component to be rendered.
|
|
254
312
|
|
|
255
313
|
### EditorKeyboardShortcuts
|
|
256
314
|
|
|
257
|
-
|
|
315
|
+
Component handles the keyboard shortcuts for the editor.
|
|
316
|
+
|
|
317
|
+
It provides functionality for various keyboard shortcuts such as toggling editor mode, toggling distraction-free mode, undo/redo, saving the post, toggling list view, and toggling the sidebar.
|
|
258
318
|
|
|
259
319
|
### EditorKeyboardShortcutsRegister
|
|
260
320
|
|
|
261
|
-
|
|
321
|
+
Component for registering editor keyboard shortcuts.
|
|
322
|
+
|
|
323
|
+
_Returns_
|
|
324
|
+
|
|
325
|
+
- `Element`: The component to be rendered.
|
|
262
326
|
|
|
263
327
|
### EditorNotices
|
|
264
328
|
|
|
@@ -270,7 +334,11 @@ Undocumented declaration.
|
|
|
270
334
|
|
|
271
335
|
### EditorSnackbars
|
|
272
336
|
|
|
273
|
-
|
|
337
|
+
Renders the editor snackbars component.
|
|
338
|
+
|
|
339
|
+
_Returns_
|
|
340
|
+
|
|
341
|
+
- `JSX.Element`: The rendered component.
|
|
274
342
|
|
|
275
343
|
### EntitiesSavedStates
|
|
276
344
|
|
|
@@ -376,19 +444,40 @@ _Parameters_
|
|
|
376
444
|
|
|
377
445
|
### PageAttributesCheck
|
|
378
446
|
|
|
379
|
-
|
|
447
|
+
Wrapper component that renders its children only if the post type supports page attributes.
|
|
448
|
+
|
|
449
|
+
_Parameters_
|
|
450
|
+
|
|
451
|
+
- _props_ `Object`: - The component props.
|
|
452
|
+
- _props.children_ `Element`: - The child components to render.
|
|
453
|
+
|
|
454
|
+
_Returns_
|
|
455
|
+
|
|
456
|
+
- `Component|null`: The rendered child components or null if page attributes are not supported.
|
|
380
457
|
|
|
381
458
|
### PageAttributesOrder
|
|
382
459
|
|
|
383
|
-
|
|
460
|
+
Renders the Page Attributes Order component. A number input in an editor interface for setting the order of a given page.
|
|
461
|
+
|
|
462
|
+
_Returns_
|
|
463
|
+
|
|
464
|
+
- `Component`: The component to be rendered.
|
|
384
465
|
|
|
385
466
|
### PageAttributesPanel
|
|
386
467
|
|
|
387
|
-
|
|
468
|
+
Renders the Page Attributes Panel component.
|
|
469
|
+
|
|
470
|
+
_Returns_
|
|
471
|
+
|
|
472
|
+
- `Component`: The component to be rendered.
|
|
388
473
|
|
|
389
474
|
### PageAttributesParent
|
|
390
475
|
|
|
391
|
-
|
|
476
|
+
Renders the Page Attributes Parent component. A dropdown menu in an editor interface for selecting the parent page of a given page.
|
|
477
|
+
|
|
478
|
+
_Returns_
|
|
479
|
+
|
|
480
|
+
- `Component|null`: The component to be rendered. Return null if post type is not hierarchical.
|
|
392
481
|
|
|
393
482
|
### PageTemplate
|
|
394
483
|
|
|
@@ -587,7 +676,7 @@ _Usage_
|
|
|
587
676
|
```jsx
|
|
588
677
|
// Using ESNext syntax
|
|
589
678
|
import { __ } from '@wordpress/i18n';
|
|
590
|
-
import { PluginPostPublishPanel } from '@wordpress/
|
|
679
|
+
import { PluginPostPublishPanel } from '@wordpress/editor';
|
|
591
680
|
|
|
592
681
|
const MyPluginPostPublishPanel = () => (
|
|
593
682
|
<PluginPostPublishPanel
|
|
@@ -666,7 +755,7 @@ _Usage_
|
|
|
666
755
|
```jsx
|
|
667
756
|
// Using ESNext syntax
|
|
668
757
|
import { __ } from '@wordpress/i18n';
|
|
669
|
-
import { PluginPrePublishPanel } from '@wordpress/
|
|
758
|
+
import { PluginPrePublishPanel } from '@wordpress/editor';
|
|
670
759
|
|
|
671
760
|
const MyPluginPrePublishPanel = () => (
|
|
672
761
|
<PluginPrePublishPanel
|
|
@@ -733,7 +822,7 @@ function MyPluginSidebar() {
|
|
|
733
822
|
// Using ESNext syntax
|
|
734
823
|
import { __ } from '@wordpress/i18n';
|
|
735
824
|
import { PanelBody } from '@wordpress/components';
|
|
736
|
-
import { PluginSidebar } from '@wordpress/
|
|
825
|
+
import { PluginSidebar } from '@wordpress/editor';
|
|
737
826
|
import { more } from '@wordpress/icons';
|
|
738
827
|
|
|
739
828
|
const MyPluginSidebar = () => (
|
|
@@ -801,15 +890,32 @@ _Returns_
|
|
|
801
890
|
|
|
802
891
|
### PostAuthor
|
|
803
892
|
|
|
804
|
-
|
|
893
|
+
Renders the component for selecting the post author.
|
|
894
|
+
|
|
895
|
+
_Returns_
|
|
896
|
+
|
|
897
|
+
- `Component`: The component to be rendered.
|
|
805
898
|
|
|
806
899
|
### PostAuthorCheck
|
|
807
900
|
|
|
808
|
-
|
|
901
|
+
Wrapper component that renders its children only if the post type supports the author.
|
|
902
|
+
|
|
903
|
+
_Parameters_
|
|
904
|
+
|
|
905
|
+
- _props_ `Object`: The component props.
|
|
906
|
+
- _props.children_ `Element`: Children to be rendered.
|
|
907
|
+
|
|
908
|
+
_Returns_
|
|
909
|
+
|
|
910
|
+
- `Component|null`: The component to be rendered. Return `null` if the post type doesn't supports the author or if there are no authors available.
|
|
809
911
|
|
|
810
912
|
### PostAuthorPanel
|
|
811
913
|
|
|
812
|
-
|
|
914
|
+
Renders the Post Author Panel component.
|
|
915
|
+
|
|
916
|
+
_Returns_
|
|
917
|
+
|
|
918
|
+
- `Component`: The component to be rendered.
|
|
813
919
|
|
|
814
920
|
### PostComments
|
|
815
921
|
|
|
@@ -821,7 +927,13 @@ Undocumented declaration.
|
|
|
821
927
|
|
|
822
928
|
### PostExcerpt
|
|
823
929
|
|
|
824
|
-
|
|
930
|
+
Renders an editable textarea for the post excerpt. Templates, template parts and patterns use the `excerpt` field as a description semantically. Additionally templates and template parts override the `excerpt` field as `description` in REST API. So this component handles proper labeling and updating the edited entity.
|
|
931
|
+
|
|
932
|
+
_Parameters_
|
|
933
|
+
|
|
934
|
+
- _props_ `Object`: - Component props.
|
|
935
|
+
- _props.hideLabelFromVision_ `[boolean]`: - Whether to visually hide the textarea's label.
|
|
936
|
+
- _props.updateOnBlur_ `[boolean]`: - Whether to update the post on change or use local state and update on blur.
|
|
825
937
|
|
|
826
938
|
### PostExcerptCheck
|
|
827
939
|
|
|
@@ -5,13 +5,82 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _i18n = require("@wordpress/i18n");
|
|
8
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
8
9
|
/**
|
|
9
10
|
* WordPress dependencies
|
|
10
11
|
*/
|
|
12
|
+
|
|
13
|
+
const CONTENT = 'content';
|
|
11
14
|
var _default = exports.default = {
|
|
12
15
|
name: 'core/pattern-overrides',
|
|
13
16
|
label: (0, _i18n._x)('Pattern Overrides', 'block bindings source'),
|
|
14
|
-
|
|
17
|
+
getValue({
|
|
18
|
+
registry,
|
|
19
|
+
clientId,
|
|
20
|
+
attributeName
|
|
21
|
+
}) {
|
|
22
|
+
const {
|
|
23
|
+
getBlockAttributes,
|
|
24
|
+
getBlockParentsByBlockName
|
|
25
|
+
} = registry.select(_blockEditor.store);
|
|
26
|
+
const currentBlockAttributes = getBlockAttributes(clientId);
|
|
27
|
+
const [patternClientId] = getBlockParentsByBlockName(clientId, 'core/block', true);
|
|
28
|
+
const overridableValue = getBlockAttributes(patternClientId)?.[CONTENT]?.[currentBlockAttributes?.metadata?.name]?.[attributeName];
|
|
29
|
+
|
|
30
|
+
// If there is no pattern client ID, or it is not overwritten, return the default value.
|
|
31
|
+
if (!patternClientId || overridableValue === undefined) {
|
|
32
|
+
return currentBlockAttributes[attributeName];
|
|
33
|
+
}
|
|
34
|
+
return overridableValue === '' ? undefined : overridableValue;
|
|
35
|
+
},
|
|
36
|
+
setValues({
|
|
37
|
+
registry,
|
|
38
|
+
clientId,
|
|
39
|
+
attributes
|
|
40
|
+
}) {
|
|
41
|
+
const {
|
|
42
|
+
getBlockAttributes,
|
|
43
|
+
getBlockParentsByBlockName,
|
|
44
|
+
getBlocks
|
|
45
|
+
} = registry.select(_blockEditor.store);
|
|
46
|
+
const currentBlockAttributes = getBlockAttributes(clientId);
|
|
47
|
+
const blockName = currentBlockAttributes?.metadata?.name;
|
|
48
|
+
if (!blockName) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const [patternClientId] = getBlockParentsByBlockName(clientId, 'core/block', true);
|
|
52
|
+
|
|
53
|
+
// If there is no pattern client ID, sync blocks with the same name and same attributes.
|
|
54
|
+
if (!patternClientId) {
|
|
55
|
+
const syncBlocksWithSameName = blocks => {
|
|
56
|
+
for (const block of blocks) {
|
|
57
|
+
if (block.attributes?.metadata?.name === blockName) {
|
|
58
|
+
registry.dispatch(_blockEditor.store).updateBlockAttributes(block.clientId, attributes);
|
|
59
|
+
}
|
|
60
|
+
syncBlocksWithSameName(block.innerBlocks);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
syncBlocksWithSameName(getBlocks());
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const currentBindingValue = getBlockAttributes(patternClientId)?.[CONTENT];
|
|
67
|
+
registry.dispatch(_blockEditor.store).updateBlockAttributes(patternClientId, {
|
|
68
|
+
[CONTENT]: {
|
|
69
|
+
...currentBindingValue,
|
|
70
|
+
[blockName]: {
|
|
71
|
+
...currentBindingValue?.[blockName],
|
|
72
|
+
...Object.entries(attributes).reduce((acc, [key, value]) => {
|
|
73
|
+
// TODO: We need a way to represent `undefined` in the serialized overrides.
|
|
74
|
+
// Also see: https://github.com/WordPress/gutenberg/pull/57249#discussion_r1452987871
|
|
75
|
+
// We use an empty string to represent undefined for now until
|
|
76
|
+
// we support a richer format for overrides and the block bindings API.
|
|
77
|
+
acc[key] = value === undefined ? '' : value;
|
|
78
|
+
return acc;
|
|
79
|
+
}, {})
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
},
|
|
15
84
|
lockAttributesEditing: false
|
|
16
85
|
};
|
|
17
86
|
//# sourceMappingURL=pattern-overrides.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_default","exports","default","name","label","_x","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_blockEditor","CONTENT","_default","exports","default","name","label","_x","getValue","registry","clientId","attributeName","getBlockAttributes","getBlockParentsByBlockName","select","blockEditorStore","currentBlockAttributes","patternClientId","overridableValue","metadata","undefined","setValues","attributes","getBlocks","blockName","syncBlocksWithSameName","blocks","block","dispatch","updateBlockAttributes","innerBlocks","currentBindingValue","Object","entries","reduce","acc","key","value","lockAttributesEditing"],"sources":["@wordpress/editor/src/bindings/pattern-overrides.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nconst CONTENT = 'content';\n\nexport default {\n\tname: 'core/pattern-overrides',\n\tlabel: _x( 'Pattern Overrides', 'block bindings source' ),\n\tgetValue( { registry, clientId, attributeName } ) {\n\t\tconst { getBlockAttributes, getBlockParentsByBlockName } =\n\t\t\tregistry.select( blockEditorStore );\n\t\tconst currentBlockAttributes = getBlockAttributes( clientId );\n\t\tconst [ patternClientId ] = getBlockParentsByBlockName(\n\t\t\tclientId,\n\t\t\t'core/block',\n\t\t\ttrue\n\t\t);\n\n\t\tconst overridableValue =\n\t\t\tgetBlockAttributes( patternClientId )?.[ CONTENT ]?.[\n\t\t\t\tcurrentBlockAttributes?.metadata?.name\n\t\t\t]?.[ attributeName ];\n\n\t\t// If there is no pattern client ID, or it is not overwritten, return the default value.\n\t\tif ( ! patternClientId || overridableValue === undefined ) {\n\t\t\treturn currentBlockAttributes[ attributeName ];\n\t\t}\n\n\t\treturn overridableValue === '' ? undefined : overridableValue;\n\t},\n\tsetValues( { registry, clientId, attributes } ) {\n\t\tconst { getBlockAttributes, getBlockParentsByBlockName, getBlocks } =\n\t\t\tregistry.select( blockEditorStore );\n\t\tconst currentBlockAttributes = getBlockAttributes( clientId );\n\t\tconst blockName = currentBlockAttributes?.metadata?.name;\n\t\tif ( ! blockName ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst [ patternClientId ] = getBlockParentsByBlockName(\n\t\t\tclientId,\n\t\t\t'core/block',\n\t\t\ttrue\n\t\t);\n\n\t\t// If there is no pattern client ID, sync blocks with the same name and same attributes.\n\t\tif ( ! patternClientId ) {\n\t\t\tconst syncBlocksWithSameName = ( blocks ) => {\n\t\t\t\tfor ( const block of blocks ) {\n\t\t\t\t\tif ( block.attributes?.metadata?.name === blockName ) {\n\t\t\t\t\t\tregistry\n\t\t\t\t\t\t\t.dispatch( blockEditorStore )\n\t\t\t\t\t\t\t.updateBlockAttributes(\n\t\t\t\t\t\t\t\tblock.clientId,\n\t\t\t\t\t\t\t\tattributes\n\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tsyncBlocksWithSameName( block.innerBlocks );\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tsyncBlocksWithSameName( getBlocks() );\n\t\t\treturn;\n\t\t}\n\t\tconst currentBindingValue =\n\t\t\tgetBlockAttributes( patternClientId )?.[ CONTENT ];\n\t\tregistry\n\t\t\t.dispatch( blockEditorStore )\n\t\t\t.updateBlockAttributes( patternClientId, {\n\t\t\t\t[ CONTENT ]: {\n\t\t\t\t\t...currentBindingValue,\n\t\t\t\t\t[ blockName ]: {\n\t\t\t\t\t\t...currentBindingValue?.[ blockName ],\n\t\t\t\t\t\t...Object.entries( attributes ).reduce(\n\t\t\t\t\t\t\t( acc, [ key, value ] ) => {\n\t\t\t\t\t\t\t\t// TODO: We need a way to represent `undefined` in the serialized overrides.\n\t\t\t\t\t\t\t\t// Also see: https://github.com/WordPress/gutenberg/pull/57249#discussion_r1452987871\n\t\t\t\t\t\t\t\t// We use an empty string to represent undefined for now until\n\t\t\t\t\t\t\t\t// we support a richer format for overrides and the block bindings API.\n\t\t\t\t\t\t\t\tacc[ key ] = value === undefined ? '' : value;\n\t\t\t\t\t\t\t\treturn acc;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{}\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t} );\n\t},\n\tlockAttributesEditing: false,\n};\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -17,17 +17,6 @@ var _store = require("../../store");
|
|
|
17
17
|
* Internal dependencies
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
/**
|
|
21
|
-
* AutosaveMonitor invokes `props.autosave()` within at most `interval` seconds after an unsaved change is detected.
|
|
22
|
-
*
|
|
23
|
-
* The logic is straightforward: a check is performed every `props.interval` seconds. If any changes are detected, `props.autosave()` is called.
|
|
24
|
-
* The time between the change and the autosave varies but is no larger than `props.interval` seconds. Refer to the code below for more details, such as
|
|
25
|
-
* the specific way of detecting changes.
|
|
26
|
-
*
|
|
27
|
-
* There are two caveats:
|
|
28
|
-
* * If `props.isAutosaveable` happens to be false at a time of checking for changes, the check is retried every second.
|
|
29
|
-
* * The timer may be disabled by setting `props.disableIntervalChecks` to `true`. In that mode, any change will immediately trigger `props.autosave()`.
|
|
30
|
-
*/
|
|
31
20
|
class AutosaveMonitor extends _element.Component {
|
|
32
21
|
constructor(props) {
|
|
33
22
|
super(props);
|
|
@@ -86,9 +75,23 @@ class AutosaveMonitor extends _element.Component {
|
|
|
86
75
|
}
|
|
87
76
|
|
|
88
77
|
/**
|
|
89
|
-
* AutosaveMonitor component.
|
|
90
78
|
* Monitors the changes made to the edited post and triggers autosave if necessary.
|
|
91
79
|
*
|
|
80
|
+
* The logic is straightforward: a check is performed every `props.interval` seconds. If any changes are detected, `props.autosave()` is called.
|
|
81
|
+
* The time between the change and the autosave varies but is no larger than `props.interval` seconds. Refer to the code below for more details, such as
|
|
82
|
+
* the specific way of detecting changes.
|
|
83
|
+
*
|
|
84
|
+
* There are two caveats:
|
|
85
|
+
* * If `props.isAutosaveable` happens to be false at a time of checking for changes, the check is retried every second.
|
|
86
|
+
* * The timer may be disabled by setting `props.disableIntervalChecks` to `true`. In that mode, any change will immediately trigger `props.autosave()`.
|
|
87
|
+
*
|
|
88
|
+
* @param {Object} props - The properties passed to the component.
|
|
89
|
+
* @param {Function} props.autosave - The function to call when changes need to be saved.
|
|
90
|
+
* @param {number} props.interval - The maximum time in seconds between an unsaved change and an autosave.
|
|
91
|
+
* @param {boolean} props.isAutosaveable - If false, the check for changes is retried every second.
|
|
92
|
+
* @param {boolean} props.disableIntervalChecks - If true, disables the timer and any change will immediately trigger `props.autosave()`.
|
|
93
|
+
* @param {boolean} props.isDirty - Indicates if there are unsaved changes.
|
|
94
|
+
*
|
|
92
95
|
* @example
|
|
93
96
|
* ```jsx
|
|
94
97
|
* <AutosaveMonitor interval={30000} />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_compose","_data","_coreData","_store","AutosaveMonitor","Component","constructor","props","needsAutosave","isDirty","isAutosaveable","componentDidMount","disableIntervalChecks","setAutosaveTimer","componentDidUpdate","prevProps","editsReference","autosave","interval","clearTimeout","timerId","isAutosaving","componentWillUnmount","timeout","setTimeout","autosaveTimerHandler","render","exports","_default","default","compose","withSelect","select","ownProps","getReferenceByDistinctEdits","coreStore","isEditedPostDirty","isEditedPostAutosaveable","isAutosavingPost","getEditorSettings","editorStore","autosaveInterval","withDispatch","dispatch"],"sources":["@wordpress/editor/src/components/autosave-monitor/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\
|
|
1
|
+
{"version":3,"names":["_element","require","_compose","_data","_coreData","_store","AutosaveMonitor","Component","constructor","props","needsAutosave","isDirty","isAutosaveable","componentDidMount","disableIntervalChecks","setAutosaveTimer","componentDidUpdate","prevProps","editsReference","autosave","interval","clearTimeout","timerId","isAutosaving","componentWillUnmount","timeout","setTimeout","autosaveTimerHandler","render","exports","_default","default","compose","withSelect","select","ownProps","getReferenceByDistinctEdits","coreStore","isEditedPostDirty","isEditedPostAutosaveable","isAutosavingPost","getEditorSettings","editorStore","autosaveInterval","withDispatch","dispatch"],"sources":["@wordpress/editor/src/components/autosave-monitor/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport class AutosaveMonitor extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.needsAutosave = !! ( props.isDirty && props.isAutosaveable );\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( ! this.props.disableIntervalChecks ) {\n\t\t\tthis.setAutosaveTimer();\n\t\t}\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.disableIntervalChecks ) {\n\t\t\tif ( this.props.editsReference !== prevProps.editsReference ) {\n\t\t\t\tthis.props.autosave();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.props.interval !== prevProps.interval ) {\n\t\t\tclearTimeout( this.timerId );\n\t\t\tthis.setAutosaveTimer();\n\t\t}\n\n\t\tif ( ! this.props.isDirty ) {\n\t\t\tthis.needsAutosave = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.props.isAutosaving && ! prevProps.isAutosaving ) {\n\t\t\tthis.needsAutosave = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.props.editsReference !== prevProps.editsReference ) {\n\t\t\tthis.needsAutosave = true;\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.timerId );\n\t}\n\n\tsetAutosaveTimer( timeout = this.props.interval * 1000 ) {\n\t\tthis.timerId = setTimeout( () => {\n\t\t\tthis.autosaveTimerHandler();\n\t\t}, timeout );\n\t}\n\n\tautosaveTimerHandler() {\n\t\tif ( ! this.props.isAutosaveable ) {\n\t\t\tthis.setAutosaveTimer( 1000 );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.needsAutosave ) {\n\t\t\tthis.needsAutosave = false;\n\t\t\tthis.props.autosave();\n\t\t}\n\n\t\tthis.setAutosaveTimer();\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\n/**\n * Monitors the changes made to the edited post and triggers autosave if necessary.\n *\n * The logic is straightforward: a check is performed every `props.interval` seconds. If any changes are detected, `props.autosave()` is called.\n * The time between the change and the autosave varies but is no larger than `props.interval` seconds. Refer to the code below for more details, such as\n * the specific way of detecting changes.\n *\n * There are two caveats:\n * * If `props.isAutosaveable` happens to be false at a time of checking for changes, the check is retried every second.\n * * The timer may be disabled by setting `props.disableIntervalChecks` to `true`. In that mode, any change will immediately trigger `props.autosave()`.\n *\n * @param {Object} props - The properties passed to the component.\n * @param {Function} props.autosave - The function to call when changes need to be saved.\n * @param {number} props.interval - The maximum time in seconds between an unsaved change and an autosave.\n * @param {boolean} props.isAutosaveable - If false, the check for changes is retried every second.\n * @param {boolean} props.disableIntervalChecks - If true, disables the timer and any change will immediately trigger `props.autosave()`.\n * @param {boolean} props.isDirty - Indicates if there are unsaved changes.\n *\n * @example\n * ```jsx\n * <AutosaveMonitor interval={30000} />\n * ```\n */\nexport default compose( [\n\twithSelect( ( select, ownProps ) => {\n\t\tconst { getReferenceByDistinctEdits } = select( coreStore );\n\n\t\tconst {\n\t\t\tisEditedPostDirty,\n\t\t\tisEditedPostAutosaveable,\n\t\t\tisAutosavingPost,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\n\t\tconst { interval = getEditorSettings().autosaveInterval } = ownProps;\n\n\t\treturn {\n\t\t\teditsReference: getReferenceByDistinctEdits(),\n\t\t\tisDirty: isEditedPostDirty(),\n\t\t\tisAutosaveable: isEditedPostAutosaveable(),\n\t\t\tisAutosaving: isAutosavingPost(),\n\t\t\tinterval,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, ownProps ) => ( {\n\t\tautosave() {\n\t\t\tconst { autosave = dispatch( editorStore ).autosave } = ownProps;\n\t\t\tautosave();\n\t\t},\n\t} ) ),\n] )( AutosaveMonitor );\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = ContentOnlySettingsMenu;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
9
|
+
var _coreData = require("@wordpress/core-data");
|
|
10
|
+
var _components = require("@wordpress/components");
|
|
11
|
+
var _data = require("@wordpress/data");
|
|
12
|
+
var _i18n = require("@wordpress/i18n");
|
|
13
|
+
var _store = require("../../store");
|
|
14
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
15
|
+
/**
|
|
16
|
+
* WordPress dependencies
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Internal dependencies
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
function ContentOnlySettingsMenuItems({
|
|
24
|
+
clientId,
|
|
25
|
+
onClose
|
|
26
|
+
}) {
|
|
27
|
+
const {
|
|
28
|
+
entity,
|
|
29
|
+
onNavigateToEntityRecord
|
|
30
|
+
} = (0, _data.useSelect)(select => {
|
|
31
|
+
const {
|
|
32
|
+
getBlockEditingMode,
|
|
33
|
+
getBlockParentsByBlockName,
|
|
34
|
+
getSettings,
|
|
35
|
+
getBlockAttributes
|
|
36
|
+
} = select(_blockEditor.store);
|
|
37
|
+
const contentOnly = getBlockEditingMode(clientId) === 'contentOnly';
|
|
38
|
+
if (!contentOnly) {
|
|
39
|
+
return {};
|
|
40
|
+
}
|
|
41
|
+
const patternParent = getBlockParentsByBlockName(clientId, 'core/block', true)[0];
|
|
42
|
+
let record;
|
|
43
|
+
if (patternParent) {
|
|
44
|
+
record = select(_coreData.store).getEntityRecord('postType', 'wp_block', getBlockAttributes(patternParent).ref);
|
|
45
|
+
} else {
|
|
46
|
+
const {
|
|
47
|
+
getCurrentPostType,
|
|
48
|
+
getCurrentTemplateId
|
|
49
|
+
} = select(_store.store);
|
|
50
|
+
const currentPostType = getCurrentPostType();
|
|
51
|
+
const templateId = getCurrentTemplateId();
|
|
52
|
+
if (currentPostType === 'page' && templateId) {
|
|
53
|
+
record = select(_coreData.store).getEntityRecord('postType', 'wp_template', templateId);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
entity: record,
|
|
58
|
+
onNavigateToEntityRecord: getSettings().onNavigateToEntityRecord
|
|
59
|
+
};
|
|
60
|
+
}, [clientId]);
|
|
61
|
+
if (!entity) {
|
|
62
|
+
return (0, _react.createElement)(TemplateLockContentOnlyMenuItems, {
|
|
63
|
+
clientId: clientId,
|
|
64
|
+
onClose: onClose
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
const isPattern = entity.type === 'wp_block';
|
|
68
|
+
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_blockEditor.__unstableBlockSettingsMenuFirstItem, null, (0, _react.createElement)(_components.MenuItem, {
|
|
69
|
+
onClick: () => {
|
|
70
|
+
onNavigateToEntityRecord({
|
|
71
|
+
postId: entity.id,
|
|
72
|
+
postType: entity.type
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}, isPattern ? (0, _i18n.__)('Edit pattern') : (0, _i18n.__)('Edit template'))), (0, _react.createElement)(_components.__experimentalText, {
|
|
76
|
+
variant: "muted",
|
|
77
|
+
as: "p",
|
|
78
|
+
className: "editor-content-only-settings-menu__description"
|
|
79
|
+
}, isPattern ? (0, _i18n.__)('Edit the pattern to move, delete, or make further changes to this block.') : (0, _i18n.__)('Edit the template to move, delete, or make further changes to this block.')));
|
|
80
|
+
}
|
|
81
|
+
function TemplateLockContentOnlyMenuItems({
|
|
82
|
+
clientId,
|
|
83
|
+
onClose
|
|
84
|
+
}) {
|
|
85
|
+
const {
|
|
86
|
+
contentLockingParent
|
|
87
|
+
} = (0, _data.useSelect)(select => {
|
|
88
|
+
const {
|
|
89
|
+
getContentLockingParent
|
|
90
|
+
} = (0, _lockUnlock.unlock)(select(_blockEditor.store));
|
|
91
|
+
return {
|
|
92
|
+
contentLockingParent: getContentLockingParent(clientId)
|
|
93
|
+
};
|
|
94
|
+
}, [clientId]);
|
|
95
|
+
const blockDisplayInformation = (0, _blockEditor.useBlockDisplayInformation)(contentLockingParent);
|
|
96
|
+
// Disable reason: We're using a hook here so it has to be on top-level.
|
|
97
|
+
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
|
|
98
|
+
const {
|
|
99
|
+
modifyContentLockBlock,
|
|
100
|
+
selectBlock
|
|
101
|
+
} = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_blockEditor.store));
|
|
102
|
+
if (!blockDisplayInformation?.title) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_blockEditor.__unstableBlockSettingsMenuFirstItem, null, (0, _react.createElement)(_components.MenuItem, {
|
|
106
|
+
onClick: () => {
|
|
107
|
+
selectBlock(contentLockingParent);
|
|
108
|
+
modifyContentLockBlock(contentLockingParent);
|
|
109
|
+
onClose();
|
|
110
|
+
}
|
|
111
|
+
}, (0, _i18n.__)('Unlock'))), (0, _react.createElement)(_components.__experimentalText, {
|
|
112
|
+
variant: "muted",
|
|
113
|
+
as: "p",
|
|
114
|
+
className: "editor-content-only-settings-menu__description"
|
|
115
|
+
}, (0, _i18n.__)('Temporarily unlock the parent block to edit, delete or make further changes to this block.')));
|
|
116
|
+
}
|
|
117
|
+
function ContentOnlySettingsMenu() {
|
|
118
|
+
return (0, _react.createElement)(_blockEditor.BlockSettingsMenuControls, null, ({
|
|
119
|
+
selectedClientIds,
|
|
120
|
+
onClose
|
|
121
|
+
}) => selectedClientIds.length === 1 && (0, _react.createElement)(ContentOnlySettingsMenuItems, {
|
|
122
|
+
clientId: selectedClientIds[0],
|
|
123
|
+
onClose: onClose
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=content-only-settings-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_coreData","_components","_data","_i18n","_store","_lockUnlock","ContentOnlySettingsMenuItems","clientId","onClose","entity","onNavigateToEntityRecord","useSelect","select","getBlockEditingMode","getBlockParentsByBlockName","getSettings","getBlockAttributes","blockEditorStore","contentOnly","patternParent","record","coreStore","getEntityRecord","ref","getCurrentPostType","getCurrentTemplateId","editorStore","currentPostType","templateId","_react","createElement","TemplateLockContentOnlyMenuItems","isPattern","type","Fragment","__unstableBlockSettingsMenuFirstItem","MenuItem","onClick","postId","id","postType","__","__experimentalText","variant","as","className","contentLockingParent","getContentLockingParent","unlock","blockDisplayInformation","useBlockDisplayInformation","modifyContentLockBlock","selectBlock","useDispatch","title","ContentOnlySettingsMenu","BlockSettingsMenuControls","selectedClientIds","length"],"sources":["@wordpress/editor/src/components/block-settings-menu/content-only-settings-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockSettingsMenuControls,\n\t__unstableBlockSettingsMenuFirstItem as BlockSettingsMenuFirstItem,\n\tstore as blockEditorStore,\n\tuseBlockDisplayInformation,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalText as Text, MenuItem } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction ContentOnlySettingsMenuItems( { clientId, onClose } ) {\n\tconst { entity, onNavigateToEntityRecord } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockEditingMode,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t\tgetSettings,\n\t\t\t\tgetBlockAttributes,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst contentOnly =\n\t\t\t\tgetBlockEditingMode( clientId ) === 'contentOnly';\n\t\t\tif ( ! contentOnly ) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\tconst patternParent = getBlockParentsByBlockName(\n\t\t\t\tclientId,\n\t\t\t\t'core/block',\n\t\t\t\ttrue\n\t\t\t)[ 0 ];\n\n\t\t\tlet record;\n\t\t\tif ( patternParent ) {\n\t\t\t\trecord = select( coreStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_block',\n\t\t\t\t\tgetBlockAttributes( patternParent ).ref\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconst { getCurrentPostType, getCurrentTemplateId } =\n\t\t\t\t\tselect( editorStore );\n\t\t\t\tconst currentPostType = getCurrentPostType();\n\t\t\t\tconst templateId = getCurrentTemplateId();\n\t\t\t\tif ( currentPostType === 'page' && templateId ) {\n\t\t\t\t\trecord = select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'wp_template',\n\t\t\t\t\t\ttemplateId\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tentity: record,\n\t\t\t\tonNavigateToEntityRecord:\n\t\t\t\t\tgetSettings().onNavigateToEntityRecord,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tif ( ! entity ) {\n\t\treturn (\n\t\t\t<TemplateLockContentOnlyMenuItems\n\t\t\t\tclientId={ clientId }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst isPattern = entity.type === 'wp_block';\n\n\treturn (\n\t\t<>\n\t\t\t<BlockSettingsMenuFirstItem>\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\t\t\tpostId: entity.id,\n\t\t\t\t\t\t\tpostType: entity.type,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ isPattern ? __( 'Edit pattern' ) : __( 'Edit template' ) }\n\t\t\t\t</MenuItem>\n\t\t\t</BlockSettingsMenuFirstItem>\n\t\t\t<Text\n\t\t\t\tvariant=\"muted\"\n\t\t\t\tas=\"p\"\n\t\t\t\tclassName=\"editor-content-only-settings-menu__description\"\n\t\t\t>\n\t\t\t\t{ isPattern\n\t\t\t\t\t? __(\n\t\t\t\t\t\t\t'Edit the pattern to move, delete, or make further changes to this block.'\n\t\t\t\t\t )\n\t\t\t\t\t: __(\n\t\t\t\t\t\t\t'Edit the template to move, delete, or make further changes to this block.'\n\t\t\t\t\t ) }\n\t\t\t</Text>\n\t\t</>\n\t);\n}\n\nfunction TemplateLockContentOnlyMenuItems( { clientId, onClose } ) {\n\tconst { contentLockingParent } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getContentLockingParent } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tcontentLockingParent: getContentLockingParent( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst blockDisplayInformation =\n\t\tuseBlockDisplayInformation( contentLockingParent );\n\t// Disable reason: We're using a hook here so it has to be on top-level.\n\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\tconst { modifyContentLockBlock, selectBlock } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\n\tif ( ! blockDisplayInformation?.title ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<BlockSettingsMenuFirstItem>\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tselectBlock( contentLockingParent );\n\t\t\t\t\t\tmodifyContentLockBlock( contentLockingParent );\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Unlock' ) }\n\t\t\t\t</MenuItem>\n\t\t\t</BlockSettingsMenuFirstItem>\n\t\t\t<Text\n\t\t\t\tvariant=\"muted\"\n\t\t\t\tas=\"p\"\n\t\t\t\tclassName=\"editor-content-only-settings-menu__description\"\n\t\t\t>\n\t\t\t\t{ __(\n\t\t\t\t\t'Temporarily unlock the parent block to edit, delete or make further changes to this block.'\n\t\t\t\t) }\n\t\t\t</Text>\n\t\t</>\n\t);\n}\n\nexport default function ContentOnlySettingsMenu() {\n\treturn (\n\t\t<BlockSettingsMenuControls>\n\t\t\t{ ( { selectedClientIds, onClose } ) =>\n\t\t\t\tselectedClientIds.length === 1 && (\n\t\t\t\t\t<ContentOnlySettingsMenuItems\n\t\t\t\t\t\tclientId={ selectedClientIds[ 0 ] }\n\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t}\n\t\t</BlockSettingsMenuControls>\n\t);\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = ContentOnlySettingsMenu;
|
|
7
|
+
// Render nothing in native for now.
|
|
8
|
+
function ContentOnlySettingsMenu() {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=content-only-settings-menu.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ContentOnlySettingsMenu"],"sources":["@wordpress/editor/src/components/block-settings-menu/content-only-settings-menu.native.js"],"sourcesContent":["// Render nothing in native for now.\nexport default function ContentOnlySettingsMenu() {\n\treturn null;\n}\n"],"mappings":";;;;;;AAAA;AACe,SAASA,uBAAuBA,CAAA,EAAG;EACjD,OAAO,IAAI;AACZ","ignoreList":[]}
|
|
@@ -15,6 +15,11 @@ var _store = require("../../store");
|
|
|
15
15
|
* Internal dependencies
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Renders the character count of the post content.
|
|
20
|
+
*
|
|
21
|
+
* @return {number} The character count.
|
|
22
|
+
*/
|
|
18
23
|
function CharacterCount() {
|
|
19
24
|
const content = (0, _data.useSelect)(select => select(_store.store).getEditedPostAttribute('content'), []);
|
|
20
25
|
return (0, _wordcount.count)(content, 'characters_including_spaces');
|