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