@topol.io/editor-vue 0.0.0-beta.3 → 0.0.0-beta.7
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/LICENSE +13 -0
- package/README.md +2 -2
- package/dist/topol-editor-vue.es.js +7 -3
- package/dist/topol-editor-vue.umd.js +1 -1
- package/package.json +8 -5
- package/dist/types/src/TopolEditor.vue.d.ts +0 -78
package/LICENSE
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright 2022 Ecomail s.r.o.
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -68,7 +68,7 @@ TopolPlugin.save();
|
|
|
68
68
|
| `TopolPlugin.toggleBlocksAndStructuresVisibility()` | Toggle hidden structures visibility for blocks and structures [more info](https://topol.io/docs#mobile-first-email-template)|
|
|
69
69
|
| `TopolPlugin.destroy()` | Destroys the editor initialization [more info](https://topol.io/docs#working-with-js-frameworks) |
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
<br>
|
|
72
72
|
## Editor Events
|
|
73
73
|
|
|
74
74
|
The callbacks from editor are received as component events.
|
|
@@ -95,7 +95,7 @@ The callbacks from editor are received as component events.
|
|
|
95
95
|
| `@onPreview` | When user switches to preview |
|
|
96
96
|
| `@onAlert` | When alert appears in editor [more info](https://topol.io/docs#show-custom-notification-in-editor)|
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
<br>
|
|
99
99
|
## TypeScript
|
|
100
100
|
|
|
101
101
|
Topol Editor provides full TypeScript integration and exports all necessary types.
|
|
@@ -17,12 +17,13 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { defineComponent, onMounted, openBlock, createElementBlock } from "vue";
|
|
20
|
+
import { defineComponent, onMounted, onBeforeUnmount, openBlock, createElementBlock } from "vue";
|
|
21
21
|
import TopolPlugin from "@topol.io/editor";
|
|
22
22
|
export { default as TopolPlugin } from "@topol.io/editor";
|
|
23
23
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
24
24
|
props: {
|
|
25
|
-
options: null
|
|
25
|
+
options: null,
|
|
26
|
+
dev: { type: Boolean, default: false }
|
|
26
27
|
},
|
|
27
28
|
emits: ["onSave", "onSaveAndClose", "onTestSend", "onOpenFileManager", "onLoaded", "onBlockSave", "onBlockRemove", "onBlockEdit", "onInit", "onUndoChange", "onRedoChange", "onPreview", "onAlert"],
|
|
28
29
|
setup(__props, { emit }) {
|
|
@@ -74,7 +75,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
74
75
|
};
|
|
75
76
|
onMounted(async () => {
|
|
76
77
|
const mergedTopolOptinos = mergeOptions();
|
|
77
|
-
await TopolPlugin.init(mergedTopolOptinos);
|
|
78
|
+
await TopolPlugin.init(mergedTopolOptinos, { dev: props.dev });
|
|
79
|
+
});
|
|
80
|
+
onBeforeUnmount(() => {
|
|
81
|
+
TopolPlugin.destroy();
|
|
78
82
|
});
|
|
79
83
|
return (_ctx, _cache) => {
|
|
80
84
|
return openBlock(), createElementBlock("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var B=Object.defineProperty,T=Object.defineProperties;var y=Object.getOwnPropertyDescriptors;var p=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var f=(e,o,d)=>o in e?B(e,o,{enumerable:!0,configurable:!0,writable:!0,value:d}):e[o]=d,u=(e,o)=>{for(var d in o||(o={}))_.call(o,d)&&f(e,d,o[d]);if(p)for(var d of p(o))C.call(o,d)&&f(e,d,o[d]);return e},v=(e,o)=>T(e,y(o));(function(e,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("vue"),require("@topol.io/editor")):typeof define=="function"&&define.amd?define(["exports","vue","@topol.io/editor"],o):(e=typeof globalThis!="undefined"?globalThis:e||self,o(e["topol-editor-vue"]={},e.Vue,e.TopolPlugin))})(this,function(e,o,d){"use strict";function g(l){return l&&typeof l=="object"&&"default"in l?l:{default:l}}var r=g(d);const h=o.defineComponent({props:{options:null,dev:{type:Boolean,default:!1}},emits:["onSave","onSaveAndClose","onTestSend","onOpenFileManager","onLoaded","onBlockSave","onBlockRemove","onBlockEdit","onInit","onUndoChange","onRedoChange","onPreview","onAlert"],setup(l,{emit:t}){const c=l,s="topol-editor-id",S=()=>{const a={onSave(n,i){t("onSave",{json:n,html:i})},onSaveAndClose(n,i){t("onSaveAndClose",{json:n,html:i})},onTestSend(n,i,k){t("onTestSend",{email:n,json:i,html:k})},onOpenFileManager(){t("onOpenFileManager")},onLoaded(){t("onLoaded")},onBlockSave(n){t("onBlockSave",n)},onBlockRemove(n){t("onBlockRemove",n)},onBlockEdit(n){t("onBlockEdit",n)},onInit(){t("onInit")},onUndoChange(n){t("onUndoChange",n)},onRedoChange(n){t("onRedoChange",n)},onPreview(n){t("onPreview",n)},onAlert(n){t("onAlert",n)}};return v(u({id:"#"+s},c.options),{callbacks:u({},a)})};return o.onMounted(async()=>{const a=S();await r.default.init(a,{dev:c.dev})}),o.onBeforeUnmount(()=>{r.default.destroy()}),(a,n)=>(o.openBlock(),o.createElementBlock("div",{id:s,style:{position:"absolute",width:"100%",height:"100vh"}}))}});Object.defineProperty(e,"TopolPlugin",{enumerable:!0,get:function(){return r.default}}),e.TopolEditor=h,Object.defineProperty(e,"__esModule",{value:!0}),e[Symbol.toStringTag]="Module"});
|
package/package.json
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topol.io/editor-vue",
|
|
3
|
-
"description": "Vue.js
|
|
3
|
+
"description": "Official Vue.js package for Topol Editor.",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"plugin",
|
|
6
6
|
"editor",
|
|
7
7
|
"email",
|
|
8
8
|
"topol",
|
|
9
|
-
"topol.io"
|
|
9
|
+
"topol.io",
|
|
10
|
+
"topol-vue",
|
|
11
|
+
"email-vue",
|
|
12
|
+
"email templates"
|
|
10
13
|
],
|
|
11
14
|
"author": "Topol.io",
|
|
12
15
|
"homepage": "https://topol.io",
|
|
13
16
|
"license": "Apache-2.0",
|
|
14
|
-
"version": "0.0.0-beta.
|
|
17
|
+
"version": "0.0.0-beta.7",
|
|
15
18
|
"files": [
|
|
16
19
|
"dist"
|
|
17
20
|
],
|
|
@@ -31,13 +34,13 @@
|
|
|
31
34
|
"build:types": "vue-tsc"
|
|
32
35
|
},
|
|
33
36
|
"dependencies": {
|
|
34
|
-
"@topol.io/editor": "^0.0.0-alfa.
|
|
37
|
+
"@topol.io/editor": "^0.0.0-alfa.10"
|
|
35
38
|
},
|
|
36
39
|
"peerDependencies": {
|
|
37
40
|
"vue": "^3.2.25"
|
|
38
41
|
},
|
|
39
42
|
"devDependencies": {
|
|
40
|
-
"@types/node": "^17.0.
|
|
43
|
+
"@types/node": "^17.0.14",
|
|
41
44
|
"@vitejs/plugin-vue": "^2.0.0",
|
|
42
45
|
"typescript": "^4.4.4",
|
|
43
46
|
"vite": "^2.7.2",
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import IVueOptions from "../types/IVueTopolOptions";
|
|
2
|
-
import ISavedBlock from "../types/SavedBlock/ISavedBlock";
|
|
3
|
-
import INotification from "../types/Notification/INotification";
|
|
4
|
-
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
5
|
-
options: IVueOptions;
|
|
6
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
-
onSave: (payload_0: {
|
|
8
|
-
json: unknown;
|
|
9
|
-
html: unknown;
|
|
10
|
-
}) => void;
|
|
11
|
-
} & {
|
|
12
|
-
onSaveAndClose: (payload_0: {
|
|
13
|
-
json: unknown;
|
|
14
|
-
html: unknown;
|
|
15
|
-
}) => void;
|
|
16
|
-
} & {
|
|
17
|
-
onTestSend: (payload_0: {
|
|
18
|
-
email: string;
|
|
19
|
-
json: unknown;
|
|
20
|
-
html: unknown;
|
|
21
|
-
}) => void;
|
|
22
|
-
} & {
|
|
23
|
-
onOpenFileManager: () => void;
|
|
24
|
-
} & {
|
|
25
|
-
onLoaded: () => void;
|
|
26
|
-
} & {
|
|
27
|
-
onBlockSave: (block: ISavedBlock) => void;
|
|
28
|
-
} & {
|
|
29
|
-
onBlockRemove: (blockId: number) => void;
|
|
30
|
-
} & {
|
|
31
|
-
onBlockEdit: (blockId: number) => void;
|
|
32
|
-
} & {
|
|
33
|
-
onInit: () => void;
|
|
34
|
-
} & {
|
|
35
|
-
onUndoChange: (count: number) => void;
|
|
36
|
-
} & {
|
|
37
|
-
onRedoChange: (count: number) => void;
|
|
38
|
-
} & {
|
|
39
|
-
onPreview: (html: unknown) => void;
|
|
40
|
-
} & {
|
|
41
|
-
onAlert: (notification: INotification) => void;
|
|
42
|
-
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
43
|
-
options: IVueOptions;
|
|
44
|
-
}>>> & {
|
|
45
|
-
onOnSave?: ((args_0: {
|
|
46
|
-
json: unknown;
|
|
47
|
-
html: unknown;
|
|
48
|
-
}) => any) | undefined;
|
|
49
|
-
onOnSaveAndClose?: ((args_0: {
|
|
50
|
-
json: unknown;
|
|
51
|
-
html: unknown;
|
|
52
|
-
}) => any) | undefined;
|
|
53
|
-
onOnTestSend?: ((args_0: {
|
|
54
|
-
email: string;
|
|
55
|
-
json: unknown;
|
|
56
|
-
html: unknown;
|
|
57
|
-
}) => any) | undefined;
|
|
58
|
-
onOnOpenFileManager?: (() => any) | undefined;
|
|
59
|
-
onOnLoaded?: (() => any) | undefined;
|
|
60
|
-
onOnBlockSave?: ((block: ISavedBlock) => any) | undefined;
|
|
61
|
-
onOnBlockRemove?: ((blockId: number) => any) | undefined;
|
|
62
|
-
onOnBlockEdit?: ((blockId: number) => any) | undefined;
|
|
63
|
-
onOnInit?: (() => any) | undefined;
|
|
64
|
-
onOnUndoChange?: ((count: number) => any) | undefined;
|
|
65
|
-
onOnRedoChange?: ((count: number) => any) | undefined;
|
|
66
|
-
onOnPreview?: ((html: unknown) => any) | undefined;
|
|
67
|
-
onOnAlert?: ((notification: INotification) => any) | undefined;
|
|
68
|
-
}, {}>;
|
|
69
|
-
export default _default;
|
|
70
|
-
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
71
|
-
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
72
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
73
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
74
|
-
} : {
|
|
75
|
-
type: import('vue').PropType<T[K]>;
|
|
76
|
-
required: true;
|
|
77
|
-
};
|
|
78
|
-
};
|