@wordpress/block-library 8.7.0 → 8.8.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/column/index.js +2 -1
- package/build/column/index.js.map +1 -1
- package/build/columns/edit.js +24 -6
- package/build/columns/edit.js.map +1 -1
- package/build/columns/index.js +2 -1
- package/build/columns/index.js.map +1 -1
- package/build/columns/utils.js +4 -9
- package/build/columns/utils.js.map +1 -1
- package/build/cover/edit/index.js +46 -50
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/{resizable-cover.js → resizable-cover-popover.js} +32 -6
- package/build/cover/edit/resizable-cover-popover.js.map +1 -0
- package/build/cover/index.js +12 -0
- package/build/cover/index.js.map +1 -1
- package/build/details/edit.js +67 -0
- package/build/details/edit.js.map +1 -0
- package/build/details/index.js +110 -0
- package/build/details/index.js.map +1 -0
- package/build/details/save.js +33 -0
- package/build/details/save.js.map +1 -0
- package/build/details-content/edit.js +34 -0
- package/build/details-content/edit.js.map +1 -0
- package/build/details-content/index.js +94 -0
- package/build/details-content/index.js.map +1 -0
- package/build/details-content/save.js +20 -0
- package/build/details-content/save.js.map +1 -0
- package/build/details-summary/edit.js +42 -0
- package/build/details-summary/edit.js.map +1 -0
- package/build/details-summary/index.js +97 -0
- package/build/details-summary/index.js.map +1 -0
- package/build/details-summary/save.js +24 -0
- package/build/details-summary/save.js.map +1 -0
- package/build/embed/deprecated.js +4 -1
- package/build/embed/deprecated.js.map +1 -1
- package/build/embed/embed-link-settings.native.js +1 -1
- package/build/embed/embed-link-settings.native.js.map +1 -1
- package/build/embed/embed-placeholder.js +1 -1
- package/build/embed/embed-placeholder.js.map +1 -1
- package/build/embed/index.js +4 -1
- package/build/embed/index.js.map +1 -1
- package/build/embed/transforms.js +4 -1
- package/build/embed/transforms.js.map +1 -1
- package/build/embed/util.js +4 -1
- package/build/embed/util.js.map +1 -1
- package/build/file/edit.native.js +0 -2
- package/build/file/edit.native.js.map +1 -1
- package/build/gallery/use-get-media.native.js +2 -1
- package/build/gallery/use-get-media.native.js.map +1 -1
- package/build/image/index.js +4 -2
- package/build/image/index.js.map +1 -1
- package/build/index.js +24 -6
- package/build/index.js.map +1 -1
- package/build/media-text/media-container.js +2 -6
- package/build/media-text/media-container.js.map +1 -1
- package/build/media-text/media-container.native.js +3 -3
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/navigation/deprecated.js +8 -11
- package/build/navigation/deprecated.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +1 -14
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/post-author/index.js +0 -1
- package/build/post-author/index.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js +2 -1
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js +8 -22
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-time-to-read/edit.js +1 -1
- package/build/post-time-to-read/edit.js.map +1 -1
- package/build/post-time-to-read/index.js +7 -0
- package/build/post-time-to-read/index.js.map +1 -1
- package/build/spacer/controls.js +25 -6
- package/build/spacer/controls.js.map +1 -1
- package/build/spacer/edit.js +14 -4
- package/build/spacer/edit.js.map +1 -1
- package/build/spacer/save.js +2 -2
- package/build/spacer/save.js.map +1 -1
- package/build/table/state.js +35 -35
- package/build/table/state.js.map +1 -1
- package/build/term-description/index.js +1 -2
- package/build/term-description/index.js.map +1 -1
- package/build/utils/clean-empty-object.js +5 -2
- package/build/utils/clean-empty-object.js.map +1 -1
- package/build-module/column/index.js +2 -1
- package/build-module/column/index.js.map +1 -1
- package/build-module/columns/edit.js +24 -6
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/columns/index.js +2 -1
- package/build-module/columns/index.js.map +1 -1
- package/build-module/columns/utils.js +4 -8
- package/build-module/columns/utils.js.map +1 -1
- package/build-module/cover/edit/index.js +48 -52
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/{resizable-cover.js → resizable-cover-popover.js} +31 -6
- package/build-module/cover/edit/resizable-cover-popover.js.map +1 -0
- package/build-module/cover/index.js +12 -0
- package/build-module/cover/index.js.map +1 -1
- package/build-module/details/edit.js +52 -0
- package/build-module/details/edit.js.map +1 -0
- package/build-module/details/index.js +91 -0
- package/build-module/details/index.js.map +1 -0
- package/build-module/details/save.js +20 -0
- package/build-module/details/save.js.map +1 -0
- package/build-module/details-content/edit.js +23 -0
- package/build-module/details-content/edit.js.map +1 -0
- package/build-module/details-content/index.js +76 -0
- package/build-module/details-content/index.js.map +1 -0
- package/build-module/details-content/save.js +11 -0
- package/build-module/details-content/save.js.map +1 -0
- package/build-module/details-summary/edit.js +30 -0
- package/build-module/details-summary/edit.js.map +1 -0
- package/build-module/details-summary/index.js +79 -0
- package/build-module/details-summary/index.js.map +1 -0
- package/build-module/details-summary/save.js +16 -0
- package/build-module/details-summary/save.js.map +1 -0
- package/build-module/embed/deprecated.js +4 -1
- package/build-module/embed/deprecated.js.map +1 -1
- package/build-module/embed/embed-link-settings.native.js +1 -1
- package/build-module/embed/embed-link-settings.native.js.map +1 -1
- package/build-module/embed/embed-placeholder.js +1 -1
- package/build-module/embed/embed-placeholder.js.map +1 -1
- package/build-module/embed/index.js +4 -1
- package/build-module/embed/index.js.map +1 -1
- package/build-module/embed/transforms.js +4 -1
- package/build-module/embed/transforms.js.map +1 -1
- package/build-module/embed/util.js +4 -1
- package/build-module/embed/util.js.map +1 -1
- package/build-module/file/edit.native.js +0 -2
- package/build-module/file/edit.native.js.map +1 -1
- package/build-module/gallery/use-get-media.native.js +2 -1
- package/build-module/gallery/use-get-media.native.js.map +1 -1
- package/build-module/image/index.js +4 -2
- package/build-module/image/index.js.map +1 -1
- package/build-module/index.js +21 -6
- package/build-module/index.js.map +1 -1
- package/build-module/media-text/media-container.js +1 -5
- package/build-module/media-text/media-container.js.map +1 -1
- package/build-module/media-text/media-container.native.js +1 -1
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/navigation/deprecated.js +8 -10
- package/build-module/navigation/deprecated.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +1 -14
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/post-author/index.js +0 -1
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js +2 -1
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js +8 -22
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-time-to-read/edit.js +1 -1
- package/build-module/post-time-to-read/edit.js.map +1 -1
- package/build-module/post-time-to-read/index.js +7 -0
- package/build-module/post-time-to-read/index.js.map +1 -1
- package/build-module/spacer/controls.js +27 -9
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/spacer/edit.js +14 -5
- package/build-module/spacer/edit.js.map +1 -1
- package/build-module/spacer/save.js +3 -3
- package/build-module/spacer/save.js.map +1 -1
- package/build-module/table/state.js +35 -33
- package/build-module/table/state.js.map +1 -1
- package/build-module/term-description/index.js +1 -2
- package/build-module/term-description/index.js.map +1 -1
- package/build-module/utils/clean-empty-object.js +6 -3
- package/build-module/utils/clean-empty-object.js.map +1 -1
- package/build-style/columns/style-rtl.css +4 -1
- package/build-style/columns/style.css +4 -1
- package/build-style/common-rtl.css +1 -1
- package/build-style/common.css +1 -1
- package/build-style/cover/editor-rtl.css +11 -12
- package/build-style/cover/editor.css +11 -12
- package/build-style/cover/style-rtl.css +3 -2
- package/build-style/cover/style.css +3 -2
- package/build-style/details/style-rtl.css +91 -0
- package/build-style/details/style.css +91 -0
- package/build-style/details-summary/editor-rtl.css +91 -0
- package/build-style/details-summary/editor.css +91 -0
- package/build-style/details-summary/style-rtl.css +91 -0
- package/build-style/details-summary/style.css +91 -0
- package/build-style/editor-rtl.css +34 -48
- package/build-style/editor.css +34 -48
- package/build-style/file/style-rtl.css +4 -3
- package/build-style/file/style.css +4 -3
- package/build-style/post-excerpt/style-rtl.css +1 -1
- package/build-style/post-excerpt/style.css +1 -1
- package/build-style/pullquote/style-rtl.css +4 -1
- package/build-style/pullquote/style.css +4 -1
- package/build-style/shortcode/editor-rtl.css +15 -34
- package/build-style/shortcode/editor.css +15 -34
- package/build-style/spacer/editor-rtl.css +4 -2
- package/build-style/spacer/editor.css +4 -2
- package/build-style/style-rtl.css +25 -9
- package/build-style/style.css +25 -9
- package/package.json +31 -31
- package/src/column/block.json +2 -1
- package/src/columns/block.json +2 -1
- package/src/columns/edit.js +33 -9
- package/src/columns/style.scss +5 -1
- package/src/columns/utils.js +8 -9
- package/src/common.scss +1 -1
- package/src/cover/block.json +12 -0
- package/src/cover/edit/index.js +44 -37
- package/src/cover/edit/resizable-cover-popover.js +82 -0
- package/src/cover/editor.scss +20 -13
- package/src/cover/index.php +9 -10
- package/src/cover/style.scss +2 -1
- package/src/cover/test/edit.js +1 -1
- package/src/details/block.json +54 -0
- package/src/details/edit.js +59 -0
- package/src/details/index.js +35 -0
- package/src/details/save.js +15 -0
- package/src/details/style.scss +3 -0
- package/src/details-content/block.json +50 -0
- package/src/details-content/edit.js +29 -0
- package/src/details-content/index.js +23 -0
- package/src/details-content/save.js +12 -0
- package/src/details-summary/block.json +53 -0
- package/src/details-summary/edit.js +27 -0
- package/src/details-summary/editor.scss +3 -0
- package/src/details-summary/index.js +23 -0
- package/src/details-summary/save.js +13 -0
- package/src/details-summary/style.scss +3 -0
- package/src/editor.scss +1 -0
- package/src/embed/block.json +4 -1
- package/src/embed/embed-link-settings.native.js +1 -1
- package/src/embed/embed-placeholder.js +1 -1
- package/src/file/edit.native.js +0 -2
- package/src/file/style.scss +5 -2
- package/src/gallery/test/use-get-media.native.js +24 -0
- package/src/gallery/use-get-media.native.js +1 -1
- package/src/image/block.json +4 -2
- package/src/index.js +13 -3
- package/src/media-text/media-container.js +1 -5
- package/src/media-text/media-container.native.js +1 -1
- package/src/navigation/deprecated.js +15 -19
- package/src/navigation/edit/unsaved-inner-blocks.js +34 -46
- package/src/navigation/index.php +0 -4
- package/src/paragraph/test/edit.native.js +356 -1
- package/src/post-author/block.json +0 -1
- package/src/post-excerpt/index.php +3 -3
- package/src/post-excerpt/style.scss +2 -1
- package/src/post-featured-image/dimension-controls.js +5 -1
- package/src/post-featured-image/edit.js +8 -29
- package/src/post-time-to-read/block.json +7 -0
- package/src/post-time-to-read/edit.js +1 -1
- package/src/post-time-to-read/index.php +3 -3
- package/src/preformatted/test/__snapshots__/edit.native.js.snap +2 -2
- package/src/preformatted/test/edit.native.js +45 -2
- package/src/pullquote/style.scss +5 -1
- package/src/pullquote/test/edit.native.js +70 -0
- package/src/quote/test/edit.native.js +92 -0
- package/src/search/index.php +1 -1
- package/src/shortcode/editor.scss +26 -5
- package/src/spacer/controls.js +42 -17
- package/src/spacer/edit.js +23 -4
- package/src/spacer/editor.scss +2 -1
- package/src/spacer/save.js +3 -3
- package/src/style.scss +2 -0
- package/src/table/state.js +83 -66
- package/src/term-description/block.json +1 -2
- package/src/utils/clean-empty-object.js +4 -4
- package/src/verse/test/edit.native.js +33 -0
- package/build/cover/edit/resizable-cover.js.map +0 -1
- package/build/media-text/media-container-icon.js +0 -27
- package/build/media-text/media-container-icon.js.map +0 -1
- package/build-module/cover/edit/resizable-cover.js.map +0 -1
- package/build-module/media-text/media-container-icon.js +0 -17
- package/build-module/media-text/media-container-icon.js.map +0 -1
- package/src/cover/edit/resizable-cover.js +0 -61
- package/src/media-text/media-container-icon.js +0 -12
package/src/table/state.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { mapValues } from 'lodash';
|
|
5
|
-
|
|
6
1
|
const INHERITED_COLUMN_ATTRIBUTES = [ 'align' ];
|
|
7
2
|
|
|
8
3
|
/**
|
|
@@ -82,33 +77,45 @@ export function updateSelectedCell( state, selection, updateCell ) {
|
|
|
82
77
|
const { sectionName: selectionSectionName, rowIndex: selectionRowIndex } =
|
|
83
78
|
selection;
|
|
84
79
|
|
|
85
|
-
return
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return row;
|
|
80
|
+
return Object.fromEntries(
|
|
81
|
+
Object.entries( tableSections ).map( ( [ sectionName, section ] ) => {
|
|
82
|
+
if (
|
|
83
|
+
selectionSectionName &&
|
|
84
|
+
selectionSectionName !== sectionName
|
|
85
|
+
) {
|
|
86
|
+
return [ sectionName, section ];
|
|
93
87
|
}
|
|
94
88
|
|
|
95
|
-
return
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
rowIndex,
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
if ( ! isCellSelected( cellLocation, selection ) ) {
|
|
104
|
-
return cellAttributes;
|
|
89
|
+
return [
|
|
90
|
+
sectionName,
|
|
91
|
+
section.map( ( row, rowIndex ) => {
|
|
92
|
+
if ( selectionRowIndex && selectionRowIndex !== rowIndex ) {
|
|
93
|
+
return row;
|
|
105
94
|
}
|
|
106
95
|
|
|
107
|
-
return
|
|
96
|
+
return {
|
|
97
|
+
cells: row.cells.map(
|
|
98
|
+
( cellAttributes, columnIndex ) => {
|
|
99
|
+
const cellLocation = {
|
|
100
|
+
sectionName,
|
|
101
|
+
columnIndex,
|
|
102
|
+
rowIndex,
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
if (
|
|
106
|
+
! isCellSelected( cellLocation, selection )
|
|
107
|
+
) {
|
|
108
|
+
return cellAttributes;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return updateCell( cellAttributes );
|
|
112
|
+
}
|
|
113
|
+
),
|
|
114
|
+
};
|
|
108
115
|
} ),
|
|
109
|
-
|
|
110
|
-
} )
|
|
111
|
-
|
|
116
|
+
];
|
|
117
|
+
} )
|
|
118
|
+
);
|
|
112
119
|
}
|
|
113
120
|
|
|
114
121
|
/**
|
|
@@ -224,31 +231,36 @@ export function insertColumn( state, { columnIndex } ) {
|
|
|
224
231
|
)
|
|
225
232
|
);
|
|
226
233
|
|
|
227
|
-
return
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
return section.map( ( row ) => {
|
|
234
|
-
// Bail early if the row is empty or it's an attempt to insert past
|
|
235
|
-
// the last possible index of the array.
|
|
236
|
-
if ( isEmptyRow( row ) || row.cells.length < columnIndex ) {
|
|
237
|
-
return row;
|
|
234
|
+
return Object.fromEntries(
|
|
235
|
+
Object.entries( tableSections ).map( ( [ sectionName, section ] ) => {
|
|
236
|
+
// Bail early if the table section is empty.
|
|
237
|
+
if ( isEmptyTableSection( section ) ) {
|
|
238
|
+
return [ sectionName, section ];
|
|
238
239
|
}
|
|
239
240
|
|
|
240
|
-
return
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
241
|
+
return [
|
|
242
|
+
sectionName,
|
|
243
|
+
section.map( ( row ) => {
|
|
244
|
+
// Bail early if the row is empty or it's an attempt to insert past
|
|
245
|
+
// the last possible index of the array.
|
|
246
|
+
if ( isEmptyRow( row ) || row.cells.length < columnIndex ) {
|
|
247
|
+
return row;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return {
|
|
251
|
+
cells: [
|
|
252
|
+
...row.cells.slice( 0, columnIndex ),
|
|
253
|
+
{
|
|
254
|
+
content: '',
|
|
255
|
+
tag: sectionName === 'head' ? 'th' : 'td',
|
|
256
|
+
},
|
|
257
|
+
...row.cells.slice( columnIndex ),
|
|
258
|
+
],
|
|
259
|
+
};
|
|
260
|
+
} ),
|
|
261
|
+
];
|
|
262
|
+
} )
|
|
263
|
+
);
|
|
252
264
|
}
|
|
253
265
|
|
|
254
266
|
/**
|
|
@@ -267,23 +279,28 @@ export function deleteColumn( state, { columnIndex } ) {
|
|
|
267
279
|
)
|
|
268
280
|
);
|
|
269
281
|
|
|
270
|
-
return
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
282
|
+
return Object.fromEntries(
|
|
283
|
+
Object.entries( tableSections ).map( ( [ sectionName, section ] ) => {
|
|
284
|
+
// Bail early if the table section is empty.
|
|
285
|
+
if ( isEmptyTableSection( section ) ) {
|
|
286
|
+
return [ sectionName, section ];
|
|
287
|
+
}
|
|
275
288
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
289
|
+
return [
|
|
290
|
+
sectionName,
|
|
291
|
+
section
|
|
292
|
+
.map( ( row ) => ( {
|
|
293
|
+
cells:
|
|
294
|
+
row.cells.length >= columnIndex
|
|
295
|
+
? row.cells.filter(
|
|
296
|
+
( cell, index ) => index !== columnIndex
|
|
297
|
+
)
|
|
298
|
+
: row.cells,
|
|
299
|
+
} ) )
|
|
300
|
+
.filter( ( row ) => row.cells.length ),
|
|
301
|
+
];
|
|
302
|
+
} )
|
|
303
|
+
);
|
|
287
304
|
}
|
|
288
305
|
|
|
289
306
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { isEmpty
|
|
4
|
+
import { isEmpty } from 'lodash';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Removed empty nodes from nested objects.
|
|
@@ -18,9 +18,9 @@ const cleanEmptyObject = ( object ) => {
|
|
|
18
18
|
return object;
|
|
19
19
|
}
|
|
20
20
|
const cleanedNestedObjects = Object.fromEntries(
|
|
21
|
-
Object.entries(
|
|
22
|
-
( [ , value ] ) =>
|
|
23
|
-
|
|
21
|
+
Object.entries( object )
|
|
22
|
+
.map( ( [ key, value ] ) => [ key, cleanEmptyObject( value ) ] )
|
|
23
|
+
.filter( ( [ , value ] ) => Boolean( value ) )
|
|
24
24
|
);
|
|
25
25
|
return isEmpty( cleanedNestedObjects ) ? undefined : cleanedNestedObjects;
|
|
26
26
|
};
|
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
getEditorHtml,
|
|
7
7
|
initializeEditor,
|
|
8
8
|
getBlock,
|
|
9
|
+
changeAndSelectTextOfRichText,
|
|
10
|
+
fireEvent,
|
|
9
11
|
} from 'test/helpers';
|
|
10
12
|
|
|
11
13
|
/**
|
|
@@ -13,6 +15,7 @@ import {
|
|
|
13
15
|
*/
|
|
14
16
|
import { getBlockTypes, unregisterBlockType } from '@wordpress/blocks';
|
|
15
17
|
import { registerCoreBlocks } from '@wordpress/block-library';
|
|
18
|
+
import { ENTER } from '@wordpress/keycodes';
|
|
16
19
|
|
|
17
20
|
beforeAll( () => {
|
|
18
21
|
// Register all core blocks
|
|
@@ -51,4 +54,34 @@ describe( 'Verse block', () => {
|
|
|
51
54
|
expect( verseBlock ).toBeVisible();
|
|
52
55
|
expect( getEditorHtml() ).toMatchSnapshot();
|
|
53
56
|
} );
|
|
57
|
+
|
|
58
|
+
it( 'should produce expected markup for multiline text', async () => {
|
|
59
|
+
// Arrange
|
|
60
|
+
const screen = await initializeEditor();
|
|
61
|
+
await addBlock( screen, 'Verse' );
|
|
62
|
+
|
|
63
|
+
// Act
|
|
64
|
+
const verseTextInput = await screen.findByPlaceholderText(
|
|
65
|
+
'Write verse…'
|
|
66
|
+
);
|
|
67
|
+
const string = 'A great statement.';
|
|
68
|
+
changeAndSelectTextOfRichText( verseTextInput, string, {
|
|
69
|
+
selectionStart: string.length,
|
|
70
|
+
selectionEnd: string.length,
|
|
71
|
+
} );
|
|
72
|
+
fireEvent( verseTextInput, 'onKeyDown', {
|
|
73
|
+
nativeEvent: {},
|
|
74
|
+
preventDefault() {},
|
|
75
|
+
keyCode: ENTER,
|
|
76
|
+
} );
|
|
77
|
+
|
|
78
|
+
// TODO: Determine a way to type after pressing ENTER within the block.
|
|
79
|
+
|
|
80
|
+
// Assert
|
|
81
|
+
expect( getEditorHtml() ).toMatchInlineSnapshot( `
|
|
82
|
+
"<!-- wp:verse -->
|
|
83
|
+
<pre class="wp-block-verse">A great statement.<br></pre>
|
|
84
|
+
<!-- /wp:verse -->"
|
|
85
|
+
` );
|
|
86
|
+
} );
|
|
54
87
|
} );
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/cover/edit/resizable-cover.js"],"names":["RESIZABLE_BOX_ENABLE_OPTION","top","right","bottom","left","topRight","bottomRight","bottomLeft","topLeft","ResizableCover","className","onResizeStart","onResize","onResizeStop","props","isResizing","setIsResizing","_event","_direction","elt","clientHeight","axis","position","isVisible"],"mappings":";;;;;;;;;AAQA;;;;AALA;;AAMA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,MAAMA,2BAA2B,GAAG;AACnCC,EAAAA,GAAG,EAAE,KAD8B;AAEnCC,EAAAA,KAAK,EAAE,KAF4B;AAGnCC,EAAAA,MAAM,EAAE,IAH2B;AAInCC,EAAAA,IAAI,EAAE,KAJ6B;AAKnCC,EAAAA,QAAQ,EAAE,KALyB;AAMnCC,EAAAA,WAAW,EAAE,KANsB;AAOnCC,EAAAA,UAAU,EAAE,KAPuB;AAQnCC,EAAAA,OAAO,EAAE;AAR0B,CAApC;;AAWe,SAASC,cAAT,OAMX;AAAA,MANoC;AACvCC,IAAAA,SADuC;AAEvCC,IAAAA,aAFuC;AAGvCC,IAAAA,QAHuC;AAIvCC,IAAAA,YAJuC;AAKvC,OAAGC;AALoC,GAMpC;AACH,QAAM,CAAEC,UAAF,EAAcC,aAAd,IAAgC,uBAAU,KAAV,CAAtC;AAEA,SACC,4BAAC,wBAAD;AACC,IAAA,SAAS,EAAG,yBAAYN,SAAZ,EAAuB;AAClC,qBAAeK;AADmB,KAAvB,CADb;AAIC,IAAA,MAAM,EAAGf,2BAJV;AAKC,IAAA,aAAa,EAAG,CAAEiB,MAAF,EAAUC,UAAV,EAAsBC,GAAtB,KAA+B;AAC9CR,MAAAA,aAAa,CAAEQ,GAAG,CAACC,YAAN,CAAb;AACAR,MAAAA,QAAQ,CAAEO,GAAG,CAACC,YAAN,CAAR;AACA,KARF;AASC,IAAA,QAAQ,EAAG,CAAEH,MAAF,EAAUC,UAAV,EAAsBC,GAAtB,KAA+B;AACzCP,MAAAA,QAAQ,CAAEO,GAAG,CAACC,YAAN,CAAR;;AACA,UAAK,CAAEL,UAAP,EAAoB;AACnBC,QAAAA,aAAa,CAAE,IAAF,CAAb;AACA;AACD,KAdF;AAeC,IAAA,YAAY,EAAG,CAAEC,MAAF,EAAUC,UAAV,EAAsBC,GAAtB,KAA+B;AAC7CN,MAAAA,YAAY,CAAEM,GAAG,CAACC,YAAN,CAAZ;AACAJ,MAAAA,aAAa,CAAE,KAAF,CAAb;AACA,KAlBF;AAmBC,IAAA,yBAAyB,MAnB1B;AAoBC,IAAA,0BAA0B,EAAG;AAC5BK,MAAAA,IAAI,EAAE,GADsB;AAE5BC,MAAAA,QAAQ,EAAE,QAFkB;AAG5BC,MAAAA,SAAS,EAAER;AAHiB;AApB9B,KAyBMD,KAzBN,EADD;AA6BA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { ResizableBox } from '@wordpress/components';\n\nconst RESIZABLE_BOX_ENABLE_OPTION = {\n\ttop: false,\n\tright: false,\n\tbottom: true,\n\tleft: false,\n\ttopRight: false,\n\tbottomRight: false,\n\tbottomLeft: false,\n\ttopLeft: false,\n};\n\nexport default function ResizableCover( {\n\tclassName,\n\tonResizeStart,\n\tonResize,\n\tonResizeStop,\n\t...props\n} ) {\n\tconst [ isResizing, setIsResizing ] = useState( false );\n\n\treturn (\n\t\t<ResizableBox\n\t\t\tclassName={ classnames( className, {\n\t\t\t\t'is-resizing': isResizing,\n\t\t\t} ) }\n\t\t\tenable={ RESIZABLE_BOX_ENABLE_OPTION }\n\t\t\tonResizeStart={ ( _event, _direction, elt ) => {\n\t\t\t\tonResizeStart( elt.clientHeight );\n\t\t\t\tonResize( elt.clientHeight );\n\t\t\t} }\n\t\t\tonResize={ ( _event, _direction, elt ) => {\n\t\t\t\tonResize( elt.clientHeight );\n\t\t\t\tif ( ! isResizing ) {\n\t\t\t\t\tsetIsResizing( true );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tonResizeStop={ ( _event, _direction, elt ) => {\n\t\t\t\tonResizeStop( elt.clientHeight );\n\t\t\t\tsetIsResizing( false );\n\t\t\t} }\n\t\t\t__experimentalShowTooltip\n\t\t\t__experimentalTooltipProps={ {\n\t\t\t\taxis: 'y',\n\t\t\t\tposition: 'bottom',\n\t\t\t\tisVisible: isResizing,\n\t\t\t} }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _element = require("@wordpress/element");
|
|
9
|
-
|
|
10
|
-
var _components = require("@wordpress/components");
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* WordPress dependencies
|
|
14
|
-
*/
|
|
15
|
-
var _default = (0, _element.createElement)(_components.SVG, {
|
|
16
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
-
viewBox: "0 0 24 24"
|
|
18
|
-
}, (0, _element.createElement)(_components.Path, {
|
|
19
|
-
d: "M18 2l2 4h-2l-2-4h-3l2 4h-2l-2-4h-1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V2zm2 12H10V4.4L11.8 8H20z"
|
|
20
|
-
}), (0, _element.createElement)(_components.Path, {
|
|
21
|
-
d: "M14 20H4V10h3V8H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3h-2z"
|
|
22
|
-
}), (0, _element.createElement)(_components.Path, {
|
|
23
|
-
d: "M5 19h8l-1.59-2H9.24l-.84 1.1L7 16.3 5 19z"
|
|
24
|
-
}));
|
|
25
|
-
|
|
26
|
-
exports.default = _default;
|
|
27
|
-
//# sourceMappingURL=media-container-icon.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/media-text/media-container-icon.js"],"names":[],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;eAIC,4BAAC,eAAD;AAAK,EAAA,KAAK,EAAC,4BAAX;AAAwC,EAAA,OAAO,EAAC;AAAhD,GACC,4BAAC,gBAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EADD,EAEC,4BAAC,gBAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EAFD,EAGC,4BAAC,gBAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EAHD,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/components';\n\nexport default (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M18 2l2 4h-2l-2-4h-3l2 4h-2l-2-4h-1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V2zm2 12H10V4.4L11.8 8H20z\" />\n\t\t<Path d=\"M14 20H4V10h3V8H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3h-2z\" />\n\t\t<Path d=\"M5 19h8l-1.59-2H9.24l-.84 1.1L7 16.3 5 19z\" />\n\t</SVG>\n);\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/cover/edit/resizable-cover.js"],"names":["classnames","useState","ResizableBox","RESIZABLE_BOX_ENABLE_OPTION","top","right","bottom","left","topRight","bottomRight","bottomLeft","topLeft","ResizableCover","className","onResizeStart","onResize","onResizeStop","props","isResizing","setIsResizing","_event","_direction","elt","clientHeight","axis","position","isVisible"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,YAAT,QAA6B,uBAA7B;AAEA,MAAMC,2BAA2B,GAAG;AACnCC,EAAAA,GAAG,EAAE,KAD8B;AAEnCC,EAAAA,KAAK,EAAE,KAF4B;AAGnCC,EAAAA,MAAM,EAAE,IAH2B;AAInCC,EAAAA,IAAI,EAAE,KAJ6B;AAKnCC,EAAAA,QAAQ,EAAE,KALyB;AAMnCC,EAAAA,WAAW,EAAE,KANsB;AAOnCC,EAAAA,UAAU,EAAE,KAPuB;AAQnCC,EAAAA,OAAO,EAAE;AAR0B,CAApC;AAWA,eAAe,SAASC,cAAT,OAMX;AAAA,MANoC;AACvCC,IAAAA,SADuC;AAEvCC,IAAAA,aAFuC;AAGvCC,IAAAA,QAHuC;AAIvCC,IAAAA,YAJuC;AAKvC,OAAGC;AALoC,GAMpC;AACH,QAAM,CAAEC,UAAF,EAAcC,aAAd,IAAgClB,QAAQ,CAAE,KAAF,CAA9C;AAEA,SACC,cAAC,YAAD;AACC,IAAA,SAAS,EAAGD,UAAU,CAAEa,SAAF,EAAa;AAClC,qBAAeK;AADmB,KAAb,CADvB;AAIC,IAAA,MAAM,EAAGf,2BAJV;AAKC,IAAA,aAAa,EAAG,CAAEiB,MAAF,EAAUC,UAAV,EAAsBC,GAAtB,KAA+B;AAC9CR,MAAAA,aAAa,CAAEQ,GAAG,CAACC,YAAN,CAAb;AACAR,MAAAA,QAAQ,CAAEO,GAAG,CAACC,YAAN,CAAR;AACA,KARF;AASC,IAAA,QAAQ,EAAG,CAAEH,MAAF,EAAUC,UAAV,EAAsBC,GAAtB,KAA+B;AACzCP,MAAAA,QAAQ,CAAEO,GAAG,CAACC,YAAN,CAAR;;AACA,UAAK,CAAEL,UAAP,EAAoB;AACnBC,QAAAA,aAAa,CAAE,IAAF,CAAb;AACA;AACD,KAdF;AAeC,IAAA,YAAY,EAAG,CAAEC,MAAF,EAAUC,UAAV,EAAsBC,GAAtB,KAA+B;AAC7CN,MAAAA,YAAY,CAAEM,GAAG,CAACC,YAAN,CAAZ;AACAJ,MAAAA,aAAa,CAAE,KAAF,CAAb;AACA,KAlBF;AAmBC,IAAA,yBAAyB,MAnB1B;AAoBC,IAAA,0BAA0B,EAAG;AAC5BK,MAAAA,IAAI,EAAE,GADsB;AAE5BC,MAAAA,QAAQ,EAAE,QAFkB;AAG5BC,MAAAA,SAAS,EAAER;AAHiB;AApB9B,KAyBMD,KAzBN,EADD;AA6BA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { ResizableBox } from '@wordpress/components';\n\nconst RESIZABLE_BOX_ENABLE_OPTION = {\n\ttop: false,\n\tright: false,\n\tbottom: true,\n\tleft: false,\n\ttopRight: false,\n\tbottomRight: false,\n\tbottomLeft: false,\n\ttopLeft: false,\n};\n\nexport default function ResizableCover( {\n\tclassName,\n\tonResizeStart,\n\tonResize,\n\tonResizeStop,\n\t...props\n} ) {\n\tconst [ isResizing, setIsResizing ] = useState( false );\n\n\treturn (\n\t\t<ResizableBox\n\t\t\tclassName={ classnames( className, {\n\t\t\t\t'is-resizing': isResizing,\n\t\t\t} ) }\n\t\t\tenable={ RESIZABLE_BOX_ENABLE_OPTION }\n\t\t\tonResizeStart={ ( _event, _direction, elt ) => {\n\t\t\t\tonResizeStart( elt.clientHeight );\n\t\t\t\tonResize( elt.clientHeight );\n\t\t\t} }\n\t\t\tonResize={ ( _event, _direction, elt ) => {\n\t\t\t\tonResize( elt.clientHeight );\n\t\t\t\tif ( ! isResizing ) {\n\t\t\t\t\tsetIsResizing( true );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tonResizeStop={ ( _event, _direction, elt ) => {\n\t\t\t\tonResizeStop( elt.clientHeight );\n\t\t\t\tsetIsResizing( false );\n\t\t\t} }\n\t\t\t__experimentalShowTooltip\n\t\t\t__experimentalTooltipProps={ {\n\t\t\t\taxis: 'y',\n\t\t\t\tposition: 'bottom',\n\t\t\t\tisVisible: isResizing,\n\t\t\t} }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* WordPress dependencies
|
|
5
|
-
*/
|
|
6
|
-
import { Path, SVG } from '@wordpress/components';
|
|
7
|
-
export default createElement(SVG, {
|
|
8
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
-
viewBox: "0 0 24 24"
|
|
10
|
-
}, createElement(Path, {
|
|
11
|
-
d: "M18 2l2 4h-2l-2-4h-3l2 4h-2l-2-4h-1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V2zm2 12H10V4.4L11.8 8H20z"
|
|
12
|
-
}), createElement(Path, {
|
|
13
|
-
d: "M14 20H4V10h3V8H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3h-2z"
|
|
14
|
-
}), createElement(Path, {
|
|
15
|
-
d: "M5 19h8l-1.59-2H9.24l-.84 1.1L7 16.3 5 19z"
|
|
16
|
-
}));
|
|
17
|
-
//# sourceMappingURL=media-container-icon.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/media-text/media-container-icon.js"],"names":["Path","SVG"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,EAAeC,GAAf,QAA0B,uBAA1B;AAEA,eACC,cAAC,GAAD;AAAK,EAAA,KAAK,EAAC,4BAAX;AAAwC,EAAA,OAAO,EAAC;AAAhD,GACC,cAAC,IAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EADD,EAEC,cAAC,IAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EAFD,EAGC,cAAC,IAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EAHD,CADD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/components';\n\nexport default (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M18 2l2 4h-2l-2-4h-3l2 4h-2l-2-4h-1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V2zm2 12H10V4.4L11.8 8H20z\" />\n\t\t<Path d=\"M14 20H4V10h3V8H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3h-2z\" />\n\t\t<Path d=\"M5 19h8l-1.59-2H9.24l-.84 1.1L7 16.3 5 19z\" />\n\t</SVG>\n);\n"]}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import classnames from 'classnames';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { useState } from '@wordpress/element';
|
|
10
|
-
import { ResizableBox } from '@wordpress/components';
|
|
11
|
-
|
|
12
|
-
const RESIZABLE_BOX_ENABLE_OPTION = {
|
|
13
|
-
top: false,
|
|
14
|
-
right: false,
|
|
15
|
-
bottom: true,
|
|
16
|
-
left: false,
|
|
17
|
-
topRight: false,
|
|
18
|
-
bottomRight: false,
|
|
19
|
-
bottomLeft: false,
|
|
20
|
-
topLeft: false,
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export default function ResizableCover( {
|
|
24
|
-
className,
|
|
25
|
-
onResizeStart,
|
|
26
|
-
onResize,
|
|
27
|
-
onResizeStop,
|
|
28
|
-
...props
|
|
29
|
-
} ) {
|
|
30
|
-
const [ isResizing, setIsResizing ] = useState( false );
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<ResizableBox
|
|
34
|
-
className={ classnames( className, {
|
|
35
|
-
'is-resizing': isResizing,
|
|
36
|
-
} ) }
|
|
37
|
-
enable={ RESIZABLE_BOX_ENABLE_OPTION }
|
|
38
|
-
onResizeStart={ ( _event, _direction, elt ) => {
|
|
39
|
-
onResizeStart( elt.clientHeight );
|
|
40
|
-
onResize( elt.clientHeight );
|
|
41
|
-
} }
|
|
42
|
-
onResize={ ( _event, _direction, elt ) => {
|
|
43
|
-
onResize( elt.clientHeight );
|
|
44
|
-
if ( ! isResizing ) {
|
|
45
|
-
setIsResizing( true );
|
|
46
|
-
}
|
|
47
|
-
} }
|
|
48
|
-
onResizeStop={ ( _event, _direction, elt ) => {
|
|
49
|
-
onResizeStop( elt.clientHeight );
|
|
50
|
-
setIsResizing( false );
|
|
51
|
-
} }
|
|
52
|
-
__experimentalShowTooltip
|
|
53
|
-
__experimentalTooltipProps={ {
|
|
54
|
-
axis: 'y',
|
|
55
|
-
position: 'bottom',
|
|
56
|
-
isVisible: isResizing,
|
|
57
|
-
} }
|
|
58
|
-
{ ...props }
|
|
59
|
-
/>
|
|
60
|
-
);
|
|
61
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { Path, SVG } from '@wordpress/components';
|
|
5
|
-
|
|
6
|
-
export default (
|
|
7
|
-
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
8
|
-
<Path d="M18 2l2 4h-2l-2-4h-3l2 4h-2l-2-4h-1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V2zm2 12H10V4.4L11.8 8H20z" />
|
|
9
|
-
<Path d="M14 20H4V10h3V8H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3h-2z" />
|
|
10
|
-
<Path d="M5 19h8l-1.59-2H9.24l-.84 1.1L7 16.3 5 19z" />
|
|
11
|
-
</SVG>
|
|
12
|
-
);
|