@colegium_dev/vue3-unlayer-embed 1.0.7 → 1.0.8

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.
@@ -1 +1 @@
1
- *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Nunito,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{font-family:Nunito}html,body,form{height:100vh;margin:0;padding:0}#app{margin:0 auto;height:inherit;width:inherit}@font-face{font-family:Nunito;font-style:normal;font-weight:300;src:url(https://cdn.colegium.com/recursos/font/nunito-300.woff2) format("woff2"),url(https://cdn.colegium.com/recursos/font/nunito-300.woff) format("woff"),url(https://cdn.colegium.com/recursos/font/nunito-300.ttf);font-display:swap}@font-face{font-family:Nunito;font-style:normal;font-weight:400;src:url(https://cdn.colegium.com/recursos/font/nunito-regular.woff2) format("woff2"),url(https://cdn.colegium.com/recursos/font/nunito-regular.woff) format("woff"),url(https://cdn.colegium.com/recursos/font/nunito-regular.ttf);font-display:swap}@font-face{font-family:Nunito;font-style:normal;font-weight:500;src:url(https://cdn.colegium.com/recursos/font/nunito-500.woff2) format("woff2"),url(https://cdn.colegium.com/recursos/font/nunito-500.woff) format("woff"),url(https://cdn.colegium.com/recursos/font/nunito-500.ttf);font-display:swap}@font-face{font-family:Nunito;font-style:normal;font-weight:600;src:url(https://cdn.colegium.com/recursos/font/nunito-600.woff2) format("woff2"),url(https://cdn.colegium.com/recursos/font/nunito-600.woff) format("woff"),url(https://cdn.colegium.com/recursos/font/nunito-600.ttf);font-display:swap}@font-face{font-family:Nunito;font-style:normal;font-weight:700;src:url(https://cdn.colegium.com/recursos/font/nunito-700.woff2) format("woff2"),url(https://cdn.colegium.com/recursos/font/nunito-700.woff) format("woff"),url(https://cdn.colegium.com/recursos/font/nunito-700.ttf);font-display:swap}@font-face{font-family:Nunito;font-style:normal;font-weight:800;src:url(https://cdn.colegium.com/recursos/font/nunito-800.woff2) format("woff2"),url(https://cdn.colegium.com/recursos/font/nunito-800.woff) format("woff"),url(https://cdn.colegium.com/recursos/font/nunito-800.ttf);font-display:swap}@font-face{font-family:Nunito;font-style:normal;font-weight:900;src:url(https://cdn.colegium.com/recursos/font/nunito-900.woff2) format("woff2"),url(https://cdn.colegium.com/recursos/font/nunito-900.woff) format("woff"),url(https://cdn.colegium.com/recursos/font/nunito-900.ttf);font-display:swap}.flex{display:flex}.hidden{display:none}.h-full{height:100%}.w-full{width:100%}.overflow-hidden{overflow:hidden}
1
+ *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Nunito,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{font-family:Nunito}html,body,form{height:100vh;margin:0;padding:0}#app{margin:0 auto;height:inherit;width:inherit}@font-face{font-family:Nunito;font-style:normal;font-weight:300;src:url(https://cdn.colegium.com/recursos/font/nunito-300.woff2) format("woff2"),url(https://cdn.colegium.com/recursos/font/nunito-300.woff) format("woff"),url(https://cdn.colegium.com/recursos/font/nunito-300.ttf);font-display:swap}@font-face{font-family:Nunito;font-style:normal;font-weight:400;src:url(https://cdn.colegium.com/recursos/font/nunito-regular.woff2) format("woff2"),url(https://cdn.colegium.com/recursos/font/nunito-regular.woff) format("woff"),url(https://cdn.colegium.com/recursos/font/nunito-regular.ttf);font-display:swap}@font-face{font-family:Nunito;font-style:normal;font-weight:500;src:url(https://cdn.colegium.com/recursos/font/nunito-500.woff2) format("woff2"),url(https://cdn.colegium.com/recursos/font/nunito-500.woff) format("woff"),url(https://cdn.colegium.com/recursos/font/nunito-500.ttf);font-display:swap}@font-face{font-family:Nunito;font-style:normal;font-weight:600;src:url(https://cdn.colegium.com/recursos/font/nunito-600.woff2) format("woff2"),url(https://cdn.colegium.com/recursos/font/nunito-600.woff) format("woff"),url(https://cdn.colegium.com/recursos/font/nunito-600.ttf);font-display:swap}@font-face{font-family:Nunito;font-style:normal;font-weight:700;src:url(https://cdn.colegium.com/recursos/font/nunito-700.woff2) format("woff2"),url(https://cdn.colegium.com/recursos/font/nunito-700.woff) format("woff"),url(https://cdn.colegium.com/recursos/font/nunito-700.ttf);font-display:swap}@font-face{font-family:Nunito;font-style:normal;font-weight:800;src:url(https://cdn.colegium.com/recursos/font/nunito-800.woff2) format("woff2"),url(https://cdn.colegium.com/recursos/font/nunito-800.woff) format("woff"),url(https://cdn.colegium.com/recursos/font/nunito-800.ttf);font-display:swap}@font-face{font-family:Nunito;font-style:normal;font-weight:900;src:url(https://cdn.colegium.com/recursos/font/nunito-900.woff2) format("woff2"),url(https://cdn.colegium.com/recursos/font/nunito-900.woff) format("woff"),url(https://cdn.colegium.com/recursos/font/nunito-900.ttf);font-display:swap}.flex{display:flex}.hidden{display:none}.h-full{height:100%}.w-full{width:100%}.flex-col{flex-direction:column}.overflow-hidden{overflow:hidden}.bg-primary-300{--tw-bg-opacity: 1;background-color:rgb(108 168 235 / var(--tw-bg-opacity, 1))}.bg-red-300{--tw-bg-opacity: 1;background-color:rgb(252 165 165 / var(--tw-bg-opacity, 1))}
@@ -1,4 +1,4 @@
1
- import { watch as S, getCurrentScope as T, onScopeDispose as M, computed as _, toValue as h, unref as E, defineComponent as W, ref as m, onMounted as k, createElementBlock as x, openBlock as D, createElementVNode as j, toRaw as A } from "vue";
1
+ import { watch as S, getCurrentScope as T, onScopeDispose as M, computed as _, toValue as h, unref as E, defineComponent as x, ref as m, onMounted as W, createElementBlock as k, openBlock as D, createElementVNode as j, toRaw as A } from "vue";
2
2
  function I(e) {
3
3
  return T() ? (M(e), !0) : !1;
4
4
  }
