@wordpress/block-editor 14.21.1-next.719a03cbe.0 → 15.0.1-next.46f643fa0.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 +6 -0
- package/build/components/block-list/use-block-props/index.js +1 -3
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-is-hovered.js +8 -25
- package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build/components/block-list/zoom-out-separator.js +0 -1
- package/build/components/block-list/zoom-out-separator.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-toolbar/index.js +6 -3
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/child-layout-control/index.js +53 -34
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/iframe/index.js +20 -15
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/use-save-image.js +49 -30
- package/build/components/image-editor/use-save-image.js.map +1 -1
- package/build/components/inserter-button/index.native.js +54 -64
- package/build/components/inserter-button/index.native.js.map +1 -1
- package/build/components/link-control/search-input.js +4 -2
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/list-view/block.js +7 -5
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/use-list-view-images.js +62 -30
- package/build/components/list-view/use-list-view-images.js.map +1 -1
- package/build/components/publish-date-time-picker/index.js +2 -1
- package/build/components/publish-date-time-picker/index.js.map +1 -1
- package/build/components/writing-flow/use-click-selection.js +3 -1
- package/build/components/writing-flow/use-click-selection.js.map +1 -1
- package/build/layouts/grid.js +2 -0
- package/build/layouts/grid.js.map +1 -1
- package/build/private-apis.js +2 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +12 -7
- package/build/store/actions.js.map +1 -1
- package/build/store/private-keys.js +2 -1
- package/build/store/private-keys.js.map +1 -1
- package/build/store/reducer.js +0 -18
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +13 -9
- package/build/store/selectors.js.map +1 -1
- package/build/utils/block-bindings.js +2 -1
- package/build/utils/block-bindings.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +1 -3
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-is-hovered.js +8 -26
- package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build-module/components/block-list/zoom-out-separator.js +0 -1
- package/build-module/components/block-list/zoom-out-separator.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-toolbar/index.js +6 -3
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +54 -35
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/iframe/index.js +20 -15
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-editor/use-save-image.js +50 -30
- package/build-module/components/image-editor/use-save-image.js.map +1 -1
- package/build-module/components/inserter-button/index.native.js +55 -65
- package/build-module/components/inserter-button/index.native.js.map +1 -1
- package/build-module/components/link-control/search-input.js +4 -2
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/list-view/block.js +8 -6
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/use-list-view-images.js +62 -30
- package/build-module/components/list-view/use-list-view-images.js.map +1 -1
- package/build-module/components/publish-date-time-picker/index.js +2 -1
- package/build-module/components/publish-date-time-picker/index.js.map +1 -1
- package/build-module/components/writing-flow/use-click-selection.js +3 -1
- package/build-module/components/writing-flow/use-click-selection.js.map +1 -1
- package/build-module/layouts/grid.js +2 -0
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/private-apis.js +3 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +12 -7
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-keys.js +1 -0
- package/build-module/store/private-keys.js.map +1 -1
- package/build-module/store/reducer.js +0 -17
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +12 -9
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/block-bindings.js +2 -1
- package/build-module/utils/block-bindings.js.map +1 -1
- package/build-style/style-rtl.css +50 -26
- package/build-style/style.css +50 -26
- package/package.json +34 -34
- package/src/components/block-list/use-block-props/index.js +1 -1
- package/src/components/block-list/use-block-props/use-is-hovered.js +12 -26
- package/src/components/block-list/zoom-out-separator.js +0 -1
- package/src/components/block-lock/style.scss +10 -0
- package/src/components/block-settings-menu/block-settings-dropdown.js +4 -1
- package/src/components/block-toolbar/index.js +8 -2
- package/src/components/block-variation-transforms/style.scss +7 -0
- package/src/components/border-radius-control/style.scss +5 -0
- package/src/components/child-layout-control/index.js +66 -42
- package/src/components/colors-gradients/style.scss +5 -0
- package/src/components/grid/style.scss +3 -2
- package/src/components/iframe/index.js +25 -16
- package/src/components/image-editor/use-save-image.js +58 -31
- package/src/components/inserter/style.scss +1 -1
- package/src/components/inserter-button/index.native.js +69 -80
- package/src/components/inserter-list-item/style.scss +9 -6
- package/src/components/link-control/search-input.js +9 -2
- package/src/components/link-control/style.scss +7 -0
- package/src/components/link-control/test/index.js +44 -44
- package/src/components/list-view/block.js +10 -5
- package/src/components/list-view/style.scss +2 -20
- package/src/components/list-view/use-list-view-images.js +57 -36
- package/src/components/media-replace-flow/test/index.js +1 -1
- package/src/components/publish-date-time-picker/README.md +9 -0
- package/src/components/publish-date-time-picker/index.js +2 -1
- package/src/components/spacing-sizes-control/style.scss +5 -0
- package/src/components/writing-flow/use-click-selection.js +3 -1
- package/src/hooks/layout.scss +8 -0
- package/src/layouts/grid.js +2 -2
- package/src/private-apis.js +2 -0
- package/src/store/actions.js +15 -7
- package/src/store/private-keys.js +1 -0
- package/src/store/reducer.js +0 -18
- package/src/store/selectors.js +29 -31
- package/src/store/test/actions.js +15 -2
- package/src/utils/block-bindings.js +1 -0
|
@@ -345,6 +345,13 @@ $block-editor-link-control-number-of-actions: 1;
|
|
|
345
345
|
position: relative;
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
+
.block-editor-link-control__settings {
|
|
349
|
+
// Reset `fieldset` browser defaults.
|
|
350
|
+
border: 0;
|
|
351
|
+
padding: 0;
|
|
352
|
+
margin: 0;
|
|
353
|
+
}
|
|
354
|
+
|
|
348
355
|
.block-editor-link-control__setting {
|
|
349
356
|
margin-bottom: 0;
|
|
350
357
|
flex: 1;
|
|
@@ -139,7 +139,7 @@ describe( 'Basic rendering', () => {
|
|
|
139
139
|
|
|
140
140
|
// Search Input UI.
|
|
141
141
|
const searchInput = screen.getByRole( 'combobox', {
|
|
142
|
-
name: '
|
|
142
|
+
name: 'Search or type URL',
|
|
143
143
|
} );
|
|
144
144
|
|
|
145
145
|
expect( searchInput ).toBeVisible();
|
|
@@ -150,7 +150,7 @@ describe( 'Basic rendering', () => {
|
|
|
150
150
|
|
|
151
151
|
// Search Input UI.
|
|
152
152
|
const searchInput = screen.getByRole( 'combobox', {
|
|
153
|
-
name: '
|
|
153
|
+
name: 'Search or type URL',
|
|
154
154
|
} );
|
|
155
155
|
|
|
156
156
|
expect( searchInput ).toBeVisible();
|
|
@@ -175,7 +175,7 @@ describe( 'Basic rendering', () => {
|
|
|
175
175
|
|
|
176
176
|
// Search Input UI.
|
|
177
177
|
const searchInput = screen.getByRole( 'combobox', {
|
|
178
|
-
name: '
|
|
178
|
+
name: 'Search or type URL',
|
|
179
179
|
} );
|
|
180
180
|
|
|
181
181
|
// Simulate searching for a term.
|
|
@@ -290,7 +290,7 @@ describe( 'Basic rendering', () => {
|
|
|
290
290
|
|
|
291
291
|
// Search Input UI.
|
|
292
292
|
const searchInput = screen.getByRole( 'combobox', {
|
|
293
|
-
name: '
|
|
293
|
+
name: 'Search or type URL',
|
|
294
294
|
} );
|
|
295
295
|
|
|
296
296
|
// Simulate searching for a term.
|
|
@@ -304,7 +304,7 @@ describe( 'Basic rendering', () => {
|
|
|
304
304
|
render( <LinkControl value={ { url: 'https://example.com' } } /> );
|
|
305
305
|
|
|
306
306
|
expect(
|
|
307
|
-
screen.queryByRole( 'combobox', { name: '
|
|
307
|
+
screen.queryByRole( 'combobox', { name: 'Search or type URL' } )
|
|
308
308
|
).not.toBeInTheDocument();
|
|
309
309
|
} );
|
|
310
310
|
|
|
@@ -317,7 +317,7 @@ describe( 'Basic rendering', () => {
|
|
|
317
317
|
);
|
|
318
318
|
|
|
319
319
|
expect(
|
|
320
|
-
screen.getByRole( 'combobox', { name: '
|
|
320
|
+
screen.getByRole( 'combobox', { name: 'Search or type URL' } )
|
|
321
321
|
).toBeVisible();
|
|
322
322
|
} );
|
|
323
323
|
|
|
@@ -335,7 +335,7 @@ describe( 'Basic rendering', () => {
|
|
|
335
335
|
await user.click( editButton );
|
|
336
336
|
|
|
337
337
|
expect(
|
|
338
|
-
screen.getByRole( 'combobox', { name: '
|
|
338
|
+
screen.getByRole( 'combobox', { name: 'Search or type URL' } )
|
|
339
339
|
).toBeVisible();
|
|
340
340
|
|
|
341
341
|
// If passed `forceIsEditingLink` of `false` while editing, should
|
|
@@ -348,7 +348,7 @@ describe( 'Basic rendering', () => {
|
|
|
348
348
|
);
|
|
349
349
|
|
|
350
350
|
expect(
|
|
351
|
-
screen.queryByRole( 'combobox', { name: '
|
|
351
|
+
screen.queryByRole( 'combobox', { name: 'Search or type URL' } )
|
|
352
352
|
).not.toBeInTheDocument();
|
|
353
353
|
} );
|
|
354
354
|
|
|
@@ -438,7 +438,7 @@ describe( 'Basic rendering', () => {
|
|
|
438
438
|
|
|
439
439
|
// Should revert back to editing mode.
|
|
440
440
|
expect(
|
|
441
|
-
screen.getByRole( 'combobox', { name: '
|
|
441
|
+
screen.getByRole( 'combobox', { name: 'Search or type URL' } )
|
|
442
442
|
).toBeVisible();
|
|
443
443
|
} );
|
|
444
444
|
} );
|
|
@@ -461,7 +461,7 @@ describe( 'Searching for a link', () => {
|
|
|
461
461
|
|
|
462
462
|
// Search Input UI.
|
|
463
463
|
const searchInput = screen.getByRole( 'combobox', {
|
|
464
|
-
name: '
|
|
464
|
+
name: 'Search or type URL',
|
|
465
465
|
} );
|
|
466
466
|
|
|
467
467
|
// Simulate searching for a term.
|
|
@@ -487,7 +487,7 @@ describe( 'Searching for a link', () => {
|
|
|
487
487
|
|
|
488
488
|
// Search Input UI.
|
|
489
489
|
const searchInput = screen.getByRole( 'combobox', {
|
|
490
|
-
name: '
|
|
490
|
+
name: 'Search or type URL',
|
|
491
491
|
} );
|
|
492
492
|
|
|
493
493
|
// Simulate searching for a term.
|
|
@@ -538,7 +538,7 @@ describe( 'Searching for a link', () => {
|
|
|
538
538
|
|
|
539
539
|
// Search Input UI.
|
|
540
540
|
const searchInput = screen.getByRole( 'combobox', {
|
|
541
|
-
name: '
|
|
541
|
+
name: 'Search or type URL',
|
|
542
542
|
} );
|
|
543
543
|
|
|
544
544
|
// Simulate searching for a term.
|
|
@@ -571,7 +571,7 @@ describe( 'Searching for a link', () => {
|
|
|
571
571
|
|
|
572
572
|
// Search Input UI.
|
|
573
573
|
const searchInput = screen.getByRole( 'combobox', {
|
|
574
|
-
name: '
|
|
574
|
+
name: 'Search or type URL',
|
|
575
575
|
} );
|
|
576
576
|
|
|
577
577
|
// Simulate searching for a term.
|
|
@@ -616,7 +616,7 @@ describe( 'Searching for a link', () => {
|
|
|
616
616
|
|
|
617
617
|
// Search Input UI.
|
|
618
618
|
const searchInput = screen.getByRole( 'combobox', {
|
|
619
|
-
name: '
|
|
619
|
+
name: 'Search or type URL',
|
|
620
620
|
} );
|
|
621
621
|
|
|
622
622
|
// Simulate searching for a term.
|
|
@@ -635,7 +635,7 @@ describe( 'Searching for a link', () => {
|
|
|
635
635
|
|
|
636
636
|
// Search Input UI.
|
|
637
637
|
const searchInput = screen.getByRole( 'combobox', {
|
|
638
|
-
name: '
|
|
638
|
+
name: 'Search or type URL',
|
|
639
639
|
} );
|
|
640
640
|
|
|
641
641
|
// Simulate searching for a term.
|
|
@@ -667,7 +667,7 @@ describe( 'Searching for a link', () => {
|
|
|
667
667
|
|
|
668
668
|
// Search Input UI.
|
|
669
669
|
const searchInput = screen.getByRole( 'combobox', {
|
|
670
|
-
name: '
|
|
670
|
+
name: 'Search or type URL',
|
|
671
671
|
} );
|
|
672
672
|
|
|
673
673
|
// Simulate searching for a term.
|
|
@@ -699,7 +699,7 @@ describe( 'Manual link entry', () => {
|
|
|
699
699
|
|
|
700
700
|
// Search Input UI.
|
|
701
701
|
const searchInput = screen.getByRole( 'combobox', {
|
|
702
|
-
name: '
|
|
702
|
+
name: 'Search or type URL',
|
|
703
703
|
} );
|
|
704
704
|
|
|
705
705
|
// Simulate searching for a term.
|
|
@@ -735,7 +735,7 @@ describe( 'Manual link entry', () => {
|
|
|
735
735
|
|
|
736
736
|
// Search Input UI.
|
|
737
737
|
const searchInput = screen.getByRole( 'combobox', {
|
|
738
|
-
name: '
|
|
738
|
+
name: 'Search or type URL',
|
|
739
739
|
} );
|
|
740
740
|
|
|
741
741
|
if ( searchString.length ) {
|
|
@@ -769,7 +769,7 @@ describe( 'Manual link entry', () => {
|
|
|
769
769
|
|
|
770
770
|
// Search Input UI.
|
|
771
771
|
const searchInput = screen.getByRole( 'combobox', {
|
|
772
|
-
name: '
|
|
772
|
+
name: 'Search or type URL',
|
|
773
773
|
} );
|
|
774
774
|
|
|
775
775
|
// Remove the existing link.
|
|
@@ -937,7 +937,7 @@ describe( 'Manual link entry', () => {
|
|
|
937
937
|
|
|
938
938
|
// Search Input UI.
|
|
939
939
|
const searchInput = screen.getByRole( 'combobox', {
|
|
940
|
-
name: '
|
|
940
|
+
name: 'Search or type URL',
|
|
941
941
|
} );
|
|
942
942
|
|
|
943
943
|
// Simulate searching for a term.
|
|
@@ -973,7 +973,7 @@ describe( 'Link submission', () => {
|
|
|
973
973
|
render( <LinkControlConsumer /> );
|
|
974
974
|
|
|
975
975
|
const searchInput = screen.getByRole( 'combobox', {
|
|
976
|
-
name: '
|
|
976
|
+
name: 'Search or type URL',
|
|
977
977
|
} );
|
|
978
978
|
|
|
979
979
|
const submitButton = screen.getByRole( 'button', {
|
|
@@ -1012,7 +1012,7 @@ describe( 'Link submission', () => {
|
|
|
1012
1012
|
render( <LinkControlConsumer /> );
|
|
1013
1013
|
|
|
1014
1014
|
const searchInput = screen.getByRole( 'combobox', {
|
|
1015
|
-
name: '
|
|
1015
|
+
name: 'Search or type URL',
|
|
1016
1016
|
} );
|
|
1017
1017
|
|
|
1018
1018
|
const createSubmitButton = screen.queryByRole( 'button', {
|
|
@@ -1059,9 +1059,9 @@ describe( 'Default search suggestions', () => {
|
|
|
1059
1059
|
// Verify input has no value has default suggestions should only show
|
|
1060
1060
|
// when this does not have a value.
|
|
1061
1061
|
// Search Input UI.
|
|
1062
|
-
expect(
|
|
1063
|
-
''
|
|
1064
|
-
);
|
|
1062
|
+
expect(
|
|
1063
|
+
screen.getByRole( 'combobox', { name: 'Search or type URL' } )
|
|
1064
|
+
).toHaveValue( '' );
|
|
1065
1065
|
|
|
1066
1066
|
// Ensure only called once as a guard against potential infinite
|
|
1067
1067
|
// re-render loop within `componentDidUpdate` calling `updateSuggestions`
|
|
@@ -1091,7 +1091,7 @@ describe( 'Default search suggestions', () => {
|
|
|
1091
1091
|
await user.click( currentLinkBtn );
|
|
1092
1092
|
|
|
1093
1093
|
const searchInput = screen.getByRole( 'combobox', {
|
|
1094
|
-
name: '
|
|
1094
|
+
name: 'Search or type URL',
|
|
1095
1095
|
} );
|
|
1096
1096
|
|
|
1097
1097
|
// Search input is set to the URL value.
|
|
@@ -1115,7 +1115,7 @@ describe( 'Default search suggestions', () => {
|
|
|
1115
1115
|
|
|
1116
1116
|
// Search Input UI.
|
|
1117
1117
|
const searchInput = screen.getByRole( 'combobox', {
|
|
1118
|
-
name: '
|
|
1118
|
+
name: 'Search or type URL',
|
|
1119
1119
|
} );
|
|
1120
1120
|
|
|
1121
1121
|
// Simulate searching for a term.
|
|
@@ -1155,7 +1155,7 @@ describe( 'Default search suggestions', () => {
|
|
|
1155
1155
|
render( <LinkControl showInitialSuggestions /> );
|
|
1156
1156
|
|
|
1157
1157
|
const searchInput = screen.getByRole( 'combobox', {
|
|
1158
|
-
name: '
|
|
1158
|
+
name: 'Search or type URL',
|
|
1159
1159
|
} );
|
|
1160
1160
|
|
|
1161
1161
|
const searchResultsField = screen.queryByRole( 'listbox', {
|
|
@@ -1215,7 +1215,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
|
|
|
1215
1215
|
|
|
1216
1216
|
// Search Input UI.
|
|
1217
1217
|
const searchInput = screen.getByRole( 'combobox', {
|
|
1218
|
-
name: '
|
|
1218
|
+
name: 'Search or type URL',
|
|
1219
1219
|
} );
|
|
1220
1220
|
|
|
1221
1221
|
// Simulate searching for a term.
|
|
@@ -1285,7 +1285,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
|
|
|
1285
1285
|
|
|
1286
1286
|
// Search Input UI.
|
|
1287
1287
|
const searchInput = screen.getByRole( 'combobox', {
|
|
1288
|
-
name: '
|
|
1288
|
+
name: 'Search or type URL',
|
|
1289
1289
|
} );
|
|
1290
1290
|
|
|
1291
1291
|
// Simulate searching for a term.
|
|
@@ -1338,7 +1338,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
|
|
|
1338
1338
|
|
|
1339
1339
|
// Search Input UI.
|
|
1340
1340
|
const searchInput = screen.getByRole( 'combobox', {
|
|
1341
|
-
name: '
|
|
1341
|
+
name: 'Search or type URL',
|
|
1342
1342
|
} );
|
|
1343
1343
|
|
|
1344
1344
|
// Simulate searching for a term.
|
|
@@ -1385,7 +1385,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
|
|
|
1385
1385
|
|
|
1386
1386
|
// Search Input UI.
|
|
1387
1387
|
const searchInput = screen.getByRole( 'combobox', {
|
|
1388
|
-
name: '
|
|
1388
|
+
name: 'Search or type URL',
|
|
1389
1389
|
} );
|
|
1390
1390
|
|
|
1391
1391
|
// Simulate searching for a term.
|
|
@@ -1410,7 +1410,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
|
|
|
1410
1410
|
|
|
1411
1411
|
// Search Input UI.
|
|
1412
1412
|
const searchInput = screen.getByRole( 'combobox', {
|
|
1413
|
-
name: '
|
|
1413
|
+
name: 'Search or type URL',
|
|
1414
1414
|
} );
|
|
1415
1415
|
|
|
1416
1416
|
const searchResultsField = screen.queryByRole( 'listbox' );
|
|
@@ -1431,7 +1431,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
|
|
|
1431
1431
|
|
|
1432
1432
|
// Search Input UI.
|
|
1433
1433
|
const searchInput = screen.getByRole( 'combobox', {
|
|
1434
|
-
name: '
|
|
1434
|
+
name: 'Search or type URL',
|
|
1435
1435
|
} );
|
|
1436
1436
|
|
|
1437
1437
|
const searchResultsField = screen.queryByRole( 'listbox' );
|
|
@@ -1455,7 +1455,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
|
|
|
1455
1455
|
|
|
1456
1456
|
// Search Input UI.
|
|
1457
1457
|
const searchInput = screen.getByRole( 'combobox', {
|
|
1458
|
-
name: '
|
|
1458
|
+
name: 'Search or type URL',
|
|
1459
1459
|
} );
|
|
1460
1460
|
|
|
1461
1461
|
// Simulate searching for a term.
|
|
@@ -1490,7 +1490,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
|
|
|
1490
1490
|
|
|
1491
1491
|
// Search Input UI.
|
|
1492
1492
|
searchInput = screen.getByRole( 'combobox', {
|
|
1493
|
-
name: '
|
|
1493
|
+
name: 'Search or type URL',
|
|
1494
1494
|
} );
|
|
1495
1495
|
|
|
1496
1496
|
// Simulate searching for a term.
|
|
@@ -1507,7 +1507,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
|
|
|
1507
1507
|
await user.click( createButton );
|
|
1508
1508
|
|
|
1509
1509
|
searchInput = screen.getByRole( 'combobox', {
|
|
1510
|
-
name: '
|
|
1510
|
+
name: 'Search or type URL',
|
|
1511
1511
|
} );
|
|
1512
1512
|
|
|
1513
1513
|
const errorNotice = screen.getAllByText(
|
|
@@ -1586,7 +1586,7 @@ describe( 'Selecting links', () => {
|
|
|
1586
1586
|
await user.click( currentLinkBtn );
|
|
1587
1587
|
|
|
1588
1588
|
const searchInput = screen.getByRole( 'combobox', {
|
|
1589
|
-
name: '
|
|
1589
|
+
name: 'Search or type URL',
|
|
1590
1590
|
} );
|
|
1591
1591
|
currentLinkUI = screen.queryByRole( 'group', {
|
|
1592
1592
|
name: 'Manage link',
|
|
@@ -1630,7 +1630,7 @@ describe( 'Selecting links', () => {
|
|
|
1630
1630
|
|
|
1631
1631
|
// Search Input UI.
|
|
1632
1632
|
const searchInput = screen.getByRole( 'combobox', {
|
|
1633
|
-
name: '
|
|
1633
|
+
name: 'Search or type URL',
|
|
1634
1634
|
} );
|
|
1635
1635
|
|
|
1636
1636
|
// Simulate searching for a term.
|
|
@@ -1692,7 +1692,7 @@ describe( 'Selecting links', () => {
|
|
|
1692
1692
|
|
|
1693
1693
|
// Search Input UI.
|
|
1694
1694
|
const searchInput = screen.getByRole( 'combobox', {
|
|
1695
|
-
name: '
|
|
1695
|
+
name: 'Search or type URL',
|
|
1696
1696
|
} );
|
|
1697
1697
|
|
|
1698
1698
|
// Simulate searching for a term.
|
|
@@ -1783,7 +1783,7 @@ describe( 'Selecting links', () => {
|
|
|
1783
1783
|
|
|
1784
1784
|
// Search Input UI.
|
|
1785
1785
|
const searchInput = screen.getByRole( 'combobox', {
|
|
1786
|
-
name: '
|
|
1786
|
+
name: 'Search or type URL',
|
|
1787
1787
|
} );
|
|
1788
1788
|
|
|
1789
1789
|
// Step down into the search results, highlighting the first result item.
|
|
@@ -1841,7 +1841,7 @@ describe( 'Selecting links', () => {
|
|
|
1841
1841
|
|
|
1842
1842
|
// focus the search input
|
|
1843
1843
|
const searchInput = screen.getByRole( 'combobox', {
|
|
1844
|
-
name: '
|
|
1844
|
+
name: 'Search or type URL',
|
|
1845
1845
|
} );
|
|
1846
1846
|
|
|
1847
1847
|
fireEvent.focus( searchInput );
|
|
@@ -2064,7 +2064,7 @@ describe( 'Post types', () => {
|
|
|
2064
2064
|
|
|
2065
2065
|
// Search Input UI.
|
|
2066
2066
|
const searchInput = screen.getByRole( 'combobox', {
|
|
2067
|
-
name: '
|
|
2067
|
+
name: 'Search or type URL',
|
|
2068
2068
|
} );
|
|
2069
2069
|
|
|
2070
2070
|
// Simulate searching for a term.
|
|
@@ -2093,7 +2093,7 @@ describe( 'Post types', () => {
|
|
|
2093
2093
|
|
|
2094
2094
|
// Search Input UI.
|
|
2095
2095
|
const searchInput = screen.getByRole( 'combobox', {
|
|
2096
|
-
name: '
|
|
2096
|
+
name: 'Search or type URL',
|
|
2097
2097
|
} );
|
|
2098
2098
|
|
|
2099
2099
|
// Simulate searching for a term.
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
__experimentalTreeGridCell as TreeGridCell,
|
|
16
16
|
__experimentalTreeGridItem as TreeGridItem,
|
|
17
17
|
} from '@wordpress/components';
|
|
18
|
-
import { useInstanceId } from '@wordpress/compose';
|
|
18
|
+
import { useInstanceId, useDebounce } from '@wordpress/compose';
|
|
19
19
|
import { moreVertical } from '@wordpress/icons';
|
|
20
20
|
import {
|
|
21
21
|
useCallback,
|
|
@@ -97,6 +97,10 @@ function ListViewBlock( {
|
|
|
97
97
|
insertBeforeBlock,
|
|
98
98
|
setOpenedBlockSettingsMenu,
|
|
99
99
|
} = unlock( useDispatch( blockEditorStore ) );
|
|
100
|
+
const debouncedToggleBlockHighlight = useDebounce(
|
|
101
|
+
toggleBlockHighlight,
|
|
102
|
+
50
|
|
103
|
+
);
|
|
100
104
|
|
|
101
105
|
const {
|
|
102
106
|
canInsertBlockType,
|
|
@@ -363,12 +367,12 @@ function ListViewBlock( {
|
|
|
363
367
|
|
|
364
368
|
const onMouseEnter = useCallback( () => {
|
|
365
369
|
setIsHovered( true );
|
|
366
|
-
|
|
367
|
-
}, [ clientId, setIsHovered,
|
|
370
|
+
debouncedToggleBlockHighlight( clientId, true );
|
|
371
|
+
}, [ clientId, setIsHovered, debouncedToggleBlockHighlight ] );
|
|
368
372
|
const onMouseLeave = useCallback( () => {
|
|
369
373
|
setIsHovered( false );
|
|
370
|
-
|
|
371
|
-
}, [ clientId, setIsHovered,
|
|
374
|
+
debouncedToggleBlockHighlight( clientId, false );
|
|
375
|
+
}, [ clientId, setIsHovered, debouncedToggleBlockHighlight ] );
|
|
372
376
|
|
|
373
377
|
const selectEditorBlock = useCallback(
|
|
374
378
|
( event ) => {
|
|
@@ -637,6 +641,7 @@ function ListViewBlock( {
|
|
|
637
641
|
tabIndex,
|
|
638
642
|
onClick: clearSettingsAnchorRect,
|
|
639
643
|
onFocus,
|
|
644
|
+
size: 'small',
|
|
640
645
|
} }
|
|
641
646
|
disableOpenOnArrowDown
|
|
642
647
|
expand={ expand }
|
|
@@ -78,10 +78,7 @@
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
&:focus::after {
|
|
81
|
-
box-shadow:
|
|
82
|
-
inset 0 0 0 1px $white,
|
|
83
|
-
0 0 0 var(--wp-admin-border-width-focus)
|
|
84
|
-
var(--wp-block-synced-color);
|
|
81
|
+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-block-synced-color);
|
|
85
82
|
}
|
|
86
83
|
}
|
|
87
84
|
&.is-selected .block-editor-list-view-block-contents,
|
|
@@ -308,7 +305,7 @@
|
|
|
308
305
|
.block-editor-list-view-block__menu-cell,
|
|
309
306
|
.block-editor-list-view-block__mover-cell {
|
|
310
307
|
line-height: 0;
|
|
311
|
-
width: $button-size;
|
|
308
|
+
width: $button-size-small + $grid-unit-05;
|
|
312
309
|
vertical-align: middle;
|
|
313
310
|
|
|
314
311
|
> * {
|
|
@@ -323,21 +320,6 @@
|
|
|
323
320
|
opacity: 1;
|
|
324
321
|
}
|
|
325
322
|
}
|
|
326
|
-
|
|
327
|
-
&,
|
|
328
|
-
.components-button.has-icon {
|
|
329
|
-
width: $button-size-small;
|
|
330
|
-
min-width: $button-size-small;
|
|
331
|
-
padding: 0;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
.block-editor-list-view-block__menu-cell {
|
|
336
|
-
padding-right: $grid-unit-05;
|
|
337
|
-
|
|
338
|
-
.components-button.has-icon {
|
|
339
|
-
height: 24px;
|
|
340
|
-
}
|
|
341
323
|
}
|
|
342
324
|
|
|
343
325
|
.block-editor-list-view-block__mover-cell-alignment-wrapper {
|
|
@@ -11,47 +11,70 @@ import { store as blockEditorStore } from '../../store';
|
|
|
11
11
|
|
|
12
12
|
// Maximum number of images to display in a list view row.
|
|
13
13
|
const MAX_IMAGES = 3;
|
|
14
|
+
const IMAGE_GETTERS = {
|
|
15
|
+
'core/image': ( { clientId, attributes } ) => {
|
|
16
|
+
if ( attributes.url ) {
|
|
17
|
+
return {
|
|
18
|
+
url: attributes.url,
|
|
19
|
+
alt: attributes.alt || '',
|
|
20
|
+
clientId,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
'core/cover': ( { clientId, attributes } ) => {
|
|
25
|
+
if ( attributes.backgroundType === 'image' && attributes.url ) {
|
|
26
|
+
return {
|
|
27
|
+
url: attributes.url,
|
|
28
|
+
alt: attributes.alt || '',
|
|
29
|
+
clientId,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
'core/media-text': ( { clientId, attributes } ) => {
|
|
34
|
+
if ( attributes.mediaType === 'image' && attributes.mediaUrl ) {
|
|
35
|
+
return {
|
|
36
|
+
url: attributes.mediaUrl,
|
|
37
|
+
alt: attributes.mediaAlt || '',
|
|
38
|
+
clientId,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
'core/gallery': ( { innerBlocks } ) => {
|
|
43
|
+
const images = [];
|
|
44
|
+
const getValues = !! innerBlocks?.length
|
|
45
|
+
? IMAGE_GETTERS[ innerBlocks[ 0 ].name ]
|
|
46
|
+
: undefined;
|
|
47
|
+
if ( ! getValues ) {
|
|
48
|
+
return images;
|
|
49
|
+
}
|
|
14
50
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
51
|
+
for ( const innerBlock of innerBlocks ) {
|
|
52
|
+
const img = getValues( innerBlock );
|
|
53
|
+
if ( img ) {
|
|
54
|
+
images.push( img );
|
|
55
|
+
}
|
|
56
|
+
if ( images.length >= MAX_IMAGES ) {
|
|
57
|
+
return images;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
19
60
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
61
|
+
return images;
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
function getImagesFromBlock( block, isExpanded ) {
|
|
66
|
+
const getImages = IMAGE_GETTERS[ block.name ];
|
|
67
|
+
const images = !! getImages ? getImages( block ) : undefined;
|
|
28
68
|
|
|
29
|
-
|
|
30
|
-
if ( block.name !== 'core/gallery' || ! block.innerBlocks ) {
|
|
69
|
+
if ( ! images ) {
|
|
31
70
|
return [];
|
|
32
71
|
}
|
|
33
72
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
for ( const innerBlock of block.innerBlocks ) {
|
|
37
|
-
const img = getImage( innerBlock );
|
|
38
|
-
if ( img ) {
|
|
39
|
-
images.push( img );
|
|
40
|
-
}
|
|
41
|
-
if ( images.length >= MAX_IMAGES ) {
|
|
42
|
-
return images;
|
|
43
|
-
}
|
|
73
|
+
if ( ! Array.isArray( images ) ) {
|
|
74
|
+
return [ images ];
|
|
44
75
|
}
|
|
45
76
|
|
|
46
|
-
return images;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function getImagesFromBlock( block, isExpanded ) {
|
|
50
|
-
const img = getImage( block );
|
|
51
|
-
if ( img ) {
|
|
52
|
-
return [ img ];
|
|
53
|
-
}
|
|
54
|
-
return isExpanded ? [] : getImagesFromGallery( block );
|
|
77
|
+
return isExpanded ? [] : images;
|
|
55
78
|
}
|
|
56
79
|
|
|
57
80
|
/**
|
|
@@ -69,12 +92,10 @@ function getImagesFromBlock( block, isExpanded ) {
|
|
|
69
92
|
export default function useListViewImages( { clientId, isExpanded } ) {
|
|
70
93
|
const { block } = useSelect(
|
|
71
94
|
( select ) => {
|
|
72
|
-
|
|
73
|
-
return { block: _block };
|
|
95
|
+
return { block: select( blockEditorStore ).getBlock( clientId ) };
|
|
74
96
|
},
|
|
75
97
|
[ clientId ]
|
|
76
98
|
);
|
|
77
|
-
|
|
78
99
|
const images = useMemo( () => {
|
|
79
100
|
return getImagesFromBlock( block, isExpanded );
|
|
80
101
|
}, [ block, isExpanded ] );
|
|
@@ -32,6 +32,7 @@ const MyDateTimePicker = () => {
|
|
|
32
32
|
currentDate={ date }
|
|
33
33
|
onChange={ ( newDate ) => setDate( newDate ) }
|
|
34
34
|
onClose={ onClose }
|
|
35
|
+
title={ __( 'Select post date' ) }
|
|
35
36
|
/>
|
|
36
37
|
) }
|
|
37
38
|
/>
|
|
@@ -44,6 +45,14 @@ const MyDateTimePicker = () => {
|
|
|
44
45
|
`PublishDateTimePicker` supports all of the props that
|
|
45
46
|
[`DateTimePicker`](/packages/components/src/date-time#Props) supports, plus:
|
|
46
47
|
|
|
48
|
+
### title
|
|
49
|
+
|
|
50
|
+
The title displayed in the header of the popover that contains the `DateTimePicker`.
|
|
51
|
+
|
|
52
|
+
- Type: `String`
|
|
53
|
+
- Required: No
|
|
54
|
+
- Default: `Publish`
|
|
55
|
+
|
|
47
56
|
### onClose
|
|
48
57
|
|
|
49
58
|
Called when the user presses the close button.
|
|
@@ -18,6 +18,7 @@ export function PublishDateTimePicker(
|
|
|
18
18
|
showPopoverHeaderActions,
|
|
19
19
|
isCompact,
|
|
20
20
|
currentDate,
|
|
21
|
+
title,
|
|
21
22
|
...additionalProps
|
|
22
23
|
},
|
|
23
24
|
ref
|
|
@@ -33,7 +34,7 @@ export function PublishDateTimePicker(
|
|
|
33
34
|
return (
|
|
34
35
|
<div ref={ ref } className="block-editor-publish-date-time-picker">
|
|
35
36
|
<InspectorPopoverHeader
|
|
36
|
-
title={ __( 'Publish' ) }
|
|
37
|
+
title={ title || __( 'Publish' ) }
|
|
37
38
|
actions={
|
|
38
39
|
showPopoverHeaderActions
|
|
39
40
|
? [
|
|
@@ -27,7 +27,9 @@ export default function useClickSelection() {
|
|
|
27
27
|
const clickedClientId = getBlockClientId( event.target );
|
|
28
28
|
|
|
29
29
|
if ( event.shiftKey ) {
|
|
30
|
-
|
|
30
|
+
// When selecting a single block in a document by holding the shift key,
|
|
31
|
+
// don't mark this action as multiselection.
|
|
32
|
+
if ( startClientId && startClientId !== clickedClientId ) {
|
|
31
33
|
node.contentEditable = true;
|
|
32
34
|
// Firefox doesn't automatically move focus.
|
|
33
35
|
node.focus();
|
package/src/hooks/layout.scss
CHANGED
|
@@ -17,3 +17,11 @@
|
|
|
17
17
|
margin-bottom: $grid-unit-10;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
.block-editor-hooks__grid-layout-columns-and-rows-controls,
|
|
22
|
+
.block-editor-hooks__grid-layout-minimum-width-control {
|
|
23
|
+
// Reset `fieldset` browser defaults.
|
|
24
|
+
border: 0;
|
|
25
|
+
padding: 0;
|
|
26
|
+
margin: 0;
|
|
27
|
+
}
|
package/src/layouts/grid.js
CHANGED
|
@@ -243,7 +243,7 @@ function GridLayoutMinimumWidthControl( { layout, onChange } ) {
|
|
|
243
243
|
};
|
|
244
244
|
|
|
245
245
|
return (
|
|
246
|
-
<fieldset>
|
|
246
|
+
<fieldset className="block-editor-hooks__grid-layout-minimum-width-control">
|
|
247
247
|
<BaseControl.VisualLabel as="legend">
|
|
248
248
|
{ __( 'Minimum column width' ) }
|
|
249
249
|
</BaseControl.VisualLabel>
|
|
@@ -302,7 +302,7 @@ function GridLayoutColumnsAndRowsControl( {
|
|
|
302
302
|
|
|
303
303
|
return (
|
|
304
304
|
<>
|
|
305
|
-
<fieldset>
|
|
305
|
+
<fieldset className="block-editor-hooks__grid-layout-columns-and-rows-controls">
|
|
306
306
|
{ ( ! window.__experimentalEnableGridInteractivity ||
|
|
307
307
|
! isManualPlacement ) && (
|
|
308
308
|
<BaseControl.VisualLabel as="legend">
|