2021-05-25 01:22:08 -04:00
|
|
|
this.wp=this.wp||{},this.wp.reusableBlocks=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="./node_modules/@wordpress/reusable-blocks/build-module/index.js")}({"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js":function(e,t,r){"use strict";function n(e,t,r,n,o,c,i){try{var s=e[c](i),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function o(e){return function(){var t=this,r=arguments;return new Promise((function(o,c){var i=e.apply(t,r);function s(e){n(i,o,c,s,u,"next",e)}function u(e){n(i,o,c,s,u,"throw",e)}s(void 0)}))}}r.d(t,"a",(function(){return o}))},"./node_modules/@babel/runtime/helpers/esm/defineProperty.js":function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"a",(function(){return n}))},"./node_modules/@wordpress/reusable-blocks/build-module/index.js":function(e,t,r){"use strict";r.r(t),r.d(t,"store",(function(){return I})),r.d(t,"ReusableBlocksMenuItems",(function(){return U}));var n={};r.r(n),r.d(n,"__experimentalConvertBlockToStatic",(function(){return j})),r.d(n,"__experimentalConvertBlocksToReusable",(function(){return _})),r.d(n,"__experimentalDeleteReusableBlock",(function(){return y})),r.d(n,"__experimentalSetEditingReusableBlock",(function(){return E}));var o={};r.r(o),r.d(o,"__experimentalIsEditingReusableBlock",(function(){return R}));var c=r("@wordpress/block-editor"),i=(r("@wordpress/core-data"),r("@wordpress/data")),s=r("@babel/runtime/regenerator"),u=r.n(s),l=r("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),a=r("lodash"),d=r("@wordpress/blocks"),p=r("@wordpress/i18n");function b(e){return{type:"CONVERT_BLOCK_TO_STATIC",clientId:e}}function f(e){return{type:"CONVERT_BLOCKS_TO_REUSABLE",clientIds:e}}function w(e){return{type:"DELETE_REUSABLE_BLOCK",id:e}}var O={CONVERT_BLOCK_TO_STATIC:Object(i.createRegistryControl)((function(e){return function(t){var r=t.clientId,n=e.select("core/block-editor").getBlock(r),o=e.select("core").getEditedEntityRecord("postType","wp_block",n.attributes.ref),c=Object(d.parse)(Object(a.isFunction)(o.content)?o.content(o):o.content);e.dispatch("core/block-editor").replaceBlocks(n.clientId,c)}})),CONVERT_BLOCKS_TO_REUSABLE:Object(i.createRegistryControl)((function(e){return function(){var t=Object(l.a)(u.a.mark((function t(r){var n,o,c,i;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.clientIds,o={title:Object(p.__)("Untitled Reusable Block"),content:Object(d.serialize)(e.select("core/block-editor").getBlocksByClientId(n)),status:"publish"},t.next=4,e.dispatch("core").saveEntityRecord("postType","wp_block",o);case 4:c=t.sent,i=Object(d.createBlock)("core/block",{ref:c.id}),e.dispatch("core/block-editor").replaceBlocks(n,i),e.dispatch(I).__experimentalSetEditingReusableBlock(i.clientId,!0);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),DELETE_REUSABLE_BLOCK:Object(i.createRegistryControl)((function(e){return function(){var t=Object(l.a)(u.a.mark((function t(r){var n,o,c,i;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r.id,e.select("core").getEditedEntityRecord("p
|