@bluepic/embed 0.2.0-next.26 → 0.2.0-next.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/bluepic-embed.es.js
CHANGED
|
@@ -73469,7 +73469,8 @@ function optimizePreviewUrl(m, c, ie, we) {
|
|
|
73469
73469
|
if (Ie.hostname === "imagedelivery.net") {
|
|
73470
73470
|
const [, Me, Ze, ne] = Ie.pathname.split("/");
|
|
73471
73471
|
return `https://imagedelivery.net/${Me}/${Ze}/${we || `${c || ie ? Object.entries({ w: c, h: ie }).filter(([rr, gr]) => gr !== void 0).map(([rr, gr]) => [rr, String(gr)]).map(([rr, gr]) => `${rr}=${gr}`).join(",") : ne}`}`;
|
|
73472
|
-
}
|
|
73472
|
+
} else
|
|
73473
|
+
return m;
|
|
73473
73474
|
} catch (Ie) {
|
|
73474
73475
|
return console.error(Ie), m;
|
|
73475
73476
|
}
|
package/lib/bluepic-embed.umd.js
CHANGED
|
@@ -2535,7 +2535,7 @@ ${He.vertexSource}`,this.forceManualRenderingForInstanceIDShaders&&(ti=ti.replac
|
|
|
2535
2535
|
|
|
2536
2536
|
|
|
2537
2537
|
}
|
|
2538
|
-
`,document.head.appendChild(ie);const we=vue.createApp({setup(){const Ie=vue.ref(),Me=vue.ref();return{popupProviderRef:Ie,popoverProviderRef:Me}},render(){return[vue.h(PopupProvider,{ref:"popupProviderRef"}),vue.h(PopoverProvider,{ref:"popoverProviderRef"})]}}).mount(c);this.popupProviderRef=we.popupProviderRef,this.popoverProviderRef=we.popoverProviderRef;try{document.body.appendChild(c)}catch(Ie){console.error("Error adding wrapper to body:",Ie)}}}function convertDeprecatedField(m){return m.datatype==="Collection"?{type:"Collection",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{fields:m.props.fields.map(convertDeprecatedField).filter(c=>c!==void 0),min:m.props.min,max:m.props.max,layout:"list"},hitbox:void 0,layout:{maxWidth:"100%",minWidth:"100%"}}:m.datatype==="Dropdown"?{type:"Select",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{size:"medium",layout:"dropdown",showLabels:!0,imageDisplay:"cover",options:m.props.options.map(c=>({label:c.label,value:c.value,image:c.preview}))},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Select"?{type:"Select",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{size:"medium",layout:"button",showLabels:!0,imageDisplay:m.props.imageDisplay,options:m.props.options.map((c,ie)=>({label:`Option ${ie+1}`,value:c.value,image:c.preview}))},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Text"?{type:"Text",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{clearable:m.props.clearable,maxHeight:"150px",maxLength:m.props.maxLength,maxLineLength:m.props.maxLineLength,maxLines:m.props.maxLines,multiline:m.props.multiline,placeholder:m.description??"Text...",showWordCount:m.props.showWordCount,uppercase:!1,richtext:{enabled:m.props.richtext,mixedStyleLabel:{en:m.props.mixedStyleLabel},noStyleLabel:{en:m.props.noStyleLabel},userAgentRichText:m.props.userAgentRichText,options:m.props.richTextOptions}},layout:{minWidth:"120px",maxWidth:"auto"},hitbox:void 0}:m.datatype==="Image"?{type:"Image",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{allowUploadFromDevice:m.props.allowUpload??!0,allowedTypes:["image/png","image/jpeg","image/gif","image/webp","image/svg+xml"],convertTo:void 0,width:m.props.width,height:m.props.height,imageLibraries:m.props.imageLibraries.map(c=>c.props?.sharingUrl?c.props.sharingUrl.indexOf("googledrive")>-1?{type:"sharedDrive",service:"googledrive",label:c.label,sharedUrl:c.props.sharingUrl}:{type:"sharedDrive",service:"onedrive",label:c.label,sharedUrl:c.props.sharingUrl}:{type:"custom",name:c.name,label:c.label,controller:c.controller,props:c.props}),layout:"normal",quality:m.props.quality,removeBackground:!1,uploadLabel:"Upload Image"},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="ImageAdjust"?{type:"ImageAdjust",model:{...m.model,image:m.model.image,adjust:m.model.adjust},description:m.description,detailedDescription:void 0,props:{aspectRatio:m.props.aspectRatio,maxScale:m.props.maxScale,minScale:m.props.minScale,maxX:m.props.maxX,maxY:m.props.maxY,minX:m.props.minX,minY:m.props.minY,type:"popup"},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Switch"?{type:"Checkbox",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{label:"",size:"medium"},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Number"?{type:"Number",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{min:m.props.min,max:m.props.max,step:m.props.step,type:"slider"},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Color"?{type:"Color",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{alpha:!0},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Map"?{type:"Map",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{aspectRatio:m.props.aspectRatio,mapStyle:m.props.mapStyle,mapboxAccessToken:m.props.mapboxAccessToken,padding:m.props.padding,type:m.props.type},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:void 0}function getCloudflareLiveUrl(m,c){return`https://${m?`${m.replaceAll(/\./g,"-")}.`:""}${c.cloudflarePagesHostname}`}function getTemplateSerialUrl(m,c){return`${c.embedApiBaseUrl}/api/public/project/serial/${m}?${new URLSearchParams({env:c.env}).toString()}`}function getTemplatePreviewUrl(m,c){return`${c.embedApiBaseUrl}/api/public/project/preview/${m}?${new URLSearchParams({env:c.env}).toString()}`}function getTemplateLiveUrl(m,c,ie){return`${getCloudflareLiveUrl(c,ie)}?`+new URLSearchParams(Object.fromEntries(Object.entries({fonts:JSON.stringify(ie.config.fonts??[]),webgl:ie.config.webgl,resolution:ie.config.resolution,autoDetectBxCoreVersion:c===void 0,resolveSerial:ie.useBoilerplate?void 0:getTemplateSerialUrl(m,ie)}).filter(([,Ie])=>Ie&&Ie!=="null"))).toString()}function optimizePreviewUrl(m,c,ie,we){try{const Ie=new URL(m);if(Ie.hostname==="imagedelivery.net"){const[,Me,Ze,ne]=Ie.pathname.split("/");return`https://imagedelivery.net/${Me}/${Ze}/${we||`${c||ie?Object.entries({w:c,h:ie}).filter(([rr,vr])=>vr!==void 0).map(([rr,vr])=>[rr,String(vr)]).map(([rr,vr])=>`${rr}=${vr}`).join(","):ne}`}`}}catch(Ie){return console.error(Ie),m}}class EmbeddedController extends EventTarget{iframe;alive;ready;sessionId;$data;constructor(c,ie,we=5){super(),this.iframe=c,this.alive=!0,this.ready=!1,this.sessionId=null,this.initListener();let Ie=!1,Me=!1;this.addEventListener("mounted",async()=>{if(ie!==void 0&&!Me){const rr=await ie;Me=!0,rr?await this.evaluate(vr=>{const lr=JSON.parse(vr);window.bx_serial.value=lr},JSON.stringify(rr)):this.dispatchEvent(new CustomEvent("error",{detail:{code:2}}))}else Ie||(Ie=!0,this.dispatchEvent(new CustomEvent("ready")))}),this.addEventListener("setGlobalScope",rr=>{const vr=Object.fromEntries(Object.entries(rr.detail).map(([yr,kr])=>kr?.__type__==="function"?[yr,new Function(`return (${kr.__value__})()`)]:[yr,kr])),lr=new CustomEvent("globalScope",{detail:vr});this.dispatchEvent(lr)});const Ze=setInterval(async()=>{if(!this.alive)return clearInterval(Ze);try{await this.ping()&&clearInterval(Ze)}catch{}},5);this.$data=new Proxy(this,{get(rr,vr){return rr.get(vr)},set(rr,vr,lr){return rr.set(vr,lr)}});let ne=0;this.addEventListener("http:error",rr=>{const vr=rr.detail?.code;if(vr>=400&&(console.error("ERROR DURING LIVE REQUEST",vr),vr===412))if(ne<we){const lr=new URL(c.src);lr.searchParams.set("force",Date.now().toString()),c.src=lr.toString(),ne++}else this.dispatchEvent(new CustomEvent("error",{detail:{code:412}}))})}destroy(){this.alive=!1}ping(c=100){return new Promise((ie,we)=>{const Ie=Date.now(),Me=Ie,Ze=setTimeout(we,c),ne=({data:rr})=>{this.alive&&rr.type=="pong"&&rr.id==Me&&(ie(Date.now()-Ie),clearTimeout(Ze),window.removeEventListener("message",ne))};window.addEventListener("message",ne);try{this.iframe.contentWindow?.postMessage({type:"ping",id:Me},"*")}catch{}})}getSessionId(){return new Promise(c=>{const ie=nanoid();this.apply("getSessionId",ie),window.addEventListener("message",({data:we})=>{we.scope==="bx"&&we.taskId===ie&&c(we.sessionId)})})}messageIsSession(c){return c.sessionId==this.sessionId}messageIsEvent(c){return c.type=="event"}initListener(){window.addEventListener("message",async({data:c})=>{if(c.error&&(console.error("ERROR FROM LIVE SANDBOX",c),c?.response?.error==="File ist not embedded"?this.dispatchEvent(new CustomEvent("error",{detail:{code:2}})):this.dispatchEvent(new CustomEvent("error",{detail:{code:1}}))),this.messageIsSession(c)&&(c.taskId&&this.dispatchEvent(new CustomEvent("rerender")),this.messageIsEvent(c))){const ie=new CustomEvent(c.message,{detail:c.payload});this.dispatchEvent(ie)}if(c.type==="bx:init"){const ie=await this.getSessionId();ie!=this.sessionId&&(this.sessionId=ie,this.dispatchEvent(new CustomEvent("init"))),this.dispatchEvent(new CustomEvent("roll"))}c.type==="event"&&c.message==="mounted"&&this.dispatchEvent(new CustomEvent("mounted"))},!1)}apply(c,...ie){try{this.iframe.contentWindow?.postMessage({type:"action",name:c,args:ie},"*")}catch(we){console.error(we)}}get(c){return this.evaluate(ie=>this.$data[ie],c)}set(c,ie){return this.apply("set",c,ie),!0}evaluate(c,...ie){return new Promise((we,Ie)=>{const Me=nanoid();this.apply("evaluate",c.toString(),Me,ie);const Ze=({detail:rr})=>{if(rr.processId==Me){try{we(JSON.parse(rr.result))}catch{we(rr.result)}this.removeEventListener("return",Ze),this.removeEventListener("error",ne)}},ne=({detail:rr})=>{rr.processId==Me&&(Ie(rr.error),this.removeEventListener("return",Ze),this.removeEventListener("error",ne))};this.addEventListener("return",Ze),this.addEventListener("error",ne)})}setData(c){return new Promise((ie,we)=>{this.evaluate(Ie=>{const Me=JSON.parse(Ie);for(const Ze in Me)window.bx_data[Ze]=Me[Ze]},JSON.stringify(c)).then(Ie=>{ie(Ie)}).catch(Ie=>{we(Ie)})})}transform(c,ie,we,Ie){this.apply("transform",c,ie,we,Ie)}}function dataUrlToBlob(m){const c=window.atob(m.split(",")[1]),ie=m.split(",")[0].split(":")[1].split(";")[0],we=new ArrayBuffer(c.length),Ie=new Uint8Array(we);for(var Me=0;Me<c.length;Me++)Ie[Me]=c.charCodeAt(Me);return new Blob([we],{type:ie})}var css={},commentre=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,parse$b=function(m,c){c=c||{};var ie=1,we=1;function Ie(nr){var $e=nr.match(/\n/g);$e&&(ie+=$e.length);var ur=nr.lastIndexOf(`
|
|
2538
|
+
`,document.head.appendChild(ie);const we=vue.createApp({setup(){const Ie=vue.ref(),Me=vue.ref();return{popupProviderRef:Ie,popoverProviderRef:Me}},render(){return[vue.h(PopupProvider,{ref:"popupProviderRef"}),vue.h(PopoverProvider,{ref:"popoverProviderRef"})]}}).mount(c);this.popupProviderRef=we.popupProviderRef,this.popoverProviderRef=we.popoverProviderRef;try{document.body.appendChild(c)}catch(Ie){console.error("Error adding wrapper to body:",Ie)}}}function convertDeprecatedField(m){return m.datatype==="Collection"?{type:"Collection",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{fields:m.props.fields.map(convertDeprecatedField).filter(c=>c!==void 0),min:m.props.min,max:m.props.max,layout:"list"},hitbox:void 0,layout:{maxWidth:"100%",minWidth:"100%"}}:m.datatype==="Dropdown"?{type:"Select",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{size:"medium",layout:"dropdown",showLabels:!0,imageDisplay:"cover",options:m.props.options.map(c=>({label:c.label,value:c.value,image:c.preview}))},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Select"?{type:"Select",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{size:"medium",layout:"button",showLabels:!0,imageDisplay:m.props.imageDisplay,options:m.props.options.map((c,ie)=>({label:`Option ${ie+1}`,value:c.value,image:c.preview}))},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Text"?{type:"Text",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{clearable:m.props.clearable,maxHeight:"150px",maxLength:m.props.maxLength,maxLineLength:m.props.maxLineLength,maxLines:m.props.maxLines,multiline:m.props.multiline,placeholder:m.description??"Text...",showWordCount:m.props.showWordCount,uppercase:!1,richtext:{enabled:m.props.richtext,mixedStyleLabel:{en:m.props.mixedStyleLabel},noStyleLabel:{en:m.props.noStyleLabel},userAgentRichText:m.props.userAgentRichText,options:m.props.richTextOptions}},layout:{minWidth:"120px",maxWidth:"auto"},hitbox:void 0}:m.datatype==="Image"?{type:"Image",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{allowUploadFromDevice:m.props.allowUpload??!0,allowedTypes:["image/png","image/jpeg","image/gif","image/webp","image/svg+xml"],convertTo:void 0,width:m.props.width,height:m.props.height,imageLibraries:m.props.imageLibraries.map(c=>c.props?.sharingUrl?c.props.sharingUrl.indexOf("googledrive")>-1?{type:"sharedDrive",service:"googledrive",label:c.label,sharedUrl:c.props.sharingUrl}:{type:"sharedDrive",service:"onedrive",label:c.label,sharedUrl:c.props.sharingUrl}:{type:"custom",name:c.name,label:c.label,controller:c.controller,props:c.props}),layout:"normal",quality:m.props.quality,removeBackground:!1,uploadLabel:"Upload Image"},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="ImageAdjust"?{type:"ImageAdjust",model:{...m.model,image:m.model.image,adjust:m.model.adjust},description:m.description,detailedDescription:void 0,props:{aspectRatio:m.props.aspectRatio,maxScale:m.props.maxScale,minScale:m.props.minScale,maxX:m.props.maxX,maxY:m.props.maxY,minX:m.props.minX,minY:m.props.minY,type:"popup"},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Switch"?{type:"Checkbox",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{label:"",size:"medium"},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Number"?{type:"Number",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{min:m.props.min,max:m.props.max,step:m.props.step,type:"slider"},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Color"?{type:"Color",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{alpha:!0},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Map"?{type:"Map",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{aspectRatio:m.props.aspectRatio,mapStyle:m.props.mapStyle,mapboxAccessToken:m.props.mapboxAccessToken,padding:m.props.padding,type:m.props.type},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:void 0}function getCloudflareLiveUrl(m,c){return`https://${m?`${m.replaceAll(/\./g,"-")}.`:""}${c.cloudflarePagesHostname}`}function getTemplateSerialUrl(m,c){return`${c.embedApiBaseUrl}/api/public/project/serial/${m}?${new URLSearchParams({env:c.env}).toString()}`}function getTemplatePreviewUrl(m,c){return`${c.embedApiBaseUrl}/api/public/project/preview/${m}?${new URLSearchParams({env:c.env}).toString()}`}function getTemplateLiveUrl(m,c,ie){return`${getCloudflareLiveUrl(c,ie)}?`+new URLSearchParams(Object.fromEntries(Object.entries({fonts:JSON.stringify(ie.config.fonts??[]),webgl:ie.config.webgl,resolution:ie.config.resolution,autoDetectBxCoreVersion:c===void 0,resolveSerial:ie.useBoilerplate?void 0:getTemplateSerialUrl(m,ie)}).filter(([,Ie])=>Ie&&Ie!=="null"))).toString()}function optimizePreviewUrl(m,c,ie,we){try{const Ie=new URL(m);if(Ie.hostname==="imagedelivery.net"){const[,Me,Ze,ne]=Ie.pathname.split("/");return`https://imagedelivery.net/${Me}/${Ze}/${we||`${c||ie?Object.entries({w:c,h:ie}).filter(([rr,vr])=>vr!==void 0).map(([rr,vr])=>[rr,String(vr)]).map(([rr,vr])=>`${rr}=${vr}`).join(","):ne}`}`}else return m}catch(Ie){return console.error(Ie),m}}class EmbeddedController extends EventTarget{iframe;alive;ready;sessionId;$data;constructor(c,ie,we=5){super(),this.iframe=c,this.alive=!0,this.ready=!1,this.sessionId=null,this.initListener();let Ie=!1,Me=!1;this.addEventListener("mounted",async()=>{if(ie!==void 0&&!Me){const rr=await ie;Me=!0,rr?await this.evaluate(vr=>{const lr=JSON.parse(vr);window.bx_serial.value=lr},JSON.stringify(rr)):this.dispatchEvent(new CustomEvent("error",{detail:{code:2}}))}else Ie||(Ie=!0,this.dispatchEvent(new CustomEvent("ready")))}),this.addEventListener("setGlobalScope",rr=>{const vr=Object.fromEntries(Object.entries(rr.detail).map(([yr,kr])=>kr?.__type__==="function"?[yr,new Function(`return (${kr.__value__})()`)]:[yr,kr])),lr=new CustomEvent("globalScope",{detail:vr});this.dispatchEvent(lr)});const Ze=setInterval(async()=>{if(!this.alive)return clearInterval(Ze);try{await this.ping()&&clearInterval(Ze)}catch{}},5);this.$data=new Proxy(this,{get(rr,vr){return rr.get(vr)},set(rr,vr,lr){return rr.set(vr,lr)}});let ne=0;this.addEventListener("http:error",rr=>{const vr=rr.detail?.code;if(vr>=400&&(console.error("ERROR DURING LIVE REQUEST",vr),vr===412))if(ne<we){const lr=new URL(c.src);lr.searchParams.set("force",Date.now().toString()),c.src=lr.toString(),ne++}else this.dispatchEvent(new CustomEvent("error",{detail:{code:412}}))})}destroy(){this.alive=!1}ping(c=100){return new Promise((ie,we)=>{const Ie=Date.now(),Me=Ie,Ze=setTimeout(we,c),ne=({data:rr})=>{this.alive&&rr.type=="pong"&&rr.id==Me&&(ie(Date.now()-Ie),clearTimeout(Ze),window.removeEventListener("message",ne))};window.addEventListener("message",ne);try{this.iframe.contentWindow?.postMessage({type:"ping",id:Me},"*")}catch{}})}getSessionId(){return new Promise(c=>{const ie=nanoid();this.apply("getSessionId",ie),window.addEventListener("message",({data:we})=>{we.scope==="bx"&&we.taskId===ie&&c(we.sessionId)})})}messageIsSession(c){return c.sessionId==this.sessionId}messageIsEvent(c){return c.type=="event"}initListener(){window.addEventListener("message",async({data:c})=>{if(c.error&&(console.error("ERROR FROM LIVE SANDBOX",c),c?.response?.error==="File ist not embedded"?this.dispatchEvent(new CustomEvent("error",{detail:{code:2}})):this.dispatchEvent(new CustomEvent("error",{detail:{code:1}}))),this.messageIsSession(c)&&(c.taskId&&this.dispatchEvent(new CustomEvent("rerender")),this.messageIsEvent(c))){const ie=new CustomEvent(c.message,{detail:c.payload});this.dispatchEvent(ie)}if(c.type==="bx:init"){const ie=await this.getSessionId();ie!=this.sessionId&&(this.sessionId=ie,this.dispatchEvent(new CustomEvent("init"))),this.dispatchEvent(new CustomEvent("roll"))}c.type==="event"&&c.message==="mounted"&&this.dispatchEvent(new CustomEvent("mounted"))},!1)}apply(c,...ie){try{this.iframe.contentWindow?.postMessage({type:"action",name:c,args:ie},"*")}catch(we){console.error(we)}}get(c){return this.evaluate(ie=>this.$data[ie],c)}set(c,ie){return this.apply("set",c,ie),!0}evaluate(c,...ie){return new Promise((we,Ie)=>{const Me=nanoid();this.apply("evaluate",c.toString(),Me,ie);const Ze=({detail:rr})=>{if(rr.processId==Me){try{we(JSON.parse(rr.result))}catch{we(rr.result)}this.removeEventListener("return",Ze),this.removeEventListener("error",ne)}},ne=({detail:rr})=>{rr.processId==Me&&(Ie(rr.error),this.removeEventListener("return",Ze),this.removeEventListener("error",ne))};this.addEventListener("return",Ze),this.addEventListener("error",ne)})}setData(c){return new Promise((ie,we)=>{this.evaluate(Ie=>{const Me=JSON.parse(Ie);for(const Ze in Me)window.bx_data[Ze]=Me[Ze]},JSON.stringify(c)).then(Ie=>{ie(Ie)}).catch(Ie=>{we(Ie)})})}transform(c,ie,we,Ie){this.apply("transform",c,ie,we,Ie)}}function dataUrlToBlob(m){const c=window.atob(m.split(",")[1]),ie=m.split(",")[0].split(":")[1].split(";")[0],we=new ArrayBuffer(c.length),Ie=new Uint8Array(we);for(var Me=0;Me<c.length;Me++)Ie[Me]=c.charCodeAt(Me);return new Blob([we],{type:ie})}var css={},commentre=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,parse$b=function(m,c){c=c||{};var ie=1,we=1;function Ie(nr){var $e=nr.match(/\n/g);$e&&(ie+=$e.length);var ur=nr.lastIndexOf(`
|
|
2539
2539
|
`);we=~ur?nr.length-ur:we+nr.length}function Me(){var nr={line:ie,column:we};return function($e){return $e.position=new Ze(nr),Ar(),$e}}function Ze(nr){this.start=nr,this.end={line:ie,column:we},this.source=c.source}Ze.prototype.content=m;var ne=[];function rr(nr){var $e=new Error(c.source+":"+ie+":"+we+": "+nr);if($e.reason=nr,$e.filename=c.source,$e.line=ie,$e.column=we,$e.source=m,c.silent)ne.push($e);else throw $e}function vr(){var nr=kr();return{type:"stylesheet",stylesheet:{source:c.source,rules:nr,parsingErrors:ne}}}function lr(){return Br(/^{\s*/)}function yr(){return Br(/^}/)}function kr(){var nr,$e=[];for(Ar(),Pr($e);m.length&&m.charAt(0)!="}"&&(nr=pr()||br());)nr!==!1&&($e.push(nr),Pr($e));return $e}function Br(nr){var $e=nr.exec(m);if(!!$e){var ur=$e[0];return Ie(ur),m=m.slice(ur.length),$e}}function Ar(){Br(/^\s*/)}function Pr(nr){var $e;for(nr=nr||[];$e=Vr();)$e!==!1&&nr.push($e);return nr}function Vr(){var nr=Me();if(!(m.charAt(0)!="/"||m.charAt(1)!="*")){for(var $e=2;m.charAt($e)!=""&&(m.charAt($e)!="*"||m.charAt($e+1)!="/");)++$e;if($e+=2,m.charAt($e-1)==="")return rr("End of comment missing");var ur=m.slice(2,$e-2);return we+=2,Ie(ur),m=m.slice($e),we+=2,nr({type:"comment",comment:ur})}}function ei(){var nr=Br(/^([^{]+)/);if(!!nr)return trim(nr[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function($e){return $e.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function($e){return $e.replace(/\u200C/g,",")})}function Nr(){var nr=Me(),$e=Br(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!!$e){if($e=trim($e[0]),!Br(/^:\s*/))return rr("property missing ':'");var ur=Br(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),$r=nr({type:"declaration",property:$e.replace(commentre,""),value:ur?trim(ur[0]).replace(commentre,""):""});return Br(/^[;\s]*/),$r}}function Zr(){var nr=[];if(!lr())return rr("missing '{'");Pr(nr);for(var $e;$e=Nr();)$e!==!1&&(nr.push($e),Pr(nr));return yr()?nr:rr("missing '}'")}function Wr(){for(var nr,$e=[],ur=Me();nr=Br(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)$e.push(nr[1]),Br(/^,\s*/);if(!!$e.length)return ur({type:"keyframe",values:$e,declarations:Zr()})}function oi(){var nr=Me(),ur=Br(/^@([-\w]+)?keyframes\s*/);if(!!ur){var $e=ur[1],ur=Br(/^([-\w]+)\s*/);if(!ur)return rr("@keyframes missing name");var $r=ur[1];if(!lr())return rr("@keyframes missing '{'");for(var Yr,wi=Pr();Yr=Wr();)wi.push(Yr),wi=wi.concat(Pr());return yr()?nr({type:"keyframes",name:$r,vendor:$e,keyframes:wi}):rr("@keyframes missing '}'")}}function ui(){var nr=Me(),$e=Br(/^@supports *([^{]+)/);if(!!$e){var ur=trim($e[1]);if(!lr())return rr("@supports missing '{'");var $r=Pr().concat(kr());return yr()?nr({type:"supports",supports:ur,rules:$r}):rr("@supports missing '}'")}}function fi(){var nr=Me(),$e=Br(/^@host\s*/);if(!!$e){if(!lr())return rr("@host missing '{'");var ur=Pr().concat(kr());return yr()?nr({type:"host",rules:ur}):rr("@host missing '}'")}}function di(){var nr=Me(),$e=Br(/^@media *([^{]+)/);if(!!$e){var ur=trim($e[1]);if(!lr())return rr("@media missing '{'");var $r=Pr().concat(kr());return yr()?nr({type:"media",media:ur,rules:$r}):rr("@media missing '}'")}}function li(){var nr=Me(),$e=Br(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(!!$e)return nr({type:"custom-media",name:trim($e[1]),media:trim($e[2])})}function hi(){var nr=Me(),$e=Br(/^@page */);if(!!$e){var ur=ei()||[];if(!lr())return rr("@page missing '{'");for(var $r=Pr(),Yr;Yr=Nr();)$r.push(Yr),$r=$r.concat(Pr());return yr()?nr({type:"page",selectors:ur,declarations:$r}):rr("@page missing '}'")}}function gr(){var nr=Me(),$e=Br(/^@([-\w]+)?document *([^{]+)/);if(!!$e){var ur=trim($e[1]),$r=trim($e[2]);if(!lr())return rr("@document missing '{'");var Yr=Pr().concat(kr());return yr()?nr({type:"document",document:$r,vendor:ur,rules:Yr}):rr("@document missing '}'")}}function Ae(){var nr=Me(),$e=Br(/^@font-face\s*/);if(!!$e){if(!lr())return rr("@font-face missing '{'");for(var ur=Pr(),$r;$r=Nr();)ur.push($r),ur=ur.concat(Pr());return yr()?nr({type:"font-face",declarations:ur}):rr("@font-face missing '}'")}}var ze=or("import"),Ue=or("charset"),tr=or("namespace");function or(nr){var $e=new RegExp("^@"+nr+"\\s*([^;]+);");return function(){var ur=Me(),$r=Br($e);if(!!$r){var Yr={type:nr};return Yr[nr]=$r[1].trim(),ur(Yr)}}}function pr(){if(m[0]=="@")return oi()||di()||li()||ui()||ze()||Ue()||tr()||gr()||hi()||fi()||Ae()}function br(){var nr=Me(),$e=ei();return $e?(Pr(),nr({type:"rule",selectors:$e,declarations:Zr()})):rr("selector missing")}return addParent(vr())};function trim(m){return m?m.replace(/^\s+|\s+$/g,""):""}function addParent(m,c){var ie=m&&typeof m.type=="string",we=ie?m:c;for(var Ie in m){var Me=m[Ie];Array.isArray(Me)?Me.forEach(function(Ze){addParent(Ze,we)}):Me&&typeof Me=="object"&&addParent(Me,we)}return ie&&Object.defineProperty(m,"parent",{configurable:!0,writable:!0,enumerable:!1,value:c||null}),m}var compiler=Compiler$2;function Compiler$2(m){this.options=m||{}}Compiler$2.prototype.emit=function(m){return m},Compiler$2.prototype.visit=function(m){return this[m.type](m)},Compiler$2.prototype.mapVisit=function(m,c){var ie="";c=c||"";for(var we=0,Ie=m.length;we<Ie;we++)ie+=this.visit(m[we]),c&&we<Ie-1&&(ie+=this.emit(c));return ie};var Base$1=compiler,inherits$1=inherits_browser.exports,compress=Compiler$1;function Compiler$1(m){Base$1.call(this,m)}inherits$1(Compiler$1,Base$1),Compiler$1.prototype.compile=function(m){return m.stylesheet.rules.map(this.visit,this).join("")},Compiler$1.prototype.comment=function(m){return this.emit("",m.position)},Compiler$1.prototype.import=function(m){return this.emit("@import "+m.import+";",m.position)},Compiler$1.prototype.media=function(m){return this.emit("@media "+m.media,m.position)+this.emit("{")+this.mapVisit(m.rules)+this.emit("}")},Compiler$1.prototype.document=function(m){var c="@"+(m.vendor||"")+"document "+m.document;return this.emit(c,m.position)+this.emit("{")+this.mapVisit(m.rules)+this.emit("}")},Compiler$1.prototype.charset=function(m){return this.emit("@charset "+m.charset+";",m.position)},Compiler$1.prototype.namespace=function(m){return this.emit("@namespace "+m.namespace+";",m.position)},Compiler$1.prototype.supports=function(m){return this.emit("@supports "+m.supports,m.position)+this.emit("{")+this.mapVisit(m.rules)+this.emit("}")},Compiler$1.prototype.keyframes=function(m){return this.emit("@"+(m.vendor||"")+"keyframes "+m.name,m.position)+this.emit("{")+this.mapVisit(m.keyframes)+this.emit("}")},Compiler$1.prototype.keyframe=function(m){var c=m.declarations;return this.emit(m.values.join(","),m.position)+this.emit("{")+this.mapVisit(c)+this.emit("}")},Compiler$1.prototype.page=function(m){var c=m.selectors.length?m.selectors.join(", "):"";return this.emit("@page "+c,m.position)+this.emit("{")+this.mapVisit(m.declarations)+this.emit("}")},Compiler$1.prototype["font-face"]=function(m){return this.emit("@font-face",m.position)+this.emit("{")+this.mapVisit(m.declarations)+this.emit("}")},Compiler$1.prototype.host=function(m){return this.emit("@host",m.position)+this.emit("{")+this.mapVisit(m.rules)+this.emit("}")},Compiler$1.prototype["custom-media"]=function(m){return this.emit("@custom-media "+m.name+" "+m.media+";",m.position)},Compiler$1.prototype.rule=function(m){var c=m.declarations;return c.length?this.emit(m.selectors.join(","),m.position)+this.emit("{")+this.mapVisit(c)+this.emit("}"):""},Compiler$1.prototype.declaration=function(m){return this.emit(m.property+":"+m.value,m.position)+this.emit(";")};var Base=compiler,inherits=inherits_browser.exports,identity=Compiler;function Compiler(m){m=m||{},Base.call(this,m),this.indentation=m.indent}inherits(Compiler,Base),Compiler.prototype.compile=function(m){return this.stylesheet(m)},Compiler.prototype.stylesheet=function(m){return this.mapVisit(m.stylesheet.rules,`
|
|
2540
2540
|
|
|
2541
2541
|
`)},Compiler.prototype.comment=function(m){return this.emit(this.indent()+"/*"+m.comment+"*/",m.position)},Compiler.prototype.import=function(m){return this.emit("@import "+m.import+";",m.position)},Compiler.prototype.media=function(m){return this.emit("@media "+m.media,m.position)+this.emit(` {
|
|
@@ -22,7 +22,7 @@ export declare function getTemplatePreviewUrl(templateId: string, options: {
|
|
|
22
22
|
env: 'dev' | 'prod';
|
|
23
23
|
}): string;
|
|
24
24
|
export declare function getTemplateLiveUrl(id: string, knownBxCoreVersion: string | undefined, options: BxTemplateOptions): string;
|
|
25
|
-
export declare function optimizePreviewUrl(url: string, width?: number, height?: number, variant?: 'public' | 'avatar'): string
|
|
25
|
+
export declare function optimizePreviewUrl(url: string, width?: number, height?: number, variant?: 'public' | 'avatar'): string;
|
|
26
26
|
export default class EmbeddedController extends EventTarget {
|
|
27
27
|
iframe: HTMLIFrameElement;
|
|
28
28
|
alive: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bluepicEmbed.d.ts","sourceRoot":"","sources":["bluepicE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