@wordpress/block-library 2.22.10 → 2.22.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/missing/edit.js
CHANGED
|
@@ -17,6 +17,8 @@ var _data = require("@wordpress/data");
|
|
|
17
17
|
|
|
18
18
|
var _blockEditor = require("@wordpress/block-editor");
|
|
19
19
|
|
|
20
|
+
var _dom = require("@wordpress/dom");
|
|
21
|
+
|
|
20
22
|
/**
|
|
21
23
|
* WordPress dependencies
|
|
22
24
|
*/
|
|
@@ -48,7 +50,7 @@ function MissingBlockWarning(_ref) {
|
|
|
48
50
|
|
|
49
51
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.Warning, {
|
|
50
52
|
actions: actions
|
|
51
|
-
}, messageHTML), (0, _element.createElement)(_element.RawHTML, null, originalUndelimitedContent));
|
|
53
|
+
}, messageHTML), (0, _element.createElement)(_element.RawHTML, null, (0, _dom.safeHTML)(originalUndelimitedContent)));
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
var MissingEdit = (0, _data.withDispatch)(function (dispatch, _ref2) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/missing/edit.js"],"names":["MissingBlockWarning","attributes","convertToHTML","originalName","originalUndelimitedContent","hasContent","hasHTMLBlock","actions","messageHTML","push","MissingEdit","dispatch","clientId","replaceBlock","content"],"mappings":";;;;;;;AAIA;;AADA;;AAEA;;AACA;;AACA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/missing/edit.js"],"names":["MissingBlockWarning","attributes","convertToHTML","originalName","originalUndelimitedContent","hasContent","hasHTMLBlock","actions","messageHTML","push","MissingEdit","dispatch","clientId","replaceBlock","content"],"mappings":";;;;;;;AAIA;;AADA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AATA;;;AAWA,SAASA,mBAAT,OAA8D;AAAA,MAA9BC,UAA8B,QAA9BA,UAA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mBAZe,CAApB;eAceU,W","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { RawHTML } from '@wordpress/element';\nimport { Button } from '@wordpress/components';\nimport { getBlockType, createBlock } from '@wordpress/blocks';\nimport { withDispatch } from '@wordpress/data';\nimport { Warning } from '@wordpress/block-editor';\nimport { safeHTML } from '@wordpress/dom';\n\nfunction MissingBlockWarning( { attributes, convertToHTML } ) {\n\tconst { originalName, originalUndelimitedContent } = attributes;\n\tconst hasContent = !! originalUndelimitedContent;\n\tconst hasHTMLBlock = getBlockType( 'core/html' );\n\n\tconst actions = [];\n\tlet messageHTML;\n\tif ( hasContent && hasHTMLBlock ) {\n\t\tmessageHTML = sprintf(\n\t\t\t/* translators: %s: block name */\n\t\t\t__(\n\t\t\t\t'Your site doesn’t include support for the \"%s\" block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely.'\n\t\t\t),\n\t\t\toriginalName\n\t\t);\n\t\tactions.push(\n\t\t\t<Button key=\"convert\" onClick={ convertToHTML } isLarge isPrimary>\n\t\t\t\t{ __( 'Keep as HTML' ) }\n\t\t\t</Button>\n\t\t);\n\t} else {\n\t\tmessageHTML = sprintf(\n\t\t\t/* translators: %s: block name */\n\t\t\t__(\n\t\t\t\t'Your site doesn’t include support for the \"%s\" block. You can leave this block intact or remove it entirely.'\n\t\t\t),\n\t\t\toriginalName\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Warning actions={ actions }>{ messageHTML }</Warning>\n\t\t\t<RawHTML>{ safeHTML( originalUndelimitedContent ) }</RawHTML>\n\t\t</>\n\t);\n}\n\nconst MissingEdit = withDispatch( ( dispatch, { clientId, attributes } ) => {\n\tconst { replaceBlock } = dispatch( 'core/block-editor' );\n\treturn {\n\t\tconvertToHTML() {\n\t\t\treplaceBlock(\n\t\t\t\tclientId,\n\t\t\t\tcreateBlock( 'core/html', {\n\t\t\t\t\tcontent: attributes.originalUndelimitedContent,\n\t\t\t\t} )\n\t\t\t);\n\t\t},\n\t};\n} )( MissingBlockWarning );\n\nexport default MissingEdit;\n"]}
|
|
@@ -9,6 +9,7 @@ import { Button } from '@wordpress/components';
|
|
|
9
9
|
import { getBlockType, createBlock } from '@wordpress/blocks';
|
|
10
10
|
import { withDispatch } from '@wordpress/data';
|
|
11
11
|
import { Warning } from '@wordpress/block-editor';
|
|
12
|
+
import { safeHTML } from '@wordpress/dom';
|
|
12
13
|
|
|
13
14
|
function MissingBlockWarning(_ref) {
|
|
14
15
|
var attributes = _ref.attributes,
|
|
@@ -38,7 +39,7 @@ function MissingBlockWarning(_ref) {
|
|
|
38
39
|
|
|
39
40
|
return createElement(Fragment, null, createElement(Warning, {
|
|
40
41
|
actions: actions
|
|
41
|
-
}, messageHTML), createElement(RawHTML, null, originalUndelimitedContent));
|
|
42
|
+
}, messageHTML), createElement(RawHTML, null, safeHTML(originalUndelimitedContent)));
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
var MissingEdit = withDispatch(function (dispatch, _ref2) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/missing/edit.js"],"names":["__","sprintf","RawHTML","Button","getBlockType","createBlock","withDispatch","Warning","MissingBlockWarning","attributes","convertToHTML","originalName","originalUndelimitedContent","hasContent","hasHTMLBlock","actions","messageHTML","push","MissingEdit","dispatch","clientId","replaceBlock","content"],"mappings":";;AAAA;;;AAGA,SAASA,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,YAAT,EAAuBC,WAAvB,QAA0C,mBAA1C;AACA,SAASC,YAAT,QAA6B,iBAA7B;AACA,SAASC,OAAT,QAAwB,yBAAxB;;AAEA,SAASC,mBAAT,OAA8D;AAAA,MAA9BC,UAA8B,QAA9BA,UAA8B;AAAA,MAAlBC,aAAkB,QAAlBA,aAAkB;AAAA,MACrDC,YADqD,GACRF,UADQ,CACrDE,YADqD;AAAA,MACvCC,0BADuC,GACRH,UADQ,CACvCG,0BADuC;AAE7D,MAAMC,UAAU,GAAG,CAAC,CAAED,0BAAtB;AACA,MAAME,YAAY,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/missing/edit.js"],"names":["__","sprintf","RawHTML","Button","getBlockType","createBlock","withDispatch","Warning","safeHTML","MissingBlockWarning","attributes","convertToHTML","originalName","originalUndelimitedContent","hasContent","hasHTMLBlock","actions","messageHTML","push","MissingEdit","dispatch","clientId","replaceBlock","content"],"mappings":";;AAAA;;;AAGA,SAASA,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,YAAT,EAAuBC,WAAvB,QAA0C,mBAA1C;AACA,SAASC,YAAT,QAA6B,iBAA7B;AACA,SAASC,OAAT,QAAwB,yBAAxB;AACA,SAASC,QAAT,QAAyB,gBAAzB;;AAEA,SAASC,mBAAT,OAA8D;AAAA,MAA9BC,UAA8B,QAA9BA,UAA8B;AAAA,MAAlBC,aAAkB,QAAlBA,aAAkB;AAAA,MACrDC,YADqD,GACRF,UADQ,CACrDE,YADqD;AAAA,MACvCC,0BADuC,GACRH,UADQ,CACvCG,0BADuC;AAE7D,MAAMC,UAAU,GAAG,CAAC,CAAED,0BAAtB;AACA,MAAME,YAAY,GAAGX,YAAY,CAAE,WAAF,CAAjC;AAEA,MAAMY,OAAO,GAAG,EAAhB;AACA,MAAIC,WAAJ;;AACA,MAAKH,UAAU,IAAIC,YAAnB,EAAkC;AACjCE,IAAAA,WAAW,GAAGhB,OAAO;AACpB;AACAD,IAAAA,EAAE,CACD,2JADC,CAFkB,EAKpBY,YALoB,CAArB;AAOAI,IAAAA,OAAO,CAACE,IAAR,CACC,cAAC,MAAD;AAAQ,MAAA,GAAG,EAAC,SAAZ;AAAsB,MAAA,OAAO,EAAGP,aAAhC;AAAgD,MAAA,OAAO,MAAvD;AAAwD,MAAA,SAAS;AAAjE,OACGX,EAAE,CAAE,cAAF,CADL,CADD;AAKA,GAbD,MAaO;AACNiB,IAAAA,WAAW,GAAGhB,OAAO;AACpB;AACAD,IAAAA,EAAE,CACD,8GADC,CAFkB,EAKpBY,YALoB,CAArB;AAOA;;AAED,SACC,8BACC,cAAC,OAAD;AAAS,IAAA,OAAO,EAAGI;AAAnB,KAA+BC,WAA/B,CADD,EAEC,cAAC,OAAD,QAAWT,QAAQ,CAAEK,0BAAF,CAAnB,CAFD,CADD;AAMA;;AAED,IAAMM,WAAW,GAAGb,YAAY,CAAE,UAAEc,QAAF,SAA0C;AAAA,MAA5BC,QAA4B,SAA5BA,QAA4B;AAAA,MAAlBX,UAAkB,SAAlBA,UAAkB;;AAAA,kBAClDU,QAAQ,CAAE,mBAAF,CAD0C;AAAA,MACnEE,YADmE,aACnEA,YADmE;;AAE3E,SAAO;AACNX,IAAAA,aADM,2BACU;AACfW,MAAAA,YAAY,CACXD,QADW,EAEXhB,WAAW,CAAE,WAAF,EAAe;AACzBkB,QAAAA,OAAO,EAAEb,UAAU,CAACG;AADK,OAAf,CAFA,CAAZ;AAMA;AARK,GAAP;AAUA,CAZ+B,CAAZ,CAYfJ,mBAZe,CAApB;AAcA,eAAeU,WAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { RawHTML } from '@wordpress/element';\nimport { Button } from '@wordpress/components';\nimport { getBlockType, createBlock } from '@wordpress/blocks';\nimport { withDispatch } from '@wordpress/data';\nimport { Warning } from '@wordpress/block-editor';\nimport { safeHTML } from '@wordpress/dom';\n\nfunction MissingBlockWarning( { attributes, convertToHTML } ) {\n\tconst { originalName, originalUndelimitedContent } = attributes;\n\tconst hasContent = !! originalUndelimitedContent;\n\tconst hasHTMLBlock = getBlockType( 'core/html' );\n\n\tconst actions = [];\n\tlet messageHTML;\n\tif ( hasContent && hasHTMLBlock ) {\n\t\tmessageHTML = sprintf(\n\t\t\t/* translators: %s: block name */\n\t\t\t__(\n\t\t\t\t'Your site doesn’t include support for the \"%s\" block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely.'\n\t\t\t),\n\t\t\toriginalName\n\t\t);\n\t\tactions.push(\n\t\t\t<Button key=\"convert\" onClick={ convertToHTML } isLarge isPrimary>\n\t\t\t\t{ __( 'Keep as HTML' ) }\n\t\t\t</Button>\n\t\t);\n\t} else {\n\t\tmessageHTML = sprintf(\n\t\t\t/* translators: %s: block name */\n\t\t\t__(\n\t\t\t\t'Your site doesn’t include support for the \"%s\" block. You can leave this block intact or remove it entirely.'\n\t\t\t),\n\t\t\toriginalName\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Warning actions={ actions }>{ messageHTML }</Warning>\n\t\t\t<RawHTML>{ safeHTML( originalUndelimitedContent ) }</RawHTML>\n\t\t</>\n\t);\n}\n\nconst MissingEdit = withDispatch( ( dispatch, { clientId, attributes } ) => {\n\tconst { replaceBlock } = dispatch( 'core/block-editor' );\n\treturn {\n\t\tconvertToHTML() {\n\t\t\treplaceBlock(\n\t\t\t\tclientId,\n\t\t\t\tcreateBlock( 'core/html', {\n\t\t\t\t\tcontent: attributes.originalUndelimitedContent,\n\t\t\t\t} )\n\t\t\t);\n\t\t},\n\t};\n} )( MissingBlockWarning );\n\nexport default MissingEdit;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "2.22.
|
|
3
|
+
"version": "2.22.12",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
"@wordpress/api-fetch": "^3.18.0",
|
|
31
31
|
"@wordpress/autop": "^2.9.0",
|
|
32
32
|
"@wordpress/blob": "^2.9.0",
|
|
33
|
-
"@wordpress/block-editor": "^4.3.
|
|
34
|
-
"@wordpress/blocks": "^6.20.
|
|
35
|
-
"@wordpress/components": "^10.0.
|
|
33
|
+
"@wordpress/block-editor": "^4.3.10",
|
|
34
|
+
"@wordpress/blocks": "^6.20.5",
|
|
35
|
+
"@wordpress/components": "^10.0.8",
|
|
36
36
|
"@wordpress/compose": "^3.19.3",
|
|
37
|
-
"@wordpress/core-data": "^2.20.
|
|
37
|
+
"@wordpress/core-data": "^2.20.5",
|
|
38
38
|
"@wordpress/data": "^4.22.3",
|
|
39
39
|
"@wordpress/date": "^3.10.0",
|
|
40
40
|
"@wordpress/deprecated": "^2.9.0",
|
|
41
|
-
"@wordpress/dom": "^2.13.
|
|
42
|
-
"@wordpress/editor": "^9.20.
|
|
41
|
+
"@wordpress/dom": "^2.13.2",
|
|
42
|
+
"@wordpress/editor": "^9.20.10",
|
|
43
43
|
"@wordpress/element": "^2.16.0",
|
|
44
44
|
"@wordpress/escape-html": "^1.9.0",
|
|
45
45
|
"@wordpress/hooks": "^2.9.0",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"@wordpress/keycodes": "^2.14.0",
|
|
50
50
|
"@wordpress/notices": "^2.8.3",
|
|
51
51
|
"@wordpress/primitives": "^1.7.0",
|
|
52
|
-
"@wordpress/rich-text": "^3.20.
|
|
53
|
-
"@wordpress/server-side-render": "^1.16.
|
|
52
|
+
"@wordpress/rich-text": "^3.20.5",
|
|
53
|
+
"@wordpress/server-side-render": "^1.16.8",
|
|
54
54
|
"@wordpress/url": "^2.17.0",
|
|
55
55
|
"@wordpress/viewport": "^2.21.3",
|
|
56
56
|
"classnames": "^2.2.5",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "b47bcf6a4c7283cfda682efa92d677fd0f80138d"
|
|
68
68
|
}
|
package/src/missing/edit.js
CHANGED
|
@@ -7,6 +7,7 @@ import { Button } from '@wordpress/components';
|
|
|
7
7
|
import { getBlockType, createBlock } from '@wordpress/blocks';
|
|
8
8
|
import { withDispatch } from '@wordpress/data';
|
|
9
9
|
import { Warning } from '@wordpress/block-editor';
|
|
10
|
+
import { safeHTML } from '@wordpress/dom';
|
|
10
11
|
|
|
11
12
|
function MissingBlockWarning( { attributes, convertToHTML } ) {
|
|
12
13
|
const { originalName, originalUndelimitedContent } = attributes;
|
|
@@ -41,7 +42,7 @@ function MissingBlockWarning( { attributes, convertToHTML } ) {
|
|
|
41
42
|
return (
|
|
42
43
|
<>
|
|
43
44
|
<Warning actions={ actions }>{ messageHTML }</Warning>
|
|
44
|
-
<RawHTML>{ originalUndelimitedContent }</RawHTML>
|
|
45
|
+
<RawHTML>{ safeHTML( originalUndelimitedContent ) }</RawHTML>
|
|
45
46
|
</>
|
|
46
47
|
);
|
|
47
48
|
}
|
package/src/rss/index.php
CHANGED
|
@@ -16,7 +16,7 @@ function render_block_core_rss( $attributes ) {
|
|
|
16
16
|
$rss = fetch_feed( $attributes['feedURL'] );
|
|
17
17
|
|
|
18
18
|
if ( is_wp_error( $rss ) ) {
|
|
19
|
-
return '<div class="components-placeholder"><div class="notice notice-error"><strong>' . __( 'RSS Error:' ) . '</strong> ' . $rss->get_error_message() . '</div></div>';
|
|
19
|
+
return '<div class="components-placeholder"><div class="notice notice-error"><strong>' . __( 'RSS Error:' ) . '</strong> ' . esc_html( $rss->get_error_message() ) . '</div></div>';
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
if ( ! $rss->get_item_quantity() ) {
|
|
@@ -44,8 +44,8 @@ function render_block_core_rss( $attributes ) {
|
|
|
44
44
|
if ( $date ) {
|
|
45
45
|
$date = sprintf(
|
|
46
46
|
'<time datetime="%1$s" class="wp-block-rss__item-publish-date">%2$s</time> ',
|
|
47
|
-
date_i18n( get_option( 'c' ), $date ),
|
|
48
|
-
date_i18n( get_option( 'date_format' ), $date )
|
|
47
|
+
esc_attr( date_i18n( get_option( 'c' ), $date ) ),
|
|
48
|
+
esc_attr( date_i18n( get_option( 'date_format' ), $date ) )
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
}
|