WordPress/wp-includes/js/dist/block-directory.min.js

2 lines
23 KiB
JavaScript
Raw Normal View History

/*! This file is auto-generated */
this.wp=this.wp||{},this.wp.blockDirectory=function(e){var t={};function o(l){if(t[l])return t[l].exports;var n=t[l]={i:l,l:!1,exports:{}};return e[l].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,l){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:l})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var l=Object.create(null);if(o.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(l,n,function(t){return e[t]}.bind(null,n));return l},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s="./node_modules/@wordpress/block-directory/build-module/index.js")}({"./node_modules/@babel/runtime/helpers/esm/extends.js":function(e,t,o){"use strict";function l(){return(l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var l in o)Object.prototype.hasOwnProperty.call(o,l)&&(e[l]=o[l])}return e}).apply(this,arguments)}o.d(t,"a",(function(){return l}))},"./node_modules/@wordpress/block-directory/build-module/index.js":function(e,t,o){"use strict";o.r(t),o.d(t,"store",(function(){return K}));var l={};o.r(l),o.d(l,"isRequestingDownloadableBlocks",(function(){return w})),o.d(l,"getDownloadableBlocks",(function(){return j})),o.d(l,"getInstalledBlockTypes",(function(){return k})),o.d(l,"getNewBlockTypes",(function(){return f})),o.d(l,"getUnusedBlockTypes",(function(){return _})),o.d(l,"isInstalling",(function(){return y})),o.d(l,"getErrorNotices",(function(){return g})),o.d(l,"getErrorNoticeForBlock",(function(){return E}));var n={};o.r(n),o.d(n,"fetchDownloadableBlocks",(function(){return S})),o.d(n,"receiveDownloadableBlocks",(function(){return x})),o.d(n,"installBlockType",(function(){return C})),o.d(n,"uninstallBlockType",(function(){return D})),o.d(n,"addInstalledBlockType",(function(){return P})),o.d(n,"removeInstalledBlockType",(function(){return R})),o.d(n,"setIsInstalling",(function(){return A})),o.d(n,"setErrorNotice",(function(){return M})),o.d(n,"clearErrorNotice",(function(){return F}));var r=o("@wordpress/element"),c=o("@wordpress/plugins"),s=o("@wordpress/hooks"),a=o("@wordpress/blocks"),i=o("@wordpress/data"),d=o("@wordpress/editor"),b=o("@wordpress/data-controls"),u=o("lodash");var p=Object(i.combineReducers)({downloadableBlocks:(e={},t)=>{switch(t.type){case"FETCH_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{isRequesting:!0}};case"RECEIVE_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{results:t.downloadableBlocks,isRequesting:!1}}}return e},blockManagement:(e={installedBlockTypes:[],isInstalling:{}},t)=>{switch(t.type){case"ADD_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:[...e.installedBlockTypes,t.item]};case"REMOVE_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:e.installedBlockTypes.filter(e=>e.name!==t.item.name)};case"SET_INSTALLING_BLOCK":return{...e,isInstalling:{...e.isInstalling,[t.blockId]:t.isInstalling}}}return e},errorNotices:(e={},t)=>{switch(t.type){case"SET_ERROR_NOTICE":return{...e,[t.blockId]:{message:t.message,isFatal:t.isFatal}};case"CLEAR_ERROR_NOTICE":return Object(u.omit)(e,t.blockId)}return e}}),m=o("@wordpress/block-editor");function O(e,t=[]){if(!t.length)return!1;if(t.some(({name:t})=>t===e.name))return!0;for(let o=0;o<t.length;o++)if(O(e,t[o].innerBlocks))return!0;return!1}function w(e,t){return!(!e.downloadableBlocks[t]||!e.downloadableBlocks[t].isRequesting)&&e.downloadableBlocks[t].isRequesting}function j(e,t){return e.downloadableBlocks[t]&&e.downloadableBlocks[t].results?e.downloadableBlocks[t].results:[]}function k(e){return e.blockManagement.installedBlockTypes}const f=Object(i.createRegistrySelector)(e=>t=>{const o=e(m.store).getBlocks();return k(t).filter(e=>O(e,o))}),_=O