@wordpress/list-reusable-blocks 3.1.3 → 3.2.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 CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 3.2.0 (2022-03-11)
6
+
5
7
  ## 3.1.0 (2022-01-27)
6
8
 
7
9
  ## 3.0.0 (2021-07-29)
package/build/index.js CHANGED
@@ -17,7 +17,7 @@ var _importDropdown = _interopRequireDefault(require("./components/import-dropdo
17
17
  /**
18
18
  * Internal dependencies
19
19
  */
20
- // Setup Export Links
20
+ // Setup Export Links.
21
21
  document.body.addEventListener('click', event => {
22
22
  if (!event.target.classList.contains('wp-list-reusable-blocks__export')) {
23
23
  return;
@@ -25,7 +25,7 @@ document.body.addEventListener('click', event => {
25
25
 
26
26
  event.preventDefault();
27
27
  (0, _export.default)(event.target.dataset.id);
28
- }); // Setup Import Form
28
+ }); // Setup Import Form.
29
29
 
30
30
  document.addEventListener('DOMContentLoaded', () => {
31
31
  const button = document.querySelector('.page-title-action');
@@ -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"],"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"]}
@@ -10,7 +10,7 @@ import { __ } from '@wordpress/i18n';
10
10
  */
11
11
 
12
12
  import exportReusableBlock from './utils/export';
13
- import ImportDropdown from './components/import-dropdown'; // Setup Export Links
13
+ import ImportDropdown from './components/import-dropdown'; // Setup Export Links.
14
14
 
15
15
  document.body.addEventListener('click', event => {
16
16
  if (!event.target.classList.contains('wp-list-reusable-blocks__export')) {
@@ -19,7 +19,7 @@ document.body.addEventListener('click', event => {
19
19
 
20
20
  event.preventDefault();
21
21
  exportReusableBlock(event.target.dataset.id);
22
- }); // Setup Import Form
22
+ }); // Setup Import Form.
23
23
 
24
24
  document.addEventListener('DOMContentLoaded', () => {
25
25
  const button = document.querySelector('.page-title-action');
@@ -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":["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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/list-reusable-blocks",
3
- "version": "3.1.3",
3
+ "version": "3.2.0",
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",
@@ -26,15 +26,19 @@
26
26
  "module": "build-module/index.js",
27
27
  "dependencies": {
28
28
  "@babel/runtime": "^7.16.0",
29
- "@wordpress/api-fetch": "^6.0.1",
30
- "@wordpress/components": "^19.5.0",
31
- "@wordpress/compose": "^5.1.2",
32
- "@wordpress/element": "^4.1.1",
33
- "@wordpress/i18n": "^4.3.1",
29
+ "@wordpress/api-fetch": "^6.1.0",
30
+ "@wordpress/components": "^19.6.0",
31
+ "@wordpress/compose": "^5.2.0",
32
+ "@wordpress/element": "^4.2.0",
33
+ "@wordpress/i18n": "^4.4.0",
34
34
  "lodash": "^4.17.21"
35
35
  },
36
+ "peerDependencies": {
37
+ "react": "^17.0.0",
38
+ "react-dom": "^17.0.0"
39
+ },
36
40
  "publishConfig": {
37
41
  "access": "public"
38
42
  },
39
- "gitHead": "4566ac290359553d04de4eb574545309343f790b"
43
+ "gitHead": "c37fd7edbc3e379540d7b24fce75a6f640a434ae"
40
44
  }
package/src/index.js CHANGED
@@ -10,7 +10,7 @@ import { __ } from '@wordpress/i18n';
10
10
  import exportReusableBlock from './utils/export';
11
11
  import ImportDropdown from './components/import-dropdown';
12
12
 
13
- // Setup Export Links
13
+ // Setup Export Links.
14
14
  document.body.addEventListener( 'click', ( event ) => {
15
15
  if (
16
16
  ! event.target.classList.contains( 'wp-list-reusable-blocks__export' )
@@ -21,7 +21,7 @@ document.body.addEventListener( 'click', ( event ) => {
21
21
  exportReusableBlock( event.target.dataset.id );
22
22
  } );
23
23
 
24
- // Setup Import Form
24
+ // Setup Import Form.
25
25
  document.addEventListener( 'DOMContentLoaded', () => {
26
26
  const button = document.querySelector( '.page-title-action' );
27
27
  if ( ! button ) {