@topol.io/editor-vue 0.0.2 → 0.0.4
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,77 +1,83 @@
|
|
|
1
1
|
import i from "@topol.io/editor";
|
|
2
|
-
import { default as
|
|
3
|
-
import { defineComponent as p, onMounted as
|
|
2
|
+
import { default as S } from "@topol.io/editor";
|
|
3
|
+
import { defineComponent as p, onMounted as m, onBeforeUnmount as g, openBlock as C, createElementBlock as u } from "vue";
|
|
4
4
|
const l = "topol-editor-id", B = /* @__PURE__ */ p({
|
|
5
5
|
__name: "TopolEditor",
|
|
6
6
|
props: {
|
|
7
7
|
options: {},
|
|
8
8
|
stage: { default: "production" }
|
|
9
9
|
},
|
|
10
|
-
emits: ["onSave", "onSaveAndClose", "onTestSend", "onOpenFileManager", "onLoaded", "onBlockSave", "onBlockRemove", "onBlockEdit", "onInit", "onClose", "onUndoChange", "onRedoChange", "onPreview", "onAlert", "onBannerClick", "onEdittedWithoutSaveChanged", "onOpenCustomBlockDialog"],
|
|
10
|
+
emits: ["onSave", "onSaveAndClose", "onTestSend", "onOpenFileManager", "onLoaded", "onBlockSave", "onBlockRemove", "onBlockEdit", "onInit", "onClose", "onUndoChange", "onRedoChange", "onPreview", "onAlert", "onBannerClick", "onEdittedWithoutSaveChanged", "onOpenCustomBlockDialog", "onTemplateRename", "updateTestingEmailAddresses"],
|
|
11
11
|
setup(d, { emit: s }) {
|
|
12
|
-
const a = d,
|
|
12
|
+
const a = d, e = s, r = () => {
|
|
13
13
|
const t = {
|
|
14
|
-
onSave(o,
|
|
15
|
-
|
|
14
|
+
onSave(o, n) {
|
|
15
|
+
e("onSave", { json: o, html: n });
|
|
16
16
|
},
|
|
17
|
-
onSaveAndClose(o,
|
|
18
|
-
|
|
17
|
+
onSaveAndClose(o, n) {
|
|
18
|
+
e("onSaveAndClose", { json: o, html: n });
|
|
19
19
|
},
|
|
20
|
-
onTestSend(o,
|
|
21
|
-
|
|
20
|
+
onTestSend(o, n, c) {
|
|
21
|
+
e("onTestSend", { email: o, json: n, html: c });
|
|
22
22
|
},
|
|
23
23
|
onOpenFileManager() {
|
|
24
|
-
|
|
24
|
+
e("onOpenFileManager");
|
|
25
25
|
},
|
|
26
26
|
onLoaded() {
|
|
27
|
-
|
|
27
|
+
e("onLoaded");
|
|
28
28
|
},
|
|
29
29
|
onBlockSave(o) {
|
|
30
|
-
|
|
30
|
+
e("onBlockSave", o);
|
|
31
31
|
},
|
|
32
32
|
onBlockRemove(o) {
|
|
33
|
-
|
|
33
|
+
e("onBlockRemove", o);
|
|
34
34
|
},
|
|
35
35
|
onBlockEdit(o) {
|
|
36
|
-
|
|
36
|
+
e("onBlockEdit", o);
|
|
37
37
|
},
|
|
38
38
|
onInit() {
|
|
39
|
-
|
|
39
|
+
e("onInit");
|
|
40
40
|
},
|
|
41
41
|
onUndoChange(o) {
|
|
42
|
-
|
|
42
|
+
e("onUndoChange", o);
|
|
43
43
|
},
|
|
44
44
|
onRedoChange(o) {
|
|
45
|
-
|
|
45
|
+
e("onRedoChange", o);
|
|
46
46
|
},
|
|
47
47
|
onPreview(o) {
|
|
48
|
-
|
|
48
|
+
e("onPreview", o);
|
|
49
49
|
},
|
|
50
50
|
onAlert(o) {
|
|
51
|
-
|
|
51
|
+
e("onAlert", o);
|
|
52
52
|
},
|
|
53
53
|
onClose() {
|
|
54
|
-
|
|
54
|
+
e("onClose");
|
|
55
55
|
},
|
|
56
56
|
// @ts-expect-error only in free version
|
|
57
|
-
onBannerClick(o,
|
|
58
|
-
|
|
57
|
+
onBannerClick(o, n) {
|
|
58
|
+
e("onBannerClick", { json: o, html: n });
|
|
59
59
|
},
|
|
60
60
|
onEdittedWithoutSaveChanged(o) {
|
|
61
|
-
|
|
61
|
+
e("onEdittedWithoutSaveChanged", o);
|
|
62
62
|
},
|
|
63
63
|
onOpenCustomBlockDialog(o) {
|
|
64
|
-
|
|
64
|
+
e("onOpenCustomBlockDialog", o);
|
|
65
|
+
},
|
|
66
|
+
onTemplateRename(o) {
|
|
67
|
+
e("onTemplateRename", o);
|
|
68
|
+
},
|
|
69
|
+
updateTestingEmailAddresses(o) {
|
|
70
|
+
e("updateTestingEmailAddresses", o);
|
|
65
71
|
}
|
|
66
72
|
};
|
|
67
73
|
return { id: "#" + l, ...a.options, callbacks: { ...t } };
|
|
68
74
|
};
|
|
69
|
-
return
|
|
75
|
+
return m(async () => {
|
|
70
76
|
const t = r();
|
|
71
77
|
await i.init(t, { stage: a.stage });
|
|
72
|
-
}),
|
|
78
|
+
}), g(() => {
|
|
73
79
|
i.destroy();
|
|
74
|
-
}), (t, o) => (
|
|
80
|
+
}), (t, o) => (C(), u("div", {
|
|
75
81
|
id: l,
|
|
76
82
|
style: { position: "absolute", width: "100%", height: "100vh" }
|
|
77
83
|
}));
|
|
@@ -79,5 +85,5 @@ const l = "topol-editor-id", B = /* @__PURE__ */ p({
|
|
|
79
85
|
});
|
|
80
86
|
export {
|
|
81
87
|
B as TopolEditor,
|
|
82
|
-
|
|
88
|
+
S as TopolPlugin
|
|
83
89
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(n,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("@topol.io/editor"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@topol.io/editor","vue"],t):(n=typeof globalThis<"u"?globalThis:n||self,t(n["topol-editor-vue"]={},n.TopolPlugin,n.Vue))})(this,function(n,t,d){"use strict";const
|
|
1
|
+
(function(n,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("@topol.io/editor"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@topol.io/editor","vue"],t):(n=typeof globalThis<"u"?globalThis:n||self,t(n["topol-editor-vue"]={},n.TopolPlugin,n.Vue))})(this,function(n,t,d){"use strict";const s="topol-editor-id",r=d.defineComponent({__name:"TopolEditor",props:{options:{},stage:{default:"production"}},emits:["onSave","onSaveAndClose","onTestSend","onOpenFileManager","onLoaded","onBlockSave","onBlockRemove","onBlockEdit","onInit","onClose","onUndoChange","onRedoChange","onPreview","onAlert","onBannerClick","onEdittedWithoutSaveChanged","onOpenCustomBlockDialog","onTemplateRename","updateTestingEmailAddresses"],setup(c,{emit:p}){const l=c,o=p,u=()=>{const a={onSave(e,i){o("onSave",{json:e,html:i})},onSaveAndClose(e,i){o("onSaveAndClose",{json:e,html:i})},onTestSend(e,i,m){o("onTestSend",{email:e,json:i,html:m})},onOpenFileManager(){o("onOpenFileManager")},onLoaded(){o("onLoaded")},onBlockSave(e){o("onBlockSave",e)},onBlockRemove(e){o("onBlockRemove",e)},onBlockEdit(e){o("onBlockEdit",e)},onInit(){o("onInit")},onUndoChange(e){o("onUndoChange",e)},onRedoChange(e){o("onRedoChange",e)},onPreview(e){o("onPreview",e)},onAlert(e){o("onAlert",e)},onClose(){o("onClose")},onBannerClick(e,i){o("onBannerClick",{json:e,html:i})},onEdittedWithoutSaveChanged(e){o("onEdittedWithoutSaveChanged",e)},onOpenCustomBlockDialog(e){o("onOpenCustomBlockDialog",e)},onTemplateRename(e){o("onTemplateRename",e)},updateTestingEmailAddresses(e){o("updateTestingEmailAddresses",e)}};return{id:"#"+s,...l.options,callbacks:{...a}}};return d.onMounted(async()=>{const a=u();await t.init(a,{stage:l.stage})}),d.onBeforeUnmount(()=>{t.destroy()}),(a,e)=>(d.openBlock(),d.createElementBlock("div",{id:s,style:{position:"absolute",width:"100%",height:"100vh"}}))}});n.TopolPlugin=t,n.TopolEditor=r,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -32,6 +32,8 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
32
32
|
onBannerClick: (data: ISaveData) => void;
|
|
33
33
|
onEdittedWithoutSaveChanged: (hasUnsavedChanges: boolean) => void;
|
|
34
34
|
onOpenCustomBlockDialog: (blockContent: unknown) => void;
|
|
35
|
+
onTemplateRename: (title: string) => void;
|
|
36
|
+
updateTestingEmailAddresses: (emails: string[]) => void;
|
|
35
37
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
36
38
|
options: IVueOptions;
|
|
37
39
|
stage?: IStage | undefined;
|
|
@@ -55,6 +57,8 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
55
57
|
onOnBannerClick?: ((data: ISaveData) => any) | undefined;
|
|
56
58
|
onOnEdittedWithoutSaveChanged?: ((hasUnsavedChanges: boolean) => any) | undefined;
|
|
57
59
|
onOnOpenCustomBlockDialog?: ((blockContent: unknown) => any) | undefined;
|
|
60
|
+
onOnTemplateRename?: ((title: string) => any) | undefined;
|
|
61
|
+
onUpdateTestingEmailAddresses?: ((emails: string[]) => any) | undefined;
|
|
58
62
|
}, {
|
|
59
63
|
stage: IStage;
|
|
60
64
|
}, {}>;
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"author": "Topol.io",
|
|
15
15
|
"homepage": "https://topol.io",
|
|
16
16
|
"license": "Apache-2.0",
|
|
17
|
-
"version": "0.0.
|
|
17
|
+
"version": "0.0.4",
|
|
18
18
|
"type": "module",
|
|
19
19
|
"files": [
|
|
20
20
|
"dist"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@topol.io/editor": "0.0.
|
|
32
|
+
"@topol.io/editor": "0.0.4"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"vue": "^3.2.25"
|