@topol.io/editor-vue 0.0.0 → 0.0.1
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,24 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i from "@topol.io/editor";
|
|
2
2
|
import { default as E } from "@topol.io/editor";
|
|
3
|
-
import { defineComponent as
|
|
4
|
-
const
|
|
3
|
+
import { defineComponent as p, onMounted as g, onBeforeUnmount as v, openBlock as C, createElementBlock as m } from "vue";
|
|
4
|
+
const d = "topol-editor-id", u = /* @__PURE__ */ p({
|
|
5
5
|
__name: "TopolEditor",
|
|
6
6
|
props: {
|
|
7
7
|
options: {},
|
|
8
8
|
stage: { default: "production" }
|
|
9
9
|
},
|
|
10
10
|
emits: ["onSave", "onSaveAndClose", "onTestSend", "onOpenFileManager", "onLoaded", "onBlockSave", "onBlockRemove", "onBlockEdit", "onInit", "onClose", "onUndoChange", "onRedoChange", "onPreview", "onAlert", "onBannerClick", "onEdittedWithoutSaveChanged"],
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
13
|
-
const
|
|
11
|
+
setup(l, { emit: s }) {
|
|
12
|
+
const a = l, n = s, r = () => {
|
|
13
|
+
const t = {
|
|
14
14
|
onSave(o, e) {
|
|
15
15
|
n("onSave", { json: o, html: e });
|
|
16
16
|
},
|
|
17
17
|
onSaveAndClose(o, e) {
|
|
18
18
|
n("onSaveAndClose", { json: o, html: e });
|
|
19
19
|
},
|
|
20
|
-
onTestSend(o, e,
|
|
21
|
-
n("onTestSend", { email: o, json: e, html:
|
|
20
|
+
onTestSend(o, e, c) {
|
|
21
|
+
n("onTestSend", { email: o, json: e, html: c });
|
|
22
22
|
},
|
|
23
23
|
onOpenFileManager() {
|
|
24
24
|
n("onOpenFileManager");
|
|
@@ -61,15 +61,15 @@ const l = "topol-editor-id", u = /* @__PURE__ */ c({
|
|
|
61
61
|
n("onEdittedWithoutSaveChanged", o);
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
|
-
return { id: "#" +
|
|
64
|
+
return { id: "#" + d, ...a.options, callbacks: { ...t } };
|
|
65
65
|
};
|
|
66
|
-
return
|
|
67
|
-
const
|
|
68
|
-
await
|
|
69
|
-
}),
|
|
70
|
-
|
|
71
|
-
}), (
|
|
72
|
-
id:
|
|
66
|
+
return g(async () => {
|
|
67
|
+
const t = r();
|
|
68
|
+
await i.init(t, { stage: a.stage });
|
|
69
|
+
}), v(() => {
|
|
70
|
+
i.destroy();
|
|
71
|
+
}), (t, o) => (C(), m("div", {
|
|
72
|
+
id: d,
|
|
73
73
|
style: { position: "absolute", width: "100%", height: "100vh" }
|
|
74
74
|
}));
|
|
75
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
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 l="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"],setup(c,{emit:p}){const s=c,e=p,u=()=>{const a={onSave(o,i){e("onSave",{json:o,html:i})},onSaveAndClose(o,i){e("onSaveAndClose",{json:o,html:i})},onTestSend(o,i,h){e("onTestSend",{email:o,json:i,html:h})},onOpenFileManager(){e("onOpenFileManager")},onLoaded(){e("onLoaded")},onBlockSave(o){e("onBlockSave",o)},onBlockRemove(o){e("onBlockRemove",o)},onBlockEdit(o){e("onBlockEdit",o)},onInit(){e("onInit")},onUndoChange(o){e("onUndoChange",o)},onRedoChange(o){e("onRedoChange",o)},onPreview(o){e("onPreview",o)},onAlert(o){e("onAlert",o)},onClose(){e("onClose")},onBannerClick(o,i){e("onBannerClick",{json:o,html:i})},onEdittedWithoutSaveChanged(o){e("onEdittedWithoutSaveChanged",o)}};return{id:"#"+l,...s.options,callbacks:{...a}}};return d.onMounted(async()=>{const a=u();await t.init(a,{stage:s.stage})}),d.onBeforeUnmount(()=>{t.destroy()}),(a,o)=>(d.openBlock(),d.createElementBlock("div",{id:l,style:{position:"absolute",width:"100%",height:"100vh"}}))}});n.TopolPlugin=t,n.TopolEditor=r,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { ITopolOptions, INotification, ISavedBlock, IStage } from '@topol.io/editor';
|
|
2
|
+
export type IVueOptions = Omit<ITopolOptions, 'id' | 'callbacks'>;
|
|
3
|
+
export type ISaveData = {
|
|
4
|
+
json: unknown;
|
|
5
|
+
html: unknown;
|
|
6
|
+
};
|
|
7
|
+
export type ISendTestData = {
|
|
8
|
+
email: string;
|
|
9
|
+
json: unknown;
|
|
10
|
+
html: unknown;
|
|
11
|
+
};
|
|
12
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
13
|
+
options: IVueOptions;
|
|
14
|
+
stage?: IStage | undefined;
|
|
15
|
+
}>, {
|
|
16
|
+
stage: string;
|
|
17
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
onSave: (data: ISaveData) => void;
|
|
19
|
+
onSaveAndClose: (data: ISaveData) => void;
|
|
20
|
+
onTestSend: (data: ISendTestData) => void;
|
|
21
|
+
onOpenFileManager: () => void;
|
|
22
|
+
onLoaded: () => void;
|
|
23
|
+
onBlockSave: (block: ISavedBlock) => void;
|
|
24
|
+
onBlockRemove: (blockId: number) => void;
|
|
25
|
+
onBlockEdit: (blockId: number) => void;
|
|
26
|
+
onInit: () => void;
|
|
27
|
+
onClose: () => void;
|
|
28
|
+
onUndoChange: (count: number) => void;
|
|
29
|
+
onRedoChange: (count: number) => void;
|
|
30
|
+
onPreview: (html: unknown) => void;
|
|
31
|
+
onAlert: (notification: INotification) => void;
|
|
32
|
+
onBannerClick: (data: ISaveData) => void;
|
|
33
|
+
onEdittedWithoutSaveChanged: (hasUnsavedChanges: boolean) => void;
|
|
34
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
35
|
+
options: IVueOptions;
|
|
36
|
+
stage?: IStage | undefined;
|
|
37
|
+
}>, {
|
|
38
|
+
stage: string;
|
|
39
|
+
}>>> & {
|
|
40
|
+
onOnSave?: ((data: ISaveData) => any) | undefined;
|
|
41
|
+
onOnSaveAndClose?: ((data: ISaveData) => any) | undefined;
|
|
42
|
+
onOnTestSend?: ((data: ISendTestData) => any) | undefined;
|
|
43
|
+
onOnOpenFileManager?: (() => any) | undefined;
|
|
44
|
+
onOnLoaded?: (() => any) | undefined;
|
|
45
|
+
onOnBlockSave?: ((block: ISavedBlock) => any) | undefined;
|
|
46
|
+
onOnBlockRemove?: ((blockId: number) => any) | undefined;
|
|
47
|
+
onOnBlockEdit?: ((blockId: number) => any) | undefined;
|
|
48
|
+
onOnInit?: (() => any) | undefined;
|
|
49
|
+
onOnClose?: (() => any) | undefined;
|
|
50
|
+
onOnUndoChange?: ((count: number) => any) | undefined;
|
|
51
|
+
onOnRedoChange?: ((count: number) => any) | undefined;
|
|
52
|
+
onOnPreview?: ((html: unknown) => any) | undefined;
|
|
53
|
+
onOnAlert?: ((notification: INotification) => any) | undefined;
|
|
54
|
+
onOnBannerClick?: ((data: ISaveData) => any) | undefined;
|
|
55
|
+
onOnEdittedWithoutSaveChanged?: ((hasUnsavedChanges: boolean) => any) | undefined;
|
|
56
|
+
}, {
|
|
57
|
+
stage: IStage;
|
|
58
|
+
}, {}>;
|
|
59
|
+
export default _default;
|
|
60
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
61
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
62
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
63
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
64
|
+
} : {
|
|
65
|
+
type: import('vue').PropType<T[K]>;
|
|
66
|
+
required: true;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
type __VLS_WithDefaults<P, D> = {
|
|
70
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
71
|
+
default: D[K];
|
|
72
|
+
}> : P[K];
|
|
73
|
+
};
|
|
74
|
+
type __VLS_Prettify<T> = {
|
|
75
|
+
[K in keyof T]: T[K];
|
|
76
|
+
} & {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as TopolPlugin } from '@topol.io/editor';
|
|
2
|
+
export type { INotification, IStage, ISavedBlock } from '@topol.io/editor';
|
|
3
|
+
export { default as TopolEditor } from './TopolEditor.vue';
|
|
4
|
+
export type { ISaveData, ISendTestData, IVueOptions as ITopolOptions } from './TopolEditor.vue';
|
package/package.json
CHANGED
|
@@ -14,7 +14,8 @@
|
|
|
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.1",
|
|
18
|
+
"type": "module",
|
|
18
19
|
"files": [
|
|
19
20
|
"dist"
|
|
20
21
|
],
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
}
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"@topol.io/editor": "0.0.
|
|
32
|
+
"@topol.io/editor": "0.0.1"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|
|
34
35
|
"vue": "^3.2.25"
|
|
@@ -36,10 +37,10 @@
|
|
|
36
37
|
"devDependencies": {
|
|
37
38
|
"@babel/types": "^7.23.0",
|
|
38
39
|
"@types/node": "^20.8.4",
|
|
39
|
-
"@vitejs/plugin-vue": "^
|
|
40
|
+
"@vitejs/plugin-vue": "^5.0.3",
|
|
40
41
|
"typescript": "^5.2.2",
|
|
41
|
-
"vite": "^
|
|
42
|
-
"vue": "^3.
|
|
42
|
+
"vite": "^5.0.11",
|
|
43
|
+
"vue": "^3.4.10",
|
|
43
44
|
"vue-tsc": "^1.8.18"
|
|
44
45
|
},
|
|
45
46
|
"publishConfig": {
|