@wordpress/block-library 7.10.0 → 7.11.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/button/edit.js +2 -1
- package/build/button/edit.js.map +1 -1
- package/build/buttons/edit.js +1 -1
- package/build/buttons/edit.js.map +1 -1
- package/build/columns/edit.native.js +1 -1
- package/build/columns/edit.native.js.map +1 -1
- package/build/comments/edit/comments-legacy.js +73 -0
- package/build/comments/edit/comments-legacy.js.map +1 -0
- package/build/comments/{edit.js → edit/index.js} +17 -38
- package/build/comments/edit/index.js.map +1 -0
- package/build/comments/edit/placeholder.js +117 -0
- package/build/comments/edit/placeholder.js.map +1 -0
- package/build/comments/edit/template.js +39 -0
- package/build/comments/edit/template.js.map +1 -0
- package/build/comments/index.js +6 -1
- package/build/comments/index.js.map +1 -1
- package/build/comments/save.js +12 -4
- package/build/comments/save.js.map +1 -1
- package/build/cover/transforms.js +3 -2
- package/build/cover/transforms.js.map +1 -1
- package/build/embed/embed-placeholder.native.js +1 -3
- package/build/embed/embed-placeholder.native.js.map +1 -1
- package/build/gallery/edit.js +2 -2
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/use-get-media.native.js +59 -0
- package/build/gallery/use-get-media.native.js.map +1 -0
- package/build/group/index.js +1 -0
- package/build/group/index.js.map +1 -1
- package/build/group/variations.js +1 -1
- package/build/group/variations.js.map +1 -1
- package/build/image/deprecated.js +77 -9
- package/build/image/deprecated.js.map +1 -1
- package/build/image/edit.js +3 -1
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +18 -8
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +27 -20
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +7 -1
- package/build/image/index.js.map +1 -1
- package/build/image/save.js +8 -2
- package/build/image/save.js.map +1 -1
- package/build/index.js +1 -3
- package/build/index.js.map +1 -1
- package/build/index.native.js +3 -13
- package/build/index.native.js.map +1 -1
- package/build/list/transforms.js +4 -63
- package/build/list/transforms.js.map +1 -1
- package/build/list/v2/transforms.js +0 -27
- package/build/list/v2/transforms.js.map +1 -1
- package/build/list-item/edit.js +14 -9
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/hooks/index.js +8 -8
- package/build/list-item/hooks/index.js.map +1 -1
- package/build/list-item/hooks/use-merge.js +174 -0
- package/build/list-item/hooks/use-merge.js.map +1 -0
- package/build/list-item/hooks/use-outdent-list-item.js +86 -50
- package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build/list-item/utils.js +125 -1
- package/build/list-item/utils.js.map +1 -1
- package/build/media-text/deprecated.js +134 -7
- package/build/media-text/deprecated.js.map +1 -1
- package/build/media-text/edit.js +2 -2
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/save.js +13 -0
- package/build/media-text/save.js.map +1 -1
- package/build/more/save.js +1 -7
- package/build/more/save.js.map +1 -1
- package/build/navigation-link/edit.js +5 -4
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +2 -1
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/edit.js +8 -1
- package/build/page-list/edit.js.map +1 -1
- package/build/paragraph/edit.js +7 -11
- package/build/paragraph/edit.js.map +1 -1
- package/build/post-comments-form/edit.js +4 -45
- package/build/post-comments-form/edit.js.map +1 -1
- package/build/post-comments-form/form.js +47 -3
- package/build/post-comments-form/form.js.map +1 -1
- package/build/post-terms/edit.js +3 -2
- package/build/post-terms/edit.js.map +1 -1
- package/build/query-no-results/edit.js +1 -1
- package/build/query-no-results/edit.js.map +1 -1
- package/build/query-pagination-next/edit.js +2 -1
- package/build/query-pagination-next/edit.js.map +1 -1
- package/build/query-pagination-previous/edit.js +2 -1
- package/build/query-pagination-previous/edit.js.map +1 -1
- package/build/quote/deprecated.js +168 -36
- package/build/quote/deprecated.js.map +1 -1
- package/build/quote/edit.js +76 -39
- package/build/quote/edit.js.map +1 -1
- package/build/quote/index.js +9 -45
- package/build/quote/index.js.map +1 -1
- package/build/quote/save.js +1 -5
- package/build/quote/save.js.map +1 -1
- package/build/quote/transforms.js +110 -158
- package/build/quote/transforms.js.map +1 -1
- package/build/social-link/icons/index.js +13 -0
- package/build/social-link/icons/index.js.map +1 -1
- package/build/social-link/icons/whatsapp.js +25 -0
- package/build/social-link/icons/whatsapp.js.map +1 -0
- package/build/social-link/variations.js +7 -0
- package/build/social-link/variations.js.map +1 -1
- package/build/template-part/edit/index.js +17 -8
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/selection-modal.js +33 -13
- package/build/template-part/edit/selection-modal.js.map +1 -1
- package/build/template-part/edit/utils/search.js +94 -0
- package/build/template-part/edit/utils/search.js.map +1 -0
- package/build-module/button/edit.js +2 -1
- package/build-module/button/edit.js.map +1 -1
- package/build-module/buttons/edit.js +2 -2
- package/build-module/buttons/edit.js.map +1 -1
- package/build-module/columns/edit.native.js +2 -2
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/comments/edit/comments-legacy.js +59 -0
- package/build-module/comments/edit/comments-legacy.js.map +1 -0
- package/build-module/comments/edit/index.js +37 -0
- package/build-module/comments/edit/index.js.map +1 -0
- package/build-module/comments/edit/placeholder.js +102 -0
- package/build-module/comments/edit/placeholder.js.map +1 -0
- package/build-module/comments/edit/template.js +32 -0
- package/build-module/comments/edit/template.js.map +1 -0
- package/build-module/comments/index.js +6 -1
- package/build-module/comments/index.js.map +1 -1
- package/build-module/comments/save.js +9 -4
- package/build-module/comments/save.js.map +1 -1
- package/build-module/cover/transforms.js +3 -2
- package/build-module/cover/transforms.js.map +1 -1
- package/build-module/embed/embed-placeholder.native.js +1 -2
- package/build-module/embed/embed-placeholder.native.js.map +1 -1
- package/build-module/gallery/edit.js +2 -2
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/use-get-media.native.js +50 -0
- package/build-module/gallery/use-get-media.native.js.map +1 -0
- package/build-module/group/index.js +1 -0
- package/build-module/group/index.js.map +1 -1
- package/build-module/group/variations.js +2 -2
- package/build-module/group/variations.js.map +1 -1
- package/build-module/image/deprecated.js +77 -9
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/edit.js +5 -3
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +18 -8
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +29 -22
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +7 -1
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/save.js +9 -3
- package/build-module/image/save.js.map +1 -1
- package/build-module/index.js +1 -2
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +3 -13
- package/build-module/index.native.js.map +1 -1
- package/build-module/list/transforms.js +4 -63
- package/build-module/list/transforms.js.map +1 -1
- package/build-module/list/v2/transforms.js +2 -29
- package/build-module/list/v2/transforms.js.map +1 -1
- package/build-module/list-item/edit.js +14 -10
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/hooks/index.js +1 -1
- package/build-module/list-item/hooks/index.js.map +1 -1
- package/build-module/list-item/hooks/use-merge.js +160 -0
- package/build-module/list-item/hooks/use-merge.js.map +1 -0
- package/build-module/list-item/hooks/use-outdent-list-item.js +82 -46
- package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build-module/list-item/utils.js +123 -2
- package/build-module/list-item/utils.js.map +1 -1
- package/build-module/media-text/deprecated.js +134 -8
- package/build-module/media-text/deprecated.js.map +1 -1
- package/build-module/media-text/edit.js +2 -2
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/save.js +13 -0
- package/build-module/media-text/save.js.map +1 -1
- package/build-module/more/save.js +1 -6
- package/build-module/more/save.js.map +1 -1
- package/build-module/navigation-link/edit.js +5 -4
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +2 -1
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/edit.js +8 -1
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/paragraph/edit.js +8 -12
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/post-comments-form/edit.js +5 -42
- package/build-module/post-comments-form/edit.js.map +1 -1
- package/build-module/post-comments-form/form.js +46 -5
- package/build-module/post-comments-form/form.js.map +1 -1
- package/build-module/post-terms/edit.js +3 -2
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/query-no-results/edit.js +2 -2
- package/build-module/query-no-results/edit.js.map +1 -1
- package/build-module/query-pagination-next/edit.js +2 -1
- package/build-module/query-pagination-next/edit.js.map +1 -1
- package/build-module/query-pagination-previous/edit.js +2 -1
- package/build-module/query-pagination-previous/edit.js.map +1 -1
- package/build-module/quote/deprecated.js +162 -36
- package/build-module/quote/deprecated.js.map +1 -1
- package/build-module/quote/edit.js +77 -43
- package/build-module/quote/edit.js.map +1 -1
- package/build-module/quote/index.js +9 -39
- package/build-module/quote/index.js.map +1 -1
- package/build-module/quote/save.js +4 -8
- package/build-module/quote/save.js.map +1 -1
- package/build-module/quote/transforms.js +111 -158
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/social-link/icons/index.js +1 -0
- package/build-module/social-link/icons/index.js.map +1 -1
- package/build-module/social-link/icons/whatsapp.js +15 -0
- package/build-module/social-link/icons/whatsapp.js.map +1 -0
- package/build-module/social-link/variations.js +8 -1
- package/build-module/social-link/variations.js.map +1 -1
- package/build-module/template-part/edit/index.js +20 -11
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/selection-modal.js +33 -15
- package/build-module/template-part/edit/selection-modal.js.map +1 -1
- package/build-module/template-part/edit/utils/search.js +84 -0
- package/build-module/template-part/edit/utils/search.js.map +1 -0
- package/build-style/button/style-rtl.css +1 -1
- package/build-style/button/style.css +1 -1
- package/build-style/comments/editor-rtl.css +122 -0
- package/build-style/comments/editor.css +122 -0
- package/build-style/{post-comments → comments}/style-rtl.css +1 -0
- package/build-style/{post-comments → comments}/style.css +1 -0
- package/build-style/common-rtl.css +7 -0
- package/build-style/common.css +7 -0
- package/build-style/cover/style-rtl.css +2 -2
- package/build-style/cover/style.css +2 -2
- package/build-style/{post-comments/editor.css → editor-elements-rtl.css} +8 -2
- package/build-style/{post-comments/editor-rtl.css → editor-elements.css} +8 -2
- package/build-style/editor-rtl.css +151 -10
- package/build-style/editor.css +151 -10
- package/build-style/gallery/style-rtl.css +7 -2
- package/build-style/gallery/style.css +7 -2
- package/build-style/image/editor-rtl.css +4 -3
- package/build-style/image/editor.css +4 -3
- package/build-style/image/style-rtl.css +33 -3
- package/build-style/image/style.css +33 -3
- package/build-style/post-comments-form/style-rtl.css +0 -1
- package/build-style/post-comments-form/style.css +0 -1
- package/build-style/social-link/editor-rtl.css +1 -0
- package/build-style/social-link/editor.css +1 -0
- package/build-style/social-links/style-rtl.css +8 -0
- package/build-style/social-links/style.css +8 -0
- package/build-style/style-rtl.css +170 -127
- package/build-style/style.css +170 -127
- package/build-style/template-part/editor-rtl.css +14 -3
- package/build-style/template-part/editor.css +14 -3
- package/package.json +28 -28
- package/src/button/edit.js +1 -0
- package/src/button/style.scss +3 -1
- package/src/buttons/edit.js +1 -5
- package/src/columns/edit.native.js +2 -2
- package/src/comments/block.json +6 -1
- package/src/comments/edit/comments-legacy.js +71 -0
- package/src/comments/edit/index.js +35 -0
- package/src/comments/edit/placeholder.js +124 -0
- package/src/comments/{edit.js → edit/template.js} +1 -28
- package/src/comments/editor.scss +9 -0
- package/src/comments/index.php +219 -0
- package/src/comments/save.js +8 -7
- package/src/{post-comments → comments}/style.scss +7 -0
- package/src/common.scss +2 -0
- package/src/cover/style.scss +2 -2
- package/src/cover/transforms.js +2 -2
- package/src/editor-elements.scss +10 -0
- package/src/editor.scss +2 -1
- package/src/embed/embed-placeholder.native.js +2 -3
- package/src/gallery/edit.js +4 -2
- package/src/gallery/style.scss +10 -1
- package/src/gallery/use-get-media.native.js +44 -0
- package/src/group/block.json +1 -0
- package/src/group/variations.js +2 -2
- package/src/image/block.json +7 -1
- package/src/image/deprecated.js +86 -0
- package/src/image/edit.js +6 -1
- package/src/image/edit.native.js +18 -7
- package/src/image/editor.scss +9 -4
- package/src/image/image.js +26 -16
- package/src/image/save.js +10 -1
- package/src/image/style.scss +39 -3
- package/src/index.js +0 -2
- package/src/index.native.js +2 -11
- package/src/list/transforms.js +0 -47
- package/src/list/v2/transforms.js +2 -40
- package/src/list-item/edit.js +10 -12
- package/src/list-item/hooks/index.js +1 -1
- package/src/list-item/hooks/use-merge.js +141 -0
- package/src/list-item/hooks/use-outdent-list-item.js +72 -74
- package/src/list-item/utils.js +27 -3
- package/src/media-text/deprecated.js +148 -1
- package/src/media-text/edit.js +2 -1
- package/src/media-text/save.js +18 -0
- package/src/more/save.js +3 -6
- package/src/navigation-link/edit.js +4 -3
- package/src/navigation-submenu/edit.js +1 -0
- package/src/page-list/edit.js +9 -0
- package/src/paragraph/edit.js +8 -14
- package/src/post-comments-form/edit.js +2 -71
- package/src/post-comments-form/form.js +80 -5
- package/src/post-comments-form/index.php +1 -1
- package/src/post-comments-form/style.scss +0 -1
- package/src/post-terms/edit.js +3 -2
- package/src/query-no-results/edit.js +2 -5
- package/src/query-pagination-next/edit.js +1 -0
- package/src/query-pagination-previous/edit.js +1 -0
- package/src/quote/deprecated.js +213 -99
- package/src/quote/edit.js +77 -52
- package/src/quote/index.js +10 -33
- package/src/quote/save.js +5 -5
- package/src/quote/{v2/test → test}/migrate.js +2 -7
- package/src/quote/transforms.js +117 -147
- package/src/social-link/editor.scss +3 -0
- package/src/social-link/icons/index.js +1 -0
- package/src/social-link/icons/whatsapp.js +10 -0
- package/src/social-link/index.php +4 -0
- package/src/social-link/socials-with-bg.scss +5 -0
- package/src/social-link/socials-without-bg.scss +5 -0
- package/src/social-link/variations.js +7 -0
- package/src/style.scss +1 -2
- package/src/template-part/edit/index.js +37 -24
- package/src/template-part/edit/selection-modal.js +68 -40
- package/src/template-part/edit/utils/search.js +76 -0
- package/src/template-part/editor.scss +21 -9
- package/src/template-part/index.php +56 -2
- package/build/comments/edit.js.map +0 -1
- package/build/list-item/hooks/use-backspace.js +0 -59
- package/build/list-item/hooks/use-backspace.js.map +0 -1
- package/build/post-comments/edit.js +0 -184
- package/build/post-comments/edit.js.map +0 -1
- package/build/post-comments/index.js +0 -72
- package/build/post-comments/index.js.map +0 -1
- package/build/quote/v2/deprecated.js +0 -133
- package/build/quote/v2/deprecated.js.map +0 -1
- package/build/quote/v2/edit.js +0 -139
- package/build/quote/v2/edit.js.map +0 -1
- package/build/quote/v2/index.js +0 -49
- package/build/quote/v2/index.js.map +0 -1
- package/build/quote/v2/save.js +0 -43
- package/build/quote/v2/save.js.map +0 -1
- package/build/quote/v2/transforms.js +0 -156
- package/build/quote/v2/transforms.js.map +0 -1
- package/build-module/comments/edit.js +0 -59
- package/build-module/comments/edit.js.map +0 -1
- package/build-module/list-item/hooks/use-backspace.js +0 -44
- package/build-module/list-item/hooks/use-backspace.js.map +0 -1
- package/build-module/post-comments/edit.js +0 -171
- package/build-module/post-comments/edit.js.map +0 -1
- package/build-module/post-comments/index.js +0 -59
- package/build-module/post-comments/index.js.map +0 -1
- package/build-module/quote/v2/deprecated.js +0 -116
- package/build-module/quote/v2/deprecated.js.map +0 -1
- package/build-module/quote/v2/edit.js +0 -122
- package/build-module/quote/v2/edit.js.map +0 -1
- package/build-module/quote/v2/index.js +0 -33
- package/build-module/quote/v2/index.js.map +0 -1
- package/build-module/quote/v2/save.js +0 -30
- package/build-module/quote/v2/save.js.map +0 -1
- package/build-module/quote/v2/transforms.js +0 -147
- package/build-module/quote/v2/transforms.js.map +0 -1
- package/src/list-item/hooks/use-backspace.js +0 -51
- package/src/post-comments/block.json +0 -45
- package/src/post-comments/edit.js +0 -247
- package/src/post-comments/editor.scss +0 -3
- package/src/post-comments/index.js +0 -18
- package/src/post-comments/index.php +0 -87
- package/src/quote/v2/deprecated.js +0 -107
- package/src/quote/v2/edit.js +0 -139
- package/src/quote/v2/index.js +0 -36
- package/src/quote/v2/save.js +0 -26
- package/src/quote/v2/transforms.js +0 -155
package/src/group/variations.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { __ } from '@wordpress/i18n';
|
|
4
|
+
import { __, _x } from '@wordpress/i18n';
|
|
5
5
|
import { group, row, stack } from '@wordpress/icons';
|
|
6
6
|
|
|
7
7
|
const variations = [
|
|
@@ -19,7 +19,7 @@ const variations = [
|
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
name: 'group-row',
|
|
22
|
-
title:
|
|
22
|
+
title: _x( 'Row', 'single horizontal line' ),
|
|
23
23
|
description: __( 'Arrange blocks horizontally.' ),
|
|
24
24
|
attributes: { layout: { type: 'flex', flexWrap: 'nowrap' } },
|
|
25
25
|
scope: [ 'inserter', 'transform' ],
|
package/src/image/block.json
CHANGED
|
@@ -84,9 +84,15 @@
|
|
|
84
84
|
"background": false
|
|
85
85
|
},
|
|
86
86
|
"__experimentalBorder": {
|
|
87
|
+
"color": true,
|
|
87
88
|
"radius": true,
|
|
89
|
+
"width": true,
|
|
90
|
+
"__experimentalSelector": "img, .wp-block-image__crop-area",
|
|
91
|
+
"__experimentalSkipSerialization": true,
|
|
88
92
|
"__experimentalDefaultControls": {
|
|
89
|
-
"
|
|
93
|
+
"color": true,
|
|
94
|
+
"radius": true,
|
|
95
|
+
"width": true
|
|
90
96
|
}
|
|
91
97
|
},
|
|
92
98
|
"__experimentalStyle": {
|
package/src/image/deprecated.js
CHANGED
|
@@ -31,6 +31,12 @@ const blockAttributes = {
|
|
|
31
31
|
source: 'html',
|
|
32
32
|
selector: 'figcaption',
|
|
33
33
|
},
|
|
34
|
+
title: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
source: 'attribute',
|
|
37
|
+
selector: 'img',
|
|
38
|
+
attribute: 'title',
|
|
39
|
+
},
|
|
34
40
|
href: {
|
|
35
41
|
type: 'string',
|
|
36
42
|
source: 'attribute',
|
|
@@ -58,6 +64,9 @@ const blockAttributes = {
|
|
|
58
64
|
height: {
|
|
59
65
|
type: 'number',
|
|
60
66
|
},
|
|
67
|
+
sizeSlug: {
|
|
68
|
+
type: 'string',
|
|
69
|
+
},
|
|
61
70
|
linkDestination: {
|
|
62
71
|
type: 'string',
|
|
63
72
|
},
|
|
@@ -85,6 +94,83 @@ const blockSupports = {
|
|
|
85
94
|
};
|
|
86
95
|
|
|
87
96
|
const deprecated = [
|
|
97
|
+
// The following deprecation moves existing border radius styles onto the
|
|
98
|
+
// inner img element where new border block support styles must be applied.
|
|
99
|
+
// It will also add a new `.has-custom-border` class for existing blocks
|
|
100
|
+
// with border radii set. This class is required to improve caption position
|
|
101
|
+
// and styling when an image within a gallery has a custom border or
|
|
102
|
+
// rounded corners.
|
|
103
|
+
//
|
|
104
|
+
// See: https://github.com/WordPress/gutenberg/pull/31366/
|
|
105
|
+
{
|
|
106
|
+
attributes: blockAttributes,
|
|
107
|
+
supports: blockSupports,
|
|
108
|
+
save( { attributes } ) {
|
|
109
|
+
const {
|
|
110
|
+
url,
|
|
111
|
+
alt,
|
|
112
|
+
caption,
|
|
113
|
+
align,
|
|
114
|
+
href,
|
|
115
|
+
rel,
|
|
116
|
+
linkClass,
|
|
117
|
+
width,
|
|
118
|
+
height,
|
|
119
|
+
id,
|
|
120
|
+
linkTarget,
|
|
121
|
+
sizeSlug,
|
|
122
|
+
title,
|
|
123
|
+
} = attributes;
|
|
124
|
+
|
|
125
|
+
const newRel = isEmpty( rel ) ? undefined : rel;
|
|
126
|
+
|
|
127
|
+
const classes = classnames( {
|
|
128
|
+
[ `align${ align }` ]: align,
|
|
129
|
+
[ `size-${ sizeSlug }` ]: sizeSlug,
|
|
130
|
+
'is-resized': width || height,
|
|
131
|
+
} );
|
|
132
|
+
|
|
133
|
+
const image = (
|
|
134
|
+
<img
|
|
135
|
+
src={ url }
|
|
136
|
+
alt={ alt }
|
|
137
|
+
className={ id ? `wp-image-${ id }` : null }
|
|
138
|
+
width={ width }
|
|
139
|
+
height={ height }
|
|
140
|
+
title={ title }
|
|
141
|
+
/>
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
const figure = (
|
|
145
|
+
<>
|
|
146
|
+
{ href ? (
|
|
147
|
+
<a
|
|
148
|
+
className={ linkClass }
|
|
149
|
+
href={ href }
|
|
150
|
+
target={ linkTarget }
|
|
151
|
+
rel={ newRel }
|
|
152
|
+
>
|
|
153
|
+
{ image }
|
|
154
|
+
</a>
|
|
155
|
+
) : (
|
|
156
|
+
image
|
|
157
|
+
) }
|
|
158
|
+
{ ! RichText.isEmpty( caption ) && (
|
|
159
|
+
<RichText.Content
|
|
160
|
+
tagName="figcaption"
|
|
161
|
+
value={ caption }
|
|
162
|
+
/>
|
|
163
|
+
) }
|
|
164
|
+
</>
|
|
165
|
+
);
|
|
166
|
+
|
|
167
|
+
return (
|
|
168
|
+
<figure { ...useBlockProps.save( { className: classes } ) }>
|
|
169
|
+
{ figure }
|
|
170
|
+
</figure>
|
|
171
|
+
);
|
|
172
|
+
},
|
|
173
|
+
},
|
|
88
174
|
{
|
|
89
175
|
attributes: {
|
|
90
176
|
...blockAttributes,
|
package/src/image/edit.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import { get, has, omit, pick } from 'lodash';
|
|
5
|
+
import { get, has, isEmpty, omit, pick } from 'lodash';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
MediaPlaceholder,
|
|
18
18
|
useBlockProps,
|
|
19
19
|
store as blockEditorStore,
|
|
20
|
+
__experimentalUseBorderProps as useBorderProps,
|
|
20
21
|
} from '@wordpress/block-editor';
|
|
21
22
|
import { useEffect, useRef, useState } from '@wordpress/element';
|
|
22
23
|
import { __ } from '@wordpress/i18n';
|
|
@@ -296,10 +297,14 @@ export function ImageEdit( {
|
|
|
296
297
|
/>
|
|
297
298
|
);
|
|
298
299
|
|
|
300
|
+
const borderProps = useBorderProps( attributes );
|
|
301
|
+
|
|
299
302
|
const classes = classnames( className, {
|
|
300
303
|
'is-transient': temporaryURL,
|
|
301
304
|
'is-resized': !! width || !! height,
|
|
302
305
|
[ `size-${ sizeSlug }` ]: sizeSlug,
|
|
306
|
+
'has-custom-border':
|
|
307
|
+
!! borderProps.className || ! isEmpty( borderProps.style ),
|
|
303
308
|
} );
|
|
304
309
|
|
|
305
310
|
const blockProps = useBlockProps( {
|
package/src/image/edit.native.js
CHANGED
|
@@ -268,11 +268,15 @@ export class ImageEdit extends Component {
|
|
|
268
268
|
componentDidUpdate( previousProps ) {
|
|
269
269
|
const { image, attributes, setAttributes, featuredImageId } =
|
|
270
270
|
this.props;
|
|
271
|
+
const { url } = attributes;
|
|
271
272
|
if ( ! previousProps.image && image ) {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
273
|
+
if ( ! hasQueryArg( url, 'w' ) && attributes?.sizeSlug ) {
|
|
274
|
+
const updatedUrl =
|
|
275
|
+
getUrlForSlug( image, attributes.sizeSlug ) ||
|
|
276
|
+
image.source_url;
|
|
277
|
+
|
|
278
|
+
setAttributes( { url: updatedUrl } );
|
|
279
|
+
}
|
|
276
280
|
}
|
|
277
281
|
|
|
278
282
|
const { id } = attributes;
|
|
@@ -574,7 +578,7 @@ export class ImageEdit extends Component {
|
|
|
574
578
|
<>
|
|
575
579
|
{ __(
|
|
576
580
|
'Describe the purpose of the image. Leave empty if the image is purely decorative.'
|
|
577
|
-
) }
|
|
581
|
+
) }{ ' ' }
|
|
578
582
|
<FooterMessageLink
|
|
579
583
|
href={
|
|
580
584
|
'https://www.w3.org/WAI/tutorials/images/decision-tree/'
|
|
@@ -665,6 +669,7 @@ export class ImageEdit extends Component {
|
|
|
665
669
|
context,
|
|
666
670
|
featuredImageId,
|
|
667
671
|
wasBlockJustInserted,
|
|
672
|
+
shouldUseFastImage,
|
|
668
673
|
} = this.props;
|
|
669
674
|
const { align, url, alt, id, sizeSlug, className } = attributes;
|
|
670
675
|
const hasImageContext = context
|
|
@@ -845,6 +850,9 @@ export class ImageEdit extends Component {
|
|
|
845
850
|
isUploadInProgress={
|
|
846
851
|
isUploadInProgress
|
|
847
852
|
}
|
|
853
|
+
shouldUseFastImage={
|
|
854
|
+
shouldUseFastImage
|
|
855
|
+
}
|
|
848
856
|
onSelectMediaUploadOption={
|
|
849
857
|
this.onSelectMediaUploadOption
|
|
850
858
|
}
|
|
@@ -904,7 +912,8 @@ export default compose( [
|
|
|
904
912
|
isSelected,
|
|
905
913
|
clientId,
|
|
906
914
|
} = props;
|
|
907
|
-
const { imageSizes, imageDefaultSize } =
|
|
915
|
+
const { imageSizes, imageDefaultSize, shouldUseFastImage } =
|
|
916
|
+
getSettings();
|
|
908
917
|
const isNotFileUrl = id && getProtocol( url ) !== 'file:';
|
|
909
918
|
const featuredImageId = getEditedPostAttribute( 'featured_media' );
|
|
910
919
|
|
|
@@ -916,11 +925,13 @@ export default compose( [
|
|
|
916
925
|
isNotFileUrl &&
|
|
917
926
|
url &&
|
|
918
927
|
! hasQueryArg( url, 'w' ) );
|
|
928
|
+
const image = shouldGetMedia ? getMedia( id ) : null;
|
|
919
929
|
|
|
920
930
|
return {
|
|
921
|
-
image
|
|
931
|
+
image,
|
|
922
932
|
imageSizes,
|
|
923
933
|
imageDefaultSize,
|
|
934
|
+
shouldUseFastImage,
|
|
924
935
|
featuredImageId,
|
|
925
936
|
wasBlockJustInserted: wasBlockJustInserted(
|
|
926
937
|
clientId,
|
package/src/image/editor.scss
CHANGED
|
@@ -22,10 +22,6 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
22
22
|
margin-top: -9px;
|
|
23
23
|
margin-left: -9px;
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
&:not(.is-style-rounded) > div:not(.components-placeholder) {
|
|
27
|
-
border-radius: inherit;
|
|
28
|
-
}
|
|
29
25
|
}
|
|
30
26
|
|
|
31
27
|
// This is necessary for the editor resize handles to accurately work on a non-floated, non-resized, small image.
|
|
@@ -94,6 +90,15 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
94
90
|
position: relative;
|
|
95
91
|
max-width: 100%;
|
|
96
92
|
width: 100%;
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
|
|
95
|
+
// This removes the border from the img within the image cropper so it
|
|
96
|
+
// can be applied to the cropper itself. This then allows the image to be
|
|
97
|
+
// cropped within the visual border providing more accurate editing and
|
|
98
|
+
// smoother UX.
|
|
99
|
+
.reactEasyCrop_Container .reactEasyCrop_Image {
|
|
100
|
+
border: none;
|
|
101
|
+
}
|
|
97
102
|
}
|
|
98
103
|
|
|
99
104
|
.wp-block-image__crop-icon {
|
package/src/image/image.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { get, filter, map, pick, includes } from 'lodash';
|
|
4
|
+
import { get, filter, isEmpty, map, pick, includes } from 'lodash';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
__experimentalImageEditor as ImageEditor,
|
|
31
31
|
__experimentalImageEditingProvider as ImageEditingProvider,
|
|
32
32
|
__experimentalGetElementClassName,
|
|
33
|
+
__experimentalUseBorderProps as useBorderProps,
|
|
33
34
|
} from '@wordpress/block-editor';
|
|
34
35
|
import { useEffect, useMemo, useState, useRef } from '@wordpress/element';
|
|
35
36
|
import { __, sprintf, isRTL } from '@wordpress/i18n';
|
|
@@ -57,7 +58,19 @@ import { MIN_SIZE, ALLOWED_MEDIA_TYPES } from './constants';
|
|
|
57
58
|
|
|
58
59
|
export default function Image( {
|
|
59
60
|
temporaryURL,
|
|
60
|
-
attributes
|
|
61
|
+
attributes,
|
|
62
|
+
setAttributes,
|
|
63
|
+
isSelected,
|
|
64
|
+
insertBlocksAfter,
|
|
65
|
+
onReplace,
|
|
66
|
+
onSelectImage,
|
|
67
|
+
onSelectURL,
|
|
68
|
+
onUploadError,
|
|
69
|
+
containerRef,
|
|
70
|
+
context,
|
|
71
|
+
clientId,
|
|
72
|
+
} ) {
|
|
73
|
+
const {
|
|
61
74
|
url = '',
|
|
62
75
|
alt,
|
|
63
76
|
caption,
|
|
@@ -72,18 +85,7 @@ export default function Image( {
|
|
|
72
85
|
height,
|
|
73
86
|
linkTarget,
|
|
74
87
|
sizeSlug,
|
|
75
|
-
}
|
|
76
|
-
setAttributes,
|
|
77
|
-
isSelected,
|
|
78
|
-
insertBlocksAfter,
|
|
79
|
-
onReplace,
|
|
80
|
-
onSelectImage,
|
|
81
|
-
onSelectURL,
|
|
82
|
-
onUploadError,
|
|
83
|
-
containerRef,
|
|
84
|
-
context,
|
|
85
|
-
clientId,
|
|
86
|
-
} ) {
|
|
88
|
+
} = attributes;
|
|
87
89
|
const imageRef = useRef();
|
|
88
90
|
const captionRef = useRef();
|
|
89
91
|
const prevUrl = usePrevious( url );
|
|
@@ -186,7 +188,7 @@ export default function Image( {
|
|
|
186
188
|
|
|
187
189
|
// Get naturalWidth and naturalHeight from image ref, and fall back to loaded natural
|
|
188
190
|
// width and height. This resolves an issue in Safari where the loaded natural
|
|
189
|
-
//
|
|
191
|
+
// width and height is otherwise lost when switching between alignments.
|
|
190
192
|
// See: https://github.com/WordPress/gutenberg/pull/37210.
|
|
191
193
|
const { naturalWidth, naturalHeight } = useMemo( () => {
|
|
192
194
|
return {
|
|
@@ -429,6 +431,11 @@ export default function Image( {
|
|
|
429
431
|
defaultedAlt = __( 'This image has an empty alt attribute' );
|
|
430
432
|
}
|
|
431
433
|
|
|
434
|
+
const borderProps = useBorderProps( attributes );
|
|
435
|
+
const isRounded = attributes.className?.includes( 'is-style-rounded' );
|
|
436
|
+
const hasCustomBorder =
|
|
437
|
+
!! borderProps.className || ! isEmpty( borderProps.style );
|
|
438
|
+
|
|
432
439
|
let img = (
|
|
433
440
|
// Disable reason: Image itself is not meant to be interactive, but
|
|
434
441
|
// should direct focus to block.
|
|
@@ -445,6 +452,8 @@ export default function Image( {
|
|
|
445
452
|
} );
|
|
446
453
|
} }
|
|
447
454
|
ref={ imageRef }
|
|
455
|
+
className={ borderProps.className }
|
|
456
|
+
style={ borderProps.style }
|
|
448
457
|
/>
|
|
449
458
|
{ temporaryURL && <Spinner /> }
|
|
450
459
|
</>
|
|
@@ -466,6 +475,7 @@ export default function Image( {
|
|
|
466
475
|
if ( canEditImage && isEditingImage ) {
|
|
467
476
|
img = (
|
|
468
477
|
<ImageEditor
|
|
478
|
+
borderProps={ isRounded ? undefined : borderProps }
|
|
469
479
|
url={ url }
|
|
470
480
|
width={ width }
|
|
471
481
|
height={ height }
|
|
@@ -530,7 +540,7 @@ export default function Image( {
|
|
|
530
540
|
<ResizableBox
|
|
531
541
|
size={ {
|
|
532
542
|
width: width ?? 'auto',
|
|
533
|
-
height: height
|
|
543
|
+
height: height && ! hasCustomBorder ? height : 'auto',
|
|
534
544
|
} }
|
|
535
545
|
showHandle={ isSelected }
|
|
536
546
|
minWidth={ minWidth }
|
package/src/image/save.js
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
RichText,
|
|
12
12
|
useBlockProps,
|
|
13
13
|
__experimentalGetElementClassName,
|
|
14
|
+
__experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles,
|
|
14
15
|
} from '@wordpress/block-editor';
|
|
15
16
|
|
|
16
17
|
export default function save( { attributes } ) {
|
|
@@ -31,18 +32,26 @@ export default function save( { attributes } ) {
|
|
|
31
32
|
} = attributes;
|
|
32
33
|
|
|
33
34
|
const newRel = isEmpty( rel ) ? undefined : rel;
|
|
35
|
+
const borderProps = getBorderClassesAndStyles( attributes );
|
|
34
36
|
|
|
35
37
|
const classes = classnames( {
|
|
36
38
|
[ `align${ align }` ]: align,
|
|
37
39
|
[ `size-${ sizeSlug }` ]: sizeSlug,
|
|
38
40
|
'is-resized': width || height,
|
|
41
|
+
'has-custom-border':
|
|
42
|
+
!! borderProps.className || ! isEmpty( borderProps.style ),
|
|
43
|
+
} );
|
|
44
|
+
|
|
45
|
+
const imageClasses = classnames( borderProps.className, {
|
|
46
|
+
[ `wp-image-${ id }` ]: !! id,
|
|
39
47
|
} );
|
|
40
48
|
|
|
41
49
|
const image = (
|
|
42
50
|
<img
|
|
43
51
|
src={ url }
|
|
44
52
|
alt={ alt }
|
|
45
|
-
className={
|
|
53
|
+
className={ imageClasses || undefined }
|
|
54
|
+
style={ borderProps.style }
|
|
46
55
|
width={ width }
|
|
47
56
|
height={ height }
|
|
48
57
|
title={ title }
|
package/src/image/style.scss
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
height: auto;
|
|
4
4
|
max-width: 100%;
|
|
5
5
|
vertical-align: bottom;
|
|
6
|
+
box-sizing: border-box;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
> a,
|
|
9
|
+
&.has-custom-border {
|
|
10
10
|
img {
|
|
11
|
-
|
|
11
|
+
box-sizing: border-box;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -97,6 +97,42 @@
|
|
|
97
97
|
border-radius: 0;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
+
|
|
101
|
+
// The following is required to overcome WP Core applying styles that clear
|
|
102
|
+
// img borders with a higher specificity than those added by the border
|
|
103
|
+
// block support to provide a default border-style of solid when a border
|
|
104
|
+
// color or width has been set.
|
|
105
|
+
:where(.has-border-color) {
|
|
106
|
+
border-style: solid;
|
|
107
|
+
}
|
|
108
|
+
:where([style*="border-top-color"]) {
|
|
109
|
+
border-top-style: solid;
|
|
110
|
+
}
|
|
111
|
+
:where([style*="border-right-color"]) {
|
|
112
|
+
border-right-style: solid;
|
|
113
|
+
}
|
|
114
|
+
:where([style*="border-bottom-color"]) {
|
|
115
|
+
border-bottom-style: solid;
|
|
116
|
+
}
|
|
117
|
+
:where([style*="border-left-color"]) {
|
|
118
|
+
border-left-style: solid;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:where([style*="border-width"]) {
|
|
122
|
+
border-style: solid;
|
|
123
|
+
}
|
|
124
|
+
:where([style*="border-top-width"]) {
|
|
125
|
+
border-top-style: solid;
|
|
126
|
+
}
|
|
127
|
+
:where([style*="border-right-width"]) {
|
|
128
|
+
border-right-style: solid;
|
|
129
|
+
}
|
|
130
|
+
:where([style*="border-bottom-width"]) {
|
|
131
|
+
border-bottom-style: solid;
|
|
132
|
+
}
|
|
133
|
+
:where([style*="border-left-width"]) {
|
|
134
|
+
border-left-style: solid;
|
|
135
|
+
}
|
|
100
136
|
}
|
|
101
137
|
|
|
102
138
|
.wp-block-image figure {
|
package/src/index.js
CHANGED
|
@@ -73,7 +73,6 @@ import * as postAuthor from './post-author';
|
|
|
73
73
|
import * as postAuthorName from './post-author-name';
|
|
74
74
|
import * as postAuthorBiography from './post-author-biography';
|
|
75
75
|
import * as postComment from './post-comment';
|
|
76
|
-
import * as postComments from './post-comments';
|
|
77
76
|
import * as postCommentsCount from './post-comments-count';
|
|
78
77
|
import * as postCommentsForm from './post-comments-form';
|
|
79
78
|
import * as postCommentsLink from './post-comments-link';
|
|
@@ -228,7 +227,6 @@ const getAllBlocks = () => [
|
|
|
228
227
|
commentsPaginationNext,
|
|
229
228
|
commentsPaginationNumbers,
|
|
230
229
|
commentsPaginationPrevious,
|
|
231
|
-
postComments,
|
|
232
230
|
postCommentsForm,
|
|
233
231
|
tableOfContents,
|
|
234
232
|
homeLink,
|
package/src/index.native.js
CHANGED
|
@@ -179,14 +179,6 @@ const devOnly = ( block ) => ( !! __DEV__ ? block : null );
|
|
|
179
179
|
const iOSOnly = ( block ) =>
|
|
180
180
|
Platform.OS === 'ios' ? block : devOnly( block );
|
|
181
181
|
|
|
182
|
-
// To be removed once Quote V2 is released on the web editor.
|
|
183
|
-
function quoteCheck( quoteBlock, blocksFlags ) {
|
|
184
|
-
if ( blocksFlags?.__experimentalEnableQuoteBlockV2 ) {
|
|
185
|
-
quoteBlock.settings = quoteBlock?.settingsV2;
|
|
186
|
-
}
|
|
187
|
-
return quoteBlock;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
182
|
// Hide the Classic block and SocialLink block
|
|
191
183
|
addFilter(
|
|
192
184
|
'blocks.registerBlockType',
|
|
@@ -238,10 +230,9 @@ addFilter(
|
|
|
238
230
|
*
|
|
239
231
|
* registerCoreBlocks();
|
|
240
232
|
* ```
|
|
241
|
-
* @param {Object} [blocksFlags] Experimental flags
|
|
242
233
|
*
|
|
243
234
|
*/
|
|
244
|
-
export const registerCoreBlocks = (
|
|
235
|
+
export const registerCoreBlocks = () => {
|
|
245
236
|
// When adding new blocks to this list please also consider updating /src/block-support/supported-blocks.json in the Gutenberg-Mobile repo
|
|
246
237
|
[
|
|
247
238
|
paragraph,
|
|
@@ -254,7 +245,7 @@ export const registerCoreBlocks = ( blocksFlags ) => {
|
|
|
254
245
|
nextpage,
|
|
255
246
|
separator,
|
|
256
247
|
list,
|
|
257
|
-
|
|
248
|
+
quote,
|
|
258
249
|
mediaText,
|
|
259
250
|
preformatted,
|
|
260
251
|
gallery,
|
package/src/list/transforms.js
CHANGED
|
@@ -65,19 +65,6 @@ const transforms = {
|
|
|
65
65
|
} );
|
|
66
66
|
},
|
|
67
67
|
},
|
|
68
|
-
{
|
|
69
|
-
type: 'block',
|
|
70
|
-
blocks: [ 'core/quote', 'core/pullquote' ],
|
|
71
|
-
transform: ( { value, anchor } ) => {
|
|
72
|
-
return createBlock( 'core/list', {
|
|
73
|
-
values: toHTMLString( {
|
|
74
|
-
value: create( { html: value, multilineTag: 'p' } ),
|
|
75
|
-
multilineTag: 'li',
|
|
76
|
-
} ),
|
|
77
|
-
anchor,
|
|
78
|
-
} );
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
68
|
{
|
|
82
69
|
type: 'raw',
|
|
83
70
|
selector: 'ol,ul',
|
|
@@ -174,40 +161,6 @@ const transforms = {
|
|
|
174
161
|
} )
|
|
175
162
|
),
|
|
176
163
|
},
|
|
177
|
-
{
|
|
178
|
-
type: 'block',
|
|
179
|
-
blocks: [ 'core/quote' ],
|
|
180
|
-
transform: ( { values, anchor } ) => {
|
|
181
|
-
return createBlock( 'core/quote', {
|
|
182
|
-
value: toHTMLString( {
|
|
183
|
-
value: create( {
|
|
184
|
-
html: values,
|
|
185
|
-
multilineTag: 'li',
|
|
186
|
-
multilineWrapperTags: [ 'ul', 'ol' ],
|
|
187
|
-
} ),
|
|
188
|
-
multilineTag: 'p',
|
|
189
|
-
} ),
|
|
190
|
-
anchor,
|
|
191
|
-
} );
|
|
192
|
-
},
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
type: 'block',
|
|
196
|
-
blocks: [ 'core/pullquote' ],
|
|
197
|
-
transform: ( { values, anchor } ) => {
|
|
198
|
-
return createBlock( 'core/pullquote', {
|
|
199
|
-
value: toHTMLString( {
|
|
200
|
-
value: create( {
|
|
201
|
-
html: values,
|
|
202
|
-
multilineTag: 'li',
|
|
203
|
-
multilineWrapperTags: [ 'ul', 'ol' ],
|
|
204
|
-
} ),
|
|
205
|
-
multilineTag: 'p',
|
|
206
|
-
} ),
|
|
207
|
-
anchor,
|
|
208
|
-
} );
|
|
209
|
-
},
|
|
210
|
-
},
|
|
211
164
|
{
|
|
212
165
|
type: 'block',
|
|
213
166
|
blocks: [ 'core/table-of-contents' ],
|
|
@@ -9,13 +9,8 @@ import { flatMap } from 'lodash';
|
|
|
9
9
|
/**
|
|
10
10
|
* WordPress dependencies
|
|
11
11
|
*/
|
|
12
|
-
import { createBlock
|
|
13
|
-
import {
|
|
14
|
-
__UNSTABLE_LINE_SEPARATOR,
|
|
15
|
-
create,
|
|
16
|
-
split,
|
|
17
|
-
toHTMLString,
|
|
18
|
-
} from '@wordpress/rich-text';
|
|
12
|
+
import { createBlock } from '@wordpress/blocks';
|
|
13
|
+
import { create, split, toHTMLString } from '@wordpress/rich-text';
|
|
19
14
|
|
|
20
15
|
/**
|
|
21
16
|
* Internal dependencies
|
|
@@ -83,26 +78,6 @@ const transforms = {
|
|
|
83
78
|
);
|
|
84
79
|
},
|
|
85
80
|
},
|
|
86
|
-
{
|
|
87
|
-
type: 'block',
|
|
88
|
-
blocks: [ 'core/quote', 'core/pullquote' ],
|
|
89
|
-
transform: ( { value, anchor } ) => {
|
|
90
|
-
return createBlock(
|
|
91
|
-
'core/list',
|
|
92
|
-
{
|
|
93
|
-
anchor,
|
|
94
|
-
},
|
|
95
|
-
split(
|
|
96
|
-
create( { html: value, multilineTag: 'p' } ),
|
|
97
|
-
__UNSTABLE_LINE_SEPARATOR
|
|
98
|
-
).map( ( result ) => {
|
|
99
|
-
return createBlock( 'core/list-item', {
|
|
100
|
-
content: toHTMLString( { value: result } ),
|
|
101
|
-
} );
|
|
102
|
-
} )
|
|
103
|
-
);
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
81
|
...[ '*', '-' ].map( ( prefix ) => ( {
|
|
107
82
|
type: 'prefix',
|
|
108
83
|
prefix,
|
|
@@ -147,19 +122,6 @@ const transforms = {
|
|
|
147
122
|
);
|
|
148
123
|
},
|
|
149
124
|
} ) ),
|
|
150
|
-
...[ 'core/quote', 'core/pullquote' ].map( ( block ) => ( {
|
|
151
|
-
type: 'block',
|
|
152
|
-
blocks: [ block ],
|
|
153
|
-
transform: ( attributes, innerBlocks ) => {
|
|
154
|
-
return switchToBlockType(
|
|
155
|
-
switchToBlockType(
|
|
156
|
-
createBlock( 'core/list', attributes, innerBlocks ),
|
|
157
|
-
'core/paragraph'
|
|
158
|
-
),
|
|
159
|
-
block
|
|
160
|
-
);
|
|
161
|
-
},
|
|
162
|
-
} ) ),
|
|
163
125
|
],
|
|
164
126
|
};
|
|
165
127
|
|