@wordpress/block-editor 12.3.1 → 12.3.3
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 +1 -0
- package/build/components/block-lock/toolbar.js +25 -6
- package/build/components/block-lock/toolbar.js.map +1 -1
- package/build/components/block-toolbar/index.js +8 -5
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/dimensions-tool/aspect-ratio-tool.js +99 -0
- package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -0
- package/build/components/dimensions-tool/index.js +207 -0
- package/build/components/dimensions-tool/index.js.map +1 -0
- package/build/components/dimensions-tool/scale-tool.js +111 -0
- package/build/components/dimensions-tool/scale-tool.js.map +1 -0
- package/build/components/dimensions-tool/width-height-tool.js +125 -0
- package/build/components/dimensions-tool/width-height-tool.js.map +1 -0
- package/build/components/image-editor/aspect-ratio-dropdown.js +1 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build/components/image-editor/use-save-image.js +1 -2
- package/build/components/image-editor/use-save-image.js.map +1 -1
- package/build/components/image-size-control/index.js +6 -0
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/link-control/index.js +17 -15
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/search-input.js +4 -4
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/link-control/settings-drawer.js +2 -3
- package/build/components/link-control/settings-drawer.js.map +1 -1
- package/build/components/provider/use-block-sync.js +21 -0
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/resolution-tool/index.js +55 -0
- package/build/components/resolution-tool/index.js.map +1 -0
- package/build/components/url-input/index.js +4 -2
- package/build/components/url-input/index.js.map +1 -1
- package/build/private-apis.js +7 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/defaults.js +1 -0
- package/build/store/defaults.js.map +1 -1
- package/build-module/components/block-lock/toolbar.js +25 -7
- package/build-module/components/block-lock/toolbar.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +8 -5
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/dimensions-tool/aspect-ratio-tool.js +87 -0
- package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -0
- package/build-module/components/dimensions-tool/index.js +195 -0
- package/build-module/components/dimensions-tool/index.js.map +1 -0
- package/build-module/components/dimensions-tool/scale-tool.js +103 -0
- package/build-module/components/dimensions-tool/scale-tool.js.map +1 -0
- package/build-module/components/dimensions-tool/width-height-tool.js +122 -0
- package/build-module/components/dimensions-tool/width-height-tool.js.map +1 -0
- package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build-module/components/image-editor/use-save-image.js +1 -2
- package/build-module/components/image-editor/use-save-image.js.map +1 -1
- package/build-module/components/image-size-control/index.js +5 -0
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/link-control/index.js +17 -15
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/search-input.js +4 -4
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/link-control/settings-drawer.js +4 -5
- package/build-module/components/link-control/settings-drawer.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +21 -0
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/resolution-tool/index.js +45 -0
- package/build-module/components/resolution-tool/index.js.map +1 -0
- package/build-module/components/url-input/index.js +4 -2
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/private-apis.js +5 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/defaults.js +1 -0
- package/build-module/store/defaults.js.map +1 -1
- package/build-style/style-rtl.css +42 -46
- package/build-style/style.css +42 -46
- package/package.json +6 -5
- package/src/components/alignment-control/test/__snapshots__/index.js.snap +6 -6
- package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +5 -5
- package/src/components/block-lock/toolbar.js +34 -6
- package/src/components/block-toolbar/index.js +9 -6
- package/src/components/block-tools/style.scss +4 -0
- package/src/components/dimensions-tool/aspect-ratio-tool.js +124 -0
- package/src/components/dimensions-tool/index.js +212 -0
- package/src/components/dimensions-tool/scale-tool.js +124 -0
- package/src/components/dimensions-tool/stories/aspect-ratio-tool.js +52 -0
- package/src/components/dimensions-tool/stories/index.js +54 -0
- package/src/components/dimensions-tool/stories/scale-tool.js +48 -0
- package/src/components/dimensions-tool/stories/width-height-tool.js +54 -0
- package/src/components/dimensions-tool/test/index.js +641 -0
- package/src/components/dimensions-tool/width-height-tool.js +113 -0
- package/src/components/image-editor/aspect-ratio-dropdown.js +1 -1
- package/src/components/image-editor/use-save-image.js +0 -1
- package/src/components/image-size-control/index.js +6 -0
- package/src/components/link-control/index.js +32 -28
- package/src/components/link-control/search-input.js +4 -3
- package/src/components/link-control/settings-drawer.js +6 -5
- package/src/components/link-control/style.scss +33 -55
- package/src/components/link-control/test/index.js +129 -116
- package/src/components/media-replace-flow/test/index.js +1 -1
- package/src/components/provider/test/use-block-sync.js +21 -6
- package/src/components/provider/use-block-sync.js +19 -0
- package/src/components/resolution-tool/index.js +56 -0
- package/src/components/resolution-tool/stories/index.js +48 -0
- package/src/components/url-input/index.js +2 -0
- package/src/private-apis.js +4 -0
- package/src/store/defaults.js +1 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import styled from '@emotion/styled';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import {
|
|
10
|
+
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
11
|
+
__experimentalUnitControl as UnitControl,
|
|
12
|
+
} from '@wordpress/components';
|
|
13
|
+
import { __ } from '@wordpress/i18n';
|
|
14
|
+
|
|
15
|
+
const SingleColumnToolsPanelItem = styled( ToolsPanelItem )`
|
|
16
|
+
grid-column: span 1;
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @typedef {import('@wordpress/components/build-types/unit-control/types').WPUnitControlUnit} WPUnitControlUnit
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @typedef {Object} WidthHeightToolValue
|
|
25
|
+
* @property {string} [width] Width CSS value.
|
|
26
|
+
* @property {string} [height] Height CSS value.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @callback WidthHeightToolOnChange
|
|
31
|
+
* @param {WidthHeightToolValue} nextValue Next dimensions value.
|
|
32
|
+
* @return {void}
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @typedef {Object} WidthHeightToolProps
|
|
37
|
+
* @property {string} [panelId] ID of the panel that contains the controls.
|
|
38
|
+
* @property {WidthHeightToolValue} [value] Current dimensions values.
|
|
39
|
+
* @property {WidthHeightToolOnChange} [onChange] Callback to update the dimensions values.
|
|
40
|
+
* @property {WPUnitControlUnit[]} [units] Units options.
|
|
41
|
+
* @property {boolean} [isShownByDefault] Whether the panel is shown by default.
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Component that renders controls to edit the dimensions of an image or container.
|
|
46
|
+
*
|
|
47
|
+
* @param {WidthHeightToolProps} props The component props.
|
|
48
|
+
*
|
|
49
|
+
* @return {import('@wordpress/element').WPElement} The width and height tool.
|
|
50
|
+
*/
|
|
51
|
+
export default function WidthHeightTool( {
|
|
52
|
+
panelId,
|
|
53
|
+
value = {},
|
|
54
|
+
onChange = () => {},
|
|
55
|
+
units,
|
|
56
|
+
isShownByDefault = true,
|
|
57
|
+
} ) {
|
|
58
|
+
// null, undefined, and 'auto' all represent the default value.
|
|
59
|
+
const width = value.width === 'auto' ? '' : value.width ?? '';
|
|
60
|
+
const height = value.height === 'auto' ? '' : value.height ?? '';
|
|
61
|
+
|
|
62
|
+
const onDimensionChange = ( dimension ) => ( nextDimension ) => {
|
|
63
|
+
const nextValue = { ...value };
|
|
64
|
+
// Empty strings or undefined may be passed and both represent removing the value.
|
|
65
|
+
if ( ! nextDimension ) {
|
|
66
|
+
delete nextValue[ dimension ];
|
|
67
|
+
} else {
|
|
68
|
+
nextValue[ dimension ] = nextDimension;
|
|
69
|
+
}
|
|
70
|
+
onChange( nextValue );
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<>
|
|
75
|
+
<SingleColumnToolsPanelItem
|
|
76
|
+
label={ __( 'Width' ) }
|
|
77
|
+
isShownByDefault={ isShownByDefault }
|
|
78
|
+
hasValue={ () => width !== '' }
|
|
79
|
+
onDeselect={ onDimensionChange( 'width' ) }
|
|
80
|
+
panelId={ panelId }
|
|
81
|
+
>
|
|
82
|
+
<UnitControl
|
|
83
|
+
label={ __( 'Width' ) }
|
|
84
|
+
placeholder={ __( 'Auto' ) }
|
|
85
|
+
labelPosition="top"
|
|
86
|
+
units={ units }
|
|
87
|
+
min={ 0 }
|
|
88
|
+
value={ width }
|
|
89
|
+
onChange={ onDimensionChange( 'width' ) }
|
|
90
|
+
size={ '__unstable-large' }
|
|
91
|
+
/>
|
|
92
|
+
</SingleColumnToolsPanelItem>
|
|
93
|
+
<SingleColumnToolsPanelItem
|
|
94
|
+
label={ __( 'Height' ) }
|
|
95
|
+
isShownByDefault={ isShownByDefault }
|
|
96
|
+
hasValue={ () => height !== '' }
|
|
97
|
+
onDeselect={ onDimensionChange( 'height' ) }
|
|
98
|
+
panelId={ panelId }
|
|
99
|
+
>
|
|
100
|
+
<UnitControl
|
|
101
|
+
label={ __( 'Height' ) }
|
|
102
|
+
placeholder={ __( 'Auto' ) }
|
|
103
|
+
labelPosition="top"
|
|
104
|
+
units={ units }
|
|
105
|
+
min={ 0 }
|
|
106
|
+
value={ height }
|
|
107
|
+
onChange={ onDimensionChange( 'height' ) }
|
|
108
|
+
size={ '__unstable-large' }
|
|
109
|
+
/>
|
|
110
|
+
</SingleColumnToolsPanelItem>
|
|
111
|
+
</>
|
|
112
|
+
);
|
|
113
|
+
}
|
|
@@ -54,7 +54,7 @@ export default function AspectRatioDropdown( { toggleProps } ) {
|
|
|
54
54
|
} }
|
|
55
55
|
value={ aspect }
|
|
56
56
|
aspectRatios={ [
|
|
57
|
-
// All ratios should be mirrored in
|
|
57
|
+
// All ratios should be mirrored in AspectRatioTool in @wordpress/block-editor.
|
|
58
58
|
{
|
|
59
59
|
title: __( 'Original' ),
|
|
60
60
|
aspect: defaultAspect,
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
__experimentalNumberControl as NumberControl,
|
|
9
9
|
__experimentalHStack as HStack,
|
|
10
10
|
} from '@wordpress/components';
|
|
11
|
+
import deprecated from '@wordpress/deprecated';
|
|
11
12
|
import { __ } from '@wordpress/i18n';
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -30,6 +31,11 @@ export default function ImageSizeControl( {
|
|
|
30
31
|
onChange,
|
|
31
32
|
onChangeImage = noop,
|
|
32
33
|
} ) {
|
|
34
|
+
deprecated( 'wp.blockEditor.__experimentalImageSizeControl', {
|
|
35
|
+
since: '6.3',
|
|
36
|
+
alternative:
|
|
37
|
+
'wp.blockEditor.privateApis.DimensionsTool and wp.blockEditor.privateApis.ResolutionTool',
|
|
38
|
+
} );
|
|
33
39
|
const { currentHeight, currentWidth, updateDimension, updateDimensions } =
|
|
34
40
|
useDimensionHandler( height, width, imageHeight, imageWidth, onChange );
|
|
35
41
|
|
|
@@ -292,7 +292,8 @@ function LinkControl( {
|
|
|
292
292
|
const shownUnlinkControl =
|
|
293
293
|
onRemove && value && ! isEditingLink && ! isCreatingPage;
|
|
294
294
|
|
|
295
|
-
const showSettings = !! settings?.length;
|
|
295
|
+
const showSettings = !! settings?.length && isEditingLink && hasLinkValue;
|
|
296
|
+
const showActions = isEditingLink && hasLinkValue;
|
|
296
297
|
|
|
297
298
|
// Only show text control once a URL value has been committed
|
|
298
299
|
// and it isn't just empty whitespace.
|
|
@@ -322,6 +323,18 @@ function LinkControl( {
|
|
|
322
323
|
'has-text-control': showTextControl,
|
|
323
324
|
} ) }
|
|
324
325
|
>
|
|
326
|
+
{ showTextControl && (
|
|
327
|
+
<TextControl
|
|
328
|
+
__nextHasNoMarginBottom
|
|
329
|
+
ref={ textInputRef }
|
|
330
|
+
className="block-editor-link-control__field block-editor-link-control__text-content"
|
|
331
|
+
label={ __( 'Text' ) }
|
|
332
|
+
value={ internalControlValue?.title }
|
|
333
|
+
onChange={ setInternalTextInputValue }
|
|
334
|
+
onKeyDown={ handleSubmitWithEnter }
|
|
335
|
+
size="__unstable-large"
|
|
336
|
+
/>
|
|
337
|
+
) }
|
|
325
338
|
<LinkControlSearchInput
|
|
326
339
|
currentLink={ value }
|
|
327
340
|
className="block-editor-link-control__field block-editor-link-control__search-input"
|
|
@@ -339,19 +352,8 @@ function LinkControl( {
|
|
|
339
352
|
createSuggestionButtonText={
|
|
340
353
|
createSuggestionButtonText
|
|
341
354
|
}
|
|
342
|
-
|
|
355
|
+
hideLabelFromVision={ ! showTextControl }
|
|
343
356
|
/>
|
|
344
|
-
{ showTextControl && (
|
|
345
|
-
<TextControl
|
|
346
|
-
__nextHasNoMarginBottom
|
|
347
|
-
ref={ textInputRef }
|
|
348
|
-
className="block-editor-link-control__field block-editor-link-control__text-content"
|
|
349
|
-
label={ __( 'Text' ) }
|
|
350
|
-
value={ internalControlValue?.title }
|
|
351
|
-
onChange={ setInternalTextInputValue }
|
|
352
|
-
onKeyDown={ handleSubmitWithEnter }
|
|
353
|
-
/>
|
|
354
|
-
) }
|
|
355
357
|
</div>
|
|
356
358
|
{ errorMessage && (
|
|
357
359
|
<Notice
|
|
@@ -376,9 +378,9 @@ function LinkControl( {
|
|
|
376
378
|
/>
|
|
377
379
|
) }
|
|
378
380
|
|
|
379
|
-
{
|
|
381
|
+
{ showSettings && (
|
|
380
382
|
<div className="block-editor-link-control__tools">
|
|
381
|
-
{
|
|
383
|
+
{ ! currentInputIsEmpty && (
|
|
382
384
|
<LinkControlSettingsDrawer
|
|
383
385
|
settingsOpen={ settingsOpen }
|
|
384
386
|
setSettingsOpen={ setSettingsOpen }
|
|
@@ -392,20 +394,22 @@ function LinkControl( {
|
|
|
392
394
|
/>
|
|
393
395
|
</LinkControlSettingsDrawer>
|
|
394
396
|
) }
|
|
397
|
+
</div>
|
|
398
|
+
) }
|
|
395
399
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
</
|
|
400
|
+
{ showActions && (
|
|
401
|
+
<div className="block-editor-link-control__search-actions">
|
|
402
|
+
<Button
|
|
403
|
+
variant="primary"
|
|
404
|
+
onClick={ isDisabled ? noop : handleSubmit }
|
|
405
|
+
className="block-editor-link-control__search-submit"
|
|
406
|
+
aria-disabled={ isDisabled }
|
|
407
|
+
>
|
|
408
|
+
{ __( 'Save' ) }
|
|
409
|
+
</Button>
|
|
410
|
+
<Button variant="tertiary" onClick={ handleCancel }>
|
|
411
|
+
{ __( 'Cancel' ) }
|
|
412
|
+
</Button>
|
|
409
413
|
</div>
|
|
410
414
|
) }
|
|
411
415
|
|
|
@@ -46,7 +46,7 @@ const LinkControlSearchInput = forwardRef(
|
|
|
46
46
|
suggestionsQuery = {},
|
|
47
47
|
withURLSuggestion = true,
|
|
48
48
|
createSuggestionButtonText,
|
|
49
|
-
|
|
49
|
+
hideLabelFromVision = false,
|
|
50
50
|
},
|
|
51
51
|
ref
|
|
52
52
|
) => {
|
|
@@ -120,7 +120,7 @@ const LinkControlSearchInput = forwardRef(
|
|
|
120
120
|
};
|
|
121
121
|
|
|
122
122
|
const inputClasses = classnames( className, {
|
|
123
|
-
'has-no-label': !
|
|
123
|
+
// 'has-no-label': ! hideLabelFromVision,
|
|
124
124
|
} );
|
|
125
125
|
|
|
126
126
|
return (
|
|
@@ -128,7 +128,8 @@ const LinkControlSearchInput = forwardRef(
|
|
|
128
128
|
<URLInput
|
|
129
129
|
disableSuggestions={ currentLink?.url === value }
|
|
130
130
|
__nextHasNoMarginBottom
|
|
131
|
-
label={
|
|
131
|
+
label={ __( 'Link' ) }
|
|
132
|
+
hideLabelFromVision={ hideLabelFromVision }
|
|
132
133
|
className={ inputClasses }
|
|
133
134
|
value={ value }
|
|
134
135
|
onChange={ onInputChange }
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
__unstableMotion as motion,
|
|
7
7
|
__unstableAnimatePresence as AnimatePresence,
|
|
8
8
|
} from '@wordpress/components';
|
|
9
|
-
import {
|
|
9
|
+
import { chevronLeftSmall, chevronRightSmall } from '@wordpress/icons';
|
|
10
10
|
import { useReducedMotion, useInstanceId } from '@wordpress/compose';
|
|
11
|
-
import {
|
|
11
|
+
import { _x, isRTL } from '@wordpress/i18n';
|
|
12
12
|
import { Fragment } from '@wordpress/element';
|
|
13
13
|
|
|
14
14
|
function LinkSettingsDrawer( { children, settingsOpen, setSettingsOpen } ) {
|
|
@@ -28,10 +28,11 @@ function LinkSettingsDrawer( { children, settingsOpen, setSettingsOpen } ) {
|
|
|
28
28
|
className="block-editor-link-control__drawer-toggle"
|
|
29
29
|
aria-expanded={ settingsOpen }
|
|
30
30
|
onClick={ () => setSettingsOpen( ! settingsOpen ) }
|
|
31
|
-
icon={
|
|
32
|
-
label={ __( 'Link Settings' ) }
|
|
31
|
+
icon={ isRTL() ? chevronLeftSmall : chevronRightSmall }
|
|
33
32
|
aria-controls={ settingsDrawerId }
|
|
34
|
-
|
|
33
|
+
>
|
|
34
|
+
{ _x( 'Advanced', 'Additional link settings' ) }
|
|
35
|
+
</Button>
|
|
35
36
|
<MaybeAnimatePresence>
|
|
36
37
|
{ settingsOpen && (
|
|
37
38
|
<MaybeMotionDiv
|
|
@@ -59,29 +59,18 @@ $preview-image-height: 140px;
|
|
|
59
59
|
.block-editor-link-control__field {
|
|
60
60
|
margin: $grid-unit-20; // allow margin collapse for vertical spacing.
|
|
61
61
|
|
|
62
|
-
// Element wrapping the label and input.
|
|
63
|
-
> .components-base-control__field {
|
|
64
|
-
display: flex;
|
|
65
|
-
align-items: center;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.components-base-control__label {
|
|
69
|
-
margin-right: $grid-unit-20;
|
|
70
|
-
margin-bottom: 0;
|
|
71
|
-
min-width: 29px; // align with search results.
|
|
72
|
-
}
|
|
73
|
-
|
|
74
62
|
input[type="text"],
|
|
75
63
|
// Specificity overide of URLInput defaults.
|
|
76
64
|
&.block-editor-url-input input[type="text"].block-editor-url-input__input {
|
|
77
65
|
@include input-control;
|
|
78
|
-
width: calc(100% - #{$grid-unit-20 * 2});
|
|
79
66
|
display: block;
|
|
80
|
-
|
|
67
|
+
border: 1px solid $gray-600;
|
|
68
|
+
border-radius: $radius-block-ui;
|
|
69
|
+
height: $button-size-next-default-40px; // components do not properly support unstable-large yet.
|
|
81
70
|
margin: 0;
|
|
71
|
+
padding: $grid-unit-10 $grid-unit-20;
|
|
82
72
|
position: relative;
|
|
83
|
-
|
|
84
|
-
border-radius: $radius-block-ui;
|
|
73
|
+
width: 100%;
|
|
85
74
|
}
|
|
86
75
|
}
|
|
87
76
|
|
|
@@ -94,12 +83,12 @@ $preview-image-height: 140px;
|
|
|
94
83
|
flex-direction: row-reverse; // put "Cancel" on the left but retain DOM order.
|
|
95
84
|
justify-content: flex-start;
|
|
96
85
|
gap: $grid-unit-10;
|
|
86
|
+
padding: $grid-unit-10;
|
|
97
87
|
order: 20;
|
|
98
88
|
}
|
|
99
89
|
|
|
100
90
|
.block-editor-link-control__search-results-wrapper {
|
|
101
91
|
position: relative;
|
|
102
|
-
margin-top: -$grid-unit-20 + 1px;
|
|
103
92
|
|
|
104
93
|
&::before,
|
|
105
94
|
&::after {
|
|
@@ -440,36 +429,7 @@ $preview-image-height: 140px;
|
|
|
440
429
|
display: flex; // allow for ordering.
|
|
441
430
|
flex-direction: column;
|
|
442
431
|
flex-basis: 100%; // occupy full width.
|
|
443
|
-
margin-top: $grid-unit-20;
|
|
444
|
-
padding-top: $grid-unit-20;
|
|
445
432
|
position: relative;
|
|
446
|
-
|
|
447
|
-
&::after {
|
|
448
|
-
content: "";
|
|
449
|
-
display: block;
|
|
450
|
-
height: 1px;
|
|
451
|
-
background-color: $gray-300;
|
|
452
|
-
position: absolute;
|
|
453
|
-
left: -$grid-unit-20;
|
|
454
|
-
right: -$grid-unit-20;
|
|
455
|
-
top: 0;
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
.block-editor-link-control__tools {
|
|
460
|
-
display: flex;
|
|
461
|
-
flex-wrap: wrap;
|
|
462
|
-
align-items: center;
|
|
463
|
-
justify-content: space-between;
|
|
464
|
-
margin: 0;
|
|
465
|
-
padding: $grid-unit-20;
|
|
466
|
-
|
|
467
|
-
// To hide the horizontal scrollbar on toggle.
|
|
468
|
-
// Margin and padding are needed to prevent cutoff of the toggle button focus outline.
|
|
469
|
-
// See: https://github.com/WordPress/gutenberg/pull/47986
|
|
470
|
-
margin-top: calc(var(--wp-admin-border-width-focus) * -1);
|
|
471
|
-
padding-top: var(--wp-admin-border-width-focus);
|
|
472
|
-
overflow: hidden;
|
|
473
433
|
}
|
|
474
434
|
|
|
475
435
|
.block-editor-link-control__unlink {
|
|
@@ -477,17 +437,10 @@ $preview-image-height: 140px;
|
|
|
477
437
|
padding-right: $grid-unit-20;
|
|
478
438
|
}
|
|
479
439
|
|
|
480
|
-
.block-editor-link-control__settings {
|
|
481
|
-
flex: 1;
|
|
482
|
-
margin: 0;
|
|
483
|
-
|
|
484
|
-
.is-alternate & {
|
|
485
|
-
border-top: $border-width solid $gray-900;
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
|
|
489
440
|
.block-editor-link-control__setting {
|
|
490
441
|
margin-bottom: $grid-unit-20;
|
|
442
|
+
flex: 1;
|
|
443
|
+
padding: $grid-unit-10 0 $grid-unit-10 $grid-unit-30;
|
|
491
444
|
|
|
492
445
|
// Cancel left margin inherited from WP Admin Forms CSS.
|
|
493
446
|
input {
|
|
@@ -499,6 +452,31 @@ $preview-image-height: 140px;
|
|
|
499
452
|
}
|
|
500
453
|
}
|
|
501
454
|
|
|
455
|
+
.block-editor-link-control__tools {
|
|
456
|
+
padding: $grid-unit-10 $grid-unit-10 0 $grid-unit-10;
|
|
457
|
+
margin-top: #{$grid-unit-20 * -1};
|
|
458
|
+
|
|
459
|
+
.components-button.block-editor-link-control__drawer-toggle {
|
|
460
|
+
padding-left: 0;
|
|
461
|
+
gap: 0;
|
|
462
|
+
|
|
463
|
+
// Point downwards when open (same as list view expander)
|
|
464
|
+
&[aria-expanded="true"] svg {
|
|
465
|
+
visibility: visible;
|
|
466
|
+
transition: transform 0.1s ease;
|
|
467
|
+
transform: rotate(90deg);
|
|
468
|
+
@include reduce-motion("transition");
|
|
469
|
+
}
|
|
470
|
+
// Point rightwards when closed (same as list view expander)
|
|
471
|
+
&[aria-expanded="false"] svg {
|
|
472
|
+
visibility: visible;
|
|
473
|
+
transform: rotate(0deg);
|
|
474
|
+
transition: transform 0.1s ease;
|
|
475
|
+
@include reduce-motion("transition");
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
502
480
|
.block-editor-link-control .block-editor-link-control__search-input .components-spinner {
|
|
503
481
|
display: block;
|
|
504
482
|
|