@wordpress/block-editor 14.3.4 → 14.3.6
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/README.md +4 -0
- package/build/components/block-list/block.js +0 -3
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +1 -4
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js +9 -12
- package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +1 -1
- package/build/components/block-variation-picker/index.js +2 -4
- package/build/components/block-variation-picker/index.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +3 -4
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/button-block-appender/index.js +2 -4
- package/build/components/button-block-appender/index.js.map +1 -1
- package/build/components/colors-gradients/dropdown.js +2 -4
- package/build/components/colors-gradients/dropdown.js.map +1 -1
- package/build/components/global-styles/color-panel.js +2 -4
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +2 -4
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/shadow-panel-components.js +24 -29
- package/build/components/global-styles/shadow-panel-components.js.map +1 -1
- package/build/components/iframe/index.js +6 -1
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/inserter/menu.js +3 -0
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inspector-controls-tabs/index.js +11 -8
- package/build/components/inspector-controls-tabs/index.js.map +1 -1
- package/build/components/inspector-popover-header/index.js +4 -8
- package/build/components/inspector-popover-header/index.js.map +1 -1
- package/build/components/link-control/index.js +4 -8
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/settings-drawer.js +2 -4
- package/build/components/link-control/settings-drawer.js.map +1 -1
- package/build/components/list-view/block-select-button.js +1 -4
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/media-placeholder/index.js +12 -24
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/skip-to-selected-block/index.js +2 -4
- package/build/components/skip-to-selected-block/index.js.map +1 -1
- package/build/components/tool-selector/index.js +7 -5
- package/build/components/tool-selector/index.js.map +1 -1
- package/build/components/url-input/button.js +14 -16
- package/build/components/url-input/button.js.map +1 -1
- package/build/components/url-input/index.js +2 -4
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-resize-canvas/index.js +1 -2
- package/build/components/use-resize-canvas/index.js.map +1 -1
- package/build/hooks/grid-visualizer.js +13 -11
- package/build/hooks/grid-visualizer.js.map +1 -1
- package/build/hooks/layout-child.js +41 -3
- package/build/hooks/layout-child.js.map +1 -1
- package/build/layouts/flex.js +6 -38
- package/build/layouts/flex.js.map +1 -1
- package/build/private-apis.js +2 -0
- package/build/private-apis.js.map +1 -1
- package/build/utils/block-bindings.js +9 -6
- package/build/utils/block-bindings.js.map +1 -1
- package/build-module/components/block-list/block.js +0 -3
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +1 -4
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js +9 -12
- package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +1 -1
- package/build-module/components/block-variation-picker/index.js +2 -4
- package/build-module/components/block-variation-picker/index.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +3 -4
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- package/build-module/components/button-block-appender/index.js +2 -4
- package/build-module/components/button-block-appender/index.js.map +1 -1
- package/build-module/components/colors-gradients/dropdown.js +2 -4
- package/build-module/components/colors-gradients/dropdown.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +2 -4
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +2 -4
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/shadow-panel-components.js +25 -30
- package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
- package/build-module/components/iframe/index.js +6 -1
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/inserter/menu.js +3 -0
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/index.js +12 -9
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
- package/build-module/components/inspector-popover-header/index.js +4 -8
- package/build-module/components/inspector-popover-header/index.js.map +1 -1
- package/build-module/components/link-control/index.js +4 -8
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/settings-drawer.js +2 -4
- package/build-module/components/link-control/settings-drawer.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +2 -5
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +12 -24
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/skip-to-selected-block/index.js +2 -4
- package/build-module/components/skip-to-selected-block/index.js.map +1 -1
- package/build-module/components/tool-selector/index.js +7 -5
- package/build-module/components/tool-selector/index.js.map +1 -1
- package/build-module/components/url-input/button.js +15 -17
- package/build-module/components/url-input/button.js.map +1 -1
- package/build-module/components/url-input/index.js +2 -4
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-resize-canvas/index.js +1 -2
- package/build-module/components/use-resize-canvas/index.js.map +1 -1
- package/build-module/hooks/grid-visualizer.js +13 -11
- package/build-module/hooks/grid-visualizer.js.map +1 -1
- package/build-module/hooks/layout-child.js +41 -3
- package/build-module/hooks/layout-child.js.map +1 -1
- package/build-module/layouts/flex.js +7 -39
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/private-apis.js +2 -0
- package/build-module/private-apis.js.map +1 -1
- package/build-module/utils/block-bindings.js +9 -6
- package/build-module/utils/block-bindings.js.map +1 -1
- package/build-style/content-rtl.css +6 -10
- package/build-style/content.css +6 -10
- package/build-style/style-rtl.css +27 -26
- package/build-style/style.css +27 -26
- package/package.json +5 -5
- package/src/components/block-inspector/style.scss +2 -0
- package/src/components/block-list/block.js +0 -3
- package/src/components/block-list/use-block-props/index.js +1 -2
- package/src/components/block-list/use-block-props/use-zoom-out-mode-exit.js +19 -11
- package/src/components/block-tools/style.scss +5 -0
- package/src/components/block-variation-picker/index.js +1 -2
- package/src/components/block-variation-transforms/index.js +2 -2
- package/src/components/button-block-appender/content.scss +0 -5
- package/src/components/button-block-appender/index.js +1 -2
- package/src/components/colors-gradients/dropdown.js +1 -5
- package/src/components/global-styles/color-panel.js +1 -5
- package/src/components/global-styles/filters-panel.js +1 -2
- package/src/components/global-styles/shadow-panel-components.js +28 -33
- package/src/components/global-styles/style.scss +5 -0
- package/src/components/iframe/content.scss +7 -8
- package/src/components/iframe/index.js +7 -1
- package/src/components/iframe/style.scss +17 -0
- package/src/components/inserter/menu.js +5 -0
- package/src/components/inspector-controls-tabs/index.js +21 -20
- package/src/components/inspector-popover-header/index.js +2 -4
- package/src/components/inspector-popover-header/style.scss +0 -13
- package/src/components/link-control/index.js +2 -4
- package/src/components/link-control/settings-drawer.js +1 -2
- package/src/components/list-view/block-select-button.js +2 -5
- package/src/components/list-view/style.scss +18 -0
- package/src/components/media-placeholder/index.js +6 -12
- package/src/components/skip-to-selected-block/index.js +1 -2
- package/src/components/skip-to-selected-block/style.scss +0 -9
- package/src/components/tool-selector/index.js +6 -4
- package/src/components/url-input/button.js +16 -12
- package/src/components/url-input/index.js +1 -2
- package/src/components/url-input/style.scss +0 -6
- package/src/components/use-resize-canvas/index.js +1 -3
- package/src/hooks/grid-visualizer.js +23 -9
- package/src/hooks/layout-child.js +48 -3
- package/src/layouts/flex.js +10 -53
- package/src/private-apis.js +2 -0
- package/src/utils/block-bindings.js +9 -6
- package/src/utils/test/use-block-bindings-utils.js +174 -0
|
@@ -710,7 +710,6 @@ function BlockListBlockProvider( props ) {
|
|
|
710
710
|
) && hasSelectedInnerBlock( clientId ),
|
|
711
711
|
blockApiVersion: blockType?.apiVersion || 1,
|
|
712
712
|
blockTitle: match?.title || blockType?.title,
|
|
713
|
-
editorMode,
|
|
714
713
|
isSubtreeDisabled:
|
|
715
714
|
blockEditingMode === 'disabled' &&
|
|
716
715
|
isBlockSubtreeDisabled( clientId ),
|
|
@@ -766,7 +765,6 @@ function BlockListBlockProvider( props ) {
|
|
|
766
765
|
themeSupportsLayout,
|
|
767
766
|
isTemporarilyEditingAsBlocks,
|
|
768
767
|
blockEditingMode,
|
|
769
|
-
editorMode,
|
|
770
768
|
mayDisplayControls,
|
|
771
769
|
mayDisplayParentControls,
|
|
772
770
|
index,
|
|
@@ -821,7 +819,6 @@ function BlockListBlockProvider( props ) {
|
|
|
821
819
|
hasOverlay,
|
|
822
820
|
initialPosition,
|
|
823
821
|
blockEditingMode,
|
|
824
|
-
editorMode,
|
|
825
822
|
isHighlighted,
|
|
826
823
|
isMultiSelected,
|
|
827
824
|
isPartiallySelected,
|
|
@@ -86,7 +86,6 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
|
|
|
86
86
|
name,
|
|
87
87
|
blockApiVersion,
|
|
88
88
|
blockTitle,
|
|
89
|
-
editorMode,
|
|
90
89
|
isSelected,
|
|
91
90
|
isSubtreeDisabled,
|
|
92
91
|
hasOverlay,
|
|
@@ -117,7 +116,7 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
|
|
|
117
116
|
useFocusHandler( clientId ),
|
|
118
117
|
useEventHandlers( { clientId, isSelected } ),
|
|
119
118
|
useNavModeExit( clientId ),
|
|
120
|
-
useZoomOutModeExit(
|
|
119
|
+
useZoomOutModeExit(),
|
|
121
120
|
useIsHovered( { clientId } ),
|
|
122
121
|
useIntersectionObserver(),
|
|
123
122
|
useMovingAnimation( { triggerAnimationOnChange: index, clientId } ),
|
|
@@ -12,25 +12,27 @@ import { unlock } from '../../../lock-unlock';
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Allows Zoom Out mode to be exited by double clicking in the selected block.
|
|
15
|
-
*
|
|
16
|
-
* @param {string} clientId Block client ID.
|
|
17
15
|
*/
|
|
18
|
-
export function useZoomOutModeExit(
|
|
19
|
-
const { getSettings, isZoomOut } = unlock(
|
|
16
|
+
export function useZoomOutModeExit() {
|
|
17
|
+
const { getSettings, isZoomOut, __unstableGetEditorMode } = unlock(
|
|
18
|
+
useSelect( blockEditorStore )
|
|
19
|
+
);
|
|
20
|
+
|
|
20
21
|
const { __unstableSetEditorMode, resetZoomLevel } = unlock(
|
|
21
22
|
useDispatch( blockEditorStore )
|
|
22
23
|
);
|
|
23
24
|
|
|
24
25
|
return useRefEffect(
|
|
25
26
|
( node ) => {
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
function onDoubleClick( event ) {
|
|
28
|
+
// In "compose" mode.
|
|
29
|
+
const composeMode =
|
|
30
|
+
__unstableGetEditorMode() === 'zoom-out' && isZoomOut();
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
if ( ! composeMode ) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
32
35
|
|
|
33
|
-
function onDoubleClick( event ) {
|
|
34
36
|
if ( ! event.defaultPrevented ) {
|
|
35
37
|
event.preventDefault();
|
|
36
38
|
|
|
@@ -52,6 +54,12 @@ export function useZoomOutModeExit( { editorMode } ) {
|
|
|
52
54
|
node.removeEventListener( 'dblclick', onDoubleClick );
|
|
53
55
|
};
|
|
54
56
|
},
|
|
55
|
-
[
|
|
57
|
+
[
|
|
58
|
+
getSettings,
|
|
59
|
+
__unstableSetEditorMode,
|
|
60
|
+
__unstableGetEditorMode,
|
|
61
|
+
isZoomOut,
|
|
62
|
+
resetZoomLevel,
|
|
63
|
+
]
|
|
56
64
|
);
|
|
57
65
|
}
|
|
@@ -283,6 +283,11 @@
|
|
|
283
283
|
background: none;
|
|
284
284
|
border: none;
|
|
285
285
|
}
|
|
286
|
+
|
|
287
|
+
// Make the spacing consistent between controls.
|
|
288
|
+
.zoom-out-toolbar-button {
|
|
289
|
+
height: $button-size-next-default-40px;
|
|
290
|
+
}
|
|
286
291
|
}
|
|
287
292
|
|
|
288
293
|
.block-editor-block-tools__zoom-out-mode-inserter-button {
|
|
@@ -64,8 +64,7 @@ function BlockVariationPicker( {
|
|
|
64
64
|
{ allowSkip && (
|
|
65
65
|
<div className="block-editor-block-variation-picker__skip">
|
|
66
66
|
<Button
|
|
67
|
-
|
|
68
|
-
__next40pxDefaultSize={ false }
|
|
67
|
+
__next40pxDefaultSize
|
|
69
68
|
variant="link"
|
|
70
69
|
onClick={ () => onSelect() }
|
|
71
70
|
>
|
|
@@ -36,8 +36,8 @@ function VariationsButtons( {
|
|
|
36
36
|
</VisuallyHidden>
|
|
37
37
|
{ variations.map( ( variation ) => (
|
|
38
38
|
<Button
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
__next40pxDefaultSize
|
|
40
|
+
size="compact"
|
|
41
41
|
key={ variation.name }
|
|
42
42
|
icon={ <BlockIcon icon={ variation.icon } showColors /> }
|
|
43
43
|
isPressed={ selectedValue === variation.name }
|
|
@@ -8,11 +8,6 @@
|
|
|
8
8
|
color: $gray-900;
|
|
9
9
|
box-shadow: inset 0 0 0 $border-width $gray-900;
|
|
10
10
|
|
|
11
|
-
// Needs specificity to override button styles.
|
|
12
|
-
&.components-button.components-button {
|
|
13
|
-
padding: $grid-unit-15;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
11
|
.is-dark-theme & {
|
|
17
12
|
color: $light-gray-placeholder;
|
|
18
13
|
box-shadow: inset 0 0 0 $border-width $light-gray-placeholder;
|
|
@@ -88,11 +88,7 @@ const renderToggle =
|
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
return (
|
|
91
|
-
<Button
|
|
92
|
-
// TODO: Switch to `true` (40px size) if possible
|
|
93
|
-
__next40pxDefaultSize={ false }
|
|
94
|
-
{ ...toggleProps }
|
|
95
|
-
>
|
|
91
|
+
<Button __next40pxDefaultSize { ...toggleProps }>
|
|
96
92
|
<LabeledColorIndicator
|
|
97
93
|
colorValue={ colorValue }
|
|
98
94
|
label={ label }
|
|
@@ -239,11 +239,7 @@ function ColorPanelDropdown( {
|
|
|
239
239
|
};
|
|
240
240
|
|
|
241
241
|
return (
|
|
242
|
-
<Button
|
|
243
|
-
// TODO: Switch to `true` (40px size) if possible
|
|
244
|
-
__next40pxDefaultSize={ false }
|
|
245
|
-
{ ...toggleProps }
|
|
246
|
-
>
|
|
242
|
+
<Button __next40pxDefaultSize { ...toggleProps }>
|
|
247
243
|
<LabeledColorIndicators
|
|
248
244
|
indicators={ indicators }
|
|
249
245
|
label={ label }
|
|
@@ -190,8 +190,7 @@ export default function FiltersPanel( {
|
|
|
190
190
|
return (
|
|
191
191
|
<ItemGroup isBordered isSeparated>
|
|
192
192
|
<Button
|
|
193
|
-
|
|
194
|
-
__next40pxDefaultSize={ false }
|
|
193
|
+
__next40pxDefaultSize
|
|
195
194
|
{ ...toggleProps }
|
|
196
195
|
>
|
|
197
196
|
<LabeledColorIndicator
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
FlexItem,
|
|
12
12
|
Dropdown,
|
|
13
13
|
Composite,
|
|
14
|
+
Tooltip,
|
|
14
15
|
} from '@wordpress/components';
|
|
15
16
|
import { useMemo } from '@wordpress/element';
|
|
16
17
|
import { shadow as shadowIcon, Icon, check } from '@wordpress/icons';
|
|
@@ -42,8 +43,7 @@ export function ShadowPopoverContainer( { shadow, onShadowChange, settings } ) {
|
|
|
42
43
|
/>
|
|
43
44
|
<div className="block-editor-global-styles__clear-shadow">
|
|
44
45
|
<Button
|
|
45
|
-
|
|
46
|
-
__next40pxDefaultSize={ false }
|
|
46
|
+
__next40pxDefaultSize
|
|
47
47
|
variant="tertiary"
|
|
48
48
|
onClick={ () => onShadowChange( undefined ) }
|
|
49
49
|
>
|
|
@@ -80,32 +80,31 @@ export function ShadowPresets( { presets, activeShadow, onSelect } ) {
|
|
|
80
80
|
|
|
81
81
|
export function ShadowIndicator( { type, label, isActive, onSelect, shadow } ) {
|
|
82
82
|
return (
|
|
83
|
-
<
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
'
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
/>
|
|
83
|
+
<Tooltip text={ label }>
|
|
84
|
+
<Composite.Item
|
|
85
|
+
role="option"
|
|
86
|
+
aria-label={ label }
|
|
87
|
+
aria-selected={ isActive }
|
|
88
|
+
className={ clsx( 'block-editor-global-styles__shadow__item', {
|
|
89
|
+
'is-active': isActive,
|
|
90
|
+
} ) }
|
|
91
|
+
render={
|
|
92
|
+
<button
|
|
93
|
+
className={ clsx(
|
|
94
|
+
'block-editor-global-styles__shadow-indicator',
|
|
95
|
+
{
|
|
96
|
+
unset: type === 'unset',
|
|
97
|
+
}
|
|
98
|
+
) }
|
|
99
|
+
onClick={ onSelect }
|
|
100
|
+
style={ { boxShadow: shadow } }
|
|
101
|
+
aria-label={ label }
|
|
102
|
+
>
|
|
103
|
+
{ isActive && <Icon icon={ check } /> }
|
|
104
|
+
</button>
|
|
105
|
+
}
|
|
106
|
+
/>
|
|
107
|
+
</Tooltip>
|
|
109
108
|
);
|
|
110
109
|
}
|
|
111
110
|
|
|
@@ -143,11 +142,7 @@ function renderShadowToggle() {
|
|
|
143
142
|
};
|
|
144
143
|
|
|
145
144
|
return (
|
|
146
|
-
<Button
|
|
147
|
-
// TODO: Switch to `true` (40px size) if possible
|
|
148
|
-
__next40pxDefaultSize={ false }
|
|
149
|
-
{ ...toggleProps }
|
|
150
|
-
>
|
|
145
|
+
<Button __next40pxDefaultSize { ...toggleProps }>
|
|
151
146
|
<HStack justify="flex-start">
|
|
152
147
|
<Icon
|
|
153
148
|
className="block-editor-global-styles__toggle-icon"
|
|
@@ -37,10 +37,15 @@
|
|
|
37
37
|
|
|
38
38
|
// These styles are similar to the color palette.
|
|
39
39
|
.block-editor-global-styles__shadow-indicator {
|
|
40
|
+
appearance: none;
|
|
41
|
+
background: none;
|
|
40
42
|
color: $gray-800;
|
|
41
43
|
border: $gray-200 $border-width solid;
|
|
42
44
|
border-radius: $radius-small;
|
|
43
45
|
cursor: pointer;
|
|
46
|
+
display: inline-flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
|
|
44
49
|
padding: 0;
|
|
45
50
|
|
|
46
51
|
height: $button-size-small + 2 * $border-width;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.block-editor-iframe__body {
|
|
2
2
|
position: relative;
|
|
3
|
+
border: 0.01px solid transparent;
|
|
3
4
|
}
|
|
4
5
|
|
|
5
6
|
.block-editor-iframe__container {
|
|
@@ -22,7 +23,6 @@
|
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
.block-editor-iframe__html {
|
|
25
|
-
border: 0 solid $gray-300;
|
|
26
26
|
transform-origin: top center;
|
|
27
27
|
@include editor-canvas-resize-animation;
|
|
28
28
|
}
|
|
@@ -38,21 +38,20 @@
|
|
|
38
38
|
|
|
39
39
|
background-color: $gray-300;
|
|
40
40
|
|
|
41
|
-
// Firefox and Safari don't render margin-bottom here and margin-bottom is needed for Chrome
|
|
42
|
-
// layout, so we use border matching the background instead of margins.
|
|
43
|
-
border: calc(#{$frame-size} / #{$scale}) solid $gray-300;
|
|
44
|
-
|
|
45
41
|
// Chrome seems to respect that transform scale shouldn't affect the layout size of the element,
|
|
46
42
|
// so we need to adjust the height of the content to match the scale by using negative margins.
|
|
47
43
|
$extra-content-height: calc(#{$content-height} * (1 - #{$scale}));
|
|
48
|
-
$total-frame-height: calc(2 * #{$frame-size});
|
|
44
|
+
$total-frame-height: calc(2 * #{$frame-size} / #{$scale});
|
|
49
45
|
$total-height: calc(#{$extra-content-height} + #{$total-frame-height} + 2px);
|
|
50
46
|
margin-bottom: calc(-1 * #{$total-height});
|
|
47
|
+
// Add the top/bottom frame size. We use scaling to account for the left/right, as
|
|
48
|
+
// the padding left/right causes the contents to reflow, which breaks the 1:1 scaling
|
|
49
|
+
// of the content.
|
|
50
|
+
padding-top: calc(#{$frame-size} / #{$scale});
|
|
51
|
+
padding-bottom: calc(#{$frame-size} / #{$scale});
|
|
51
52
|
|
|
52
53
|
body {
|
|
53
54
|
min-height: calc((#{$inner-height} - #{$total-frame-height}) / #{$scale});
|
|
54
|
-
display: flex;
|
|
55
|
-
flex-direction: column;
|
|
56
55
|
|
|
57
56
|
> .is-root-container:not(.wp-block-post-content) {
|
|
58
57
|
flex: 1;
|
|
@@ -306,13 +306,19 @@ function Iframe( {
|
|
|
306
306
|
iframeDocument.documentElement.classList.add( 'is-zoomed-out' );
|
|
307
307
|
|
|
308
308
|
const maxWidth = 750;
|
|
309
|
+
// This scaling calculation has to happen within the JS because CSS calc() can
|
|
310
|
+
// only divide and multiply by a unitless value. I.e. calc( 100px / 2 ) is valid
|
|
311
|
+
// but calc( 100px / 2px ) is not.
|
|
309
312
|
iframeDocument.documentElement.style.setProperty(
|
|
310
313
|
'--wp-block-editor-iframe-zoom-out-scale',
|
|
311
314
|
scale === 'default'
|
|
312
|
-
? Math.min( containerWidth, maxWidth )
|
|
315
|
+
? ( Math.min( containerWidth, maxWidth ) -
|
|
316
|
+
parseInt( frameSize ) * 2 ) /
|
|
313
317
|
prevContainerWidthRef.current
|
|
314
318
|
: scale
|
|
315
319
|
);
|
|
320
|
+
|
|
321
|
+
// frameSize has to be a px value for the scaling and frame size to be computed correctly.
|
|
316
322
|
iframeDocument.documentElement.style.setProperty(
|
|
317
323
|
'--wp-block-editor-iframe-zoom-out-frame-size',
|
|
318
324
|
typeof frameSize === 'number' ? `${ frameSize }px` : frameSize
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.block-editor-iframe__container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
overflow-x: hidden;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.block-editor-iframe__scale-container {
|
|
8
|
+
height: 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.block-editor-iframe__scale-container.is-zoomed-out {
|
|
12
|
+
$container-width: var(--wp-block-editor-iframe-zoom-out-container-width, 100vw);
|
|
13
|
+
$prev-container-width: var(--wp-block-editor-iframe-zoom-out-prev-container-width, 100vw);
|
|
14
|
+
width: $prev-container-width;
|
|
15
|
+
// This is to offset the movement of the iframe when we open sidebars
|
|
16
|
+
margin-left: calc(-1 * (#{$prev-container-width} - #{$container-width}) / 2);
|
|
17
|
+
}
|
|
@@ -32,6 +32,7 @@ import InserterSearchResults from './search-results';
|
|
|
32
32
|
import useInsertionPoint from './hooks/use-insertion-point';
|
|
33
33
|
import { store as blockEditorStore } from '../../store';
|
|
34
34
|
import TabbedSidebar from '../tabbed-sidebar';
|
|
35
|
+
import { useZoomOut } from '../../hooks/use-zoom-out';
|
|
35
36
|
|
|
36
37
|
const NOOP = () => {};
|
|
37
38
|
function InserterMenu(
|
|
@@ -77,6 +78,10 @@ function InserterMenu(
|
|
|
77
78
|
}
|
|
78
79
|
const [ selectedTab, setSelectedTab ] = useState( getInitialTab() );
|
|
79
80
|
|
|
81
|
+
const shouldUseZoomOut =
|
|
82
|
+
selectedTab === 'patterns' || selectedTab === 'media';
|
|
83
|
+
useZoomOut( shouldUseZoomOut );
|
|
84
|
+
|
|
80
85
|
const [ destinationRootClientId, onInsertBlocks, onToggleInsertionPoint ] =
|
|
81
86
|
useInsertionPoint( {
|
|
82
87
|
rootClientId,
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
Icon,
|
|
6
|
+
Tooltip,
|
|
6
7
|
privateApis as componentsPrivateApis,
|
|
7
8
|
} from '@wordpress/components';
|
|
8
9
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
@@ -43,27 +44,27 @@ export default function InspectorControlsTabs( {
|
|
|
43
44
|
<div className="block-editor-block-inspector__tabs">
|
|
44
45
|
<Tabs defaultTabId={ initialTabName } key={ clientId }>
|
|
45
46
|
<Tabs.TabList>
|
|
46
|
-
{ tabs.map( ( tab ) =>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
47
|
+
{ tabs.map( ( tab ) =>
|
|
48
|
+
showIconLabels ? (
|
|
49
|
+
<Tabs.Tab
|
|
50
|
+
key={ tab.name }
|
|
51
|
+
tabId={ tab.name }
|
|
52
|
+
className={ tab.className }
|
|
53
|
+
>
|
|
54
|
+
{ tab.title }
|
|
55
|
+
</Tabs.Tab>
|
|
56
|
+
) : (
|
|
57
|
+
<Tooltip text={ tab.title } key={ tab.name }>
|
|
58
|
+
<Tabs.Tab
|
|
59
|
+
tabId={ tab.name }
|
|
60
60
|
className={ tab.className }
|
|
61
|
+
aria-label={ tab.title }
|
|
61
62
|
>
|
|
62
|
-
{
|
|
63
|
-
</
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
)
|
|
63
|
+
<Icon icon={ tab.icon } />
|
|
64
|
+
</Tabs.Tab>
|
|
65
|
+
</Tooltip>
|
|
66
|
+
)
|
|
67
|
+
) }
|
|
67
68
|
</Tabs.TabList>
|
|
68
69
|
<Tabs.TabPanel tabId={ TAB_SETTINGS.name } focusable={ false }>
|
|
69
70
|
<SettingsTab showAdvancedControls={ !! blockName } />
|
|
@@ -31,8 +31,7 @@ export default function InspectorPopoverHeader( {
|
|
|
31
31
|
<Spacer />
|
|
32
32
|
{ actions.map( ( { label, icon, onClick } ) => (
|
|
33
33
|
<Button
|
|
34
|
-
|
|
35
|
-
__next40pxDefaultSize={ false }
|
|
34
|
+
size="small"
|
|
36
35
|
key={ label }
|
|
37
36
|
className="block-editor-inspector-popover-header__action"
|
|
38
37
|
label={ label }
|
|
@@ -45,8 +44,7 @@ export default function InspectorPopoverHeader( {
|
|
|
45
44
|
) ) }
|
|
46
45
|
{ onClose && (
|
|
47
46
|
<Button
|
|
48
|
-
|
|
49
|
-
__next40pxDefaultSize={ false }
|
|
47
|
+
size="small"
|
|
50
48
|
className="block-editor-inspector-popover-header__action"
|
|
51
49
|
label={ __( 'Close' ) }
|
|
52
50
|
icon={ closeSmall }
|
|
@@ -1,16 +1,3 @@
|
|
|
1
1
|
.block-editor-inspector-popover-header {
|
|
2
2
|
margin-bottom: $grid-unit-20;
|
|
3
3
|
}
|
|
4
|
-
|
|
5
|
-
[class].block-editor-inspector-popover-header__action {
|
|
6
|
-
height: $icon-size;
|
|
7
|
-
|
|
8
|
-
&.has-icon {
|
|
9
|
-
min-width: $icon-size;
|
|
10
|
-
padding: 0;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
&:not(.has-icon) {
|
|
14
|
-
text-decoration: underline;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -475,16 +475,14 @@ function LinkControl( {
|
|
|
475
475
|
className="block-editor-link-control__search-actions"
|
|
476
476
|
>
|
|
477
477
|
<Button
|
|
478
|
-
|
|
479
|
-
__next40pxDefaultSize={ false }
|
|
478
|
+
__next40pxDefaultSize
|
|
480
479
|
variant="tertiary"
|
|
481
480
|
onClick={ handleCancel }
|
|
482
481
|
>
|
|
483
482
|
{ __( 'Cancel' ) }
|
|
484
483
|
</Button>
|
|
485
484
|
<Button
|
|
486
|
-
|
|
487
|
-
__next40pxDefaultSize={ false }
|
|
485
|
+
__next40pxDefaultSize
|
|
488
486
|
variant="primary"
|
|
489
487
|
onClick={ isDisabled ? noop : handleSubmit }
|
|
490
488
|
className="block-editor-link-control__search-submit"
|
|
@@ -25,8 +25,7 @@ function LinkSettingsDrawer( { children, settingsOpen, setSettingsOpen } ) {
|
|
|
25
25
|
return (
|
|
26
26
|
<>
|
|
27
27
|
<Button
|
|
28
|
-
|
|
29
|
-
__next40pxDefaultSize={ false }
|
|
28
|
+
__next40pxDefaultSize
|
|
30
29
|
className="block-editor-link-control__drawer-toggle"
|
|
31
30
|
aria-expanded={ settingsOpen }
|
|
32
31
|
onClick={ () => setSettingsOpen( ! settingsOpen ) }
|
|
@@ -7,7 +7,6 @@ import clsx from 'clsx';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import {
|
|
10
|
-
Button,
|
|
11
10
|
__experimentalHStack as HStack,
|
|
12
11
|
__experimentalTruncate as Truncate,
|
|
13
12
|
} from '@wordpress/components';
|
|
@@ -82,9 +81,7 @@ function ListViewBlockSelectButton(
|
|
|
82
81
|
}
|
|
83
82
|
|
|
84
83
|
return (
|
|
85
|
-
<
|
|
86
|
-
// TODO: Switch to `true` (40px size) if possible
|
|
87
|
-
__next40pxDefaultSize={ false }
|
|
84
|
+
<a
|
|
88
85
|
className={ clsx(
|
|
89
86
|
'block-editor-list-view-block-select-button',
|
|
90
87
|
className
|
|
@@ -156,7 +153,7 @@ function ListViewBlockSelectButton(
|
|
|
156
153
|
</span>
|
|
157
154
|
) }
|
|
158
155
|
</HStack>
|
|
159
|
-
</
|
|
156
|
+
</a>
|
|
160
157
|
);
|
|
161
158
|
}
|
|
162
159
|
|
|
@@ -41,6 +41,15 @@
|
|
|
41
41
|
&:hover {
|
|
42
42
|
color: var(--wp-admin-theme-color);
|
|
43
43
|
}
|
|
44
|
+
|
|
45
|
+
svg {
|
|
46
|
+
fill: currentColor;
|
|
47
|
+
// Optimizate for high contrast modes.
|
|
48
|
+
// See also https://blogs.windows.com/msedgedev/2020/09/17/styling-for-windows-high-contrast-with-new-standards-for-forced-colors/.
|
|
49
|
+
@media (forced-colors: active) {
|
|
50
|
+
fill: CanvasText;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
44
53
|
}
|
|
45
54
|
|
|
46
55
|
&:not(.is-selected) .block-editor-list-view-block-select-button {
|
|
@@ -216,6 +225,15 @@
|
|
|
216
225
|
text-align: left;
|
|
217
226
|
position: relative;
|
|
218
227
|
white-space: nowrap;
|
|
228
|
+
border-radius: 2px;
|
|
229
|
+
box-sizing: border-box;
|
|
230
|
+
color: inherit;
|
|
231
|
+
font-family: inherit;
|
|
232
|
+
font-size: 13px;
|
|
233
|
+
font-weight: 400;
|
|
234
|
+
margin: 0;
|
|
235
|
+
text-decoration: none;
|
|
236
|
+
transition: box-shadow 0.1s linear;
|
|
219
237
|
|
|
220
238
|
&.is-dropping-before::before {
|
|
221
239
|
content: "";
|
|
@@ -91,8 +91,7 @@ const URLSelectionUI = ( { src, onChangeSrc, onSelectURL } ) => {
|
|
|
91
91
|
return (
|
|
92
92
|
<div className="block-editor-media-placeholder__url-input-container">
|
|
93
93
|
<Button
|
|
94
|
-
|
|
95
|
-
__next40pxDefaultSize={ false }
|
|
94
|
+
__next40pxDefaultSize
|
|
96
95
|
className="block-editor-media-placeholder__button"
|
|
97
96
|
onClick={ openURLInput }
|
|
98
97
|
isPressed={ isURLInputVisible }
|
|
@@ -389,8 +388,7 @@ export function MediaPlaceholder( {
|
|
|
389
388
|
return (
|
|
390
389
|
onCancel && (
|
|
391
390
|
<Button
|
|
392
|
-
|
|
393
|
-
__next40pxDefaultSize={ false }
|
|
391
|
+
__next40pxDefaultSize
|
|
394
392
|
className="block-editor-media-placeholder__cancel-button"
|
|
395
393
|
title={ __( 'Cancel' ) }
|
|
396
394
|
variant="link"
|
|
@@ -419,8 +417,7 @@ export function MediaPlaceholder( {
|
|
|
419
417
|
onToggleFeaturedImage && (
|
|
420
418
|
<div className="block-editor-media-placeholder__url-input-container">
|
|
421
419
|
<Button
|
|
422
|
-
|
|
423
|
-
__next40pxDefaultSize={ false }
|
|
420
|
+
__next40pxDefaultSize
|
|
424
421
|
className="block-editor-media-placeholder__button"
|
|
425
422
|
onClick={ onToggleFeaturedImage }
|
|
426
423
|
variant="secondary"
|
|
@@ -436,8 +433,7 @@ export function MediaPlaceholder( {
|
|
|
436
433
|
const defaultButton = ( { open } ) => {
|
|
437
434
|
return (
|
|
438
435
|
<Button
|
|
439
|
-
|
|
440
|
-
__next40pxDefaultSize={ false }
|
|
436
|
+
__next40pxDefaultSize
|
|
441
437
|
variant="secondary"
|
|
442
438
|
onClick={ () => {
|
|
443
439
|
open();
|
|
@@ -477,8 +473,7 @@ export function MediaPlaceholder( {
|
|
|
477
473
|
const content = (
|
|
478
474
|
<>
|
|
479
475
|
<Button
|
|
480
|
-
|
|
481
|
-
__next40pxDefaultSize={ false }
|
|
476
|
+
__next40pxDefaultSize
|
|
482
477
|
variant="primary"
|
|
483
478
|
className={ clsx(
|
|
484
479
|
'block-editor-media-placeholder__button',
|
|
@@ -508,8 +503,7 @@ export function MediaPlaceholder( {
|
|
|
508
503
|
<FormFileUpload
|
|
509
504
|
render={ ( { openFileDialog } ) => (
|
|
510
505
|
<Button
|
|
511
|
-
|
|
512
|
-
__next40pxDefaultSize={ false }
|
|
506
|
+
__next40pxDefaultSize
|
|
513
507
|
onClick={ openFileDialog }
|
|
514
508
|
variant="primary"
|
|
515
509
|
className={ clsx(
|
|
@@ -28,8 +28,7 @@ export default function SkipToSelectedBlock() {
|
|
|
28
28
|
|
|
29
29
|
return selectedBlockClientId ? (
|
|
30
30
|
<Button
|
|
31
|
-
|
|
32
|
-
__next40pxDefaultSize={ false }
|
|
31
|
+
__next40pxDefaultSize
|
|
33
32
|
variant="secondary"
|
|
34
33
|
className="block-editor-skip-to-selected-block"
|
|
35
34
|
onClick={ onClick }
|