@wordpress/block-library 2.28.9 → 2.28.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
|
*/
|
|
@@ -47,7 +49,7 @@ function MissingBlockWarning(_ref) {
|
|
|
47
49
|
|
|
48
50
|
return (0, _element.createElement)("div", (0, _blockEditor.useBlockProps)(), (0, _element.createElement)(_blockEditor.Warning, {
|
|
49
51
|
actions: actions
|
|
50
|
-
}, messageHTML), (0, _element.createElement)(_element.RawHTML, null, originalUndelimitedContent));
|
|
52
|
+
}, messageHTML), (0, _element.createElement)(_element.RawHTML, null, (0, _dom.safeHTML)(originalUndelimitedContent)));
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
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;AACA;AACA;AASA,SAASA,mBAAT,OAA8D;AAAA,MAA9BC,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YfJ,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, useBlockProps } 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 } 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<div { ...useBlockProps() }>\n\t\t\t<Warning actions={ actions }>{ messageHTML }</Warning>\n\t\t\t<RawHTML>{ safeHTML( originalUndelimitedContent ) }</RawHTML>\n\t\t</div>\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, useBlockProps } from '@wordpress/block-editor';
|
|
12
|
+
import { safeHTML } from '@wordpress/dom';
|
|
12
13
|
|
|
13
14
|
function MissingBlockWarning(_ref) {
|
|
14
15
|
var attributes = _ref.attributes,
|
|
@@ -37,7 +38,7 @@ function MissingBlockWarning(_ref) {
|
|
|
37
38
|
|
|
38
39
|
return createElement("div", useBlockProps(), createElement(Warning, {
|
|
39
40
|
actions: actions
|
|
40
|
-
}, messageHTML), createElement(RawHTML, null, originalUndelimitedContent));
|
|
41
|
+
}, messageHTML), createElement(RawHTML, null, safeHTML(originalUndelimitedContent)));
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
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","useBlockProps","MissingBlockWarning","attributes","convertToHTML","originalName","originalUndelimitedContent","hasContent","hasHTMLBlock","actions","messageHTML","push","MissingEdit","dispatch","clientId","replaceBlock","content"],"mappings":";;AAAA;AACA;AACA;AACA,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,EAAkBC,aAAlB,QAAuC,yBAAvC;;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","useBlockProps","safeHTML","MissingBlockWarning","attributes","convertToHTML","originalName","originalUndelimitedContent","hasContent","hasHTMLBlock","actions","messageHTML","push","MissingEdit","dispatch","clientId","replaceBlock","content"],"mappings":";;AAAA;AACA;AACA;AACA,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,EAAkBC,aAAlB,QAAuC,yBAAvC;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,GAAGZ,YAAY,CAAE,WAAF,CAAjC;AAEA,MAAMa,OAAO,GAAG,EAAhB;AACA,MAAIC,WAAJ;;AACA,MAAKH,UAAU,IAAIC,YAAnB,EAAkC;AACjCE,IAAAA,WAAW,GAAGjB,OAAO;AACpB;AACAD,IAAAA,EAAE,CACD,2JADC,CAFkB,EAKpBa,YALoB,CAArB;AAOAI,IAAAA,OAAO,CAACE,IAAR,CACC,cAAC,MAAD;AAAQ,MAAA,GAAG,EAAC,SAAZ;AAAsB,MAAA,OAAO,EAAGP,aAAhC;AAAgD,MAAA,SAAS;AAAzD,OACGZ,EAAE,CAAE,cAAF,CADL,CADD;AAKA,GAbD,MAaO;AACNkB,IAAAA,WAAW,GAAGjB,OAAO;AACpB;AACAD,IAAAA,EAAE,CACD,8GADC,CAFkB,EAKpBa,YALoB,CAArB;AAOA;;AAED,SACC,qBAAUL,aAAa,EAAvB,EACC,cAAC,OAAD;AAAS,IAAA,OAAO,EAAGS;AAAnB,KAA+BC,WAA/B,CADD,EAEC,cAAC,OAAD,QAAWT,QAAQ,CAAEK,0BAAF,CAAnB,CAFD,CADD;AAMA;;AAED,IAAMM,WAAW,GAAGd,YAAY,CAAE,UAAEe,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,EAEXjB,WAAW,CAAE,WAAF,EAAe;AACzBmB,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, useBlockProps } 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 } 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<div { ...useBlockProps() }>\n\t\t\t<Warning actions={ actions }>{ messageHTML }</Warning>\n\t\t\t<RawHTML>{ safeHTML( originalUndelimitedContent ) }</RawHTML>\n\t\t</div>\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.28.
|
|
3
|
+
"version": "2.28.12",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -28,19 +28,19 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@babel/runtime": "^7.12.5",
|
|
30
30
|
"@wordpress/a11y": "^2.14.3",
|
|
31
|
-
"@wordpress/api-fetch": "^3.21.
|
|
31
|
+
"@wordpress/api-fetch": "^3.21.6",
|
|
32
32
|
"@wordpress/autop": "^2.11.1",
|
|
33
33
|
"@wordpress/blob": "^2.12.1",
|
|
34
|
-
"@wordpress/block-editor": "^5.2.
|
|
35
|
-
"@wordpress/blocks": "^7.0.
|
|
36
|
-
"@wordpress/components": "^12.0.
|
|
37
|
-
"@wordpress/compose": "^3.24.
|
|
38
|
-
"@wordpress/core-data": "^2.25.
|
|
39
|
-
"@wordpress/data": "^4.26.
|
|
34
|
+
"@wordpress/block-editor": "^5.2.13",
|
|
35
|
+
"@wordpress/blocks": "^7.0.7",
|
|
36
|
+
"@wordpress/components": "^12.0.9",
|
|
37
|
+
"@wordpress/compose": "^3.24.6",
|
|
38
|
+
"@wordpress/core-data": "^2.25.11",
|
|
39
|
+
"@wordpress/data": "^4.26.9",
|
|
40
40
|
"@wordpress/date": "^3.13.1",
|
|
41
41
|
"@wordpress/deprecated": "^2.11.1",
|
|
42
|
-
"@wordpress/dom": "^2.16.
|
|
43
|
-
"@wordpress/editor": "^9.25.
|
|
42
|
+
"@wordpress/dom": "^2.16.3",
|
|
43
|
+
"@wordpress/editor": "^9.25.14",
|
|
44
44
|
"@wordpress/element": "^2.19.1",
|
|
45
45
|
"@wordpress/escape-html": "^1.11.1",
|
|
46
46
|
"@wordpress/hooks": "^2.11.1",
|
|
@@ -48,13 +48,13 @@
|
|
|
48
48
|
"@wordpress/icons": "^2.9.1",
|
|
49
49
|
"@wordpress/is-shallow-equal": "^3.0.1",
|
|
50
50
|
"@wordpress/keycodes": "^2.18.3",
|
|
51
|
-
"@wordpress/notices": "^2.12.
|
|
51
|
+
"@wordpress/notices": "^2.12.9",
|
|
52
52
|
"@wordpress/primitives": "^1.11.1",
|
|
53
|
-
"@wordpress/reusable-blocks": "^1.1.
|
|
54
|
-
"@wordpress/rich-text": "^3.24.
|
|
55
|
-
"@wordpress/server-side-render": "^1.20.
|
|
56
|
-
"@wordpress/url": "^2.21.
|
|
57
|
-
"@wordpress/viewport": "^2.25.
|
|
53
|
+
"@wordpress/reusable-blocks": "^1.1.13",
|
|
54
|
+
"@wordpress/rich-text": "^3.24.9",
|
|
55
|
+
"@wordpress/server-side-render": "^1.20.10",
|
|
56
|
+
"@wordpress/url": "^2.21.3",
|
|
57
|
+
"@wordpress/viewport": "^2.25.9",
|
|
58
58
|
"classnames": "^2.2.5",
|
|
59
59
|
"fast-average-color": "4.3.0",
|
|
60
60
|
"lodash": "^4.17.19",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"access": "public"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "14a64efc7cf32f4d37400902a7c1cbb822bc5c2f"
|
|
70
70
|
}
|
|
@@ -134,6 +134,10 @@ function render_block_core_latest_posts( $attributes ) {
|
|
|
134
134
|
|
|
135
135
|
$trimmed_excerpt = get_the_excerpt( $post );
|
|
136
136
|
|
|
137
|
+
if ( post_password_required( $post ) ) {
|
|
138
|
+
$trimmed_excerpt = __( 'This content is password protected.' );
|
|
139
|
+
}
|
|
140
|
+
|
|
137
141
|
$list_items_markup .= sprintf(
|
|
138
142
|
'<div class="wp-block-latest-posts__post-excerpt">%1$s</div>',
|
|
139
143
|
$trimmed_excerpt
|
|
@@ -142,9 +146,16 @@ function render_block_core_latest_posts( $attributes ) {
|
|
|
142
146
|
|
|
143
147
|
if ( isset( $attributes['displayPostContent'] ) && $attributes['displayPostContent']
|
|
144
148
|
&& isset( $attributes['displayPostContentRadio'] ) && 'full_post' === $attributes['displayPostContentRadio'] ) {
|
|
149
|
+
|
|
150
|
+
$post_content = wp_kses_post( html_entity_decode( $post->post_content, ENT_QUOTES, get_option( 'blog_charset' ) ) );
|
|
151
|
+
|
|
152
|
+
if ( post_password_required( $post ) ) {
|
|
153
|
+
$post_content = __( 'This content is password protected.' );
|
|
154
|
+
}
|
|
155
|
+
|
|
145
156
|
$list_items_markup .= sprintf(
|
|
146
157
|
'<div class="wp-block-latest-posts__post-full-content">%1$s</div>',
|
|
147
|
-
|
|
158
|
+
$post_content
|
|
148
159
|
);
|
|
149
160
|
}
|
|
150
161
|
|
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, useBlockProps } 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
|
<div { ...useBlockProps() }>
|
|
43
44
|
<Warning actions={ actions }>{ messageHTML }</Warning>
|
|
44
|
-
<RawHTML>{ originalUndelimitedContent }</RawHTML>
|
|
45
|
+
<RawHTML>{ safeHTML( originalUndelimitedContent ) }</RawHTML>
|
|
45
46
|
</div>
|
|
46
47
|
);
|
|
47
48
|
}
|