@colegium_dev/vue3-unlayer-embed 1.0.13 → 1.0.15

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/dist/index.d.ts CHANGED
@@ -3,7 +3,14 @@ import { ComponentProvideOptions } from 'vue';
3
3
  import { DefineComponent } from 'vue';
4
4
  import { PublicProps } from 'vue';
5
5
 
6
- export declare const ClgTemplateBuilder: DefineComponent< {}, {
6
+ declare type __VLS_Props = {
7
+ /** URL del iframe publicado en el CDN. Por defecto, producción. */
8
+ iframeUrl?: string;
9
+ /** Módulo que abre el editor (define su configuración). Sin valor, el iframe usa `mensajes`. */
10
+ module?: 'mensajes' | 'matricula';
11
+ };
12
+
13
+ export declare const ClgTemplateBuilder: DefineComponent<__VLS_Props, {
7
14
  getTemplateDesign: () => void;
8
15
  setTemplateDesign: (template: unknown) => void;
9
16
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
@@ -12,21 +19,23 @@ ready: () => any;
12
19
  onSuccess: (args_0: {
13
20
  originalTemplate: Object;
14
21
  template: TemplateConfig;
22
+ html: string;
15
23
  }) => any;
16
24
  onError: (args_0: {
17
25
  message: string;
18
26
  }) => any;
19
- }, string, PublicProps, Readonly<{}> & Readonly<{
27
+ }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
20
28
  onLoad?: (() => any) | undefined;
21
29
  onReady?: (() => any) | undefined;
22
30
  onOnSuccess?: ((args_0: {
23
31
  originalTemplate: Object;
24
32
  template: TemplateConfig;
33
+ html: string;
25
34
  }) => any) | undefined;
26
35
  onOnError?: ((args_0: {
27
36
  message: string;
28
37
  }) => any) | undefined;
29
- }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {
38
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
30
39
  unlayerIframe: HTMLIFrameElement;
31
40
  }, HTMLDivElement>;
32
41
 
@@ -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%}.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
+ *,: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}
@@ -1,105 +1,112 @@
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";
1
+ import { watch as x, getCurrentScope as k, onScopeDispose as D, computed as C, toValue as h, unref as T, defineComponent as L, ref as E, onMounted as P, createElementBlock as U, openBlock as W, createElementVNode as j, toRaw as A } from "vue";
2
2
  function I(e) {
3
- return T() ? (M(e), !0) : !1;
3
+ return k() ? (D(e), !0) : !1;
4
4
  }
