@wordpress/block-editor 13.3.0 → 13.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 +0 -4
- package/build/components/alignment-control/ui.js +2 -2
- package/build/components/alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/ui.js +1 -1
- package/build/components/block-alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/ui.native.js +1 -1
- package/build/components/block-alignment-control/ui.native.js.map +1 -1
- package/build/components/block-inspector/index.js +6 -3
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +3 -1
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-refs.js +9 -2
- package/build/components/block-list/use-block-props/use-block-refs.js.map +1 -1
- package/build/components/block-list/use-block-props/use-is-hovered.js +25 -9
- package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +3 -2
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-lock/modal.js +2 -0
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-removal-warning-modal/index.js +2 -0
- package/build/components/block-removal-warning-modal/index.js.map +1 -1
- package/build/components/block-switcher/index.js +1 -1
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-switcher/pattern-transformations-menu.js +11 -12
- package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/preview-block-popover.js +20 -17
- package/build/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build/components/block-toolbar/shuffle.js +5 -2
- package/build/components/block-toolbar/shuffle.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +7 -8
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserter-button.js +45 -0
- package/build/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -0
- package/build/components/block-tools/zoom-out-mode-inserters.js +27 -27
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/block-tools/zoom-out-popover.js +2 -1
- package/build/components/block-tools/zoom-out-popover.js.map +1 -1
- package/build/components/block-tools/zoom-out-toolbar.js +1 -1
- package/build/components/block-tools/zoom-out-toolbar.js.map +1 -1
- package/build/components/date-format-picker/index.js +2 -11
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/default-block-appender/index.js +7 -4
- package/build/components/default-block-appender/index.js.map +1 -1
- package/build/components/font-appearance-control/index.js +2 -7
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/global-styles/background-panel.js +8 -1
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +5 -1
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +26 -43
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-utils.js +78 -7
- package/build/components/global-styles/typography-utils.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +24 -5
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/grid/grid-item-movers.js +89 -44
- package/build/components/grid/grid-item-movers.js.map +1 -1
- package/build/components/grid/grid-visualizer.js +1 -1
- package/build/components/grid/grid-visualizer.js.map +1 -1
- package/build/components/grid/use-grid-layout-sync.js +40 -28
- package/build/components/grid/use-grid-layout-sync.js.map +1 -1
- package/build/components/index.js +1 -9
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/index.js +1 -1
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/patterns-filter.js +20 -23
- package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build/components/inserter/media-tab/media-panel.js +1 -0
- package/build/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build/components/inserter/menu.js +1 -1
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/preview-panel.js +20 -3
- package/build/components/inserter/preview-panel.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +10 -3
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inspector-controls-tabs/settings-tab.js +1 -2
- package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
- package/build/components/list-view/block-select-button.js +2 -6
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +2 -2
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/utils.js +3 -1
- package/build/components/list-view/utils.js.map +1 -1
- package/build/components/rich-text/format-toolbar/index.js +1 -1
- package/build/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build/components/rich-text/index.js +1 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -2
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +3 -3
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/hooks/grid-visualizer.js +5 -8
- package/build/hooks/grid-visualizer.js.map +1 -1
- package/build/hooks/layout-child.js +9 -2
- package/build/hooks/layout-child.js.map +1 -1
- package/build/hooks/position.js +3 -7
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/use-bindings-attributes.js +81 -50
- package/build/hooks/use-bindings-attributes.js.map +1 -1
- package/build/layouts/constrained.js +6 -2
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/grid.js +2 -0
- package/build/layouts/grid.js.map +1 -1
- package/build/private-apis.js +0 -3
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +18 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +19 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +13 -1
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/alignment-control/ui.js +2 -2
- package/build-module/components/alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.js +1 -1
- package/build-module/components/block-alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.native.js +1 -1
- package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
- package/build-module/components/block-inspector/index.js +6 -3
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +3 -1
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-refs.js +11 -4
- package/build-module/components/block-list/use-block-props/use-block-refs.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-is-hovered.js +26 -9
- package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +3 -2
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-lock/modal.js +2 -0
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-removal-warning-modal/index.js +2 -0
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
- package/build-module/components/block-switcher/index.js +1 -1
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.js +12 -13
- package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/preview-block-popover.js +20 -17
- package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build-module/components/block-toolbar/shuffle.js +5 -2
- package/build-module/components/block-toolbar/shuffle.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +7 -8
- 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 +37 -0
- package/build-module/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -0
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +28 -28
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-popover.js +2 -1
- package/build-module/components/block-tools/zoom-out-popover.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-toolbar.js +1 -1
- package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +4 -12
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/default-block-appender/index.js +7 -4
- package/build-module/components/default-block-appender/index.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +3 -6
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +8 -1
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +5 -1
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +27 -44
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-utils.js +76 -7
- package/build-module/components/global-styles/typography-utils.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +24 -5
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/grid/grid-item-movers.js +92 -46
- package/build-module/components/grid/grid-item-movers.js.map +1 -1
- package/build-module/components/grid/grid-visualizer.js +1 -1
- package/build-module/components/grid/grid-visualizer.js.map +1 -1
- package/build-module/components/grid/use-grid-layout-sync.js +41 -29
- package/build-module/components/grid/use-grid-layout-sync.js.map +1 -1
- package/build-module/components/index.js +0 -5
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +1 -1
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +20 -23
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-panel.js +1 -0
- package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build-module/components/inserter/menu.js +1 -1
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/preview-panel.js +20 -3
- package/build-module/components/inserter/preview-panel.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +10 -3
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/settings-tab.js +1 -2
- package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +3 -7
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +2 -2
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/utils.js +3 -1
- package/build-module/components/list-view/utils.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar/index.js +1 -1
- package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +1 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -2
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +3 -3
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/hooks/grid-visualizer.js +5 -8
- package/build-module/hooks/grid-visualizer.js.map +1 -1
- package/build-module/hooks/layout-child.js +9 -2
- package/build-module/hooks/layout-child.js.map +1 -1
- package/build-module/hooks/position.js +3 -7
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/use-bindings-attributes.js +81 -51
- package/build-module/hooks/use-bindings-attributes.js.map +1 -1
- package/build-module/layouts/constrained.js +6 -2
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/layouts/grid.js +2 -0
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/private-apis.js +0 -3
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +15 -0
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +18 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +10 -0
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/content-rtl.css +6 -6
- package/build-style/content.css +6 -6
- package/build-style/style-rtl.css +167 -103
- package/build-style/style.css +167 -103
- package/build-types/components/block-context/index.d.ts +2 -2
- package/build-types/components/block-context/index.d.ts.map +1 -1
- package/build-types/utils/dom.d.ts.map +1 -1
- package/package.json +31 -31
- package/src/components/alignment-control/ui.js +2 -2
- package/src/components/block-alignment-control/ui.js +1 -1
- package/src/components/block-alignment-control/ui.native.js +1 -1
- package/src/components/block-context/README.md +4 -4
- package/src/components/block-inspector/index.js +8 -4
- package/src/components/block-list/content.scss +2 -16
- package/src/components/block-list/use-block-props/index.js +1 -1
- package/src/components/block-list/use-block-props/use-block-refs.js +19 -3
- package/src/components/block-list/use-block-props/use-is-hovered.js +26 -11
- package/src/components/block-list/use-in-between-inserter.js +5 -1
- package/src/components/block-lock/modal.js +10 -2
- package/src/components/block-lock/style.scss +4 -8
- package/src/components/block-patterns-paging/style.scss +0 -23
- package/src/components/block-removal-warning-modal/index.js +10 -2
- package/src/components/block-switcher/index.js +1 -1
- package/src/components/block-switcher/pattern-transformations-menu.js +17 -15
- package/src/components/block-switcher/preview-block-popover.js +20 -14
- package/src/components/block-switcher/style.scss +8 -17
- package/src/components/block-toolbar/shuffle.js +8 -1
- package/src/components/block-tools/style.scss +8 -0
- package/src/components/block-tools/use-show-block-tools.js +12 -9
- package/src/components/block-tools/zoom-out-mode-inserter-button.js +47 -0
- package/src/components/block-tools/zoom-out-mode-inserters.js +43 -33
- package/src/components/block-tools/zoom-out-popover.js +1 -0
- package/src/components/block-tools/zoom-out-toolbar.js +1 -1
- package/src/components/date-format-picker/index.js +2 -11
- package/src/components/default-block-appender/index.js +11 -4
- package/src/components/font-appearance-control/index.js +1 -5
- package/src/components/global-styles/background-panel.js +21 -1
- package/src/components/global-styles/hooks.js +5 -1
- package/src/components/global-styles/style.scss +12 -0
- package/src/components/global-styles/test/typography-utils.js +325 -0
- package/src/components/global-styles/test/use-global-styles-output.js +3 -1
- package/src/components/global-styles/typography-panel.js +36 -44
- package/src/components/global-styles/typography-utils.js +103 -7
- package/src/components/global-styles/use-global-styles-output.js +22 -2
- package/src/components/grid/grid-item-movers.js +139 -69
- package/src/components/grid/grid-visualizer.js +1 -1
- package/src/components/grid/style.scss +114 -0
- package/src/components/grid/use-grid-layout-sync.js +66 -27
- package/src/components/iframe/content.scss +1 -1
- package/src/components/index.js +0 -5
- package/src/components/inner-blocks/index.js +4 -1
- package/src/components/inserter/block-patterns-tab/patterns-filter.js +40 -44
- package/src/components/inserter/media-tab/media-panel.js +1 -0
- package/src/components/inserter/menu.js +1 -1
- package/src/components/inserter/preview-panel.js +27 -4
- package/src/components/inserter/style.scss +57 -43
- package/src/components/inserter-draggable-blocks/index.js +11 -3
- package/src/components/inspector-controls-tabs/settings-tab.js +0 -2
- package/src/components/inspector-controls-tabs/style.scss +0 -21
- package/src/components/list-view/block-select-button.js +3 -13
- package/src/components/list-view/block.js +10 -3
- package/src/components/list-view/style.scss +2 -1
- package/src/components/list-view/utils.js +13 -2
- package/src/components/rich-text/format-toolbar/index.js +1 -1
- package/src/components/rich-text/index.js +1 -1
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +3 -1
- package/src/components/url-popover/image-url-input-ui.js +3 -3
- package/src/components/url-popover/style.scss +1 -0
- package/src/hooks/grid-visualizer.js +5 -7
- package/src/hooks/layout-child.js +12 -3
- package/src/hooks/position.js +3 -13
- package/src/hooks/use-bindings-attributes.js +89 -59
- package/src/layouts/constrained.js +10 -2
- package/src/layouts/grid.js +2 -0
- package/src/private-apis.js +0 -6
- package/src/store/actions.js +15 -0
- package/src/store/reducer.js +18 -0
- package/src/store/selectors.js +10 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/inserter/reusable-block-rename-hint.js +0 -71
- package/build/components/inserter/reusable-block-rename-hint.js.map +0 -1
- package/build/components/inspector-controls-tabs/settings-tab-hint.js +0 -53
- package/build/components/inspector-controls-tabs/settings-tab-hint.js.map +0 -1
- package/build-module/components/inserter/reusable-block-rename-hint.js +0 -64
- package/build-module/components/inserter/reusable-block-rename-hint.js.map +0 -1
- package/build-module/components/inspector-controls-tabs/settings-tab-hint.js +0 -47
- package/build-module/components/inspector-controls-tabs/settings-tab-hint.js.map +0 -1
- package/src/components/inserter/reusable-block-rename-hint.js +0 -69
- package/src/components/inspector-controls-tabs/settings-tab-hint.js +0 -52
|
@@ -115,7 +115,7 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
|
|
|
115
115
|
useFocusHandler( clientId ),
|
|
116
116
|
useEventHandlers( { clientId, isSelected } ),
|
|
117
117
|
useNavModeExit( clientId ),
|
|
118
|
-
useIsHovered(),
|
|
118
|
+
useIsHovered( { clientId } ),
|
|
119
119
|
useIntersectionObserver(),
|
|
120
120
|
useMovingAnimation( { triggerAnimationOnChange: index, clientId } ),
|
|
121
121
|
useDisabled( { isDisabled: ! hasOverlay } ),
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import {
|
|
5
|
+
useContext,
|
|
6
|
+
useMemo,
|
|
7
|
+
useRef,
|
|
8
|
+
useState,
|
|
9
|
+
useLayoutEffect,
|
|
10
|
+
} from '@wordpress/element';
|
|
11
|
+
import { useRefEffect } from '@wordpress/compose';
|
|
6
12
|
|
|
7
13
|
/**
|
|
8
14
|
* Internal dependencies
|
|
@@ -67,7 +73,17 @@ function useBlockRef( clientId ) {
|
|
|
67
73
|
*/
|
|
68
74
|
function useBlockElement( clientId ) {
|
|
69
75
|
const { refsMap } = useContext( BlockRefs );
|
|
70
|
-
|
|
76
|
+
const [ blockElement, setBlockElement ] = useState( null );
|
|
77
|
+
// Delay setting the resulting `blockElement` until an effect. If the block element
|
|
78
|
+
// changes (i.e., the block is unmounted and re-mounted), this allows enough time
|
|
79
|
+
// for the ref callbacks to clean up the old element and set the new one.
|
|
80
|
+
useLayoutEffect( () => {
|
|
81
|
+
setBlockElement( refsMap.get( clientId ) );
|
|
82
|
+
return refsMap.subscribe( clientId, () =>
|
|
83
|
+
setBlockElement( refsMap.get( clientId ) )
|
|
84
|
+
);
|
|
85
|
+
}, [ refsMap, clientId ] );
|
|
86
|
+
return blockElement;
|
|
71
87
|
}
|
|
72
88
|
|
|
73
89
|
export { useBlockRef as __unstableUseBlockRef };
|
|
@@ -2,23 +2,37 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useRefEffect } from '@wordpress/compose';
|
|
5
|
+
import { useDispatch } from '@wordpress/data';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const action = event.type === 'mouseover' ? 'add' : 'remove';
|
|
12
|
-
|
|
13
|
-
event.preventDefault();
|
|
14
|
-
event.currentTarget.classList[ action ]( 'is-hovered' );
|
|
15
|
-
}
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { store as blockEditorStore } from '../../../store';
|
|
16
11
|
|
|
17
12
|
/*
|
|
18
13
|
* Adds `is-hovered` class when the block is hovered and in navigation or
|
|
19
14
|
* outline mode.
|
|
20
15
|
*/
|
|
21
|
-
export function useIsHovered() {
|
|
16
|
+
export function useIsHovered( { clientId } ) {
|
|
17
|
+
const { hoverBlock } = useDispatch( blockEditorStore );
|
|
18
|
+
|
|
19
|
+
function listener( event ) {
|
|
20
|
+
if ( event.defaultPrevented ) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const action = event.type === 'mouseover' ? 'add' : 'remove';
|
|
25
|
+
|
|
26
|
+
event.preventDefault();
|
|
27
|
+
event.currentTarget.classList[ action ]( 'is-hovered' );
|
|
28
|
+
|
|
29
|
+
if ( action === 'add' ) {
|
|
30
|
+
hoverBlock( clientId );
|
|
31
|
+
} else {
|
|
32
|
+
hoverBlock( null );
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
22
36
|
return useRefEffect( ( node ) => {
|
|
23
37
|
node.addEventListener( 'mouseout', listener );
|
|
24
38
|
node.addEventListener( 'mouseover', listener );
|
|
@@ -29,6 +43,7 @@ export function useIsHovered() {
|
|
|
29
43
|
|
|
30
44
|
// Remove class in case it lingers.
|
|
31
45
|
node.classList.remove( 'is-hovered' );
|
|
46
|
+
hoverBlock( null );
|
|
32
47
|
};
|
|
33
48
|
}, [] );
|
|
34
49
|
}
|
|
@@ -29,6 +29,7 @@ export function useInBetweenInserter() {
|
|
|
29
29
|
__unstableIsWithinBlockOverlay,
|
|
30
30
|
getBlockEditingMode,
|
|
31
31
|
getBlockName,
|
|
32
|
+
getBlockAttributes,
|
|
32
33
|
} = useSelect( blockEditorStore );
|
|
33
34
|
const { showInsertionPoint, hideInsertionPoint } =
|
|
34
35
|
useDispatch( blockEditorStore );
|
|
@@ -79,7 +80,10 @@ export function useInBetweenInserter() {
|
|
|
79
80
|
if (
|
|
80
81
|
getTemplateLock( rootClientId ) ||
|
|
81
82
|
getBlockEditingMode( rootClientId ) === 'disabled' ||
|
|
82
|
-
getBlockName( rootClientId ) === 'core/block'
|
|
83
|
+
getBlockName( rootClientId ) === 'core/block' ||
|
|
84
|
+
( rootClientId &&
|
|
85
|
+
getBlockAttributes( rootClientId ).layout
|
|
86
|
+
?.isManualPlacement )
|
|
83
87
|
) {
|
|
84
88
|
return;
|
|
85
89
|
}
|
|
@@ -217,12 +217,20 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
217
217
|
expanded={ false }
|
|
218
218
|
>
|
|
219
219
|
<FlexItem>
|
|
220
|
-
<Button
|
|
220
|
+
<Button
|
|
221
|
+
variant="tertiary"
|
|
222
|
+
onClick={ onClose }
|
|
223
|
+
__next40pxDefaultSize
|
|
224
|
+
>
|
|
221
225
|
{ __( 'Cancel' ) }
|
|
222
226
|
</Button>
|
|
223
227
|
</FlexItem>
|
|
224
228
|
<FlexItem>
|
|
225
|
-
<Button
|
|
229
|
+
<Button
|
|
230
|
+
variant="primary"
|
|
231
|
+
type="submit"
|
|
232
|
+
__next40pxDefaultSize
|
|
233
|
+
>
|
|
226
234
|
{ __( 'Apply' ) }
|
|
227
235
|
</Button>
|
|
228
236
|
</FlexItem>
|
|
@@ -8,13 +8,9 @@
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.block-editor-block-lock-modal__options {
|
|
12
|
-
margin-
|
|
13
|
-
|
|
14
|
-
legend {
|
|
15
|
-
margin-bottom: $grid-unit-20;
|
|
16
|
-
padding: 0;
|
|
17
|
-
}
|
|
11
|
+
.block-editor-block-lock-modal__options legend {
|
|
12
|
+
margin-bottom: $grid-unit-20;
|
|
13
|
+
padding: 0;
|
|
18
14
|
}
|
|
19
15
|
|
|
20
16
|
.block-editor-block-lock-modal__checklist {
|
|
@@ -52,7 +48,7 @@
|
|
|
52
48
|
.block-editor-block-lock-modal__template-lock {
|
|
53
49
|
border-top: $border-width solid $gray-300;
|
|
54
50
|
margin-top: $grid-unit-20;
|
|
55
|
-
padding: $grid-unit-
|
|
51
|
+
padding-top: $grid-unit-20;
|
|
56
52
|
}
|
|
57
53
|
|
|
58
54
|
.block-editor-block-lock-modal__actions {
|
|
@@ -24,11 +24,6 @@
|
|
|
24
24
|
|
|
25
25
|
.show-icon-labels {
|
|
26
26
|
.block-editor-patterns__grid-pagination {
|
|
27
|
-
flex-direction: column;
|
|
28
|
-
.block-editor-patterns__grid-pagination-previous,
|
|
29
|
-
.block-editor-patterns__grid-pagination-next {
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
}
|
|
32
27
|
.components-button {
|
|
33
28
|
width: auto;
|
|
34
29
|
// Hide the button icons when labels are set to display...
|
|
@@ -42,22 +37,4 @@
|
|
|
42
37
|
}
|
|
43
38
|
}
|
|
44
39
|
}
|
|
45
|
-
|
|
46
|
-
@media screen and (min-width: $break-large) {
|
|
47
|
-
.block-editor-patterns__grid-pagination {
|
|
48
|
-
flex-direction: row;
|
|
49
|
-
.block-editor-patterns__grid-pagination-previous,
|
|
50
|
-
.block-editor-patterns__grid-pagination-next {
|
|
51
|
-
flex-direction: row;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.block-editor-block-patterns-list .block-editor-patterns__grid-pagination {
|
|
58
|
-
flex-direction: column;
|
|
59
|
-
.block-editor-patterns__grid-pagination-previous,
|
|
60
|
-
.block-editor-patterns__grid-pagination-next {
|
|
61
|
-
flex-direction: column;
|
|
62
|
-
}
|
|
63
40
|
}
|
|
@@ -53,10 +53,18 @@ export function BlockRemovalWarningModal( { rules } ) {
|
|
|
53
53
|
>
|
|
54
54
|
<p>{ message }</p>
|
|
55
55
|
<HStack justify="right">
|
|
56
|
-
<Button
|
|
56
|
+
<Button
|
|
57
|
+
variant="tertiary"
|
|
58
|
+
onClick={ clearBlockRemovalPrompt }
|
|
59
|
+
__next40pxDefaultSize
|
|
60
|
+
>
|
|
57
61
|
{ __( 'Cancel' ) }
|
|
58
62
|
</Button>
|
|
59
|
-
<Button
|
|
63
|
+
<Button
|
|
64
|
+
variant="primary"
|
|
65
|
+
onClick={ onConfirmRemoval }
|
|
66
|
+
__next40pxDefaultSize
|
|
67
|
+
>
|
|
60
68
|
{ __( 'Delete' ) }
|
|
61
69
|
</Button>
|
|
62
70
|
</HStack>
|
|
@@ -306,7 +306,7 @@ export const BlockSwitcher = ( { clientIds, disabled, isUsingBindings } ) => {
|
|
|
306
306
|
</>
|
|
307
307
|
}
|
|
308
308
|
toggleProps={ {
|
|
309
|
-
|
|
309
|
+
description: blockSwitcherDescription,
|
|
310
310
|
...toggleProps,
|
|
311
311
|
} }
|
|
312
312
|
menuProps={ { orientation: 'both' } }
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { useState } from '@wordpress/element';
|
|
6
|
-
import { useInstanceId } from '@wordpress/compose';
|
|
6
|
+
import { useInstanceId, useViewportMatch } from '@wordpress/compose';
|
|
7
7
|
import { chevronRight } from '@wordpress/icons';
|
|
8
8
|
|
|
9
9
|
import {
|
|
@@ -34,6 +34,7 @@ function PatternTransformationsMenu( {
|
|
|
34
34
|
} ) {
|
|
35
35
|
const [ showTransforms, setShowTransforms ] = useState( false );
|
|
36
36
|
const patterns = useTransformedPatterns( statePatterns, blocks );
|
|
37
|
+
|
|
37
38
|
if ( ! patterns.length ) {
|
|
38
39
|
return null;
|
|
39
40
|
}
|
|
@@ -60,21 +61,22 @@ function PatternTransformationsMenu( {
|
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
function PreviewPatternsPopover( { patterns, onSelect } ) {
|
|
64
|
+
const isMobile = useViewportMatch( 'medium', '<' );
|
|
65
|
+
|
|
63
66
|
return (
|
|
64
|
-
<div className="block-editor-block-
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
</div>
|
|
67
|
+
<div className="block-editor-block-switcher__popover-preview-container">
|
|
68
|
+
<Popover
|
|
69
|
+
className="block-editor-block-switcher__popover-preview"
|
|
70
|
+
placement={ isMobile ? 'bottom' : 'right-start' }
|
|
71
|
+
offset={ 16 }
|
|
72
|
+
>
|
|
73
|
+
<div className="block-editor-block-switcher__preview is-pattern-list-preview">
|
|
74
|
+
<BlockPatternsList
|
|
75
|
+
patterns={ patterns }
|
|
76
|
+
onSelect={ onSelect }
|
|
77
|
+
/>
|
|
78
|
+
</div>
|
|
79
|
+
</Popover>
|
|
78
80
|
</div>
|
|
79
81
|
);
|
|
80
82
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { Popover } from '@wordpress/components';
|
|
6
|
+
import { useViewportMatch } from '@wordpress/compose';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
@@ -10,22 +11,27 @@ import { Popover } from '@wordpress/components';
|
|
|
10
11
|
import BlockPreview from '../block-preview';
|
|
11
12
|
|
|
12
13
|
export default function PreviewBlockPopover( { blocks } ) {
|
|
14
|
+
const isMobile = useViewportMatch( 'medium', '<' );
|
|
15
|
+
|
|
16
|
+
if ( isMobile ) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
13
20
|
return (
|
|
14
|
-
<div className="block-editor-block-
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
</div>
|
|
25
|
-
<BlockPreview viewportWidth={ 500 } blocks={ blocks } />
|
|
21
|
+
<div className="block-editor-block-switcher__popover-preview-container">
|
|
22
|
+
<Popover
|
|
23
|
+
className="block-editor-block-switcher__popover-preview"
|
|
24
|
+
placement="right-start"
|
|
25
|
+
focusOnMount={ false }
|
|
26
|
+
offset={ 16 }
|
|
27
|
+
>
|
|
28
|
+
<div className="block-editor-block-switcher__preview">
|
|
29
|
+
<div className="block-editor-block-switcher__preview-title">
|
|
30
|
+
{ __( 'Preview' ) }
|
|
26
31
|
</div>
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
<BlockPreview viewportWidth={ 500 } blocks={ blocks } />
|
|
33
|
+
</div>
|
|
34
|
+
</Popover>
|
|
29
35
|
</div>
|
|
30
36
|
);
|
|
31
37
|
}
|
|
@@ -84,27 +84,18 @@
|
|
|
84
84
|
min-width: 300px;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
.block-editor-block-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
.block-editor-block-switcher__popover-preview-container {
|
|
88
|
+
left: 0;
|
|
89
|
+
position: absolute;
|
|
90
|
+
top: -$border-width;
|
|
91
|
+
width: 100%;
|
|
92
|
+
bottom: 0;
|
|
93
|
+
pointer-events: none;
|
|
93
94
|
}
|
|
94
95
|
|
|
95
|
-
.block-editor-block-
|
|
96
|
-
display: none;
|
|
96
|
+
.block-editor-block-switcher__popover-preview {
|
|
97
97
|
overflow: hidden;
|
|
98
98
|
|
|
99
|
-
// Position correctly. Needs specificity.
|
|
100
|
-
&.components-popover {
|
|
101
|
-
margin-top: $grid-unit-15 - $border-width;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
@include break-medium() {
|
|
105
|
-
display: block;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
99
|
.components-popover__content {
|
|
109
100
|
width: 300px;
|
|
110
101
|
border: $border-width solid $gray-900;
|
|
@@ -54,10 +54,16 @@ export default function Shuffle( { clientId, as = Container } ) {
|
|
|
54
54
|
return EMPTY_ARRAY;
|
|
55
55
|
}
|
|
56
56
|
return patterns.filter( ( pattern ) => {
|
|
57
|
+
const isCorePattern =
|
|
58
|
+
pattern.source === 'core' ||
|
|
59
|
+
( pattern.source?.startsWith( 'pattern-directory' ) &&
|
|
60
|
+
pattern.source !== 'pattern-directory/theme' );
|
|
57
61
|
return (
|
|
58
62
|
// Check if the pattern has only one top level block,
|
|
59
63
|
// otherwise we may shuffle to pattern that will not allow to continue shuffling.
|
|
60
64
|
pattern.blocks.length === 1 &&
|
|
65
|
+
// We exclude the core patterns and pattern directory patterns that are not theme patterns.
|
|
66
|
+
! isCorePattern &&
|
|
61
67
|
pattern.categories?.some( ( category ) => {
|
|
62
68
|
return categories.includes( category );
|
|
63
69
|
} ) &&
|
|
@@ -66,7 +72,8 @@ export default function Shuffle( { clientId, as = Container } ) {
|
|
|
66
72
|
);
|
|
67
73
|
} );
|
|
68
74
|
}, [ categories, patterns ] );
|
|
69
|
-
|
|
75
|
+
|
|
76
|
+
if ( sameCategoryPatternsWithSingleWrapper.length < 2 ) {
|
|
70
77
|
return null;
|
|
71
78
|
}
|
|
72
79
|
|
|
@@ -29,10 +29,11 @@ export function useShowBlockTools() {
|
|
|
29
29
|
const clientId =
|
|
30
30
|
getSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();
|
|
31
31
|
|
|
32
|
-
const block = getBlock( clientId )
|
|
32
|
+
const block = getBlock( clientId );
|
|
33
33
|
const editorMode = __unstableGetEditorMode();
|
|
34
|
-
const hasSelectedBlock = clientId && block
|
|
35
|
-
const isEmptyDefaultBlock =
|
|
34
|
+
const hasSelectedBlock = !! clientId && !! block;
|
|
35
|
+
const isEmptyDefaultBlock =
|
|
36
|
+
hasSelectedBlock && isUnmodifiedDefaultBlock( block );
|
|
36
37
|
const _showEmptyBlockSideInserter =
|
|
37
38
|
clientId &&
|
|
38
39
|
! isTyping() &&
|
|
@@ -43,8 +44,14 @@ export function useShowBlockTools() {
|
|
|
43
44
|
! hasMultiSelection() &&
|
|
44
45
|
editorMode === 'navigation';
|
|
45
46
|
|
|
47
|
+
const isZoomOut = editorMode === 'zoom-out';
|
|
48
|
+
const _showZoomOutToolbar =
|
|
49
|
+
isZoomOut &&
|
|
50
|
+
block?.attributes?.align === 'full' &&
|
|
51
|
+
! _showEmptyBlockSideInserter &&
|
|
52
|
+
! maybeShowBreadcrumb;
|
|
46
53
|
const _showBlockToolbarPopover =
|
|
47
|
-
|
|
54
|
+
! _showZoomOutToolbar &&
|
|
48
55
|
! getSettings().hasFixedToolbar &&
|
|
49
56
|
! _showEmptyBlockSideInserter &&
|
|
50
57
|
hasSelectedBlock &&
|
|
@@ -56,11 +63,7 @@ export function useShowBlockTools() {
|
|
|
56
63
|
showBreadcrumb:
|
|
57
64
|
! _showEmptyBlockSideInserter && maybeShowBreadcrumb,
|
|
58
65
|
showBlockToolbarPopover: _showBlockToolbarPopover,
|
|
59
|
-
showZoomOutToolbar:
|
|
60
|
-
editorMode === 'zoom-out' &&
|
|
61
|
-
! _showEmptyBlockSideInserter &&
|
|
62
|
-
! maybeShowBreadcrumb &&
|
|
63
|
-
! _showBlockToolbarPopover,
|
|
66
|
+
showZoomOutToolbar: _showZoomOutToolbar,
|
|
64
67
|
};
|
|
65
68
|
}, [] );
|
|
66
69
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { useState } from '@wordpress/element';
|
|
10
|
+
import { Button } from '@wordpress/components';
|
|
11
|
+
import { plus } from '@wordpress/icons';
|
|
12
|
+
import { _x } from '@wordpress/i18n';
|
|
13
|
+
|
|
14
|
+
function ZoomOutModeInserterButton( { isVisible, onClick } ) {
|
|
15
|
+
const [
|
|
16
|
+
zoomOutModeInserterButtonHovered,
|
|
17
|
+
setZoomOutModeInserterButtonHovered,
|
|
18
|
+
] = useState( false );
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Button
|
|
22
|
+
variant="primary"
|
|
23
|
+
icon={ plus }
|
|
24
|
+
size="compact"
|
|
25
|
+
className={ clsx(
|
|
26
|
+
'block-editor-button-pattern-inserter__button',
|
|
27
|
+
'block-editor-block-tools__zoom-out-mode-inserter-button',
|
|
28
|
+
{
|
|
29
|
+
'is-visible': isVisible || zoomOutModeInserterButtonHovered,
|
|
30
|
+
}
|
|
31
|
+
) }
|
|
32
|
+
onClick={ onClick }
|
|
33
|
+
onMouseOver={ () => {
|
|
34
|
+
setZoomOutModeInserterButtonHovered( true );
|
|
35
|
+
} }
|
|
36
|
+
onMouseOut={ () => {
|
|
37
|
+
setZoomOutModeInserterButtonHovered( false );
|
|
38
|
+
} }
|
|
39
|
+
label={ _x(
|
|
40
|
+
'Add pattern',
|
|
41
|
+
'Generic label for pattern inserter button'
|
|
42
|
+
) }
|
|
43
|
+
/>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export default ZoomOutModeInserterButton;
|
|
@@ -2,29 +2,34 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useSelect } from '@wordpress/data';
|
|
5
|
-
import { useEffect,
|
|
6
|
-
import { Button } from '@wordpress/components';
|
|
7
|
-
import { plus } from '@wordpress/icons';
|
|
8
|
-
import { _x } from '@wordpress/i18n';
|
|
5
|
+
import { useEffect, useState } from '@wordpress/element';
|
|
9
6
|
|
|
10
7
|
/**
|
|
11
8
|
* Internal dependencies
|
|
12
9
|
*/
|
|
13
10
|
import BlockPopoverInbetween from '../block-popover/inbetween';
|
|
11
|
+
import ZoomOutModeInserterButton from './zoom-out-mode-inserter-button';
|
|
14
12
|
import { store as blockEditorStore } from '../../store';
|
|
15
13
|
import { unlock } from '../../lock-unlock';
|
|
16
14
|
|
|
17
15
|
function ZoomOutModeInserters() {
|
|
18
16
|
const [ isReady, setIsReady ] = useState( false );
|
|
19
17
|
const {
|
|
18
|
+
hasSelection,
|
|
20
19
|
blockOrder,
|
|
21
|
-
sectionRootClientId,
|
|
22
20
|
insertionPoint,
|
|
23
21
|
setInserterIsOpened,
|
|
24
|
-
|
|
22
|
+
sectionRootClientId,
|
|
23
|
+
selectedBlockClientId,
|
|
24
|
+
hoveredBlockClientId,
|
|
25
25
|
} = useSelect( ( select ) => {
|
|
26
|
-
const {
|
|
27
|
-
|
|
26
|
+
const {
|
|
27
|
+
getSettings,
|
|
28
|
+
getBlockOrder,
|
|
29
|
+
getSelectionStart,
|
|
30
|
+
getSelectedBlockClientId,
|
|
31
|
+
getHoveredBlockClientId,
|
|
32
|
+
} = select( blockEditorStore );
|
|
28
33
|
const { sectionRootClientId: root } = unlock( getSettings() );
|
|
29
34
|
// To do: move ZoomOutModeInserters to core/editor.
|
|
30
35
|
// Or we perhaps we should move the insertion point state to the
|
|
@@ -40,20 +45,11 @@ function ZoomOutModeInserters() {
|
|
|
40
45
|
sectionRootClientId: root,
|
|
41
46
|
setInserterIsOpened:
|
|
42
47
|
getSettings().__experimentalSetIsInserterOpened,
|
|
48
|
+
selectedBlockClientId: getSelectedBlockClientId(),
|
|
49
|
+
hoveredBlockClientId: getHoveredBlockClientId(),
|
|
43
50
|
};
|
|
44
51
|
}, [] );
|
|
45
52
|
|
|
46
|
-
const isMounted = useRef( false );
|
|
47
|
-
|
|
48
|
-
useEffect( () => {
|
|
49
|
-
if ( ! isMounted.current ) {
|
|
50
|
-
isMounted.current = true;
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
// reset insertion point when the block order changes
|
|
54
|
-
setInserterIsOpened( true );
|
|
55
|
-
}, [ blockOrder, setInserterIsOpened ] );
|
|
56
|
-
|
|
57
53
|
// Defer the initial rendering to avoid the jumps due to the animation.
|
|
58
54
|
useEffect( () => {
|
|
59
55
|
const timeout = setTimeout( () => {
|
|
@@ -64,18 +60,39 @@ function ZoomOutModeInserters() {
|
|
|
64
60
|
};
|
|
65
61
|
}, [] );
|
|
66
62
|
|
|
67
|
-
if ( ! isReady
|
|
63
|
+
if ( ! isReady ) {
|
|
68
64
|
return null;
|
|
69
65
|
}
|
|
70
66
|
|
|
71
67
|
return [ undefined, ...blockOrder ].map( ( clientId, index ) => {
|
|
68
|
+
const shouldRenderInserter = insertionPoint.insertionIndex !== index;
|
|
69
|
+
|
|
70
|
+
const shouldRenderInsertionPoint =
|
|
71
|
+
insertionPoint.insertionIndex === index;
|
|
72
|
+
|
|
73
|
+
if ( ! shouldRenderInserter && ! shouldRenderInsertionPoint ) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const previousClientId = clientId;
|
|
78
|
+
const nextClientId = blockOrder[ index ];
|
|
79
|
+
|
|
80
|
+
const isSelected =
|
|
81
|
+
hasSelection &&
|
|
82
|
+
( selectedBlockClientId === previousClientId ||
|
|
83
|
+
selectedBlockClientId === nextClientId );
|
|
84
|
+
|
|
85
|
+
const isHovered =
|
|
86
|
+
hoveredBlockClientId === previousClientId ||
|
|
87
|
+
hoveredBlockClientId === nextClientId;
|
|
88
|
+
|
|
72
89
|
return (
|
|
73
90
|
<BlockPopoverInbetween
|
|
74
91
|
key={ index }
|
|
75
|
-
previousClientId={
|
|
76
|
-
nextClientId={
|
|
92
|
+
previousClientId={ previousClientId }
|
|
93
|
+
nextClientId={ nextClientId }
|
|
77
94
|
>
|
|
78
|
-
{
|
|
95
|
+
{ shouldRenderInsertionPoint && (
|
|
79
96
|
<div
|
|
80
97
|
style={ {
|
|
81
98
|
borderRadius: '0',
|
|
@@ -87,12 +104,9 @@ function ZoomOutModeInserters() {
|
|
|
87
104
|
className="block-editor-block-list__insertion-point-indicator"
|
|
88
105
|
/>
|
|
89
106
|
) }
|
|
90
|
-
{
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
icon={ plus }
|
|
94
|
-
size="compact"
|
|
95
|
-
className="block-editor-button-pattern-inserter__button"
|
|
107
|
+
{ shouldRenderInserter && (
|
|
108
|
+
<ZoomOutModeInserterButton
|
|
109
|
+
isVisible={ isSelected || isHovered }
|
|
96
110
|
onClick={ () => {
|
|
97
111
|
setInserterIsOpened( {
|
|
98
112
|
rootClientId: sectionRootClientId,
|
|
@@ -101,10 +115,6 @@ function ZoomOutModeInserters() {
|
|
|
101
115
|
category: 'all',
|
|
102
116
|
} );
|
|
103
117
|
} }
|
|
104
|
-
label={ _x(
|
|
105
|
-
'Add pattern',
|
|
106
|
-
'Generic label for pattern inserter button'
|
|
107
|
-
) }
|
|
108
118
|
/>
|
|
109
119
|
) }
|
|
110
120
|
</BlockPopoverInbetween>
|
|
@@ -129,7 +129,7 @@ export default function ZoomOutToolbar( { clientId, rootClientId } ) {
|
|
|
129
129
|
<ToolbarButton
|
|
130
130
|
className="zoom-out-toolbar-button"
|
|
131
131
|
icon={ trash }
|
|
132
|
-
label=
|
|
132
|
+
label={ __( 'Delete' ) }
|
|
133
133
|
onClick={ () => {
|
|
134
134
|
removeBlock( clientId );
|
|
135
135
|
} }
|