@wordpress/block-editor 8.5.0 → 8.6.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/build/components/block-alignment-control/ui.js +1 -1
- package/build/components/block-alignment-control/ui.js.map +1 -1
- package/build/components/block-content-overlay/index.js +13 -4
- package/build/components/block-content-overlay/index.js.map +1 -1
- package/build/components/block-list/block.native.js +3 -1
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-lock/index.js +8 -0
- package/build/components/block-lock/index.js.map +1 -1
- package/build/components/block-lock/menu-item.js +5 -20
- package/build/components/block-lock/menu-item.js.map +1 -1
- package/build/components/block-lock/modal.js +33 -12
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-lock/toolbar.js +7 -20
- package/build/components/block-lock/toolbar.js.map +1 -1
- package/build/components/block-lock/use-block-lock.js +50 -0
- package/build/components/block-lock/use-block-lock.js.map +1 -0
- package/build/components/block-mover/button.js +4 -4
- package/build/components/block-mover/button.js.map +1 -1
- package/build/components/block-mover/index.js +39 -65
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-pattern-setup/index.js +37 -22
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.js +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build/components/block-popover/inbetween.js +183 -0
- package/build/components/block-popover/inbetween.js.map +1 -0
- package/build/components/block-popover/index.js +82 -0
- package/build/components/block-popover/index.js.map +1 -0
- package/build/components/{block-tools → block-popover}/use-popover-scroll.js +4 -1
- package/build/components/block-popover/use-popover-scroll.js.map +1 -0
- package/build/components/block-preview/auto.js +6 -3
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-preview/index.js +4 -2
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-styles/index.js +1 -10
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-switcher/index.js +7 -2
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-tools/back-compat.js +2 -2
- package/build/components/block-tools/back-compat.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +4 -2
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/index.js +5 -5
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +14 -121
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/{block-popover.js → selected-block-popover.js} +25 -108
- package/build/components/block-tools/selected-block-popover.js.map +1 -0
- package/build/components/copy-handler/index.js +44 -9
- package/build/components/copy-handler/index.js.map +1 -1
- package/build/components/duotone-control/index.js +5 -1
- package/build/components/duotone-control/index.js.map +1 -1
- package/build/components/inserter/index.native.js +30 -8
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/link-control/index.js +6 -7
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/list-view/block-select-button.js +4 -10
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +13 -2
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/rich-text/index.js +0 -5
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +0 -4
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/use-block-display-information/index.js +3 -1
- package/build/components/use-block-display-information/index.js.map +1 -1
- package/build/hooks/border.js +468 -44
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/duotone.js +66 -16
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/index.js +8 -2
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/use-border-props.js +22 -32
- package/build/hooks/use-border-props.js.map +1 -1
- package/build/index.js +7 -0
- package/build/index.js.map +1 -1
- package/build/store/actions.js +36 -31
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +0 -26
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +131 -6
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +27 -0
- package/build/store/utils.js.map +1 -0
- package/build-module/components/block-alignment-control/ui.js +2 -2
- package/build-module/components/block-alignment-control/ui.js.map +1 -1
- package/build-module/components/block-content-overlay/index.js +13 -4
- package/build-module/components/block-content-overlay/index.js.map +1 -1
- package/build-module/components/block-list/block.native.js +3 -1
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-lock/index.js +1 -0
- package/build-module/components/block-lock/index.js.map +1 -1
- package/build-module/components/block-lock/menu-item.js +4 -18
- package/build-module/components/block-lock/menu-item.js.map +1 -1
- package/build-module/components/block-lock/modal.js +31 -12
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-lock/toolbar.js +6 -18
- package/build-module/components/block-lock/toolbar.js.map +1 -1
- package/build-module/components/block-lock/use-block-lock.js +41 -0
- package/build-module/components/block-lock/use-block-lock.js.map +1 -0
- package/build-module/components/block-mover/button.js +5 -5
- package/build-module/components/block-mover/button.js.map +1 -1
- package/build-module/components/block-mover/index.js +38 -63
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/index.js +39 -24
- package/build-module/components/block-pattern-setup/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.js +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +165 -0
- package/build-module/components/block-popover/inbetween.js.map +1 -0
- package/build-module/components/block-popover/index.js +67 -0
- package/build-module/components/block-popover/index.js.map +1 -0
- package/build-module/components/{block-tools → block-popover}/use-popover-scroll.js +3 -1
- package/build-module/components/block-popover/use-popover-scroll.js.map +1 -0
- package/build-module/components/block-preview/auto.js +6 -3
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-preview/index.js +4 -2
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-styles/index.js +1 -9
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-switcher/index.js +7 -2
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-tools/back-compat.js +1 -1
- package/build-module/components/block-tools/back-compat.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +3 -2
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/index.js +3 -3
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +16 -121
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/{block-popover.js → selected-block-popover.js} +25 -105
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -0
- package/build-module/components/copy-handler/index.js +44 -9
- package/build-module/components/copy-handler/index.js.map +1 -1
- package/build-module/components/duotone-control/index.js +4 -1
- package/build-module/components/duotone-control/index.js.map +1 -1
- package/build-module/components/inserter/index.native.js +31 -10
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/link-control/index.js +6 -7
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +4 -9
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +13 -2
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/rich-text/index.js +0 -4
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +0 -4
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/use-block-display-information/index.js +3 -1
- package/build-module/components/use-block-display-information/index.js.map +1 -1
- package/build-module/hooks/border.js +458 -44
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/duotone.js +63 -16
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/index.js +2 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/use-border-props.js +21 -30
- package/build-module/hooks/use-border-props.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +19 -16
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +0 -24
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +120 -5
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +20 -0
- package/build-module/store/utils.js.map +1 -0
- package/build-style/style-rtl.css +145 -272
- package/build-style/style.css +145 -272
- package/package.json +28 -28
- package/src/components/block-alignment-control/ui.js +2 -2
- package/src/components/block-content-overlay/index.js +19 -2
- package/src/components/block-list/block.native.js +2 -0
- package/src/components/block-lock/index.js +1 -0
- package/src/components/block-lock/menu-item.js +3 -23
- package/src/components/block-lock/modal.js +37 -13
- package/src/components/block-lock/style.scss +1 -2
- package/src/components/block-lock/toolbar.js +4 -21
- package/src/components/block-lock/use-block-lock.js +45 -0
- package/src/components/block-mover/button.js +5 -7
- package/src/components/block-mover/index.js +37 -60
- package/src/components/block-mover/stories/index.js +110 -0
- package/src/components/block-mover/style.scss +48 -138
- package/src/components/block-pattern-setup/index.js +84 -59
- package/src/components/block-pattern-setup/setup-toolbar.js +3 -1
- package/src/components/block-pattern-setup/style.scss +32 -26
- package/src/components/block-popover/README.md +41 -0
- package/src/components/block-popover/inbetween.js +180 -0
- package/src/components/block-popover/index.js +73 -0
- package/src/components/block-popover/style.scss +24 -0
- package/src/components/{block-tools → block-popover}/use-popover-scroll.js +3 -1
- package/src/components/block-preview/auto.js +10 -1
- package/src/components/block-preview/index.js +2 -0
- package/src/components/block-styles/index.js +1 -12
- package/src/components/block-switcher/index.js +13 -1
- package/src/components/block-switcher/style.scss +4 -4
- package/src/components/block-switcher/test/__snapshots__/index.js.snap +15 -13
- package/src/components/block-toolbar/style.scss +0 -12
- package/src/components/block-tools/back-compat.js +1 -1
- package/src/components/block-tools/block-selection-button.js +3 -1
- package/src/components/block-tools/index.js +6 -4
- package/src/components/block-tools/insertion-point.js +19 -152
- package/src/components/block-tools/{block-popover.js → selected-block-popover.js} +24 -116
- package/src/components/block-tools/style.scss +11 -123
- package/src/components/border-radius-control/style.scss +5 -2
- package/src/components/copy-handler/index.js +52 -10
- package/src/components/default-block-appender/style.scss +1 -2
- package/src/components/duotone-control/index.js +8 -1
- package/src/components/gradients/README.md +29 -0
- package/src/components/inserter/index.native.js +60 -25
- package/src/components/inserter/style.native.scss +24 -3
- package/src/components/link-control/index.js +5 -5
- package/src/components/list-view/block-select-button.js +2 -10
- package/src/components/list-view/block.js +16 -7
- package/src/components/navigable-toolbar/README.md +16 -0
- package/src/components/rich-text/index.js +0 -2
- package/src/components/rich-text/index.native.js +0 -4
- package/src/components/use-block-display-information/index.js +2 -0
- package/src/hooks/border.js +438 -72
- package/src/hooks/border.scss +48 -0
- package/src/hooks/duotone.js +98 -62
- package/src/hooks/index.js +2 -1
- package/src/hooks/use-border-props.js +15 -32
- package/src/index.js +1 -0
- package/src/store/actions.js +19 -15
- package/src/store/reducer.js +0 -21
- package/src/store/selectors.js +160 -5
- package/src/store/test/actions.js +0 -18
- package/src/store/test/reducer.js +0 -19
- package/src/store/test/selectors.js +0 -19
- package/src/store/utils.js +19 -0
- package/src/style.scss +1 -1
- package/build/components/block-mobile-toolbar/index.js +0 -42
- package/build/components/block-mobile-toolbar/index.js.map +0 -1
- package/build/components/block-tools/block-popover.js.map +0 -1
- package/build/components/block-tools/use-popover-scroll.js.map +0 -1
- package/build/components/list-view/appender.js +0 -93
- package/build/components/list-view/appender.js.map +0 -1
- package/build/components/list-view/list-item.js +0 -62
- package/build/components/list-view/list-item.js.map +0 -1
- package/build/components/rich-text/use-caret-in-format.js +0 -43
- package/build/components/rich-text/use-caret-in-format.js.map +0 -1
- package/build/hooks/border-color.js +0 -302
- package/build/hooks/border-color.js.map +0 -1
- package/build/hooks/border-style.js +0 -96
- package/build/hooks/border-style.js.map +0 -1
- package/build/hooks/border-width.js +0 -162
- package/build/hooks/border-width.js.map +0 -1
- package/build-module/components/block-mobile-toolbar/index.js +0 -31
- package/build-module/components/block-mobile-toolbar/index.js.map +0 -1
- package/build-module/components/block-tools/block-popover.js.map +0 -1
- package/build-module/components/block-tools/use-popover-scroll.js.map +0 -1
- package/build-module/components/list-view/appender.js +0 -76
- package/build-module/components/list-view/appender.js.map +0 -1
- package/build-module/components/list-view/list-item.js +0 -47
- package/build-module/components/list-view/list-item.js.map +0 -1
- package/build-module/components/rich-text/use-caret-in-format.js +0 -33
- package/build-module/components/rich-text/use-caret-in-format.js.map +0 -1
- package/build-module/hooks/border-color.js +0 -276
- package/build-module/hooks/border-color.js.map +0 -1
- package/build-module/hooks/border-style.js +0 -78
- package/build-module/hooks/border-style.js.map +0 -1
- package/build-module/hooks/border-width.js +0 -143
- package/build-module/hooks/border-width.js.map +0 -1
- package/src/components/block-mobile-toolbar/index.js +0 -24
- package/src/components/block-mobile-toolbar/style.scss +0 -29
- package/src/components/list-view/appender.js +0 -82
- package/src/components/list-view/list-item.js +0 -59
- package/src/components/rich-text/use-caret-in-format.js +0 -28
- package/src/hooks/border-color.js +0 -315
- package/src/hooks/border-style.js +0 -64
- package/src/hooks/border-width.js +0 -139
|
@@ -7,24 +7,16 @@ import classnames from 'classnames';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
useRef,
|
|
13
|
-
useMemo,
|
|
14
|
-
createContext,
|
|
15
|
-
useContext,
|
|
16
|
-
} from '@wordpress/element';
|
|
17
|
-
import { Popover, __unstableMotion as motion } from '@wordpress/components';
|
|
10
|
+
import { useRef, createContext, useContext } from '@wordpress/element';
|
|
11
|
+
import { __unstableMotion as motion } from '@wordpress/components';
|
|
18
12
|
import { useReducedMotion } from '@wordpress/compose';
|
|
19
|
-
import { isRTL } from '@wordpress/i18n';
|
|
20
13
|
|
|
21
14
|
/**
|
|
22
15
|
* Internal dependencies
|
|
23
16
|
*/
|
|
24
17
|
import Inserter from '../inserter';
|
|
25
18
|
import { store as blockEditorStore } from '../../store';
|
|
26
|
-
import
|
|
27
|
-
import { usePopoverScroll } from './use-popover-scroll';
|
|
19
|
+
import BlockPopoverInbetween from '../block-popover/inbetween';
|
|
28
20
|
|
|
29
21
|
export const InsertionPointOpenRef = createContext();
|
|
30
22
|
|
|
@@ -78,109 +70,10 @@ function InsertionPointPopover( {
|
|
|
78
70
|
isInserterShown: insertionPoint?.__unstableWithInserter,
|
|
79
71
|
};
|
|
80
72
|
}, [] );
|
|
81
|
-
const previousElement = useBlockElement( previousClientId );
|
|
82
|
-
const nextElement = useBlockElement( nextClientId );
|
|
83
73
|
const isVertical = orientation === 'vertical';
|
|
84
|
-
const style = useMemo( () => {
|
|
85
|
-
if ( ! previousElement && ! nextElement ) {
|
|
86
|
-
return {};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const previousRect = previousElement
|
|
90
|
-
? previousElement.getBoundingClientRect()
|
|
91
|
-
: null;
|
|
92
|
-
const nextRect = nextElement
|
|
93
|
-
? nextElement.getBoundingClientRect()
|
|
94
|
-
: null;
|
|
95
|
-
|
|
96
|
-
if ( isVertical ) {
|
|
97
|
-
return {
|
|
98
|
-
width: previousElement
|
|
99
|
-
? previousElement.offsetWidth
|
|
100
|
-
: nextElement.offsetWidth,
|
|
101
|
-
height:
|
|
102
|
-
nextRect && previousRect
|
|
103
|
-
? nextRect.top - previousRect.bottom
|
|
104
|
-
: 0,
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
let width = 0;
|
|
109
|
-
if ( previousRect && nextRect ) {
|
|
110
|
-
width = isRTL()
|
|
111
|
-
? previousRect.left - nextRect.right
|
|
112
|
-
: nextRect.left - previousRect.right;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return {
|
|
116
|
-
width,
|
|
117
|
-
height: previousElement
|
|
118
|
-
? previousElement.offsetHeight
|
|
119
|
-
: nextElement.offsetHeight,
|
|
120
|
-
};
|
|
121
|
-
}, [ previousElement, nextElement ] );
|
|
122
|
-
|
|
123
|
-
const getAnchorRect = useCallback( () => {
|
|
124
|
-
if ( ! previousElement && ! nextElement ) {
|
|
125
|
-
return {};
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const { ownerDocument } = previousElement || nextElement;
|
|
129
|
-
|
|
130
|
-
const previousRect = previousElement
|
|
131
|
-
? previousElement.getBoundingClientRect()
|
|
132
|
-
: null;
|
|
133
|
-
const nextRect = nextElement
|
|
134
|
-
? nextElement.getBoundingClientRect()
|
|
135
|
-
: null;
|
|
136
|
-
|
|
137
|
-
if ( isVertical ) {
|
|
138
|
-
if ( isRTL() ) {
|
|
139
|
-
return {
|
|
140
|
-
top: previousRect ? previousRect.bottom : nextRect.top,
|
|
141
|
-
left: previousRect ? previousRect.right : nextRect.right,
|
|
142
|
-
right: previousRect ? previousRect.left : nextRect.left,
|
|
143
|
-
bottom: nextRect ? nextRect.top : previousRect.bottom,
|
|
144
|
-
ownerDocument,
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return {
|
|
149
|
-
top: previousRect ? previousRect.bottom : nextRect.top,
|
|
150
|
-
left: previousRect ? previousRect.left : nextRect.left,
|
|
151
|
-
right: previousRect ? previousRect.right : nextRect.right,
|
|
152
|
-
bottom: nextRect ? nextRect.top : previousRect.bottom,
|
|
153
|
-
ownerDocument,
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
if ( isRTL() ) {
|
|
158
|
-
return {
|
|
159
|
-
top: previousRect ? previousRect.top : nextRect.top,
|
|
160
|
-
left: previousRect ? previousRect.left : nextRect.right,
|
|
161
|
-
right: nextRect ? nextRect.right : previousRect.left,
|
|
162
|
-
bottom: previousRect ? previousRect.bottom : nextRect.bottom,
|
|
163
|
-
ownerDocument,
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
74
|
|
|
167
|
-
return {
|
|
168
|
-
top: previousRect ? previousRect.top : nextRect.top,
|
|
169
|
-
left: previousRect ? previousRect.right : nextRect.left,
|
|
170
|
-
right: nextRect ? nextRect.left : previousRect.right,
|
|
171
|
-
bottom: previousRect ? previousRect.bottom : nextRect.bottom,
|
|
172
|
-
ownerDocument,
|
|
173
|
-
};
|
|
174
|
-
}, [ previousElement, nextElement ] );
|
|
175
|
-
|
|
176
|
-
const popoverScrollRef = usePopoverScroll( __unstableContentRef );
|
|
177
75
|
const disableMotion = useReducedMotion();
|
|
178
76
|
|
|
179
|
-
const className = classnames(
|
|
180
|
-
'block-editor-block-list__insertion-point',
|
|
181
|
-
'is-' + orientation
|
|
182
|
-
);
|
|
183
|
-
|
|
184
77
|
function onClick( event ) {
|
|
185
78
|
if ( event.target === ref.current && nextClientId ) {
|
|
186
79
|
selectBlock( nextClientId, -1 );
|
|
@@ -203,11 +96,6 @@ function InsertionPointPopover( {
|
|
|
203
96
|
}
|
|
204
97
|
}
|
|
205
98
|
|
|
206
|
-
// Only show the in-between inserter between blocks, so when there's a
|
|
207
|
-
// previous and a next element.
|
|
208
|
-
const showInsertionPointInserter =
|
|
209
|
-
previousElement && nextElement && isInserterShown;
|
|
210
|
-
|
|
211
99
|
// Define animation variants for the line element.
|
|
212
100
|
const horizontalLine = {
|
|
213
101
|
start: {
|
|
@@ -261,7 +149,7 @@ function InsertionPointPopover( {
|
|
|
261
149
|
...( ! isVertical ? horizontalLine.rest : verticalLine.rest ),
|
|
262
150
|
opacity: 1,
|
|
263
151
|
borderRadius: '2px',
|
|
264
|
-
transition: { delay:
|
|
152
|
+
transition: { delay: isInserterShown ? 0.4 : 0 },
|
|
265
153
|
},
|
|
266
154
|
hover: {
|
|
267
155
|
...( ! isVertical ? horizontalLine.hover : verticalLine.hover ),
|
|
@@ -281,27 +169,17 @@ function InsertionPointPopover( {
|
|
|
281
169
|
},
|
|
282
170
|
};
|
|
283
171
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
//
|
|
290
|
-
// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
|
|
172
|
+
const className = classnames(
|
|
173
|
+
'block-editor-block-list__insertion-point',
|
|
174
|
+
'is-' + orientation
|
|
175
|
+
);
|
|
176
|
+
|
|
291
177
|
return (
|
|
292
|
-
<
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
focusOnMount={ false }
|
|
298
|
-
className="block-editor-block-list__insertion-point-popover"
|
|
299
|
-
// Render in the old slot if needed for backward compatibility,
|
|
300
|
-
// otherwise render in place (not in the the default popover slot).
|
|
301
|
-
__unstableSlotName={ __unstablePopoverSlot || null }
|
|
302
|
-
// Forces a remount of the popover when its position changes
|
|
303
|
-
// This makes sure the popover doesn't animate from its previous position.
|
|
304
|
-
key={ nextClientId + '--' + rootClientId }
|
|
178
|
+
<BlockPopoverInbetween
|
|
179
|
+
previousClientId={ previousClientId }
|
|
180
|
+
nextClientId={ nextClientId }
|
|
181
|
+
__unstablePopoverSlot={ __unstablePopoverSlot }
|
|
182
|
+
__unstableContentRef={ __unstableContentRef }
|
|
305
183
|
>
|
|
306
184
|
<motion.div
|
|
307
185
|
layout={ ! disableMotion }
|
|
@@ -315,16 +193,15 @@ function InsertionPointPopover( {
|
|
|
315
193
|
onClick={ onClick }
|
|
316
194
|
onFocus={ onFocus }
|
|
317
195
|
className={ classnames( className, {
|
|
318
|
-
'is-with-inserter':
|
|
196
|
+
'is-with-inserter': isInserterShown,
|
|
319
197
|
} ) }
|
|
320
198
|
onHoverEnd={ maybeHideInserterPoint }
|
|
321
|
-
style={ style }
|
|
322
199
|
>
|
|
323
200
|
<motion.div
|
|
324
201
|
variants={ lineVariants }
|
|
325
202
|
className="block-editor-block-list__insertion-point-indicator"
|
|
326
203
|
/>
|
|
327
|
-
{
|
|
204
|
+
{ isInserterShown && (
|
|
328
205
|
<motion.div
|
|
329
206
|
variants={ inserterVariants }
|
|
330
207
|
className={ classnames(
|
|
@@ -346,28 +223,18 @@ function InsertionPointPopover( {
|
|
|
346
223
|
</motion.div>
|
|
347
224
|
) }
|
|
348
225
|
</motion.div>
|
|
349
|
-
</
|
|
226
|
+
</BlockPopoverInbetween>
|
|
350
227
|
);
|
|
351
|
-
/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
|
|
352
228
|
}
|
|
353
229
|
|
|
354
|
-
export default function InsertionPoint( {
|
|
355
|
-
children,
|
|
356
|
-
__unstablePopoverSlot,
|
|
357
|
-
__unstableContentRef,
|
|
358
|
-
} ) {
|
|
230
|
+
export default function InsertionPoint( { children, ...props } ) {
|
|
359
231
|
const isVisible = useSelect( ( select ) => {
|
|
360
232
|
return select( blockEditorStore ).isBlockInsertionPointVisible();
|
|
361
233
|
}, [] );
|
|
362
234
|
|
|
363
235
|
return (
|
|
364
236
|
<InsertionPointOpenRef.Provider value={ useRef( false ) }>
|
|
365
|
-
{ isVisible &&
|
|
366
|
-
<InsertionPointPopover
|
|
367
|
-
__unstablePopoverSlot={ __unstablePopoverSlot }
|
|
368
|
-
__unstableContentRef={ __unstableContentRef }
|
|
369
|
-
/>
|
|
370
|
-
) }
|
|
237
|
+
{ isVisible && <InsertionPointPopover { ...props } /> }
|
|
371
238
|
{ children }
|
|
372
239
|
</InsertionPointOpenRef.Provider>
|
|
373
240
|
);
|
|
@@ -9,11 +9,9 @@ import classnames from 'classnames';
|
|
|
9
9
|
*/
|
|
10
10
|
import { useState, useRef, useEffect } from '@wordpress/element';
|
|
11
11
|
import { isUnmodifiedDefaultBlock } from '@wordpress/blocks';
|
|
12
|
-
import { Popover } from '@wordpress/components';
|
|
13
12
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
14
13
|
import { useShortcut } from '@wordpress/keyboard-shortcuts';
|
|
15
14
|
import { useViewportMatch } from '@wordpress/compose';
|
|
16
|
-
import { getScrollContainer } from '@wordpress/dom';
|
|
17
15
|
|
|
18
16
|
/**
|
|
19
17
|
* Internal dependencies
|
|
@@ -22,8 +20,7 @@ import BlockSelectionButton from './block-selection-button';
|
|
|
22
20
|
import BlockContextualToolbar from './block-contextual-toolbar';
|
|
23
21
|
import Inserter from '../inserter';
|
|
24
22
|
import { store as blockEditorStore } from '../../store';
|
|
25
|
-
import
|
|
26
|
-
import { usePopoverScroll } from './use-popover-scroll';
|
|
23
|
+
import BlockPopover from '../block-popover';
|
|
27
24
|
|
|
28
25
|
function selector( select ) {
|
|
29
26
|
const {
|
|
@@ -31,7 +28,6 @@ function selector( select ) {
|
|
|
31
28
|
isMultiSelecting,
|
|
32
29
|
hasMultiSelection,
|
|
33
30
|
isTyping,
|
|
34
|
-
isCaretWithinFormattedText,
|
|
35
31
|
getSettings,
|
|
36
32
|
getLastMultiSelectedBlockClientId,
|
|
37
33
|
} = select( blockEditorStore );
|
|
@@ -39,17 +35,16 @@ function selector( select ) {
|
|
|
39
35
|
isNavigationMode: isNavigationMode(),
|
|
40
36
|
isMultiSelecting: isMultiSelecting(),
|
|
41
37
|
isTyping: isTyping(),
|
|
42
|
-
isCaretWithinFormattedText: isCaretWithinFormattedText(),
|
|
43
|
-
hasMultiSelection: hasMultiSelection(),
|
|
44
38
|
hasFixedToolbar: getSettings().hasFixedToolbar,
|
|
45
|
-
lastClientId:
|
|
39
|
+
lastClientId: hasMultiSelection()
|
|
40
|
+
? getLastMultiSelectedBlockClientId()
|
|
41
|
+
: null,
|
|
46
42
|
};
|
|
47
43
|
}
|
|
48
44
|
|
|
49
|
-
function
|
|
45
|
+
function SelectedBlockPopover( {
|
|
50
46
|
clientId,
|
|
51
47
|
rootClientId,
|
|
52
|
-
isValid,
|
|
53
48
|
isEmptyDefaultBlock,
|
|
54
49
|
capturingClientId,
|
|
55
50
|
__unstablePopoverSlot,
|
|
@@ -59,8 +54,6 @@ function BlockPopover( {
|
|
|
59
54
|
isNavigationMode,
|
|
60
55
|
isMultiSelecting,
|
|
61
56
|
isTyping,
|
|
62
|
-
isCaretWithinFormattedText,
|
|
63
|
-
hasMultiSelection,
|
|
64
57
|
hasFixedToolbar,
|
|
65
58
|
lastClientId,
|
|
66
59
|
} = useSelect( selector, [] );
|
|
@@ -83,22 +76,20 @@ function BlockPopover( {
|
|
|
83
76
|
[ clientId ]
|
|
84
77
|
);
|
|
85
78
|
const isLargeViewport = useViewportMatch( 'medium' );
|
|
86
|
-
const
|
|
79
|
+
const isToolbarForced = useRef( false );
|
|
87
80
|
const [ isInserterShown, setIsInserterShown ] = useState( false );
|
|
88
81
|
const { stopTyping } = useDispatch( blockEditorStore );
|
|
89
82
|
|
|
90
|
-
// Controls when the side inserter on empty lines should
|
|
91
|
-
// be shown, including writing and selection modes.
|
|
92
83
|
const showEmptyBlockSideInserter =
|
|
93
|
-
! isTyping && ! isNavigationMode && isEmptyDefaultBlock
|
|
84
|
+
! isTyping && ! isNavigationMode && isEmptyDefaultBlock;
|
|
94
85
|
const shouldShowBreadcrumb = isNavigationMode;
|
|
95
86
|
const shouldShowContextualToolbar =
|
|
96
87
|
! isNavigationMode &&
|
|
97
88
|
! hasFixedToolbar &&
|
|
98
89
|
isLargeViewport &&
|
|
99
|
-
! showEmptyBlockSideInserter &&
|
|
100
90
|
! isMultiSelecting &&
|
|
101
|
-
|
|
91
|
+
! showEmptyBlockSideInserter &&
|
|
92
|
+
! isTyping;
|
|
102
93
|
const canFocusHiddenToolbar =
|
|
103
94
|
! isNavigationMode &&
|
|
104
95
|
! shouldShowContextualToolbar &&
|
|
@@ -108,7 +99,7 @@ function BlockPopover( {
|
|
|
108
99
|
useShortcut(
|
|
109
100
|
'core/block-editor/focus-toolbar',
|
|
110
101
|
() => {
|
|
111
|
-
|
|
102
|
+
isToolbarForced.current = true;
|
|
112
103
|
stopTyping( true );
|
|
113
104
|
},
|
|
114
105
|
{
|
|
@@ -117,55 +108,17 @@ function BlockPopover( {
|
|
|
117
108
|
);
|
|
118
109
|
|
|
119
110
|
useEffect( () => {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
}, [ shouldShowContextualToolbar ] );
|
|
111
|
+
isToolbarForced.current = false;
|
|
112
|
+
} );
|
|
124
113
|
|
|
125
114
|
// Stores the active toolbar item index so the block toolbar can return focus
|
|
126
115
|
// to it when re-mounting.
|
|
127
116
|
const initialToolbarItemIndexRef = useRef();
|
|
128
117
|
|
|
129
|
-
|
|
130
|
-
const lastSelectedElement = useBlockElement( lastClientId );
|
|
131
|
-
const capturingElement = useBlockElement( capturingClientId );
|
|
132
|
-
|
|
133
|
-
const popoverScrollRef = usePopoverScroll( __unstableContentRef );
|
|
134
|
-
|
|
135
|
-
if (
|
|
136
|
-
! shouldShowBreadcrumb &&
|
|
137
|
-
! shouldShowContextualToolbar &&
|
|
138
|
-
! isToolbarForced &&
|
|
139
|
-
! showEmptyBlockSideInserter
|
|
140
|
-
) {
|
|
118
|
+
if ( ! shouldShowBreadcrumb && ! shouldShowContextualToolbar ) {
|
|
141
119
|
return null;
|
|
142
120
|
}
|
|
143
121
|
|
|
144
|
-
let node = selectedElement;
|
|
145
|
-
|
|
146
|
-
if ( ! node ) {
|
|
147
|
-
return null;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if ( capturingClientId ) {
|
|
151
|
-
node = capturingElement;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
let anchorRef = node;
|
|
155
|
-
|
|
156
|
-
if ( hasMultiSelection ) {
|
|
157
|
-
// Wait to render the popover until the bottom reference is available
|
|
158
|
-
// as well.
|
|
159
|
-
if ( ! lastSelectedElement ) {
|
|
160
|
-
return null;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
anchorRef = {
|
|
164
|
-
top: node,
|
|
165
|
-
bottom: lastSelectedElement,
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
|
|
169
122
|
function onFocus() {
|
|
170
123
|
setIsInserterShown( true );
|
|
171
124
|
}
|
|
@@ -174,48 +127,17 @@ function BlockPopover( {
|
|
|
174
127
|
setIsInserterShown( false );
|
|
175
128
|
}
|
|
176
129
|
|
|
177
|
-
// Position above the anchor, pop out towards the right, and position in the
|
|
178
|
-
// left corner. For the side inserter, pop out towards the left, and
|
|
179
|
-
// position in the right corner.
|
|
180
|
-
// To do: refactor `Popover` to make this prop clearer.
|
|
181
|
-
const popoverPosition = showEmptyBlockSideInserter
|
|
182
|
-
? 'top left right'
|
|
183
|
-
: 'top right left';
|
|
184
|
-
const { ownerDocument } = node;
|
|
185
|
-
const stickyBoundaryElement = showEmptyBlockSideInserter
|
|
186
|
-
? undefined
|
|
187
|
-
: // The sticky boundary element should be the boundary at which the
|
|
188
|
-
// the block toolbar becomes sticky when the block scolls out of view.
|
|
189
|
-
// In case of an iframe, this should be the iframe boundary, otherwise
|
|
190
|
-
// the scroll container.
|
|
191
|
-
ownerDocument.defaultView.frameElement ||
|
|
192
|
-
getScrollContainer( node ) ||
|
|
193
|
-
ownerDocument.body;
|
|
194
|
-
|
|
195
130
|
return (
|
|
196
|
-
<
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
animate={ false }
|
|
200
|
-
position={ popoverPosition }
|
|
201
|
-
focusOnMount={ false }
|
|
202
|
-
anchorRef={ anchorRef }
|
|
131
|
+
<BlockPopover
|
|
132
|
+
clientId={ capturingClientId || clientId }
|
|
133
|
+
bottomClientId={ lastClientId }
|
|
203
134
|
className={ classnames( 'block-editor-block-list__block-popover', {
|
|
204
135
|
'is-insertion-point-visible': isInsertionPointVisible,
|
|
205
136
|
} ) }
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
// otherwise render in place (not in the the default popover slot).
|
|
209
|
-
__unstableSlotName={ __unstablePopoverSlot || null }
|
|
210
|
-
__unstableBoundaryParent
|
|
211
|
-
// Observe movement for block animations (especially horizontal).
|
|
212
|
-
__unstableObserveElement={ node }
|
|
213
|
-
shouldAnchorIncludePadding
|
|
214
|
-
// Used to safeguard sticky position behavior against cases where it would permanently
|
|
215
|
-
// obscure specific sections of a block.
|
|
216
|
-
__unstableEditorCanvasWrapper={ __unstableContentRef?.current }
|
|
137
|
+
__unstablePopoverSlot={ __unstablePopoverSlot }
|
|
138
|
+
__unstableContentRef={ __unstableContentRef }
|
|
217
139
|
>
|
|
218
|
-
{
|
|
140
|
+
{ shouldShowContextualToolbar && (
|
|
219
141
|
<div
|
|
220
142
|
onFocus={ onFocus }
|
|
221
143
|
onBlur={ onBlur }
|
|
@@ -240,11 +162,11 @@ function BlockPopover( {
|
|
|
240
162
|
/>
|
|
241
163
|
</div>
|
|
242
164
|
) }
|
|
243
|
-
{
|
|
165
|
+
{ shouldShowContextualToolbar && (
|
|
244
166
|
<BlockContextualToolbar
|
|
245
167
|
// If the toolbar is being shown because of being forced
|
|
246
168
|
// it should focus the toolbar right after the mount.
|
|
247
|
-
focusOnMount={ isToolbarForced }
|
|
169
|
+
focusOnMount={ isToolbarForced.current }
|
|
248
170
|
__experimentalInitialIndex={
|
|
249
171
|
initialToolbarItemIndexRef.current
|
|
250
172
|
}
|
|
@@ -260,20 +182,9 @@ function BlockPopover( {
|
|
|
260
182
|
<BlockSelectionButton
|
|
261
183
|
clientId={ clientId }
|
|
262
184
|
rootClientId={ rootClientId }
|
|
263
|
-
blockElement={ node }
|
|
264
185
|
/>
|
|
265
186
|
) }
|
|
266
|
-
|
|
267
|
-
<div className="block-editor-block-list__empty-block-inserter">
|
|
268
|
-
<Inserter
|
|
269
|
-
position="bottom right"
|
|
270
|
-
rootClientId={ rootClientId }
|
|
271
|
-
clientId={ clientId }
|
|
272
|
-
__experimentalIsQuick
|
|
273
|
-
/>
|
|
274
|
-
</div>
|
|
275
|
-
) }
|
|
276
|
-
</Popover>
|
|
187
|
+
</BlockPopover>
|
|
277
188
|
);
|
|
278
189
|
}
|
|
279
190
|
|
|
@@ -294,7 +205,7 @@ function wrapperSelector( select ) {
|
|
|
294
205
|
return;
|
|
295
206
|
}
|
|
296
207
|
|
|
297
|
-
const { name, attributes = {}
|
|
208
|
+
const { name, attributes = {} } = getBlock( clientId ) || {};
|
|
298
209
|
const blockParentsClientIds = getBlockParents( clientId );
|
|
299
210
|
|
|
300
211
|
// Get Block List Settings for all ancestors of the current Block clientId.
|
|
@@ -314,7 +225,6 @@ function wrapperSelector( select ) {
|
|
|
314
225
|
clientId,
|
|
315
226
|
rootClientId: getBlockRootClientId( clientId ),
|
|
316
227
|
name,
|
|
317
|
-
isValid,
|
|
318
228
|
isEmptyDefaultBlock:
|
|
319
229
|
name && isUnmodifiedDefaultBlock( { name, attributes } ),
|
|
320
230
|
capturingClientId,
|
|
@@ -335,7 +245,6 @@ export default function WrappedBlockPopover( {
|
|
|
335
245
|
clientId,
|
|
336
246
|
rootClientId,
|
|
337
247
|
name,
|
|
338
|
-
isValid,
|
|
339
248
|
isEmptyDefaultBlock,
|
|
340
249
|
capturingClientId,
|
|
341
250
|
} = selected;
|
|
@@ -345,10 +254,9 @@ export default function WrappedBlockPopover( {
|
|
|
345
254
|
}
|
|
346
255
|
|
|
347
256
|
return (
|
|
348
|
-
<
|
|
257
|
+
<SelectedBlockPopover
|
|
349
258
|
clientId={ clientId }
|
|
350
259
|
rootClientId={ rootClientId }
|
|
351
|
-
isValid={ isValid }
|
|
352
260
|
isEmptyDefaultBlock={ isEmptyDefaultBlock }
|
|
353
261
|
capturingClientId={ capturingClientId }
|
|
354
262
|
__unstablePopoverSlot={ __unstablePopoverSlot }
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
.block-editor-block-list__insertion-point {
|
|
6
6
|
position: absolute;
|
|
7
|
+
top: 0;
|
|
8
|
+
bottom: 0;
|
|
9
|
+
left: 0;
|
|
10
|
+
right: 0;
|
|
7
11
|
}
|
|
8
12
|
|
|
9
13
|
.block-editor-block-list__insertion-point-indicator {
|
|
@@ -49,7 +53,6 @@
|
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
// Sibling inserter / "inbetweenserter".
|
|
52
|
-
.block-editor-block-list__empty-block-inserter,
|
|
53
56
|
.block-editor-default-block-appender,
|
|
54
57
|
.block-editor-block-list__insertion-point-inserter,
|
|
55
58
|
.block-editor-block-list__block-popover-inserter {
|
|
@@ -98,7 +101,7 @@
|
|
|
98
101
|
position: sticky;
|
|
99
102
|
top: 0;
|
|
100
103
|
width: 100%;
|
|
101
|
-
z-index: z-index(".block-editor-block-
|
|
104
|
+
z-index: z-index(".block-editor-block-popover");
|
|
102
105
|
// Fill up when empty
|
|
103
106
|
min-height: $block-toolbar-height;
|
|
104
107
|
display: block;
|
|
@@ -112,42 +115,6 @@
|
|
|
112
115
|
border-right-color: $gray-200;
|
|
113
116
|
}
|
|
114
117
|
}
|
|
115
|
-
|
|
116
|
-
.block-editor-block-mover-button {
|
|
117
|
-
overflow: hidden;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// Extra specificity to override standard toolbar button styles.
|
|
121
|
-
.block-editor-block-mover.is-horizontal .block-editor-block-mover-button.block-editor-block-mover-button {
|
|
122
|
-
min-width: $block-toolbar-height*0.5;
|
|
123
|
-
width: $block-toolbar-height*0.5;
|
|
124
|
-
|
|
125
|
-
svg {
|
|
126
|
-
min-width: $block-toolbar-height*0.5;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// Position mover arrows for both toolbars.
|
|
132
|
-
.block-editor-block-contextual-toolbar .block-editor-block-mover:not(.is-horizontal) {
|
|
133
|
-
// Position SVGs.
|
|
134
|
-
.block-editor-block-mover-button {
|
|
135
|
-
&:focus::before {
|
|
136
|
-
left: 0 !important;
|
|
137
|
-
min-width: 0;
|
|
138
|
-
width: 100%;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
@include break-small() {
|
|
143
|
-
.block-editor-block-mover-button.is-up-button svg {
|
|
144
|
-
top: 5px;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.block-editor-block-mover-button.is-down-button svg {
|
|
148
|
-
bottom: 5px;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
118
|
}
|
|
152
119
|
|
|
153
120
|
/**
|
|
@@ -217,37 +184,6 @@
|
|
|
217
184
|
}
|
|
218
185
|
}
|
|
219
186
|
|
|
220
|
-
/**
|
|
221
|
-
* Popovers.
|
|
222
|
-
*/
|
|
223
|
-
|
|
224
|
-
.block-editor-block-list__insertion-point-popover.is-without-arrow {
|
|
225
|
-
z-index: z-index(".block-editor-block-list__insertion-point-popover");
|
|
226
|
-
position: absolute;
|
|
227
|
-
pointer-events: none;
|
|
228
|
-
|
|
229
|
-
* {
|
|
230
|
-
pointer-events: none;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
.is-with-inserter {
|
|
234
|
-
pointer-events: all;
|
|
235
|
-
|
|
236
|
-
* {
|
|
237
|
-
pointer-events: all;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
.components-popover__content.components-popover__content {
|
|
242
|
-
// Needs specificity.
|
|
243
|
-
background: none;
|
|
244
|
-
border: none;
|
|
245
|
-
box-shadow: none;
|
|
246
|
-
overflow-y: visible;
|
|
247
|
-
margin-left: 0;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
187
|
// Hide the popover block editor list while dragging.
|
|
252
188
|
// Using a hacky animation to delay hiding the element.
|
|
253
189
|
// It's needed because if we hide the element immediately upon dragging,
|
|
@@ -262,33 +198,12 @@
|
|
|
262
198
|
}
|
|
263
199
|
|
|
264
200
|
.components-popover.block-editor-block-list__block-popover {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
margin:
|
|
270
|
-
|
|
271
|
-
width: max-content;
|
|
272
|
-
background: none;
|
|
273
|
-
border: none;
|
|
274
|
-
box-shadow: none;
|
|
275
|
-
overflow-y: visible;
|
|
276
|
-
|
|
277
|
-
// Allow clicking through the toolbar holder.
|
|
278
|
-
pointer-events: none;
|
|
279
|
-
|
|
280
|
-
.block-editor-block-list__block-selection-button,
|
|
281
|
-
.block-editor-block-contextual-toolbar,
|
|
282
|
-
.block-editor-block-list__empty-block-inserter {
|
|
283
|
-
pointer-events: all;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
// Position the block toolbar.
|
|
287
|
-
.block-editor-block-list__block-selection-button,
|
|
288
|
-
.block-editor-block-contextual-toolbar {
|
|
289
|
-
margin-top: $grid-unit-15;
|
|
290
|
-
margin-bottom: $grid-unit-15;
|
|
291
|
-
}
|
|
201
|
+
// Position the block toolbar.
|
|
202
|
+
.block-editor-block-list__block-selection-button,
|
|
203
|
+
.block-editor-block-contextual-toolbar {
|
|
204
|
+
pointer-events: all;
|
|
205
|
+
margin-top: $grid-unit-15;
|
|
206
|
+
margin-bottom: $grid-unit-15;
|
|
292
207
|
}
|
|
293
208
|
|
|
294
209
|
// Hide the block toolbar if the insertion point is shown.
|
|
@@ -307,30 +222,3 @@
|
|
|
307
222
|
.is-dragging-components-draggable .components-tooltip {
|
|
308
223
|
display: none;
|
|
309
224
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
// Size multiple sequential buttons to be optically balanced.
|
|
313
|
-
// Icons are 36px, as set by a 24px icon and 12px padding.
|
|
314
|
-
.block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot, // When a plugin adds to a slot, the segment has a `components-toolbar` class.
|
|
315
|
-
.block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar, // The nesting order is sometimes reversed.
|
|
316
|
-
.block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown, // Targets unique markup for the "Replace" button.
|
|
317
|
-
.block-editor-block-toolbar .components-toolbar-group {
|
|
318
|
-
padding-left: $grid-unit-15 * 0.5; // 6px.
|
|
319
|
-
padding-right: $grid-unit-15 * 0.5;
|
|
320
|
-
|
|
321
|
-
.components-button,
|
|
322
|
-
.components-button.has-icon.has-icon {
|
|
323
|
-
min-width: $block-toolbar-height - $grid-unit-15;
|
|
324
|
-
padding-left: $grid-unit-15 * 0.5; // 6px.
|
|
325
|
-
padding-right: $grid-unit-15 * 0.5;
|
|
326
|
-
|
|
327
|
-
svg {
|
|
328
|
-
min-width: $button-size-small; // This is the optimal icon size, and we size the whole button after this.
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
&::before {
|
|
332
|
-
left: 2px;
|
|
333
|
-
right: 2px;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|