@wordpress/block-editor 14.3.3 → 14.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/README.md +46 -0
- package/build/autocompleters/link.js +2 -1
- package/build/autocompleters/link.js.map +1 -1
- package/build/components/block-actions/index.js +1 -13
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-inspector/index.js +56 -75
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block.js +5 -19
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/index.js +5 -8
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +3 -11
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js +9 -12
- package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +5 -3
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-list/zoom-out-separator.js +14 -6
- package/build/components/block-list/zoom-out-separator.js.map +1 -1
- package/build/components/block-navigation/dropdown.js +2 -4
- package/build/components/block-navigation/dropdown.js.map +1 -1
- package/build/components/block-parent-selector/index.js +13 -10
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.js +10 -20
- package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build/components/block-patterns-paging/index.js +11 -13
- package/build/components/block-patterns-paging/index.js.map +1 -1
- package/build/components/block-quick-navigation/index.js +2 -4
- package/build/components/block-quick-navigation/index.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +79 -76
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +1 -6
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-switcher/index.js +17 -14
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +16 -19
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-toolbar/use-has-block-toolbar.js +3 -5
- package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
- package/build/components/block-tools/index.js +8 -11
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +1 -4
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +2 -5
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserter-button.js +1 -12
- package/build/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js +14 -17
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/block-tools/zoom-out-toolbar.js +2 -12
- package/build/components/block-tools/zoom-out-toolbar.js.map +1 -1
- package/build/components/block-variation-picker/index.js +2 -4
- package/build/components/block-variation-picker/index.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +3 -4
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/button-block-appender/index.js +2 -4
- package/build/components/button-block-appender/index.js.map +1 -1
- package/build/components/colors-gradients/dropdown.js +2 -4
- package/build/components/colors-gradients/dropdown.js.map +1 -1
- package/build/components/global-styles/border-panel.js +1 -1
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +2 -4
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +3 -3
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +2 -4
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/shadow-panel-components.js +24 -29
- package/build/components/global-styles/shadow-panel-components.js.map +1 -1
- package/build/components/inner-blocks/index.js +1 -9
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inserter/block-types-tab.js +1 -1
- package/build/components/inserter/block-types-tab.js.map +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js +24 -5
- package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build/components/inserter/hooks/use-insertion-point.js +22 -12
- package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js +23 -10
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/media-tab/media-preview.js +35 -13
- package/build/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build/components/inserter/menu.js +2 -2
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/mobile-tab-navigation.js +5 -5
- package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +4 -4
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inspector-controls-tabs/index.js +11 -8
- package/build/components/inspector-controls-tabs/index.js.map +1 -1
- package/build/components/inspector-popover-header/index.js +4 -8
- package/build/components/inspector-popover-header/index.js.map +1 -1
- package/build/components/link-control/index.js +5 -10
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/settings-drawer.js +2 -4
- package/build/components/link-control/settings-drawer.js.map +1 -1
- package/build/components/list-view/block-contents.js +1 -25
- package/build/components/list-view/block-contents.js.map +1 -1
- package/build/components/list-view/block-select-button.js +1 -4
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/media-placeholder/index.js +29 -43
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/rich-text/index.js +4 -8
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/skip-to-selected-block/index.js +2 -4
- package/build/components/skip-to-selected-block/index.js.map +1 -1
- package/build/components/tool-selector/index.js +13 -12
- package/build/components/tool-selector/index.js.map +1 -1
- package/build/components/url-input/button.js +14 -16
- package/build/components/url-input/button.js.map +1 -1
- package/build/components/url-input/index.js +2 -4
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-block-commands/index.js +0 -61
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +2 -25
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/hooks/block-bindings.js +6 -13
- package/build/hooks/block-bindings.js.map +1 -1
- package/build/hooks/duotone.js +4 -1
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/layout-child.js +3 -1
- package/build/hooks/layout-child.js.map +1 -1
- package/build/hooks/position.js +3 -2
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/use-bindings-attributes.js +5 -4
- package/build/hooks/use-bindings-attributes.js.map +1 -1
- package/build/layouts/flex.js +6 -38
- package/build/layouts/flex.js.map +1 -1
- package/build/private-apis.js +0 -2
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +13 -14
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +15 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +104 -7
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +22 -26
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +127 -56
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +4 -3
- package/build/store/utils.js.map +1 -1
- package/build/utils/block-bindings.js +50 -0
- package/build/utils/block-bindings.js.map +1 -1
- package/build/utils/index.js +7 -0
- package/build/utils/index.js.map +1 -1
- package/build-module/autocompleters/link.js +2 -1
- package/build-module/autocompleters/link.js.map +1 -1
- package/build-module/components/block-actions/index.js +1 -13
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +57 -76
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block.js +5 -19
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/index.js +5 -8
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +3 -11
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js +9 -12
- package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +5 -3
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-list/zoom-out-separator.js +14 -6
- package/build-module/components/block-list/zoom-out-separator.js.map +1 -1
- package/build-module/components/block-navigation/dropdown.js +2 -4
- package/build-module/components/block-navigation/dropdown.js.map +1 -1
- package/build-module/components/block-parent-selector/index.js +13 -10
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.js +10 -20
- package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build-module/components/block-patterns-paging/index.js +11 -13
- package/build-module/components/block-patterns-paging/index.js.map +1 -1
- package/build-module/components/block-quick-navigation/index.js +2 -4
- package/build-module/components/block-quick-navigation/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +79 -76
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +2 -7
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-switcher/index.js +17 -14
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +17 -20
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-toolbar/use-has-block-toolbar.js +3 -5
- package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
- package/build-module/components/block-tools/index.js +8 -11
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +1 -4
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +2 -5
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserter-button.js +1 -12
- package/build-module/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +14 -17
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-toolbar.js +2 -12
- package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -1
- package/build-module/components/block-variation-picker/index.js +2 -4
- package/build-module/components/block-variation-picker/index.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +3 -4
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- package/build-module/components/button-block-appender/index.js +2 -4
- package/build-module/components/button-block-appender/index.js.map +1 -1
- package/build-module/components/colors-gradients/dropdown.js +2 -4
- package/build-module/components/colors-gradients/dropdown.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +1 -1
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +2 -4
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +1 -1
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +2 -4
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/shadow-panel-components.js +25 -30
- package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +1 -9
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.js +1 -1
- package/build-module/components/inserter/block-types-tab.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js +27 -8
- package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build-module/components/inserter/hooks/use-insertion-point.js +22 -12
- package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js +23 -10
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-preview.js +35 -13
- package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build-module/components/inserter/menu.js +2 -2
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/mobile-tab-navigation.js +6 -6
- package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +4 -4
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/index.js +12 -9
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
- package/build-module/components/inspector-popover-header/index.js +4 -8
- package/build-module/components/inspector-popover-header/index.js.map +1 -1
- package/build-module/components/link-control/index.js +5 -10
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/settings-drawer.js +2 -4
- package/build-module/components/link-control/settings-drawer.js.map +1 -1
- package/build-module/components/list-view/block-contents.js +1 -25
- package/build-module/components/list-view/block-contents.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +2 -5
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +30 -44
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +4 -8
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/skip-to-selected-block/index.js +2 -4
- package/build-module/components/skip-to-selected-block/index.js.map +1 -1
- package/build-module/components/tool-selector/index.js +13 -12
- package/build-module/components/tool-selector/index.js.map +1 -1
- package/build-module/components/url-input/button.js +15 -17
- package/build-module/components/url-input/button.js.map +1 -1
- package/build-module/components/url-input/index.js +2 -4
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +1 -62
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +3 -26
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/hooks/block-bindings.js +6 -13
- package/build-module/hooks/block-bindings.js.map +1 -1
- package/build-module/hooks/duotone.js +4 -1
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/layout-child.js +4 -1
- package/build-module/hooks/layout-child.js.map +1 -1
- package/build-module/hooks/position.js +4 -1
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/use-bindings-attributes.js +5 -4
- package/build-module/hooks/use-bindings-attributes.js.map +1 -1
- package/build-module/layouts/flex.js +7 -39
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/private-apis.js +0 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +12 -12
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +14 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +98 -7
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +21 -25
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +129 -58
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +3 -2
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/block-bindings.js +50 -0
- package/build-module/utils/block-bindings.js.map +1 -1
- package/build-module/utils/index.js +1 -0
- package/build-module/utils/index.js.map +1 -1
- package/build-style/content-rtl.css +16 -70
- package/build-style/content.css +16 -70
- package/build-style/default-editor-styles-rtl.css +10 -1
- package/build-style/default-editor-styles.css +10 -1
- package/build-style/style-rtl.css +51 -149
- package/build-style/style.css +51 -149
- package/package.json +32 -32
- package/src/autocompleters/link.js +2 -1
- package/src/components/block-actions/index.js +1 -13
- package/src/components/block-draggable/style.scss +2 -2
- package/src/components/block-inspector/index.js +79 -95
- package/src/components/block-inspector/style.scss +2 -0
- package/src/components/block-list/block.js +7 -28
- package/src/components/block-list/content.scss +1 -61
- package/src/components/block-list/index.js +21 -29
- package/src/components/block-list/use-block-props/index.js +3 -10
- package/src/components/block-list/use-block-props/use-zoom-out-mode-exit.js +19 -11
- package/src/components/block-list/use-in-between-inserter.js +5 -2
- package/src/components/block-list/zoom-out-separator.js +24 -8
- package/src/components/block-navigation/dropdown.js +1 -2
- package/src/components/block-parent-selector/index.js +13 -10
- package/src/components/block-pattern-setup/setup-toolbar.js +5 -10
- package/src/components/block-patterns-paging/index.js +8 -7
- package/src/components/block-patterns-paging/style.scss +10 -27
- package/src/components/block-quick-navigation/index.js +1 -2
- package/src/components/block-settings-menu/block-settings-dropdown.js +120 -106
- package/src/components/block-settings-menu-controls/index.js +0 -15
- package/src/components/block-switcher/index.js +37 -30
- package/src/components/block-toolbar/index.js +22 -34
- package/src/components/block-toolbar/style.scss +10 -1
- package/src/components/block-toolbar/use-has-block-toolbar.js +19 -31
- package/src/components/block-tools/index.js +7 -16
- package/src/components/block-tools/insertion-point.js +1 -4
- package/src/components/block-tools/style.scss +3 -88
- package/src/components/block-tools/use-show-block-tools.js +2 -12
- package/src/components/block-tools/zoom-out-mode-inserter-button.js +2 -17
- package/src/components/block-tools/zoom-out-mode-inserters.js +11 -19
- package/src/components/block-tools/zoom-out-toolbar.js +2 -13
- package/src/components/block-variation-picker/index.js +1 -2
- package/src/components/block-variation-transforms/index.js +2 -2
- package/src/components/button-block-appender/content.scss +0 -5
- package/src/components/button-block-appender/index.js +1 -2
- package/src/components/colors-gradients/dropdown.js +1 -5
- package/src/components/font-family/README.md +5 -1
- package/src/components/global-styles/border-panel.js +1 -1
- package/src/components/global-styles/color-panel.js +1 -5
- package/src/components/global-styles/dimensions-panel.js +1 -1
- package/src/components/global-styles/filters-panel.js +1 -2
- package/src/components/global-styles/shadow-panel-components.js +28 -33
- package/src/components/global-styles/style.scss +5 -0
- package/src/components/inner-blocks/index.js +1 -16
- package/src/components/inserter/block-types-tab.js +1 -1
- package/src/components/inserter/hooks/use-block-types-state.js +34 -14
- package/src/components/inserter/hooks/use-insertion-point.js +35 -13
- package/src/components/inserter/hooks/use-patterns-state.js +46 -9
- package/src/components/inserter/media-tab/media-preview.js +38 -12
- package/src/components/inserter/menu.js +2 -2
- package/src/components/inserter/mobile-tab-navigation.js +10 -13
- package/src/components/inserter/quick-inserter.js +5 -4
- package/src/components/inserter/style.scss +0 -28
- package/src/components/inspector-controls-tabs/index.js +21 -20
- package/src/components/inspector-controls-tabs/style.scss +2 -6
- package/src/components/inspector-popover-header/index.js +2 -4
- package/src/components/inspector-popover-header/style.scss +0 -13
- package/src/components/link-control/index.js +2 -5
- package/src/components/link-control/settings-drawer.js +1 -2
- package/src/components/list-view/block-contents.js +1 -28
- package/src/components/list-view/block-select-button.js +2 -5
- package/src/components/list-view/style.scss +18 -14
- package/src/components/media-placeholder/content.scss +3 -19
- package/src/components/media-placeholder/index.js +23 -29
- package/src/components/rich-text/index.js +4 -13
- package/src/components/skip-to-selected-block/index.js +1 -2
- package/src/components/skip-to-selected-block/style.scss +0 -9
- package/src/components/tool-selector/index.js +14 -9
- package/src/components/tool-selector/style.scss +5 -0
- package/src/components/url-input/button.js +16 -12
- package/src/components/url-input/index.js +1 -2
- package/src/components/url-input/style.scss +0 -6
- package/src/components/use-block-commands/index.js +0 -58
- package/src/components/writing-flow/use-tab-nav.js +4 -36
- package/src/content.scss +0 -1
- package/src/hooks/block-bindings.js +9 -10
- package/src/hooks/duotone.js +4 -1
- package/src/hooks/layout-child.js +4 -1
- package/src/hooks/position.js +4 -1
- package/src/hooks/use-bindings-attributes.js +66 -63
- package/src/layouts/flex.js +10 -53
- package/src/private-apis.js +0 -2
- package/src/store/actions.js +14 -13
- package/src/store/private-actions.js +14 -0
- package/src/store/private-selectors.js +120 -16
- package/src/store/reducer.js +22 -28
- package/src/store/selectors.js +203 -114
- package/src/store/test/private-actions.js +15 -0
- package/src/store/test/private-selectors.js +34 -0
- package/src/store/test/reducer.js +40 -4
- package/src/store/test/selectors.js +183 -20
- package/src/store/utils.js +4 -2
- package/src/utils/block-bindings.js +49 -0
- package/src/utils/index.js +1 -0
- package/build/components/block-controls/use-has-block-controls.js +0 -43
- package/build/components/block-controls/use-has-block-controls.js.map +0 -1
- package/build/components/block-list/use-block-props/use-nav-mode-exit.js +0 -54
- package/build/components/block-list/use-block-props/use-nav-mode-exit.js.map +0 -1
- package/build/components/block-tools/block-selection-button.js +0 -259
- package/build/components/block-tools/block-selection-button.js.map +0 -1
- package/build/components/block-tools/block-toolbar-breadcrumb.js +0 -57
- package/build/components/block-tools/block-toolbar-breadcrumb.js.map +0 -1
- package/build/components/inserter/tabs.js +0 -78
- package/build/components/inserter/tabs.js.map +0 -1
- package/build-module/components/block-controls/use-has-block-controls.js +0 -34
- package/build-module/components/block-controls/use-has-block-controls.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-nav-mode-exit.js +0 -48
- package/build-module/components/block-list/use-block-props/use-nav-mode-exit.js.map +0 -1
- package/build-module/components/block-tools/block-selection-button.js +0 -254
- package/build-module/components/block-tools/block-selection-button.js.map +0 -1
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js +0 -49
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +0 -1
- package/build-module/components/inserter/tabs.js +0 -72
- package/build-module/components/inserter/tabs.js.map +0 -1
- package/src/components/block-controls/use-has-block-controls.js +0 -35
- package/src/components/block-list/use-block-props/use-nav-mode-exit.js +0 -46
- package/src/components/block-tools/block-selection-button.js +0 -302
- package/src/components/block-tools/block-toolbar-breadcrumb.js +0 -51
- package/src/components/inner-blocks/content.scss +0 -13
- package/src/components/inserter/tabs.js +0 -78
- package/src/components/inserter/test/block-types-tab.native.js +0 -67
|
@@ -58,7 +58,6 @@ export function BlockSettingsDropdown( {
|
|
|
58
58
|
const firstBlockClientId = clientIds[ 0 ];
|
|
59
59
|
const {
|
|
60
60
|
firstParentClientId,
|
|
61
|
-
onlyBlock,
|
|
62
61
|
parentBlockType,
|
|
63
62
|
previousBlockClientId,
|
|
64
63
|
selectedBlockClientIds,
|
|
@@ -67,7 +66,6 @@ export function BlockSettingsDropdown( {
|
|
|
67
66
|
} = useSelect(
|
|
68
67
|
( select ) => {
|
|
69
68
|
const {
|
|
70
|
-
getBlockCount,
|
|
71
69
|
getBlockName,
|
|
72
70
|
getBlockRootClientId,
|
|
73
71
|
getPreviousBlockClientId,
|
|
@@ -86,7 +84,6 @@ export function BlockSettingsDropdown( {
|
|
|
86
84
|
|
|
87
85
|
return {
|
|
88
86
|
firstParentClientId: _firstParentClientId,
|
|
89
|
-
onlyBlock: 1 === getBlockCount( _firstParentClientId ),
|
|
90
87
|
parentBlockType:
|
|
91
88
|
_firstParentClientId &&
|
|
92
89
|
( getActiveBlockVariation(
|
|
@@ -186,6 +183,9 @@ export function BlockSettingsDropdown( {
|
|
|
186
183
|
}
|
|
187
184
|
}
|
|
188
185
|
|
|
186
|
+
const shouldShowBlockParentMenuItem =
|
|
187
|
+
! parentBlockIsSelected && !! firstParentClientId;
|
|
188
|
+
|
|
189
189
|
return (
|
|
190
190
|
<BlockActions
|
|
191
191
|
clientIds={ clientIds }
|
|
@@ -195,7 +195,6 @@ export function BlockSettingsDropdown( {
|
|
|
195
195
|
canCopyStyles,
|
|
196
196
|
canDuplicate,
|
|
197
197
|
canInsertBlock,
|
|
198
|
-
canMove,
|
|
199
198
|
canRemove,
|
|
200
199
|
onDuplicate,
|
|
201
200
|
onInsertAfter,
|
|
@@ -203,26 +202,39 @@ export function BlockSettingsDropdown( {
|
|
|
203
202
|
onRemove,
|
|
204
203
|
onCopy,
|
|
205
204
|
onPasteStyles,
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
205
|
+
} ) => {
|
|
206
|
+
// It is possible that some plugins register fills for this menu
|
|
207
|
+
// even if Core doesn't render anything in the block settings menu.
|
|
208
|
+
// in which case, we may want to render the menu anyway.
|
|
209
|
+
// That said for now, we can start more conservative.
|
|
210
|
+
const isEmpty =
|
|
211
|
+
! canRemove &&
|
|
212
|
+
! canDuplicate &&
|
|
213
|
+
! canInsertBlock &&
|
|
214
|
+
isContentOnly;
|
|
215
|
+
|
|
216
|
+
if ( isEmpty ) {
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return (
|
|
221
|
+
<DropdownMenu
|
|
222
|
+
icon={ moreVertical }
|
|
223
|
+
label={ __( 'Options' ) }
|
|
224
|
+
className="block-editor-block-settings-menu"
|
|
225
|
+
popoverProps={ POPOVER_PROPS }
|
|
226
|
+
open={ open }
|
|
227
|
+
onToggle={ onToggle }
|
|
228
|
+
noIcons
|
|
229
|
+
{ ...props }
|
|
230
|
+
>
|
|
231
|
+
{ ( { onClose } ) => (
|
|
232
|
+
<>
|
|
233
|
+
<MenuGroup>
|
|
234
|
+
<__unstableBlockSettingsMenuFirstItem.Slot
|
|
235
|
+
fillProps={ { onClose } }
|
|
236
|
+
/>
|
|
237
|
+
{ shouldShowBlockParentMenuItem && (
|
|
226
238
|
<BlockParentSelectorMenuItem
|
|
227
239
|
parentClientId={
|
|
228
240
|
firstParentClientId
|
|
@@ -230,101 +242,103 @@ export function BlockSettingsDropdown( {
|
|
|
230
242
|
parentBlockType={ parentBlockType }
|
|
231
243
|
/>
|
|
232
244
|
) }
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
<MenuItem
|
|
249
|
-
onClick={ pipe(
|
|
250
|
-
onClose,
|
|
251
|
-
onDuplicate,
|
|
252
|
-
updateSelectionAfterDuplicate
|
|
253
|
-
) }
|
|
254
|
-
shortcut={ shortcuts.duplicate }
|
|
255
|
-
>
|
|
256
|
-
{ __( 'Duplicate' ) }
|
|
257
|
-
</MenuItem>
|
|
258
|
-
) }
|
|
259
|
-
{ canInsertBlock && ! isContentOnly && (
|
|
260
|
-
<>
|
|
245
|
+
{ count === 1 && (
|
|
246
|
+
<BlockHTMLConvertButton
|
|
247
|
+
clientId={ firstBlockClientId }
|
|
248
|
+
/>
|
|
249
|
+
) }
|
|
250
|
+
{ ! isContentOnly && (
|
|
251
|
+
<CopyMenuItem
|
|
252
|
+
clientIds={ clientIds }
|
|
253
|
+
onCopy={ onCopy }
|
|
254
|
+
shortcut={ displayShortcut.primary(
|
|
255
|
+
'c'
|
|
256
|
+
) }
|
|
257
|
+
/>
|
|
258
|
+
) }
|
|
259
|
+
{ canDuplicate && (
|
|
261
260
|
<MenuItem
|
|
262
261
|
onClick={ pipe(
|
|
263
262
|
onClose,
|
|
264
|
-
|
|
263
|
+
onDuplicate,
|
|
264
|
+
updateSelectionAfterDuplicate
|
|
265
265
|
) }
|
|
266
|
-
shortcut={ shortcuts.
|
|
266
|
+
shortcut={ shortcuts.duplicate }
|
|
267
267
|
>
|
|
268
|
-
{ __( '
|
|
268
|
+
{ __( 'Duplicate' ) }
|
|
269
|
+
</MenuItem>
|
|
270
|
+
) }
|
|
271
|
+
{ canInsertBlock && ! isContentOnly && (
|
|
272
|
+
<>
|
|
273
|
+
<MenuItem
|
|
274
|
+
onClick={ pipe(
|
|
275
|
+
onClose,
|
|
276
|
+
onInsertBefore
|
|
277
|
+
) }
|
|
278
|
+
shortcut={
|
|
279
|
+
shortcuts.insertBefore
|
|
280
|
+
}
|
|
281
|
+
>
|
|
282
|
+
{ __( 'Add before' ) }
|
|
283
|
+
</MenuItem>
|
|
284
|
+
<MenuItem
|
|
285
|
+
onClick={ pipe(
|
|
286
|
+
onClose,
|
|
287
|
+
onInsertAfter
|
|
288
|
+
) }
|
|
289
|
+
shortcut={
|
|
290
|
+
shortcuts.insertAfter
|
|
291
|
+
}
|
|
292
|
+
>
|
|
293
|
+
{ __( 'Add after' ) }
|
|
294
|
+
</MenuItem>
|
|
295
|
+
</>
|
|
296
|
+
) }
|
|
297
|
+
</MenuGroup>
|
|
298
|
+
{ canCopyStyles && ! isContentOnly && (
|
|
299
|
+
<MenuGroup>
|
|
300
|
+
<CopyMenuItem
|
|
301
|
+
clientIds={ clientIds }
|
|
302
|
+
onCopy={ onCopy }
|
|
303
|
+
label={ __( 'Copy styles' ) }
|
|
304
|
+
/>
|
|
305
|
+
<MenuItem onClick={ onPasteStyles }>
|
|
306
|
+
{ __( 'Paste styles' ) }
|
|
269
307
|
</MenuItem>
|
|
308
|
+
</MenuGroup>
|
|
309
|
+
) }
|
|
310
|
+
<BlockSettingsMenuControls.Slot
|
|
311
|
+
fillProps={ {
|
|
312
|
+
onClose,
|
|
313
|
+
count,
|
|
314
|
+
firstBlockClientId,
|
|
315
|
+
} }
|
|
316
|
+
clientIds={ clientIds }
|
|
317
|
+
/>
|
|
318
|
+
{ typeof children === 'function'
|
|
319
|
+
? children( { onClose } )
|
|
320
|
+
: Children.map( ( child ) =>
|
|
321
|
+
cloneElement( child, { onClose } )
|
|
322
|
+
) }
|
|
323
|
+
{ canRemove && (
|
|
324
|
+
<MenuGroup>
|
|
270
325
|
<MenuItem
|
|
271
326
|
onClick={ pipe(
|
|
272
327
|
onClose,
|
|
273
|
-
|
|
328
|
+
onRemove,
|
|
329
|
+
updateSelectionAfterRemove
|
|
274
330
|
) }
|
|
275
|
-
shortcut={ shortcuts.
|
|
331
|
+
shortcut={ shortcuts.remove }
|
|
276
332
|
>
|
|
277
|
-
{ __( '
|
|
333
|
+
{ __( 'Delete' ) }
|
|
278
334
|
</MenuItem>
|
|
279
|
-
|
|
335
|
+
</MenuGroup>
|
|
280
336
|
) }
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
onCopy={ onCopy }
|
|
287
|
-
label={ __( 'Copy styles' ) }
|
|
288
|
-
/>
|
|
289
|
-
<MenuItem onClick={ onPasteStyles }>
|
|
290
|
-
{ __( 'Paste styles' ) }
|
|
291
|
-
</MenuItem>
|
|
292
|
-
</MenuGroup>
|
|
293
|
-
) }
|
|
294
|
-
<BlockSettingsMenuControls.Slot
|
|
295
|
-
fillProps={ {
|
|
296
|
-
onClose,
|
|
297
|
-
canMove,
|
|
298
|
-
onMoveTo,
|
|
299
|
-
onlyBlock,
|
|
300
|
-
count,
|
|
301
|
-
firstBlockClientId,
|
|
302
|
-
} }
|
|
303
|
-
clientIds={ clientIds }
|
|
304
|
-
/>
|
|
305
|
-
{ typeof children === 'function'
|
|
306
|
-
? children( { onClose } )
|
|
307
|
-
: Children.map( ( child ) =>
|
|
308
|
-
cloneElement( child, { onClose } )
|
|
309
|
-
) }
|
|
310
|
-
{ canRemove && (
|
|
311
|
-
<MenuGroup>
|
|
312
|
-
<MenuItem
|
|
313
|
-
onClick={ pipe(
|
|
314
|
-
onClose,
|
|
315
|
-
onRemove,
|
|
316
|
-
updateSelectionAfterRemove
|
|
317
|
-
) }
|
|
318
|
-
shortcut={ shortcuts.remove }
|
|
319
|
-
>
|
|
320
|
-
{ __( 'Delete' ) }
|
|
321
|
-
</MenuItem>
|
|
322
|
-
</MenuGroup>
|
|
323
|
-
) }
|
|
324
|
-
</>
|
|
325
|
-
) }
|
|
326
|
-
</DropdownMenu>
|
|
327
|
-
) }
|
|
337
|
+
</>
|
|
338
|
+
) }
|
|
339
|
+
</DropdownMenu>
|
|
340
|
+
);
|
|
341
|
+
} }
|
|
328
342
|
</BlockActions>
|
|
329
343
|
);
|
|
330
344
|
}
|
|
@@ -4,12 +4,9 @@
|
|
|
4
4
|
import {
|
|
5
5
|
createSlotFill,
|
|
6
6
|
MenuGroup,
|
|
7
|
-
MenuItem,
|
|
8
7
|
__experimentalStyleProvider as StyleProvider,
|
|
9
8
|
} from '@wordpress/components';
|
|
10
9
|
import { useSelect } from '@wordpress/data';
|
|
11
|
-
import { pipe } from '@wordpress/compose';
|
|
12
|
-
import { __ } from '@wordpress/i18n';
|
|
13
10
|
|
|
14
11
|
/**
|
|
15
12
|
* Internal dependencies
|
|
@@ -96,18 +93,6 @@ const BlockSettingsMenuControlsSlot = ( { fillProps, clientIds = null } ) => {
|
|
|
96
93
|
/>
|
|
97
94
|
) }
|
|
98
95
|
{ fills }
|
|
99
|
-
{ fillProps?.canMove &&
|
|
100
|
-
! fillProps?.onlyBlock &&
|
|
101
|
-
! isContentOnly && (
|
|
102
|
-
<MenuItem
|
|
103
|
-
onClick={ pipe(
|
|
104
|
-
fillProps?.onClose,
|
|
105
|
-
fillProps?.onMoveTo
|
|
106
|
-
) }
|
|
107
|
-
>
|
|
108
|
-
{ __( 'Move to' ) }
|
|
109
|
-
</MenuItem>
|
|
110
|
-
) }
|
|
111
96
|
{ selectedClientIds.length === 1 && (
|
|
112
97
|
<ModifyContentLockMenuItem
|
|
113
98
|
clientId={ selectedClientIds[ 0 ] }
|
|
@@ -35,36 +35,40 @@ function BlockSwitcherDropdownMenuContents( {
|
|
|
35
35
|
clientIds,
|
|
36
36
|
hasBlockStyles,
|
|
37
37
|
canRemove,
|
|
38
|
-
isUsingBindings,
|
|
39
38
|
} ) {
|
|
40
39
|
const { replaceBlocks, multiSelect, updateBlockAttributes } =
|
|
41
40
|
useDispatch( blockEditorStore );
|
|
42
|
-
const { possibleBlockTransformations, patterns, blocks } =
|
|
43
|
-
(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
41
|
+
const { possibleBlockTransformations, patterns, blocks, isUsingBindings } =
|
|
42
|
+
useSelect(
|
|
43
|
+
( select ) => {
|
|
44
|
+
const {
|
|
45
|
+
getBlockAttributes,
|
|
46
|
+
getBlocksByClientId,
|
|
47
|
+
getBlockRootClientId,
|
|
48
|
+
getBlockTransformItems,
|
|
49
|
+
__experimentalGetPatternTransformItems,
|
|
50
|
+
} = select( blockEditorStore );
|
|
51
|
+
const rootClientId = getBlockRootClientId( clientIds[ 0 ] );
|
|
52
|
+
const _blocks = getBlocksByClientId( clientIds );
|
|
53
|
+
return {
|
|
54
|
+
blocks: _blocks,
|
|
55
|
+
possibleBlockTransformations: getBlockTransformItems(
|
|
56
|
+
_blocks,
|
|
57
|
+
rootClientId
|
|
58
|
+
),
|
|
59
|
+
patterns: __experimentalGetPatternTransformItems(
|
|
60
|
+
_blocks,
|
|
61
|
+
rootClientId
|
|
62
|
+
),
|
|
63
|
+
isUsingBindings: clientIds.every(
|
|
64
|
+
( clientId ) =>
|
|
65
|
+
!! getBlockAttributes( clientId )?.metadata
|
|
66
|
+
?.bindings
|
|
67
|
+
),
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
[ clientIds ]
|
|
71
|
+
);
|
|
68
72
|
const blockVariationTransformations = useBlockVariationTransforms( {
|
|
69
73
|
clientIds,
|
|
70
74
|
blocks,
|
|
@@ -196,7 +200,7 @@ const BlockIndicator = ( { icon, showTitle, blockTitle } ) => (
|
|
|
196
200
|
</>
|
|
197
201
|
);
|
|
198
202
|
|
|
199
|
-
export const BlockSwitcher = ( { clientIds
|
|
203
|
+
export const BlockSwitcher = ( { clientIds } ) => {
|
|
200
204
|
const {
|
|
201
205
|
hasContentOnlyLocking,
|
|
202
206
|
canRemove,
|
|
@@ -205,6 +209,7 @@ export const BlockSwitcher = ( { clientIds, disabled, isUsingBindings } ) => {
|
|
|
205
209
|
invalidBlocks,
|
|
206
210
|
isReusable,
|
|
207
211
|
isTemplate,
|
|
212
|
+
isDisabled,
|
|
208
213
|
} = useSelect(
|
|
209
214
|
( select ) => {
|
|
210
215
|
const {
|
|
@@ -212,6 +217,7 @@ export const BlockSwitcher = ( { clientIds, disabled, isUsingBindings } ) => {
|
|
|
212
217
|
getBlocksByClientId,
|
|
213
218
|
getBlockAttributes,
|
|
214
219
|
canRemoveBlocks,
|
|
220
|
+
getBlockEditingMode,
|
|
215
221
|
} = select( blockEditorStore );
|
|
216
222
|
const { getBlockStyles, getBlockType, getActiveBlockVariation } =
|
|
217
223
|
select( blocksStore );
|
|
@@ -222,6 +228,7 @@ export const BlockSwitcher = ( { clientIds, disabled, isUsingBindings } ) => {
|
|
|
222
228
|
const [ { name: firstBlockName } ] = _blocks;
|
|
223
229
|
const _isSingleBlockSelected = _blocks.length === 1;
|
|
224
230
|
const blockType = getBlockType( firstBlockName );
|
|
231
|
+
const editingMode = getBlockEditingMode( clientIds[ 0 ] );
|
|
225
232
|
|
|
226
233
|
let _icon;
|
|
227
234
|
let _hasTemplateLock;
|
|
@@ -256,6 +263,7 @@ export const BlockSwitcher = ( { clientIds, disabled, isUsingBindings } ) => {
|
|
|
256
263
|
isTemplate:
|
|
257
264
|
_isSingleBlockSelected && isTemplatePart( _blocks[ 0 ] ),
|
|
258
265
|
hasContentOnlyLocking: _hasTemplateLock,
|
|
266
|
+
isDisabled: editingMode !== 'default',
|
|
259
267
|
};
|
|
260
268
|
},
|
|
261
269
|
[ clientIds ]
|
|
@@ -275,7 +283,7 @@ export const BlockSwitcher = ( { clientIds, disabled, isUsingBindings } ) => {
|
|
|
275
283
|
: __( 'Multiple blocks selected' );
|
|
276
284
|
|
|
277
285
|
const hideDropdown =
|
|
278
|
-
|
|
286
|
+
isDisabled ||
|
|
279
287
|
( ! hasBlockStyles && ! canRemove ) ||
|
|
280
288
|
hasContentOnlyLocking;
|
|
281
289
|
|
|
@@ -339,7 +347,6 @@ export const BlockSwitcher = ( { clientIds, disabled, isUsingBindings } ) => {
|
|
|
339
347
|
clientIds={ clientIds }
|
|
340
348
|
hasBlockStyles={ hasBlockStyles }
|
|
341
349
|
canRemove={ canRemove }
|
|
342
|
-
isUsingBindings={ isUsingBindings }
|
|
343
350
|
/>
|
|
344
351
|
) }
|
|
345
352
|
</DropdownMenu>
|
|
@@ -35,6 +35,7 @@ import { store as blockEditorStore } from '../../store';
|
|
|
35
35
|
import __unstableBlockNameContext from './block-name-context';
|
|
36
36
|
import NavigableToolbar from '../navigable-toolbar';
|
|
37
37
|
import { useHasBlockToolbar } from './use-has-block-toolbar';
|
|
38
|
+
import { unlock } from '../../lock-unlock';
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
41
|
* Renders the block toolbar.
|
|
@@ -58,7 +59,6 @@ export function PrivateBlockToolbar( {
|
|
|
58
59
|
const {
|
|
59
60
|
blockClientId,
|
|
60
61
|
blockClientIds,
|
|
61
|
-
isContentOnlyEditingMode,
|
|
62
62
|
isDefaultEditingMode,
|
|
63
63
|
blockType,
|
|
64
64
|
toolbarKey,
|
|
@@ -78,12 +78,14 @@ export function PrivateBlockToolbar( {
|
|
|
78
78
|
getBlockAttributes,
|
|
79
79
|
getBlockParentsByBlockName,
|
|
80
80
|
getTemplateLock,
|
|
81
|
-
|
|
81
|
+
getParentSectionBlock,
|
|
82
|
+
} = unlock( select( blockEditorStore ) );
|
|
82
83
|
const selectedBlockClientIds = getSelectedBlockClientIds();
|
|
83
84
|
const selectedBlockClientId = selectedBlockClientIds[ 0 ];
|
|
84
85
|
const parents = getBlockParents( selectedBlockClientId );
|
|
85
|
-
const
|
|
86
|
-
const
|
|
86
|
+
const parentSection = getParentSectionBlock( selectedBlockClientId );
|
|
87
|
+
const parentClientId = parentSection ?? parents[ parents.length - 1 ];
|
|
88
|
+
const parentBlockName = getBlockName( parentClientId );
|
|
87
89
|
const parentBlockType = getBlockType( parentBlockName );
|
|
88
90
|
const editingMode = getBlockEditingMode( selectedBlockClientId );
|
|
89
91
|
const _isDefaultEditingMode = editingMode === 'default';
|
|
@@ -112,21 +114,19 @@ export function PrivateBlockToolbar( {
|
|
|
112
114
|
return {
|
|
113
115
|
blockClientId: selectedBlockClientId,
|
|
114
116
|
blockClientIds: selectedBlockClientIds,
|
|
115
|
-
isContentOnlyEditingMode: editingMode === 'contentOnly',
|
|
116
117
|
isDefaultEditingMode: _isDefaultEditingMode,
|
|
117
118
|
blockType: selectedBlockClientId && getBlockType( _blockName ),
|
|
118
119
|
shouldShowVisualToolbar: isValid && isVisual,
|
|
119
|
-
toolbarKey: `${ selectedBlockClientId }${
|
|
120
|
+
toolbarKey: `${ selectedBlockClientId }${ parentClientId }`,
|
|
120
121
|
showParentSelector:
|
|
121
122
|
parentBlockType &&
|
|
122
|
-
getBlockEditingMode(
|
|
123
|
+
getBlockEditingMode( parentClientId ) !== 'disabled' &&
|
|
123
124
|
hasBlockSupport(
|
|
124
125
|
parentBlockType,
|
|
125
126
|
'__experimentalParentSelector',
|
|
126
127
|
true
|
|
127
128
|
) &&
|
|
128
|
-
selectedBlockClientIds.length === 1
|
|
129
|
-
_isDefaultEditingMode,
|
|
129
|
+
selectedBlockClientIds.length === 1,
|
|
130
130
|
isUsingBindings: _isUsingBindings,
|
|
131
131
|
hasParentPattern: _hasParentPattern,
|
|
132
132
|
hasContentOnlyLocking: _hasTemplateLock,
|
|
@@ -179,36 +179,26 @@ export function PrivateBlockToolbar( {
|
|
|
179
179
|
key={ toolbarKey }
|
|
180
180
|
>
|
|
181
181
|
<div ref={ toolbarWrapperRef } className={ innerClasses }>
|
|
182
|
-
{ ! isMultiToolbar &&
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
{ ! isMultiToolbar && isLargeViewport && (
|
|
183
|
+
<BlockParentSelector />
|
|
184
|
+
) }
|
|
185
185
|
{ ( shouldShowVisualToolbar || isMultiToolbar ) &&
|
|
186
|
-
|
|
187
|
-
( isContentOnlyEditingMode && ! hasParentPattern ) ||
|
|
188
|
-
isSynced ) && (
|
|
186
|
+
! hasParentPattern && (
|
|
189
187
|
<div
|
|
190
188
|
ref={ nodeRef }
|
|
191
189
|
{ ...showHoveredOrFocusedGestures }
|
|
192
190
|
>
|
|
193
191
|
<ToolbarGroup className="block-editor-block-toolbar__block-controls">
|
|
194
|
-
<BlockSwitcher
|
|
192
|
+
<BlockSwitcher clientIds={ blockClientIds } />
|
|
193
|
+
{ ! isMultiToolbar && isDefaultEditingMode && (
|
|
194
|
+
<BlockLockToolbar
|
|
195
|
+
clientId={ blockClientId }
|
|
196
|
+
/>
|
|
197
|
+
) }
|
|
198
|
+
<BlockMover
|
|
195
199
|
clientIds={ blockClientIds }
|
|
196
|
-
|
|
197
|
-
isUsingBindings={ isUsingBindings }
|
|
200
|
+
hideDragHandle={ hideDragHandle }
|
|
198
201
|
/>
|
|
199
|
-
{ isDefaultEditingMode && (
|
|
200
|
-
<>
|
|
201
|
-
{ ! isMultiToolbar && (
|
|
202
|
-
<BlockLockToolbar
|
|
203
|
-
clientId={ blockClientId }
|
|
204
|
-
/>
|
|
205
|
-
) }
|
|
206
|
-
<BlockMover
|
|
207
|
-
clientIds={ blockClientIds }
|
|
208
|
-
hideDragHandle={ hideDragHandle }
|
|
209
|
-
/>
|
|
210
|
-
</>
|
|
211
|
-
) }
|
|
212
202
|
</ToolbarGroup>
|
|
213
203
|
</div>
|
|
214
204
|
) }
|
|
@@ -242,9 +232,7 @@ export function PrivateBlockToolbar( {
|
|
|
242
232
|
</>
|
|
243
233
|
) }
|
|
244
234
|
<BlockEditVisuallyButton clientIds={ blockClientIds } />
|
|
245
|
-
{
|
|
246
|
-
<BlockSettingsMenu clientIds={ blockClientIds } />
|
|
247
|
-
) }
|
|
235
|
+
<BlockSettingsMenu clientIds={ blockClientIds } />
|
|
248
236
|
</div>
|
|
249
237
|
</NavigableToolbar>
|
|
250
238
|
);
|
|
@@ -59,9 +59,18 @@
|
|
|
59
59
|
|
|
60
60
|
> :last-child,
|
|
61
61
|
> :last-child .components-toolbar-group,
|
|
62
|
-
> :last-child .components-toolbar
|
|
62
|
+
> :last-child .components-toolbar,
|
|
63
|
+
// If the last toolbar group is empty,
|
|
64
|
+
// we need to remove the double border from the penultimate one.
|
|
65
|
+
&:has(> :last-child:empty) > :nth-last-child(2),
|
|
66
|
+
&:has(> :last-child:empty) > :nth-last-child(2) .components-toolbar-group,
|
|
67
|
+
&:has(> :last-child:empty) > :nth-last-child(2) .components-toolbar {
|
|
63
68
|
border-right: none;
|
|
64
69
|
}
|
|
70
|
+
|
|
71
|
+
.components-toolbar-group:empty {
|
|
72
|
+
display: none;
|
|
73
|
+
}
|
|
65
74
|
}
|
|
66
75
|
|
|
67
76
|
.block-editor-block-contextual-toolbar {
|
|
@@ -7,7 +7,6 @@ import { getBlockType, hasBlockSupport } from '@wordpress/blocks';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { store as blockEditorStore } from '../../store';
|
|
10
|
-
import { useHasAnyBlockControls } from '../block-controls/use-has-block-controls';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Returns true if the block toolbar should be shown.
|
|
@@ -15,40 +14,29 @@ import { useHasAnyBlockControls } from '../block-controls/use-has-block-controls
|
|
|
15
14
|
* @return {boolean} Whether the block toolbar component will be rendered.
|
|
16
15
|
*/
|
|
17
16
|
export function useHasBlockToolbar() {
|
|
18
|
-
const { isToolbarEnabled,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
getBlockEditingMode,
|
|
22
|
-
getBlockName,
|
|
23
|
-
getBlockSelectionStart,
|
|
24
|
-
} = select( blockEditorStore );
|
|
17
|
+
const { isToolbarEnabled, isBlockDisabled } = useSelect( ( select ) => {
|
|
18
|
+
const { getBlockEditingMode, getBlockName, getBlockSelectionStart } =
|
|
19
|
+
select( blockEditorStore );
|
|
25
20
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
// we only care about the 1st selected block
|
|
22
|
+
// for the toolbar, so we use getBlockSelectionStart
|
|
23
|
+
// instead of getSelectedBlockClientIds
|
|
24
|
+
const selectedBlockClientId = getBlockSelectionStart();
|
|
30
25
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
const blockType =
|
|
27
|
+
selectedBlockClientId &&
|
|
28
|
+
getBlockType( getBlockName( selectedBlockClientId ) );
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
[]
|
|
44
|
-
);
|
|
30
|
+
return {
|
|
31
|
+
isToolbarEnabled:
|
|
32
|
+
blockType &&
|
|
33
|
+
hasBlockSupport( blockType, '__experimentalToolbar', true ),
|
|
34
|
+
isBlockDisabled:
|
|
35
|
+
getBlockEditingMode( selectedBlockClientId ) === 'disabled',
|
|
36
|
+
};
|
|
37
|
+
}, [] );
|
|
45
38
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (
|
|
49
|
-
! isToolbarEnabled ||
|
|
50
|
-
( ! isDefaultEditingMode && ! hasAnyBlockControls )
|
|
51
|
-
) {
|
|
39
|
+
if ( ! isToolbarEnabled || isBlockDisabled ) {
|
|
52
40
|
return false;
|
|
53
41
|
}
|
|
54
42
|
|