mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-02 16:59:35 +01:00
c3ea09ebb8
It contains several changes in addition to regular update to WordPress packages: - All newly exposed blocks are now registered on the server. - Dutone block support was added. - Border block support was updated. - New shared function `construct_wp_query_args` was added for the family of Query blocks - it might need some further work. Props youknowriad. See #52991. Built from https://develop.svn.wordpress.org/trunk@50929 git-svn-id: http://core.svn.wordpress.org/trunk@50538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2 lines
21 KiB
JavaScript
2 lines
21 KiB
JavaScript
/*! This file is auto-generated */
|
||
this.wp=this.wp||{},this.wp.blockDirectory=function(e){var t={};function n(l){if(t[l])return t[l].exports;var c=t[l]={i:l,l:!1,exports:{}};return e[l].call(c.exports,c,c.exports,n),c.l=!0,c.exports}return n.m=e,n.c=t,n.d=function(e,t,l){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:l})},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 l=Object.create(null);if(n.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)n.d(l,c,function(t){return e[t]}.bind(null,c));return l},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=563)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){e.exports=window.wp.compose},134:function(e,t,n){"use strict";var l=n(0),c=n(3);const o=Object(l.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(l.createElement)(c.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"}));t.a=o},161:function(e,t,n){"use strict";var l=n(0),c=n(3);const o=Object(l.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(l.createElement)(c.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"}));t.a=o},162:function(e,t,n){"use strict";var l=n(0),c=n(3);const o=Object(l.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(l.createElement)(c.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"}));t.a=o},18:function(e,t){e.exports=window.wp.coreData},2:function(e,t){e.exports=window.lodash},204:function(e,t,n){"use strict";var l=n(0),c=n(3);const o=Object(l.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(l.createElement)(c.Path,{d:"M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z"}));t.a=o},21:function(e,t){e.exports=window.wp.hooks},22:function(e,t){e.exports=window.wp.editor},3:function(e,t){e.exports=window.wp.primitives},30:function(e,t){e.exports=window.wp.a11y},32:function(e,t){e.exports=window.wp.dataControls},33:function(e,t){e.exports=window.wp.apiFetch},36:function(e,t){e.exports=window.wp.notices},394:function(e,t){e.exports=window.wp.editPost},4:function(e,t){e.exports=window.wp.components},41:function(e,t){e.exports=window.wp.htmlEntities},5:function(e,t){e.exports=window.wp.data},54:function(e,t){e.exports=window.wp.plugins},563:function(e,t,n){"use strict";n.r(t),n.d(t,"store",(function(){return K}));var l={};n.r(l),n.d(l,"isRequestingDownloadableBlocks",(function(){return k})),n.d(l,"getDownloadableBlocks",(function(){return j})),n.d(l,"getInstalledBlockTypes",(function(){return f})),n.d(l,"getNewBlockTypes",(function(){return _})),n.d(l,"getUnusedBlockTypes",(function(){return y})),n.d(l,"isInstalling",(function(){return w})),n.d(l,"getErrorNotices",(function(){return E})),n.d(l,"getErrorNoticeForBlock",(function(){return g}));var c={};n.r(c),n.d(c,"fetchDownloadableBlocks",(function(){return S})),n.d(c,"receiveDownloadableBlocks",(function(){return C})),n.d(c,"installBlockType",(function(){return x})),n.d(c,"uninstallBlockType",(function(){return D})),n.d(c,"addInstalledBlockType",(function(){return P})),n.d(c,"removeInstalledBlockType",(function(){return R})),n.d(c,"setIsInstalling",(function(){return A})),n.d(c,"setErrorNotice",(function(){return M})),n.d(c,"clearErrorNotice",(function(){return F}));var o=n(0),r=n(54),a=n(21),i=n(8),s=n(5),d=n(22),b=n(32),u=n(2);var m=Object(s.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}}),p=n(6);function O(e,t=[]){if(!t.length)return!1;if(t.some(({name:t})=>t===e.name))return!0;for(let n=0;n<t.length;n++)if(O(e,t[n].innerBlocks))return!0;return!1}function k(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 f(e){return e.blockManagement.installedBlockTypes}const _=Object(s.createRegistrySelector)(e=>t=>{const n=e(p.store).getBlocks();return f(t).filter(e=>O(e,n))}),y=Object(s.createRegistrySelector)(e=>t=>{const n=e(p.store).getBlocks();return f(t).filter(e=>!O(e,n))});function w(e,t){return e.blockManagement.isInstalling[t]||!1}function E(e){return e.errorNotices}function g(e,t){return e.errorNotices[t]}var h=n(1),v=n(36),B=n(33),N=n.n(B);const I=e=>new Promise((t,n)=>{const l=document.createElement(e.nodeName);["id","rel","src","href","type"].forEach(t=>{e[t]&&(l[t]=e[t])}),e.innerHTML&&l.appendChild(document.createTextNode(e.innerHTML)),l.onload=()=>t(!0),l.onerror=()=>n(new Error("Error loading asset.")),document.body.appendChild(l),("link"===l.nodeName.toLowerCase()||"script"===l.nodeName.toLowerCase()&&!l.src)&&t()});var T={async LOAD_ASSETS(){const e=await N()({url:document.location.href,parse:!1}),t=await e.text(),n=(new window.DOMParser).parseFromString(t,"text/html"),l=Array.from(n.querySelectorAll('link[rel="stylesheet"],script')).filter(e=>e.id&&!document.getElementById(e.id));for(const e of l)await I(e)}};function L(e){if(!e)return!1;const t=e.links["wp:plugin"]||e.links.self;return!(!t||!t.length)&&t[0].href}function S(e){return{type:"FETCH_DOWNLOADABLE_BLOCKS",filterValue:e}}function C(e,t){return{type:"RECEIVE_DOWNLOADABLE_BLOCKS",downloadableBlocks:e,filterValue:t}}function*x(e){const{id:t,assets:n}=e;let l=!1;yield F(t);try{yield A(e.id,!0);const t=L(e);let c={};if(t)yield Object(b.apiFetch)({url:t,data:{status:"active"},method:"PUT"});else{c=(yield Object(b.apiFetch)({path:"wp/v2/plugins",data:{slug:e.id,status:"active"},method:"POST"}))._links}yield P({...e,links:{...e.links,...c}}),yield function(e){return{type:"LOAD_ASSETS",assets:e}}(n);if(!(yield s.controls.select(i.store.name,"getBlockTypes")).some(t=>t.name===e.name))throw new Error(Object(h.__)("Error registering block. Try reloading the page."));yield s.controls.dispatch(v.store,"createInfoNotice",Object(h.sprintf)(Object(h.__)("Block %s installed and added."),e.title),{speak:!0,type:"snackbar"}),l=!0}catch(e){let n=e.message||Object(h.__)("An error occurred."),l=e instanceof Error;const c={folder_exists:Object(h.__)("This block is already installed. Try reloading the page."),unable_to_connect_to_filesystem:Object(h.__)("Error installing block. You can reload the page and try again.")};c[e.code]&&(l=!0,n=c[e.code]),yield M(t,n,l),yield s.controls.dispatch(v.store,"createErrorNotice",n,{speak:!0,isDismissible:!0})}return yield A(e.id,!1),l}function*D(e){try{yield Object(b.apiFetch)({url:L(e),data:{status:"inactive"},method:"PUT"}),yield Object(b.apiFetch)({url:L(e),method:"DELETE"}),yield R(e)}catch(e){yield s.controls.dispatch(v.store,"createErrorNotice",e.message||Object(h.__)("An error occurred."))}}function P(e){return{type:"ADD_INSTALLED_BLOCK_TYPE",item:e}}function R(e){return{type:"REMOVE_INSTALLED_BLOCK_TYPE",item:e}}function A(e,t){return{type:"SET_INSTALLING_BLOCK",blockId:e,isInstalling:t}}function M(e,t,n=!1){return{type:"SET_ERROR_NOTICE",blockId:e,message:t,isFatal:n}}function F(e){return{type:"CLEAR_ERROR_NOTICE",blockId:e}}var V={*getDownloadableBlocks(e){if(e)try{yield S(e);const t=(yield Object(b.apiFetch)({path:"wp/v2/block-directory/search?term="+e})).map(e=>Object(u.mapKeys)(e,(e,t)=>Object(u.camelCase)(t)));yield C(t,e)}catch(e){}}};const H={reducer:m,selectors:l,actions:c,controls:{...b.controls,...T},resolvers:V},K=Object(s.createReduxStore)("core/block-directory",H);function z(){const{uninstallBlockType:e}=Object(s.useDispatch)(K),t=Object(s.useSelect)(e=>{const{isAutosavingPost:t,isSavingPost:n}=e(d.store);return n()&&!t()},[]),n=Object(s.useSelect)(e=>e(K).getUnusedBlockTypes(),[]);return Object(o.useEffect)(()=>{t&&n.length&&n.forEach(t=>{e(t),Object(i.unregisterBlockType)(t.name)})},[t]),null}Object(s.register)(K);var q=n(4),Y=n(10),$=n(18),U=n(7),G=n(41),W=n(97),J=n(161),Q=n(204),X=n(162);var Z=function({rating:e}){const t=.5*Math.round(e/.5),n=Math.floor(e),l=Math.ceil(e-n),c=5-(n+l);return Object(o.createElement)("span",{"aria-label":Object(h.sprintf)(Object(h.__)("%s out of 5 stars"),t)},Object(u.times)(n,e=>Object(o.createElement)(W.a,{key:"full_stars_"+e,className:"block-directory-block-ratings__star-full",icon:J.a,size:16})),Object(u.times)(l,e=>Object(o.createElement)(W.a,{key:"half_stars_"+e,className:"block-directory-block-ratings__star-half-full",icon:Q.a,size:16})),Object(u.times)(c,e=>Object(o.createElement)(W.a,{key:"empty_stars_"+e,className:"block-directory-block-ratings__star-empty",icon:X.a,size:16})))};var ee=({rating:e})=>Object(o.createElement)("span",{className:"block-directory-block-ratings"},Object(o.createElement)(Z,{rating:e}));var te=function({icon:e}){const t="block-directory-downloadable-block-icon";return null!==e.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/)?Object(o.createElement)("img",{className:t,src:e,alt:""}):Object(o.createElement)(p.BlockIcon,{className:t,icon:e,showColors:!0})};var ne=({block:e})=>{const t=Object(s.useSelect)(t=>t(K).getErrorNoticeForBlock(e.id),[e]);return t?Object(o.createElement)("div",{className:"block-directory-downloadable-block-notice"},Object(o.createElement)("div",{className:"block-directory-downloadable-block-notice__content"},t.message,t.isFatal?" "+Object(h.__)("Try reloading the page."):null)):null};function le({title:e,rating:t,ratingCount:n},{hasNotice:l,isInstalled:c,isInstalling:o}){const r=.5*Math.round(t/.5);return!c&&l?Object(h.sprintf)("Retry installing %s.",Object(G.decodeEntities)(e)):c?Object(h.sprintf)("Add %s.",Object(G.decodeEntities)(e)):o?Object(h.sprintf)("Installing %s.",Object(G.decodeEntities)(e)):n<1?Object(h.sprintf)("Install %s.",Object(G.decodeEntities)(e)):Object(h.sprintf)(Object(h._n)("Install %1$s. %2$s stars with %3$s review.","Install %1$s. %2$s stars with %3$s reviews.",n),Object(G.decodeEntities)(e),r,n)}var ce=function({composite:e,item:t,onClick:n}){const{author:l,description:c,icon:r,rating:a,title:d}=t,b=!!Object(i.getBlockType)(t.name),{hasNotice:u,isInstalling:m,isInstallable:p}=Object(s.useSelect)(e=>{const{getErrorNoticeForBlock:n,isInstalling:l}=e(K),c=n(t.id),o=c&&c.isFatal;return{hasNotice:!!c,isInstalling:l(t.id),isInstallable:!o}},[t]);let O="";return b?O=Object(h.__)("Installed!"):m&&(O=Object(h.__)("Installing…")),Object(o.createElement)(q.__unstableCompositeItem,Object(U.a)({role:"option",as:q.Button},e,{className:"block-directory-downloadable-block-list-item",onClick:e=>{e.preventDefault(),n()},isBusy:m,disabled:m||!p,label:le(t,{hasNotice:u,isInstalled:b,isInstalling:m}),showTooltip:!0,tooltipPosition:"top center"}),Object(o.createElement)("div",{className:"block-directory-downloadable-block-list-item__icon"},Object(o.createElement)(te,{icon:r,title:d}),m?Object(o.createElement)("span",{className:"block-directory-downloadable-block-list-item__spinner"},Object(o.createElement)(q.Spinner,null)):Object(o.createElement)(ee,{rating:a})),Object(o.createElement)("span",{className:"block-directory-downloadable-block-list-item__details"},Object(o.createElement)("span",{className:"block-directory-downloadable-block-list-item__title"},Object(o.createInterpolateElement)(Object(h.sprintf)(Object(h.__)("%1$s <span>by %2$s</span>"),Object(G.decodeEntities)(d),l),{span:Object(o.createElement)("span",{className:"block-directory-downloadable-block-list-item__author"})})),u?Object(o.createElement)(ne,{block:t}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"block-directory-downloadable-block-list-item__desc"},O||Object(G.decodeEntities)(c)),p&&!(b||m)&&Object(o.createElement)(q.VisuallyHidden,null,Object(h.__)("Install block")))))};var oe=function({items:e,onHover:t=u.noop,onSelect:n}){const l=Object(q.__unstableUseCompositeState)(),{installBlockType:c}=Object(s.useDispatch)(K);return e.length?Object(o.createElement)(q.__unstableComposite,Object(U.a)({},l,{role:"listbox",className:"block-directory-downloadable-blocks-list","aria-label":Object(h.__)("Blocks available for install")}),e.map(e=>Object(o.createElement)(ce,{key:e.id,composite:l,onClick:()=>{Object(i.getBlockType)(e.name)?n(e):c(e).then(t=>{t&&n(e)}),t(null)},onHover:t,item:e}))):null},re=n(30);var ae=function({children:e,downloadableItems:t,hasLocalBlocks:n}){const l=t.length;return Object(o.useEffect)(()=>{Object(re.speak)(Object(h.sprintf)(Object(h._n)("%d additional block is available to install.","%d additional blocks are available to install.",l),l))},[l]),Object(o.createElement)(o.Fragment,null,!n&&Object(o.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},Object(h.__)("No results available from your installed blocks.")),Object(o.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),Object(o.createElement)("div",{className:"block-directory-downloadable-blocks-panel"},Object(o.createElement)("div",{className:"block-directory-downloadable-blocks-panel__header"},Object(o.createElement)("h2",{className:"block-directory-downloadable-blocks-panel__title"},Object(h.__)("Available to install")),Object(o.createElement)("p",{className:"block-directory-downloadable-blocks-panel__description"},Object(h.__)("Select a block to install and add it to your post."))),e))},ie=n(134);var se=function(){return Object(o.createElement)("div",{className:"block-editor-inserter__no-results"},Object(o.createElement)(W.a,{className:"block-editor-inserter__no-results-icon",icon:ie.a}),Object(o.createElement)("p",null,Object(h.__)("No results found.")))};var de=Object(Y.compose)([Object(s.withSelect)((e,{filterValue:t,rootClientId:n=null})=>{const{getDownloadableBlocks:l,isRequestingDownloadableBlocks:c}=e(K),{canInsertBlockType:o}=e(p.store),r=e($.store).canUser("read","block-directory/search");return{downloadableItems:r?l(t).filter(e=>o(e,n,!0)):[],hasPermission:r,isLoading:c(t)}})])((function({downloadableItems:e,onSelect:t,onHover:n,hasLocalBlocks:l,hasPermission:c,isLoading:r,isTyping:a}){return void 0===c||r||a?Object(o.createElement)(o.Fragment,null,c&&!l&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},Object(h.__)("No results available from your installed blocks.")),Object(o.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"})),Object(o.createElement)("div",{className:"block-directory-downloadable-blocks-panel has-blocks-loading"},Object(o.createElement)(q.Spinner,null))):!1===c?l?null:Object(o.createElement)(se,null):e.length?Object(o.createElement)(ae,{downloadableItems:e,hasLocalBlocks:l},Object(o.createElement)(oe,{items:e,onSelect:t,onHover:n})):!l&&Object(o.createElement)(se,null)}));var be=function(){const[e,t]=Object(o.useState)(""),n=Object(u.debounce)(t,400);return Object(o.createElement)(p.__experimentalInserterMenuExtension,null,({onSelect:t,onHover:l,filterValue:c,hasItems:r,rootClientId:a})=>(e!==c&&n(c),e?Object(o.createElement)(de,{onSelect:t,onHover:l,rootClientId:a,filterValue:e,hasLocalBlocks:r,isTyping:c!==e}):null))},ue=n(394);function me({items:e}){return e.length?Object(o.createElement)("ul",{className:"block-directory-compact-list"},e.map(({icon:e,id:t,title:n,author:l})=>Object(o.createElement)("li",{key:t,className:"block-directory-compact-list__item"},Object(o.createElement)(te,{icon:e,title:n}),Object(o.createElement)("div",{className:"block-directory-compact-list__item-details"},Object(o.createElement)("div",{className:"block-directory-compact-list__item-title"},n),Object(o.createElement)("div",{className:"block-directory-compact-list__item-author"},Object(h.sprintf)(Object(h.__)("By %s"),l)))))):null}function pe(){const e=Object(s.useSelect)(e=>e(K).getNewBlockTypes(),[]);return e.length?Object(o.createElement)(ue.PluginPrePublishPanel,{icon:ie.a,title:Object(h.sprintf)(Object(h._n)("Added: %d block","Added: %d blocks",e.length),e.length),initialOpen:!0},Object(o.createElement)("p",{className:"installed-blocks-pre-publish-panel__copy"},Object(h._n)("The following block has been added to your site.","The following blocks have been added to your site.",e.length)),Object(o.createElement)(me,{items:e})):null}function Oe({attributes:e,block:t,clientId:n}){const l=Object(s.useSelect)(e=>e(K).isInstalling(t.id)),{installBlockType:c}=Object(s.useDispatch)(K),{replaceBlock:r}=Object(s.useDispatch)(p.store);return Object(o.createElement)(q.Button,{onClick:()=>c(t).then(l=>{if(l){const l=Object(i.getBlockType)(t.name),[c]=Object(i.parse)(e.originalContent);c&&r(n,Object(i.createBlock)(l.name,c.attributes,c.innerBlocks))}}),disabled:l,isBusy:l,isPrimary:!0},Object(h.sprintf)(Object(h.__)("Install %s"),t.title))}const ke=({originalBlock:e,...t})=>{const{originalName:n,originalUndelimitedContent:l}=t.attributes,{replaceBlock:c}=Object(s.useDispatch)(p.store),r=()=>{c(t.clientId,Object(i.createBlock)("core/html",{content:l}))},a=!!l,d=Object(i.getBlockType)("core/html");let b=Object(h.sprintf)(Object(h.__)("Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely."),e.title||n);const u=[Object(o.createElement)(Oe,{key:"install",block:e,attributes:t.attributes,clientId:t.clientId})];return a&&d&&(b=Object(h.sprintf)(Object(h.__)("Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely."),e.title||n),u.push(Object(o.createElement)(q.Button,{key:"convert",onClick:r,isLink:!0},Object(h.__)("Keep as HTML")))),Object(o.createElement)("div",Object(p.useBlockProps)(),Object(o.createElement)(p.Warning,{actions:u},b),Object(o.createElement)(o.RawHTML,null,l))};var je=e=>t=>{const{originalName:n}=t.attributes,{block:l,hasPermission:c}=Object(s.useSelect)(e=>{const{getDownloadableBlocks:t}=e(K),l=t("block:"+n).filter(({name:e})=>n===e);return{hasPermission:e($.store).canUser("read","block-directory/search"),block:l.length&&l[0]}},[n]);return c&&l?Object(o.createElement)(ke,Object(U.a)({},t,{originalBlock:l})):Object(o.createElement)(e,t)};Object(r.registerPlugin)("block-directory",{render:()=>Object(o.createElement)(o.Fragment,null,Object(o.createElement)(z,null),Object(o.createElement)(be,null),Object(o.createElement)(pe,null))}),Object(a.addFilter)("blocks.registerBlockType","block-directory/fallback",(e,t)=>("core/missing"!==t||(e.edit=je(e.edit)),e))},6:function(e,t){e.exports=window.wp.blockEditor},7:function(e,t,n){"use strict";function l(){return(l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return l}))},8:function(e,t){e.exports=window.wp.blocks},97:function(e,t,n){"use strict";var l=n(0);t.a=function({icon:e,size:t=24,...n}){return Object(l.cloneElement)(e,{width:t,height:t,...n})}}}); |