@wordpress/block-editor 14.3.4 → 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 +4 -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 +12 -24
- package/build/components/media-placeholder/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/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/layouts/flex.js +6 -38
- package/build/layouts/flex.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 +2 -0
- package/build/utils/block-bindings.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 +12 -24
- package/build-module/components/media-placeholder/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/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/layouts/flex.js +7 -39
- package/build-module/layouts/flex.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 +2 -0
- package/build-module/utils/block-bindings.js.map +1 -1
- package/build-style/content-rtl.css +14 -56
- package/build-style/content.css +14 -56
- 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/index.js +6 -12
- 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/duotone.js +4 -1
- package/src/hooks/layout-child.js +4 -1
- package/src/hooks/position.js +4 -1
- package/src/layouts/flex.js +10 -53
- 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 +2 -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
package/src/layouts/flex.js
CHANGED
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
arrowDown,
|
|
13
13
|
} from '@wordpress/icons';
|
|
14
14
|
import {
|
|
15
|
-
Button,
|
|
16
15
|
ToggleControl,
|
|
17
16
|
Flex,
|
|
18
17
|
FlexItem,
|
|
@@ -110,7 +109,6 @@ export default {
|
|
|
110
109
|
<FlexLayoutVerticalAlignmentControl
|
|
111
110
|
layout={ layout }
|
|
112
111
|
onChange={ onChange }
|
|
113
|
-
isToolbar
|
|
114
112
|
/>
|
|
115
113
|
) }
|
|
116
114
|
</BlockControls>
|
|
@@ -190,11 +188,7 @@ export default {
|
|
|
190
188
|
},
|
|
191
189
|
};
|
|
192
190
|
|
|
193
|
-
function FlexLayoutVerticalAlignmentControl( {
|
|
194
|
-
layout,
|
|
195
|
-
onChange,
|
|
196
|
-
isToolbar = false,
|
|
197
|
-
} ) {
|
|
191
|
+
function FlexLayoutVerticalAlignmentControl( { layout, onChange } ) {
|
|
198
192
|
const { orientation = 'horizontal' } = layout;
|
|
199
193
|
|
|
200
194
|
const defaultVerticalAlignment =
|
|
@@ -210,54 +204,17 @@ function FlexLayoutVerticalAlignmentControl( {
|
|
|
210
204
|
verticalAlignment: value,
|
|
211
205
|
} );
|
|
212
206
|
};
|
|
213
|
-
if ( isToolbar ) {
|
|
214
|
-
return (
|
|
215
|
-
<BlockVerticalAlignmentControl
|
|
216
|
-
onChange={ onVerticalAlignmentChange }
|
|
217
|
-
value={ verticalAlignment }
|
|
218
|
-
controls={
|
|
219
|
-
orientation === 'horizontal'
|
|
220
|
-
? [ 'top', 'center', 'bottom', 'stretch' ]
|
|
221
|
-
: [ 'top', 'center', 'bottom', 'space-between' ]
|
|
222
|
-
}
|
|
223
|
-
/>
|
|
224
|
-
);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
const verticalAlignmentOptions = [
|
|
228
|
-
{
|
|
229
|
-
value: 'flex-start',
|
|
230
|
-
label: __( 'Align items top' ),
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
value: 'center',
|
|
234
|
-
label: __( 'Align items center' ),
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
value: 'flex-end',
|
|
238
|
-
label: __( 'Align items bottom' ),
|
|
239
|
-
},
|
|
240
|
-
];
|
|
241
207
|
|
|
242
208
|
return (
|
|
243
|
-
<
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
label={ label }
|
|
253
|
-
icon={ icon }
|
|
254
|
-
isPressed={ verticalAlignment === value }
|
|
255
|
-
onClick={ () => onVerticalAlignmentChange( value ) }
|
|
256
|
-
/>
|
|
257
|
-
);
|
|
258
|
-
} ) }
|
|
259
|
-
</div>
|
|
260
|
-
</fieldset>
|
|
209
|
+
<BlockVerticalAlignmentControl
|
|
210
|
+
onChange={ onVerticalAlignmentChange }
|
|
211
|
+
value={ verticalAlignment }
|
|
212
|
+
controls={
|
|
213
|
+
orientation === 'horizontal'
|
|
214
|
+
? [ 'top', 'center', 'bottom', 'stretch' ]
|
|
215
|
+
: [ 'top', 'center', 'bottom', 'space-between' ]
|
|
216
|
+
}
|
|
217
|
+
/>
|
|
261
218
|
);
|
|
262
219
|
}
|
|
263
220
|
|
package/src/store/actions.js
CHANGED
|
@@ -1728,23 +1728,24 @@ export const __unstableSetEditorMode =
|
|
|
1728
1728
|
};
|
|
1729
1729
|
|
|
1730
1730
|
/**
|
|
1731
|
-
*
|
|
1731
|
+
* Set the block moving client ID.
|
|
1732
1732
|
*
|
|
1733
|
-
* @
|
|
1733
|
+
* @deprecated
|
|
1734
|
+
*
|
|
1735
|
+
* @return {Object} Action object.
|
|
1734
1736
|
*/
|
|
1735
|
-
export
|
|
1736
|
-
(
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
speak(
|
|
1742
|
-
__(
|
|
1743
|
-
'Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block.'
|
|
1744
|
-
)
|
|
1745
|
-
);
|
|
1737
|
+
export function setBlockMovingClientId() {
|
|
1738
|
+
deprecated(
|
|
1739
|
+
'wp.data.dispatch( "core/block-editor" ).setBlockMovingClientId',
|
|
1740
|
+
{
|
|
1741
|
+
since: '6.7',
|
|
1742
|
+
hint: 'Block moving mode feature has been removed',
|
|
1746
1743
|
}
|
|
1744
|
+
);
|
|
1745
|
+
return {
|
|
1746
|
+
type: 'DO_NOTHING',
|
|
1747
1747
|
};
|
|
1748
|
+
}
|
|
1748
1749
|
|
|
1749
1750
|
/**
|
|
1750
1751
|
* Action that duplicates a list of blocks.
|
|
@@ -359,6 +359,20 @@ export function expandBlock( clientId ) {
|
|
|
359
359
|
};
|
|
360
360
|
}
|
|
361
361
|
|
|
362
|
+
/**
|
|
363
|
+
* @param {Object} value
|
|
364
|
+
* @param {string} value.rootClientId The root client ID to insert at.
|
|
365
|
+
* @param {number} value.index The index to insert at.
|
|
366
|
+
*
|
|
367
|
+
* @return {Object} Action object.
|
|
368
|
+
*/
|
|
369
|
+
export function setInsertionPoint( value ) {
|
|
370
|
+
return {
|
|
371
|
+
type: 'SET_INSERTION_POINT',
|
|
372
|
+
value,
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
|
|
362
376
|
/**
|
|
363
377
|
* Temporarily modify/unlock the content-only block for editions.
|
|
364
378
|
*
|
|
@@ -15,6 +15,8 @@ import {
|
|
|
15
15
|
getBlockName,
|
|
16
16
|
getTemplateLock,
|
|
17
17
|
getClientIdsWithDescendants,
|
|
18
|
+
isNavigationMode,
|
|
19
|
+
getBlockRootClientId,
|
|
18
20
|
} from './selectors';
|
|
19
21
|
import {
|
|
20
22
|
checkAllowListRecursive,
|
|
@@ -115,6 +117,7 @@ export const getEnabledClientIdsTree = createSelector(
|
|
|
115
117
|
state.settings.templateLock,
|
|
116
118
|
state.blockListSettings,
|
|
117
119
|
state.editorMode,
|
|
120
|
+
getSectionRootClientId( state ),
|
|
118
121
|
]
|
|
119
122
|
);
|
|
120
123
|
|
|
@@ -471,26 +474,57 @@ export function getExpandedBlock( state ) {
|
|
|
471
474
|
* with the provided client ID.
|
|
472
475
|
*
|
|
473
476
|
* @param {Object} state Global application state.
|
|
474
|
-
* @param {
|
|
477
|
+
* @param {string} clientId Client Id of the block.
|
|
475
478
|
*
|
|
476
479
|
* @return {?string} Client ID of the ancestor block that is content locking the block.
|
|
477
480
|
*/
|
|
478
|
-
export const getContentLockingParent =
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
getBlockName( state, current ) === 'core/block' ||
|
|
485
|
-
getTemplateLock( state, current ) === 'contentOnly'
|
|
486
|
-
) {
|
|
487
|
-
result = current;
|
|
488
|
-
}
|
|
481
|
+
export const getContentLockingParent = ( state, clientId ) => {
|
|
482
|
+
let current = clientId;
|
|
483
|
+
let result;
|
|
484
|
+
while ( ! result && ( current = state.blocks.parents.get( current ) ) ) {
|
|
485
|
+
if ( getTemplateLock( state, current ) === 'contentOnly' ) {
|
|
486
|
+
result = current;
|
|
489
487
|
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
488
|
+
}
|
|
489
|
+
return result;
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Retrieves the client ID of the parent section block.
|
|
494
|
+
*
|
|
495
|
+
* @param {Object} state Global application state.
|
|
496
|
+
* @param {string} clientId Client Id of the block.
|
|
497
|
+
*
|
|
498
|
+
* @return {?string} Client ID of the ancestor block that is content locking the block.
|
|
499
|
+
*/
|
|
500
|
+
export const getParentSectionBlock = ( state, clientId ) => {
|
|
501
|
+
let current = clientId;
|
|
502
|
+
let result;
|
|
503
|
+
while ( ! result && ( current = state.blocks.parents.get( current ) ) ) {
|
|
504
|
+
if ( isSectionBlock( state, current ) ) {
|
|
505
|
+
result = current;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
return result;
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Retrieves the client ID is a content locking parent
|
|
513
|
+
*
|
|
514
|
+
* @param {Object} state Global application state.
|
|
515
|
+
* @param {string} clientId Client Id of the block.
|
|
516
|
+
*
|
|
517
|
+
* @return {boolean} Whether the block is a content locking parent.
|
|
518
|
+
*/
|
|
519
|
+
export function isSectionBlock( state, clientId ) {
|
|
520
|
+
const sectionRootClientId = getSectionRootClientId( state );
|
|
521
|
+
const sectionClientIds = getBlockOrder( state, sectionRootClientId );
|
|
522
|
+
return (
|
|
523
|
+
getBlockName( state, clientId ) === 'core/block' ||
|
|
524
|
+
getTemplateLock( state, clientId ) === 'contentOnly' ||
|
|
525
|
+
( isNavigationMode( state ) && sectionClientIds.includes( clientId ) )
|
|
526
|
+
);
|
|
527
|
+
}
|
|
494
528
|
|
|
495
529
|
/**
|
|
496
530
|
* Retrieves the client ID of the block that is content locked but is
|
|
@@ -580,3 +614,73 @@ export function getZoomLevel( state ) {
|
|
|
580
614
|
export function isZoomOut( state ) {
|
|
581
615
|
return getZoomLevel( state ) < 100;
|
|
582
616
|
}
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* Finds the closest block where the block is allowed to be inserted.
|
|
620
|
+
*
|
|
621
|
+
* @param {Object} state Editor state.
|
|
622
|
+
* @param {string[] | string} name Block name or names.
|
|
623
|
+
* @param {string} clientId Default insertion point.
|
|
624
|
+
*
|
|
625
|
+
* @return {string} clientID of the closest container when the block name can be inserted.
|
|
626
|
+
*/
|
|
627
|
+
export function getClosestAllowedInsertionPoint( state, name, clientId = '' ) {
|
|
628
|
+
const blockNames = Array.isArray( name ) ? name : [ name ];
|
|
629
|
+
const areBlockNamesAllowedInClientId = ( id ) =>
|
|
630
|
+
blockNames.every( ( currentName ) =>
|
|
631
|
+
canInsertBlockType( state, currentName, id )
|
|
632
|
+
);
|
|
633
|
+
|
|
634
|
+
// If we're trying to insert at the root level and it's not allowed
|
|
635
|
+
// Try the section root instead.
|
|
636
|
+
if ( ! clientId ) {
|
|
637
|
+
if ( areBlockNamesAllowedInClientId( clientId ) ) {
|
|
638
|
+
return clientId;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
const sectionRootClientId = getSectionRootClientId( state );
|
|
642
|
+
if (
|
|
643
|
+
sectionRootClientId &&
|
|
644
|
+
areBlockNamesAllowedInClientId( sectionRootClientId )
|
|
645
|
+
) {
|
|
646
|
+
return sectionRootClientId;
|
|
647
|
+
}
|
|
648
|
+
return null;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
// Traverse the block tree up until we find a place where we can insert.
|
|
652
|
+
let current = clientId;
|
|
653
|
+
while ( current !== null && ! areBlockNamesAllowedInClientId( current ) ) {
|
|
654
|
+
const parentClientId = getBlockRootClientId( state, current );
|
|
655
|
+
current = parentClientId;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
return current;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
export function getClosestAllowedInsertionPointForPattern(
|
|
662
|
+
state,
|
|
663
|
+
pattern,
|
|
664
|
+
clientId
|
|
665
|
+
) {
|
|
666
|
+
const { allowedBlockTypes } = getSettings( state );
|
|
667
|
+
const isAllowed = checkAllowListRecursive(
|
|
668
|
+
getGrammar( pattern ),
|
|
669
|
+
allowedBlockTypes
|
|
670
|
+
);
|
|
671
|
+
if ( ! isAllowed ) {
|
|
672
|
+
return null;
|
|
673
|
+
}
|
|
674
|
+
const names = getGrammar( pattern ).map( ( { blockName: name } ) => name );
|
|
675
|
+
return getClosestAllowedInsertionPoint( state, names, clientId );
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* Where the point where the next block will be inserted into.
|
|
680
|
+
*
|
|
681
|
+
* @param {Object} state
|
|
682
|
+
* @return {Object} where the insertion point in the block editor is or null if none is set.
|
|
683
|
+
*/
|
|
684
|
+
export function getInsertionPoint( state ) {
|
|
685
|
+
return state.insertionPoint;
|
|
686
|
+
}
|
package/src/store/reducer.js
CHANGED
|
@@ -1601,7 +1601,7 @@ export function blocksMode( state = {}, action ) {
|
|
|
1601
1601
|
*
|
|
1602
1602
|
* @return {Object} Updated state.
|
|
1603
1603
|
*/
|
|
1604
|
-
export function
|
|
1604
|
+
export function insertionCue( state = null, action ) {
|
|
1605
1605
|
switch ( action.type ) {
|
|
1606
1606
|
case 'SHOW_INSERTION_POINT': {
|
|
1607
1607
|
const {
|
|
@@ -1795,11 +1795,6 @@ export const blockListSettings = ( state = {}, action ) => {
|
|
|
1795
1795
|
* @return {string} Updated state.
|
|
1796
1796
|
*/
|
|
1797
1797
|
export function editorMode( state = 'edit', action ) {
|
|
1798
|
-
// Let inserting block in navigation mode always trigger Edit mode.
|
|
1799
|
-
if ( action.type === 'INSERT_BLOCKS' && state === 'navigation' ) {
|
|
1800
|
-
return 'edit';
|
|
1801
|
-
}
|
|
1802
|
-
|
|
1803
1798
|
if ( action.type === 'SET_EDITOR_MODE' ) {
|
|
1804
1799
|
return action.mode;
|
|
1805
1800
|
}
|
|
@@ -1807,26 +1802,6 @@ export function editorMode( state = 'edit', action ) {
|
|
|
1807
1802
|
return state;
|
|
1808
1803
|
}
|
|
1809
1804
|
|
|
1810
|
-
/**
|
|
1811
|
-
* Reducer returning whether the block moving mode is enabled or not.
|
|
1812
|
-
*
|
|
1813
|
-
* @param {string|null} state Current state.
|
|
1814
|
-
* @param {Object} action Dispatched action.
|
|
1815
|
-
*
|
|
1816
|
-
* @return {string|null} Updated state.
|
|
1817
|
-
*/
|
|
1818
|
-
export function hasBlockMovingClientId( state = null, action ) {
|
|
1819
|
-
if ( action.type === 'SET_BLOCK_MOVING_MODE' ) {
|
|
1820
|
-
return action.hasBlockMovingClientId;
|
|
1821
|
-
}
|
|
1822
|
-
|
|
1823
|
-
if ( action.type === 'SET_EDITOR_MODE' ) {
|
|
1824
|
-
return null;
|
|
1825
|
-
}
|
|
1826
|
-
|
|
1827
|
-
return state;
|
|
1828
|
-
}
|
|
1829
|
-
|
|
1830
1805
|
/**
|
|
1831
1806
|
* Reducer return an updated state representing the most recent block attribute
|
|
1832
1807
|
* update. The state is structured as an object where the keys represent the
|
|
@@ -2091,7 +2066,7 @@ export function hoveredBlockClientId( state = false, action ) {
|
|
|
2091
2066
|
* @param {boolean} state Current state.
|
|
2092
2067
|
* @param {Object} action Dispatched action.
|
|
2093
2068
|
*
|
|
2094
|
-
* @return {
|
|
2069
|
+
* @return {number} Updated state.
|
|
2095
2070
|
*/
|
|
2096
2071
|
export function zoomLevel( state = 100, action ) {
|
|
2097
2072
|
switch ( action.type ) {
|
|
@@ -2104,6 +2079,25 @@ export function zoomLevel( state = 100, action ) {
|
|
|
2104
2079
|
return state;
|
|
2105
2080
|
}
|
|
2106
2081
|
|
|
2082
|
+
/**
|
|
2083
|
+
* Reducer setting the insertion point
|
|
2084
|
+
*
|
|
2085
|
+
* @param {boolean} state Current state.
|
|
2086
|
+
* @param {Object} action Dispatched action.
|
|
2087
|
+
*
|
|
2088
|
+
* @return {Object} Updated state.
|
|
2089
|
+
*/
|
|
2090
|
+
export function insertionPoint( state = null, action ) {
|
|
2091
|
+
switch ( action.type ) {
|
|
2092
|
+
case 'SET_INSERTION_POINT':
|
|
2093
|
+
return action.value;
|
|
2094
|
+
case 'SELECT_BLOCK':
|
|
2095
|
+
return null;
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
return state;
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2107
2101
|
const combinedReducers = combineReducers( {
|
|
2108
2102
|
blocks,
|
|
2109
2103
|
isDragging,
|
|
@@ -2117,13 +2111,13 @@ const combinedReducers = combineReducers( {
|
|
|
2117
2111
|
blocksMode,
|
|
2118
2112
|
blockListSettings,
|
|
2119
2113
|
insertionPoint,
|
|
2114
|
+
insertionCue,
|
|
2120
2115
|
template,
|
|
2121
2116
|
settings,
|
|
2122
2117
|
preferences,
|
|
2123
2118
|
lastBlockAttributesChange,
|
|
2124
2119
|
lastFocus,
|
|
2125
2120
|
editorMode,
|
|
2126
|
-
hasBlockMovingClientId,
|
|
2127
2121
|
expandedBlock,
|
|
2128
2122
|
highlightedBlock,
|
|
2129
2123
|
lastBlockInserted,
|