@topol.io/editor-vue 0.0.0-beta.12 → 0.0.0-beta.13
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.
|
@@ -21,6 +21,7 @@ import { defineComponent, onMounted, onBeforeUnmount, openBlock, createElementBl
|
|
|
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
|
+
__name: "TopolEditor",
|
|
24
25
|
props: {
|
|
25
26
|
options: null,
|
|
26
27
|
dev: { type: Boolean, default: false }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var k=Object.defineProperty,B=Object.defineProperties;var C=Object.getOwnPropertyDescriptors;var p=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var f=(e,o,d)=>o in e?k(e,o,{enumerable:!0,configurable:!0,writable:!0,value:d}):e[o]=d,s=(e,o)=>{for(var d in o||(o={}))_.call(o,d)&&f(e,d,o[d]);if(p)for(var d of p(o))y.call(o,d)&&f(e,d,o[d]);return e},v=(e,o)=>B(e,C(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({__name:"TopolEditor",props:{options:null,dev:{type:Boolean,default:!1}},emits:["onSave","onSaveAndClose","onTestSend","onOpenFileManager","onLoaded","onBlockSave","onBlockRemove","onBlockEdit","onInit","onClose","onUndoChange","onRedoChange","onPreview","onAlert"],setup(l,{emit:t}){const u=l,c="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,T){t("onTestSend",{email:n,json:i,html:T})},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)},onClose(){t("onClose")}};return v(s({id:"#"+c},u.options),{callbacks:s({},a)})};return o.onMounted(async()=>{const a=S();await r.default.init(a,{dev:u.dev})}),o.onBeforeUnmount(()=>{r.default.destroy()}),(a,n)=>(o.openBlock(),o.createElementBlock("div",{id:c,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"});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { INotification, ISavedBlock } from "@topol.io/editor";
|
|
2
|
+
import IVueOptions from "../types/IVueTopolOptions";
|
|
3
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
options: IVueOptions;
|
|
5
|
+
dev?: boolean | undefined;
|
|
6
|
+
}>, {
|
|
7
|
+
dev: boolean;
|
|
8
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
onSave: (payload_0: {
|
|
10
|
+
json: unknown;
|
|
11
|
+
html: unknown;
|
|
12
|
+
}) => void;
|
|
13
|
+
} & {
|
|
14
|
+
onSaveAndClose: (payload_0: {
|
|
15
|
+
json: unknown;
|
|
16
|
+
html: unknown;
|
|
17
|
+
}) => void;
|
|
18
|
+
} & {
|
|
19
|
+
onTestSend: (payload_0: {
|
|
20
|
+
email: string;
|
|
21
|
+
json: unknown;
|
|
22
|
+
html: unknown;
|
|
23
|
+
}) => void;
|
|
24
|
+
} & {
|
|
25
|
+
onOpenFileManager: () => void;
|
|
26
|
+
} & {
|
|
27
|
+
onLoaded: () => void;
|
|
28
|
+
} & {
|
|
29
|
+
onBlockSave: (block: ISavedBlock) => void;
|
|
30
|
+
} & {
|
|
31
|
+
onBlockRemove: (blockId: number) => void;
|
|
32
|
+
} & {
|
|
33
|
+
onBlockEdit: (blockId: number) => void;
|
|
34
|
+
} & {
|
|
35
|
+
onInit: () => void;
|
|
36
|
+
} & {
|
|
37
|
+
onClose: () => void;
|
|
38
|
+
} & {
|
|
39
|
+
onUndoChange: (count: number) => void;
|
|
40
|
+
} & {
|
|
41
|
+
onRedoChange: (count: number) => void;
|
|
42
|
+
} & {
|
|
43
|
+
onPreview: (html: unknown) => void;
|
|
44
|
+
} & {
|
|
45
|
+
onAlert: (notification: INotification) => void;
|
|
46
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
47
|
+
options: IVueOptions;
|
|
48
|
+
dev?: boolean | undefined;
|
|
49
|
+
}>, {
|
|
50
|
+
dev: boolean;
|
|
51
|
+
}>>> & {
|
|
52
|
+
onOnSave?: ((args_0: {
|
|
53
|
+
json: unknown;
|
|
54
|
+
html: unknown;
|
|
55
|
+
}) => any) | undefined;
|
|
56
|
+
onOnSaveAndClose?: ((args_0: {
|
|
57
|
+
json: unknown;
|
|
58
|
+
html: unknown;
|
|
59
|
+
}) => any) | undefined;
|
|
60
|
+
onOnTestSend?: ((args_0: {
|
|
61
|
+
email: string;
|
|
62
|
+
json: unknown;
|
|
63
|
+
html: unknown;
|
|
64
|
+
}) => any) | undefined;
|
|
65
|
+
onOnOpenFileManager?: (() => any) | undefined;
|
|
66
|
+
onOnLoaded?: (() => any) | undefined;
|
|
67
|
+
onOnBlockSave?: ((block: ISavedBlock) => any) | undefined;
|
|
68
|
+
onOnBlockRemove?: ((blockId: number) => any) | undefined;
|
|
69
|
+
onOnBlockEdit?: ((blockId: number) => any) | undefined;
|
|
70
|
+
onOnInit?: (() => any) | undefined;
|
|
71
|
+
onOnClose?: (() => any) | undefined;
|
|
72
|
+
onOnUndoChange?: ((count: number) => any) | undefined;
|
|
73
|
+
onOnRedoChange?: ((count: number) => any) | undefined;
|
|
74
|
+
onOnPreview?: ((html: unknown) => any) | undefined;
|
|
75
|
+
onOnAlert?: ((notification: INotification) => any) | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
dev: boolean;
|
|
78
|
+
}>;
|
|
79
|
+
export default _default;
|
|
80
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
81
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
82
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
83
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
84
|
+
} : {
|
|
85
|
+
type: import('vue').PropType<T[K]>;
|
|
86
|
+
required: true;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
type __VLS_WithDefaults<P, D> = {
|
|
90
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
|
|
91
|
+
default: D[K];
|
|
92
|
+
} : P[K];
|
|
93
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ISavedBlock, IMergeTagGroup, IContentBlockOptions, ITheme, IAuthHeaderConfig, IFont, IAPI } from "@topol.io/editor";
|
|
1
|
+
import { ISavedBlock, IMergeTagGroup, IContentBlockOptions, ITheme, IAuthHeaderConfig, IFont, IAPI, ICustomBlockData } from "@topol.io/editor";
|
|
2
2
|
export default interface IVueOptions {
|
|
3
3
|
authorize: {
|
|
4
4
|
apiKey: string;
|
|
@@ -31,4 +31,10 @@ export default interface IVueOptions {
|
|
|
31
31
|
colors?: Array<string>;
|
|
32
32
|
googleApiKey?: string;
|
|
33
33
|
role?: "manager" | "editor" | "reader";
|
|
34
|
+
imageMaxSize?: number;
|
|
35
|
+
autosaveInterval?: number;
|
|
36
|
+
betaFeatures?: {
|
|
37
|
+
carousel?: boolean;
|
|
38
|
+
};
|
|
39
|
+
customBlocks?: ICustomBlockData[];
|
|
34
40
|
}
|
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.0-beta.
|
|
17
|
+
"version": "0.0.0-beta.13",
|
|
18
18
|
"files": [
|
|
19
19
|
"dist"
|
|
20
20
|
],
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"vue": "^3.2.25"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
+
"@babel/types": "^7.20.7",
|
|
43
44
|
"@types/node": "^18.13.0",
|
|
44
45
|
"@vitejs/plugin-vue": "^2.0.0",
|
|
45
46
|
"typescript": "^4.9.5",
|