2021-05-21 12:14:23 +02:00
|
|
|
this.wp=this.wp||{},this.wp.reusableBlocks=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="./node_modules/@wordpress/reusable-blocks/build-module/index.js")}({"./node_modules/@wordpress/reusable-blocks/build-module/index.js":function(e,t,n){"use strict";n.r(t),n.d(t,"store",(function(){return f})),n.d(t,"ReusableBlocksMenuItems",(function(){return C}));var r={};n.r(r),n.d(r,"__experimentalConvertBlockToStatic",(function(){return d})),n.d(r,"__experimentalConvertBlocksToReusable",(function(){return b})),n.d(r,"__experimentalDeleteReusableBlock",(function(){return p})),n.d(r,"__experimentalSetEditingReusableBlock",(function(){return w}));var o={};n.r(o),n.d(o,"__experimentalIsEditingReusableBlock",(function(){return _}));var c=n("@wordpress/block-editor"),s=(n("@wordpress/core-data"),n("@wordpress/data")),l=n("lodash"),i=n("@wordpress/blocks"),a=n("@wordpress/i18n");var u={CONVERT_BLOCK_TO_STATIC:Object(s.createRegistryControl)(e=>({clientId:t})=>{const n=e.select(c.store).getBlock(t),r=e.select("core").getEditedEntityRecord("postType","wp_block",n.attributes.ref),o=Object(i.parse)(Object(l.isFunction)(r.content)?r.content(r):r.content);e.dispatch(c.store).replaceBlocks(n.clientId,o)}),CONVERT_BLOCKS_TO_REUSABLE:Object(s.createRegistryControl)(e=>async function({clientIds:t,title:n}){const r={title:n||Object(a.__)("Untitled Reusable block"),content:Object(i.serialize)(e.select(c.store).getBlocksByClientId(t)),status:"publish"},o=await e.dispatch("core").saveEntityRecord("postType","wp_block",r),s=Object(i.createBlock)("core/block",{ref:o.id});e.dispatch(c.store).replaceBlocks(t,s),e.dispatch(f).__experimentalSetEditingReusableBlock(s.clientId,!0)}),DELETE_REUSABLE_BLOCK:Object(s.createRegistryControl)(e=>async function({id:t}){if(!e.select("core").getEditedEntityRecord("postType","wp_block",t))return;const n=e.select(c.store).getBlocks().filter(e=>Object(i.isReusableBlock)(e)&&e.attributes.ref===t).map(e=>e.clientId);n.length&&e.dispatch(c.store).removeBlocks(n),await e.dispatch("core").deleteEntityRecord("postType","wp_block",t)})};function*d(e){yield function(e){return{type:"CONVERT_BLOCK_TO_STATIC",clientId:e}}(e)}function*b(e,t){yield function(e,t){return{type:"CONVERT_BLOCKS_TO_REUSABLE",clientIds:e,title:t}}(e,t)}function*p(e){yield function(e){return{type:"DELETE_REUSABLE_BLOCK",id:e}}(e)}function w(e,t){return{type:"SET_EDITING_REUSABLE_BLOCK",clientId:e,isEditing:t}}var O=Object(s.combineReducers)({isEditingReusableBlock:function(e={},t){return"SET_EDITING_REUSABLE_BLOCK"===(null==t?void 0:t.type)?{...e,[t.clientId]:t.isEditing}:e}});function _(e,t){return e.isEditingReusableBlock[t]}const f=Object(s.createReduxStore)("core/reusable-blocks",{actions:r,controls:u,reducer:O,selectors:o});Object(s.register)(f);var m=n("@wordpress/element"),j=n("@wordpress/components"),k=n("@wordpress/primitives");var E=Object(m.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(m.createElement)(k.Path,{d:"M7 7.2h8.2L13.5 9l1.1 1.1 3.6-3.6-3.5-4-1.1 1 1.9 2.3H7c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.2-.5zm13.8 4V11h-1.5v.3c0 1.1 0 3.5-1 4.5-.3.3-.7.5-1.3.5H8.8l1.7-1.7-1.1-1.1L5.9 17l3.5 4 1.1-1-1.9-2.3H17c.9
|