@colegium_dev/vue3-unlayer-embed 1.0.3

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/README.md ADDED
@@ -0,0 +1,73 @@
1
+ ![Logo](https://cdn2.colegium.com/production/www-old/wp-content/uploads/2020/06/logo-clg-blue.png)
2
+
3
+ # @colegium/vue3-unlayer-embed
4
+
5
+ Bienvenidos al proyecto de investigación y desarrollo para [Unlayer Embed](https://unlayer.com/embed) en forma de componentes de Vue 3 para Colegium desarrollado en base a la [aplicación base](https://bitbucket.org/colegium-desarrollo/vue3-ce-app-base) pero con capacidades para [compilación en librería de Vite.js](https://vitejs.dev/guide/build.html#library-mode).
6
+
7
+ Este es el desarrollo de parte del paquete que se ofrecerá visiblemente en el módulo correspondiente, el cual cargará el iframe como `@colegium/vue3-unlayer-embed`.
8
+
9
+ ## Motivación
10
+
11
+ La motivación principal de la investigación y desarrollo de este proyecto es crear una versión de Unlayer Embed que funcione correctamente tanto en el ambito de desarrollo, como en otros Web Components creando un componente que haga envoltura de la dependencia oficial usando iframes. Esta decisión fue tomada debido a Unlayer Embed no tiene ningún tipo de soporte para Web Components.
12
+
13
+ Este desarrollo se pensó originalmente para la creación de plantillas para el envío de mensajes en el módulo homonimo, ofreciendo escalabilidad a través de la parametrización, y seguridad usando protocolos de comunicación seguros y prácticas de desarrollo para encriptación de origen. Sin embargo, está preparada para ser implementada en cualquier módulo basado y desarrollado en Vue 3.
14
+
15
+ ## Instalación
16
+
17
+ Primero debemos configurar globalmente nuestro git para que el registro de paquetes apunte a Colegium Verdaccio. Posteriormente, iniciar sesión. Si tienes dudas sobre esto, comunícate con [César Gómez](https://teams.microsoft.com/l/chat/0/0?users=cgomez@colegium.com) o [Ángel Castillo](https://teams.microsoft.com/l/chat/0/0?users=acastillo@colegium.com).
18
+
19
+ Luego de cerciorarte que los pasos anteriores estén correctos, sólo debemos escribir en el terminal el siguiente comando dentro del proyecto que deseamos incluirlo:
20
+
21
+ `pnpm add @colegium/vue3-unlayer-embed`.
22
+
23
+ ## Modo de uso
24
+
25
+ ```ts
26
+ <script setup lang="ts">
27
+ import { ClgTemplateBuilder } from '@colegium/vue3-unlayer-embed'
28
+ </script>
29
+
30
+ <template>
31
+ <section class="w-full">
32
+ <ClgTemplateBuilder />
33
+ </section>
34
+ </template>
35
+ ```
36
+
37
+ ## Eventos
38
+
39
+ ```ts
40
+ const emit = defineEmits<{
41
+ /**
42
+ * Iframe onload event - Iframe is ready to use
43
+ *
44
+ * See: https://www.w3schools.com/jsref/event_onload.asp
45
+ *
46
+ */
47
+ (e: 'load'): void
48
+ }>()
49
+ ```
50
+
51
+ ## Desarrollo
52
+
53
+ Desde el root del proyecto escribir en el terminal `pnpm dev:web`. Esto es importante ya que debemos trabajar con la parte web para cualquier desarrollo. Para ver más detalles, ver el [README](./../web/README.md) del repositorio `web`. Debemos esperar a que este servicio inicie para luego, en otra pestaña o ventana de terminal, escribir, `pnpm dev:pkg`. Importante, esto se debe hacer así para el desarrollo del paquete (`package`), así podremos ver los cambios, tanto para `web` como para `pkg`, si tambien se desea hacer cambios en `web`.
54
+
55
+ > **Nota:** Se necesita un archivo de ambiente (`.env`) que es importante para el funcionamiento correcto. Solicitarlo a [César Gómez](https://teams.microsoft.com/l/chat/0/0?users=cgomez@colegium.com). Obtenido el archivo de ambiente, colocarlo en la raíz de `pkg`.
56
+
57
+ A su vez, se debe modificar la variable reactiva `url` para que apunte a la url de la parte web. Por defecto, es `const url = ref(import.meta.env.VITE_IFRAME_URL_DEV_DEMO)`, y este `import.meta.env` se encuentra en el `.env`. Por defecto, en desarrollo se trabaja con `import.meta.env.VITE_IFRAME_URL_DEV`, o también puedes configurar una URL.
58
+
59
+ ## Compilación y deploy
60
+
61
+ Desde el root del proyecto escribir en el terminal `pnpm build:pkg`, o en el repositorio `package` del monorepo, `pnpm build`.
62
+
63
+ Se generará una carpeta `dist` en el root de `package` con tres archivos: un `cjs`, un `js` y un `d.ts`; los tres son importantes para hacer la publicación de la versión.
64
+
65
+ Luego de generar el compilado, es necesario generar la version. Para ello, escribir `pnpm version-{major|minor|patch}:pkg`. Luego, `pnpm release:pkg` para disponibilizar el componente en Colegium Verdaccio.
66
+
67
+ > **Nota:** Para este ultimo paso, debes ser un usuario autorizado para publicar paquetes.
68
+
69
+ ## Colaboradores
70
+
71
+ - Cesar Gómez
72
+
73
+ Colegium - Senior Frontend Team - 2024
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,49 @@
1
+ import { ComponentOptionsMixin } from 'vue';
2
+ import { ComponentProvideOptions } from 'vue';
3
+ import { DefineComponent } from 'vue';
4
+ import { PublicProps } from 'vue';
5
+
6
+ export declare const ClgTemplateBuilder: DefineComponent< {}, {
7
+ getTemplateDesign: () => void;
8
+ setTemplateDesign: (template: unknown) => void;
9
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
10
+ load: () => any;
11
+ ready: () => any;
12
+ onSuccess: (args_0: {
13
+ originalTemplate: Object;
14
+ template: TemplateConfig;
15
+ }) => any;
16
+ onError: (args_0: {
17
+ message: string;
18
+ }) => any;
19
+ }, string, PublicProps, Readonly<{}> & Readonly<{
20
+ onLoad?: (() => any) | undefined;
21
+ onReady?: (() => any) | undefined;
22
+ onOnSuccess?: ((args_0: {
23
+ originalTemplate: Object;
24
+ template: TemplateConfig;
25
+ }) => any) | undefined;
26
+ onOnError?: ((args_0: {
27
+ message: string;
28
+ }) => any) | undefined;
29
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {
30
+ unlayerIframe: HTMLIFrameElement;
31
+ }, HTMLDivElement>;
32
+
33
+ declare type TemplateConfig = {
34
+ form: Array<TemplateContentForm>;
35
+ design: object;
36
+ html?: string;
37
+ thumbnail?: string;
38
+ };
39
+
40
+ declare type TemplateContentForm = {
41
+ editable: boolean;
42
+ required: boolean;
43
+ label: string;
44
+ tagId: string;
45
+ type: 'text' | 'heading' | 'image';
46
+ value: string;
47
+ };
48
+
49
+ export { }
@@ -0,0 +1,13 @@
1
+ [[plugins]]
2
+ package = "./../../scripts/pnpm-preinstaller"
3
+
4
+ [[redirects]]
5
+ from = "/*"
6
+ to = "/"
7
+ status = 200
8
+
9
+ [build.environment]
10
+ NPM_FLAGS = "--version"
11
+
12
+ [build]
13
+ command = "npx pnpm i --store=node_modules/.pnpm-store --frozen-lockfile && npx pnpm build-only"
@@ -0,0 +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}
@@ -0,0 +1,124 @@
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";
2
+ function I(e) {
3
+ return T() ? (M(e), !0) : !1;
4
+ }
5
+ const L = typeof window < "u" && typeof document < "u";
6
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
7
+ const O = Object.prototype.toString, B = (e) => O.call(e) === "[object Object]";
8
+ function w(e) {
9
+ return Array.isArray(e) ? e : [e];
10
+ }
11
+ function G(e, r, s) {
12
+ return S(
13
+ e,
14
+ r,
15
+ {
16
+ ...s,
17
+ immediate: !0
18
+ }
19
+ );
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;
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);
32
+ return n.every((t) => typeof t != "string") ? n : void 0;
33
+ }), f = G(
34
+ () => {
35
+ var n, t;
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])),
40
+ // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
41
+ h(i.value ? e[3] : e[2])
42
+ ];
43
+ },
44
+ ([n, t, o, u]) => {
45
+ if (s(), !(n != null && n.length) || !(t != null && t.length) || !(o != null && o.length))
46
+ return;
47
+ const g = B(u) ? { ...u } : u;
48
+ r.push(
49
+ ...n.flatMap(
50
+ (y) => t.flatMap(
51
+ (v) => o.map((b) => c(y, v, b, g))
52
+ )
53
+ )
54
+ );
55
+ },
56
+ { flush: "post" }
57
+ ), p = () => {
58
+ f(), s();
59
+ };
60
+ return I(s), p;
61
+ }
62
+ const R = { class: "flex w-full h-full" }, U = ["src"], z = /* @__PURE__ */ W({
63
+ __name: "App",
64
+ 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);
68
+ function t() {
69
+ const l = new MessageChannel();
70
+ f.value = l;
71
+ }
72
+ function o() {
73
+ const { port1: l } = f.value;
74
+ p.value = l, p.value.onmessage = y;
75
+ }
76
+ function u({ data: l }) {
77
+ "ready" in l && c("ready");
78
+ }
79
+ function g() {
80
+ c("load"), o();
81
+ }
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 });
87
+ } else {
88
+ const { message: d } = a;
89
+ c("onError", { message: d });
90
+ }
91
+ t(), o();
92
+ }
93
+ const v = () => {
94
+ var l, a;
95
+ (a = (l = n.value) == null ? void 0 : l.contentWindow) == null || a.postMessage({ type: "GET" }, "*", [
96
+ f.value.port2
97
+ ]);
98
+ }, b = (l) => {
99
+ var a, d;
100
+ (d = (a = n.value) == null ? void 0 : a.contentWindow) == null || d.postMessage(
101
+ { template: A(l), type: "PUT" },
102
+ "*",
103
+ [f.value.port2]
104
+ ), t(), o();
105
+ };
106
+ return k(() => t()), r({ getTemplateDesign: v, setTemplateDesign: b }), (l, a) => (D(), x("div", R, [
107
+ j("iframe", {
108
+ class: "w-full h-full overflow-hidden",
109
+ style: { width: "100%", height: "100%" },
110
+ ref_key: "unlayerIframe",
111
+ ref: n,
112
+ frameborder: "0",
113
+ loading: "lazy",
114
+ "no-referrer": "",
115
+ title: "Colegium Unlayer Embed",
116
+ src: `${E(i)}?v=${(/* @__PURE__ */ new Date()).getTime()}`,
117
+ onLoad: g
118
+ }, null, 40, U)
119
+ ]));
120
+ }
121
+ });
122
+ export {
123
+ z as ClgTemplateBuilder
124
+ };
@@ -0,0 +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"})});
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@colegium_dev/vue3-unlayer-embed",
3
+ "version": "1.0.3",
4
+ "description": "Unlayer Embed project for Colegium Cloud Platform",
5
+ "author": "Colegium Frontend Team",
6
+ "type": "module",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "main": "./dist/vue3-colegium-unlayer-embed.umd.cjs",
11
+ "module": "./dist/vue3-colegium-unlayer-embed.js",
12
+ "types": "./dist/index.d.ts",
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/vue3-colegium-unlayer-embed.js",
17
+ "require": "./dist/vue3-colegium-unlayer-embed.umd.cjs"
18
+ },
19
+ "./style.css": "./dist/style.css"
20
+ },
21
+ "scripts": {
22
+ "dev": "vite",
23
+ "build": "vite build && vue-tsc --noEmit",
24
+ "preview": "vite preview",
25
+ "version-patch": "pnpm version patch",
26
+ "version-minor": "pnpm version minor",
27
+ "version-major": "pnpm version major",
28
+ "release": "pnpm publish --access public --tag beta"
29
+ }
30
+ }