Changeset 3425185
- Timestamp:
- 12/22/2025 09:20:55 AM (3 months ago)
- Location:
- convert-blocks-to-json
- Files:
-
- 109 added
- 18 edited
-
tags/1.2.0 (added)
-
tags/1.2.0/LICENSE (added)
-
tags/1.2.0/composer.json (added)
-
tags/1.2.0/convert-blocks-to-json.php (added)
-
tags/1.2.0/dist (added)
-
tags/1.2.0/dist/app.asset.php (added)
-
tags/1.2.0/dist/app.js (added)
-
tags/1.2.0/dist/app.js.map (added)
-
tags/1.2.0/inc (added)
-
tags/1.2.0/inc/Abstracts (added)
-
tags/1.2.0/inc/Abstracts/Block.php (added)
-
tags/1.2.0/inc/Abstracts/Route.php (added)
-
tags/1.2.0/inc/Abstracts/Service.php (added)
-
tags/1.2.0/inc/Blocks (added)
-
tags/1.2.0/inc/Blocks/Image.php (added)
-
tags/1.2.0/inc/Core (added)
-
tags/1.2.0/inc/Core/Container.php (added)
-
tags/1.2.0/inc/Interfaces (added)
-
tags/1.2.0/inc/Interfaces/Kernel.php (added)
-
tags/1.2.0/inc/Interfaces/Router.php (added)
-
tags/1.2.0/inc/Plugin.php (added)
-
tags/1.2.0/inc/Routes (added)
-
tags/1.2.0/inc/Routes/Export.php (added)
-
tags/1.2.0/inc/Routes/Import.php (added)
-
tags/1.2.0/inc/Services (added)
-
tags/1.2.0/inc/Services/Blocks.php (added)
-
tags/1.2.0/inc/Services/Boot.php (added)
-
tags/1.2.0/inc/Services/Routes.php (added)
-
tags/1.2.0/inc/Services/Scripts.php (added)
-
tags/1.2.0/languages (added)
-
tags/1.2.0/languages/convert-blocks-to-json-ar-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.2.0/languages/convert-blocks-to-json-ar.mo (added)
-
tags/1.2.0/languages/convert-blocks-to-json-ar.po (added)
-
tags/1.2.0/languages/convert-blocks-to-json-de_DE-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.2.0/languages/convert-blocks-to-json-de_DE.mo (added)
-
tags/1.2.0/languages/convert-blocks-to-json-de_DE.po (added)
-
tags/1.2.0/languages/convert-blocks-to-json-es_ES-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.2.0/languages/convert-blocks-to-json-es_ES.mo (added)
-
tags/1.2.0/languages/convert-blocks-to-json-es_ES.po (added)
-
tags/1.2.0/languages/convert-blocks-to-json-fr_FR-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.2.0/languages/convert-blocks-to-json-fr_FR.mo (added)
-
tags/1.2.0/languages/convert-blocks-to-json-fr_FR.po (added)
-
tags/1.2.0/languages/convert-blocks-to-json-he_IL-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.2.0/languages/convert-blocks-to-json-he_IL.mo (added)
-
tags/1.2.0/languages/convert-blocks-to-json-he_IL.po (added)
-
tags/1.2.0/languages/convert-blocks-to-json-hi_IN-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.2.0/languages/convert-blocks-to-json-hi_IN.mo (added)
-
tags/1.2.0/languages/convert-blocks-to-json-hi_IN.po (added)
-
tags/1.2.0/languages/convert-blocks-to-json-hr-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.2.0/languages/convert-blocks-to-json-hr.mo (added)
-
tags/1.2.0/languages/convert-blocks-to-json-hr.po (added)
-
tags/1.2.0/languages/convert-blocks-to-json-it_IT-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.2.0/languages/convert-blocks-to-json-it_IT.mo (added)
-
tags/1.2.0/languages/convert-blocks-to-json-it_IT.po (added)
-
tags/1.2.0/languages/convert-blocks-to-json-ru_RU-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.2.0/languages/convert-blocks-to-json-ru_RU.mo (added)
-
tags/1.2.0/languages/convert-blocks-to-json-ru_RU.po (added)
-
tags/1.2.0/languages/convert-blocks-to-json-zh_CN-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.2.0/languages/convert-blocks-to-json-zh_CN.mo (added)
-
tags/1.2.0/languages/convert-blocks-to-json-zh_CN.po (added)
-
tags/1.2.0/languages/convert-blocks-to-json.pot (added)
-
tags/1.2.0/readme.txt (added)
-
tags/1.2.0/vendor (added)
-
tags/1.2.0/vendor/autoload.php (added)
-
tags/1.2.0/vendor/badasswp (added)
-
tags/1.2.0/vendor/badasswp/wp-mock-tc (added)
-
tags/1.2.0/vendor/badasswp/wp-mock-tc/.editorconfig (added)
-
tags/1.2.0/vendor/badasswp/wp-mock-tc/.gitignore (added)
-
tags/1.2.0/vendor/badasswp/wp-mock-tc/CHANGELOG.md (added)
-
tags/1.2.0/vendor/badasswp/wp-mock-tc/README.md (added)
-
tags/1.2.0/vendor/badasswp/wp-mock-tc/composer.json (added)
-
tags/1.2.0/vendor/badasswp/wp-mock-tc/composer.lock (added)
-
tags/1.2.0/vendor/badasswp/wp-mock-tc/phpcs.xml (added)
-
tags/1.2.0/vendor/badasswp/wp-mock-tc/phpunit.xml (added)
-
tags/1.2.0/vendor/badasswp/wp-mock-tc/src (added)
-
tags/1.2.0/vendor/badasswp/wp-mock-tc/src/WPMockTestCase.php (added)
-
tags/1.2.0/vendor/badasswp/wp-mock-tc/tests (added)
-
tags/1.2.0/vendor/badasswp/wp-mock-tc/tests/SampleTest.php (added)
-
tags/1.2.0/vendor/badasswp/wp-mock-tc/tests/bootstrap.php (added)
-
tags/1.2.0/vendor/composer (added)
-
tags/1.2.0/vendor/composer/ClassLoader.php (added)
-
tags/1.2.0/vendor/composer/InstalledVersions.php (added)
-
tags/1.2.0/vendor/composer/LICENSE (added)
-
tags/1.2.0/vendor/composer/autoload_classmap.php (added)
-
tags/1.2.0/vendor/composer/autoload_namespaces.php (added)
-
tags/1.2.0/vendor/composer/autoload_psr4.php (added)
-
tags/1.2.0/vendor/composer/autoload_real.php (added)
-
tags/1.2.0/vendor/composer/autoload_static.php (added)
-
tags/1.2.0/vendor/composer/installed.json (added)
-
tags/1.2.0/vendor/composer/installed.php (added)
-
trunk/composer.json (modified) (1 diff)
-
trunk/convert-blocks-to-json.php (modified) (1 diff)
-
trunk/dist/app.asset.php (modified) (1 diff)
-
trunk/dist/app.js (modified) (1 diff)
-
trunk/dist/app.js.map (modified) (1 diff)
-
trunk/inc/Abstracts/Block.php (added)
-
trunk/inc/Abstracts/Route.php (modified) (6 diffs)
-
trunk/inc/Blocks (added)
-
trunk/inc/Blocks/Image.php (added)
-
trunk/inc/Core/Container.php (modified) (2 diffs)
-
trunk/inc/Routes/Export.php (modified) (6 diffs)
-
trunk/inc/Routes/Import.php (modified) (6 diffs)
-
trunk/inc/Services/Blocks.php (added)
-
trunk/inc/Services/Boot.php (modified) (1 diff)
-
trunk/inc/Services/Scripts.php (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/badasswp (added)
-
trunk/vendor/badasswp/wp-mock-tc (added)
-
trunk/vendor/badasswp/wp-mock-tc/.editorconfig (added)
-
trunk/vendor/badasswp/wp-mock-tc/.gitignore (added)
-
trunk/vendor/badasswp/wp-mock-tc/CHANGELOG.md (added)
-
trunk/vendor/badasswp/wp-mock-tc/README.md (added)
-
trunk/vendor/badasswp/wp-mock-tc/composer.json (added)
-
trunk/vendor/badasswp/wp-mock-tc/composer.lock (added)
-
trunk/vendor/badasswp/wp-mock-tc/phpcs.xml (added)
-
trunk/vendor/badasswp/wp-mock-tc/phpunit.xml (added)
-
trunk/vendor/badasswp/wp-mock-tc/src (added)
-
trunk/vendor/badasswp/wp-mock-tc/src/WPMockTestCase.php (added)
-
trunk/vendor/badasswp/wp-mock-tc/tests (added)
-
trunk/vendor/badasswp/wp-mock-tc/tests/SampleTest.php (added)
-
trunk/vendor/badasswp/wp-mock-tc/tests/bootstrap.php (added)
-
trunk/vendor/composer/autoload_psr4.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_real.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.json (modified) (1 diff)
-
trunk/vendor/composer/installed.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
convert-blocks-to-json/trunk/composer.json
r3365125 r3425185 39 39 "test": "vendor/bin/phpunit --testdox", 40 40 "analyse": "vendor/bin/phpstan analyse --memory-limit=2048M" 41 }, 42 "require": { 43 "badasswp/wp-mock-tc": "^1.0" 41 44 } 42 45 } -
convert-blocks-to-json/trunk/convert-blocks-to-json.php
r3365125 r3425185 4 4 * Plugin URI: https://github.com/badasswp/convert-blocks-to-json 5 5 * Description: Convert your WP blocks to JSON. 6 * Version: 1. 1.06 * Version: 1.2.0 7 7 * Author: badasswp 8 8 * Author URI: https://github.com/badasswp -
convert-blocks-to-json/trunk/dist/app.asset.php
r3365125 r3425185 1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block s', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => 'b57f977670617d2b78ab');1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-plugins'), 'version' => 'af0a14b1e3ec484454e6'); -
convert-blocks-to-json/trunk/dist/app.js
r3365125 r3425185 1 (()=>{"use strict";var t={20 :(t,e,n)=>{var o=n(609),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,a=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function l(t,e,n){var o,i={},l=null,d=null;for(o in void 0!==n&&(l=""+n),void 0!==e.key&&(l=""+e.key),void 0!==e.ref&&(d=e.ref),e)c.call(e,o)&&!s.hasOwnProperty(o)&&(i[o]=e[o]);if(t&&t.defaultProps)for(o in e=t.defaultProps)void 0===i[o]&&(i[o]=e[o]);return{$$typeof:r,type:t,key:l,ref:d,props:i,_owner:a.current}}e.Fragment=i,e.jsx=l,e.jsxs=l},56:(t,e,n)=>{t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},72:t=>{var e=[];function n(t){for(var n=-1,o=0;o<e.length;o++)if(e[o].identifier===t){n=o;break}return n}function o(t,o){for(var i={},c=[],a=0;a<t.length;a++){var s=t[a],l=o.base?s[0]+o.base:s[0],d=i[l]||0,p="".concat(l," ").concat(d);i[l]=d+1;var u=n(p),f={css:s[1],media:s[2],sourceMap:s[3],supports:s[4],layer:s[5]};if(-1!==u)e[u].references++,e[u].updater(f);else{var v=r(f,o);o.byIndex=a,e.splice(a,0,{identifier:p,updater:v,references:1})}c.push(p)}return c}function r(t,e){var n=e.domAPI(e);return n.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,r){var i=o(t=t||[],r=r||{});return function(t){t=t||[];for(var c=0;c<i.length;c++){var a=n(i[c]);e[a].references--}for(var s=o(t,r),l=0;l<i.length;l++){var d=n(i[l]);0===e[d].references&&(e[d].updater(),e.splice(d,1))}i=s}}},87:t=>{t.exports=window.wp.element},100:(t,e,n)=>{n.d(e,{A:()=>a});var o=n(354),r=n.n(o),i=n(314),c=n.n(i)()(r());c.push([t.id,"#cbtj p{margin-top:0 !important;margin-bottom:7.5px !important}#cbtj button{height:auto;padding:11.5px 15px;justify-content:center}#cbtj ul{margin:0;padding:0;display:flex;flex-direction:column}#cbtj ul li{padding:20px 0 22.5px 0;border-bottom:1px solid #eee;margin:0}#cbtj ul li:first-child{padding-top:0}","",{version:3,sources:["webpack://./src/styles/app.scss"],names:[],mappings:"AACC,QACC,uBAAA,CACA,8BAAA,CAGD,aACC,WAAA,CACA,mBAAA,CACA,sBAAA,CAGD,SACC,QAAA,CACA,SAAA,CACA,YAAA,CACA,qBAAA,CAEA,YACC,uBAAA,CACA,4BAAA,CACA,QAAA,CAEA,wBACC,aAAA",sourcesContent:["#cbtj {\n\tp {\n\t\tmargin-top: 0 !important;\n\t\tmargin-bottom: 7.5px !important;\n\t}\n\n\tbutton {\n\t\theight: auto;\n\t\tpadding: 11.5px 15px;\n\t\tjustify-content: center;\n\t}\n\n\tul {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\n\t\tli {\n\t\t\tpadding: 20px 0 22.5px 0;\n\t\t\tborder-bottom: 1px solid #EEE;\n\t\t\tmargin: 0;\n\n\t\t\t&:first-child {\n\t\t\t\tpadding-top: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);const a=c},113:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},143:t=>{t.exports=window.wp.data},279:t=>{t.exports=window.wp.plugins},309:t=>{t.exports=window.wp.editPost},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n="",o=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),o&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),o&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n}).join("")},e.i=function(t,n,o,r,i){"string"==typeof t&&(t=[[null,t,void 0]]);var c={};if(o)for(var a=0;a<this.length;a++){var s=this[a][0];null!=s&&(c[s]=!0)}for(var l=0;l<t.length;l++){var d=[].concat(t[l]);o&&c[d[0]]||(void 0!==i&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=i),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),e.push(d))}},e}},349:(t,e,n)=>{n.d(e,{A:()=>a});var o=n(848),r=n(723),i=n(143),c=n(427);const a=()=>{const t=(0,i.select)("core/editor").getCurrentPostId(),e=(null===cbtj||void 0===cbtj?void 0:cbtj.baseUrl)||"",n=(null===cbtj||void 0===cbtj?void 0:cbtj.namespace)||"cbtj/v1",a=(0,r.sprintf)("%1$s/wp-json/%2$s/%3$s",e,n,t);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{children:(0,r.__)("View JSON","convert-blocks-to-json")}),(0,o.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",children:(0,o.jsx)(c.Button,{variant:"primary",onClick:()=>{},children:(0,r.__)("View JSON","convert-blocks-to-json")})})]})}},354:t=>{t.exports=function(t){var e=t[1],n=t[3];if(!n)return e;if("function"==typeof btoa){var o=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(o),i="/*# ".concat(r," */");return[e].concat([i]).join("\n")}return[e].join("\n")}},377:(t,e,n)=>{n.d(e,{A:()=>l});var o=n(848),r=n(723),i=n(143),c=n(427),a=n(997),s=n(900);const l=()=>{const t=t=>{return e=void 0,n=void 0,r=function*(){const e=t.state().get("selection").first().toJSON();(yield(0,s.cO)(e)).forEach(({name:t,attributes:e,innerBlocks:n})=>{e=JSON.parse(e),(0,i.dispatch)("core/block-editor").insertBlocks((0,a.createBlock)(t,Object.assign({},e),n))})},new((o=void 0)||(o=Promise))(function(t,i){function c(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o(function(t){t(n)})).then(c,a)}s((r=r.apply(e,n||[])).next())});var e,n,o,r};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{children:(0,r.__)("Import Blocks by JSON","convert-blocks-to-json")}),(0,o.jsx)(c.Button,{variant:"primary",onClick:()=>{const e=wp.media((0,s.ip)());e.on("select",()=>t(e)).open()},children:(0,r.__)("Import Blocks","convert-blocks-to-json")})]})}},427:t=>{t.exports=window.wp.components},455:t=>{t.exports=window.wp.apiFetch},533:(t,e,n)=>{var o=n(72),r=n.n(o),i=n(825),c=n.n(i),a=n(659),s=n.n(a),l=n(56),d=n.n(l),p=n(540),u=n.n(p),f=n(113),v=n.n(f),m=n(100),A={};A.styleTagTransform=v(),A.setAttributes=d(),A.insert=s().bind(null,"head"),A.domAPI=c(),A.insertStyleElement=u(),r()(m.A,A),m.A&&m.A.locals&&m.A.locals},540:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},609:t=>{t.exports=window.React},659:t=>{var e={};t.exports=function(t,n){var o=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},723:t=>{t.exports=window.wp.i18n},724:(t,e,n)=>{n.d(e,{A:()=>a});var o=n(848),r=n(723),i=n(427),c=n(900);const a=()=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{children:(0,r.__)("Export Blocks to JSON","convert-blocks-to-json")}),(0,o.jsx)(i.Button,{variant:"primary",onClick:()=>{return t=void 0,e=void 0,o=function*(){const t=yield(0,c.Tr)(),e=JSON.stringify(t,null,2),n=URL.createObjectURL(new Blob([e],{type:"application/json"})),o=document.createElement("a");o.href=n,o.download=`convert-blocks-to-json-${Date.now()}.json`,document.body.appendChild(o),o.click(),URL.revokeObjectURL(n),document.body.removeChild(o)},new((n=void 0)||(n=Promise))(function(r,i){function c(t){try{s(o.next(t))}catch(t){i(t)}}function a(t){try{s(o.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(c,a)}s((o=o.apply(t,e||[])).next())});var t,e,n,o},children:(0,r.__)("Export Blocks","convert-blocks-to-json")})]})},825:t=>{t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,r&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(o,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},848:(t,e,n)=>{t.exports=n(20)},900:(t,e,n)=>{n.d(e,{Tr:()=>a,cO:()=>s,ip:()=>l});var o=n(723),r=n(143),i=n(455),c=n.n(i);const a=()=>{const t=(0,r.select)("core/editor").getCurrentPostId();return c()({path:`/cbtj/v1/${t}`})},s=t=>c()({path:"/cbtj/v1/import",method:"POST",data:Object.assign({},t)}),l=()=>({title:(0,o.__)("Select JSON File","convert-blocks-to-json"),button:{text:(0,o.__)("Use JSON","convert-blocks-to-json")},multiple:!1})},997:t=>{t.exports=window.wp.blocks}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var i=e[o]={id:o,exports:{}};return t[o](i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.nc=void 0;var o=n(848),r=n(723),i=n(87),c=n(427),a=n(279),s=n(309),l=n(349),d=n(377),p=n(724);n(533),(0,a.registerPlugin)("convert-blocks-to-json",{render:()=>(0,o.jsxs)(i.Fragment,{children:[(0,o.jsx)(s.PluginSidebarMoreMenuItem,{target:"cbtj-sidebar",icon:"editor-code",children:(0,r.__)("Convert Blocks to JSON","convert-blocks-to-json")}),(0,o.jsx)(s.PluginSidebar,{name:"cbtj-sidebar",title:(0,r.__)("Convert Blocks to JSON","convert-blocks-to-json"),icon:"editor-code",children:(0,o.jsx)(c.PanelBody,{children:(0,o.jsx)("div",{id:"cbtj",children:(0,o.jsxs)("ul",{children:[(0,o.jsx)("li",{children:(0,o.jsx)(l.A,{})}),(0,o.jsx)("li",{children:(0,o.jsx)(d.A,{})}),(0,o.jsx)("li",{children:(0,o.jsx)(p.A,{})})]})})})})]})})})();1 (()=>{"use strict";var t={20(t,n,e){var o=e(609),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,s=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(t,n,e){var o,i={},l=null,d=null;for(o in void 0!==e&&(l=""+e),void 0!==n.key&&(l=""+n.key),void 0!==n.ref&&(d=n.ref),n)c.call(n,o)&&!a.hasOwnProperty(o)&&(i[o]=n[o]);if(t&&t.defaultProps)for(o in n=t.defaultProps)void 0===i[o]&&(i[o]=n[o]);return{$$typeof:r,type:t,key:l,ref:d,props:i,_owner:s.current}}n.Fragment=i,n.jsx=l,n.jsxs=l},56(t,n,e){t.exports=function(t){var n=e.nc;n&&t.setAttribute("nonce",n)}},72(t){var n=[];function e(t){for(var e=-1,o=0;o<n.length;o++)if(n[o].identifier===t){e=o;break}return e}function o(t,o){for(var i={},c=[],s=0;s<t.length;s++){var a=t[s],l=o.base?a[0]+o.base:a[0],d=i[l]||0,p="".concat(l," ").concat(d);i[l]=d+1;var u=e(p),f={css:a[1],media:a[2],sourceMap:a[3],supports:a[4],layer:a[5]};if(-1!==u)n[u].references++,n[u].updater(f);else{var v=r(f,o);o.byIndex=s,n.splice(s,0,{identifier:p,updater:v,references:1})}c.push(p)}return c}function r(t,n){var e=n.domAPI(n);return e.update(t),function(n){if(n){if(n.css===t.css&&n.media===t.media&&n.sourceMap===t.sourceMap&&n.supports===t.supports&&n.layer===t.layer)return;e.update(t=n)}else e.remove()}}t.exports=function(t,r){var i=o(t=t||[],r=r||{});return function(t){t=t||[];for(var c=0;c<i.length;c++){var s=e(i[c]);n[s].references--}for(var a=o(t,r),l=0;l<i.length;l++){var d=e(i[l]);0===n[d].references&&(n[d].updater(),n.splice(d,1))}i=a}}},87(t){t.exports=window.wp.element},100(t,n,e){e.d(n,{A:()=>s});var o=e(354),r=e.n(o),i=e(314),c=e.n(i)()(r());c.push([t.id,"#cbtj p{margin-top:0 !important;margin-bottom:7.5px !important}#cbtj button{height:auto;padding:11.5px 15px;justify-content:center}#cbtj ul{margin:0;padding:0;display:flex;flex-direction:column}#cbtj ul li{padding:20px 0 22.5px 0;border-bottom:1px solid #eee;margin:0}#cbtj ul li:first-child{padding-top:0}","",{version:3,sources:["webpack://./src/styles/app.scss"],names:[],mappings:"AACC,QACC,uBAAA,CACA,8BAAA,CAGD,aACC,WAAA,CACA,mBAAA,CACA,sBAAA,CAGD,SACC,QAAA,CACA,SAAA,CACA,YAAA,CACA,qBAAA,CAEA,YACC,uBAAA,CACA,4BAAA,CACA,QAAA,CAEA,wBACC,aAAA",sourcesContent:["#cbtj {\n\tp {\n\t\tmargin-top: 0 !important;\n\t\tmargin-bottom: 7.5px !important;\n\t}\n\n\tbutton {\n\t\theight: auto;\n\t\tpadding: 11.5px 15px;\n\t\tjustify-content: center;\n\t}\n\n\tul {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\n\t\tli {\n\t\t\tpadding: 20px 0 22.5px 0;\n\t\t\tborder-bottom: 1px solid #EEE;\n\t\t\tmargin: 0;\n\n\t\t\t&:first-child {\n\t\t\t\tpadding-top: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);const s=c},113(t){t.exports=function(t,n){if(n.styleSheet)n.styleSheet.cssText=t;else{for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(document.createTextNode(t))}}},143(t){t.exports=window.wp.data},279(t){t.exports=window.wp.plugins},309(t){t.exports=window.wp.editPost},314(t){t.exports=function(t){var n=[];return n.toString=function(){return this.map(function(n){var e="",o=void 0!==n[5];return n[4]&&(e+="@supports (".concat(n[4],") {")),n[2]&&(e+="@media ".concat(n[2]," {")),o&&(e+="@layer".concat(n[5].length>0?" ".concat(n[5]):""," {")),e+=t(n),o&&(e+="}"),n[2]&&(e+="}"),n[4]&&(e+="}"),e}).join("")},n.i=function(t,e,o,r,i){"string"==typeof t&&(t=[[null,t,void 0]]);var c={};if(o)for(var s=0;s<this.length;s++){var a=this[s][0];null!=a&&(c[a]=!0)}for(var l=0;l<t.length;l++){var d=[].concat(t[l]);o&&c[d[0]]||(void 0!==i&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=i),e&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=e):d[2]=e),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),n.push(d))}},n}},349(t,n,e){e.d(n,{A:()=>s});var o=e(848),r=e(723),i=e(143),c=e(427);const s=()=>{const t=(0,i.select)("core/editor").getCurrentPostId(),n=(null===cbtj||void 0===cbtj?void 0:cbtj.baseUrl)||"",e=(null===cbtj||void 0===cbtj?void 0:cbtj.namespace)||"cbtj/v1",s=(0,r.sprintf)("%1$s/wp-json/%2$s/%3$s",n,e,t);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{children:(0,r.__)("View JSON","convert-blocks-to-json")}),(0,o.jsx)("a",{href:s,target:"_blank",rel:"noreferrer",children:(0,o.jsx)(c.Button,{variant:"primary",onClick:()=>{},children:(0,r.__)("View JSON","convert-blocks-to-json")})})]})}},354(t){t.exports=function(t){var n=t[1],e=t[3];if(!e)return n;if("function"==typeof btoa){var o=btoa(unescape(encodeURIComponent(JSON.stringify(e)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(o),i="/*# ".concat(r," */");return[n].concat([i]).join("\n")}return[n].join("\n")}},377(t,n,e){e.d(n,{A:()=>u});var o=e(848),r=e(723),i=e(143),c=e(427),s=e(997),a=e(656),l=e(692),d=e(715),p=e(900);const u=()=>{const t=t=>{return n=void 0,e=void 0,r=function*(){const n=t.state().get("selection").first().toJSON();try{const{title:t,content:e}=yield(0,p.cO)(n);(0,i.dispatch)(a.store).editPost({title:t,status:"publish"}),e.forEach(({name:t,attributes:n,innerBlocks:e})=>{n=JSON.parse(n),(0,i.dispatch)(d.store).insertBlocks((0,s.createBlock)(t,Object.assign({},n),e))}),yield(0,i.dispatch)(a.store).savePost()}catch(t){(0,i.dispatch)(l.store).createWarningNotice(t.message)}},new((o=void 0)||(o=Promise))(function(t,i){function c(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(n){var e;n.done?t(n.value):(e=n.value,e instanceof o?e:new o(function(t){t(e)})).then(c,s)}a((r=r.apply(n,e||[])).next())});var n,e,o,r};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{children:(0,r.__)("Import Blocks by JSON","convert-blocks-to-json")}),(0,o.jsx)(c.Button,{variant:"primary",onClick:()=>{const n=wp.media((0,p.ip)());n.on("select",()=>t(n)).open()},children:(0,r.__)("Import Blocks","convert-blocks-to-json")})]})}},427(t){t.exports=window.wp.components},455(t){t.exports=window.wp.apiFetch},533(t,n,e){var o=e(72),r=e.n(o),i=e(825),c=e.n(i),s=e(659),a=e.n(s),l=e(56),d=e.n(l),p=e(540),u=e.n(p),f=e(113),v=e.n(f),m=e(100),h={};h.styleTagTransform=v(),h.setAttributes=d(),h.insert=a().bind(null,"head"),h.domAPI=c(),h.insertStyleElement=u(),r()(m.A,h),m.A&&m.A.locals&&m.A.locals},540(t){t.exports=function(t){var n=document.createElement("style");return t.setAttributes(n,t.attributes),t.insert(n,t.options),n}},609(t){t.exports=window.React},656(t){t.exports=window.wp.editor},659(t){var n={};t.exports=function(t,e){var o=function(t){if(void 0===n[t]){var e=document.querySelector(t);if(window.HTMLIFrameElement&&e instanceof window.HTMLIFrameElement)try{e=e.contentDocument.head}catch(t){e=null}n[t]=e}return n[t]}(t);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(e)}},692(t){t.exports=window.wp.notices},715(t){t.exports=window.wp.blockEditor},723(t){t.exports=window.wp.i18n},724(t,n,e){e.d(n,{A:()=>s});var o=e(848),r=e(723),i=e(427),c=e(900);const s=()=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{children:(0,r.__)("Export Blocks to JSON","convert-blocks-to-json")}),(0,o.jsx)(i.Button,{variant:"primary",onClick:()=>{return t=void 0,n=void 0,o=function*(){const t=yield(0,c.Tr)(),n=JSON.stringify(t,null,2),e=URL.createObjectURL(new Blob([n],{type:"application/json"})),o=document.createElement("a");o.href=e,o.download=`convert-blocks-to-json-${Date.now()}.json`,document.body.appendChild(o),o.click(),URL.revokeObjectURL(e),document.body.removeChild(o)},new((e=void 0)||(e=Promise))(function(r,i){function c(t){try{a(o.next(t))}catch(t){i(t)}}function s(t){try{a(o.throw(t))}catch(t){i(t)}}function a(t){var n;t.done?r(t.value):(n=t.value,n instanceof e?n:new e(function(t){t(n)})).then(c,s)}a((o=o.apply(t,n||[])).next())});var t,n,e,o},children:(0,r.__)("Export Blocks","convert-blocks-to-json")})]})},825(t){t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var n=t.insertStyleElement(t);return{update:function(e){!function(t,n,e){var o="";e.supports&&(o+="@supports (".concat(e.supports,") {")),e.media&&(o+="@media ".concat(e.media," {"));var r=void 0!==e.layer;r&&(o+="@layer".concat(e.layer.length>0?" ".concat(e.layer):""," {")),o+=e.css,r&&(o+="}"),e.media&&(o+="}"),e.supports&&(o+="}");var i=e.sourceMap;i&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),n.styleTagTransform(o,t,n.options)}(n,t,e)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)}}}},848(t,n,e){t.exports=e(20)},900(t,n,e){e.d(n,{Tr:()=>l,cO:()=>d,ip:()=>p});var o=e(723),r=e(143),i=e(455),c=e.n(i),s=e(656),a=function(t,n,e,o){return new(e||(e=Promise))(function(r,i){function c(t){try{a(o.next(t))}catch(t){i(t)}}function s(t){try{a(o.throw(t))}catch(t){i(t)}}function a(t){var n;t.done?r(t.value):(n=t.value,n instanceof e?n:new e(function(t){t(n)})).then(c,s)}a((o=o.apply(t,n||[])).next())})};const l=()=>a(void 0,void 0,void 0,function*(){const t=(0,r.select)(s.store).getCurrentPostId();return yield c()({path:`/cbtj/v1/${t}`})}),d=t=>a(void 0,void 0,void 0,function*(){return yield c()({path:"/cbtj/v1/import",method:"POST",data:Object.assign({},t)})}),p=()=>({title:(0,o.__)("Select JSON File","convert-blocks-to-json"),button:{text:(0,o.__)("Use JSON","convert-blocks-to-json")},multiple:!1})},997(t){t.exports=window.wp.blocks}},n={};function e(o){var r=n[o];if(void 0!==r)return r.exports;var i=n[o]={id:o,exports:{}};return t[o](i,i.exports,e),i.exports}e.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},e.d=(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},e.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),e.nc=void 0;var o=e(848),r=e(723),i=e(87),c=e(427),s=e(279),a=e(309),l=e(349),d=e(377),p=e(724);e(533),(0,s.registerPlugin)("convert-blocks-to-json",{render:()=>(0,o.jsxs)(i.Fragment,{children:[(0,o.jsx)(a.PluginSidebarMoreMenuItem,{target:"cbtj-sidebar",icon:"editor-code",children:(0,r.__)("Convert Blocks to JSON","convert-blocks-to-json")}),(0,o.jsx)(a.PluginSidebar,{name:"cbtj-sidebar",title:(0,r.__)("Convert Blocks to JSON","convert-blocks-to-json"),icon:"editor-code",children:(0,o.jsx)(c.PanelBody,{children:(0,o.jsx)("div",{id:"cbtj",children:(0,o.jsxs)("ul",{children:[(0,o.jsx)("li",{children:(0,o.jsx)(l.A,{})}),(0,o.jsx)("li",{children:(0,o.jsx)(d.A,{})}),(0,o.jsx)("li",{children:(0,o.jsx)(p.A,{})})]})})})})]})})})(); 2 2 //# sourceMappingURL=app.js.map -
convert-blocks-to-json/trunk/dist/app.js.map
r3365125 r3425185 1 {"version":3,"file":"app.js","mappings":" uCASa,IAAIA,EAAE,EAAQ,KAASC,EAAEC,OAAOC,IAAI,iBAAiBC,EAAEF,OAAOC,IAAI,kBAAkBE,EAAEC,OAAOC,UAAUC,eAAeC,EAAET,EAAEU,mDAAmDC,kBAAkBC,EAAE,CAACC,KAAI,EAAGC,KAAI,EAAGC,QAAO,EAAGC,UAAS,GAChP,SAASC,EAAEC,EAAEC,EAAEC,GAAG,IAAIC,EAAEC,EAAE,CAAC,EAAEC,EAAE,KAAKC,EAAE,KAAiF,IAAIH,UAAhF,IAASD,IAAIG,EAAE,GAAGH,QAAG,IAASD,EAAEN,MAAMU,EAAE,GAAGJ,EAAEN,UAAK,IAASM,EAAEL,MAAMU,EAAEL,EAAEL,KAAcK,EAAEd,EAAEoB,KAAKN,EAAEE,KAAKT,EAAEJ,eAAea,KAAKC,EAAED,GAAGF,EAAEE,IAAI,GAAGH,GAAGA,EAAEQ,aAAa,IAAIL,KAAKF,EAAED,EAAEQ,kBAAe,IAASJ,EAAED,KAAKC,EAAED,GAAGF,EAAEE,IAAI,MAAM,CAACM,SAAS1B,EAAE2B,KAAKV,EAAEL,IAAIU,EAAET,I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B,IAAOzJ,EAAiB,QACxB,IAAM,EAEP,OADAoJ,EAAoBlK,EAAEsK,EAAQ,CAAEzK,EAAGyK,IAC5BA,GCLRJ,EAAoBlK,EAAI,CAACU,EAAS8J,KACjC,IAAI,IAAIjL,KAAOiL,EACXN,EAAoBO,EAAED,EAAYjL,KAAS2K,EAAoBO,EAAE/J,EAASnB,IAC5EP,OAAO0L,eAAehK,EAASnB,EAAK,CAAEoL,YAAY,EAAMhE,IAAK6D,EAAWjL,MCJ3E2K,EAAoBO,EAAI,CAACtI,EAAKyI,IAAU5L,OAAOC,UAAUC,eAAeiB,KAAKgC,EAAKyI,GCAlFV,EAAoBW,QAAKjG,E,4FCwDzB,IAAAkG,gBAAgB,yBAA0B,CACzCC,OAnC2B,KAE1B,UAAC,EAAApK,SAAQ,YACR,SAAC,EAAAqK,0BAAyB,CAACvF,OAAO,eAAewF,KAAK,cAAa,UAChE,IAAA1F,IAAI,yBAA0B,6BAEjC,SAAC,EAAA2F,cAAa,CACbnE,KAAK,eACL8C,OAAQ,IAAAtE,IACP,yBACA,0BAED0F,KAAK,cAAa,UAElB,SAAC,EAAAE,UAAS,WACT,gBAAKrJ,GAAG,OAAM,UACb,2BACC,yBACC,SAAC,IAAQ,OAEV,yBACC,SAAC,IAAU,OAEZ,yBACC,SAAC,IAAU,mB","sources":["webpack://convert-blocks-to-json/./node_modules/react/cjs/react-jsx-runtime.production.min.js","webpack://convert-blocks-to-json/./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js","webpack://convert-blocks-to-json/./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack://convert-blocks-to-json/external window [\"wp\",\"element\"]","webpack://convert-blocks-to-json/./src/styles/app.scss","webpack://convert-blocks-to-json/./node_modules/style-loader/dist/runtime/styleTagTransform.js","webpack://convert-blocks-to-json/external window [\"wp\",\"data\"]","webpack://convert-blocks-to-json/external window [\"wp\",\"plugins\"]","webpack://convert-blocks-to-json/external window [\"wp\",\"editPost\"]","webpack://convert-blocks-to-json/./node_modules/css-loader/dist/runtime/api.js","webpack://convert-blocks-to-json/./src/components/ViewJSON.tsx","webpack://convert-blocks-to-json/./node_modules/css-loader/dist/runtime/sourceMaps.js","webpack://convert-blocks-to-json/./src/components/ImportJSON.tsx","webpack://convert-blocks-to-json/external window [\"wp\",\"components\"]","webpack://convert-blocks-to-json/external window [\"wp\",\"apiFetch\"]","webpack://convert-blocks-to-json/./src/styles/app.scss?4dc7","webpack://convert-blocks-to-json/./node_modules/style-loader/dist/runtime/insertStyleElement.js","webpack://convert-blocks-to-json/external window \"React\"","webpack://convert-blocks-to-json/./node_modules/style-loader/dist/runtime/insertBySelector.js","webpack://convert-blocks-to-json/external window [\"wp\",\"i18n\"]","webpack://convert-blocks-to-json/./src/components/ExportJSON.tsx","webpack://convert-blocks-to-json/./node_modules/style-loader/dist/runtime/styleDomAPI.js","webpack://convert-blocks-to-json/./node_modules/react/jsx-runtime.js","webpack://convert-blocks-to-json/./src/utils.tsx","webpack://convert-blocks-to-json/external window [\"wp\",\"blocks\"]","webpack://convert-blocks-to-json/webpack/bootstrap","webpack://convert-blocks-to-json/webpack/runtime/compat get default export","webpack://convert-blocks-to-json/webpack/runtime/define property getters","webpack://convert-blocks-to-json/webpack/runtime/hasOwnProperty shorthand","webpack://convert-blocks-to-json/webpack/runtime/nonce","webpack://convert-blocks-to-json/./src/index.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","\"use strict\";\n\n/* istanbul ignore next */\nfunction setAttributesWithoutAttributes(styleElement) {\n var nonce = typeof __webpack_nonce__ !== \"undefined\" ? __webpack_nonce__ : null;\n if (nonce) {\n styleElement.setAttribute(\"nonce\", nonce);\n }\n}\nmodule.exports = setAttributesWithoutAttributes;","\"use strict\";\n\nvar stylesInDOM = [];\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n for (var i = 0; i < stylesInDOM.length; i++) {\n if (stylesInDOM[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n return result;\n}\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var indexByIdentifier = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3],\n supports: item[4],\n layer: item[5]\n };\n if (indexByIdentifier !== -1) {\n stylesInDOM[indexByIdentifier].references++;\n stylesInDOM[indexByIdentifier].updater(obj);\n } else {\n var updater = addElementStyle(obj, options);\n options.byIndex = i;\n stylesInDOM.splice(i, 0, {\n identifier: identifier,\n updater: updater,\n references: 1\n });\n }\n identifiers.push(identifier);\n }\n return identifiers;\n}\nfunction addElementStyle(obj, options) {\n var api = options.domAPI(options);\n api.update(obj);\n var updater = function updater(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {\n return;\n }\n api.update(obj = newObj);\n } else {\n api.remove();\n }\n };\n return updater;\n}\nmodule.exports = function (list, options) {\n options = options || {};\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDOM[index].references--;\n }\n var newLastIdentifiers = modulesToDom(newList, options);\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n var _index = getIndexByIdentifier(_identifier);\n if (stylesInDOM[_index].references === 0) {\n stylesInDOM[_index].updater();\n stylesInDOM.splice(_index, 1);\n }\n }\n lastIdentifiers = newLastIdentifiers;\n };\n};","module.exports = window[\"wp\"][\"element\"];","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `#cbtj p{margin-top:0 !important;margin-bottom:7.5px !important}#cbtj button{height:auto;padding:11.5px 15px;justify-content:center}#cbtj ul{margin:0;padding:0;display:flex;flex-direction:column}#cbtj ul li{padding:20px 0 22.5px 0;border-bottom:1px solid #eee;margin:0}#cbtj ul li:first-child{padding-top:0}`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/styles/app.scss\"],\"names\":[],\"mappings\":\"AACC,QACC,uBAAA,CACA,8BAAA,CAGD,aACC,WAAA,CACA,mBAAA,CACA,sBAAA,CAGD,SACC,QAAA,CACA,SAAA,CACA,YAAA,CACA,qBAAA,CAEA,YACC,uBAAA,CACA,4BAAA,CACA,QAAA,CAEA,wBACC,aAAA\",\"sourcesContent\":[\"#cbtj {\\n\\tp {\\n\\t\\tmargin-top: 0 !important;\\n\\t\\tmargin-bottom: 7.5px !important;\\n\\t}\\n\\n\\tbutton {\\n\\t\\theight: auto;\\n\\t\\tpadding: 11.5px 15px;\\n\\t\\tjustify-content: center;\\n\\t}\\n\\n\\tul {\\n\\t\\tmargin: 0;\\n\\t\\tpadding: 0;\\n\\t\\tdisplay: flex;\\n\\t\\tflex-direction: column;\\n\\n\\t\\tli {\\n\\t\\t\\tpadding: 20px 0 22.5px 0;\\n\\t\\t\\tborder-bottom: 1px solid #EEE;\\n\\t\\t\\tmargin: 0;\\n\\n\\t\\t\\t&:first-child {\\n\\t\\t\\t\\tpadding-top: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/* istanbul ignore next */\nfunction styleTagTransform(css, styleElement) {\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = css;\n } else {\n while (styleElement.firstChild) {\n styleElement.removeChild(styleElement.firstChild);\n }\n styleElement.appendChild(document.createTextNode(css));\n }\n}\nmodule.exports = styleTagTransform;","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"plugins\"];","module.exports = window[\"wp\"][\"editPost\"];","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = [];\n\n // return the list of modules as css string\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n content += cssWithMappingToString(item);\n if (needLayer) {\n content += \"}\";\n }\n if (item[2]) {\n content += \"}\";\n }\n if (item[4]) {\n content += \"}\";\n }\n return content;\n }).join(\"\");\n };\n\n // import a list of modules into the list\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n var alreadyImportedModules = {};\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n list.push(item);\n }\n };\n return list;\n};","import { __, sprintf } from '@wordpress/i18n';\nimport { select } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\n\n/**\n * View JSON.\n *\n * This Component returns the View JSON\n * label and button.\n *\n * @since 1.0.0\n *\n * @return {JSX.Element} View JSON.\n */\nconst ViewJSON = (): JSX.Element => {\n\tconst postID = select( 'core/editor' ).getCurrentPostId();\n\tconst baseUrl = cbtj?.baseUrl || '';\n\tconst namespace = cbtj?.namespace || 'cbtj/v1';\n\n\t// Get URL.\n\tconst url = sprintf( '%1$s/wp-json/%2$s/%3$s', baseUrl, namespace, postID );\n\n\treturn (\n\t\t<>\n\t\t\t<p>{ __( 'View JSON', 'convert-blocks-to-json' ) }</p>\n\t\t\t<a href={ url } target=\"_blank\" rel=\"noreferrer\">\n\t\t\t\t<Button variant=\"primary\" onClick={ () => {} }>\n\t\t\t\t\t{ __( 'View JSON', 'convert-blocks-to-json' ) }\n\t\t\t\t</Button>\n\t\t\t</a>\n\t\t</>\n\t);\n};\n\nexport default ViewJSON;\n","\"use strict\";\n\nmodule.exports = function (item) {\n var content = item[1];\n var cssMapping = item[3];\n if (!cssMapping) {\n return content;\n }\n if (typeof btoa === \"function\") {\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n return [content].concat([sourceMapping]).join(\"\\n\");\n }\n return [content].join(\"\\n\");\n};","import { __ } from '@wordpress/i18n';\nimport { dispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { createBlock } from '@wordpress/blocks';\n\nimport { getModalParams, getImport } from '../utils';\n\n/**\n * Import JSON.\n *\n * This Component returns the Import JSON\n * label and button.\n *\n * @since 1.0.0\n * @since 1.0.1 Implement handleModal callback.\n *\n * @return {JSX.Element} Import JSON.\n */\nconst ImportJSON = (): JSX.Element => {\n\t/**\n\t * Handles the Modal.\n\t *\n\t * This function is responsible for handling the\n\t * WP Media Modal and its selection.\n\t *\n\t * @since 1.0.1\n\t *\n\t * @return {void}\n\t */\n\tconst handleModal = () => {\n\t\tconst wpMediaModal = wp.media( getModalParams() );\n\t\twpMediaModal.on( 'select', () => handleImport( wpMediaModal ) ).open();\n\t};\n\n\t/**\n\t * Handles the Import.\n\t *\n\t * This function is responsible for handling the\n\t * JSON import and its insertion.\n\t *\n\t * @since 1.0.1\n\t *\n\t * @param {Object} wpMediaModal\n\t *\n\t * @return {Promise<void>}\n\t */\n\tconst handleImport = async ( wpMediaModal ) => {\n\t\tconst attachment = wpMediaModal\n\t\t\t.state()\n\t\t\t.get( 'selection' )\n\t\t\t.first()\n\t\t\t.toJSON();\n\t\tconst jsonImport = ( await getImport( attachment ) ) as any[];\n\n\t\tjsonImport.forEach( ( { name, attributes, innerBlocks } ) => {\n\t\t\tattributes = JSON.parse( attributes );\n\t\t\t(\n\t\t\t\tdispatch( 'core/block-editor' ) as { insertBlocks: any }\n\t\t\t ).insertBlocks(\n\t\t\t\tcreateBlock( name, { ...attributes }, innerBlocks )\n\t\t\t);\n\t\t} );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<p>{ __( 'Import Blocks by JSON', 'convert-blocks-to-json' ) }</p>\n\t\t\t<Button variant=\"primary\" onClick={ handleModal }>\n\t\t\t\t{ __( 'Import Blocks', 'convert-blocks-to-json' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n};\n\nexport default ImportJSON;\n","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"apiFetch\"];","\n import API from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./app.scss\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./app.scss\";\n export default content && content.locals ? content.locals : undefined;\n","\"use strict\";\n\n/* istanbul ignore next */\nfunction insertStyleElement(options) {\n var element = document.createElement(\"style\");\n options.setAttributes(element, options.attributes);\n options.insert(element, options.options);\n return element;\n}\nmodule.exports = insertStyleElement;","module.exports = window[\"React\"];","\"use strict\";\n\nvar memo = {};\n\n/* istanbul ignore next */\nfunction getTarget(target) {\n if (typeof memo[target] === \"undefined\") {\n var styleTarget = document.querySelector(target);\n\n // Special case to return head of iframe instead of iframe itself\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n memo[target] = styleTarget;\n }\n return memo[target];\n}\n\n/* istanbul ignore next */\nfunction insertBySelector(insert, style) {\n var target = getTarget(insert);\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n target.appendChild(style);\n}\nmodule.exports = insertBySelector;","module.exports = window[\"wp\"][\"i18n\"];","import { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\n\nimport { getBlocks } from '../utils';\n\n/**\n * Export JSON.\n *\n * This Component returns the Export JSON\n * label and button.\n *\n * @since 1.0.0\n *\n * @return {JSX.Element} Export JSON.\n */\nconst ExportJSON = (): JSX.Element => {\n\t/**\n\t * Generates the JSON export file\n\t * and nothing more.\n\t *\n\t * @since 1.0.1\n\t *\n\t * @return {Promise<void>}\n\t */\n\tconst handleExport = async (): Promise< void > => {\n\t\tconst jsonBlocks = await getBlocks();\n\t\tconst jsonString = JSON.stringify( jsonBlocks, null, 2 );\n\t\tconst jsonURL = URL.createObjectURL(\n\t\t\tnew Blob( [ jsonString ], { type: 'application/json' } )\n\t\t);\n\n\t\t// Define Anchor.\n\t\tconst a = document.createElement( 'a' );\n\t\ta.href = jsonURL;\n\t\ta.download = `convert-blocks-to-json-${ Date.now() }.json`;\n\n\t\t// Fire Anchor.\n\t\tdocument.body.appendChild( a );\n\t\ta.click();\n\n\t\t// Clear Anchor.\n\t\tURL.revokeObjectURL( jsonURL );\n\t\tdocument.body.removeChild( a );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<p>{ __( 'Export Blocks to JSON', 'convert-blocks-to-json' ) }</p>\n\t\t\t<Button variant=\"primary\" onClick={ handleExport }>\n\t\t\t\t{ __( 'Export Blocks', 'convert-blocks-to-json' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n};\n\nexport default ExportJSON;\n","\"use strict\";\n\n/* istanbul ignore next */\nfunction apply(styleElement, options, obj) {\n var css = \"\";\n if (obj.supports) {\n css += \"@supports (\".concat(obj.supports, \") {\");\n }\n if (obj.media) {\n css += \"@media \".concat(obj.media, \" {\");\n }\n var needLayer = typeof obj.layer !== \"undefined\";\n if (needLayer) {\n css += \"@layer\".concat(obj.layer.length > 0 ? \" \".concat(obj.layer) : \"\", \" {\");\n }\n css += obj.css;\n if (needLayer) {\n css += \"}\";\n }\n if (obj.media) {\n css += \"}\";\n }\n if (obj.supports) {\n css += \"}\";\n }\n var sourceMap = obj.sourceMap;\n if (sourceMap && typeof btoa !== \"undefined\") {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n }\n\n // For old IE\n /* istanbul ignore if */\n options.styleTagTransform(css, styleElement, options.options);\n}\nfunction removeStyleElement(styleElement) {\n // istanbul ignore if\n if (styleElement.parentNode === null) {\n return false;\n }\n styleElement.parentNode.removeChild(styleElement);\n}\n\n/* istanbul ignore next */\nfunction domAPI(options) {\n if (typeof document === \"undefined\") {\n return {\n update: function update() {},\n remove: function remove() {}\n };\n }\n var styleElement = options.insertStyleElement(options);\n return {\n update: function update(obj) {\n apply(styleElement, options, obj);\n },\n remove: function remove() {\n removeStyleElement(styleElement);\n }\n };\n}\nmodule.exports = domAPI;","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import { __ } from '@wordpress/i18n';\nimport { select } from '@wordpress/data';\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Get Blocks.\n *\n * This function reaches out to the custom endpoint\n * and grabs the list of blocks available to the Post\n * with the current ID.\n *\n * @since 1.0.0\n *\n * @return {Promise<any[]>} Blocks.\n */\nexport const getBlocks = (): Promise< any[] > => {\n\tconst postID = select( 'core/editor' ).getCurrentPostId();\n\n\treturn apiFetch( {\n\t\tpath: `/cbtj/v1/${ postID }`,\n\t} );\n};\n\n/**\n * Get Import.\n *\n * This function reaches out to the import endpoint\n * and gets the list of JSON blocks.\n *\n * @param attachment\n * @since 1.0.1\n *\n * @return {Promise<any[]>} Import.\n */\nexport const getImport = ( attachment ): Promise< any[] > => {\n\treturn apiFetch( {\n\t\tpath: '/cbtj/v1/import',\n\t\tmethod: 'POST',\n\t\tdata: {\n\t\t\t...attachment,\n\t\t},\n\t} );\n};\n\n/**\n * Get Modal Params.\n *\n * This function is responsible for getting the\n * Modal params values for the WP Media Window Frame\n * displayed to the user.\n *\n * @since 1.0.1\n *\n * @return {Object} Modal Params.\n */\nexport const getModalParams = (): object => {\n\treturn {\n\t\ttitle: __( 'Select JSON File', 'convert-blocks-to-json' ),\n\t\tbutton: {\n\t\t\ttext: __( 'Use JSON', 'convert-blocks-to-json' ),\n\t\t},\n\t\tmultiple: false,\n\t};\n};\n","module.exports = window[\"wp\"][\"blocks\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","__webpack_require__.nc = undefined;","import { __ } from '@wordpress/i18n';\nimport { Fragment } from '@wordpress/element';\nimport { PanelBody } from '@wordpress/components';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { PluginSidebar, PluginSidebarMoreMenuItem } from '@wordpress/edit-post';\n\nimport ViewJSON from './components/ViewJSON';\nimport ImportJSON from './components/ImportJSON';\nimport ExportJSON from './components/ExportJSON';\n\nimport './styles/app.scss';\n\n/**\n * Convert Blocks To JSON.\n *\n * This function returns a JSX component that comprises\n * the Plugin Sidebar and the JSON components.\n *\n * @since 1.0.0\n *\n * @return {JSX.Element} Convert Blocks To JSON.\n */\nconst ConvertBlocksToJSON = (): JSX.Element => {\n\treturn (\n\t\t<Fragment>\n\t\t\t<PluginSidebarMoreMenuItem target=\"cbtj-sidebar\" icon=\"editor-code\">\n\t\t\t\t{ __( 'Convert Blocks to JSON', 'convert-blocks-to-json' ) }\n\t\t\t</PluginSidebarMoreMenuItem>\n\t\t\t<PluginSidebar\n\t\t\t\tname=\"cbtj-sidebar\"\n\t\t\t\ttitle={ __(\n\t\t\t\t\t'Convert Blocks to JSON',\n\t\t\t\t\t'convert-blocks-to-json'\n\t\t\t\t) }\n\t\t\t\ticon=\"editor-code\"\n\t\t\t>\n\t\t\t\t<PanelBody>\n\t\t\t\t\t<div id=\"cbtj\">\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<ViewJSON />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<ImportJSON />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<ExportJSON />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</PanelBody>\n\t\t\t</PluginSidebar>\n\t\t</Fragment>\n\t);\n};\n\nregisterPlugin( 'convert-blocks-to-json', {\n\trender: ConvertBlocksToJSON,\n} );\n"],"names":["f","k","Symbol","for","l","m","Object","prototype","hasOwnProperty","n","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","p","key","ref","__self","__source","q","c","a","g","b","d","e","h","call","defaultProps","$$typeof","type","props","_owner","current","exports","Fragment","jsx","jsxs","module","styleElement","nonce","setAttribute","stylesInDOM","getIndexByIdentifier","identifier","result","i","length","modulesToDom","list","options","idCountMap","identifiers","item","id","base","count","concat","indexByIdentifier","obj","css","media","sourceMap","supports","layer","references","updater","addElementStyle","byIndex","splice","push","api","domAPI","update","newObj","remove","lastIdentifiers","newList","index","newLastIdentifiers","_i","_index","window","___CSS_LOADER_EXPORT___","styleSheet","cssText","firstChild","removeChild","appendChild","document","createTextNode","cssWithMappingToString","toString","this","map","content","needLayer","join","modules","dedupe","undefined","alreadyImportedModules","_k","postID","select","getCurrentPostId","baseUrl","cbtj","namespace","url","sprintf","__","href","target","rel","Button","variant","onClick","cssMapping","btoa","base64","unescape","encodeURIComponent","JSON","stringify","data","sourceMapping","handleImport","wpMediaModal","attachment","state","get","first","toJSON","forEach","name","attributes","innerBlocks","parse","dispatch","insertBlocks","createBlock","wp","on","open","styleTagTransform","setAttributes","insert","insertStyleElement","locals","element","createElement","memo","style","styleTarget","querySelector","HTMLIFrameElement","contentDocument","head","getTarget","Error","jsonBlocks","jsonString","jsonURL","URL","createObjectURL","Blob","download","Date","now","body","click","revokeObjectURL","apply","parentNode","removeStyleElement","getBlocks","path","getImport","method","getModalParams","title","button","text","multiple","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","o","defineProperty","enumerable","prop","nc","registerPlugin","render","PluginSidebarMoreMenuItem","icon","PluginSidebar","PanelBody"],"sourceRoot":""}1 {"version":3,"file":"app.js","mappings":"oCASa,IAAIA,EAAE,EAAQ,KAASC,EAAEC,OAAOC,IAAI,iBAAiBC,EAAEF,OAAOC,IAAI,kBAAkBE,EAAEC,OAAOC,UAAUC,eAAeC,EAAET,EAAEU,mDAAmDC,kBAAkBC,EAAE,CAACC,KAAI,EAAGC,KAAI,EAAGC,QAAO,EAAGC,UAAS,GAChP,SAASC,EAAEC,EAAEC,EAAEC,GAAG,IAAIC,EAAEC,EAAE,CAAC,EAAEC,EAAE,KAAKC,EAAE,KAAiF,IAAIH,UAAhF,IAASD,IAAIG,EAAE,GAAGH,QAAG,IAASD,EAAEN,MAAMU,EAAE,GAAGJ,EAAEN,UAAK,IAASM,EAAEL,MAAMU,EAAEL,EAAEL,KAAcK,EAAEd,EAAEoB,KAAKN,EAAEE,KAAKT,EAAEJ,eAAea,KAAKC,EAAED,GAAGF,EAAEE,IAAI,GAAGH,GAAGA,EAAEQ,aAAa,IAAIL,KAAKF,EAAED,EAAEQ,kBAAe,IAASJ,EAAED,KAAKC,EAAED,GAAGF,EAAEE,IAAI,MAAM,CAACM,SAAS1B,EAAE2B,KAAKV,EAAEL,IAAIU,EAAET,IAAIU,EAAEK,MAAMP,EAAEQ,OAAOrB,EAAEsB,QAAQ,CAACC,EAAQC,SAAS7B,EAAE4B,EAAQE,IAAIjB,EAAEe,EAAQG,KAAKlB,C,YCD1WmB,EAAOJ,QANP,SAAwCK,GACtC,IAAIC,EAAmD,KACnDA,GACFD,EAAaE,aAAa,QAASD,EAEvC,C,QCNA,IAAIE,EAAc,GAClB,SAASC,EAAqBC,GAE5B,IADA,IAAIC,GAAU,EACLC,EAAI,EAAGA,EAAIJ,EAA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,EAAoBpL,EAAK2B,IACxB,IAAI6J,EAAS7J,GAAUA,EAAO8J,WAC7B,IAAO9J,EAAiB,QACxB,IAAM,EAEP,OADAyJ,EAAoBvK,EAAE2K,EAAQ,CAAE9K,EAAG8K,IAC5BA,GCLRJ,EAAoBvK,EAAI,CAACU,EAASmK,KACjC,IAAI,IAAItL,KAAOsL,EACXN,EAAoBO,EAAED,EAAYtL,KAASgL,EAAoBO,EAAEpK,EAASnB,IAC5EP,OAAO+L,eAAerK,EAASnB,EAAK,CAAEyL,YAAY,EAAMrE,IAAKkE,EAAWtL,MCJ3EgL,EAAoBO,EAAI,CAAC3I,EAAK8I,IAAUjM,OAAOC,UAAUC,eAAeiB,KAAKgC,EAAK8I,GCAlFV,EAAoBW,QAAKtG,E,4FCwDzB,IAAAuG,gBAAgB,yBAA0B,CACzCC,OAnC2B,KAE1B,UAAC,EAAAzK,SAAQ,YACR,SAAC,EAAA0K,0BAAyB,CAAC5F,OAAO,eAAe6F,KAAK,cAAa,UAChE,IAAA/F,IAAI,yBAA0B,6BAEjC,SAAC,EAAAgG,cAAa,CACbpE,KAAK,eACLL,OAAQ,IAAAvB,IACP,yBACA,0BAED+F,KAAK,cAAa,UAElB,SAAC,EAAAE,UAAS,WACT,gBAAK1J,GAAG,OAAM,UACb,2BACC,yBACC,SAAC,IAAQ,OAEV,yBACC,SAAC,IAAU,OAEZ,yBACC,SAAC,IAAU,mB","sources":["webpack://convert-blocks-to-json/./node_modules/react/cjs/react-jsx-runtime.production.min.js","webpack://convert-blocks-to-json/./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js","webpack://convert-blocks-to-json/./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack://convert-blocks-to-json/external window [\"wp\",\"element\"]","webpack://convert-blocks-to-json/./src/styles/app.scss","webpack://convert-blocks-to-json/./node_modules/style-loader/dist/runtime/styleTagTransform.js","webpack://convert-blocks-to-json/external window [\"wp\",\"data\"]","webpack://convert-blocks-to-json/external window [\"wp\",\"plugins\"]","webpack://convert-blocks-to-json/external window [\"wp\",\"editPost\"]","webpack://convert-blocks-to-json/./node_modules/css-loader/dist/runtime/api.js","webpack://convert-blocks-to-json/./src/components/ViewJSON.tsx","webpack://convert-blocks-to-json/./node_modules/css-loader/dist/runtime/sourceMaps.js","webpack://convert-blocks-to-json/./src/components/ImportJSON.tsx","webpack://convert-blocks-to-json/external window [\"wp\",\"components\"]","webpack://convert-blocks-to-json/external window [\"wp\",\"apiFetch\"]","webpack://convert-blocks-to-json/./src/styles/app.scss?4dc7","webpack://convert-blocks-to-json/./node_modules/style-loader/dist/runtime/insertStyleElement.js","webpack://convert-blocks-to-json/external window \"React\"","webpack://convert-blocks-to-json/external window [\"wp\",\"editor\"]","webpack://convert-blocks-to-json/./node_modules/style-loader/dist/runtime/insertBySelector.js","webpack://convert-blocks-to-json/external window [\"wp\",\"notices\"]","webpack://convert-blocks-to-json/external window [\"wp\",\"blockEditor\"]","webpack://convert-blocks-to-json/external window [\"wp\",\"i18n\"]","webpack://convert-blocks-to-json/./src/components/ExportJSON.tsx","webpack://convert-blocks-to-json/./node_modules/style-loader/dist/runtime/styleDomAPI.js","webpack://convert-blocks-to-json/./node_modules/react/jsx-runtime.js","webpack://convert-blocks-to-json/./src/utils.tsx","webpack://convert-blocks-to-json/external window [\"wp\",\"blocks\"]","webpack://convert-blocks-to-json/webpack/bootstrap","webpack://convert-blocks-to-json/webpack/runtime/compat get default export","webpack://convert-blocks-to-json/webpack/runtime/define property getters","webpack://convert-blocks-to-json/webpack/runtime/hasOwnProperty shorthand","webpack://convert-blocks-to-json/webpack/runtime/nonce","webpack://convert-blocks-to-json/./src/index.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","\"use strict\";\n\n/* istanbul ignore next */\nfunction setAttributesWithoutAttributes(styleElement) {\n var nonce = typeof __webpack_nonce__ !== \"undefined\" ? __webpack_nonce__ : null;\n if (nonce) {\n styleElement.setAttribute(\"nonce\", nonce);\n }\n}\nmodule.exports = setAttributesWithoutAttributes;","\"use strict\";\n\nvar stylesInDOM = [];\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n for (var i = 0; i < stylesInDOM.length; i++) {\n if (stylesInDOM[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n return result;\n}\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var indexByIdentifier = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3],\n supports: item[4],\n layer: item[5]\n };\n if (indexByIdentifier !== -1) {\n stylesInDOM[indexByIdentifier].references++;\n stylesInDOM[indexByIdentifier].updater(obj);\n } else {\n var updater = addElementStyle(obj, options);\n options.byIndex = i;\n stylesInDOM.splice(i, 0, {\n identifier: identifier,\n updater: updater,\n references: 1\n });\n }\n identifiers.push(identifier);\n }\n return identifiers;\n}\nfunction addElementStyle(obj, options) {\n var api = options.domAPI(options);\n api.update(obj);\n var updater = function updater(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {\n return;\n }\n api.update(obj = newObj);\n } else {\n api.remove();\n }\n };\n return updater;\n}\nmodule.exports = function (list, options) {\n options = options || {};\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDOM[index].references--;\n }\n var newLastIdentifiers = modulesToDom(newList, options);\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n var _index = getIndexByIdentifier(_identifier);\n if (stylesInDOM[_index].references === 0) {\n stylesInDOM[_index].updater();\n stylesInDOM.splice(_index, 1);\n }\n }\n lastIdentifiers = newLastIdentifiers;\n };\n};","module.exports = window[\"wp\"][\"element\"];","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `#cbtj p{margin-top:0 !important;margin-bottom:7.5px !important}#cbtj button{height:auto;padding:11.5px 15px;justify-content:center}#cbtj ul{margin:0;padding:0;display:flex;flex-direction:column}#cbtj ul li{padding:20px 0 22.5px 0;border-bottom:1px solid #eee;margin:0}#cbtj ul li:first-child{padding-top:0}`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/styles/app.scss\"],\"names\":[],\"mappings\":\"AACC,QACC,uBAAA,CACA,8BAAA,CAGD,aACC,WAAA,CACA,mBAAA,CACA,sBAAA,CAGD,SACC,QAAA,CACA,SAAA,CACA,YAAA,CACA,qBAAA,CAEA,YACC,uBAAA,CACA,4BAAA,CACA,QAAA,CAEA,wBACC,aAAA\",\"sourcesContent\":[\"#cbtj {\\n\\tp {\\n\\t\\tmargin-top: 0 !important;\\n\\t\\tmargin-bottom: 7.5px !important;\\n\\t}\\n\\n\\tbutton {\\n\\t\\theight: auto;\\n\\t\\tpadding: 11.5px 15px;\\n\\t\\tjustify-content: center;\\n\\t}\\n\\n\\tul {\\n\\t\\tmargin: 0;\\n\\t\\tpadding: 0;\\n\\t\\tdisplay: flex;\\n\\t\\tflex-direction: column;\\n\\n\\t\\tli {\\n\\t\\t\\tpadding: 20px 0 22.5px 0;\\n\\t\\t\\tborder-bottom: 1px solid #EEE;\\n\\t\\t\\tmargin: 0;\\n\\n\\t\\t\\t&:first-child {\\n\\t\\t\\t\\tpadding-top: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/* istanbul ignore next */\nfunction styleTagTransform(css, styleElement) {\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = css;\n } else {\n while (styleElement.firstChild) {\n styleElement.removeChild(styleElement.firstChild);\n }\n styleElement.appendChild(document.createTextNode(css));\n }\n}\nmodule.exports = styleTagTransform;","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"plugins\"];","module.exports = window[\"wp\"][\"editPost\"];","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = [];\n\n // return the list of modules as css string\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n content += cssWithMappingToString(item);\n if (needLayer) {\n content += \"}\";\n }\n if (item[2]) {\n content += \"}\";\n }\n if (item[4]) {\n content += \"}\";\n }\n return content;\n }).join(\"\");\n };\n\n // import a list of modules into the list\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n var alreadyImportedModules = {};\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n list.push(item);\n }\n };\n return list;\n};","import { __, sprintf } from '@wordpress/i18n';\nimport { select } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\n\n/**\n * View JSON.\n *\n * This Component returns the View JSON\n * label and button.\n *\n * @since 1.0.0\n *\n * @return {JSX.Element} View JSON.\n */\nconst ViewJSON = (): JSX.Element => {\n\tconst postID = select( 'core/editor' ).getCurrentPostId();\n\tconst baseUrl = cbtj?.baseUrl || '';\n\tconst namespace = cbtj?.namespace || 'cbtj/v1';\n\n\t// Get URL.\n\tconst url = sprintf( '%1$s/wp-json/%2$s/%3$s', baseUrl, namespace, postID );\n\n\treturn (\n\t\t<>\n\t\t\t<p>{ __( 'View JSON', 'convert-blocks-to-json' ) }</p>\n\t\t\t<a href={ url } target=\"_blank\" rel=\"noreferrer\">\n\t\t\t\t<Button variant=\"primary\" onClick={ () => {} }>\n\t\t\t\t\t{ __( 'View JSON', 'convert-blocks-to-json' ) }\n\t\t\t\t</Button>\n\t\t\t</a>\n\t\t</>\n\t);\n};\n\nexport default ViewJSON;\n","\"use strict\";\n\nmodule.exports = function (item) {\n var content = item[1];\n var cssMapping = item[3];\n if (!cssMapping) {\n return content;\n }\n if (typeof btoa === \"function\") {\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n return [content].concat([sourceMapping]).join(\"\\n\");\n }\n return [content].join(\"\\n\");\n};","import { __ } from '@wordpress/i18n';\nimport { dispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { createBlock } from '@wordpress/blocks';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as noticeStore } from '@wordpress/notices';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nimport { getModalParams, getImport } from '../utils';\n\n/**\n * Import JSON.\n *\n * This Component returns the Import JSON\n * label and button.\n *\n * @since 1.0.0\n * @since 1.0.1 Implement handleModal callback.\n *\n * @return {JSX.Element} Import JSON.\n */\nconst ImportJSON = (): JSX.Element => {\n\t/**\n\t * Handles the Modal.\n\t *\n\t * This function is responsible for handling the\n\t * WP Media Modal and its selection.\n\t *\n\t * @since 1.0.1\n\t *\n\t * @return {void}\n\t */\n\tconst handleModal = () => {\n\t\tconst wpMediaModal = wp.media( getModalParams() );\n\t\twpMediaModal.on( 'select', () => handleImport( wpMediaModal ) ).open();\n\t};\n\n\t/**\n\t * Handles the Import.\n\t *\n\t * This function is responsible for handling the\n\t * JSON import and its insertion.\n\t *\n\t * @since 1.0.1\n\t *\n\t * @param {any} wpMediaModal\n\t * @return {Promise<void>}\n\t */\n\tconst handleImport = async ( wpMediaModal: any ): Promise< void > => {\n\t\tconst attachment = wpMediaModal\n\t\t\t.state()\n\t\t\t.get( 'selection' )\n\t\t\t.first()\n\t\t\t.toJSON();\n\n\t\ttry {\n\t\t\t// Get data.\n\t\t\tconst { title, content } = await getImport( attachment );\n\n\t\t\t// Add title.\n\t\t\tdispatch( editorStore ).editPost( { title, status: 'publish' } );\n\n\t\t\t// Add content.\n\t\t\tcontent.forEach( ( { name, attributes, innerBlocks } ) => {\n\t\t\t\tattributes = JSON.parse( attributes );\n\t\t\t\t(\n\t\t\t\t\tdispatch( blockEditorStore ) as { insertBlocks: any }\n\t\t\t\t ).insertBlocks(\n\t\t\t\t\tcreateBlock( name, { ...attributes }, innerBlocks )\n\t\t\t\t);\n\t\t\t} );\n\n\t\t\t// Save Post.\n\t\t\tawait dispatch( editorStore ).savePost();\n\t\t} catch ( e ) {\n\t\t\tdispatch( noticeStore ).createWarningNotice( e.message );\n\t\t}\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<p>{ __( 'Import Blocks by JSON', 'convert-blocks-to-json' ) }</p>\n\t\t\t<Button variant=\"primary\" onClick={ handleModal }>\n\t\t\t\t{ __( 'Import Blocks', 'convert-blocks-to-json' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n};\n\nexport default ImportJSON;\n","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"apiFetch\"];","\n import API from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./app.scss\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./app.scss\";\n export default content && content.locals ? content.locals : undefined;\n","\"use strict\";\n\n/* istanbul ignore next */\nfunction insertStyleElement(options) {\n var element = document.createElement(\"style\");\n options.setAttributes(element, options.attributes);\n options.insert(element, options.options);\n return element;\n}\nmodule.exports = insertStyleElement;","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"editor\"];","\"use strict\";\n\nvar memo = {};\n\n/* istanbul ignore next */\nfunction getTarget(target) {\n if (typeof memo[target] === \"undefined\") {\n var styleTarget = document.querySelector(target);\n\n // Special case to return head of iframe instead of iframe itself\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n memo[target] = styleTarget;\n }\n return memo[target];\n}\n\n/* istanbul ignore next */\nfunction insertBySelector(insert, style) {\n var target = getTarget(insert);\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n target.appendChild(style);\n}\nmodule.exports = insertBySelector;","module.exports = window[\"wp\"][\"notices\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"i18n\"];","import { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\n\nimport { getBlocks } from '../utils';\n\n/**\n * Export JSON.\n *\n * This Component returns the Export JSON\n * label and button.\n *\n * @since 1.0.0\n *\n * @return {JSX.Element} Export JSON.\n */\nconst ExportJSON = (): JSX.Element => {\n\t/**\n\t * Generates the JSON export file\n\t * and nothing more.\n\t *\n\t * @since 1.0.1\n\t *\n\t * @return {Promise<void>}\n\t */\n\tconst handleExport = async (): Promise< void > => {\n\t\tconst jsonBlocks = await getBlocks();\n\t\tconst jsonString = JSON.stringify( jsonBlocks, null, 2 );\n\t\tconst jsonURL = URL.createObjectURL(\n\t\t\tnew Blob( [ jsonString ], { type: 'application/json' } )\n\t\t);\n\n\t\t// Define Anchor.\n\t\tconst a = document.createElement( 'a' );\n\t\ta.href = jsonURL;\n\t\ta.download = `convert-blocks-to-json-${ Date.now() }.json`;\n\n\t\t// Fire Anchor.\n\t\tdocument.body.appendChild( a );\n\t\ta.click();\n\n\t\t// Clear Anchor.\n\t\tURL.revokeObjectURL( jsonURL );\n\t\tdocument.body.removeChild( a );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<p>{ __( 'Export Blocks to JSON', 'convert-blocks-to-json' ) }</p>\n\t\t\t<Button variant=\"primary\" onClick={ handleExport }>\n\t\t\t\t{ __( 'Export Blocks', 'convert-blocks-to-json' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n};\n\nexport default ExportJSON;\n","\"use strict\";\n\n/* istanbul ignore next */\nfunction apply(styleElement, options, obj) {\n var css = \"\";\n if (obj.supports) {\n css += \"@supports (\".concat(obj.supports, \") {\");\n }\n if (obj.media) {\n css += \"@media \".concat(obj.media, \" {\");\n }\n var needLayer = typeof obj.layer !== \"undefined\";\n if (needLayer) {\n css += \"@layer\".concat(obj.layer.length > 0 ? \" \".concat(obj.layer) : \"\", \" {\");\n }\n css += obj.css;\n if (needLayer) {\n css += \"}\";\n }\n if (obj.media) {\n css += \"}\";\n }\n if (obj.supports) {\n css += \"}\";\n }\n var sourceMap = obj.sourceMap;\n if (sourceMap && typeof btoa !== \"undefined\") {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n }\n\n // For old IE\n /* istanbul ignore if */\n options.styleTagTransform(css, styleElement, options.options);\n}\nfunction removeStyleElement(styleElement) {\n // istanbul ignore if\n if (styleElement.parentNode === null) {\n return false;\n }\n styleElement.parentNode.removeChild(styleElement);\n}\n\n/* istanbul ignore next */\nfunction domAPI(options) {\n if (typeof document === \"undefined\") {\n return {\n update: function update() {},\n remove: function remove() {}\n };\n }\n var styleElement = options.insertStyleElement(options);\n return {\n update: function update(obj) {\n apply(styleElement, options, obj);\n },\n remove: function remove() {\n removeStyleElement(styleElement);\n }\n };\n}\nmodule.exports = domAPI;","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import { __ } from '@wordpress/i18n';\nimport { select } from '@wordpress/data';\nimport apiFetch from '@wordpress/api-fetch';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Get Blocks.\n *\n * This function reaches out to the custom endpoint\n * and grabs the list of blocks available to the Post\n * with the current ID.\n *\n * @since 1.0.0\n *\n * @return {Promise<any[]>} Blocks.\n */\nexport const getBlocks = async (): Promise< any[] > => {\n\tconst postID = select( editorStore ).getCurrentPostId();\n\n\treturn await apiFetch( {\n\t\tpath: `/cbtj/v1/${ postID }`,\n\t} );\n};\n\n/**\n * Get Import.\n *\n * This function reaches out to the import endpoint\n * and gets the list of JSON blocks.\n *\n * @since 1.0.1\n *\n * @param {any} attachment Attachment object.\n * @return {Promise<any>} Import.\n */\nexport const getImport = async ( attachment: any ): Promise< any > => {\n\treturn await apiFetch( {\n\t\tpath: '/cbtj/v1/import',\n\t\tmethod: 'POST',\n\t\tdata: {\n\t\t\t...attachment,\n\t\t},\n\t} );\n};\n\n/**\n * Get Modal Params.\n *\n * This function is responsible for getting the\n * Modal params values for the WP Media Window Frame\n * displayed to the user.\n *\n * @since 1.0.1\n *\n * @return {any} Modal Params.\n */\nexport const getModalParams = (): any => {\n\treturn {\n\t\ttitle: __( 'Select JSON File', 'convert-blocks-to-json' ),\n\t\tbutton: {\n\t\t\ttext: __( 'Use JSON', 'convert-blocks-to-json' ),\n\t\t},\n\t\tmultiple: false,\n\t};\n};\n","module.exports = window[\"wp\"][\"blocks\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","__webpack_require__.nc = undefined;","import { __ } from '@wordpress/i18n';\nimport { Fragment } from '@wordpress/element';\nimport { PanelBody } from '@wordpress/components';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { PluginSidebar, PluginSidebarMoreMenuItem } from '@wordpress/edit-post';\n\nimport ViewJSON from './components/ViewJSON';\nimport ImportJSON from './components/ImportJSON';\nimport ExportJSON from './components/ExportJSON';\n\nimport './styles/app.scss';\n\n/**\n * Convert Blocks To JSON.\n *\n * This function returns a JSX component that comprises\n * the Plugin Sidebar and the JSON components.\n *\n * @since 1.0.0\n *\n * @return {JSX.Element} Convert Blocks To JSON.\n */\nconst ConvertBlocksToJSON = (): JSX.Element => {\n\treturn (\n\t\t<Fragment>\n\t\t\t<PluginSidebarMoreMenuItem target=\"cbtj-sidebar\" icon=\"editor-code\">\n\t\t\t\t{ __( 'Convert Blocks to JSON', 'convert-blocks-to-json' ) }\n\t\t\t</PluginSidebarMoreMenuItem>\n\t\t\t<PluginSidebar\n\t\t\t\tname=\"cbtj-sidebar\"\n\t\t\t\ttitle={ __(\n\t\t\t\t\t'Convert Blocks to JSON',\n\t\t\t\t\t'convert-blocks-to-json'\n\t\t\t\t) }\n\t\t\t\ticon=\"editor-code\"\n\t\t\t>\n\t\t\t\t<PanelBody>\n\t\t\t\t\t<div id=\"cbtj\">\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<ViewJSON />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<ImportJSON />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<ExportJSON />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</PanelBody>\n\t\t\t</PluginSidebar>\n\t\t</Fragment>\n\t);\n};\n\nregisterPlugin( 'convert-blocks-to-json', {\n\trender: ConvertBlocksToJSON,\n} );\n"],"names":["f","k","Symbol","for","l","m","Object","prototype","hasOwnProperty","n","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","p","key","ref","__self","__source","q","c","a","g","b","d","e","h","call","defaultProps","$$typeof","type","props","_owner","current","exports","Fragment","jsx","jsxs","module","styleElement","nonce","setAttribute","stylesInDOM","getIndexByIdentifier","identifier","result","i","length","modulesToDom","list","options","idCountMap","identifiers","item","id","base","count","concat","indexByIdentifier","obj","css","media","sourceMap","supports","layer","references","updater","addElementStyle","byIndex","splice","push","api","domAPI","update","newObj","remove","lastIdentifiers","newList","index","newLastIdentifiers","_i","_index","window","___CSS_LOADER_EXPORT___","styleSheet","cssText","firstChild","removeChild","appendChild","document","createTextNode","cssWithMappingToString","toString","this","map","content","needLayer","join","modules","dedupe","undefined","alreadyImportedModules","_k","postID","select","getCurrentPostId","baseUrl","cbtj","namespace","url","sprintf","__","href","target","rel","Button","variant","onClick","cssMapping","btoa","base64","unescape","encodeURIComponent","JSON","stringify","data","sourceMapping","handleImport","wpMediaModal","attachment","state","get","first","toJSON","title","dispatch","editPost","status","forEach","name","attributes","innerBlocks","parse","insertBlocks","createBlock","savePost","createWarningNotice","message","wp","on","open","styleTagTransform","setAttributes","insert","insertStyleElement","locals","element","createElement","memo","style","styleTarget","querySelector","HTMLIFrameElement","contentDocument","head","getTarget","Error","jsonBlocks","jsonString","jsonURL","URL","createObjectURL","Blob","download","Date","now","body","click","revokeObjectURL","apply","parentNode","removeStyleElement","getBlocks","path","getImport","method","getModalParams","button","text","multiple","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","o","defineProperty","enumerable","prop","nc","registerPlugin","render","PluginSidebarMoreMenuItem","icon","PluginSidebar","PanelBody"],"ignoreList":[],"sourceRoot":""} -
convert-blocks-to-json/trunk/inc/Abstracts/Route.php
r3365125 r3425185 11 11 namespace ConvertBlocksToJSON\Abstracts; 12 12 13 use WP_Error; 14 use WP_REST_Server; 13 15 use ConvertBlocksToJSON\Interfaces\Router; 14 16 … … 39 41 */ 40 42 public function get_permission_callback() { 41 if ( \WP_REST_Server::READABLE === $this->method ) {43 if ( WP_REST_Server::READABLE === $this->method ) { 42 44 return '__return_true'; 43 45 } … … 100 102 * @return \WP_Error 101 103 */ 102 public function get_400_response( $message ): \WP_Error { 103 $args = $this->request->get_json_params(); 104 105 return new \WP_Error( 104 public function get_400_response( $message ): WP_Error { 105 return new WP_Error( 106 106 'cbtj-bad-request', 107 107 sprintf( … … 110 110 ), 111 111 [ 112 'status' => 400, 113 'request' => $args, 112 'status' => 400, 114 113 ] 115 114 ); … … 133 132 134 133 if ( ! current_user_can( 'administrator' ) ) { 135 return new \WP_Error(134 return new WP_Error( 136 135 'cbtj-rest-forbidden', 137 136 sprintf( 'Invalid User. Error: %s', $http_error ), … … 141 140 142 141 if ( ! wp_verify_nonce( $request->get_header( 'X-WP-Nonce' ), 'wp_rest' ) ) { 143 return new \WP_Error(142 return new WP_Error( 144 143 'cbtj-rest-forbidden', 145 144 sprintf( 'Invalid Nonce. Error: %s', $http_error ), -
convert-blocks-to-json/trunk/inc/Core/Container.php
r3365125 r3425185 12 12 13 13 use ConvertBlocksToJSON\Services\Boot; 14 use ConvertBlocksToJSON\Services\Blocks; 14 15 use ConvertBlocksToJSON\Services\Routes; 15 16 use ConvertBlocksToJSON\Services\Scripts; … … 34 35 static::$services = [ 35 36 Boot::class, 37 Blocks::class, 36 38 Routes::class, 37 39 Scripts::class, -
convert-blocks-to-json/trunk/inc/Routes/Export.php
r3365125 r3425185 11 11 namespace ConvertBlocksToJSON\Routes; 12 12 13 use WP_REST_Server; 13 14 use ConvertBlocksToJSON\Abstracts\Route; 14 15 use ConvertBlocksToJSON\Interfaces\Router; … … 25 26 * @var string 26 27 */ 27 public string $method = \WP_REST_Server::READABLE;28 public string $method = WP_REST_Server::READABLE; 28 29 29 30 /** … … 59 60 60 61 /** 61 * Filter JSON Response.62 * Filter Export. 62 63 * 63 64 * @since 1.0.0 64 65 * 65 * @param mixed[] $export Response Array.66 * @param mixed[] $export Export data. 66 67 * @param integer $post_id Post ID. 67 68 * … … 102 103 103 104 /** 104 * Get JSON.105 * Get Export Content. 105 106 * 106 * Get all JSON block arrays and recursively107 * add children .107 * Loop through the JSON blocks and recursively 108 * add children blocks. 108 109 * 109 110 * @since 1.0.0 110 111 * 111 * @param mixed[] $block WP Blocks.112 * @param mixed[] $block Block array. 112 113 * @return mixed[] 113 114 */ … … 121 122 } 122 123 123 return[124 $export_block = [ 124 125 'name' => $block['blockName'] ?? '', 125 126 'content' => $block['innerHTML'] ?? '', … … 128 129 'innerBlocks' => $children, 129 130 ]; 131 132 /** 133 * Filter Export Block. 134 * 135 * @since 1.2.0 136 * 137 * @param mixed[] $export_block Export Block. 138 * @return mixed[] 139 */ 140 return apply_filters( 'cbtj_export_block', $export_block ); 130 141 } 131 142 } -
convert-blocks-to-json/trunk/inc/Routes/Import.php
r3365125 r3425185 11 11 namespace ConvertBlocksToJSON\Routes; 12 12 13 use WP_REST_Server; 13 14 use ConvertBlocksToJSON\Abstracts\Route; 14 15 use ConvertBlocksToJSON\Interfaces\Router; … … 25 26 * @var string 26 27 */ 27 public string $method = \WP_REST_Server::CREATABLE;28 public string $method = WP_REST_Server::CREATABLE; 28 29 29 30 /** … … 77 78 78 79 // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents 79 $json = file_get_contents( $json_file ); 80 $import = $this->get_blocks_import( json_decode( $json, true ), $post_id ); 80 $json = json_decode( file_get_contents( $json_file ), true ); 81 $blocks = $this->get_blocks_import( $json['content'] ?? [] ); 82 83 // Make sure to weed out empty blocks. 84 $content = array_filter( $blocks, fn( $block ) => ! empty( $block ) ); 85 86 // Add title. 87 $import = [ 88 'title' => $json['title'] ?? '', 89 'content' => $content, 90 ]; 81 91 82 92 /** 83 * Filter JSONImport.93 * Filter Import. 84 94 * 85 95 * @since 1.0.1 86 96 * 87 * @param mixed[] $ response Import Blocks.88 * @param integer $post_id Post ID.97 * @param mixed[] $import Import data. 98 * @param integer $post_id Post ID. 89 99 * 90 100 * @return mixed[] … … 103 113 * @param 1.0.1 104 114 * 105 * @param array $json JSON Array of Blocks. 106 * @param integer $post_id Post ID. 107 * 115 * @param array $content JSON content. 108 116 * @return mixed[] 109 117 */ 110 public function get_blocks_import( $json, $post_id ): array { 111 $import_blocks = array_map( 112 [ $this, 'get_import' ], 113 $json['content'] ?? [] 114 ); 115 116 return $import_blocks; 118 public function get_blocks_import( $content ): array { 119 return array_map( [ $this, 'get_import' ], $content ); 117 120 } 118 121 … … 129 132 */ 130 133 public function get_import( $block ): array { 134 // Bail out, if block has no name. 135 if ( '' === ( $block['name'] ?? '' ) ) { 136 return []; 137 } 138 131 139 $children = []; 132 140 … … 139 147 $block['attributes']['content'] = $block['filtered'] ?? ''; 140 148 141 return [ 142 'name' => $block['name'] ?? '', 143 'attributes' => wp_json_encode( $block['attributes'] ?? [] ), 144 'innerBlocks' => $children ?? [], 149 $import_block = [ 150 'name' => $block['name'] ?? '', 151 'originalContent' => $block['content'] ?? '', 152 'attributes' => wp_json_encode( $block['attributes'] ?? [] ), 153 'innerBlocks' => $children ?? [], 145 154 ]; 155 156 /** 157 * Filter Import Block. 158 * 159 * @since 1.2.0 160 * 161 * @param mixed[] $import_block Import Block. 162 * @return mixed[] 163 */ 164 return apply_filters( 'cbtj_import_block', $import_block ); 146 165 } 147 166 } -
convert-blocks-to-json/trunk/inc/Services/Boot.php
r3365125 r3425185 55 55 */ 56 56 public function register_json_mime( $mimes ) { 57 return wp_parse_args(58 [59 'json' => 'application/json',60 ],61 $mimes 62 );57 if ( ! isset( $mimes['json'] ) ) { 58 $mimes['json'] = 'application/json'; 59 return $mimes; 60 } 61 62 return $mimes; 63 63 } 64 64 } -
convert-blocks-to-json/trunk/inc/Services/Scripts.php
r3365125 r3425185 97 97 * @return array 98 98 */ 99 p rotectedfunction get_assets( string $path ): array {99 public function get_assets( string $path ): array { 100 100 $assets = [ 101 101 'version' => strval( time() ), -
convert-blocks-to-json/trunk/readme.txt
r3365125 r3425185 4 4 Requires at least: 4.0 5 5 Tested up to: 6.8 6 Stable tag: 1. 1.06 Stable tag: 1.2.0 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 45 45 You can get a taste of how this works, by using the [demo](https://tastewp.com/create/NMS/8.0/6.7.0/convert-blocks-to-json/twentytwentythree?ni=true&origin=wp) link. 46 46 47 = ✨ Why can't I upload JSON files? = 48 49 You might need to configure the <code>ALLOW_UNFILTERED_UPLOADS</code> option in your <code>wp-config.php</code> file like so: 50 51 <code>define( 'ALLOW_UNFILTERED_UPLOADS', true );</code> 52 47 53 = ⚡ Why Convert Blocks to JSON = 48 54 … … 64 70 65 71 == Changelog == 72 73 = 1.2.0 = 74 * Fix: Resolve `Image` block import issues. 75 * Fix: Missing post title during import. 76 * Feat: Add custom hooks `cbtj_import_block`, `cbtj_export_block`, `cbtj_blocks`. 77 * Test: Add PHP unit tests to improve code. 78 * Docs: Update README docs. 79 * Tested up to WP 6.8. 66 80 67 81 = 1.1.0 = -
convert-blocks-to-json/trunk/vendor/autoload.php
r3365125 r3425185 20 20 require_once __DIR__ . '/composer/autoload_real.php'; 21 21 22 return ComposerAutoloaderInit 75688d696e2bd2f5a402a08793ea1e2f::getLoader();22 return ComposerAutoloaderInit4361fef6d64b38194c8b96bd4b96f1b4::getLoader(); -
convert-blocks-to-json/trunk/vendor/composer/autoload_psr4.php
r3365125 r3425185 9 9 'ConvertBlocksToJSON\\Tests\\' => array($baseDir . '/tests'), 10 10 'ConvertBlocksToJSON\\' => array($baseDir . '/inc'), 11 'Badasswp\\WPMockTC\\Tests\\' => array($vendorDir . '/badasswp/wp-mock-tc/tests'), 12 'Badasswp\\WPMockTC\\' => array($vendorDir . '/badasswp/wp-mock-tc/src'), 11 13 ); -
convert-blocks-to-json/trunk/vendor/composer/autoload_real.php
r3365125 r3425185 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 75688d696e2bd2f5a402a08793ea1e2f5 class ComposerAutoloaderInit4361fef6d64b38194c8b96bd4b96f1b4 6 6 { 7 7 private static $loader; … … 23 23 } 24 24 25 spl_autoload_register(array('ComposerAutoloaderInit 75688d696e2bd2f5a402a08793ea1e2f', 'loadClassLoader'), true, true);25 spl_autoload_register(array('ComposerAutoloaderInit4361fef6d64b38194c8b96bd4b96f1b4', 'loadClassLoader'), true, true); 26 26 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 27 spl_autoload_unregister(array('ComposerAutoloaderInit 75688d696e2bd2f5a402a08793ea1e2f', 'loadClassLoader'));27 spl_autoload_unregister(array('ComposerAutoloaderInit4361fef6d64b38194c8b96bd4b96f1b4', 'loadClassLoader')); 28 28 29 29 require __DIR__ . '/autoload_static.php'; 30 call_user_func(\Composer\Autoload\ComposerStaticInit 75688d696e2bd2f5a402a08793ea1e2f::getInitializer($loader));30 call_user_func(\Composer\Autoload\ComposerStaticInit4361fef6d64b38194c8b96bd4b96f1b4::getInitializer($loader)); 31 31 32 32 $loader->register(true); -
convert-blocks-to-json/trunk/vendor/composer/autoload_static.php
r3365125 r3425185 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 75688d696e2bd2f5a402a08793ea1e2f7 class ComposerStaticInit4361fef6d64b38194c8b96bd4b96f1b4 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( 10 'C' => 10 'C' => 11 11 array ( 12 12 'ConvertBlocksToJSON\\Tests\\' => 26, 13 13 'ConvertBlocksToJSON\\' => 20, 14 14 ), 15 'B' => 16 array ( 17 'Badasswp\\WPMockTC\\Tests\\' => 24, 18 'Badasswp\\WPMockTC\\' => 18, 19 ), 15 20 ); 16 21 17 22 public static $prefixDirsPsr4 = array ( 18 'ConvertBlocksToJSON\\Tests\\' => 23 'ConvertBlocksToJSON\\Tests\\' => 19 24 array ( 20 25 0 => __DIR__ . '/../..' . '/tests', 21 26 ), 22 'ConvertBlocksToJSON\\' => 27 'ConvertBlocksToJSON\\' => 23 28 array ( 24 29 0 => __DIR__ . '/../..' . '/inc', 30 ), 31 'Badasswp\\WPMockTC\\Tests\\' => 32 array ( 33 0 => __DIR__ . '/..' . '/badasswp/wp-mock-tc/tests', 34 ), 35 'Badasswp\\WPMockTC\\' => 36 array ( 37 0 => __DIR__ . '/..' . '/badasswp/wp-mock-tc/src', 25 38 ), 26 39 ); … … 33 46 { 34 47 return \Closure::bind(function () use ($loader) { 35 $loader->prefixLengthsPsr4 = ComposerStaticInit 75688d696e2bd2f5a402a08793ea1e2f::$prefixLengthsPsr4;36 $loader->prefixDirsPsr4 = ComposerStaticInit 75688d696e2bd2f5a402a08793ea1e2f::$prefixDirsPsr4;37 $loader->classMap = ComposerStaticInit 75688d696e2bd2f5a402a08793ea1e2f::$classMap;48 $loader->prefixLengthsPsr4 = ComposerStaticInit4361fef6d64b38194c8b96bd4b96f1b4::$prefixLengthsPsr4; 49 $loader->prefixDirsPsr4 = ComposerStaticInit4361fef6d64b38194c8b96bd4b96f1b4::$prefixDirsPsr4; 50 $loader->classMap = ComposerStaticInit4361fef6d64b38194c8b96bd4b96f1b4::$classMap; 38 51 39 52 }, null, ClassLoader::class); -
convert-blocks-to-json/trunk/vendor/composer/installed.json
r3365125 r3425185 1 1 { 2 "packages": [], 2 "packages": [ 3 { 4 "name": "badasswp/wp-mock-tc", 5 "version": "v1.0.0", 6 "version_normalized": "1.0.0.0", 7 "source": { 8 "type": "git", 9 "url": "https://github.com/badasswp/wp-mock-tc.git", 10 "reference": "5ce1409c66280343af0af75ad94afb93dc41661c" 11 }, 12 "dist": { 13 "type": "zip", 14 "url": "https://api.github.com/repos/badasswp/wp-mock-tc/zipball/5ce1409c66280343af0af75ad94afb93dc41661c", 15 "reference": "5ce1409c66280343af0af75ad94afb93dc41661c", 16 "shasum": "" 17 }, 18 "require-dev": { 19 "10up/wp_mock": "^1.1", 20 "dealerdirect/phpcodesniffer-composer-installer": "^1.0", 21 "phpunit/phpunit": "^9.0", 22 "wp-coding-standards/wpcs": "^3.0" 23 }, 24 "time": "2025-09-25T19:36:07+00:00", 25 "type": "library", 26 "installation-source": "dist", 27 "autoload": { 28 "psr-4": { 29 "Badasswp\\WPMockTC\\": "src/", 30 "Badasswp\\WPMockTC\\Tests\\": "tests/" 31 } 32 }, 33 "notification-url": "https://packagist.org/downloads/", 34 "license": [ 35 "MIT" 36 ], 37 "authors": [ 38 { 39 "name": "badasswp", 40 "email": "badasswpdev@gmail.com" 41 } 42 ], 43 "description": "WP Mock Test Case Library", 44 "support": { 45 "issues": "https://github.com/badasswp/wp-mock-tc/issues", 46 "source": "https://github.com/badasswp/wp-mock-tc/tree/v1.0.0" 47 }, 48 "install-path": "../badasswp/wp-mock-tc" 49 } 50 ], 3 51 "dev": false, 4 52 "dev-package-names": [] -
convert-blocks-to-json/trunk/vendor/composer/installed.php
r3365125 r3425185 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' 946ac241fbf17fe920d8508de11e42d366caecca',6 'reference' => 'a0131c67c5e679c642a541ab4b20b80903ab2f26', 7 7 'type' => 'package', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-master', 15 15 'version' => 'dev-master', 16 'reference' => ' 946ac241fbf17fe920d8508de11e42d366caecca',16 'reference' => 'a0131c67c5e679c642a541ab4b20b80903ab2f26', 17 17 'type' => 'package', 18 18 'install_path' => __DIR__ . '/../../', … … 20 20 'dev_requirement' => false, 21 21 ), 22 'badasswp/wp-mock-tc' => array( 23 'pretty_version' => 'v1.0.0', 24 'version' => '1.0.0.0', 25 'reference' => '5ce1409c66280343af0af75ad94afb93dc41661c', 26 'type' => 'library', 27 'install_path' => __DIR__ . '/../badasswp/wp-mock-tc', 28 'aliases' => array(), 29 'dev_requirement' => false, 30 ), 22 31 ), 23 32 );
Note: See TracChangeset
for help on using the changeset viewer.