@wordpress/block-editor 15.10.1-next.06ee73755.0 → 15.10.1-next.ba3aee3a2.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/build/components/block-bindings/attribute-control.cjs +1 -1
- package/build/components/block-bindings/attribute-control.cjs.map +1 -1
- package/build/components/block-bindings/source-fields-list.cjs +1 -1
- package/build/components/block-bindings/source-fields-list.cjs.map +1 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.cjs +1 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.cjs.map +1 -1
- package/build/components/inserter/menu.cjs +2 -6
- package/build/components/inserter/menu.cjs.map +2 -2
- package/build/components/rich-text/index.cjs +1 -1
- package/build/components/rich-text/index.cjs.map +1 -1
- package/build/hooks/block-fields/index.cjs +28 -39
- package/build/hooks/block-fields/index.cjs.map +2 -2
- package/build/store/reducer.cjs +1 -1
- package/build/store/reducer.cjs.map +1 -1
- package/build-module/components/block-bindings/attribute-control.mjs +1 -1
- package/build-module/components/block-bindings/attribute-control.mjs.map +1 -1
- package/build-module/components/block-bindings/source-fields-list.mjs +1 -1
- package/build-module/components/block-bindings/source-fields-list.mjs.map +1 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs +1 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs.map +1 -1
- package/build-module/components/inserter/menu.mjs +2 -6
- package/build-module/components/inserter/menu.mjs.map +2 -2
- package/build-module/components/rich-text/index.mjs +1 -1
- package/build-module/components/rich-text/index.mjs.map +1 -1
- package/build-module/hooks/block-fields/index.mjs +28 -39
- package/build-module/hooks/block-fields/index.mjs.map +2 -2
- package/build-module/store/reducer.mjs +1 -1
- package/build-module/store/reducer.mjs.map +1 -1
- package/build-style/style-rtl.css +0 -1
- package/build-style/style.css +0 -1
- package/package.json +39 -39
- package/src/components/block-bindings/attribute-control.js +1 -1
- package/src/components/block-bindings/source-fields-list.js +1 -1
- package/src/components/inner-blocks/use-inner-block-template-sync.js +1 -1
- package/src/components/inserter/menu.js +2 -6
- package/src/components/rich-text/index.js +1 -1
- package/src/hooks/block-fields/index.js +19 -57
- package/src/hooks/block-fields/styles.scss +0 -2
- package/src/store/reducer.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "15.10.1-next.
|
|
3
|
+
"version": "15.10.1-next.ba3aee3a2.0",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -61,43 +61,43 @@
|
|
|
61
61
|
],
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@react-spring/web": "^9.4.5",
|
|
64
|
-
"@wordpress/a11y": "^4.37.1-next.
|
|
65
|
-
"@wordpress/api-fetch": "^7.37.1-next.
|
|
66
|
-
"@wordpress/base-styles": "^6.13.2-next.
|
|
67
|
-
"@wordpress/blob": "^4.37.1-next.
|
|
68
|
-
"@wordpress/block-serialization-default-parser": "^5.37.1-next.
|
|
69
|
-
"@wordpress/blocks": "^15.10.1-next.
|
|
70
|
-
"@wordpress/commands": "^1.37.1-next.
|
|
71
|
-
"@wordpress/components": "^32.0.1-next.
|
|
72
|
-
"@wordpress/compose": "^7.37.1-next.
|
|
73
|
-
"@wordpress/data": "^10.37.1-next.
|
|
74
|
-
"@wordpress/dataviews": "^11.2.1-next.
|
|
75
|
-
"@wordpress/date": "^5.37.2-next.
|
|
76
|
-
"@wordpress/deprecated": "^4.37.1-next.
|
|
77
|
-
"@wordpress/dom": "^4.37.1-next.
|
|
78
|
-
"@wordpress/element": "^6.37.1-next.
|
|
79
|
-
"@wordpress/escape-html": "^3.37.1-next.
|
|
80
|
-
"@wordpress/global-styles-engine": "^1.4.1-next.
|
|
81
|
-
"@wordpress/hooks": "^4.37.1-next.
|
|
82
|
-
"@wordpress/html-entities": "^4.37.1-next.
|
|
83
|
-
"@wordpress/i18n": "^6.10.1-next.
|
|
84
|
-
"@wordpress/icons": "^11.4.1-next.
|
|
85
|
-
"@wordpress/image-cropper": "^1.1.1-next.
|
|
86
|
-
"@wordpress/interactivity": "^6.37.2-next.
|
|
87
|
-
"@wordpress/is-shallow-equal": "^5.37.1-next.
|
|
88
|
-
"@wordpress/keyboard-shortcuts": "^5.37.1-next.
|
|
89
|
-
"@wordpress/keycodes": "^4.38.1-next.
|
|
90
|
-
"@wordpress/notices": "^5.37.1-next.
|
|
91
|
-
"@wordpress/preferences": "^4.37.1-next.
|
|
92
|
-
"@wordpress/priority-queue": "^3.37.1-next.
|
|
93
|
-
"@wordpress/private-apis": "^1.37.1-next.
|
|
94
|
-
"@wordpress/rich-text": "^7.37.1-next.
|
|
95
|
-
"@wordpress/style-engine": "^2.37.1-next.
|
|
96
|
-
"@wordpress/token-list": "^3.37.1-next.
|
|
97
|
-
"@wordpress/upload-media": "^0.22.1-next.
|
|
98
|
-
"@wordpress/url": "^4.37.1-next.
|
|
99
|
-
"@wordpress/warning": "^3.37.1-next.
|
|
100
|
-
"@wordpress/wordcount": "^4.37.1-next.
|
|
64
|
+
"@wordpress/a11y": "^4.37.1-next.ba3aee3a2.0",
|
|
65
|
+
"@wordpress/api-fetch": "^7.37.1-next.ba3aee3a2.0",
|
|
66
|
+
"@wordpress/base-styles": "^6.13.2-next.ba3aee3a2.0",
|
|
67
|
+
"@wordpress/blob": "^4.37.1-next.ba3aee3a2.0",
|
|
68
|
+
"@wordpress/block-serialization-default-parser": "^5.37.1-next.ba3aee3a2.0",
|
|
69
|
+
"@wordpress/blocks": "^15.10.1-next.ba3aee3a2.0",
|
|
70
|
+
"@wordpress/commands": "^1.37.1-next.ba3aee3a2.0",
|
|
71
|
+
"@wordpress/components": "^32.0.1-next.ba3aee3a2.0",
|
|
72
|
+
"@wordpress/compose": "^7.37.1-next.ba3aee3a2.0",
|
|
73
|
+
"@wordpress/data": "^10.37.1-next.ba3aee3a2.0",
|
|
74
|
+
"@wordpress/dataviews": "^11.2.1-next.ba3aee3a2.0",
|
|
75
|
+
"@wordpress/date": "^5.37.2-next.ba3aee3a2.0",
|
|
76
|
+
"@wordpress/deprecated": "^4.37.1-next.ba3aee3a2.0",
|
|
77
|
+
"@wordpress/dom": "^4.37.1-next.ba3aee3a2.0",
|
|
78
|
+
"@wordpress/element": "^6.37.1-next.ba3aee3a2.0",
|
|
79
|
+
"@wordpress/escape-html": "^3.37.1-next.ba3aee3a2.0",
|
|
80
|
+
"@wordpress/global-styles-engine": "^1.4.1-next.ba3aee3a2.0",
|
|
81
|
+
"@wordpress/hooks": "^4.37.1-next.ba3aee3a2.0",
|
|
82
|
+
"@wordpress/html-entities": "^4.37.1-next.ba3aee3a2.0",
|
|
83
|
+
"@wordpress/i18n": "^6.10.1-next.ba3aee3a2.0",
|
|
84
|
+
"@wordpress/icons": "^11.4.1-next.ba3aee3a2.0",
|
|
85
|
+
"@wordpress/image-cropper": "^1.1.1-next.ba3aee3a2.0",
|
|
86
|
+
"@wordpress/interactivity": "^6.37.2-next.ba3aee3a2.0",
|
|
87
|
+
"@wordpress/is-shallow-equal": "^5.37.1-next.ba3aee3a2.0",
|
|
88
|
+
"@wordpress/keyboard-shortcuts": "^5.37.1-next.ba3aee3a2.0",
|
|
89
|
+
"@wordpress/keycodes": "^4.38.1-next.ba3aee3a2.0",
|
|
90
|
+
"@wordpress/notices": "^5.37.1-next.ba3aee3a2.0",
|
|
91
|
+
"@wordpress/preferences": "^4.37.1-next.ba3aee3a2.0",
|
|
92
|
+
"@wordpress/priority-queue": "^3.37.1-next.ba3aee3a2.0",
|
|
93
|
+
"@wordpress/private-apis": "^1.37.1-next.ba3aee3a2.0",
|
|
94
|
+
"@wordpress/rich-text": "^7.37.1-next.ba3aee3a2.0",
|
|
95
|
+
"@wordpress/style-engine": "^2.37.1-next.ba3aee3a2.0",
|
|
96
|
+
"@wordpress/token-list": "^3.37.1-next.ba3aee3a2.0",
|
|
97
|
+
"@wordpress/upload-media": "^0.22.1-next.ba3aee3a2.0",
|
|
98
|
+
"@wordpress/url": "^4.37.1-next.ba3aee3a2.0",
|
|
99
|
+
"@wordpress/warning": "^3.37.1-next.ba3aee3a2.0",
|
|
100
|
+
"@wordpress/wordcount": "^4.37.1-next.ba3aee3a2.0",
|
|
101
101
|
"change-case": "^4.1.2",
|
|
102
102
|
"clsx": "^2.1.1",
|
|
103
103
|
"colord": "^2.7.0",
|
|
@@ -124,5 +124,5 @@
|
|
|
124
124
|
"publishConfig": {
|
|
125
125
|
"access": "public"
|
|
126
126
|
},
|
|
127
|
-
"gitHead": "
|
|
127
|
+
"gitHead": "67d2e486fcd40c753591cf911ca0659132f519ca"
|
|
128
128
|
}
|
|
@@ -75,8 +75,6 @@ function InserterMenu(
|
|
|
75
75
|
const [ selectedMediaCategory, setSelectedMediaCategory ] =
|
|
76
76
|
useState( null );
|
|
77
77
|
const isLargeViewport = useViewportMatch( 'large' );
|
|
78
|
-
const isMobileViewport = useViewportMatch( 'medium', '<' );
|
|
79
|
-
const maybeCloseInserter = isMobileViewport ? onClose : NOOP;
|
|
80
78
|
|
|
81
79
|
function getInitialTab() {
|
|
82
80
|
if ( __experimentalInitialTab ) {
|
|
@@ -116,7 +114,6 @@ function InserterMenu(
|
|
|
116
114
|
_rootClientId
|
|
117
115
|
);
|
|
118
116
|
onSelect( blocks );
|
|
119
|
-
maybeCloseInserter();
|
|
120
117
|
|
|
121
118
|
// Check for focus loss due to filtering blocks by selected block type
|
|
122
119
|
window.requestAnimationFrame( () => {
|
|
@@ -131,7 +128,7 @@ function InserterMenu(
|
|
|
131
128
|
}
|
|
132
129
|
} );
|
|
133
130
|
},
|
|
134
|
-
[ onInsertBlocks,
|
|
131
|
+
[ onInsertBlocks, onSelect, shouldFocusBlock ]
|
|
135
132
|
);
|
|
136
133
|
|
|
137
134
|
const onInsertPattern = useCallback(
|
|
@@ -139,9 +136,8 @@ function InserterMenu(
|
|
|
139
136
|
onToggleInsertionPoint( false );
|
|
140
137
|
onInsertBlocks( blocks, { patternName }, ...args );
|
|
141
138
|
onSelect();
|
|
142
|
-
maybeCloseInserter();
|
|
143
139
|
},
|
|
144
|
-
[ onInsertBlocks,
|
|
140
|
+
[ onInsertBlocks, onSelect ]
|
|
145
141
|
);
|
|
146
142
|
|
|
147
143
|
const onHover = useCallback(
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
import { createHigherOrderComponent } from '@wordpress/compose';
|
|
11
11
|
import { DataForm } from '@wordpress/dataviews';
|
|
12
12
|
import { useContext, useState, useMemo } from '@wordpress/element';
|
|
13
|
-
import { __ } from '@wordpress/i18n';
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* Internal dependencies
|
|
@@ -170,25 +169,7 @@ function denormalizeLinkValue( value, fieldDef ) {
|
|
|
170
169
|
return result;
|
|
171
170
|
}
|
|
172
171
|
|
|
173
|
-
|
|
174
|
-
* Component that renders a DataForm for a single block's attributes
|
|
175
|
-
* @param {Object} props
|
|
176
|
-
* @param {string} props.clientId The clientId of the block.
|
|
177
|
-
* @param {Object} props.blockType The blockType definition.
|
|
178
|
-
* @param {Object} props.attributes The block's attribute values.
|
|
179
|
-
* @param {Function} props.setAttributes Action to set the block's attributes.
|
|
180
|
-
* @param {boolean} props.isCollapsed Whether the DataForm is rendered as 'collapsed' with only the first field
|
|
181
|
-
* displayed by default. When collapsed a dropdown is displayed to allow
|
|
182
|
-
* displaying additional fields. The block's title is displayed as the title.
|
|
183
|
-
* The collapsed mode is often used when multiple BlockForms are shown together.
|
|
184
|
-
*/
|
|
185
|
-
function BlockFields( {
|
|
186
|
-
clientId,
|
|
187
|
-
blockType,
|
|
188
|
-
attributes,
|
|
189
|
-
setAttributes,
|
|
190
|
-
isCollapsed = false,
|
|
191
|
-
} ) {
|
|
172
|
+
function BlockFields( { clientId, blockType, attributes, setAttributes } ) {
|
|
192
173
|
const blockTitle = useBlockDisplayTitle( {
|
|
193
174
|
clientId,
|
|
194
175
|
context: 'list-view',
|
|
@@ -197,19 +178,9 @@ function BlockFields( {
|
|
|
197
178
|
|
|
198
179
|
const blockTypeFields = blockType?.[ fieldsKey ];
|
|
199
180
|
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
// For a collapsed form only show the first field by default.
|
|
206
|
-
return {
|
|
207
|
-
...blockType?.[ formKey ],
|
|
208
|
-
fields: [ blockType?.[ formKey ]?.fields?.[ 0 ] ],
|
|
209
|
-
};
|
|
210
|
-
}, [ blockType, isCollapsed ] );
|
|
211
|
-
|
|
212
|
-
const [ form, setForm ] = useState( computedForm );
|
|
181
|
+
const [ form, setForm ] = useState( () => {
|
|
182
|
+
return blockType?.[ formKey ];
|
|
183
|
+
} );
|
|
213
184
|
|
|
214
185
|
// Build DataForm fields with proper structure
|
|
215
186
|
const dataFormFields = useMemo( () => {
|
|
@@ -339,29 +310,21 @@ function BlockFields( {
|
|
|
339
310
|
<div className="block-editor-block-fields__container">
|
|
340
311
|
<div className="block-editor-block-fields__header">
|
|
341
312
|
<HStack spacing={ 1 }>
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
/>
|
|
358
|
-
</>
|
|
359
|
-
) }
|
|
360
|
-
{ ! isCollapsed && (
|
|
361
|
-
<h2 className="block-editor-block-fields__header-title">
|
|
362
|
-
{ __( 'Content' ) }
|
|
363
|
-
</h2>
|
|
364
|
-
) }
|
|
313
|
+
<BlockIcon
|
|
314
|
+
className="block-editor-block-fields__header-icon"
|
|
315
|
+
icon={ blockInformation?.icon }
|
|
316
|
+
/>
|
|
317
|
+
<Truncate
|
|
318
|
+
className="block-editor-block-fields__header-title"
|
|
319
|
+
numberOfLines={ 1 }
|
|
320
|
+
>
|
|
321
|
+
{ blockTitle }
|
|
322
|
+
</Truncate>
|
|
323
|
+
<FieldsDropdownMenu
|
|
324
|
+
fields={ dataFormFields }
|
|
325
|
+
visibleFields={ form.fields }
|
|
326
|
+
onToggleField={ handleToggleField }
|
|
327
|
+
/>
|
|
365
328
|
</HStack>
|
|
366
329
|
</div>
|
|
367
330
|
<DataForm
|
|
@@ -407,7 +370,6 @@ const withBlockFields = createHigherOrderComponent(
|
|
|
407
370
|
<BlockFields
|
|
408
371
|
{ ...props }
|
|
409
372
|
blockType={ blockType }
|
|
410
|
-
isCollapsed
|
|
411
373
|
/>
|
|
412
374
|
</PrivateInspectorControlsFill>
|
|
413
375
|
)
|