@wordpress/block-library 9.8.4 → 9.8.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/build/block/edit.js +1 -4
- package/build/block/edit.js.map +1 -1
- package/build/button/edit.js +2 -4
- package/build/button/edit.js.map +1 -1
- package/build/cover/edit/index.js +4 -2
- package/build/cover/edit/index.js.map +1 -1
- package/build/image/edit.js +2 -4
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +6 -10
- package/build/image/image.js.map +1 -1
- package/build-module/block/edit.js +1 -4
- package/build-module/block/edit.js.map +1 -1
- package/build-module/button/edit.js +4 -6
- package/build-module/button/edit.js.map +1 -1
- package/build-module/cover/edit/index.js +5 -3
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/image/edit.js +4 -6
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +5 -9
- package/build-module/image/image.js.map +1 -1
- package/build-style/editor-rtl.css +2 -2
- package/build-style/editor.css +2 -2
- package/build-style/group/editor-rtl.css +2 -2
- package/build-style/group/editor.css +2 -2
- package/package.json +11 -11
- package/src/block/edit.js +1 -2
- package/src/button/edit.js +6 -8
- package/src/categories/index.php +1 -1
- package/src/cover/edit/index.js +6 -2
- package/src/group/editor.scss +2 -2
- package/src/image/edit.js +6 -8
- package/src/image/image.js +5 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "9.8.
|
|
3
|
+
"version": "9.8.6",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"@wordpress/api-fetch": "^7.8.2",
|
|
44
44
|
"@wordpress/autop": "^4.8.1",
|
|
45
45
|
"@wordpress/blob": "^4.8.1",
|
|
46
|
-
"@wordpress/block-editor": "^14.3.
|
|
47
|
-
"@wordpress/blocks": "^13.8.
|
|
48
|
-
"@wordpress/components": "^28.8.
|
|
46
|
+
"@wordpress/block-editor": "^14.3.5",
|
|
47
|
+
"@wordpress/blocks": "^13.8.4",
|
|
48
|
+
"@wordpress/components": "^28.8.5",
|
|
49
49
|
"@wordpress/compose": "^7.8.3",
|
|
50
|
-
"@wordpress/core-data": "^7.8.
|
|
50
|
+
"@wordpress/core-data": "^7.8.5",
|
|
51
51
|
"@wordpress/data": "^10.8.3",
|
|
52
52
|
"@wordpress/date": "^5.8.2",
|
|
53
53
|
"@wordpress/deprecated": "^4.8.2",
|
|
@@ -58,17 +58,17 @@
|
|
|
58
58
|
"@wordpress/html-entities": "^4.8.1",
|
|
59
59
|
"@wordpress/i18n": "^5.8.2",
|
|
60
60
|
"@wordpress/icons": "^10.8.2",
|
|
61
|
-
"@wordpress/interactivity": "^6.8.
|
|
62
|
-
"@wordpress/interactivity-router": "^2.8.
|
|
61
|
+
"@wordpress/interactivity": "^6.8.3",
|
|
62
|
+
"@wordpress/interactivity-router": "^2.8.4",
|
|
63
63
|
"@wordpress/keyboard-shortcuts": "^5.8.3",
|
|
64
64
|
"@wordpress/keycodes": "^4.8.2",
|
|
65
65
|
"@wordpress/notices": "^5.8.3",
|
|
66
|
-
"@wordpress/patterns": "^2.8.
|
|
66
|
+
"@wordpress/patterns": "^2.8.5",
|
|
67
67
|
"@wordpress/primitives": "^4.8.1",
|
|
68
68
|
"@wordpress/private-apis": "^1.8.1",
|
|
69
|
-
"@wordpress/reusable-blocks": "^5.8.
|
|
69
|
+
"@wordpress/reusable-blocks": "^5.8.5",
|
|
70
70
|
"@wordpress/rich-text": "^7.8.3",
|
|
71
|
-
"@wordpress/server-side-render": "^5.8.
|
|
71
|
+
"@wordpress/server-side-render": "^5.8.5",
|
|
72
72
|
"@wordpress/url": "^4.8.1",
|
|
73
73
|
"@wordpress/viewport": "^6.8.3",
|
|
74
74
|
"@wordpress/wordcount": "^4.8.1",
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"publishConfig": {
|
|
90
90
|
"access": "public"
|
|
91
91
|
},
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "21b3c2e9abda74edab42455041edc6e82fccc388"
|
|
93
93
|
}
|
package/src/block/edit.js
CHANGED
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
InnerBlocks,
|
|
33
33
|
} from '@wordpress/block-editor';
|
|
34
34
|
import { privateApis as patternsPrivateApis } from '@wordpress/patterns';
|
|
35
|
-
import {
|
|
35
|
+
import { getBlockBindingsSource } from '@wordpress/blocks';
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* Internal dependencies
|
|
@@ -196,7 +196,6 @@ function ReusableBlockEdit( {
|
|
|
196
196
|
( select ) => {
|
|
197
197
|
const { getBlocks, getSettings, getBlockEditingMode } =
|
|
198
198
|
select( blockEditorStore );
|
|
199
|
-
const { getBlockBindingsSource } = unlock( select( blocksStore ) );
|
|
200
199
|
// For editing link to the site editor if the theme and user permissions support it.
|
|
201
200
|
return {
|
|
202
201
|
innerBlocks: getBlocks( patternClientId ),
|
package/src/button/edit.js
CHANGED
|
@@ -9,7 +9,6 @@ import clsx from 'clsx';
|
|
|
9
9
|
import { NEW_TAB_TARGET, NOFOLLOW_REL } from './constants';
|
|
10
10
|
import { getUpdatedLinkAttributes } from './get-updated-link-attributes';
|
|
11
11
|
import removeAnchorTag from '../utils/remove-anchor-tag';
|
|
12
|
-
import { unlock } from '../lock-unlock';
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* WordPress dependencies
|
|
@@ -45,10 +44,10 @@ import {
|
|
|
45
44
|
createBlock,
|
|
46
45
|
cloneBlock,
|
|
47
46
|
getDefaultBlockName,
|
|
48
|
-
|
|
47
|
+
getBlockBindingsSource,
|
|
49
48
|
} from '@wordpress/blocks';
|
|
50
49
|
import { useMergeRefs, useRefEffect } from '@wordpress/compose';
|
|
51
|
-
import { useSelect, useDispatch
|
|
50
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
52
51
|
|
|
53
52
|
const LINK_SETTINGS = [
|
|
54
53
|
...LinkControl.DEFAULT_LINK_SETTINGS,
|
|
@@ -190,7 +189,6 @@ function ButtonEdit( props ) {
|
|
|
190
189
|
const colorProps = useColorProps( attributes );
|
|
191
190
|
const spacingProps = useSpacingProps( attributes );
|
|
192
191
|
const shadowProps = useShadowProps( attributes );
|
|
193
|
-
const registry = useRegistry();
|
|
194
192
|
const ref = useRef();
|
|
195
193
|
const richTextRef = useRef();
|
|
196
194
|
const blockProps = useBlockProps( {
|
|
@@ -241,15 +239,15 @@ function ButtonEdit( props ) {
|
|
|
241
239
|
return {};
|
|
242
240
|
}
|
|
243
241
|
|
|
244
|
-
const blockBindingsSource =
|
|
245
|
-
|
|
246
|
-
)
|
|
242
|
+
const blockBindingsSource = getBlockBindingsSource(
|
|
243
|
+
metadata?.bindings?.url?.source
|
|
244
|
+
);
|
|
247
245
|
|
|
248
246
|
return {
|
|
249
247
|
lockUrlControls:
|
|
250
248
|
!! metadata?.bindings?.url &&
|
|
251
249
|
! blockBindingsSource?.canUserEditValue?.( {
|
|
252
|
-
|
|
250
|
+
select,
|
|
253
251
|
context,
|
|
254
252
|
args: metadata?.bindings?.url?.args,
|
|
255
253
|
} ),
|
package/src/categories/index.php
CHANGED
|
@@ -49,7 +49,7 @@ function render_block_core_categories( $attributes, $content, $block ) {
|
|
|
49
49
|
|
|
50
50
|
$show_label = empty( $attributes['showLabel'] ) ? ' screen-reader-text' : '';
|
|
51
51
|
$default_label = $taxonomy->label;
|
|
52
|
-
$label_text = ! empty( $attributes['label'] ) ? $attributes['label'] : $default_label;
|
|
52
|
+
$label_text = ! empty( $attributes['label'] ) ? wp_kses_post( $attributes['label'] ) : $default_label;
|
|
53
53
|
$wrapper_markup = '<div %1$s><label class="wp-block-categories__label' . $show_label . '" for="' . esc_attr( $id ) . '">' . $label_text . '</label>%2$s</div>';
|
|
54
54
|
$items_markup = wp_dropdown_categories( $args );
|
|
55
55
|
$type = 'dropdown';
|
package/src/cover/edit/index.js
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
useInnerBlocksProps,
|
|
19
19
|
__experimentalUseGradient,
|
|
20
20
|
store as blockEditorStore,
|
|
21
|
+
useBlockEditingMode,
|
|
21
22
|
} from '@wordpress/block-editor';
|
|
22
23
|
import { __ } from '@wordpress/i18n';
|
|
23
24
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
@@ -278,6 +279,9 @@ function CoverEdit( {
|
|
|
278
279
|
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
|
|
279
280
|
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
|
|
280
281
|
|
|
282
|
+
const blockEditingMode = useBlockEditingMode();
|
|
283
|
+
const hasNonContentControls = blockEditingMode === 'default';
|
|
284
|
+
|
|
281
285
|
const [ resizeListener, { height, width } ] = useResizeObserver();
|
|
282
286
|
const resizableBoxDimensions = useMemo( () => {
|
|
283
287
|
return {
|
|
@@ -447,7 +451,7 @@ function CoverEdit( {
|
|
|
447
451
|
<>
|
|
448
452
|
{ blockControls }
|
|
449
453
|
{ inspectorControls }
|
|
450
|
-
{ isSelected && (
|
|
454
|
+
{ hasNonContentControls && isSelected && (
|
|
451
455
|
<ResizableCoverPopover { ...resizableCoverProps } />
|
|
452
456
|
) }
|
|
453
457
|
<TagName
|
|
@@ -576,7 +580,7 @@ function CoverEdit( {
|
|
|
576
580
|
/>
|
|
577
581
|
<div { ...innerBlocksProps } />
|
|
578
582
|
</TagName>
|
|
579
|
-
{ isSelected && (
|
|
583
|
+
{ hasNonContentControls && isSelected && (
|
|
580
584
|
<ResizableCoverPopover { ...resizableCoverProps } />
|
|
581
585
|
) }
|
|
582
586
|
</>
|
package/src/group/editor.scss
CHANGED
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
&::after {
|
|
40
40
|
content: "";
|
|
41
41
|
display: flex;
|
|
42
|
-
flex: 1 0 $
|
|
42
|
+
flex: 1 0 $button-size-next-default-40px;
|
|
43
43
|
pointer-events: none;
|
|
44
|
-
min-height: $
|
|
44
|
+
min-height: $button-size-next-default-40px - $border-width - $border-width;
|
|
45
45
|
border: $border-width dashed currentColor;
|
|
46
46
|
}
|
|
47
47
|
|
package/src/image/edit.js
CHANGED
|
@@ -7,9 +7,9 @@ import clsx from 'clsx';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { isBlobURL, createBlobURL } from '@wordpress/blob';
|
|
10
|
-
import {
|
|
10
|
+
import { createBlock, getBlockBindingsSource } from '@wordpress/blocks';
|
|
11
11
|
import { Placeholder } from '@wordpress/components';
|
|
12
|
-
import { useDispatch, useSelect
|
|
12
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
13
13
|
import {
|
|
14
14
|
BlockIcon,
|
|
15
15
|
useBlockProps,
|
|
@@ -28,7 +28,6 @@ import { useResizeObserver } from '@wordpress/compose';
|
|
|
28
28
|
/**
|
|
29
29
|
* Internal dependencies
|
|
30
30
|
*/
|
|
31
|
-
import { unlock } from '../lock-unlock';
|
|
32
31
|
import { useUploadMediaFromBlobURL } from '../utils/hooks';
|
|
33
32
|
import Image from './image';
|
|
34
33
|
import { isValidFileType } from './utils';
|
|
@@ -113,7 +112,6 @@ export function ImageEdit( {
|
|
|
113
112
|
|
|
114
113
|
const [ temporaryURL, setTemporaryURL ] = useState( attributes.blob );
|
|
115
114
|
|
|
116
|
-
const registry = useRegistry();
|
|
117
115
|
const containerRef = useRef();
|
|
118
116
|
// Only observe the max width from the parent container when the parent layout is not flex nor grid.
|
|
119
117
|
// This won't work for them because the container width changes with the image.
|
|
@@ -373,15 +371,15 @@ export function ImageEdit( {
|
|
|
373
371
|
return {};
|
|
374
372
|
}
|
|
375
373
|
|
|
376
|
-
const blockBindingsSource =
|
|
377
|
-
|
|
378
|
-
)
|
|
374
|
+
const blockBindingsSource = getBlockBindingsSource(
|
|
375
|
+
metadata?.bindings?.url?.source
|
|
376
|
+
);
|
|
379
377
|
|
|
380
378
|
return {
|
|
381
379
|
lockUrlControls:
|
|
382
380
|
!! metadata?.bindings?.url &&
|
|
383
381
|
! blockBindingsSource?.canUserEditValue?.( {
|
|
384
|
-
|
|
382
|
+
select,
|
|
385
383
|
context,
|
|
386
384
|
args: metadata?.bindings?.url?.args,
|
|
387
385
|
} ),
|
package/src/image/image.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
Placeholder,
|
|
18
18
|
} from '@wordpress/components';
|
|
19
19
|
import { useViewportMatch } from '@wordpress/compose';
|
|
20
|
-
import { useSelect, useDispatch
|
|
20
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
21
21
|
import {
|
|
22
22
|
BlockControls,
|
|
23
23
|
InspectorControls,
|
|
@@ -34,7 +34,7 @@ import { useEffect, useMemo, useState, useRef } from '@wordpress/element';
|
|
|
34
34
|
import { __, _x, sprintf, isRTL } from '@wordpress/i18n';
|
|
35
35
|
import { DOWN } from '@wordpress/keycodes';
|
|
36
36
|
import { getFilename } from '@wordpress/url';
|
|
37
|
-
import {
|
|
37
|
+
import { getBlockBindingsSource, switchToBlockType } from '@wordpress/blocks';
|
|
38
38
|
import { crop, overlayText, upload } from '@wordpress/icons';
|
|
39
39
|
import { store as noticesStore } from '@wordpress/notices';
|
|
40
40
|
import { store as coreStore } from '@wordpress/core-data';
|
|
@@ -134,7 +134,6 @@ export default function Image( {
|
|
|
134
134
|
const numericWidth = width ? parseInt( width, 10 ) : undefined;
|
|
135
135
|
const numericHeight = height ? parseInt( height, 10 ) : undefined;
|
|
136
136
|
|
|
137
|
-
const registry = useRegistry();
|
|
138
137
|
const imageRef = useRef();
|
|
139
138
|
const { allowResize = true } = context;
|
|
140
139
|
const { getBlock, getSettings } = useSelect( blockEditorStore );
|
|
@@ -477,7 +476,6 @@ export default function Image( {
|
|
|
477
476
|
if ( ! isSingleSelected ) {
|
|
478
477
|
return {};
|
|
479
478
|
}
|
|
480
|
-
const { getBlockBindingsSource } = unlock( select( blocksStore ) );
|
|
481
479
|
const {
|
|
482
480
|
url: urlBinding,
|
|
483
481
|
alt: altBinding,
|
|
@@ -497,7 +495,7 @@ export default function Image( {
|
|
|
497
495
|
lockUrlControls:
|
|
498
496
|
!! urlBinding &&
|
|
499
497
|
! urlBindingSource?.canUserEditValue?.( {
|
|
500
|
-
|
|
498
|
+
select,
|
|
501
499
|
context,
|
|
502
500
|
args: urlBinding?.args,
|
|
503
501
|
} ),
|
|
@@ -512,7 +510,7 @@ export default function Image( {
|
|
|
512
510
|
lockAltControls:
|
|
513
511
|
!! altBinding &&
|
|
514
512
|
! altBindingSource?.canUserEditValue?.( {
|
|
515
|
-
|
|
513
|
+
select,
|
|
516
514
|
context,
|
|
517
515
|
args: altBinding?.args,
|
|
518
516
|
} ),
|
|
@@ -526,7 +524,7 @@ export default function Image( {
|
|
|
526
524
|
lockTitleControls:
|
|
527
525
|
!! titleBinding &&
|
|
528
526
|
! titleBindingSource?.canUserEditValue?.( {
|
|
529
|
-
|
|
527
|
+
select,
|
|
530
528
|
context,
|
|
531
529
|
args: titleBinding?.args,
|
|
532
530
|
} ),
|