@wordpress/block-library 2.4.9 → 2.4.13

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/README.md CHANGED
@@ -30,6 +30,7 @@ import { registerCoreBlocks } from '@wordpress/block-library';
30
30
  registerCoreBlocks();
31
31
  ```
32
32
 
33
+
33
34
  <!-- END TOKEN(Autogenerated API docs) -->
34
35
 
35
36
  <br/><br/><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>
@@ -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
  */
@@ -44,7 +46,7 @@ function MissingBlockWarning(_ref) {
44
46
 
45
47
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.Warning, {
46
48
  actions: actions
47
- }, messageHTML), (0, _element.createElement)(_element.RawHTML, null, originalUndelimitedContent));
49
+ }, messageHTML), (0, _element.createElement)(_element.RawHTML, null, (0, _dom.safeHTML)(originalUndelimitedContent)));
48
50
  }
49
51
 
50
52
  var edit = (0, _data.withDispatch)(function (dispatch, _ref2) {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/missing/index.js"],"names":["MissingBlockWarning","attributes","convertToHTML","originalName","originalUndelimitedContent","hasContent","hasHTMLBlock","actions","messageHTML","push","edit","dispatch","clientId","replaceBlock","content","name","settings","category","title","description","supports","className","customClassName","inserter","html","reusable","type","originalContent","source","save"],"mappings":";;;;;;;AAIA;;AADA;;AAEA;;AACA;;AACA;;AACA;;AARA;;;AAUA,SAASA,mBAAT,OAA8D;AAAA,MAA9BC,UAA8B,QAA9BA,UAA8B;AAAA,MAAlBC,aAAkB,QAAlBA,aAAkB;AAAA,MACrDC,YADqD,GACRF,UADQ,CACrDE,YADqD;AAAA,MACvCC,0BADuC,GACRH,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,EAAAA,QAAQ,EAAE,QAFa;AAGvBC,EAAAA,KAAK,EAAE,cAAI,oBAAJ,CAHgB;AAIvBC,EAAAA,WAAW,EAAE,cAAI,mDAAJ,CAJU;AAMvBC,EAAAA,QAAQ,EAAE;AACTC,IAAAA,SAAS,EAAE,KADF;AAETC,IAAAA,eAAe,EAAE,KAFR;AAGTC,IAAAA,QAAQ,EAAE,KAHD;AAITC,IAAAA,IAAI,EAAE,KAJG;AAKTC,IAAAA,QAAQ,EAAE;AALD,GANa;AAcvBxB,EAAAA,UAAU,EAAE;AACXE,IAAAA,YAAY,EAAE;AACbuB,MAAAA,IAAI,EAAE;AADO,KADH;AAIXtB,IAAAA,0BAA0B,EAAE;AAC3BsB,MAAAA,IAAI,EAAE;AADqB,KAJjB;AAOXC,IAAAA,eAAe,EAAE;AAChBD,MAAAA,IAAI,EAAE,QADU;AAEhBE,MAAAA,MAAM,EAAE;AAFQ;AAPN,GAdW;AA2BvBlB,EAAAA,IAAI,EAAJA,IA3BuB;AA4BvBmB,EAAAA,IA5BuB,uBA4BA;AAAA,QAAf5B,UAAe,SAAfA,UAAe;AACtB;AACA,WAAO,4BAAC,gBAAD,QAAWA,UAAU,CAAC0B,eAAtB,CAAP;AACA;AA/BsB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { RawHTML, Fragment } 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';\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__( '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\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__( 'Your site doesn’t include support for the \"%s\" block. You can leave this block intact or remove it entirely.' ),\n\t\t\toriginalName\n\t\t);\n\t}\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Warning actions={ actions }>\n\t\t\t\t{ messageHTML }\n\t\t\t</Warning>\n\t\t\t<RawHTML>{ originalUndelimitedContent }</RawHTML>\n\t\t</Fragment>\n\t);\n}\n\nconst edit = withDispatch( ( dispatch, { clientId, attributes } ) => {\n\tconst { replaceBlock } = dispatch( 'core/block-editor' );\n\treturn {\n\t\tconvertToHTML() {\n\t\t\treplaceBlock( clientId, createBlock( 'core/html', {\n\t\t\t\tcontent: attributes.originalUndelimitedContent,\n\t\t\t} ) );\n\t\t},\n\t};\n} )( MissingBlockWarning );\n\nexport const name = 'core/missing';\n\nexport const settings = {\n\tname,\n\tcategory: 'common',\n\ttitle: __( 'Unrecognized Block' ),\n\tdescription: __( 'Your site doesn’t include support for this block.' ),\n\n\tsupports: {\n\t\tclassName: false,\n\t\tcustomClassName: false,\n\t\tinserter: false,\n\t\thtml: false,\n\t\treusable: false,\n\t},\n\n\tattributes: {\n\t\toriginalName: {\n\t\t\ttype: 'string',\n\t\t},\n\t\toriginalUndelimitedContent: {\n\t\t\ttype: 'string',\n\t\t},\n\t\toriginalContent: {\n\t\t\ttype: 'string',\n\t\t\tsource: 'html',\n\t\t},\n\t},\n\n\tedit,\n\tsave( { attributes } ) {\n\t\t// Preserve the missing block's content.\n\t\treturn <RawHTML>{ attributes.originalContent }</RawHTML>;\n\t},\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/missing/index.js"],"names":["MissingBlockWarning","attributes","convertToHTML","originalName","originalUndelimitedContent","hasContent","hasHTMLBlock","actions","messageHTML","push","edit","dispatch","clientId","replaceBlock","content","name","settings","category","title","description","supports","className","customClassName","inserter","html","reusable","type","originalContent","source","save"],"mappings":";;;;;;;AAIA;;AADA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AATA;;;AAWA,SAASA,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,GAAG,0BAAc,WAAd,CAArB;AAEA,MAAMC,OAAO,GAAG,EAAhB;AACA,MAAIC,WAAJ;;AACA,MAAKH,UAAU,IAAIC,YAAnB,EAAkC;AACjCE,IAAAA,WAAW,GAAG,mBACb,cAAI,2JAAJ,CADa,EAEbL,YAFa,CAAd;AAIAI,IAAAA,OAAO,CAACE,IAAR,CACC,4BAAC,kBAAD;AAAQ,MAAA,GAAG,EAAC,SAAZ;AAAsB,MAAA,OAAO,EAAGP,aAAhC;AAAgD,MAAA,OAAO,MAAvD;AAAwD,MAAA,SAAS;AAAjE,OACG,cAAI,cAAJ,CADH,CADD;AAKA,GAVD,MAUO;AACNM,IAAAA,WAAW,GAAG,mBACb,cAAI,8GAAJ,CADa,EAEbL,YAFa,CAAd;AAIA;;AAED,SACC,4BAAC,iBAAD,QACC,4BAAC,oBAAD;AAAS,IAAA,OAAO,EAAGI;AAAnB,KACGC,WADH,CADD,EAIC,4BAAC,gBAAD,QAAW,mBAAUJ,0BAAV,CAAX,CAJD,CADD;AAQA;;AAED,IAAMM,IAAI,GAAG,wBAAc,UAAEC,QAAF,SAA0C;AAAA,MAA5BC,QAA4B,SAA5BA,QAA4B;AAAA,MAAlBX,UAAkB,SAAlBA,UAAkB;;AAAA,kBAC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Fragment } 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__( '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\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__( 'Your site doesn’t include support for the \"%s\" block. You can leave this block intact or remove it entirely.' ),\n\t\t\toriginalName\n\t\t);\n\t}\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Warning actions={ actions }>\n\t\t\t\t{ messageHTML }\n\t\t\t</Warning>\n\t\t\t<RawHTML>{ safeHTML( originalUndelimitedContent ) }</RawHTML>\n\t\t</Fragment>\n\t);\n}\n\nconst edit = withDispatch( ( dispatch, { clientId, attributes } ) => {\n\tconst { replaceBlock } = dispatch( 'core/block-editor' );\n\treturn {\n\t\tconvertToHTML() {\n\t\t\treplaceBlock( clientId, createBlock( 'core/html', {\n\t\t\t\tcontent: attributes.originalUndelimitedContent,\n\t\t\t} ) );\n\t\t},\n\t};\n} )( MissingBlockWarning );\n\nexport const name = 'core/missing';\n\nexport const settings = {\n\tname,\n\tcategory: 'common',\n\ttitle: __( 'Unrecognized Block' ),\n\tdescription: __( 'Your site doesn’t include support for this block.' ),\n\n\tsupports: {\n\t\tclassName: false,\n\t\tcustomClassName: false,\n\t\tinserter: false,\n\t\thtml: false,\n\t\treusable: false,\n\t},\n\n\tattributes: {\n\t\toriginalName: {\n\t\t\ttype: 'string',\n\t\t},\n\t\toriginalUndelimitedContent: {\n\t\t\ttype: 'string',\n\t\t},\n\t\toriginalContent: {\n\t\t\ttype: 'string',\n\t\t\tsource: 'html',\n\t\t},\n\t},\n\n\tedit,\n\tsave( { attributes } ) {\n\t\t// Preserve the missing block's content.\n\t\treturn <RawHTML>{ attributes.originalContent }</RawHTML>;\n\t},\n};\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,
@@ -34,7 +35,7 @@ function MissingBlockWarning(_ref) {
34
35
 
35
36
  return createElement(Fragment, null, createElement(Warning, {
36
37
  actions: actions
37
- }, messageHTML), createElement(RawHTML, null, originalUndelimitedContent));
38
+ }, messageHTML), createElement(RawHTML, null, safeHTML(originalUndelimitedContent)));
38
39
  }
39
40
 
40
41
  var edit = withDispatch(function (dispatch, _ref2) {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/missing/index.js"],"names":["__","sprintf","RawHTML","Fragment","Button","getBlockType","createBlock","withDispatch","Warning","MissingBlockWarning","attributes","convertToHTML","originalName","originalUndelimitedContent","hasContent","hasHTMLBlock","actions","messageHTML","push","edit","dispatch","clientId","replaceBlock","content","name","settings","category","title","description","supports","className","customClassName","inserter","html","reusable","type","originalContent","source","save"],"mappings":";;AAAA;;;AAGA,SAASA,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,OAAT,EAAkBC,QAAlB,QAAkC,oBAAlC;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,YAAT,EA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D;;AAEpE,SAAO;AACNX,IAAAA,aADM,2BACU;AACfW,MAAAA,YAAY,CAAED,QAAF,EAAYf,WAAW,CAAE,WAAF,EAAe;AACjDiB,QAAAA,OAAO,EAAEb,UAAU,CAACG;AAD6B,OAAf,CAAvB,CAAZ;AAGA;AALK,GAAP;AAOA,CATwB,CAAZ,CASRJ,mBATQ,CAAb;AAWA,OAAO,IAAMe,IAAI,GAAG,cAAb;AAEP,OAAO,IAAMC,QAAQ,GAAG;AACvBD,EAAAA,IAAI,EAAJA,IADuB;AAEvBE,EAAAA,QAAQ,EAAE,QAFa;AAGvBC,EAAAA,KAAK,EAAE3B,EAAE,CAAE,oBAAF,CAHc;AAIvB4B,EAAAA,WAAW,EAAE5B,EAAE,CAAE,mDAAF,CAJQ;AAMvB6B,EAAAA,QAAQ,EAAE;AACTC,IAAAA,SAAS,EAAE,KADF;AAETC,IAAAA,eAAe,EAAE,KAFR;AAGTC,IAAAA,QAAQ,EAAE,KAHD;AAITC,IAAAA,IAAI,EAAE,KAJG;AAKTC,IAAAA,QAAQ,EAAE;AALD,GANa;AAcvBxB,EAAAA,UAAU,EAAE;AACXE,IAAAA,YAAY,EAAE;AACbuB,MAAAA,IAAI,EAAE;AADO,KADH;AAIXtB,IAAAA,0BAA0B,EAAE;AAC3BsB,MAAAA,IAAI,EAAE;AADqB,KAJjB;AAOXC,IAAAA,eAAe,EAAE;AAChBD,MAAAA,IAAI,EAAE,QADU;AAEhBE,MAAAA,MAAM,EAAE;AAFQ;AAPN,GAdW;AA2BvBlB,EAAAA,IAAI,EAAJA,IA3BuB;AA4BvBmB,EAAAA,IA5BuB,uBA4BA;AAAA,QAAf5B,UAAe,SAAfA,UAAe;AACtB;AACA,WAAO,cAAC,OAAD,QAAWA,UAAU,CAAC0B,eAAtB,CAAP;AACA;AA/BsB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { RawHTML, Fragment } 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';\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__( '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\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__( 'Your site doesn’t include support for the \"%s\" block. You can leave this block intact or remove it entirely.' ),\n\t\t\toriginalName\n\t\t);\n\t}\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Warning actions={ actions }>\n\t\t\t\t{ messageHTML }\n\t\t\t</Warning>\n\t\t\t<RawHTML>{ originalUndelimitedContent }</RawHTML>\n\t\t</Fragment>\n\t);\n}\n\nconst edit = withDispatch( ( dispatch, { clientId, attributes } ) => {\n\tconst { replaceBlock } = dispatch( 'core/block-editor' );\n\treturn {\n\t\tconvertToHTML() {\n\t\t\treplaceBlock( clientId, createBlock( 'core/html', {\n\t\t\t\tcontent: attributes.originalUndelimitedContent,\n\t\t\t} ) );\n\t\t},\n\t};\n} )( MissingBlockWarning );\n\nexport const name = 'core/missing';\n\nexport const settings = {\n\tname,\n\tcategory: 'common',\n\ttitle: __( 'Unrecognized Block' ),\n\tdescription: __( 'Your site doesn’t include support for this block.' ),\n\n\tsupports: {\n\t\tclassName: false,\n\t\tcustomClassName: false,\n\t\tinserter: false,\n\t\thtml: false,\n\t\treusable: false,\n\t},\n\n\tattributes: {\n\t\toriginalName: {\n\t\t\ttype: 'string',\n\t\t},\n\t\toriginalUndelimitedContent: {\n\t\t\ttype: 'string',\n\t\t},\n\t\toriginalContent: {\n\t\t\ttype: 'string',\n\t\t\tsource: 'html',\n\t\t},\n\t},\n\n\tedit,\n\tsave( { attributes } ) {\n\t\t// Preserve the missing block's content.\n\t\treturn <RawHTML>{ attributes.originalContent }</RawHTML>;\n\t},\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/missing/index.js"],"names":["__","sprintf","RawHTML","Fragment","Button","getBlockType","createBlock","withDispatch","Warning","safeHTML","MissingBlockWarning","attributes","convertToHTML","originalName","originalUndelimitedContent","hasContent","hasHTMLBlock","actions","messageHTML","push","edit","dispatch","clientId","replaceBlock","content","name","settings","category","title","description","supports","className","customClassName","inserter","html","reusable","type","originalContent","source","save"],"mappings":";;AAAA;;;AAGA,SAASA,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,OAAT,EAAkBC,QAAlB,QAAkC,oBAAlC;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,WAA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CAJQ;AAMvB8B,EAAAA,QAAQ,EAAE;AACTC,IAAAA,SAAS,EAAE,KADF;AAETC,IAAAA,eAAe,EAAE,KAFR;AAGTC,IAAAA,QAAQ,EAAE,KAHD;AAITC,IAAAA,IAAI,EAAE,KAJG;AAKTC,IAAAA,QAAQ,EAAE;AALD,GANa;AAcvBxB,EAAAA,UAAU,EAAE;AACXE,IAAAA,YAAY,EAAE;AACbuB,MAAAA,IAAI,EAAE;AADO,KADH;AAIXtB,IAAAA,0BAA0B,EAAE;AAC3BsB,MAAAA,IAAI,EAAE;AADqB,KAJjB;AAOXC,IAAAA,eAAe,EAAE;AAChBD,MAAAA,IAAI,EAAE,QADU;AAEhBE,MAAAA,MAAM,EAAE;AAFQ;AAPN,GAdW;AA2BvBlB,EAAAA,IAAI,EAAJA,IA3BuB;AA4BvBmB,EAAAA,IA5BuB,uBA4BA;AAAA,QAAf5B,UAAe,SAAfA,UAAe;AACtB;AACA,WAAO,cAAC,OAAD,QAAWA,UAAU,CAAC0B,eAAtB,CAAP;AACA;AA/BsB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { RawHTML, Fragment } 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__( '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\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__( 'Your site doesn’t include support for the \"%s\" block. You can leave this block intact or remove it entirely.' ),\n\t\t\toriginalName\n\t\t);\n\t}\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Warning actions={ actions }>\n\t\t\t\t{ messageHTML }\n\t\t\t</Warning>\n\t\t\t<RawHTML>{ safeHTML( originalUndelimitedContent ) }</RawHTML>\n\t\t</Fragment>\n\t);\n}\n\nconst edit = withDispatch( ( dispatch, { clientId, attributes } ) => {\n\tconst { replaceBlock } = dispatch( 'core/block-editor' );\n\treturn {\n\t\tconvertToHTML() {\n\t\t\treplaceBlock( clientId, createBlock( 'core/html', {\n\t\t\t\tcontent: attributes.originalUndelimitedContent,\n\t\t\t} ) );\n\t\t},\n\t};\n} )( MissingBlockWarning );\n\nexport const name = 'core/missing';\n\nexport const settings = {\n\tname,\n\tcategory: 'common',\n\ttitle: __( 'Unrecognized Block' ),\n\tdescription: __( 'Your site doesn’t include support for this block.' ),\n\n\tsupports: {\n\t\tclassName: false,\n\t\tcustomClassName: false,\n\t\tinserter: false,\n\t\thtml: false,\n\t\treusable: false,\n\t},\n\n\tattributes: {\n\t\toriginalName: {\n\t\t\ttype: 'string',\n\t\t},\n\t\toriginalUndelimitedContent: {\n\t\t\ttype: 'string',\n\t\t},\n\t\toriginalContent: {\n\t\t\ttype: 'string',\n\t\t\tsource: 'html',\n\t\t},\n\t},\n\n\tedit,\n\tsave( { attributes } ) {\n\t\t// Preserve the missing block's content.\n\t\treturn <RawHTML>{ attributes.originalContent }</RawHTML>;\n\t},\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "2.4.9",
3
+ "version": "2.4.13",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -24,14 +24,14 @@
24
24
  "@babel/runtime": "^7.3.1",
25
25
  "@wordpress/autop": "^2.2.0",
26
26
  "@wordpress/blob": "^2.3.0",
27
- "@wordpress/block-editor": "^2.0.3",
28
- "@wordpress/blocks": "^6.2.5",
29
- "@wordpress/components": "^7.3.2",
27
+ "@wordpress/block-editor": "^2.0.6",
28
+ "@wordpress/blocks": "^6.2.8",
29
+ "@wordpress/components": "^7.3.5",
30
30
  "@wordpress/compose": "^3.2.0",
31
31
  "@wordpress/core-data": "^2.2.2",
32
32
  "@wordpress/data": "^4.4.0",
33
33
  "@wordpress/deprecated": "^2.2.0",
34
- "@wordpress/editor": "^9.2.6",
34
+ "@wordpress/editor": "^9.2.9",
35
35
  "@wordpress/element": "^2.3.0",
36
36
  "@wordpress/html-entities": "^2.2.0",
37
37
  "@wordpress/i18n": "^3.3.0",
@@ -46,5 +46,5 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "ecf77c7acb7d3680e71f34c01899c5670153e61f"
49
+ "gitHead": "5d66b8bb933093e92fc631b33e11b9e9c02fdfdd"
50
50
  }
@@ -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;
@@ -37,7 +38,7 @@ function MissingBlockWarning( { attributes, convertToHTML } ) {
37
38
  <Warning actions={ actions }>
38
39
  { messageHTML }
39
40
  </Warning>
40
- <RawHTML>{ originalUndelimitedContent }</RawHTML>
41
+ <RawHTML>{ safeHTML( originalUndelimitedContent ) }</RawHTML>
41
42
  </Fragment>
42
43
  );
43
44
  }
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() ) {
@@ -48,8 +48,8 @@ function render_block_core_rss( $attributes ) {
48
48
  if ( $date ) {
49
49
  $date = sprintf(
50
50
  '<time datetime="%1$s" class="wp-block-rss__item-publish-date">%2$s</time> ',
51
- date_i18n( get_option( 'c' ), $date ),
52
- date_i18n( get_option( 'date_format' ), $date )
51
+ esc_attr( date_i18n( get_option( 'c' ), $date ) ),
52
+ esc_attr( date_i18n( get_option( 'date_format' ), $date ) )
53
53
  );
54
54
  }
55
55
  }