5
- const L = typeof window < "u" && typeof document < "u";
5
+ const O = typeof window < "u" && typeof document < "u";
6
6
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
7
- const O = Object.prototype.toString, B = (e) => O.call(e) === "[object Object]";
8
- function w(e) {
7
+ const B = Object.prototype.toString, G = (e) => B.call(e) === "[object Object]";
8
+ function b(e) {
9
9
  return Array.isArray(e) ? e : [e];
10
10
  }
11
- function G(e, r, s) {
12
- return S(
11
+ function R(e, s, r) {
12
+ return x(
13
13
  e,
14
- r,
14
+ s,
15
15
  {
16
- ...s,
16
+ ...r,
17
17
  immediate: !0
18
18
  }
19
19
  );
20
20
  }
21
- const P = L ? window : void 0;
22
- function $(e) {
23
- var r;
24
- const s = h(e);
25
- return (r = s == null ? void 0 : s.$el) != null ? r : s;
21
+ const N = O ? window : void 0;
22
+ function V(e) {
23
+ var s;
24
+ const r = h(e);
25
+ return (s = r == null ? void 0 : r.$el) != null ? s : r;
26
26
  }
27
- function N(...e) {
28
- const r = [], s = () => {
29
- r.forEach((n) => n()), r.length = 0;
30
- }, c = (n, t, o, u) => (n.addEventListener(t, o, u), () => n.removeEventListener(t, o, u)), i = _(() => {
31
- const n = w(h(e[0])).filter((t) => t != null);
27
+ function _(...e) {
28
+ const s = [], r = () => {
29
+ s.forEach((n) => n()), s.length = 0;
30
+ }, u = (n, t, l, a) => (n.addEventListener(t, l, a), () => n.removeEventListener(t, l, a)), c = C(() => {
31
+ const n = b(h(e[0])).filter((t) => t != null);
32
32
  return n.every((t) => typeof t != "string") ? n : void 0;
33
- }), f = G(
33
+ }), d = R(
34
34
  () => {
35
35
  var n, t;
36
36
  return [
37
- (t = (n = i.value) == null ? void 0 : n.map((o) => $(o))) != null ? t : [P].filter((o) => o != null),
38
- w(h(i.value ? e[1] : e[0])),
39
- w(E(i.value ? e[2] : e[1])),
37
+ (t = (n = c.value) == null ? void 0 : n.map((l) => V(l))) != null ? t : [N].filter((l) => l != null),
38
+ b(h(c.value ? e[1] : e[0])),
39
+ b(T(c.value ? e[2] : e[1])),
40
40
  // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
41
- h(i.value ? e[3] : e[2])
41
+ h(c.value ? e[3] : e[2])
42
42
  ];
43
43
  },
44
- ([n, t, o, u]) => {
45
- if (s(), !(n != null && n.length) || !(t != null && t.length) || !(o != null && o.length))
44
+ ([n, t, l, a]) => {
45
+ if (r(), !(n != null && n.length) || !(t != null && t.length) || !(l != null && l.length))
46
46
  return;
47
- const g = B(u) ? { ...u } : u;
48
- r.push(
47
+ const g = G(a) ? { ...a } : a;
48
+ s.push(
49
49
  ...n.flatMap(
50
50
  (y) => t.flatMap(
51
- (v) => o.map((b) => c(y, v, b, g))
51
+ (v) => l.map((w) => u(y, v, w, g))
52
52
  )
53
53
  )
54
54
  );
55
55
  },
56
56
  { flush: "post" }
57
- ), p = () => {
58
- f(), s();
57
+ ), m = () => {
58
+ d(), r();
59
59
  };
60
- return I(s), p;
60
+ return I(r), m;
61
61
  }
62
- const R = { class: "flex flex-col w-full h-full" }, U = ["src"], z = /* @__PURE__ */ x({
62
+ const $ = { class: "flex flex-col w-full h-full" }, z = ["src"], F = /* @__PURE__ */ L({
63
63
  __name: "App",
64
+ props: {
65
+ iframeUrl: { default: () => "https://cdn2.colegium.com/production/unlayer/index.html" },
66
+ module: {}
67
+ },
64
68
  emits: ["load", "ready", "onSuccess", "onError"],
65
- setup(e, { expose: r, emit: s }) {
66
- const c = s, i = m("https://cdn2.colegium.com/beta/unlayer/index.html"), f = m(), p = m(), n = m(null);
67
- N(window, "message", u);
69
+ setup(e, { expose: s, emit: r }) {
70
+ const u = r, c = C(() => {
71
+ const o = new URL(e.iframeUrl, window.location.href);
72
+ return e.module && o.searchParams.set("module", e.module), o.searchParams.set("v", `${(/* @__PURE__ */ new Date()).getTime()}`), o.toString();
73
+ }), d = E(), m = E(), n = E(null);
74
+ _(window, "message", a);
68
75
  function t() {
69
- const l = new MessageChannel();
70
- f.value = l;
76
+ const o = new MessageChannel();
77
+ d.value = o;
71
78
  }
72
- function o() {
73
- const { port1: l } = f.value;
74
- p.value = l, p.value.onmessage = y;
79
+ function l() {
80
+ const { port1: o } = d.value;
81
+ m.value = o, m.value.onmessage = y;
75
82
  }
76
- function u({ data: l }) {
77
- "ready" in l && c("ready");
83
+ function a({ data: o }) {
84
+ "ready" in o && u("ready");
78
85
  }
79
86
  function g() {
80
- c("load"), o();
87
+ u("load"), l();
81
88
  }
82
- function y(l) {
83
- const { data: a } = l;
84
- if (a.status == "success") {
85
- const { template: d, originalTemplate: C } = a;
86
- c("onSuccess", { template: d, originalTemplate: C });
89
+ function y(o) {
90
+ const { data: i } = o;
91
+ if (i.status == "success") {
92
+ const { template: f, originalTemplate: p, html: M } = i;
93
+ u("onSuccess", { template: f, originalTemplate: p, html: M });
87
94
  } else {
88
- const { message: d } = a;
89
- c("onError", { message: d });
95
+ const { message: f } = i;
96
+ u("onError", { message: f });
90
97
  }
91
- t(), o();
98
+ t(), l();
92
99
  }
93
100
  const v = () => {
94
- var l, a;
95
- (a = (l = n.value) == null ? void 0 : l.contentWindow) == null || a.postMessage({ type: "GET" }, "*", [f.value.port2]);
96
- }, b = (l) => {
97
- var a, d;
98
- (d = (a = n.value) == null ? void 0 : a.contentWindow) == null || d.postMessage({ template: A(l), type: "PUT" }, "*", [
99
- f.value.port2
100
- ]), t(), o();
101
+ S("GET");
102
+ }, w = (o) => {
103
+ S("PUT", { template: A(o) }), t(), l();
101
104
  };
102
- return W(() => t()), r({ getTemplateDesign: v, setTemplateDesign: b }), (l, a) => (D(), k("div", R, [
105
+ function S(o, i = {}) {
106
+ var f, p;
107
+ (p = (f = n.value) == null ? void 0 : f.contentWindow) == null || p.postMessage({ type: o, ...i }, "*", [d.value.port2]);
108
+ }
109
+ return P(() => t()), s({ getTemplateDesign: v, setTemplateDesign: w }), (o, i) => (W(), U("div", $, [
103
110
  j("iframe", {
104
111
  class: "w-full h-full overflow-hidden",
105
112
  style: { width: "100%", height: "100%" },
@@ -109,12 +116,12 @@ const R = { class: "flex flex-col w-full h-full" }, U = ["src"], z = /* @__PURE_
109
116
  loading: "lazy",
110
117
  "no-referrer": "",
111
118
  title: "Colegium Unlayer Embed",
112
- src: `${E(i)}?v=${(/* @__PURE__ */ new Date()).getTime()}`,
119
+ src: T(c),
113
120
  onLoad: g
114
- }, null, 40, U)
121
+ }, null, 40, z)
115
122
  ]));
116
123
  }
117
124
  });
118
125
  export {
119
- z as ClgTemplateBuilder
126
+ F as ClgTemplateBuilder
120
127
  };
@@ -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 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"})}));
1
+ (function(c,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(c=typeof globalThis<"u"?globalThis:c||self,e(c["@colegium/vue3-unlayer-embed"]={},c.Vue))})(this,function(c,e){"use strict";function C(n){return e.getCurrentScope()?(e.onScopeDispose(n),!0):!1}const M=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const x=Object.prototype.toString,j=n=>x.call(n)==="[object Object]";function y(n){return Array.isArray(n)?n:[n]}function P(n,i,s){return e.watch(n,i,{...s,immediate:!0})}const V=M?window:void 0;function k(n){var i;const s=e.toValue(n);return(i=s==null?void 0:s.$el)!=null?i:s}function D(...n){const i=[],s=()=>{i.forEach(t=>t()),i.length=0},u=(t,o,r,a)=>(t.addEventListener(o,r,a),()=>t.removeEventListener(o,r,a)),f=e.computed(()=>{const t=y(e.toValue(n[0])).filter(o=>o!=null);return t.every(o=>typeof o!="string")?t:void 0}),p=P(()=>{var t,o;return[(o=(t=f.value)==null?void 0:t.map(r=>k(r)))!=null?o:[V].filter(r=>r!=null),y(e.toValue(f.value?n[1]:n[0])),y(e.unref(f.value?n[2]:n[1])),e.toValue(f.value?n[3]:n[2])]},([t,o,r,a])=>{if(s(),!(t!=null&&t.length)||!(o!=null&&o.length)||!(r!=null&&r.length))return;const b=j(a)?{...a}:a;i.push(...t.flatMap(w=>o.flatMap(S=>r.map(T=>u(w,S,T,b)))))},{flush:"post"}),h=()=>{p(),s()};return C(s),h}const L={class:"flex flex-col w-full h-full"},O=["src"],U=e.defineComponent({__name:"App",props:{iframeUrl:{default:()=>"https://cdn2.colegium.com/production/unlayer/index.html"},module:{}},emits:["load","ready","onSuccess","onError"],setup(n,{expose:i,emit:s}){const u=s,f=e.computed(()=>{const l=new URL(n.iframeUrl,window.location.href);return n.module&&l.searchParams.set("module",n.module),l.searchParams.set("v",`${new Date().getTime()}`),l.toString()}),p=e.ref(),h=e.ref(),t=e.ref(null);D(window,"message",a);function o(){const l=new MessageChannel;p.value=l}function r(){const{port1:l}=p.value;h.value=l,h.value.onmessage=w}function a({data:l}){"ready"in l&&u("ready")}function b(){u("load"),r()}function w(l){const{data:d}=l;if(d.status=="success"){const{template:m,originalTemplate:g,html:W}=d;u("onSuccess",{template:m,originalTemplate:g,html:W})}else{const{message:m}=d;u("onError",{message:m})}o(),r()}const S=()=>{E("GET")},T=l=>{E("PUT",{template:e.toRaw(l)}),o(),r()};function E(l,d={}){var m,g;(g=(m=t.value)==null?void 0:m.contentWindow)==null||g.postMessage({type:l,...d},"*",[p.value.port2])}return e.onMounted(()=>o()),i({getTemplateDesign:S,setTemplateDesign:T}),(l,d)=>(e.openBlock(),e.createElementBlock("div",L,[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(f),onLoad:b},null,40,O)]))}});c.ClgTemplateBuilder=U,Object.defineProperty(c,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.13",
3
+ "version": "1.0.15",
4
4
  "description": "Unlayer Embed project for Colegium Cloud Platform",
5
5
  "author": "Colegium Frontend Team",
6
6
  "type": "module",
@@ -25,6 +25,6 @@
25
25
  "version-patch": "pnpm version patch",
26
26
  "version-minor": "pnpm version minor",
27
27
  "version-major": "pnpm version major",
28
- "release": "pnpm publish --access public --tag beta"
28
+ "release": "pnpm publish --access public"
29
29
  }
30
30
  }