@wordpress/block-editor 14.7.1-next.082ed6819.0 → 14.8.1-next.cd6172eb0.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/autocompleters/block.js +2 -4
- package/build/autocompleters/block.js.map +1 -1
- package/build/autocompleters/link.js +2 -4
- package/build/autocompleters/link.js.map +1 -1
- package/build/components/block-canvas/index.js +3 -6
- package/build/components/block-canvas/index.js.map +1 -1
- package/build/components/block-list/block.js +6 -5
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/index.js +0 -1
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +7 -2
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +34 -0
- package/build/components/block-list/use-block-props/use-firefox-draggable-compatibility.js.map +1 -0
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +98 -5
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build/components/block-patterns-list/index.js +13 -4
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-popover/inbetween.js +4 -0
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +7 -4
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +1 -1
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-switcher/index.js +12 -22
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-switcher/use-transformed-patterns.js +0 -1
- package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
- package/build/components/block-switcher/utils.js +0 -1
- package/build/components/block-switcher/utils.js.map +1 -1
- package/build/components/block-toolbar/index.js +17 -9
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +0 -1
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/date-format-picker/index.js +0 -1
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/font-appearance-control/index.js +1 -0
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/font-family/index.js +10 -0
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +17 -16
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/get-global-styles-changes.js +0 -1
- package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
- package/build/components/iframe/index.js +12 -216
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/iframe/use-scale-canvas.js +398 -0
- package/build/components/iframe/use-scale-canvas.js.map +1 -0
- package/build/components/image-editor/use-save-image.js +22 -3
- package/build/components/image-editor/use-save-image.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/index.js +0 -10
- package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build/components/inserter/menu.js +2 -1
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +19 -10
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/letter-spacing-control/index.js +10 -0
- package/build/components/letter-spacing-control/index.js.map +1 -1
- package/build/components/line-height-control/index.js +1 -0
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/media-placeholder/index.js +18 -18
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/observe-typing/index.js +0 -1
- package/build/components/observe-typing/index.js.map +1 -1
- package/build/components/recursion-provider/index.js +0 -1
- package/build/components/recursion-provider/index.js.map +1 -1
- package/build/components/rich-text/index.js +5 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/native/use-format-types.js +0 -1
- package/build/components/rich-text/native/use-format-types.js.map +1 -1
- package/build/components/rich-text/use-format-types.js +0 -1
- package/build/components/rich-text/use-format-types.js.map +1 -1
- package/build/components/spacing-sizes-control/utils.js +0 -1
- package/build/components/spacing-sizes-control/utils.js.map +1 -1
- package/build/components/typewriter/index.js +0 -1
- package/build/components/typewriter/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +11 -2
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-moving-animation/index.js +15 -2
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/use-resize-canvas/index.js +1 -1
- package/build/components/use-resize-canvas/index.js.map +1 -1
- package/build/components/writing-flow/use-drag-selection.js +11 -0
- package/build/components/writing-flow/use-drag-selection.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +6 -2
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/hooks/block-bindings.js +4 -3
- package/build/hooks/block-bindings.js.map +1 -1
- package/build/hooks/gap.js +1 -1
- package/build/hooks/gap.js.map +1 -1
- package/build/hooks/generated-class-name.js +0 -1
- package/build/hooks/generated-class-name.js.map +1 -1
- package/build/store/private-selectors.js +1 -7
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +478 -2
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +12 -55
- package/build/store/selectors.js.map +1 -1
- package/build/utils/object.js +0 -1
- package/build/utils/object.js.map +1 -1
- package/build-module/autocompleters/block.js +2 -4
- package/build-module/autocompleters/block.js.map +1 -1
- package/build-module/autocompleters/link.js +2 -4
- package/build-module/autocompleters/link.js.map +1 -1
- package/build-module/components/block-canvas/index.js +3 -6
- package/build-module/components/block-canvas/index.js.map +1 -1
- package/build-module/components/block-list/block.js +8 -7
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/index.js +0 -1
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +7 -2
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +28 -0
- package/build-module/components/block-list/use-block-props/use-firefox-draggable-compatibility.js.map +1 -0
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +97 -5
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +13 -4
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +4 -0
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +7 -4
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +1 -1
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-switcher/index.js +13 -23
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-switcher/use-transformed-patterns.js +0 -1
- package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
- package/build-module/components/block-switcher/utils.js +0 -1
- package/build-module/components/block-switcher/utils.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +17 -9
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +0 -1
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +0 -1
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +1 -0
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/font-family/index.js +10 -0
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +17 -16
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/get-global-styles-changes.js +0 -1
- package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
- package/build-module/components/iframe/index.js +14 -218
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/iframe/use-scale-canvas.js +392 -0
- package/build-module/components/iframe/use-scale-canvas.js.map +1 -0
- package/build-module/components/image-editor/use-save-image.js +22 -3
- package/build-module/components/image-editor/use-save-image.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/index.js +1 -11
- package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build-module/components/inserter/menu.js +2 -1
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +20 -11
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/letter-spacing-control/index.js +9 -0
- package/build-module/components/letter-spacing-control/index.js.map +1 -1
- package/build-module/components/line-height-control/index.js +1 -0
- package/build-module/components/line-height-control/index.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +18 -18
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/observe-typing/index.js +0 -1
- package/build-module/components/observe-typing/index.js.map +1 -1
- package/build-module/components/recursion-provider/index.js +0 -1
- package/build-module/components/recursion-provider/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +5 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/native/use-format-types.js +0 -1
- package/build-module/components/rich-text/native/use-format-types.js.map +1 -1
- package/build-module/components/rich-text/use-format-types.js +0 -1
- package/build-module/components/rich-text/use-format-types.js.map +1 -1
- package/build-module/components/spacing-sizes-control/utils.js +0 -1
- package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
- package/build-module/components/typewriter/index.js +0 -1
- package/build-module/components/typewriter/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +11 -2
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +15 -2
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/use-resize-canvas/index.js +1 -1
- package/build-module/components/use-resize-canvas/index.js.map +1 -1
- package/build-module/components/writing-flow/use-drag-selection.js +11 -0
- package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +6 -2
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/hooks/block-bindings.js +4 -3
- package/build-module/hooks/block-bindings.js.map +1 -1
- package/build-module/hooks/gap.js +1 -1
- package/build-module/hooks/gap.js.map +1 -1
- package/build-module/hooks/generated-class-name.js +0 -1
- package/build-module/hooks/generated-class-name.js.map +1 -1
- package/build-module/store/private-selectors.js +1 -6
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +479 -3
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +12 -55
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/object.js +0 -1
- package/build-module/utils/object.js.map +1 -1
- package/build-style/content-rtl.css +24 -26
- package/build-style/content.css +24 -26
- package/build-style/style-rtl.css +51 -16
- package/build-style/style.css +51 -16
- package/package.json +32 -32
- package/src/autocompleters/block.js +2 -4
- package/src/autocompleters/link.js +2 -4
- package/src/components/alignment-control/stories/aliginment-toolbar.story.js +47 -0
- package/src/components/alignment-control/stories/index.story.js +51 -0
- package/src/components/alignment-control/test/__snapshots__/index.js.snap +5 -5
- package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +4 -4
- package/src/components/block-canvas/index.js +3 -5
- package/src/components/block-canvas/style.scss +2 -1
- package/src/components/block-draggable/content.scss +11 -5
- package/src/components/block-list/block.js +7 -13
- package/src/components/block-list/content.scss +6 -0
- package/src/components/block-list/use-block-props/index.js +7 -0
- package/src/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +25 -0
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +112 -8
- package/src/components/block-patterns-list/index.js +12 -1
- package/src/components/block-patterns-list/style.scss +16 -5
- package/src/components/block-popover/inbetween.js +4 -0
- package/src/components/block-settings-menu/block-settings-dropdown.js +6 -1
- package/src/components/block-settings-menu-controls/index.js +2 -1
- package/src/components/block-switcher/index.js +19 -21
- package/src/components/block-switcher/style.scss +0 -9
- package/src/components/block-title/test/index.js +2 -0
- package/src/components/block-toolbar/index.js +16 -6
- package/src/components/block-tools/style.scss +44 -0
- package/src/components/block-vertical-alignment-control/test/__snapshots__/index.js.snap +3 -3
- package/src/components/color-palette/test/__snapshots__/control.js.snap +2 -2
- package/src/components/font-appearance-control/index.js +1 -0
- package/src/components/font-family/index.js +10 -0
- package/src/components/font-family/style.scss +5 -0
- package/src/components/global-styles/dimensions-panel.js +16 -16
- package/src/components/iframe/content.scss +40 -42
- package/src/components/iframe/index.js +13 -313
- package/src/components/iframe/use-scale-canvas.js +490 -0
- package/src/components/image-editor/use-save-image.js +27 -2
- package/src/components/inserter/block-patterns-tab/index.js +1 -17
- package/src/components/inserter/menu.js +8 -1
- package/src/components/inserter-draggable-blocks/index.js +19 -29
- package/src/components/letter-spacing-control/README.md +2 -1
- package/src/components/letter-spacing-control/index.js +17 -0
- package/src/components/line-height-control/index.js +1 -0
- package/src/components/media-placeholder/index.js +25 -28
- package/src/components/rich-text/index.js +5 -0
- package/src/components/use-block-drop-zone/index.js +18 -1
- package/src/components/use-moving-animation/index.js +15 -0
- package/src/components/use-resize-canvas/index.js +1 -1
- package/src/components/writing-flow/use-drag-selection.js +11 -0
- package/src/components/writing-flow/use-tab-nav.js +9 -6
- package/src/hooks/block-bindings.js +8 -4
- package/src/hooks/gap.js +1 -1
- package/src/store/private-selectors.js +2 -17
- package/src/store/reducer.js +639 -2
- package/src/store/selectors.js +19 -69
- package/src/store/test/private-selectors.js +1 -0
- package/src/store/test/reducer.js +849 -0
- package/src/store/test/selectors.js +4 -110
- package/src/style.scss +1 -0
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
} from '@wordpress/blocks';
|
|
19
19
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
20
20
|
import { copy } from '@wordpress/icons';
|
|
21
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* Internal dependencies
|
|
@@ -185,21 +186,6 @@ function BlockSwitcherDropdownMenuContents( {
|
|
|
185
186
|
);
|
|
186
187
|
}
|
|
187
188
|
|
|
188
|
-
const BlockIndicator = ( { icon, showTitle, blockTitle } ) => (
|
|
189
|
-
<>
|
|
190
|
-
<BlockIcon
|
|
191
|
-
className="block-editor-block-switcher__toggle"
|
|
192
|
-
icon={ icon }
|
|
193
|
-
showColors
|
|
194
|
-
/>
|
|
195
|
-
{ showTitle && blockTitle && (
|
|
196
|
-
<span className="block-editor-block-switcher__toggle-text">
|
|
197
|
-
{ blockTitle }
|
|
198
|
-
</span>
|
|
199
|
-
) }
|
|
200
|
-
</>
|
|
201
|
-
);
|
|
202
|
-
|
|
203
189
|
export const BlockSwitcher = ( { clientIds } ) => {
|
|
204
190
|
const {
|
|
205
191
|
hasContentOnlyLocking,
|
|
@@ -272,6 +258,11 @@ export const BlockSwitcher = ( { clientIds } ) => {
|
|
|
272
258
|
clientId: clientIds?.[ 0 ],
|
|
273
259
|
maximumLength: 35,
|
|
274
260
|
} );
|
|
261
|
+
const showIconLabels = useSelect(
|
|
262
|
+
( select ) =>
|
|
263
|
+
select( preferencesStore ).get( 'core', 'showIconLabels' ),
|
|
264
|
+
[]
|
|
265
|
+
);
|
|
275
266
|
|
|
276
267
|
if ( invalidBlocks ) {
|
|
277
268
|
return null;
|
|
@@ -282,6 +273,11 @@ export const BlockSwitcher = ( { clientIds } ) => {
|
|
|
282
273
|
? blockTitle
|
|
283
274
|
: __( 'Multiple blocks selected' );
|
|
284
275
|
|
|
276
|
+
const blockIndicatorText =
|
|
277
|
+
( isReusable || isTemplate ) && ! showIconLabels && blockTitle
|
|
278
|
+
? blockTitle
|
|
279
|
+
: undefined;
|
|
280
|
+
|
|
285
281
|
const hideDropdown =
|
|
286
282
|
isDisabled ||
|
|
287
283
|
( ! hasBlockStyles && ! canRemove ) ||
|
|
@@ -295,12 +291,13 @@ export const BlockSwitcher = ( { clientIds } ) => {
|
|
|
295
291
|
className="block-editor-block-switcher__no-switcher-icon"
|
|
296
292
|
title={ blockSwitcherLabel }
|
|
297
293
|
icon={
|
|
298
|
-
<
|
|
294
|
+
<BlockIcon
|
|
295
|
+
className="block-editor-block-switcher__toggle"
|
|
299
296
|
icon={ icon }
|
|
300
|
-
|
|
301
|
-
blockTitle={ blockTitle }
|
|
297
|
+
showColors
|
|
302
298
|
/>
|
|
303
299
|
}
|
|
300
|
+
text={ blockIndicatorText }
|
|
304
301
|
/>
|
|
305
302
|
</ToolbarGroup>
|
|
306
303
|
);
|
|
@@ -329,12 +326,13 @@ export const BlockSwitcher = ( { clientIds } ) => {
|
|
|
329
326
|
className: 'block-editor-block-switcher__popover',
|
|
330
327
|
} }
|
|
331
328
|
icon={
|
|
332
|
-
<
|
|
329
|
+
<BlockIcon
|
|
330
|
+
className="block-editor-block-switcher__toggle"
|
|
333
331
|
icon={ icon }
|
|
334
|
-
|
|
335
|
-
blockTitle={ blockTitle }
|
|
332
|
+
showColors
|
|
336
333
|
/>
|
|
337
334
|
}
|
|
335
|
+
text={ blockIndicatorText }
|
|
338
336
|
toggleProps={ {
|
|
339
337
|
description: blockSwitcherDescription,
|
|
340
338
|
...toggleProps,
|
|
@@ -26,15 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
.block-editor-block-switcher__toggle-text {
|
|
30
|
-
margin-left: $grid-unit-10;
|
|
31
|
-
|
|
32
|
-
// Account for double label when show-text-buttons is set.
|
|
33
|
-
.show-icon-labels & {
|
|
34
|
-
display: none;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
29
|
.components-button.block-editor-block-switcher__no-switcher-icon {
|
|
39
30
|
display: flex;
|
|
40
31
|
|
|
@@ -31,7 +31,9 @@ const blockLabelMap = {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
jest.mock( '@wordpress/blocks', () => {
|
|
34
|
+
const actualImplementation = jest.requireActual( '@wordpress/blocks' );
|
|
34
35
|
return {
|
|
36
|
+
...actualImplementation,
|
|
35
37
|
isReusableBlock( { title } ) {
|
|
36
38
|
return title === 'Reusable Block';
|
|
37
39
|
},
|
|
@@ -74,6 +74,8 @@ export function PrivateBlockToolbar( {
|
|
|
74
74
|
showGroupButtons,
|
|
75
75
|
showLockButtons,
|
|
76
76
|
showSwitchSectionStyleButton,
|
|
77
|
+
hasFixedToolbar,
|
|
78
|
+
isNavigationMode,
|
|
77
79
|
} = useSelect( ( select ) => {
|
|
78
80
|
const {
|
|
79
81
|
getBlockName,
|
|
@@ -85,8 +87,10 @@ export function PrivateBlockToolbar( {
|
|
|
85
87
|
getBlockAttributes,
|
|
86
88
|
getBlockParentsByBlockName,
|
|
87
89
|
getTemplateLock,
|
|
90
|
+
getSettings,
|
|
88
91
|
getParentSectionBlock,
|
|
89
92
|
isZoomOut,
|
|
93
|
+
isNavigationMode: _isNavigationMode,
|
|
90
94
|
} = unlock( select( blockEditorStore ) );
|
|
91
95
|
const selectedBlockClientIds = getSelectedBlockClientIds();
|
|
92
96
|
const selectedBlockClientId = selectedBlockClientIds[ 0 ];
|
|
@@ -119,6 +123,9 @@ export function PrivateBlockToolbar( {
|
|
|
119
123
|
const _hasTemplateLock = selectedBlockClientIds.some(
|
|
120
124
|
( id ) => getTemplateLock( id ) === 'contentOnly'
|
|
121
125
|
);
|
|
126
|
+
|
|
127
|
+
const _isZoomOut = isZoomOut();
|
|
128
|
+
|
|
122
129
|
return {
|
|
123
130
|
blockClientId: selectedBlockClientId,
|
|
124
131
|
blockClientIds: selectedBlockClientIds,
|
|
@@ -127,7 +134,7 @@ export function PrivateBlockToolbar( {
|
|
|
127
134
|
shouldShowVisualToolbar: isValid && isVisual,
|
|
128
135
|
toolbarKey: `${ selectedBlockClientId }${ parentClientId }`,
|
|
129
136
|
showParentSelector:
|
|
130
|
-
!
|
|
137
|
+
! _isZoomOut &&
|
|
131
138
|
parentBlockType &&
|
|
132
139
|
getBlockEditingMode( parentClientId ) !== 'disabled' &&
|
|
133
140
|
hasBlockSupport(
|
|
@@ -139,11 +146,13 @@ export function PrivateBlockToolbar( {
|
|
|
139
146
|
isUsingBindings: _isUsingBindings,
|
|
140
147
|
hasParentPattern: _hasParentPattern,
|
|
141
148
|
hasContentOnlyLocking: _hasTemplateLock,
|
|
142
|
-
showShuffleButton:
|
|
143
|
-
showSlots: !
|
|
144
|
-
showGroupButtons: !
|
|
145
|
-
showLockButtons: !
|
|
146
|
-
showSwitchSectionStyleButton:
|
|
149
|
+
showShuffleButton: _isZoomOut,
|
|
150
|
+
showSlots: ! _isZoomOut,
|
|
151
|
+
showGroupButtons: ! _isZoomOut,
|
|
152
|
+
showLockButtons: ! _isZoomOut,
|
|
153
|
+
showSwitchSectionStyleButton: _isZoomOut,
|
|
154
|
+
hasFixedToolbar: getSettings().hasFixedToolbar,
|
|
155
|
+
isNavigationMode: _isNavigationMode(),
|
|
147
156
|
};
|
|
148
157
|
}, [] );
|
|
149
158
|
|
|
@@ -170,6 +179,7 @@ export function PrivateBlockToolbar( {
|
|
|
170
179
|
// Shifts the toolbar to make room for the parent block selector.
|
|
171
180
|
const classes = clsx( 'block-editor-block-contextual-toolbar', {
|
|
172
181
|
'has-parent': showParentSelector,
|
|
182
|
+
'is-inverted-toolbar': isNavigationMode && ! hasFixedToolbar,
|
|
173
183
|
} );
|
|
174
184
|
|
|
175
185
|
const innerClasses = clsx( 'block-editor-block-toolbar', {
|
|
@@ -139,6 +139,50 @@
|
|
|
139
139
|
border-right-color: $gray-900;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
.is-inverted-toolbar {
|
|
143
|
+
background-color: $gray-900;
|
|
144
|
+
color: $gray-100;
|
|
145
|
+
|
|
146
|
+
&.block-editor-block-contextual-toolbar {
|
|
147
|
+
border-color: $gray-800;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
button {
|
|
151
|
+
color: $gray-300;
|
|
152
|
+
|
|
153
|
+
&:hover {
|
|
154
|
+
color: $white;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&:focus::before {
|
|
158
|
+
box-shadow: inset 0 0 0 1px $gray-900, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&:disabled,
|
|
162
|
+
&[aria-disabled="true"] {
|
|
163
|
+
color: $gray-700;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.block-editor-block-parent-selector .block-editor-block-parent-selector__button {
|
|
168
|
+
border-color: $gray-800;
|
|
169
|
+
background-color: $gray-900;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.block-editor-block-switcher__toggle {
|
|
173
|
+
color: $gray-100;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.components-toolbar-group,
|
|
177
|
+
.components-toolbar {
|
|
178
|
+
border-right-color: $gray-800 !important;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.is-pressed {
|
|
182
|
+
color: var(--wp-admin-theme-color);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
142
186
|
// Hide the block toolbar if the insertion point is shown.
|
|
143
187
|
&.is-insertion-point-visible {
|
|
144
188
|
visibility: hidden;
|
|
@@ -42,7 +42,7 @@ exports[`BlockVerticalAlignmentUI should match snapshot when controls are visibl
|
|
|
42
42
|
<button
|
|
43
43
|
aria-label="Align top"
|
|
44
44
|
aria-pressed="true"
|
|
45
|
-
class="components-button components-toolbar__control is-pressed has-icon"
|
|
45
|
+
class="components-button components-toolbar__control is-compact is-pressed has-icon"
|
|
46
46
|
data-toolbar-item="true"
|
|
47
47
|
type="button"
|
|
48
48
|
>
|
|
@@ -64,7 +64,7 @@ exports[`BlockVerticalAlignmentUI should match snapshot when controls are visibl
|
|
|
64
64
|
<button
|
|
65
65
|
aria-label="Align middle"
|
|
66
66
|
aria-pressed="false"
|
|
67
|
-
class="components-button components-toolbar__control has-icon"
|
|
67
|
+
class="components-button components-toolbar__control is-compact has-icon"
|
|
68
68
|
data-toolbar-item="true"
|
|
69
69
|
type="button"
|
|
70
70
|
>
|
|
@@ -86,7 +86,7 @@ exports[`BlockVerticalAlignmentUI should match snapshot when controls are visibl
|
|
|
86
86
|
<button
|
|
87
87
|
aria-label="Align bottom"
|
|
88
88
|
aria-pressed="false"
|
|
89
|
-
class="components-button components-toolbar__control has-icon"
|
|
89
|
+
class="components-button components-toolbar__control is-compact has-icon"
|
|
90
90
|
data-toolbar-item="true"
|
|
91
91
|
type="button"
|
|
92
92
|
>
|
|
@@ -219,7 +219,7 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
|
|
|
219
219
|
<button
|
|
220
220
|
aria-label="Color: red"
|
|
221
221
|
aria-selected="true"
|
|
222
|
-
class="components-button components-circular-option-picker__option"
|
|
222
|
+
class="components-button components-circular-option-picker__option is-next-40px-default-size"
|
|
223
223
|
data-active-item="true"
|
|
224
224
|
id="components-circular-option-picker-0-0"
|
|
225
225
|
role="option"
|
|
@@ -247,7 +247,7 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
|
|
|
247
247
|
class="components-circular-option-picker__custom-clear-wrapper"
|
|
248
248
|
>
|
|
249
249
|
<button
|
|
250
|
-
class="components-button components-circular-option-picker__clear is-tertiary"
|
|
250
|
+
class="components-button components-circular-option-picker__clear is-next-40px-default-size is-tertiary"
|
|
251
251
|
type="button"
|
|
252
252
|
>
|
|
253
253
|
Clear
|
|
@@ -153,6 +153,7 @@ export default function FontAppearanceControl( props ) {
|
|
|
153
153
|
{ ...otherProps }
|
|
154
154
|
className="components-font-appearance-control"
|
|
155
155
|
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
156
|
+
__shouldNotWarnDeprecated36pxSize
|
|
156
157
|
label={ label }
|
|
157
158
|
describedBy={ getDescribedBy() }
|
|
158
159
|
options={ selectOptions }
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* WordPress dependencies
|
|
3
8
|
*/
|
|
@@ -18,6 +23,7 @@ export default function FontFamilyControl( {
|
|
|
18
23
|
value = '',
|
|
19
24
|
onChange,
|
|
20
25
|
fontFamilies,
|
|
26
|
+
className,
|
|
21
27
|
...props
|
|
22
28
|
} ) {
|
|
23
29
|
const [ blockLevelFontFamilies ] = useSettings( 'typography.fontFamilies' );
|
|
@@ -55,10 +61,14 @@ export default function FontFamilyControl( {
|
|
|
55
61
|
return (
|
|
56
62
|
<CustomSelectControl
|
|
57
63
|
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
64
|
+
__shouldNotWarnDeprecated36pxSize
|
|
58
65
|
label={ __( 'Font' ) }
|
|
59
66
|
value={ value }
|
|
60
67
|
onChange={ ( { selectedItem } ) => onChange( selectedItem.key ) }
|
|
61
68
|
options={ options }
|
|
69
|
+
className={ clsx( 'block-editor-font-family-control', className, {
|
|
70
|
+
'is-next-has-no-margin-bottom': __nextHasNoMarginBottom,
|
|
71
|
+
} ) }
|
|
62
72
|
{ ...props }
|
|
63
73
|
/>
|
|
64
74
|
);
|
|
@@ -444,17 +444,6 @@ export default function DimensionsPanel( {
|
|
|
444
444
|
|
|
445
445
|
const onMouseLeaveControls = () => onVisualize( false );
|
|
446
446
|
|
|
447
|
-
const inputProps = {
|
|
448
|
-
min: minMarginValue,
|
|
449
|
-
onDragStart: () => {
|
|
450
|
-
//Reset to 0 in case the value was negative.
|
|
451
|
-
setMinMarginValue( 0 );
|
|
452
|
-
},
|
|
453
|
-
onDragEnd: () => {
|
|
454
|
-
setMinMarginValue( minimumMargin );
|
|
455
|
-
},
|
|
456
|
-
};
|
|
457
|
-
|
|
458
447
|
return (
|
|
459
448
|
<Wrapper
|
|
460
449
|
resetAllFilter={ resetAllFilter }
|
|
@@ -545,8 +534,10 @@ export default function DimensionsPanel( {
|
|
|
545
534
|
units={ units }
|
|
546
535
|
allowReset={ false }
|
|
547
536
|
splitOnAxis={ isAxialPadding }
|
|
548
|
-
|
|
549
|
-
|
|
537
|
+
inputProps={ {
|
|
538
|
+
onMouseOver: onMouseOverPadding,
|
|
539
|
+
onMouseOut: onMouseLeaveControls,
|
|
540
|
+
} }
|
|
550
541
|
/>
|
|
551
542
|
) }
|
|
552
543
|
{ showSpacingPresetsControl && (
|
|
@@ -581,14 +572,23 @@ export default function DimensionsPanel( {
|
|
|
581
572
|
__next40pxDefaultSize
|
|
582
573
|
values={ marginValues }
|
|
583
574
|
onChange={ setMarginValues }
|
|
584
|
-
inputProps={
|
|
575
|
+
inputProps={ {
|
|
576
|
+
min: minMarginValue,
|
|
577
|
+
onDragStart: () => {
|
|
578
|
+
// Reset to 0 in case the value was negative.
|
|
579
|
+
setMinMarginValue( 0 );
|
|
580
|
+
},
|
|
581
|
+
onDragEnd: () => {
|
|
582
|
+
setMinMarginValue( minimumMargin );
|
|
583
|
+
},
|
|
584
|
+
onMouseOver: onMouseOverMargin,
|
|
585
|
+
onMouseOut: onMouseLeaveControls,
|
|
586
|
+
} }
|
|
585
587
|
label={ __( 'Margin' ) }
|
|
586
588
|
sides={ marginSides }
|
|
587
589
|
units={ units }
|
|
588
590
|
allowReset={ false }
|
|
589
591
|
splitOnAxis={ isAxialMargin }
|
|
590
|
-
onMouseOver={ onMouseOverMargin }
|
|
591
|
-
onMouseOut={ onMouseLeaveControls }
|
|
592
592
|
/>
|
|
593
593
|
) }
|
|
594
594
|
{ showSpacingPresetsControl && (
|
|
@@ -4,68 +4,66 @@
|
|
|
4
4
|
|
|
5
5
|
.block-editor-iframe__html {
|
|
6
6
|
transform-origin: top center;
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
// odd ways.
|
|
10
|
-
@include editor-canvas-resize-animation( transform 0s, scale 0s, padding 0s, translate 0s);
|
|
7
|
+
// Prevents a flash of background color change when entering/exiting zoom out
|
|
8
|
+
transition: background-color 400ms;
|
|
11
9
|
|
|
12
10
|
&.zoom-out-animation {
|
|
13
11
|
$scroll-top: var(--wp-block-editor-iframe-zoom-out-scroll-top, 0);
|
|
14
12
|
$scroll-top-next: var(--wp-block-editor-iframe-zoom-out-scroll-top-next, 0);
|
|
13
|
+
$overflow-behavior: var(--wp-block-editor-iframe-zoom-out-overflow-behavior, scroll);
|
|
15
14
|
|
|
16
15
|
position: fixed;
|
|
17
16
|
left: 0;
|
|
18
17
|
right: 0;
|
|
19
18
|
top: calc(-1 * #{$scroll-top});
|
|
20
19
|
bottom: 0;
|
|
21
|
-
translate: 0 calc(#{$scroll-top} - #{$scroll-top-next});
|
|
22
20
|
// Force preserving a scrollbar gutter as scrollbar-gutter isn't supported in all browsers yet,
|
|
23
21
|
// and removing the scrollbar causes the content to shift.
|
|
24
|
-
overflow-y:
|
|
25
|
-
|
|
26
|
-
// We only want to animate the scaling when entering zoom out. When sidebars
|
|
27
|
-
// are toggled, the resizing of the iframe handles scaling the canvas as well,
|
|
28
|
-
// and the doubled animations cause very odd animations.
|
|
29
|
-
@include editor-canvas-resize-animation( transform 0s, top 0s, bottom 0s, right 0s, left 0s );
|
|
22
|
+
overflow-y: $overflow-behavior;
|
|
30
23
|
}
|
|
31
|
-
}
|
|
32
24
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
25
|
+
&.is-zoomed-out {
|
|
26
|
+
$scale: var(--wp-block-editor-iframe-zoom-out-scale, 1);
|
|
27
|
+
$frame-size: var(--wp-block-editor-iframe-zoom-out-frame-size, 0);
|
|
28
|
+
$inner-height: var(--wp-block-editor-iframe-zoom-out-inner-height);
|
|
29
|
+
$content-height: var(--wp-block-editor-iframe-zoom-out-content-height);
|
|
30
|
+
$scale-container-width: var(--wp-block-editor-iframe-zoom-out-scale-container-width);
|
|
31
|
+
$container-width: var(--wp-block-editor-iframe-zoom-out-container-width, 100vw);
|
|
32
|
+
// Apply an X translation to center the scaled content within the available space.
|
|
33
|
+
transform: translateX(calc((#{$scale-container-width} - #{$container-width}) / 2 / #{$scale}));
|
|
34
|
+
scale: $scale;
|
|
35
|
+
background-color: $gray-300;
|
|
44
36
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
// Add the top/bottom frame size. We use scaling to account for the left/right, as
|
|
52
|
-
// the padding left/right causes the contents to reflow, which breaks the 1:1 scaling
|
|
53
|
-
// of the content.
|
|
54
|
-
padding-top: calc(#{$frame-size} / #{$scale});
|
|
55
|
-
padding-bottom: calc(#{$frame-size} / #{$scale});
|
|
37
|
+
// Chrome seems to respect that transform scale shouldn't affect the layout size of the element,
|
|
38
|
+
// so we need to adjust the height of the content to match the scale by using negative margins.
|
|
39
|
+
$extra-content-height: calc(#{$content-height} * (1 - #{$scale}));
|
|
40
|
+
$total-frame-height: calc(2 * #{$frame-size} / #{$scale});
|
|
41
|
+
$total-height: calc(#{$extra-content-height} + #{$total-frame-height} + 2px);
|
|
42
|
+
margin-bottom: calc(-1 * #{$total-height});
|
|
56
43
|
|
|
57
|
-
|
|
58
|
-
|
|
44
|
+
// Add the top/bottom frame size. We use scaling to account for the left/right, as
|
|
45
|
+
// the padding left/right causes the contents to reflow, which breaks the 1:1 scaling
|
|
46
|
+
// of the content.
|
|
47
|
+
padding-top: calc(#{$frame-size} / #{$scale});
|
|
48
|
+
padding-bottom: calc(#{$frame-size} / #{$scale});
|
|
59
49
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
display: flex;
|
|
63
|
-
flex-direction: column;
|
|
64
|
-
height: 100%;
|
|
50
|
+
body {
|
|
51
|
+
min-height: calc((#{$inner-height} - #{$total-frame-height}) / #{$scale});
|
|
65
52
|
|
|
66
|
-
>
|
|
53
|
+
> .is-root-container:not(.wp-block-post-content) {
|
|
67
54
|
flex: 1;
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
height: 100%;
|
|
58
|
+
|
|
59
|
+
> main {
|
|
60
|
+
flex: 1;
|
|
61
|
+
}
|
|
68
62
|
}
|
|
69
63
|
}
|
|
64
|
+
|
|
65
|
+
.wp-block[draggable] {
|
|
66
|
+
cursor: grab;
|
|
67
|
+
}
|
|
70
68
|
}
|
|
71
69
|
}
|