@wordpress/block-editor 10.2.0 → 10.3.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 +12 -0
- package/README.md +41 -0
- package/build/components/block-draggable/draggable-chip.js +4 -2
- package/build/components/block-draggable/draggable-chip.js.map +1 -1
- package/build/components/block-inspector/index.js +4 -4
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block-list-compact.native.js +1 -0
- package/build/components/block-list/block-list-compact.native.js.map +1 -1
- package/build/components/block-list/block.js +72 -14
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +79 -12
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +7 -23
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-lock/modal.js +9 -6
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-parent-selector/index.js +3 -3
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-patterns-list/index.js +5 -4
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-popover/drop-zone.js +85 -0
- package/build/components/block-popover/drop-zone.js.map +1 -0
- package/build/components/block-popover/index.js +2 -1
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-preview/auto.js +2 -2
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-preview/index.js +6 -9
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-preview/live.js +3 -7
- package/build/components/block-preview/live.js.map +1 -1
- package/build/components/block-selection-clearer/index.js +9 -1
- package/build/components/block-selection-clearer/index.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +17 -11
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-styles/index.js +18 -42
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +4 -4
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/back-compat.js +2 -1
- package/build/components/block-tools/back-compat.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +50 -20
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +15 -3
- package/build/components/block-tools/selected-block-popover.js.map +1 -1
- package/build/components/colors-gradients/control.js +1 -1
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.js +2 -2
- package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js +256 -0
- package/build/components/font-sizes/fluid-utils.js.map +1 -0
- package/build/components/font-sizes/index.js +8 -0
- package/build/components/font-sizes/index.js.map +1 -1
- package/build/components/index.js +0 -9
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.js +3 -2
- package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build/components/inserter/block-patterns-tab.js +151 -78
- package/build/components/inserter/block-patterns-tab.js.map +1 -1
- package/build/components/inserter/menu.js +14 -3
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +4 -2
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/list-view/use-list-view-drop-zone.js +1 -14
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/preview-options/index.js +2 -3
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/spacing-sizes-control/spacing-input-control.js +35 -5
- package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +98 -57
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +12 -12
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-on-block-drop/types.js +6 -0
- package/build/components/use-on-block-drop/types.js.map +1 -0
- package/build/hooks/align.js +1 -3
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/align.native.js +1 -7
- package/build/hooks/align.native.js.map +1 -1
- package/build/hooks/font-size.js +60 -0
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/margin.js +6 -5
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/padding.js +2 -1
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/style.js +126 -4
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/use-typography-props.js +17 -3
- package/build/hooks/use-typography-props.js.map +1 -1
- package/build/hooks/utils.js +1 -1
- package/build/hooks/utils.js.map +1 -1
- package/build/store/actions.js +59 -45
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +3 -0
- package/build/store/defaults.js.map +1 -1
- package/build/store/reducer.js +31 -15
- package/build/store/reducer.js.map +1 -1
- package/build/utils/math.js +14 -0
- package/build/utils/math.js.map +1 -1
- package/build/utils/pre-parse-patterns.js +19 -2
- package/build/utils/pre-parse-patterns.js.map +1 -1
- package/build-module/components/block-draggable/draggable-chip.js +7 -3
- package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
- package/build-module/components/block-inspector/index.js +4 -4
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block-list-compact.native.js +1 -0
- package/build-module/components/block-list/block-list-compact.native.js.map +1 -1
- package/build-module/components/block-list/block.js +72 -14
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +80 -13
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +8 -24
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-lock/modal.js +10 -8
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-parent-selector/index.js +3 -3
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +5 -4
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-popover/drop-zone.js +70 -0
- package/build-module/components/block-popover/drop-zone.js.map +1 -0
- package/build-module/components/block-popover/index.js +2 -1
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-preview/auto.js +1 -1
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-preview/index.js +6 -9
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-preview/live.js +3 -6
- package/build-module/components/block-preview/live.js.map +1 -1
- package/build-module/components/block-selection-clearer/index.js +9 -1
- package/build-module/components/block-selection-clearer/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +18 -12
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-styles/index.js +19 -44
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +4 -4
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/back-compat.js +2 -1
- package/build-module/components/block-tools/back-compat.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +48 -20
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +15 -3
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +2 -2
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js +3 -3
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js +245 -0
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -0
- package/build-module/components/font-sizes/index.js +1 -0
- package/build-module/components/font-sizes/index.js.map +1 -1
- package/build-module/components/index.js +0 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js +3 -2
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab.js +148 -81
- package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
- package/build-module/components/inserter/menu.js +10 -3
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +4 -2
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js +1 -14
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/preview-options/index.js +2 -3
- package/build-module/components/preview-options/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/spacing-input-control.js +34 -5
- package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +98 -58
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +12 -12
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/types.js +2 -0
- package/build-module/components/use-on-block-drop/types.js.map +1 -0
- package/build-module/hooks/align.js +1 -2
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/align.native.js +1 -6
- package/build-module/hooks/align.native.js.map +1 -1
- package/build-module/hooks/font-size.js +59 -1
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/margin.js +6 -5
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/padding.js +2 -1
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/style.js +124 -3
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/use-typography-props.js +17 -4
- package/build-module/hooks/use-typography-props.js.map +1 -1
- package/build-module/hooks/utils.js +2 -2
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/store/actions.js +55 -42
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +3 -0
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/reducer.js +32 -16
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/utils/math.js +12 -0
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/pre-parse-patterns.js +19 -2
- package/build-module/utils/pre-parse-patterns.js.map +1 -1
- package/build-style/style-rtl.css +243 -144
- package/build-style/style.css +243 -144
- package/package.json +28 -28
- package/src/components/block-breadcrumb/test/index.js +1 -1
- package/src/components/block-draggable/draggable-chip.js +4 -2
- package/src/components/block-inspector/index.js +8 -7
- package/src/components/block-list/block-list-compact.native.js +1 -0
- package/src/components/block-list/block.js +111 -7
- package/src/components/block-list/block.native.js +123 -9
- package/src/components/block-list/style.scss +93 -126
- package/src/components/block-list/use-in-between-inserter.js +8 -19
- package/src/components/block-lock/modal.js +12 -7
- package/src/components/block-mover/style.scss +0 -1
- package/src/components/block-parent-selector/index.js +3 -3
- package/src/components/block-patterns-list/index.js +9 -5
- package/src/components/block-patterns-list/style.scss +7 -3
- package/src/components/block-popover/README.md +8 -0
- package/src/components/block-popover/drop-zone.js +63 -0
- package/src/components/block-popover/index.js +2 -1
- package/src/components/block-popover/style.scss +17 -1
- package/src/components/block-preview/auto.js +1 -1
- package/src/components/block-preview/index.js +7 -8
- package/src/components/block-preview/live.js +2 -7
- package/src/components/block-preview/test/index.js +1 -7
- package/src/components/block-selection-clearer/index.js +7 -2
- package/src/components/block-selection-clearer/test/index.js +118 -0
- package/src/components/block-settings-menu/block-settings-dropdown.js +25 -11
- package/src/components/block-settings-menu/test/block-mode-toggle.js +17 -17
- package/src/components/block-styles/index.js +26 -49
- package/src/components/block-switcher/test/index.js +2 -2
- package/src/components/block-toolbar/index.js +4 -6
- package/src/components/block-toolbar/style.scss +38 -14
- package/src/components/block-tools/back-compat.js +1 -0
- package/src/components/block-tools/insertion-point.js +42 -17
- package/src/components/block-tools/selected-block-popover.js +14 -1
- package/src/components/button-block-appender/style.scss +4 -2
- package/src/components/color-palette/test/__snapshots__/control.js.snap +32 -52
- package/src/components/color-palette/test/control.js +11 -15
- package/src/components/colors-gradients/control.js +2 -2
- package/src/components/colors-gradients/panel-color-gradient-settings.js +3 -4
- package/src/components/colors-gradients/test/control.js +49 -77
- package/src/components/font-sizes/fluid-utils.js +296 -0
- package/src/components/font-sizes/index.js +1 -0
- package/src/components/font-sizes/test/fluid-utils.js +168 -0
- package/src/components/image-size-control/test/index.js +47 -60
- package/src/components/index.js +0 -1
- package/src/components/inner-blocks/use-inner-block-template-sync.js +3 -2
- package/src/components/inserter/block-patterns-tab.js +232 -98
- package/src/components/inserter/menu.js +15 -2
- package/src/components/inserter/style.scss +94 -9
- package/src/components/inserter/test/reusable-blocks-tab.js +6 -6
- package/src/components/inserter-draggable-blocks/index.js +12 -2
- package/src/components/inserter-list-item/style.scss +20 -1
- package/src/components/link-control/test/index.js +1 -1
- package/src/components/list-view/use-list-view-drop-zone.js +4 -18
- package/src/components/panel-color-settings/test/index.js +4 -4
- package/src/components/preview-options/index.js +2 -2
- package/src/components/preview-options/style.scss +1 -1
- package/src/components/provider/test/use-block-sync.js +131 -165
- package/src/components/responsive-block-control/test/index.js +4 -4
- package/src/components/spacing-sizes-control/spacing-input-control.js +16 -2
- package/src/components/spacing-sizes-control/style.scss +26 -19
- package/src/components/use-block-drop-zone/index.js +136 -79
- package/src/components/use-block-drop-zone/test/index.js +333 -81
- package/src/components/use-on-block-drop/index.js +11 -12
- package/src/components/use-on-block-drop/types.ts +1 -0
- package/src/hooks/align.js +3 -2
- package/src/hooks/align.native.js +5 -8
- package/src/hooks/font-size.js +75 -0
- package/src/hooks/margin.js +5 -4
- package/src/hooks/padding.js +1 -0
- package/src/hooks/style.js +122 -3
- package/src/hooks/test/style.js +206 -1
- package/src/hooks/test/use-typography-props.js +22 -0
- package/src/hooks/use-typography-props.js +18 -3
- package/src/hooks/utils.js +6 -2
- package/src/store/actions.js +20 -12
- package/src/store/defaults.js +3 -0
- package/src/store/reducer.js +31 -24
- package/src/store/test/actions.js +0 -9
- package/src/utils/math.js +17 -0
- package/src/utils/pre-parse-patterns.js +12 -7
- package/build/components/inserter/pattern-panel.js +0 -87
- package/build/components/inserter/pattern-panel.js.map +0 -1
- package/build-module/components/inserter/pattern-panel.js +0 -74
- package/build-module/components/inserter/pattern-panel.js.map +0 -1
- package/src/components/inserter/pattern-panel.js +0 -93
|
@@ -8,8 +8,19 @@
|
|
|
8
8
|
* Cross-Block Selection
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
@keyframes selection-overlay__fade-in-animation {
|
|
12
|
+
from {
|
|
13
|
+
opacity: 0;
|
|
14
|
+
}
|
|
15
|
+
to {
|
|
16
|
+
opacity: 0.4;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
11
20
|
// Note to developers refactoring this, please test navigation mode, and
|
|
12
21
|
// multi selection and hovering the block switcher to highlight the block.
|
|
22
|
+
// Also be sure to test partial selections in Safari, as it draws the
|
|
23
|
+
// selection marker with an entirely different model than Blink.
|
|
13
24
|
.block-editor-block-list__layout {
|
|
14
25
|
position: relative;
|
|
15
26
|
|
|
@@ -19,63 +30,93 @@
|
|
|
19
30
|
background: transparent;
|
|
20
31
|
}
|
|
21
32
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
33
|
+
.has-multi-selection &::selection {
|
|
34
|
+
background: transparent;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Block multi selection
|
|
38
|
+
.block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) {
|
|
39
|
+
// Apply a rounded radius to the entire block.
|
|
40
|
+
border-radius: $radius-block-ui;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
|
|
43
|
+
// Hide the native selection indicator, for the selection, and children.
|
|
44
|
+
&::selection,
|
|
45
|
+
& ::selection {
|
|
46
|
+
background: transparent;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Draw a spot color overlay.
|
|
27
50
|
&::after {
|
|
28
|
-
|
|
51
|
+
content: "";
|
|
29
52
|
position: absolute;
|
|
30
53
|
z-index: 1;
|
|
31
54
|
pointer-events: none;
|
|
55
|
+
top: 0;
|
|
56
|
+
right: 0;
|
|
57
|
+
bottom: 0;
|
|
58
|
+
left: 0;
|
|
59
|
+
background: var(--wp-admin-theme-color);
|
|
60
|
+
opacity: 0.4;
|
|
61
|
+
border-radius: $radius-block-ui;
|
|
62
|
+
|
|
63
|
+
// Animate.
|
|
64
|
+
animation: selection-overlay__fade-in-animation 0.1s ease-out;
|
|
65
|
+
animation-fill-mode: forwards;
|
|
66
|
+
@include reduce-motion("animation");
|
|
67
|
+
|
|
68
|
+
// Show outline in high contrast mode.
|
|
69
|
+
outline: 2px solid transparent;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Block highlight, and navigation mode, not focus.
|
|
74
|
+
// By not using a pseudo element, we can limit ourselves to only
|
|
75
|
+
// using ::after, leaving ::before free. Otherwise, highlight + multi-select
|
|
76
|
+
// would require the opacity-changing overlay to be on ::before.
|
|
77
|
+
.block-editor-block-list__block.is-highlighted,
|
|
78
|
+
.block-editor-block-list__block.is-highlighted ~ .is-multi-selected,
|
|
79
|
+
&.is-navigate-mode .block-editor-block-list__block.is-selected,
|
|
80
|
+
& .is-block-moving-mode.block-editor-block-list__block.has-child-selected {
|
|
81
|
+
border-radius: $radius-block-ui;
|
|
82
|
+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
83
|
+
|
|
84
|
+
// Show outline in high contrast mode.
|
|
85
|
+
outline: 2px solid transparent;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Block focus.
|
|
89
|
+
.block-editor-block-list__block:not([contenteditable]):focus {
|
|
90
|
+
outline: none;
|
|
91
|
+
|
|
92
|
+
// We're using a pseudo element to overflow placeholder borders
|
|
93
|
+
// and any border inside the block itself.
|
|
94
|
+
&::after {
|
|
32
95
|
content: "";
|
|
96
|
+
position: absolute;
|
|
97
|
+
z-index: 1;
|
|
98
|
+
pointer-events: none;
|
|
33
99
|
top: $border-width;
|
|
100
|
+
right: $border-width;
|
|
34
101
|
bottom: $border-width;
|
|
35
102
|
left: $border-width;
|
|
36
|
-
right: $border-width;
|
|
37
|
-
|
|
38
|
-
// Everything else.
|
|
39
103
|
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
40
104
|
border-radius: $radius-block-ui - $border-width; // Border is outset, so subtract the width to achieve correct radius.
|
|
105
|
+
outline: 2px solid transparent; // This shows up in Windows High Contrast Mode.
|
|
41
106
|
|
|
42
|
-
//
|
|
43
|
-
outline: 2px solid transparent;
|
|
44
|
-
|
|
45
|
-
// Show a lighter color for dark themes.
|
|
107
|
+
// Show a light color for dark themes.
|
|
46
108
|
.is-dark-theme & {
|
|
47
|
-
box-shadow: 0 0 0
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Provide exceptions for placeholders.
|
|
52
|
-
.components-placeholder,
|
|
53
|
-
.block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) {
|
|
54
|
-
::selection {
|
|
55
|
-
background: transparent;
|
|
109
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) $dark-theme-focus;
|
|
56
110
|
}
|
|
57
111
|
}
|
|
58
112
|
}
|
|
59
113
|
|
|
60
|
-
//
|
|
61
|
-
.has-multi-selection &::selection {
|
|
62
|
-
background: transparent;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.block-editor-block-list__block.is-highlighted::after {
|
|
66
|
-
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
67
|
-
outline: $border-width solid transparent;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
&.is-navigate-mode .block-editor-block-list__block.is-selected::after,
|
|
71
|
-
& .is-block-moving-mode.block-editor-block-list__block.has-child-selected {
|
|
72
|
-
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
73
|
-
outline: 2px solid transparent;
|
|
74
|
-
}
|
|
75
|
-
|
|
114
|
+
// Moving blocks using keyboard (Ellipsis > Move).
|
|
76
115
|
& .is-block-moving-mode.block-editor-block-list__block.is-selected {
|
|
116
|
+
box-shadow: none;
|
|
117
|
+
outline: none;
|
|
77
118
|
|
|
78
|
-
&::
|
|
119
|
+
&::after {
|
|
79
120
|
content: "";
|
|
80
121
|
position: absolute;
|
|
81
122
|
z-index: 0;
|
|
@@ -90,14 +131,10 @@
|
|
|
90
131
|
border-radius: $radius-block-ui;
|
|
91
132
|
border-top: 4px solid $gray-400;
|
|
92
133
|
}
|
|
93
|
-
|
|
94
|
-
&::after {
|
|
95
|
-
content: none;
|
|
96
|
-
}
|
|
97
134
|
}
|
|
98
135
|
|
|
99
136
|
& .is-block-moving-mode.can-insert-moving-block.block-editor-block-list__block.is-selected {
|
|
100
|
-
&::
|
|
137
|
+
&::after {
|
|
101
138
|
border-color: var(--wp-admin-theme-color);
|
|
102
139
|
}
|
|
103
140
|
}
|
|
@@ -134,29 +171,16 @@
|
|
|
134
171
|
}
|
|
135
172
|
|
|
136
173
|
.block-editor-block-list__layout .block-editor-block-list__block {
|
|
174
|
+
// With `position: static`, Safari marks a full-width selection rectangle, including margins.
|
|
175
|
+
// With `position: relative`, Safari marks an inline selection rectangle, similar to that of
|
|
176
|
+
// Blink based browsers, but it also does "crop" the marker, which can result in a small line
|
|
177
|
+
// from the preceeding paragraph showing, which is effectively the above selection bleeding in.
|
|
178
|
+
// We choose relative, as that matches the multi-selection, which is limited to the block footprint.
|
|
137
179
|
position: relative;
|
|
138
180
|
|
|
139
181
|
// Re-enable text-selection on editable blocks.
|
|
140
182
|
user-select: text;
|
|
141
183
|
|
|
142
|
-
// Hide the select style pseudo element as otherwise it gets shwon as "selected" in Safari.
|
|
143
|
-
&.is-partially-selected::after {
|
|
144
|
-
// By positioning this pseudo element outside the boundaries of the parent block,
|
|
145
|
-
// when partially selected it hides the pseudo element selection in Safari.
|
|
146
|
-
top: -0.5px;
|
|
147
|
-
right: -0.5px;
|
|
148
|
-
bottom: -0.5px;
|
|
149
|
-
left: -0.5px;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
&.is-highlighted::after,
|
|
153
|
-
&.is-highlighted ~ .is-multi-selected::after {
|
|
154
|
-
top: 0;
|
|
155
|
-
right: 0;
|
|
156
|
-
bottom: 0;
|
|
157
|
-
left: 0;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
184
|
// Break long strings of text without spaces so they don't overflow the block.
|
|
161
185
|
overflow-wrap: break-word;
|
|
162
186
|
|
|
@@ -167,7 +191,6 @@
|
|
|
167
191
|
/**
|
|
168
192
|
* Notices
|
|
169
193
|
*/
|
|
170
|
-
|
|
171
194
|
.components-placeholder .components-with-notices-ui {
|
|
172
195
|
margin: -10px 0 12px 0;
|
|
173
196
|
}
|
|
@@ -186,56 +209,6 @@
|
|
|
186
209
|
}
|
|
187
210
|
}
|
|
188
211
|
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Block Layout
|
|
192
|
-
*/
|
|
193
|
-
|
|
194
|
-
// Navigate mode & Focused wrapper.
|
|
195
|
-
// We're using a pseudo element to overflow placeholder borders
|
|
196
|
-
// and any border inside the block itself.
|
|
197
|
-
&:not([contenteditable]):focus {
|
|
198
|
-
outline: none;
|
|
199
|
-
|
|
200
|
-
&::after {
|
|
201
|
-
position: absolute;
|
|
202
|
-
z-index: 1;
|
|
203
|
-
pointer-events: none;
|
|
204
|
-
content: "";
|
|
205
|
-
top: $border-width;
|
|
206
|
-
bottom: $border-width;
|
|
207
|
-
left: $border-width;
|
|
208
|
-
right: $border-width;
|
|
209
|
-
|
|
210
|
-
// 2px outside.
|
|
211
|
-
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
212
|
-
border-radius: $radius-block-ui - $border-width; // Border is outset, so subtract the width to achieve correct radius.
|
|
213
|
-
outline: 2px solid transparent; // This shows up in Windows High Contrast Mode.
|
|
214
|
-
|
|
215
|
-
// Show a light color for dark themes.
|
|
216
|
-
.is-dark-theme & {
|
|
217
|
-
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) $dark-theme-focus;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Block styles and alignments
|
|
224
|
-
*/
|
|
225
|
-
&::after {
|
|
226
|
-
content: "";
|
|
227
|
-
pointer-events: none;
|
|
228
|
-
position: absolute;
|
|
229
|
-
top: 0;
|
|
230
|
-
right: 0;
|
|
231
|
-
bottom: 0;
|
|
232
|
-
left: 0;
|
|
233
|
-
border-radius: $radius-block-ui;
|
|
234
|
-
box-shadow: 0 0 0 0 transparent;
|
|
235
|
-
transition: box-shadow 0.1s linear;
|
|
236
|
-
@include reduce-motion("transition");
|
|
237
|
-
}
|
|
238
|
-
|
|
239
212
|
// Warnings
|
|
240
213
|
&.has-warning {
|
|
241
214
|
min-height: $grid-unit-60;
|
|
@@ -282,7 +255,7 @@
|
|
|
282
255
|
}
|
|
283
256
|
}
|
|
284
257
|
|
|
285
|
-
// Reusable blocks parent
|
|
258
|
+
// Reusable blocks parent border.
|
|
286
259
|
&.is-reusable.has-child-selected::after {
|
|
287
260
|
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
|
|
288
261
|
}
|
|
@@ -298,12 +271,14 @@
|
|
|
298
271
|
cursor: default;
|
|
299
272
|
|
|
300
273
|
&::after {
|
|
274
|
+
content: "";
|
|
275
|
+
position: absolute;
|
|
276
|
+
pointer-events: none;
|
|
301
277
|
top: $border-width;
|
|
302
278
|
left: $border-width;
|
|
303
279
|
right: $border-width;
|
|
304
280
|
bottom: $border-width;
|
|
305
281
|
box-shadow: 0 0 0 $border-width var(--wp-admin-theme-color);
|
|
306
|
-
// Border is outset, so subtract the width to achieve correct radius.
|
|
307
282
|
border-radius: $radius-block-ui - $border-width;
|
|
308
283
|
}
|
|
309
284
|
}
|
|
@@ -315,19 +290,11 @@
|
|
|
315
290
|
cursor: unset;
|
|
316
291
|
}
|
|
317
292
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
top: $border-width;
|
|
321
|
-
left: $border-width;
|
|
322
|
-
right: $border-width;
|
|
323
|
-
bottom: $border-width;
|
|
324
|
-
border-radius: $radius-block-ui - $border-width; // Border is outset, so subtract the width to achieve correct radius.
|
|
325
|
-
}
|
|
293
|
+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color); // Selected not focussed.
|
|
294
|
+
border-radius: $radius-block-ui;
|
|
326
295
|
|
|
327
296
|
&:focus {
|
|
328
|
-
|
|
329
|
-
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
330
|
-
}
|
|
297
|
+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
331
298
|
}
|
|
332
299
|
}
|
|
333
300
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { useRefEffect
|
|
4
|
+
import { useRefEffect } from '@wordpress/compose';
|
|
5
5
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
6
|
import { useContext } from '@wordpress/element';
|
|
7
7
|
|
|
@@ -15,7 +15,7 @@ export function useInBetweenInserter() {
|
|
|
15
15
|
const openRef = useContext( InsertionPointOpenRef );
|
|
16
16
|
const isInBetweenInserterDisabled = useSelect(
|
|
17
17
|
( select ) =>
|
|
18
|
-
select( blockEditorStore ).getSettings().
|
|
18
|
+
select( blockEditorStore ).getSettings().isDistractionFree ||
|
|
19
19
|
select( blockEditorStore ).__unstableGetEditorMode() === 'zoom-out',
|
|
20
20
|
[]
|
|
21
21
|
);
|
|
@@ -32,10 +32,6 @@ export function useInBetweenInserter() {
|
|
|
32
32
|
const { showInsertionPoint, hideInsertionPoint } =
|
|
33
33
|
useDispatch( blockEditorStore );
|
|
34
34
|
|
|
35
|
-
const delayedShowInsertionPoint = useDebounce( showInsertionPoint, 500, {
|
|
36
|
-
trailing: true,
|
|
37
|
-
} );
|
|
38
|
-
|
|
39
35
|
return useRefEffect(
|
|
40
36
|
( node ) => {
|
|
41
37
|
if ( isInBetweenInserterDisabled ) {
|
|
@@ -56,10 +52,7 @@ export function useInBetweenInserter() {
|
|
|
56
52
|
'block-editor-block-list__layout'
|
|
57
53
|
)
|
|
58
54
|
) {
|
|
59
|
-
|
|
60
|
-
if ( isBlockInsertionPointVisible() ) {
|
|
61
|
-
hideInsertionPoint();
|
|
62
|
-
}
|
|
55
|
+
hideInsertionPoint();
|
|
63
56
|
return;
|
|
64
57
|
}
|
|
65
58
|
|
|
@@ -100,6 +93,7 @@ export function useInBetweenInserter() {
|
|
|
100
93
|
} );
|
|
101
94
|
|
|
102
95
|
if ( ! element ) {
|
|
96
|
+
hideInsertionPoint();
|
|
103
97
|
return;
|
|
104
98
|
}
|
|
105
99
|
|
|
@@ -109,6 +103,7 @@ export function useInBetweenInserter() {
|
|
|
109
103
|
element = element.firstElementChild;
|
|
110
104
|
|
|
111
105
|
if ( ! element ) {
|
|
106
|
+
hideInsertionPoint();
|
|
112
107
|
return;
|
|
113
108
|
}
|
|
114
109
|
}
|
|
@@ -138,10 +133,7 @@ export function useInBetweenInserter() {
|
|
|
138
133
|
( event.clientX > elementRect.right ||
|
|
139
134
|
event.clientX < elementRect.left ) )
|
|
140
135
|
) {
|
|
141
|
-
|
|
142
|
-
if ( isBlockInsertionPointVisible() ) {
|
|
143
|
-
hideInsertionPoint();
|
|
144
|
-
}
|
|
136
|
+
hideInsertionPoint();
|
|
145
137
|
return;
|
|
146
138
|
}
|
|
147
139
|
|
|
@@ -150,14 +142,11 @@ export function useInBetweenInserter() {
|
|
|
150
142
|
// Don't show the in-between inserter before the first block in
|
|
151
143
|
// the list (preserves the original behaviour).
|
|
152
144
|
if ( index === 0 ) {
|
|
153
|
-
|
|
154
|
-
if ( isBlockInsertionPointVisible() ) {
|
|
155
|
-
hideInsertionPoint();
|
|
156
|
-
}
|
|
145
|
+
hideInsertionPoint();
|
|
157
146
|
return;
|
|
158
147
|
}
|
|
159
148
|
|
|
160
|
-
|
|
149
|
+
showInsertionPoint( rootClientId, index, {
|
|
161
150
|
__unstableWithInserter: true,
|
|
162
151
|
} );
|
|
163
152
|
}
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import { lock as lockIcon, unlock as unlockIcon } from '@wordpress/icons';
|
|
16
16
|
import { useInstanceId } from '@wordpress/compose';
|
|
17
17
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
18
|
-
import {
|
|
18
|
+
import { getBlockType } from '@wordpress/blocks';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Internal dependencies
|
|
@@ -24,6 +24,9 @@ import useBlockLock from './use-block-lock';
|
|
|
24
24
|
import useBlockDisplayInformation from '../use-block-display-information';
|
|
25
25
|
import { store as blockEditorStore } from '../../store';
|
|
26
26
|
|
|
27
|
+
// Entity based blocks which allow edit locking
|
|
28
|
+
const ALLOWS_EDIT_LOCKING = [ 'core/block', 'core/navigation' ];
|
|
29
|
+
|
|
27
30
|
function getTemplateLockValue( lock ) {
|
|
28
31
|
// Prevents all operations.
|
|
29
32
|
if ( lock.remove && lock.move ) {
|
|
@@ -41,7 +44,7 @@ function getTemplateLockValue( lock ) {
|
|
|
41
44
|
export default function BlockLockModal( { clientId, onClose } ) {
|
|
42
45
|
const [ lock, setLock ] = useState( { move: false, remove: false } );
|
|
43
46
|
const { canEdit, canMove, canRemove } = useBlockLock( clientId );
|
|
44
|
-
const {
|
|
47
|
+
const { allowsEditLocking, templateLock, hasTemplateLock } = useSelect(
|
|
45
48
|
( select ) => {
|
|
46
49
|
const { getBlockName, getBlockAttributes } =
|
|
47
50
|
select( blockEditorStore );
|
|
@@ -49,7 +52,7 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
49
52
|
const blockType = getBlockType( blockName );
|
|
50
53
|
|
|
51
54
|
return {
|
|
52
|
-
|
|
55
|
+
allowsEditLocking: ALLOWS_EDIT_LOCKING.includes( blockName ),
|
|
53
56
|
templateLock: getBlockAttributes( clientId )?.templateLock,
|
|
54
57
|
hasTemplateLock: !! blockType?.attributes?.templateLock,
|
|
55
58
|
};
|
|
@@ -70,9 +73,9 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
70
73
|
setLock( {
|
|
71
74
|
move: ! canMove,
|
|
72
75
|
remove: ! canRemove,
|
|
73
|
-
...(
|
|
76
|
+
...( allowsEditLocking ? { edit: ! canEdit } : {} ),
|
|
74
77
|
} );
|
|
75
|
-
}, [ canEdit, canMove, canRemove,
|
|
78
|
+
}, [ canEdit, canMove, canRemove, allowsEditLocking ] );
|
|
76
79
|
|
|
77
80
|
const isAllChecked = Object.values( lock ).every( Boolean );
|
|
78
81
|
const isMixed = Object.values( lock ).some( Boolean ) && ! isAllChecked;
|
|
@@ -121,12 +124,14 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
121
124
|
setLock( {
|
|
122
125
|
move: newValue,
|
|
123
126
|
remove: newValue,
|
|
124
|
-
...(
|
|
127
|
+
...( allowsEditLocking
|
|
128
|
+
? { edit: newValue }
|
|
129
|
+
: {} ),
|
|
125
130
|
} )
|
|
126
131
|
}
|
|
127
132
|
/>
|
|
128
133
|
<ul className="block-editor-block-lock-modal__checklist">
|
|
129
|
-
{
|
|
134
|
+
{ allowsEditLocking && (
|
|
130
135
|
<li className="block-editor-block-lock-modal__checklist-item">
|
|
131
136
|
<CheckboxControl
|
|
132
137
|
label={
|
|
@@ -24,7 +24,7 @@ import { store as blockEditorStore } from '../../store';
|
|
|
24
24
|
export default function BlockParentSelector() {
|
|
25
25
|
const { selectBlock, toggleBlockHighlight } =
|
|
26
26
|
useDispatch( blockEditorStore );
|
|
27
|
-
const { firstParentClientId, shouldHide,
|
|
27
|
+
const { firstParentClientId, shouldHide, isDistractionFree } = useSelect(
|
|
28
28
|
( select ) => {
|
|
29
29
|
const {
|
|
30
30
|
getBlockName,
|
|
@@ -46,7 +46,7 @@ export default function BlockParentSelector() {
|
|
|
46
46
|
'__experimentalParentSelector',
|
|
47
47
|
true
|
|
48
48
|
),
|
|
49
|
-
|
|
49
|
+
isDistractionFree: settings.isDistractionFree,
|
|
50
50
|
};
|
|
51
51
|
},
|
|
52
52
|
[]
|
|
@@ -59,7 +59,7 @@ export default function BlockParentSelector() {
|
|
|
59
59
|
const { gestures: showMoversGestures } = useShowMoversGestures( {
|
|
60
60
|
ref: nodeRef,
|
|
61
61
|
onChange( isFocused ) {
|
|
62
|
-
if ( isFocused &&
|
|
62
|
+
if ( isFocused && isDistractionFree ) {
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
toggleBlockHighlight( firstParentClientId, isFocused );
|
|
@@ -22,14 +22,14 @@ function BlockPattern( { isDraggable, pattern, onClick, composite } ) {
|
|
|
22
22
|
const descriptionId = `block-editor-block-patterns-list__item-description-${ instanceId }`;
|
|
23
23
|
|
|
24
24
|
return (
|
|
25
|
-
<InserterDraggableBlocks
|
|
25
|
+
<InserterDraggableBlocks
|
|
26
|
+
isEnabled={ isDraggable }
|
|
27
|
+
blocks={ blocks }
|
|
28
|
+
isPattern={ !! pattern }
|
|
29
|
+
>
|
|
26
30
|
{ ( { draggable, onDragStart, onDragEnd } ) => (
|
|
27
31
|
<div
|
|
28
32
|
className="block-editor-block-patterns-list__list-item"
|
|
29
|
-
aria-label={ pattern.title }
|
|
30
|
-
aria-describedby={
|
|
31
|
-
pattern.description ? descriptionId : undefined
|
|
32
|
-
}
|
|
33
33
|
draggable={ draggable }
|
|
34
34
|
onDragStart={ onDragStart }
|
|
35
35
|
onDragEnd={ onDragEnd }
|
|
@@ -40,6 +40,10 @@ function BlockPattern( { isDraggable, pattern, onClick, composite } ) {
|
|
|
40
40
|
{ ...composite }
|
|
41
41
|
className="block-editor-block-patterns-list__item"
|
|
42
42
|
onClick={ () => onClick( pattern, blocks ) }
|
|
43
|
+
aria-label={ pattern.title }
|
|
44
|
+
aria-describedby={
|
|
45
|
+
pattern.description ? descriptionId : undefined
|
|
46
|
+
}
|
|
43
47
|
>
|
|
44
48
|
<BlockPreview
|
|
45
49
|
blocks={ blocks }
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
cursor: pointer;
|
|
3
3
|
margin-bottom: $grid-unit-30;
|
|
4
4
|
|
|
5
|
+
// The list item contains absolutely positioned visually hidden text,
|
|
6
|
+
// so make this container relative. This prevents the bug experienced in
|
|
7
|
+
// https://github.com/WordPress/gutenberg/issues/44842.
|
|
8
|
+
position: relative;
|
|
9
|
+
|
|
5
10
|
&.is-placeholder {
|
|
6
11
|
min-height: 100px;
|
|
7
12
|
}
|
|
@@ -18,8 +23,7 @@
|
|
|
18
23
|
display: flex;
|
|
19
24
|
align-items: center;
|
|
20
25
|
overflow: hidden;
|
|
21
|
-
border-radius:
|
|
22
|
-
border: $border-width solid $gray-100;
|
|
26
|
+
border-radius: 4px;
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
.block-editor-block-patterns-list__item-title {
|
|
@@ -29,7 +33,7 @@
|
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
&:hover .block-editor-block-preview__container {
|
|
32
|
-
|
|
36
|
+
box-shadow: 0 0 0 2px var(--wp-admin-theme-color);
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
&:focus .block-editor-block-preview__container {
|
|
@@ -22,6 +22,14 @@ The client ID of the block representing the bottom position of the popover.
|
|
|
22
22
|
- Type: `String`
|
|
23
23
|
- Required: No
|
|
24
24
|
|
|
25
|
+
#### shift
|
|
26
|
+
|
|
27
|
+
This determines whether the block popover always shifts into the viewport or remains at its original position. See FloatingUI for more details on shift.
|
|
28
|
+
|
|
29
|
+
- Type: `Boolean`
|
|
30
|
+
- Required: No
|
|
31
|
+
- Default: `true`
|
|
32
|
+
|
|
25
33
|
## BlockPopoverInbetween
|
|
26
34
|
|
|
27
35
|
### Props
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useSelect } from '@wordpress/data';
|
|
5
|
+
import { useReducedMotion } from '@wordpress/compose';
|
|
6
|
+
import { __unstableMotion as motion } from '@wordpress/components';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { store as blockEditorStore } from '../../store';
|
|
12
|
+
import BlockPopover from './index';
|
|
13
|
+
|
|
14
|
+
const animateVariants = {
|
|
15
|
+
hide: { opacity: 0, scaleY: 0.75 },
|
|
16
|
+
show: { opacity: 1, scaleY: 1 },
|
|
17
|
+
exit: { opacity: 0, scaleY: 0.9 },
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
function BlockDropZonePopover( {
|
|
21
|
+
__unstablePopoverSlot,
|
|
22
|
+
__unstableContentRef,
|
|
23
|
+
} ) {
|
|
24
|
+
const { clientId } = useSelect( ( select ) => {
|
|
25
|
+
const { getBlockOrder, getBlockInsertionPoint } =
|
|
26
|
+
select( blockEditorStore );
|
|
27
|
+
const insertionPoint = getBlockInsertionPoint();
|
|
28
|
+
const order = getBlockOrder( insertionPoint.rootClientId );
|
|
29
|
+
|
|
30
|
+
if ( ! order.length ) {
|
|
31
|
+
return {};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
clientId: order[ insertionPoint.index ],
|
|
36
|
+
};
|
|
37
|
+
}, [] );
|
|
38
|
+
const reducedMotion = useReducedMotion();
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<BlockPopover
|
|
42
|
+
clientId={ clientId }
|
|
43
|
+
__unstableCoverTarget
|
|
44
|
+
__unstablePopoverSlot={ __unstablePopoverSlot }
|
|
45
|
+
__unstableContentRef={ __unstableContentRef }
|
|
46
|
+
className="block-editor-block-popover__drop-zone"
|
|
47
|
+
>
|
|
48
|
+
<motion.div
|
|
49
|
+
data-testid="block-popover-drop-zone"
|
|
50
|
+
initial={
|
|
51
|
+
reducedMotion ? animateVariants.show : animateVariants.hide
|
|
52
|
+
}
|
|
53
|
+
animate={ animateVariants.show }
|
|
54
|
+
exit={
|
|
55
|
+
reducedMotion ? animateVariants.show : animateVariants.exit
|
|
56
|
+
}
|
|
57
|
+
className="block-editor-block-popover__drop-zone-foreground"
|
|
58
|
+
/>
|
|
59
|
+
</BlockPopover>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export default BlockDropZonePopover;
|
|
@@ -32,6 +32,7 @@ function BlockPopover(
|
|
|
32
32
|
__unstableCoverTarget = false,
|
|
33
33
|
__unstablePopoverSlot,
|
|
34
34
|
__unstableContentRef,
|
|
35
|
+
shift = true,
|
|
35
36
|
...props
|
|
36
37
|
},
|
|
37
38
|
ref
|
|
@@ -166,7 +167,7 @@ function BlockPopover(
|
|
|
166
167
|
placement="top-start"
|
|
167
168
|
resize={ false }
|
|
168
169
|
flip={ false }
|
|
169
|
-
shift
|
|
170
|
+
shift={ shift }
|
|
170
171
|
{ ...props }
|
|
171
172
|
className={ classnames(
|
|
172
173
|
'block-editor-block-popover',
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// Enable pointer events for the toolbar's content.
|
|
24
|
-
&:not(.block-editor-block-popover__inbetween) .components-popover__content {
|
|
24
|
+
&:not(.block-editor-block-popover__inbetween, .block-editor-block-popover__drop-zone) .components-popover__content {
|
|
25
25
|
* {
|
|
26
26
|
pointer-events: all;
|
|
27
27
|
}
|
|
@@ -48,3 +48,19 @@
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
.components-popover.block-editor-block-popover__drop-zone {
|
|
54
|
+
// Disable pointer events for dragging and dropping.
|
|
55
|
+
// This drop zone is fully presentational, the actual DnD implementation is handled elsewhere.
|
|
56
|
+
* {
|
|
57
|
+
pointer-events: none;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.block-editor-block-popover__drop-zone-foreground {
|
|
61
|
+
position: absolute;
|
|
62
|
+
inset: 0;
|
|
63
|
+
background-color: var(--wp-admin-theme-color);
|
|
64
|
+
border-radius: 2px;
|
|
65
|
+
}
|
|
66
|
+
}
|