@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
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
default as InsertionPoint,
|
|
20
20
|
} from './insertion-point';
|
|
21
21
|
import BlockToolbarPopover from './block-toolbar-popover';
|
|
22
|
-
import BlockToolbarBreadcrumb from './block-toolbar-breadcrumb';
|
|
23
22
|
import ZoomOutPopover from './zoom-out-popover';
|
|
24
23
|
import { store as blockEditorStore } from '../../store';
|
|
25
24
|
import usePopoverScroll from '../block-popover/use-popover-scroll';
|
|
@@ -35,7 +34,8 @@ function selector( select ) {
|
|
|
35
34
|
getSettings,
|
|
36
35
|
__unstableGetEditorMode,
|
|
37
36
|
isTyping,
|
|
38
|
-
|
|
37
|
+
isDragging,
|
|
38
|
+
} = unlock( select( blockEditorStore ) );
|
|
39
39
|
|
|
40
40
|
const clientId =
|
|
41
41
|
getSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();
|
|
@@ -47,6 +47,7 @@ function selector( select ) {
|
|
|
47
47
|
hasFixedToolbar: getSettings().hasFixedToolbar,
|
|
48
48
|
isTyping: isTyping(),
|
|
49
49
|
isZoomOutMode: editorMode === 'zoom-out',
|
|
50
|
+
isDragging: isDragging(),
|
|
50
51
|
};
|
|
51
52
|
}
|
|
52
53
|
|
|
@@ -64,10 +65,9 @@ export default function BlockTools( {
|
|
|
64
65
|
__unstableContentRef,
|
|
65
66
|
...props
|
|
66
67
|
} ) {
|
|
67
|
-
const { clientId, hasFixedToolbar, isTyping, isZoomOutMode } =
|
|
68
|
-
selector,
|
|
69
|
-
|
|
70
|
-
);
|
|
68
|
+
const { clientId, hasFixedToolbar, isTyping, isZoomOutMode, isDragging } =
|
|
69
|
+
useSelect( selector, [] );
|
|
70
|
+
|
|
71
71
|
const isMatch = useShortcutEventMatch();
|
|
72
72
|
const {
|
|
73
73
|
getBlocksByClientId,
|
|
@@ -78,7 +78,6 @@ export default function BlockTools( {
|
|
|
78
78
|
const { getGroupingBlockName } = useSelect( blocksStore );
|
|
79
79
|
const {
|
|
80
80
|
showEmptyBlockSideInserter,
|
|
81
|
-
showBreadcrumb,
|
|
82
81
|
showBlockToolbarPopover,
|
|
83
82
|
showZoomOutToolbar,
|
|
84
83
|
} = useShowBlockTools();
|
|
@@ -223,14 +222,6 @@ export default function BlockTools( {
|
|
|
223
222
|
/>
|
|
224
223
|
) }
|
|
225
224
|
|
|
226
|
-
{ showBreadcrumb && (
|
|
227
|
-
<BlockToolbarBreadcrumb
|
|
228
|
-
ref={ blockSelectionButtonRef }
|
|
229
|
-
__unstableContentRef={ __unstableContentRef }
|
|
230
|
-
clientId={ clientId }
|
|
231
|
-
/>
|
|
232
|
-
) }
|
|
233
|
-
|
|
234
225
|
{ showZoomOutToolbar && (
|
|
235
226
|
<ZoomOutPopover
|
|
236
227
|
__unstableContentRef={ __unstableContentRef }
|
|
@@ -251,7 +242,7 @@ export default function BlockTools( {
|
|
|
251
242
|
name="__unstable-block-tools-after"
|
|
252
243
|
ref={ blockToolbarAfterRef }
|
|
253
244
|
/>
|
|
254
|
-
{ isZoomOutMode && (
|
|
245
|
+
{ isZoomOutMode && ! isDragging && (
|
|
255
246
|
<ZoomOutModeInserters
|
|
256
247
|
__unstableContentRef={ __unstableContentRef }
|
|
257
248
|
/>
|
|
@@ -37,7 +37,6 @@ function InbetweenInsertionPointPopover( {
|
|
|
37
37
|
rootClientId,
|
|
38
38
|
isInserterShown,
|
|
39
39
|
isDistractionFree,
|
|
40
|
-
isNavigationMode,
|
|
41
40
|
isZoomOutMode,
|
|
42
41
|
} = useSelect( ( select ) => {
|
|
43
42
|
const {
|
|
@@ -48,7 +47,6 @@ function InbetweenInsertionPointPopover( {
|
|
|
48
47
|
getPreviousBlockClientId,
|
|
49
48
|
getNextBlockClientId,
|
|
50
49
|
getSettings,
|
|
51
|
-
isNavigationMode: _isNavigationMode,
|
|
52
50
|
__unstableGetEditorMode,
|
|
53
51
|
} = select( blockEditorStore );
|
|
54
52
|
const insertionPoint = getBlockInsertionPoint();
|
|
@@ -78,7 +76,6 @@ function InbetweenInsertionPointPopover( {
|
|
|
78
76
|
getBlockListSettings( insertionPoint.rootClientId )
|
|
79
77
|
?.orientation || 'vertical',
|
|
80
78
|
rootClientId: insertionPoint.rootClientId,
|
|
81
|
-
isNavigationMode: _isNavigationMode(),
|
|
82
79
|
isDistractionFree: settings.isDistractionFree,
|
|
83
80
|
isInserterShown: insertionPoint?.__unstableWithInserter,
|
|
84
81
|
isZoomOutMode: __unstableGetEditorMode() === 'zoom-out',
|
|
@@ -144,7 +141,7 @@ function InbetweenInsertionPointPopover( {
|
|
|
144
141
|
},
|
|
145
142
|
};
|
|
146
143
|
|
|
147
|
-
if ( isDistractionFree
|
|
144
|
+
if ( isDistractionFree ) {
|
|
148
145
|
return null;
|
|
149
146
|
}
|
|
150
147
|
|
|
@@ -84,84 +84,6 @@
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
/**
|
|
88
|
-
* Block Label for Navigation/Selection Mode
|
|
89
|
-
*/
|
|
90
|
-
|
|
91
|
-
.block-editor-block-list__block-selection-button {
|
|
92
|
-
display: inline-flex;
|
|
93
|
-
padding: 0 $grid-unit-15;
|
|
94
|
-
z-index: z-index(".block-editor-block-list__block-selection-button");
|
|
95
|
-
|
|
96
|
-
// Dark block UI appearance.
|
|
97
|
-
border-radius: $radius-small;
|
|
98
|
-
background-color: $gray-900;
|
|
99
|
-
|
|
100
|
-
font-size: $default-font-size;
|
|
101
|
-
height: $block-toolbar-height;
|
|
102
|
-
|
|
103
|
-
.block-editor-block-list__block-selection-button__content {
|
|
104
|
-
margin: auto;
|
|
105
|
-
display: inline-flex;
|
|
106
|
-
align-items: center;
|
|
107
|
-
|
|
108
|
-
> .components-flex__item {
|
|
109
|
-
margin-right: $grid-unit-15 * 0.5;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
.components-button.has-icon.block-selection-button_drag-handle {
|
|
113
|
-
cursor: grab;
|
|
114
|
-
padding: 0;
|
|
115
|
-
height: $grid-unit-30;
|
|
116
|
-
min-width: $grid-unit-30;
|
|
117
|
-
margin-left: -2px;
|
|
118
|
-
|
|
119
|
-
// Drag handle is smaller than the others.
|
|
120
|
-
svg {
|
|
121
|
-
min-width: 18px;
|
|
122
|
-
min-height: 18px;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.block-editor-block-icon {
|
|
127
|
-
font-size: $default-font-size;
|
|
128
|
-
color: $white;
|
|
129
|
-
height: $block-toolbar-height;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
// The button here has a special style to appear as a toolbar.
|
|
133
|
-
.components-button {
|
|
134
|
-
min-width: $button-size;
|
|
135
|
-
color: $white;
|
|
136
|
-
height: $block-toolbar-height;
|
|
137
|
-
|
|
138
|
-
// When button is focused, it receives a box-shadow instead of the border.
|
|
139
|
-
&:focus {
|
|
140
|
-
box-shadow: none;
|
|
141
|
-
border: none;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
&:active {
|
|
145
|
-
color: $white;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// Make sure the button has no hover style when it's disabled.
|
|
149
|
-
&[aria-disabled="true"]:hover {
|
|
150
|
-
color: $white;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
display: flex;
|
|
154
|
-
}
|
|
155
|
-
.block-selection-button_select-button.components-button {
|
|
156
|
-
padding: 0;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.block-editor-block-mover {
|
|
160
|
-
background: unset;
|
|
161
|
-
border: none;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
87
|
// Hide the popover block editor list while dragging.
|
|
166
88
|
// Using a hacky animation to delay hiding the element.
|
|
167
89
|
// It's needed because if we hide the element immediately upon dragging,
|
|
@@ -178,14 +100,10 @@
|
|
|
178
100
|
.components-popover.block-editor-block-list__block-popover {
|
|
179
101
|
|
|
180
102
|
// Position the block toolbar.
|
|
181
|
-
.block-editor-block-list__block-selection-button,
|
|
182
103
|
.block-editor-block-contextual-toolbar {
|
|
183
104
|
pointer-events: all;
|
|
184
105
|
margin-top: $grid-unit-10;
|
|
185
106
|
margin-bottom: $grid-unit-10;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
.block-editor-block-contextual-toolbar {
|
|
189
107
|
border: $border-width solid $gray-900;
|
|
190
108
|
border-radius: $radius-small;
|
|
191
109
|
overflow: visible; // allow the parent selector to be visible
|
|
@@ -283,12 +201,9 @@
|
|
|
283
201
|
background: none;
|
|
284
202
|
border: none;
|
|
285
203
|
}
|
|
286
|
-
}
|
|
287
204
|
|
|
288
|
-
.
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
&.is-visible {
|
|
292
|
-
visibility: visible;
|
|
205
|
+
// Make the spacing consistent between controls.
|
|
206
|
+
.components-button {
|
|
207
|
+
height: $button-size-next-default-40px;
|
|
293
208
|
}
|
|
294
209
|
}
|
|
@@ -22,7 +22,6 @@ export function useShowBlockTools() {
|
|
|
22
22
|
getBlock,
|
|
23
23
|
getBlockMode,
|
|
24
24
|
getSettings,
|
|
25
|
-
hasMultiSelection,
|
|
26
25
|
__unstableGetEditorMode,
|
|
27
26
|
isTyping,
|
|
28
27
|
} = select( blockEditorStore );
|
|
@@ -42,29 +41,20 @@ export function useShowBlockTools() {
|
|
|
42
41
|
! isTyping() &&
|
|
43
42
|
editorMode === 'edit' &&
|
|
44
43
|
isEmptyDefaultBlock;
|
|
45
|
-
const maybeShowBreadcrumb =
|
|
46
|
-
hasSelectedBlock &&
|
|
47
|
-
! hasMultiSelection() &&
|
|
48
|
-
editorMode === 'navigation';
|
|
49
|
-
|
|
50
44
|
const isZoomOut = editorMode === 'zoom-out';
|
|
51
45
|
const _showZoomOutToolbar =
|
|
52
46
|
isZoomOut &&
|
|
53
47
|
block?.attributes?.align === 'full' &&
|
|
54
|
-
! _showEmptyBlockSideInserter
|
|
55
|
-
! maybeShowBreadcrumb;
|
|
48
|
+
! _showEmptyBlockSideInserter;
|
|
56
49
|
const _showBlockToolbarPopover =
|
|
57
50
|
! _showZoomOutToolbar &&
|
|
58
51
|
! getSettings().hasFixedToolbar &&
|
|
59
52
|
! _showEmptyBlockSideInserter &&
|
|
60
53
|
hasSelectedBlock &&
|
|
61
|
-
! isEmptyDefaultBlock
|
|
62
|
-
! maybeShowBreadcrumb;
|
|
54
|
+
! isEmptyDefaultBlock;
|
|
63
55
|
|
|
64
56
|
return {
|
|
65
57
|
showEmptyBlockSideInserter: _showEmptyBlockSideInserter,
|
|
66
|
-
showBreadcrumb:
|
|
67
|
-
! _showEmptyBlockSideInserter && maybeShowBreadcrumb,
|
|
68
58
|
showBlockToolbarPopover: _showBlockToolbarPopover,
|
|
69
59
|
showZoomOutToolbar: _showZoomOutToolbar,
|
|
70
60
|
};
|
|
@@ -6,17 +6,11 @@ import clsx from 'clsx';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { useState } from '@wordpress/element';
|
|
10
9
|
import { Button } from '@wordpress/components';
|
|
11
10
|
import { plus } from '@wordpress/icons';
|
|
12
11
|
import { _x } from '@wordpress/i18n';
|
|
13
12
|
|
|
14
|
-
function ZoomOutModeInserterButton( {
|
|
15
|
-
const [
|
|
16
|
-
zoomOutModeInserterButtonHovered,
|
|
17
|
-
setZoomOutModeInserterButtonHovered,
|
|
18
|
-
] = useState( false );
|
|
19
|
-
|
|
13
|
+
function ZoomOutModeInserterButton( { onClick } ) {
|
|
20
14
|
return (
|
|
21
15
|
<Button
|
|
22
16
|
variant="primary"
|
|
@@ -24,18 +18,9 @@ function ZoomOutModeInserterButton( { isVisible, onClick } ) {
|
|
|
24
18
|
size="compact"
|
|
25
19
|
className={ clsx(
|
|
26
20
|
'block-editor-button-pattern-inserter__button',
|
|
27
|
-
'block-editor-block-tools__zoom-out-mode-inserter-button'
|
|
28
|
-
{
|
|
29
|
-
'is-visible': isVisible || zoomOutModeInserterButtonHovered,
|
|
30
|
-
}
|
|
21
|
+
'block-editor-block-tools__zoom-out-mode-inserter-button'
|
|
31
22
|
) }
|
|
32
23
|
onClick={ onClick }
|
|
33
|
-
onMouseOver={ () => {
|
|
34
|
-
setZoomOutModeInserterButtonHovered( true );
|
|
35
|
-
} }
|
|
36
|
-
onMouseOut={ () => {
|
|
37
|
-
setZoomOutModeInserterButtonHovered( false );
|
|
38
|
-
} }
|
|
39
24
|
label={ _x(
|
|
40
25
|
'Add pattern',
|
|
41
26
|
'Generic label for pattern inserter button'
|
|
@@ -16,41 +16,39 @@ function ZoomOutModeInserters() {
|
|
|
16
16
|
const [ isReady, setIsReady ] = useState( false );
|
|
17
17
|
const {
|
|
18
18
|
hasSelection,
|
|
19
|
-
|
|
19
|
+
insertionPoint,
|
|
20
20
|
blockOrder,
|
|
21
21
|
blockInsertionPointVisible,
|
|
22
22
|
setInserterIsOpened,
|
|
23
23
|
sectionRootClientId,
|
|
24
24
|
selectedBlockClientId,
|
|
25
|
-
hoveredBlockClientId,
|
|
26
25
|
} = useSelect( ( select ) => {
|
|
27
26
|
const {
|
|
28
27
|
getSettings,
|
|
29
|
-
|
|
28
|
+
getInsertionPoint,
|
|
30
29
|
getBlockOrder,
|
|
31
30
|
getSelectionStart,
|
|
32
31
|
getSelectedBlockClientId,
|
|
33
|
-
getHoveredBlockClientId,
|
|
34
|
-
isBlockInsertionPointVisible,
|
|
35
32
|
getSectionRootClientId,
|
|
33
|
+
isBlockInsertionPointVisible,
|
|
36
34
|
} = unlock( select( blockEditorStore ) );
|
|
37
35
|
|
|
38
36
|
const root = getSectionRootClientId();
|
|
39
37
|
|
|
40
38
|
return {
|
|
41
39
|
hasSelection: !! getSelectionStart().clientId,
|
|
42
|
-
|
|
40
|
+
insertionPoint: getInsertionPoint(),
|
|
43
41
|
blockOrder: getBlockOrder( root ),
|
|
44
42
|
blockInsertionPointVisible: isBlockInsertionPointVisible(),
|
|
45
43
|
sectionRootClientId: root,
|
|
46
44
|
setInserterIsOpened:
|
|
47
45
|
getSettings().__experimentalSetIsInserterOpened,
|
|
48
46
|
selectedBlockClientId: getSelectedBlockClientId(),
|
|
49
|
-
hoveredBlockClientId: getHoveredBlockClientId(),
|
|
50
47
|
};
|
|
51
48
|
}, [] );
|
|
52
49
|
|
|
53
|
-
|
|
50
|
+
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
|
|
51
|
+
const { showInsertionPoint } = unlock( useDispatch( blockEditorStore ) );
|
|
54
52
|
|
|
55
53
|
// Defer the initial rendering to avoid the jumps due to the animation.
|
|
56
54
|
useEffect( () => {
|
|
@@ -62,25 +60,20 @@ function ZoomOutModeInserters() {
|
|
|
62
60
|
};
|
|
63
61
|
}, [] );
|
|
64
62
|
|
|
65
|
-
if ( ! isReady ) {
|
|
63
|
+
if ( ! isReady || ! hasSelection ) {
|
|
66
64
|
return null;
|
|
67
65
|
}
|
|
68
66
|
|
|
69
67
|
return [ undefined, ...blockOrder ].map( ( clientId, index ) => {
|
|
70
68
|
const shouldRenderInsertionPoint =
|
|
71
|
-
blockInsertionPointVisible &&
|
|
69
|
+
blockInsertionPointVisible && insertionPoint?.index === index;
|
|
72
70
|
|
|
73
71
|
const previousClientId = clientId;
|
|
74
72
|
const nextClientId = blockOrder[ index ];
|
|
75
73
|
|
|
76
74
|
const isSelected =
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
selectedBlockClientId === nextClientId );
|
|
80
|
-
|
|
81
|
-
const isHovered =
|
|
82
|
-
hoveredBlockClientId === previousClientId ||
|
|
83
|
-
hoveredBlockClientId === nextClientId;
|
|
75
|
+
selectedBlockClientId === previousClientId ||
|
|
76
|
+
selectedBlockClientId === nextClientId;
|
|
84
77
|
|
|
85
78
|
return (
|
|
86
79
|
<BlockPopoverInbetween
|
|
@@ -88,9 +81,8 @@ function ZoomOutModeInserters() {
|
|
|
88
81
|
previousClientId={ previousClientId }
|
|
89
82
|
nextClientId={ nextClientId }
|
|
90
83
|
>
|
|
91
|
-
{ ! shouldRenderInsertionPoint && (
|
|
84
|
+
{ ! shouldRenderInsertionPoint && isSelected && (
|
|
92
85
|
<ZoomOutModeInserterButton
|
|
93
|
-
isVisible={ isSelected || isHovered }
|
|
94
86
|
onClick={ () => {
|
|
95
87
|
setInserterIsOpened( {
|
|
96
88
|
rootClientId: sectionRootClientId,
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -27,7 +22,6 @@ export default function ZoomOutToolbar( { clientId, __unstableContentRef } ) {
|
|
|
27
22
|
( select ) => {
|
|
28
23
|
const {
|
|
29
24
|
getBlock,
|
|
30
|
-
hasBlockMovingClientId,
|
|
31
25
|
getNextBlockClientId,
|
|
32
26
|
getPreviousBlockClientId,
|
|
33
27
|
canRemoveBlock,
|
|
@@ -63,7 +57,6 @@ export default function ZoomOutToolbar( { clientId, __unstableContentRef } ) {
|
|
|
63
57
|
}
|
|
64
58
|
|
|
65
59
|
return {
|
|
66
|
-
blockMovingMode: hasBlockMovingClientId(),
|
|
67
60
|
isBlockTemplatePart,
|
|
68
61
|
isNextBlockTemplatePart,
|
|
69
62
|
isPrevBlockTemplatePart,
|
|
@@ -76,7 +69,6 @@ export default function ZoomOutToolbar( { clientId, __unstableContentRef } ) {
|
|
|
76
69
|
);
|
|
77
70
|
|
|
78
71
|
const {
|
|
79
|
-
blockMovingMode,
|
|
80
72
|
isBlockTemplatePart,
|
|
81
73
|
isNextBlockTemplatePart,
|
|
82
74
|
isPrevBlockTemplatePart,
|
|
@@ -89,15 +81,11 @@ export default function ZoomOutToolbar( { clientId, __unstableContentRef } ) {
|
|
|
89
81
|
useDispatch( blockEditorStore )
|
|
90
82
|
);
|
|
91
83
|
|
|
92
|
-
const classNames = clsx( 'zoom-out-toolbar', {
|
|
93
|
-
'is-block-moving-mode': !! blockMovingMode,
|
|
94
|
-
} );
|
|
95
|
-
|
|
96
84
|
const showBlockDraggable = canMove && ! isBlockTemplatePart;
|
|
97
85
|
|
|
98
86
|
return (
|
|
99
87
|
<NavigableToolbar
|
|
100
|
-
className=
|
|
88
|
+
className="zoom-out-toolbar"
|
|
101
89
|
/* translators: accessibility text for the block toolbar */
|
|
102
90
|
aria-label={ __( 'Block tools' ) }
|
|
103
91
|
// The variant is applied as "toolbar" when undefined, which is the black border style of the dropdown from the toolbar popover.
|
|
@@ -159,6 +147,7 @@ export default function ZoomOutToolbar( { clientId, __unstableContentRef } ) {
|
|
|
159
147
|
label={ __( 'Delete' ) }
|
|
160
148
|
onClick={ () => {
|
|
161
149
|
removeBlock( clientId );
|
|
150
|
+
__unstableContentRef.current?.focus();
|
|
162
151
|
} }
|
|
163
152
|
/>
|
|
164
153
|
) }
|
|
@@ -64,8 +64,7 @@ function BlockVariationPicker( {
|
|
|
64
64
|
{ allowSkip && (
|
|
65
65
|
<div className="block-editor-block-variation-picker__skip">
|
|
66
66
|
<Button
|
|
67
|
-
|
|
68
|
-
__next40pxDefaultSize={ false }
|
|
67
|
+
__next40pxDefaultSize
|
|
69
68
|
variant="link"
|
|
70
69
|
onClick={ () => onSelect() }
|
|
71
70
|
>
|
|
@@ -36,8 +36,8 @@ function VariationsButtons( {
|
|
|
36
36
|
</VisuallyHidden>
|
|
37
37
|
{ variations.map( ( variation ) => (
|
|
38
38
|
<Button
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
__next40pxDefaultSize
|
|
40
|
+
size="compact"
|
|
41
41
|
key={ variation.name }
|
|
42
42
|
icon={ <BlockIcon icon={ variation.icon } showColors /> }
|
|
43
43
|
isPressed={ selectedValue === variation.name }
|
|
@@ -8,11 +8,6 @@
|
|
|
8
8
|
color: $gray-900;
|
|
9
9
|
box-shadow: inset 0 0 0 $border-width $gray-900;
|
|
10
10
|
|
|
11
|
-
// Needs specificity to override button styles.
|
|
12
|
-
&.components-button.components-button {
|
|
13
|
-
padding: $grid-unit-15;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
11
|
.is-dark-theme & {
|
|
17
12
|
color: $light-gray-placeholder;
|
|
18
13
|
box-shadow: inset 0 0 0 $border-width $light-gray-placeholder;
|
|
@@ -88,11 +88,7 @@ const renderToggle =
|
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
return (
|
|
91
|
-
<Button
|
|
92
|
-
// TODO: Switch to `true` (40px size) if possible
|
|
93
|
-
__next40pxDefaultSize={ false }
|
|
94
|
-
{ ...toggleProps }
|
|
95
|
-
>
|
|
91
|
+
<Button __next40pxDefaultSize { ...toggleProps }>
|
|
96
92
|
<LabeledColorIndicator
|
|
97
93
|
colorValue={ colorValue }
|
|
98
94
|
label={ label }
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# FontFamilyControl
|
|
2
2
|
|
|
3
|
+
<div class="callout callout-alert">
|
|
4
|
+
This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.
|
|
5
|
+
</div>
|
|
6
|
+
|
|
3
7
|
FontFamilyControl is a React component that renders a UI that allows users to select a font family.
|
|
4
8
|
The component renders a user interface that allows the user to select from a set of predefined font families as defined by the `typography.fontFamilies` presets.
|
|
5
9
|
Optionally, you can provide a `fontFamilies` prop that overrides the predefined font families.
|
|
@@ -10,7 +14,7 @@ Optionally, you can provide a `fontFamilies` prop that overrides the predefined
|
|
|
10
14
|
|
|
11
15
|
```jsx
|
|
12
16
|
import { useState } from 'react';
|
|
13
|
-
import { FontFamilyControl } from '@wordpress/block-editor';
|
|
17
|
+
import { __experimentalFontFamilyControl as FontFamilyControl } from '@wordpress/block-editor';
|
|
14
18
|
import { __ } from '@wordpress/i18n';
|
|
15
19
|
|
|
16
20
|
// ...
|
|
@@ -239,11 +239,7 @@ function ColorPanelDropdown( {
|
|
|
239
239
|
};
|
|
240
240
|
|
|
241
241
|
return (
|
|
242
|
-
<Button
|
|
243
|
-
// TODO: Switch to `true` (40px size) if possible
|
|
244
|
-
__next40pxDefaultSize={ false }
|
|
245
|
-
{ ...toggleProps }
|
|
246
|
-
>
|
|
242
|
+
<Button __next40pxDefaultSize { ...toggleProps }>
|
|
247
243
|
<LabeledColorIndicators
|
|
248
244
|
indicators={ indicators }
|
|
249
245
|
label={ label }
|
|
@@ -10,7 +10,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
10
10
|
import {
|
|
11
11
|
__experimentalToolsPanel as ToolsPanel,
|
|
12
12
|
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
13
|
-
|
|
13
|
+
BoxControl,
|
|
14
14
|
__experimentalUnitControl as UnitControl,
|
|
15
15
|
__experimentalUseCustomUnits as useCustomUnits,
|
|
16
16
|
__experimentalInputControlPrefixWrapper as InputControlPrefixWrapper,
|
|
@@ -190,8 +190,7 @@ export default function FiltersPanel( {
|
|
|
190
190
|
return (
|
|
191
191
|
<ItemGroup isBordered isSeparated>
|
|
192
192
|
<Button
|
|
193
|
-
|
|
194
|
-
__next40pxDefaultSize={ false }
|
|
193
|
+
__next40pxDefaultSize
|
|
195
194
|
{ ...toggleProps }
|
|
196
195
|
>
|
|
197
196
|
<LabeledColorIndicator
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
FlexItem,
|
|
12
12
|
Dropdown,
|
|
13
13
|
Composite,
|
|
14
|
+
Tooltip,
|
|
14
15
|
} from '@wordpress/components';
|
|
15
16
|
import { useMemo } from '@wordpress/element';
|
|
16
17
|
import { shadow as shadowIcon, Icon, check } from '@wordpress/icons';
|
|
@@ -42,8 +43,7 @@ export function ShadowPopoverContainer( { shadow, onShadowChange, settings } ) {
|
|
|
42
43
|
/>
|
|
43
44
|
<div className="block-editor-global-styles__clear-shadow">
|
|
44
45
|
<Button
|
|
45
|
-
|
|
46
|
-
__next40pxDefaultSize={ false }
|
|
46
|
+
__next40pxDefaultSize
|
|
47
47
|
variant="tertiary"
|
|
48
48
|
onClick={ () => onShadowChange( undefined ) }
|
|
49
49
|
>
|
|
@@ -80,32 +80,31 @@ export function ShadowPresets( { presets, activeShadow, onSelect } ) {
|
|
|
80
80
|
|
|
81
81
|
export function ShadowIndicator( { type, label, isActive, onSelect, shadow } ) {
|
|
82
82
|
return (
|
|
83
|
-
<
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
'
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
/>
|
|
83
|
+
<Tooltip text={ label }>
|
|
84
|
+
<Composite.Item
|
|
85
|
+
role="option"
|
|
86
|
+
aria-label={ label }
|
|
87
|
+
aria-selected={ isActive }
|
|
88
|
+
className={ clsx( 'block-editor-global-styles__shadow__item', {
|
|
89
|
+
'is-active': isActive,
|
|
90
|
+
} ) }
|
|
91
|
+
render={
|
|
92
|
+
<button
|
|
93
|
+
className={ clsx(
|
|
94
|
+
'block-editor-global-styles__shadow-indicator',
|
|
95
|
+
{
|
|
96
|
+
unset: type === 'unset',
|
|
97
|
+
}
|
|
98
|
+
) }
|
|
99
|
+
onClick={ onSelect }
|
|
100
|
+
style={ { boxShadow: shadow } }
|
|
101
|
+
aria-label={ label }
|
|
102
|
+
>
|
|
103
|
+
{ isActive && <Icon icon={ check } /> }
|
|
104
|
+
</button>
|
|
105
|
+
}
|
|
106
|
+
/>
|
|
107
|
+
</Tooltip>
|
|
109
108
|
);
|
|
110
109
|
}
|
|
111
110
|
|
|
@@ -143,11 +142,7 @@ function renderShadowToggle() {
|
|
|
143
142
|
};
|
|
144
143
|
|
|
145
144
|
return (
|
|
146
|
-
<Button
|
|
147
|
-
// TODO: Switch to `true` (40px size) if possible
|
|
148
|
-
__next40pxDefaultSize={ false }
|
|
149
|
-
{ ...toggleProps }
|
|
150
|
-
>
|
|
145
|
+
<Button __next40pxDefaultSize { ...toggleProps }>
|
|
151
146
|
<HStack justify="flex-start">
|
|
152
147
|
<Icon
|
|
153
148
|
className="block-editor-global-styles__toggle-icon"
|
|
@@ -37,10 +37,15 @@
|
|
|
37
37
|
|
|
38
38
|
// These styles are similar to the color palette.
|
|
39
39
|
.block-editor-global-styles__shadow-indicator {
|
|
40
|
+
appearance: none;
|
|
41
|
+
background: none;
|
|
40
42
|
color: $gray-800;
|
|
41
43
|
border: $gray-200 $border-width solid;
|
|
42
44
|
border-radius: $radius-small;
|
|
43
45
|
cursor: pointer;
|
|
46
|
+
display: inline-flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
|
|
44
49
|
padding: 0;
|
|
45
50
|
|
|
46
51
|
height: $button-size-small + 2 * $border-width;
|