@@ -59,7 +59,7 @@ function N(...e) {
59
59
  };
60
60
  return I(s), p;
61
61
  }
62
- const R = { class: "flex w-full h-full" }, U = ["src"], z = /* @__PURE__ */ W({
62
+ const R = { class: "flex flex-col w-full h-full" }, U = ["src"], z = /* @__PURE__ */ x({
63
63
  __name: "App",
64
64
  emits: ["load", "ready", "onSuccess", "onError"],
65
65
  setup(e, { expose: r, emit: s }) {
@@ -99,7 +99,7 @@ const R = { class: "flex w-full h-full" }, U = ["src"], z = /* @__PURE__ */ W({
99
99
  f.value.port2
100
100
  ]), t(), o();
101
101
  };
102
- return k(() => t()), r({ getTemplateDesign: v, setTemplateDesign: b }), (l, a) => (D(), x("div", R, [
102
+ return W(() => t()), r({ getTemplateDesign: v, setTemplateDesign: b }), (l, a) => (D(), k("div", R, [
103
103
  j("iframe", {
104
104
  class: "w-full h-full overflow-hidden",
105
105
  style: { width: "100%", height: "100%" },
@@ -1 +1 @@
1
- (function(u,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(u=typeof globalThis<"u"?globalThis:u||self,e(u["@colegium/vue3-unlayer-embed"]={},u.Vue))})(this,function(u,e){"use strict";function E(n){return e.getCurrentScope()?(e.onScopeDispose(n),!0):!1}const S=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const C=Object.prototype.toString,M=n=>C.call(n)==="[object Object]";function y(n){return Array.isArray(n)?n:[n]}function _(n,i,r){return e.watch(n,i,{...r,immediate:!0})}const j=S?window:void 0;function x(n){var i;const r=e.toValue(n);return(i=r==null?void 0:r.$el)!=null?i:r}function V(...n){const i=[],r=()=>{i.forEach(t=>t()),i.length=0},f=(t,o,l,c)=>(t.addEventListener(o,l,c),()=>t.removeEventListener(o,l,c)),d=e.computed(()=>{const t=y(e.toValue(n[0])).filter(o=>o!=null);return t.every(o=>typeof o!="string")?t:void 0}),p=_(()=>{var t,o;return[(o=(t=d.value)==null?void 0:t.map(l=>x(l)))!=null?o:[j].filter(l=>l!=null),y(e.toValue(d.value?n[1]:n[0])),y(e.unref(d.value?n[2]:n[1])),e.toValue(d.value?n[3]:n[2])]},([t,o,l,c])=>{if(r(),!(t!=null&&t.length)||!(o!=null&&o.length)||!(l!=null&&l.length))return;const g=M(c)?{...c}:c;i.push(...t.flatMap(b=>o.flatMap(T=>l.map(w=>f(b,T,w,g)))))},{flush:"post"}),h=()=>{p(),r()};return E(r),h}const W={class:"flex w-full h-full"},k=["src"],D=e.defineComponent({__name:"App",emits:["load","ready","onSuccess","onError"],setup(n,{expose:i,emit:r}){const f=r,d=e.ref("https://cdn2.colegium.com/beta/unlayer/index.html"),p=e.ref(),h=e.ref(),t=e.ref(null);V(window,"message",c);function o(){const s=new MessageChannel;p.value=s}function l(){const{port1:s}=p.value;h.value=s,h.value.onmessage=b}function c({data:s}){"ready"in s&&f("ready")}function g(){f("load"),l()}function b(s){const{data:a}=s;if(a.status=="success"){const{template:m,originalTemplate:O}=a;f("onSuccess",{template:m,originalTemplate:O})}else{const{message:m}=a;f("onError",{message:m})}o(),l()}const T=()=>{var s,a;(a=(s=t.value)==null?void 0:s.contentWindow)==null||a.postMessage({type:"GET"},"*",[p.value.port2])},w=s=>{var a,m;(m=(a=t.value)==null?void 0:a.contentWindow)==null||m.postMessage({template:e.toRaw(s),type:"PUT"},"*",[p.value.port2]),o(),l()};return e.onMounted(()=>o()),i({getTemplateDesign:T,setTemplateDesign:w}),(s,a)=>(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("iframe",{class:"w-full h-full overflow-hidden",style:{width:"100%",height:"100%"},ref_key:"unlayerIframe",ref:t,frameborder:"0",loading:"lazy","no-referrer":"",title:"Colegium Unlayer Embed",src:`${e.unref(d)}?v=${new Date().getTime()}`,onLoad:g},null,40,k)]))}});u.ClgTemplateBuilder=D,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
1
+ (function(u,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(u=typeof globalThis<"u"?globalThis:u||self,e(u["@colegium/vue3-unlayer-embed"]={},u.Vue))})(this,function(u,e){"use strict";function E(n){return e.getCurrentScope()?(e.onScopeDispose(n),!0):!1}const S=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const C=Object.prototype.toString,M=n=>C.call(n)==="[object Object]";function y(n){return Array.isArray(n)?n:[n]}function _(n,i,r){return e.watch(n,i,{...r,immediate:!0})}const x=S?window:void 0;function j(n){var i;const r=e.toValue(n);return(i=r==null?void 0:r.$el)!=null?i:r}function V(...n){const i=[],r=()=>{i.forEach(t=>t()),i.length=0},f=(t,o,l,c)=>(t.addEventListener(o,l,c),()=>t.removeEventListener(o,l,c)),d=e.computed(()=>{const t=y(e.toValue(n[0])).filter(o=>o!=null);return t.every(o=>typeof o!="string")?t:void 0}),p=_(()=>{var t,o;return[(o=(t=d.value)==null?void 0:t.map(l=>j(l)))!=null?o:[x].filter(l=>l!=null),y(e.toValue(d.value?n[1]:n[0])),y(e.unref(d.value?n[2]:n[1])),e.toValue(d.value?n[3]:n[2])]},([t,o,l,c])=>{if(r(),!(t!=null&&t.length)||!(o!=null&&o.length)||!(l!=null&&l.length))return;const g=M(c)?{...c}:c;i.push(...t.flatMap(b=>o.flatMap(T=>l.map(w=>f(b,T,w,g)))))},{flush:"post"}),h=()=>{p(),r()};return E(r),h}const W={class:"flex flex-col w-full h-full"},k=["src"],D=e.defineComponent({__name:"App",emits:["load","ready","onSuccess","onError"],setup(n,{expose:i,emit:r}){const f=r,d=e.ref("https://cdn2.colegium.com/beta/unlayer/index.html"),p=e.ref(),h=e.ref(),t=e.ref(null);V(window,"message",c);function o(){const s=new MessageChannel;p.value=s}function l(){const{port1:s}=p.value;h.value=s,h.value.onmessage=b}function c({data:s}){"ready"in s&&f("ready")}function g(){f("load"),l()}function b(s){const{data:a}=s;if(a.status=="success"){const{template:m,originalTemplate:O}=a;f("onSuccess",{template:m,originalTemplate:O})}else{const{message:m}=a;f("onError",{message:m})}o(),l()}const T=()=>{var s,a;(a=(s=t.value)==null?void 0:s.contentWindow)==null||a.postMessage({type:"GET"},"*",[p.value.port2])},w=s=>{var a,m;(m=(a=t.value)==null?void 0:a.contentWindow)==null||m.postMessage({template:e.toRaw(s),type:"PUT"},"*",[p.value.port2]),o(),l()};return e.onMounted(()=>o()),i({getTemplateDesign:T,setTemplateDesign:w}),(s,a)=>(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("iframe",{class:"w-full h-full overflow-hidden",style:{width:"100%",height:"100%"},ref_key:"unlayerIframe",ref:t,frameborder:"0",loading:"lazy","no-referrer":"",title:"Colegium Unlayer Embed",src:`${e.unref(d)}?v=${new Date().getTime()}`,onLoad:g},null,40,k)]))}});u.ClgTemplateBuilder=D,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colegium_dev/vue3-unlayer-embed",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Unlayer Embed project for Colegium Cloud Platform",
5
5
  "author": "Colegium Frontend Team",
6
6
  "type": "module",