@wordpress/list-reusable-blocks 4.3.2 → 4.3.4

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/index.js CHANGED
@@ -50,8 +50,8 @@ document.addEventListener('DOMContentLoaded', () => {
50
50
  const container = document.createElement('div');
51
51
  container.className = 'list-reusable-blocks__container';
52
52
  button.parentNode.insertBefore(container, button);
53
- (0, _element.render)((0, _element.createElement)(_importDropdown.default, {
53
+ (0, _element.createRoot)(container).render((0, _element.createElement)(_importDropdown.default, {
54
54
  onUpload: showNotice
55
- }), container);
55
+ }));
56
56
  });
57
57
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/list-reusable-blocks/src/index.js"],"names":["document","body","addEventListener","event","target","classList","contains","preventDefault","dataset","id","button","querySelector","showNotice","notice","createElement","className","innerHTML","headerEnd","parentNode","insertBefore","container"],"mappings":";;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AAIA;AACAA,QAAQ,CAACC,IAAT,CAAcC,gBAAd,CAAgC,OAAhC,EAA2CC,KAAF,IAAa;AACrD,MACC,CAAEA,KAAK,CAACC,MAAN,CAAaC,SAAb,CAAuBC,QAAvB,CAAiC,iCAAjC,CADH,EAEE;AACD;AACA;;AACDH,EAAAA,KAAK,CAACI,cAAN;AACA,uBAAqBJ,KAAK,CAACC,MAAN,CAAaI,OAAb,CAAqBC,EAA1C;AACA,CARD,E,CAUA;;AACAT,QAAQ,CAACE,gBAAT,CAA2B,kBAA3B,EAA+C,MAAM;AACpD,QAAMQ,MAAM,GAAGV,QAAQ,CAACW,aAAT,CAAwB,oBAAxB,CAAf;;AACA,MAAK,CAAED,MAAP,EAAgB;AACf;AACA;;AAED,QAAME,UAAU,GAAG,MAAM;AACxB,UAAMC,MAAM,GAAGb,QAAQ,CAACc,aAAT,CAAwB,KAAxB,CAAf;AACAD,IAAAA,MAAM,CAACE,SAAP,GAAmB,sCAAnB;AACAF,IAAAA,MAAM,CAACG,SAAP,GAAoB,MAAM,cACzB,uCADyB,CAEvB,MAFH;AAIA,UAAMC,SAAS,GAAGjB,QAAQ,CAACW,aAAT,CAAwB,gBAAxB,CAAlB;;AACA,QAAK,CAAEM,SAAP,EAAmB;AAClB;AACA;;AACDA,IAAAA,SAAS,CAACC,UAAV,CAAqBC,YAArB,CAAmCN,MAAnC,EAA2CI,SAA3C;AACA,GAZD;;AAcA,QAAMG,SAAS,GAAGpB,QAAQ,CAACc,aAAT,CAAwB,KAAxB,CAAlB;AACAM,EAAAA,SAAS,CAACL,SAAV,GAAsB,iCAAtB;AACAL,EAAAA,MAAM,CAACQ,UAAP,CAAkBC,YAAlB,CAAgCC,SAAhC,EAA2CV,MAA3C;AACA,uBAAQ,4BAAC,uBAAD;AAAgB,IAAA,QAAQ,EAAGE;AAA3B,IAAR,EAAoDQ,SAApD;AACA,CAxBD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { render } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport exportReusableBlock from './utils/export';\nimport ImportDropdown from './components/import-dropdown';\n\n// Setup Export Links.\ndocument.body.addEventListener( 'click', ( event ) => {\n\tif (\n\t\t! event.target.classList.contains( 'wp-list-reusable-blocks__export' )\n\t) {\n\t\treturn;\n\t}\n\tevent.preventDefault();\n\texportReusableBlock( event.target.dataset.id );\n} );\n\n// Setup Import Form.\ndocument.addEventListener( 'DOMContentLoaded', () => {\n\tconst button = document.querySelector( '.page-title-action' );\n\tif ( ! button ) {\n\t\treturn;\n\t}\n\n\tconst showNotice = () => {\n\t\tconst notice = document.createElement( 'div' );\n\t\tnotice.className = 'notice notice-success is-dismissible';\n\t\tnotice.innerHTML = `<p>${ __(\n\t\t\t'Reusable block imported successfully!'\n\t\t) }</p>`;\n\n\t\tconst headerEnd = document.querySelector( '.wp-header-end' );\n\t\tif ( ! headerEnd ) {\n\t\t\treturn;\n\t\t}\n\t\theaderEnd.parentNode.insertBefore( notice, headerEnd );\n\t};\n\n\tconst container = document.createElement( 'div' );\n\tcontainer.className = 'list-reusable-blocks__container';\n\tbutton.parentNode.insertBefore( container, button );\n\trender( <ImportDropdown onUpload={ showNotice } />, container );\n} );\n"]}
1
+ {"version":3,"sources":["@wordpress/list-reusable-blocks/src/index.js"],"names":["document","body","addEventListener","event","target","classList","contains","preventDefault","dataset","id","button","querySelector","showNotice","notice","createElement","className","innerHTML","headerEnd","parentNode","insertBefore","container","render"],"mappings":";;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AAIA;AACAA,QAAQ,CAACC,IAAT,CAAcC,gBAAd,CAAgC,OAAhC,EAA2CC,KAAF,IAAa;AACrD,MACC,CAAEA,KAAK,CAACC,MAAN,CAAaC,SAAb,CAAuBC,QAAvB,CAAiC,iCAAjC,CADH,EAEE;AACD;AACA;;AACDH,EAAAA,KAAK,CAACI,cAAN;AACA,uBAAqBJ,KAAK,CAACC,MAAN,CAAaI,OAAb,CAAqBC,EAA1C;AACA,CARD,E,CAUA;;AACAT,QAAQ,CAACE,gBAAT,CAA2B,kBAA3B,EAA+C,MAAM;AACpD,QAAMQ,MAAM,GAAGV,QAAQ,CAACW,aAAT,CAAwB,oBAAxB,CAAf;;AACA,MAAK,CAAED,MAAP,EAAgB;AACf;AACA;;AAED,QAAME,UAAU,GAAG,MAAM;AACxB,UAAMC,MAAM,GAAGb,QAAQ,CAACc,aAAT,CAAwB,KAAxB,CAAf;AACAD,IAAAA,MAAM,CAACE,SAAP,GAAmB,sCAAnB;AACAF,IAAAA,MAAM,CAACG,SAAP,GAAoB,MAAM,cACzB,uCADyB,CAEvB,MAFH;AAIA,UAAMC,SAAS,GAAGjB,QAAQ,CAACW,aAAT,CAAwB,gBAAxB,CAAlB;;AACA,QAAK,CAAEM,SAAP,EAAmB;AAClB;AACA;;AACDA,IAAAA,SAAS,CAACC,UAAV,CAAqBC,YAArB,CAAmCN,MAAnC,EAA2CI,SAA3C;AACA,GAZD;;AAcA,QAAMG,SAAS,GAAGpB,QAAQ,CAACc,aAAT,CAAwB,KAAxB,CAAlB;AACAM,EAAAA,SAAS,CAACL,SAAV,GAAsB,iCAAtB;AACAL,EAAAA,MAAM,CAACQ,UAAP,CAAkBC,YAAlB,CAAgCC,SAAhC,EAA2CV,MAA3C;AACA,2BAAYU,SAAZ,EAAwBC,MAAxB,CACC,4BAAC,uBAAD;AAAgB,IAAA,QAAQ,EAAGT;AAA3B,IADD;AAGA,CA1BD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRoot } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport exportReusableBlock from './utils/export';\nimport ImportDropdown from './components/import-dropdown';\n\n// Setup Export Links.\ndocument.body.addEventListener( 'click', ( event ) => {\n\tif (\n\t\t! event.target.classList.contains( 'wp-list-reusable-blocks__export' )\n\t) {\n\t\treturn;\n\t}\n\tevent.preventDefault();\n\texportReusableBlock( event.target.dataset.id );\n} );\n\n// Setup Import Form.\ndocument.addEventListener( 'DOMContentLoaded', () => {\n\tconst button = document.querySelector( '.page-title-action' );\n\tif ( ! button ) {\n\t\treturn;\n\t}\n\n\tconst showNotice = () => {\n\t\tconst notice = document.createElement( 'div' );\n\t\tnotice.className = 'notice notice-success is-dismissible';\n\t\tnotice.innerHTML = `<p>${ __(\n\t\t\t'Reusable block imported successfully!'\n\t\t) }</p>`;\n\n\t\tconst headerEnd = document.querySelector( '.wp-header-end' );\n\t\tif ( ! headerEnd ) {\n\t\t\treturn;\n\t\t}\n\t\theaderEnd.parentNode.insertBefore( notice, headerEnd );\n\t};\n\n\tconst container = document.createElement( 'div' );\n\tcontainer.className = 'list-reusable-blocks__container';\n\tbutton.parentNode.insertBefore( container, button );\n\tcreateRoot( container ).render(\n\t\t<ImportDropdown onUpload={ showNotice } />\n\t);\n} );\n"]}
@@ -3,7 +3,7 @@ import { createElement } from "@wordpress/element";
3
3
  /**
4
4
  * WordPress dependencies
5
5
  */
