camper/web/static/isolated-block-editor@2.26....

9 lines
3.5 MiB
JavaScript
Raw Normal View History

/*! For license information please see isolated-block-editor.js.LICENSE.txt */
(()=>{var e,t,n={6996:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===a)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},1269:e=>{e.exports=function(e){return e&&"__experimental"in e&&!1!==e.__experimental}},1893:(e,t)=>{var n;!function(){"use strict";var o=function(){function e(){}function t(e,t){for(var n=t.length,o=0;o<n;++o)r(e,t[o])}e.prototype=Object.create(null);var n={}.hasOwnProperty;var o=/\s+/;function r(e,r){if(r){var a=typeof r;"string"===a?function(e,t){for(var n=t.split(o),r=n.length,a=0;a<r;++a)e[n[a]]=!0}(e,r):Array.isArray(r)?t(e,r):"object"===a?function(e,t){if(t.toString===Object.prototype.toString)for(var o in t)n.call(t,o)&&(e[o]=!!t[o]);else e[t.toString()]=!0}(e,r):"number"===a&&function(e,t){e[t]=!0}(e,r)}}return function(){for(var n=arguments.length,o=Array(n),r=0;r<n;r++)o[r]=arguments[r];var a=new e;t(a,o);var i=[];for(var s in a)a[s]&&i.push(s);return i.join(" ")}}();e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},7383:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===a)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},7414:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===a)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},9253:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===a)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},8752:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===a)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},2438:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===a)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},936
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
`,Kee=Nw("svg",{target:"ea4tfvq2"})("width:",qD.spinnerSize,"px;height:",qD.spinnerSize,"px;display:inline-block;margin:5px 11px 0;position:relative;color:",xB.ui.theme,";overflow:visible;opacity:1;background-color:transparent;"),Jee={name:"9s4963",styles:"fill:transparent;stroke-width:1.5px"},Zee=Nw("circle",{target:"ea4tfvq1"})(Jee,";stroke:",xB.gray[300],";"),Qee=Nw("path",{target:"ea4tfvq0"})(Jee,";stroke:currentColor;stroke-linecap:round;transform-origin:50% 50%;animation:1.4s linear infinite both ",Gee,";");const ete=(0,Nt.forwardRef)((function({className:e,...t},n){return(0,Nt.createElement)(Kee,{className:Cm()("components-spinner",e),viewBox:"0 0 100 100",width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",role:"presentation",focusable:"false",...t,ref:n},(0,Nt.createElement)(Zee,{cx:"50",cy:"50",r:"50",vectorEffect:"non-scaling-stroke"}),(0,Nt.createElement)(Qee,{d:"m 50 0 a 50 50 0 0 1 50 50",vectorEffect:"non-scaling-stroke"}))})),tte={image:"img",video:"video",audio:"audio"};function nte(e,t){const n={id:e.id||void 0,caption:e.caption||void 0},o=e.url,r=e.alt||void 0;"image"===t?(n.url=o,n.alt=r):["video","audio"].includes(t)&&(n.src=o);const a=tte[t],i=(0,Nt.createElement)(a,{src:e.previewUrl||o,alt:r,controls:"audio"===t||void 0,inert:"true",onError:({currentTarget:t})=>{t.src===e.previewUrl&&(t.src=o)}});return[Ha(`core/${t}`,n),i]}const ote=["image"],rte=25,ate={position:"bottom left",className:"block-editor-inserter__media-list__item-preview-options__popover"};function ite({category:e,media:t}){if(!e.getReportUrl)return null;const n=e.getReportUrl(t);return(0,Nt.createElement)(YW,{className:"block-editor-inserter__media-list__item-preview-options",label:ur("Options"),popoverProps:ate,icon:Y0},(()=>(0,Nt.createElement)(nV,null,(0,Nt.createElement)(oV,{onClick:()=>window.open(n,"_blank").focus(),icon:A0},Qo(ur("Report %s"),e.mediaType)))))}function ste({onClose:e,onSubmit:t}){return(0,Nt.createElement)(F1,{title:ur("Insert external image"),onRequestClose:e,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal"},(0,Nt.createElement)(lee,{spacing:3},(0,Nt.createElement)("p",null,ur("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")),(0,Nt.createElement)("p",null,ur("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation."))),(0,Nt.createElement)(sD,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,Nt.createElement)(lD,null,(0,Nt.createElement)(Fw,{variant:"tertiary",onClick:e},ur("Cancel"))),(0,Nt.createElement)(lD,null,(0,Nt.createElement)(Fw,{variant:"primary",onClick:t},ur("Insert")))))}function cte({media:e,onClick:t,composite:n,category:o}){const[r,a]=(0,Nt.useState)(!1),[i,s]=(0,Nt.useState)(!1),[c,l]=(0,Nt.useState)(!1),[p,u]=(0,Nt.useMemo)((()=>nte(e,o.mediaType)),[e,o.mediaType]),{createErrorNotice:d,createSuccessNotice:b}=km(S9),m=pu((e=>e(FT).getSettings().mediaUpload),[]),M=(0,Nt.useCallback)((e=>{if(c)return;const n=Ya(e),{id:o,url:r,caption:i}=n.attributes;o?t(n):(l(!0),window.fetch(r).then((e=>e.blob())).then((e=>{m({filesList:[e],additionalData:{caption:i},onFileChange([e]){xp(e.url)||(t({...n,attributes:{...n.attributes,id:e.id,url:e.url}}),b(ur("Image uploaded and inserted."),{type:"snackbar"}),l(!1))},allowedTypes:ote,onError(e){d(e,{type:"snackbar"}),l(!1)}})})).catch((()=>{a(!0),l(!1)})))}),[c,t,m,d,b]),f=e.title?.rendered||e.title;let z;if(f.length>rte){const e="...";z=f.slice(0,rte-e.length)+e}const h=(0,Nt.useCallback)((()=>s(!0)),[]),g=(0,Nt.useCallback)((()=>s(!1)),[]);return(0,Nt.createElement)(Nt.Fragment,null,(0,Nt.createElement)(F7,{isEnabled:!0,blocks:[p]},(({draggable:t,onDragStart:r,onDragEnd:a})=>(0,Nt.createElement)("div",{className:Em()("block-editor-inserter__media-list__list-item",{"is-hovered":i}),draggable:t,onDragStart:r,onDragEnd:a},(0,Nt.createElement)(tw,{text:z||f},(0,Nt.createElement)("div",{onMouseEnter:h,onMouseLeave:g},(0,Nt.createElement