@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
|
@@ -195,14 +195,11 @@ export function useInnerBlocksProps( props = {}, options = {} ) {
|
|
|
195
195
|
( select ) => {
|
|
196
196
|
const {
|
|
197
197
|
getBlockName,
|
|
198
|
-
isBlockSelected,
|
|
199
|
-
hasSelectedInnerBlock,
|
|
200
198
|
__unstableGetEditorMode,
|
|
201
199
|
getTemplateLock,
|
|
202
200
|
getBlockRootClientId,
|
|
203
201
|
getBlockEditingMode,
|
|
204
202
|
getBlockSettings,
|
|
205
|
-
isDragging,
|
|
206
203
|
getSectionRootClientId,
|
|
207
204
|
} = unlock( select( blockEditorStore ) );
|
|
208
205
|
let _isDropZoneDisabled;
|
|
@@ -213,8 +210,6 @@ export function useInnerBlocksProps( props = {}, options = {} ) {
|
|
|
213
210
|
|
|
214
211
|
const { hasBlockSupport, getBlockType } = select( blocksStore );
|
|
215
212
|
const blockName = getBlockName( clientId );
|
|
216
|
-
const enableClickThrough =
|
|
217
|
-
__unstableGetEditorMode() === 'navigation';
|
|
218
213
|
const blockEditingMode = getBlockEditingMode( clientId );
|
|
219
214
|
const parentClientId = getBlockRootClientId( clientId );
|
|
220
215
|
const [ defaultLayout ] = getBlockSettings( clientId, 'layout' );
|
|
@@ -236,12 +231,6 @@ export function useInnerBlocksProps( props = {}, options = {} ) {
|
|
|
236
231
|
'__experimentalExposeControlsToChildren',
|
|
237
232
|
false
|
|
238
233
|
),
|
|
239
|
-
hasOverlay:
|
|
240
|
-
blockName !== 'core/template' &&
|
|
241
|
-
! isBlockSelected( clientId ) &&
|
|
242
|
-
! hasSelectedInnerBlock( clientId, true ) &&
|
|
243
|
-
enableClickThrough &&
|
|
244
|
-
! isDragging(),
|
|
245
234
|
name: blockName,
|
|
246
235
|
blockType: getBlockType( blockName ),
|
|
247
236
|
parentLock: getTemplateLock( parentClientId ),
|
|
@@ -254,7 +243,6 @@ export function useInnerBlocksProps( props = {}, options = {} ) {
|
|
|
254
243
|
);
|
|
255
244
|
const {
|
|
256
245
|
__experimentalCaptureToolbars,
|
|
257
|
-
hasOverlay,
|
|
258
246
|
name,
|
|
259
247
|
blockType,
|
|
260
248
|
parentLock,
|
|
@@ -299,10 +287,7 @@ export function useInnerBlocksProps( props = {}, options = {} ) {
|
|
|
299
287
|
className: clsx(
|
|
300
288
|
props.className,
|
|
301
289
|
'block-editor-block-list__layout',
|
|
302
|
-
__unstableDisableLayoutClassNames ? '' : layoutClassNames
|
|
303
|
-
{
|
|
304
|
-
'has-overlay': hasOverlay,
|
|
305
|
-
}
|
|
290
|
+
__unstableDisableLayoutClassNames ? '' : layoutClassNames
|
|
306
291
|
),
|
|
307
292
|
children: clientId ? (
|
|
308
293
|
<InnerBlocks { ...innerBlocksProps } clientId={ clientId } />
|
|
@@ -186,7 +186,7 @@ export function BlockTypesTab(
|
|
|
186
186
|
continue;
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
if ( rootClientId && item.
|
|
189
|
+
if ( rootClientId && item.isAllowedInCurrentRoot ) {
|
|
190
190
|
itemsForCurrentRoot.push( item );
|
|
191
191
|
} else {
|
|
192
192
|
itemsRemaining.push( item );
|
|
@@ -2,19 +2,23 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
|
+
getBlockType,
|
|
5
6
|
createBlock,
|
|
6
7
|
createBlocksFromInnerBlocksTemplate,
|
|
7
8
|
store as blocksStore,
|
|
8
9
|
parse,
|
|
9
10
|
} from '@wordpress/blocks';
|
|
10
|
-
import { useSelect } from '@wordpress/data';
|
|
11
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
11
12
|
import { useCallback, useMemo } from '@wordpress/element';
|
|
13
|
+
import { store as noticesStore } from '@wordpress/notices';
|
|
14
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
12
15
|
|
|
13
16
|
/**
|
|
14
17
|
* Internal dependencies
|
|
15
18
|
*/
|
|
16
19
|
import { store as blockEditorStore } from '../../../store';
|
|
17
|
-
import {
|
|
20
|
+
import { isFiltered } from '../../../store/utils';
|
|
21
|
+
import { unlock } from '../../../lock-unlock';
|
|
18
22
|
|
|
19
23
|
/**
|
|
20
24
|
* Retrieves the block types inserter state.
|
|
@@ -26,7 +30,7 @@ import { withRootClientIdOptionKey } from '../../../store/utils';
|
|
|
26
30
|
*/
|
|
27
31
|
const useBlockTypesState = ( rootClientId, onInsert, isQuick ) => {
|
|
28
32
|
const options = useMemo(
|
|
29
|
-
() => ( { [
|
|
33
|
+
() => ( { [ isFiltered ]: !! isQuick } ),
|
|
30
34
|
[ isQuick ]
|
|
31
35
|
);
|
|
32
36
|
const [ items ] = useSelect(
|
|
@@ -38,6 +42,10 @@ const useBlockTypesState = ( rootClientId, onInsert, isQuick ) => {
|
|
|
38
42
|
],
|
|
39
43
|
[ rootClientId, options ]
|
|
40
44
|
);
|
|
45
|
+
const { getClosestAllowedInsertionPoint } = unlock(
|
|
46
|
+
useSelect( blockEditorStore )
|
|
47
|
+
);
|
|
48
|
+
const { createErrorNotice } = useDispatch( noticesStore );
|
|
41
49
|
|
|
42
50
|
const [ categories, collections ] = useSelect( ( select ) => {
|
|
43
51
|
const { getCategories, getCollections } = select( blocksStore );
|
|
@@ -46,16 +54,29 @@ const useBlockTypesState = ( rootClientId, onInsert, isQuick ) => {
|
|
|
46
54
|
|
|
47
55
|
const onSelectItem = useCallback(
|
|
48
56
|
(
|
|
49
|
-
{
|
|
50
|
-
name,
|
|
51
|
-
initialAttributes,
|
|
52
|
-
innerBlocks,
|
|
53
|
-
syncStatus,
|
|
54
|
-
content,
|
|
55
|
-
rootClientId: _rootClientId,
|
|
56
|
-
},
|
|
57
|
+
{ name, initialAttributes, innerBlocks, syncStatus, content },
|
|
57
58
|
shouldFocusBlock
|
|
58
59
|
) => {
|
|
60
|
+
const destinationClientId = getClosestAllowedInsertionPoint(
|
|
61
|
+
name,
|
|
62
|
+
rootClientId
|
|
63
|
+
);
|
|
64
|
+
if ( destinationClientId === null ) {
|
|
65
|
+
const title = getBlockType( name )?.title ?? name;
|
|
66
|
+
createErrorNotice(
|
|
67
|
+
sprintf(
|
|
68
|
+
/* translators: %s: block pattern title. */
|
|
69
|
+
__( 'Block "%s" can\'t be inserted.' ),
|
|
70
|
+
title
|
|
71
|
+
),
|
|
72
|
+
{
|
|
73
|
+
type: 'snackbar',
|
|
74
|
+
id: 'inserter-notice',
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
|
|
59
80
|
const insertedBlock =
|
|
60
81
|
syncStatus === 'unsynced'
|
|
61
82
|
? parse( content, {
|
|
@@ -66,15 +87,14 @@ const useBlockTypesState = ( rootClientId, onInsert, isQuick ) => {
|
|
|
66
87
|
initialAttributes,
|
|
67
88
|
createBlocksFromInnerBlocksTemplate( innerBlocks )
|
|
68
89
|
);
|
|
69
|
-
|
|
70
90
|
onInsert(
|
|
71
91
|
insertedBlock,
|
|
72
92
|
undefined,
|
|
73
93
|
shouldFocusBlock,
|
|
74
|
-
|
|
94
|
+
destinationClientId
|
|
75
95
|
);
|
|
76
96
|
},
|
|
77
|
-
[ onInsert ]
|
|
97
|
+
[ onInsert, getClosestAllowedInsertionPoint, rootClientId ]
|
|
78
98
|
);
|
|
79
99
|
|
|
80
100
|
return [ items, categories, collections, onSelectItem ];
|
|
@@ -71,7 +71,11 @@ function useInsertionPoint( {
|
|
|
71
71
|
selectBlockOnInsert = true,
|
|
72
72
|
} ) {
|
|
73
73
|
const registry = useRegistry();
|
|
74
|
-
const {
|
|
74
|
+
const {
|
|
75
|
+
getSelectedBlock,
|
|
76
|
+
getClosestAllowedInsertionPoint,
|
|
77
|
+
isBlockInsertionPointVisible,
|
|
78
|
+
} = unlock( useSelect( blockEditorStore ) );
|
|
75
79
|
const { destinationRootClientId, destinationIndex } = useSelect(
|
|
76
80
|
( select ) => {
|
|
77
81
|
const {
|
|
@@ -79,15 +83,24 @@ function useInsertionPoint( {
|
|
|
79
83
|
getBlockRootClientId,
|
|
80
84
|
getBlockIndex,
|
|
81
85
|
getBlockOrder,
|
|
82
|
-
|
|
86
|
+
getInsertionPoint,
|
|
87
|
+
} = unlock( select( blockEditorStore ) );
|
|
83
88
|
const selectedBlockClientId = getSelectedBlockClientId();
|
|
84
|
-
|
|
85
89
|
let _destinationRootClientId = rootClientId;
|
|
86
90
|
let _destinationIndex;
|
|
91
|
+
const insertionPoint = getInsertionPoint();
|
|
87
92
|
|
|
88
93
|
if ( insertionIndex !== undefined ) {
|
|
89
94
|
// Insert into a specific index.
|
|
90
95
|
_destinationIndex = insertionIndex;
|
|
96
|
+
} else if (
|
|
97
|
+
insertionPoint &&
|
|
98
|
+
insertionPoint.hasOwnProperty( 'index' )
|
|
99
|
+
) {
|
|
100
|
+
_destinationRootClientId = insertionPoint?.rootClientId
|
|
101
|
+
? insertionPoint.rootClientId
|
|
102
|
+
: rootClientId;
|
|
103
|
+
_destinationIndex = insertionPoint.index;
|
|
91
104
|
} else if ( clientId ) {
|
|
92
105
|
// Insert after a specific client ID.
|
|
93
106
|
_destinationIndex = getBlockIndex( clientId );
|
|
@@ -193,21 +206,30 @@ function useInsertionPoint( {
|
|
|
193
206
|
|
|
194
207
|
const onToggleInsertionPoint = useCallback(
|
|
195
208
|
( item ) => {
|
|
196
|
-
if ( item
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
destinationRootClientId
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
209
|
+
if ( item && ! isBlockInsertionPointVisible() ) {
|
|
210
|
+
const allowedDestinationRootClientId =
|
|
211
|
+
getClosestAllowedInsertionPoint(
|
|
212
|
+
item.name,
|
|
213
|
+
destinationRootClientId
|
|
214
|
+
);
|
|
215
|
+
if ( allowedDestinationRootClientId !== null ) {
|
|
216
|
+
showInsertionPoint(
|
|
217
|
+
allowedDestinationRootClientId,
|
|
218
|
+
getIndex( {
|
|
219
|
+
destinationRootClientId,
|
|
220
|
+
destinationIndex,
|
|
221
|
+
rootClientId: allowedDestinationRootClientId,
|
|
222
|
+
registry,
|
|
223
|
+
} )
|
|
224
|
+
);
|
|
225
|
+
}
|
|
206
226
|
} else {
|
|
207
227
|
hideInsertionPoint();
|
|
208
228
|
}
|
|
209
229
|
},
|
|
210
230
|
[
|
|
231
|
+
getClosestAllowedInsertionPoint,
|
|
232
|
+
isBlockInsertionPointVisible,
|
|
211
233
|
showInsertionPoint,
|
|
212
234
|
hideInsertionPoint,
|
|
213
235
|
destinationRootClientId,
|
|
@@ -11,33 +11,52 @@ import { store as noticesStore } from '@wordpress/notices';
|
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
13
|
import { store as blockEditorStore } from '../../../store';
|
|
14
|
+
import { unlock } from '../../../lock-unlock';
|
|
14
15
|
import { INSERTER_PATTERN_TYPES } from '../block-patterns-tab/utils';
|
|
16
|
+
import { isFiltered } from '../../../store/utils';
|
|
15
17
|
|
|
16
18
|
/**
|
|
17
19
|
* Retrieves the block patterns inserter state.
|
|
18
20
|
*
|
|
19
21
|
* @param {Function} onInsert function called when inserter a list of blocks.
|
|
20
22
|
* @param {string=} rootClientId Insertion's root client ID.
|
|
21
|
-
*
|
|
22
23
|
* @param {string} selectedCategory The selected pattern category.
|
|
24
|
+
* @param {boolean} isQuick For the quick inserter render only allowed patterns.
|
|
25
|
+
*
|
|
23
26
|
* @return {Array} Returns the patterns state. (patterns, categories, onSelect handler)
|
|
24
27
|
*/
|
|
25
|
-
const usePatternsState = (
|
|
28
|
+
const usePatternsState = (
|
|
29
|
+
onInsert,
|
|
30
|
+
rootClientId,
|
|
31
|
+
selectedCategory,
|
|
32
|
+
isQuick
|
|
33
|
+
) => {
|
|
34
|
+
const options = useMemo(
|
|
35
|
+
() => ( { [ isFiltered ]: !! isQuick } ),
|
|
36
|
+
[ isQuick ]
|
|
37
|
+
);
|
|
26
38
|
const { patternCategories, patterns, userPatternCategories } = useSelect(
|
|
27
39
|
( select ) => {
|
|
28
|
-
const {
|
|
29
|
-
select( blockEditorStore )
|
|
40
|
+
const { getSettings, __experimentalGetAllowedPatterns } = unlock(
|
|
41
|
+
select( blockEditorStore )
|
|
42
|
+
);
|
|
30
43
|
const {
|
|
31
44
|
__experimentalUserPatternCategories,
|
|
32
45
|
__experimentalBlockPatternCategories,
|
|
33
46
|
} = getSettings();
|
|
34
47
|
return {
|
|
35
|
-
patterns: __experimentalGetAllowedPatterns(
|
|
48
|
+
patterns: __experimentalGetAllowedPatterns(
|
|
49
|
+
rootClientId,
|
|
50
|
+
options
|
|
51
|
+
),
|
|
36
52
|
userPatternCategories: __experimentalUserPatternCategories,
|
|
37
53
|
patternCategories: __experimentalBlockPatternCategories,
|
|
38
54
|
};
|
|
39
55
|
},
|
|
40
|
-
[ rootClientId ]
|
|
56
|
+
[ rootClientId, options ]
|
|
57
|
+
);
|
|
58
|
+
const { getClosestAllowedInsertionPointForPattern } = unlock(
|
|
59
|
+
useSelect( blockEditorStore )
|
|
41
60
|
);
|
|
42
61
|
|
|
43
62
|
const allCategories = useMemo( () => {
|
|
@@ -58,6 +77,15 @@ const usePatternsState = ( onInsert, rootClientId, selectedCategory ) => {
|
|
|
58
77
|
const { createSuccessNotice } = useDispatch( noticesStore );
|
|
59
78
|
const onClickPattern = useCallback(
|
|
60
79
|
( pattern, blocks ) => {
|
|
80
|
+
const destinationRootClientId = isQuick
|
|
81
|
+
? rootClientId
|
|
82
|
+
: getClosestAllowedInsertionPointForPattern(
|
|
83
|
+
pattern,
|
|
84
|
+
rootClientId
|
|
85
|
+
);
|
|
86
|
+
if ( destinationRootClientId === null ) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
61
89
|
const patternBlocks =
|
|
62
90
|
pattern.type === INSERTER_PATTERN_TYPES.user &&
|
|
63
91
|
pattern.syncStatus !== 'unsynced'
|
|
@@ -77,7 +105,9 @@ const usePatternsState = ( onInsert, rootClientId, selectedCategory ) => {
|
|
|
77
105
|
}
|
|
78
106
|
return clonedBlock;
|
|
79
107
|
} ),
|
|
80
|
-
pattern.name
|
|
108
|
+
pattern.name,
|
|
109
|
+
false,
|
|
110
|
+
destinationRootClientId
|
|
81
111
|
);
|
|
82
112
|
createSuccessNotice(
|
|
83
113
|
sprintf(
|
|
@@ -87,11 +117,18 @@ const usePatternsState = ( onInsert, rootClientId, selectedCategory ) => {
|
|
|
87
117
|
),
|
|
88
118
|
{
|
|
89
119
|
type: 'snackbar',
|
|
90
|
-
id: '
|
|
120
|
+
id: 'inserter-notice',
|
|
91
121
|
}
|
|
92
122
|
);
|
|
93
123
|
},
|
|
94
|
-
[
|
|
124
|
+
[
|
|
125
|
+
createSuccessNotice,
|
|
126
|
+
onInsert,
|
|
127
|
+
selectedCategory,
|
|
128
|
+
rootClientId,
|
|
129
|
+
getClosestAllowedInsertionPointForPattern,
|
|
130
|
+
isQuick,
|
|
131
|
+
]
|
|
95
132
|
);
|
|
96
133
|
|
|
97
134
|
return [ patterns, allCategories, onClickPattern ];
|
|
@@ -26,6 +26,7 @@ import { moreVertical, external } from '@wordpress/icons';
|
|
|
26
26
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
27
27
|
import { store as noticesStore } from '@wordpress/notices';
|
|
28
28
|
import { isBlobURL } from '@wordpress/blob';
|
|
29
|
+
import { getFilename } from '@wordpress/url';
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
32
|
* Internal dependencies
|
|
@@ -132,7 +133,8 @@ export function MediaPreview( { media, onClick, category } ) {
|
|
|
132
133
|
);
|
|
133
134
|
const { createErrorNotice, createSuccessNotice } =
|
|
134
135
|
useDispatch( noticesStore );
|
|
135
|
-
const { getSettings } = useSelect( blockEditorStore );
|
|
136
|
+
const { getSettings, getBlock } = useSelect( blockEditorStore );
|
|
137
|
+
const { updateBlockAttributes } = useDispatch( blockEditorStore );
|
|
136
138
|
|
|
137
139
|
const onMediaInsert = useCallback(
|
|
138
140
|
( previewBlock ) => {
|
|
@@ -167,30 +169,51 @@ export function MediaPreview( { media, onClick, category } ) {
|
|
|
167
169
|
.fetch( url )
|
|
168
170
|
.then( ( response ) => response.blob() )
|
|
169
171
|
.then( ( blob ) => {
|
|
172
|
+
const fileName = getFilename( url ) || 'image.jpg';
|
|
173
|
+
const file = new File( [ blob ], fileName, {
|
|
174
|
+
type: blob.type,
|
|
175
|
+
} );
|
|
176
|
+
|
|
170
177
|
settings.mediaUpload( {
|
|
171
|
-
filesList: [
|
|
178
|
+
filesList: [ file ],
|
|
172
179
|
additionalData: { caption },
|
|
173
180
|
onFileChange( [ img ] ) {
|
|
174
181
|
if ( isBlobURL( img.url ) ) {
|
|
175
182
|
return;
|
|
176
183
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
184
|
+
|
|
185
|
+
if ( ! getBlock( clonedBlock.clientId ) ) {
|
|
186
|
+
// Ensure the block is only inserted once.
|
|
187
|
+
onClick( {
|
|
188
|
+
...clonedBlock,
|
|
189
|
+
attributes: {
|
|
190
|
+
...clonedBlock.attributes,
|
|
191
|
+
id: img.id,
|
|
192
|
+
url: img.url,
|
|
193
|
+
},
|
|
194
|
+
} );
|
|
195
|
+
|
|
196
|
+
createSuccessNotice(
|
|
197
|
+
__( 'Image uploaded and inserted.' ),
|
|
198
|
+
{ type: 'snackbar', id: 'inserter-notice' }
|
|
199
|
+
);
|
|
200
|
+
} else {
|
|
201
|
+
// For subsequent calls, update the existing block.
|
|
202
|
+
updateBlockAttributes( clonedBlock.clientId, {
|
|
180
203
|
...clonedBlock.attributes,
|
|
181
204
|
id: img.id,
|
|
182
205
|
url: img.url,
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
__( 'Image uploaded and inserted.' ),
|
|
187
|
-
{ type: 'snackbar' }
|
|
188
|
-
);
|
|
206
|
+
} );
|
|
207
|
+
}
|
|
208
|
+
|
|
189
209
|
setIsInserting( false );
|
|
190
210
|
},
|
|
191
211
|
allowedTypes: ALLOWED_MEDIA_TYPES,
|
|
192
212
|
onError( message ) {
|
|
193
|
-
createErrorNotice( message, {
|
|
213
|
+
createErrorNotice( message, {
|
|
214
|
+
type: 'snackbar',
|
|
215
|
+
id: 'inserter-notice',
|
|
216
|
+
} );
|
|
194
217
|
setIsInserting( false );
|
|
195
218
|
},
|
|
196
219
|
} );
|
|
@@ -205,7 +228,9 @@ export function MediaPreview( { media, onClick, category } ) {
|
|
|
205
228
|
getSettings,
|
|
206
229
|
onClick,
|
|
207
230
|
createSuccessNotice,
|
|
231
|
+
updateBlockAttributes,
|
|
208
232
|
createErrorNotice,
|
|
233
|
+
getBlock,
|
|
209
234
|
]
|
|
210
235
|
);
|
|
211
236
|
|
|
@@ -281,6 +306,7 @@ export function MediaPreview( { media, onClick, category } ) {
|
|
|
281
306
|
onClick( cloneBlock( block ) );
|
|
282
307
|
createSuccessNotice( __( 'Image inserted.' ), {
|
|
283
308
|
type: 'snackbar',
|
|
309
|
+
id: 'inserter-notice',
|
|
284
310
|
} );
|
|
285
311
|
setShowExternalUploadModal( false );
|
|
286
312
|
} }
|
|
@@ -114,9 +114,9 @@ function InserterMenu(
|
|
|
114
114
|
);
|
|
115
115
|
|
|
116
116
|
const onInsertPattern = useCallback(
|
|
117
|
-
( blocks, patternName ) => {
|
|
117
|
+
( blocks, patternName, ...args ) => {
|
|
118
118
|
onToggleInsertionPoint( false );
|
|
119
|
-
onInsertBlocks( blocks, { patternName } );
|
|
119
|
+
onInsertBlocks( blocks, { patternName }, ...args );
|
|
120
120
|
onSelect();
|
|
121
121
|
},
|
|
122
122
|
[ onInsertBlocks, onSelect ]
|
|
@@ -10,10 +10,7 @@ import {
|
|
|
10
10
|
__experimentalSpacer as Spacer,
|
|
11
11
|
__experimentalHeading as Heading,
|
|
12
12
|
__experimentalView as View,
|
|
13
|
-
|
|
14
|
-
__experimentalNavigatorScreen as NavigatorScreen,
|
|
15
|
-
__experimentalNavigatorButton as NavigatorButton,
|
|
16
|
-
__experimentalNavigatorBackButton as NavigatorBackButton,
|
|
13
|
+
Navigator,
|
|
17
14
|
FlexBlock,
|
|
18
15
|
} from '@wordpress/components';
|
|
19
16
|
import { Icon, chevronRight, chevronLeft } from '@wordpress/icons';
|
|
@@ -24,7 +21,7 @@ function ScreenHeader( { title } ) {
|
|
|
24
21
|
<View>
|
|
25
22
|
<Spacer marginBottom={ 0 } paddingX={ 4 } paddingY={ 3 }>
|
|
26
23
|
<HStack spacing={ 2 }>
|
|
27
|
-
<
|
|
24
|
+
<Navigator.BackButton
|
|
28
25
|
style={
|
|
29
26
|
// TODO: This style override is also used in ToolsPanelHeader.
|
|
30
27
|
// It should be supported out-of-the-box by Button.
|
|
@@ -46,14 +43,14 @@ function ScreenHeader( { title } ) {
|
|
|
46
43
|
|
|
47
44
|
export default function MobileTabNavigation( { categories, children } ) {
|
|
48
45
|
return (
|
|
49
|
-
<
|
|
46
|
+
<Navigator
|
|
50
47
|
initialPath="/"
|
|
51
48
|
className="block-editor-inserter__mobile-tab-navigation"
|
|
52
49
|
>
|
|
53
|
-
<
|
|
50
|
+
<Navigator.Screen path="/">
|
|
54
51
|
<ItemGroup>
|
|
55
52
|
{ categories.map( ( category ) => (
|
|
56
|
-
<
|
|
53
|
+
<Navigator.Button
|
|
57
54
|
key={ category.name }
|
|
58
55
|
path={ `/category/${ category.name }` }
|
|
59
56
|
as={ Item }
|
|
@@ -67,19 +64,19 @@ export default function MobileTabNavigation( { categories, children } ) {
|
|
|
67
64
|
}
|
|
68
65
|
/>
|
|
69
66
|
</HStack>
|
|
70
|
-
</
|
|
67
|
+
</Navigator.Button>
|
|
71
68
|
) ) }
|
|
72
69
|
</ItemGroup>
|
|
73
|
-
</
|
|
70
|
+
</Navigator.Screen>
|
|
74
71
|
{ categories.map( ( category ) => (
|
|
75
|
-
<
|
|
72
|
+
<Navigator.Screen
|
|
76
73
|
key={ category.name }
|
|
77
74
|
path={ `/category/${ category.name }` }
|
|
78
75
|
>
|
|
79
76
|
<ScreenHeader title={ __( 'Back' ) } />
|
|
80
77
|
{ children( category ) }
|
|
81
|
-
</
|
|
78
|
+
</Navigator.Screen>
|
|
82
79
|
) ) }
|
|
83
|
-
</
|
|
80
|
+
</Navigator>
|
|
84
81
|
);
|
|
85
82
|
}
|
|
@@ -47,10 +47,11 @@ export default function QuickInserter( {
|
|
|
47
47
|
onInsertBlocks,
|
|
48
48
|
true
|
|
49
49
|
);
|
|
50
|
-
|
|
51
50
|
const [ patterns ] = usePatternsState(
|
|
52
51
|
onInsertBlocks,
|
|
53
|
-
destinationRootClientId
|
|
52
|
+
destinationRootClientId,
|
|
53
|
+
undefined,
|
|
54
|
+
true
|
|
54
55
|
);
|
|
55
56
|
|
|
56
57
|
const { setInserterIsOpened, insertionIndex } = useSelect(
|
|
@@ -86,10 +87,10 @@ export default function QuickInserter( {
|
|
|
86
87
|
// the insertion point can work as expected.
|
|
87
88
|
const onBrowseAll = () => {
|
|
88
89
|
setInserterIsOpened( {
|
|
89
|
-
rootClientId,
|
|
90
|
-
insertionIndex,
|
|
91
90
|
filterValue,
|
|
92
91
|
onSelect,
|
|
92
|
+
rootClientId,
|
|
93
|
+
insertionIndex,
|
|
93
94
|
} );
|
|
94
95
|
};
|
|
95
96
|
|
|
@@ -257,39 +257,11 @@ $block-inserter-tabs-height: 44px;
|
|
|
257
257
|
svg {
|
|
258
258
|
fill: var(--wp-admin-theme-color);
|
|
259
259
|
}
|
|
260
|
-
|
|
261
|
-
&::after {
|
|
262
|
-
content: "";
|
|
263
|
-
display: block;
|
|
264
|
-
outline: none;
|
|
265
|
-
position: absolute;
|
|
266
|
-
top: 0;
|
|
267
|
-
bottom: 0;
|
|
268
|
-
left: 0;
|
|
269
|
-
right: 0;
|
|
270
|
-
border-radius: $radius-small;
|
|
271
|
-
opacity: 0.04;
|
|
272
|
-
background: var(--wp-admin-theme-color);
|
|
273
|
-
height: 100%;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
&:focus-visible,
|
|
278
|
-
&:focus:not(:disabled) {
|
|
279
|
-
border-radius: $radius-small;
|
|
280
|
-
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
281
|
-
// Windows high contrast mode.
|
|
282
|
-
outline: 2px solid transparent;
|
|
283
|
-
outline-offset: 0;
|
|
284
260
|
}
|
|
285
261
|
|
|
286
262
|
&::before {
|
|
287
263
|
display: none;
|
|
288
264
|
}
|
|
289
|
-
|
|
290
|
-
&::after {
|
|
291
|
-
display: none;
|
|
292
|
-
}
|
|
293
265
|
}
|
|
294
266
|
}
|
|
295
267
|
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
Icon,
|
|
6
|
+
Tooltip,
|
|
6
7
|
privateApis as componentsPrivateApis,
|
|
7
8
|
} from '@wordpress/components';
|
|
8
9
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
@@ -43,27 +44,27 @@ export default function InspectorControlsTabs( {
|
|
|
43
44
|
<div className="block-editor-block-inspector__tabs">
|
|
44
45
|
<Tabs defaultTabId={ initialTabName } key={ clientId }>
|
|
45
46
|
<Tabs.TabList>
|
|
46
|
-
{ tabs.map( ( tab ) =>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
47
|
+
{ tabs.map( ( tab ) =>
|
|
48
|
+
showIconLabels ? (
|
|
49
|
+
<Tabs.Tab
|
|
50
|
+
key={ tab.name }
|
|
51
|
+
tabId={ tab.name }
|
|
52
|
+
className={ tab.className }
|
|
53
|
+
>
|
|
54
|
+
{ tab.title }
|
|
55
|
+
</Tabs.Tab>
|
|
56
|
+
) : (
|
|
57
|
+
<Tooltip text={ tab.title } key={ tab.name }>
|
|
58
|
+
<Tabs.Tab
|
|
59
|
+
tabId={ tab.name }
|
|
60
60
|
className={ tab.className }
|
|
61
|
+
aria-label={ tab.title }
|
|
61
62
|
>
|
|
62
|
-
{
|
|
63
|
-
</
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
)
|
|
63
|
+
<Icon icon={ tab.icon } />
|
|
64
|
+
</Tabs.Tab>
|
|
65
|
+
</Tooltip>
|
|
66
|
+
)
|
|
67
|
+
) }
|
|
67
68
|
</Tabs.TabList>
|
|
68
69
|
<Tabs.TabPanel tabId={ TAB_SETTINGS.name } focusable={ false }>
|
|
69
70
|
<SettingsTab showAdvancedControls={ !! blockName } />
|
|
@@ -31,8 +31,7 @@ export default function InspectorPopoverHeader( {
|
|
|
31
31
|
<Spacer />
|
|
32
32
|
{ actions.map( ( { label, icon, onClick } ) => (
|
|
33
33
|
<Button
|
|
34
|
-
|
|
35
|
-
__next40pxDefaultSize={ false }
|
|
34
|
+
size="small"
|
|
36
35
|
key={ label }
|
|
37
36
|
className="block-editor-inspector-popover-header__action"
|
|
38
37
|
label={ label }
|
|
@@ -45,8 +44,7 @@ export default function InspectorPopoverHeader( {
|
|
|
45
44
|
) ) }
|
|
46
45
|
{ onClose && (
|
|
47
46
|
<Button
|
|
48
|
-
|
|
49
|
-
__next40pxDefaultSize={ false }
|
|
47
|
+
size="small"
|
|
50
48
|
className="block-editor-inspector-popover-header__action"
|
|
51
49
|
label={ __( 'Close' ) }
|
|
52
50
|
icon={ closeSmall }
|