6
- import { render } from '@wordpress/element';
6
+ import { createRoot } from '@wordpress/element';
7
7
  import { __ } from '@wordpress/i18n';
8
8
  /**
9
9
  * Internal dependencies
@@ -44,8 +44,8 @@ document.addEventListener('DOMContentLoaded', () => {
44
44
  const container = document.createElement('div');
45
45
  container.className = 'list-reusable-blocks__container';
46
46
  button.parentNode.insertBefore(container, button);
47
- render(createElement(ImportDropdown, {
47
+ createRoot(container).render(createElement(ImportDropdown, {
48
48
  onUpload: showNotice
49
- }), container);
49
+ }));
50
50
  });
51
51
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/list-reusable-blocks/src/index.js"],"names":["render","__","exportReusableBlock","ImportDropdown","document","body","addEventListener","event","target","classList","contains","preventDefault","dataset","id","button","querySelector","showNotice","notice","createElement","className","innerHTML","headerEnd","parentNode","insertBefore","container"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,QAAuB,oBAAvB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,mBAAP,MAAgC,gBAAhC;AACA,OAAOC,cAAP,MAA2B,8BAA3B,C,CAEA;;AACAC,QAAQ,CAACC,IAAT,CAAcC,gBAAd,CAAgC,OAAhC,EAA2CC,KAAF,IAAa;AACrD,MACC,CAAEA,KAAK,CAACC,MAAN,CAAaC,SAAb,CAAuBC,QAAvB,CAAiC,iCAAjC,CADH,EAEE;AACD;AACA;;AACDH,EAAAA,KAAK,CAACI,cAAN;AACAT,EAAAA,mBAAmB,CAAEK,KAAK,CAACC,MAAN,CAAaI,OAAb,CAAqBC,EAAvB,CAAnB;AACA,CARD,E,CAUA;;AACAT,QAAQ,CAACE,gBAAT,CAA2B,kBAA3B,EAA+C,MAAM;AACpD,QAAMQ,MAAM,GAAGV,QAAQ,CAACW,aAAT,CAAwB,oBAAxB,CAAf;;AACA,MAAK,CAAED,MAAP,EAAgB;AACf;AACA;;AAED,QAAME,UAAU,GAAG,MAAM;AACxB,UAAMC,MAAM,GAAGb,QAAQ,CAACc,aAAT,CAAwB,KAAxB,CAAf;AACAD,IAAAA,MAAM,CAACE,SAAP,GAAmB,sCAAnB;AACAF,IAAAA,MAAM,CAACG,SAAP,GAAoB,MAAMnB,EAAE,CAC3B,uCAD2B,CAEzB,MAFH;AAIA,UAAMoB,SAAS,GAAGjB,QAAQ,CAACW,aAAT,CAAwB,gBAAxB,CAAlB;;AACA,QAAK,CAAEM,SAAP,EAAmB;AAClB;AACA;;AACDA,IAAAA,SAAS,CAACC,UAAV,CAAqBC,YAArB,CAAmCN,MAAnC,EAA2CI,SAA3C;AACA,GAZD;;AAcA,QAAMG,SAAS,GAAGpB,QAAQ,CAACc,aAAT,CAAwB,KAAxB,CAAlB;AACAM,EAAAA,SAAS,CAACL,SAAV,GAAsB,iCAAtB;AACAL,EAAAA,MAAM,CAACQ,UAAP,CAAkBC,YAAlB,CAAgCC,SAAhC,EAA2CV,MAA3C;AACAd,EAAAA,MAAM,CAAE,cAAC,cAAD;AAAgB,IAAA,QAAQ,EAAGgB;AAA3B,IAAF,EAA8CQ,SAA9C,CAAN;AACA,CAxBD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { render } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport exportReusableBlock from './utils/export';\nimport ImportDropdown from './components/import-dropdown';\n\n// Setup Export Links.\ndocument.body.addEventListener( 'click', ( event ) => {\n\tif (\n\t\t! event.target.classList.contains( 'wp-list-reusable-blocks__export' )\n\t) {\n\t\treturn;\n\t}\n\tevent.preventDefault();\n\texportReusableBlock( event.target.dataset.id );\n} );\n\n// Setup Import Form.\ndocument.addEventListener( 'DOMContentLoaded', () => {\n\tconst button = document.querySelector( '.page-title-action' );\n\tif ( ! button ) {\n\t\treturn;\n\t}\n\n\tconst showNotice = () => {\n\t\tconst notice = document.createElement( 'div' );\n\t\tnotice.className = 'notice notice-success is-dismissible';\n\t\tnotice.innerHTML = `<p>${ __(\n\t\t\t'Reusable block imported successfully!'\n\t\t) }</p>`;\n\n\t\tconst headerEnd = document.querySelector( '.wp-header-end' );\n\t\tif ( ! headerEnd ) {\n\t\t\treturn;\n\t\t}\n\t\theaderEnd.parentNode.insertBefore( notice, headerEnd );\n\t};\n\n\tconst container = document.createElement( 'div' );\n\tcontainer.className = 'list-reusable-blocks__container';\n\tbutton.parentNode.insertBefore( container, button );\n\trender( <ImportDropdown onUpload={ showNotice } />, container );\n} );\n"]}
1
+ {"version":3,"sources":["@wordpress/list-reusable-blocks/src/index.js"],"names":["createRoot","__","exportReusableBlock","ImportDropdown","document","body","addEventListener","event","target","classList","contains","preventDefault","dataset","id","button","querySelector","showNotice","notice","createElement","className","innerHTML","headerEnd","parentNode","insertBefore","container","render"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,oBAA3B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,mBAAP,MAAgC,gBAAhC;AACA,OAAOC,cAAP,MAA2B,8BAA3B,C,CAEA;;AACAC,QAAQ,CAACC,IAAT,CAAcC,gBAAd,CAAgC,OAAhC,EAA2CC,KAAF,IAAa;AACrD,MACC,CAAEA,KAAK,CAACC,MAAN,CAAaC,SAAb,CAAuBC,QAAvB,CAAiC,iCAAjC,CADH,EAEE;AACD;AACA;;AACDH,EAAAA,KAAK,CAACI,cAAN;AACAT,EAAAA,mBAAmB,CAAEK,KAAK,CAACC,MAAN,CAAaI,OAAb,CAAqBC,EAAvB,CAAnB;AACA,CARD,E,CAUA;;AACAT,QAAQ,CAACE,gBAAT,CAA2B,kBAA3B,EAA+C,MAAM;AACpD,QAAMQ,MAAM,GAAGV,QAAQ,CAACW,aAAT,CAAwB,oBAAxB,CAAf;;AACA,MAAK,CAAED,MAAP,EAAgB;AACf;AACA;;AAED,QAAME,UAAU,GAAG,MAAM;AACxB,UAAMC,MAAM,GAAGb,QAAQ,CAACc,aAAT,CAAwB,KAAxB,CAAf;AACAD,IAAAA,MAAM,CAACE,SAAP,GAAmB,sCAAnB;AACAF,IAAAA,MAAM,CAACG,SAAP,GAAoB,MAAMnB,EAAE,CAC3B,uCAD2B,CAEzB,MAFH;AAIA,UAAMoB,SAAS,GAAGjB,QAAQ,CAACW,aAAT,CAAwB,gBAAxB,CAAlB;;AACA,QAAK,CAAEM,SAAP,EAAmB;AAClB;AACA;;AACDA,IAAAA,SAAS,CAACC,UAAV,CAAqBC,YAArB,CAAmCN,MAAnC,EAA2CI,SAA3C;AACA,GAZD;;AAcA,QAAMG,SAAS,GAAGpB,QAAQ,CAACc,aAAT,CAAwB,KAAxB,CAAlB;AACAM,EAAAA,SAAS,CAACL,SAAV,GAAsB,iCAAtB;AACAL,EAAAA,MAAM,CAACQ,UAAP,CAAkBC,YAAlB,CAAgCC,SAAhC,EAA2CV,MAA3C;AACAd,EAAAA,UAAU,CAAEwB,SAAF,CAAV,CAAwBC,MAAxB,CACC,cAAC,cAAD;AAAgB,IAAA,QAAQ,EAAGT;AAA3B,IADD;AAGA,CA1BD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRoot } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport exportReusableBlock from './utils/export';\nimport ImportDropdown from './components/import-dropdown';\n\n// Setup Export Links.\ndocument.body.addEventListener( 'click', ( event ) => {\n\tif (\n\t\t! event.target.classList.contains( 'wp-list-reusable-blocks__export' )\n\t) {\n\t\treturn;\n\t}\n\tevent.preventDefault();\n\texportReusableBlock( event.target.dataset.id );\n} );\n\n// Setup Import Form.\ndocument.addEventListener( 'DOMContentLoaded', () => {\n\tconst button = document.querySelector( '.page-title-action' );\n\tif ( ! button ) {\n\t\treturn;\n\t}\n\n\tconst showNotice = () => {\n\t\tconst notice = document.createElement( 'div' );\n\t\tnotice.className = 'notice notice-success is-dismissible';\n\t\tnotice.innerHTML = `<p>${ __(\n\t\t\t'Reusable block imported successfully!'\n\t\t) }</p>`;\n\n\t\tconst headerEnd = document.querySelector( '.wp-header-end' );\n\t\tif ( ! headerEnd ) {\n\t\t\treturn;\n\t\t}\n\t\theaderEnd.parentNode.insertBefore( notice, headerEnd );\n\t};\n\n\tconst container = document.createElement( 'div' );\n\tcontainer.className = 'list-reusable-blocks__container';\n\tbutton.parentNode.insertBefore( container, button );\n\tcreateRoot( container ).render(\n\t\t<ImportDropdown onUpload={ showNotice } />\n\t);\n} );\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/list-reusable-blocks",
3
- "version": "4.3.2",
3
+ "version": "4.3.4",
4
4
  "description": "Adding Export/Import support to the reusable blocks listing.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -27,9 +27,9 @@
27
27
  "dependencies": {
28
28
  "@babel/runtime": "^7.16.0",
29
29
  "@wordpress/api-fetch": "^6.23.1",
30
- "@wordpress/components": "^23.3.2",
31
- "@wordpress/compose": "^6.3.2",
32
- "@wordpress/element": "^5.3.1",
30
+ "@wordpress/components": "^23.3.4",
31
+ "@wordpress/compose": "^6.3.3",
32
+ "@wordpress/element": "^5.3.2",
33
33
  "@wordpress/i18n": "^4.26.1",
34
34
  "change-case": "^4.1.2"
35
35
  },
@@ -40,5 +40,5 @@
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  },
43
- "gitHead": "1bf01c01a8238ce3a681ad1e517f86033818b78d"
43
+ "gitHead": "1e2b2f680c6378f789d6660bc04b30e35e3a33a3"
44
44
  }
package/src/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { render } from '@wordpress/element';
4
+ import { createRoot } from '@wordpress/element';
5
5
  import { __ } from '@wordpress/i18n';
6
6
 
7
7
  /**
@@ -45,5 +45,7 @@ document.addEventListener( 'DOMContentLoaded', () => {
45
45
  const container = document.createElement( 'div' );
46
46
  container.className = 'list-reusable-blocks__container';
47
47
  button.parentNode.insertBefore( container, button );
48
- render( <ImportDropdown onUpload={ showNotice } />, container );
48
+ createRoot( container ).render(
49
+ <ImportDropdown onUpload={ showNotice } />
50
+ );
49
51
  } );