@keyblade/tinymce-editor-vue2 1.2.0 → 1.2.2
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/es/_virtual/_plugin-vue2_normalizer.js +3 -3
- package/es/editor.vue.d.ts +21 -42
- package/es/editor.vue.js +5 -5
- package/es/editor.vue2.js +142 -139
- package/es/index.d.ts +28 -33
- package/es/index.js +1 -1
- package/es/types.d.ts +12 -3
- package/package.json +2 -2
- package/es/style.less.js +0 -1
- /package/es/{style.css → tinymce-editor-vue2.css} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
function
|
|
1
|
+
function f(e, o, t, d, i, a, l, u) {
|
|
2
2
|
var n = typeof e == "function" ? e.options : e;
|
|
3
|
-
return
|
|
3
|
+
return n.render = o, n.staticRenderFns = t, n._compiled = !0, {
|
|
4
4
|
exports: e,
|
|
5
5
|
options: n
|
|
6
6
|
};
|
|
7
7
|
}
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
f as default
|
|
10
10
|
};
|
package/es/editor.vue.d.ts
CHANGED
|
@@ -1,65 +1,49 @@
|
|
|
1
1
|
import { Editor, RawEditorOptions } from 'tinymce';
|
|
2
2
|
import { AudioUploadOptions, ImageUploadOptions, VideoUploadOptions } from './types';
|
|
3
|
-
|
|
4
|
-
declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
type __VLS_Props = {
|
|
5
4
|
/** vue2 v-model */
|
|
6
|
-
value?: string
|
|
5
|
+
value?: string;
|
|
7
6
|
/** 是否禁止编辑 */
|
|
8
|
-
disabled?: boolean
|
|
7
|
+
disabled?: boolean;
|
|
9
8
|
/** 额外参数 */
|
|
10
|
-
extParameters?: Record<string, any
|
|
9
|
+
extParameters?: Record<string, any>;
|
|
11
10
|
/** 富文本编辑器选项 */
|
|
12
|
-
options?: Partial<RawEditorOptions
|
|
11
|
+
options?: Partial<RawEditorOptions>;
|
|
13
12
|
/** 图片上传选项 */
|
|
14
|
-
imageUploadOptions?: ImageUploadOptions
|
|
13
|
+
imageUploadOptions?: ImageUploadOptions;
|
|
15
14
|
/** 音频上传组件选项 */
|
|
16
|
-
audioUploadOptions?: AudioUploadOptions
|
|
15
|
+
audioUploadOptions?: AudioUploadOptions;
|
|
17
16
|
/** 视频上传选项 */
|
|
18
|
-
videoUploadOptions?: VideoUploadOptions
|
|
17
|
+
videoUploadOptions?: VideoUploadOptions;
|
|
19
18
|
/** 初始化完成 */
|
|
20
|
-
initComplete?: (
|
|
19
|
+
initComplete?: (params: {
|
|
21
20
|
editorIns: Editor;
|
|
22
|
-
}) => void
|
|
23
|
-
}
|
|
21
|
+
}) => void;
|
|
22
|
+
};
|
|
23
|
+
declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
24
24
|
value: string;
|
|
25
25
|
disabled: boolean;
|
|
26
26
|
extParameters: () => {};
|
|
27
27
|
options: () => {};
|
|
28
|
-
}>, {}, {}, {}, {}, import('vue/types/v3-component-options').ComponentOptionsMixin, import('vue/types/v3-component-options').ComponentOptionsMixin, {
|
|
29
|
-
input: (value: string) => void;
|
|
30
|
-
}, string, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
31
|
-
/** vue2 v-model */
|
|
32
|
-
value?: string | undefined;
|
|
33
|
-
/** 是否禁止编辑 */
|
|
34
|
-
disabled?: boolean | undefined;
|
|
35
|
-
/** 额外参数 */
|
|
36
|
-
extParameters?: Record<string, any> | undefined;
|
|
37
|
-
/** 富文本编辑器选项 */
|
|
38
|
-
options?: Partial<RawEditorOptions> | undefined;
|
|
39
|
-
/** 图片上传选项 */
|
|
40
|
-
imageUploadOptions?: ImageUploadOptions | undefined;
|
|
41
|
-
/** 音频上传组件选项 */
|
|
42
|
-
audioUploadOptions?: AudioUploadOptions | undefined;
|
|
43
|
-
/** 视频上传选项 */
|
|
44
|
-
videoUploadOptions?: VideoUploadOptions | undefined;
|
|
45
|
-
/** 初始化完成 */
|
|
46
|
-
initComplete?: ((params: {
|
|
47
|
-
editorIns: Editor;
|
|
48
|
-
}) => void) | undefined;
|
|
49
|
-
}>, {
|
|
28
|
+
}>, {}, {}, {}, {}, import('vue/types/v3-component-options').ComponentOptionsMixin, import('vue/types/v3-component-options').ComponentOptionsMixin, {}, string, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
50
29
|
value: string;
|
|
51
30
|
disabled: boolean;
|
|
52
31
|
extParameters: () => {};
|
|
53
32
|
options: () => {};
|
|
54
33
|
}>>>, {
|
|
34
|
+
options: Partial<RawEditorOptions>;
|
|
55
35
|
value: string;
|
|
56
36
|
disabled: boolean;
|
|
57
37
|
extParameters: Record<string, any>;
|
|
58
|
-
options: Partial<RawEditorOptions>;
|
|
59
38
|
}>;
|
|
60
39
|
export default _default;
|
|
40
|
+
type __VLS_WithDefaults<P, D> = {
|
|
41
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
42
|
+
default: D[K];
|
|
43
|
+
}> : P[K];
|
|
44
|
+
};
|
|
61
45
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
62
|
-
type
|
|
46
|
+
type __VLS_TypePropsToOption<T> = {
|
|
63
47
|
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
64
48
|
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
65
49
|
} : {
|
|
@@ -67,11 +51,6 @@ type __VLS_TypePropsToRuntimeProps<T> = {
|
|
|
67
51
|
required: true;
|
|
68
52
|
};
|
|
69
53
|
};
|
|
70
|
-
type
|
|
71
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
72
|
-
default: D[K];
|
|
73
|
-
}> : P[K];
|
|
74
|
-
};
|
|
75
|
-
type __VLS_Prettify<T> = {
|
|
54
|
+
type __VLS_PrettifyLocal<T> = {
|
|
76
55
|
[K in keyof T]: T[K];
|
|
77
56
|
} & {};
|
package/es/editor.vue.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import A from "./editor.vue2.js";
|
|
2
2
|
import I from "./_virtual/_plugin-vue2_normalizer.js";
|
|
3
3
|
var h = function() {
|
|
4
|
-
var i, l, s,
|
|
4
|
+
var i, l, s, d, u, r, p, n, m, c, g, f, C, v, F, U, _, D, E, b, y;
|
|
5
5
|
var a = this, o = a._self._c, e = a._self._setupProxy;
|
|
6
6
|
return o("div", { staticClass: "tinymce-editor" }, [o("textarea", { ref: "insRef" }), o("el-dialog", { staticClass: "tinymce-editor-dialog tinymce-editor-upload-image-dialog", attrs: { visible: e.uploadImage.dialogVisible, title: "插入图片", "append-to-body": !0, "close-on-click-modal": !1, "destroy-on-close": "" }, on: { close: e.onUploadImageClose } }, [o("el-form", { ref: "uploadImageFormRef", staticClass: "uploadImageForm", attrs: { model: e.uploadImage.formData } }, [o("el-form-item", { attrs: { prop: "images", rules: { required: !0, message: "必填项" } } }, [o("kb-pro-vue2-image-upload", a._b({ attrs: { accept: (i = e.mergeImageUploadOptions) == null ? void 0 : i.accept, action: e.mergeImageUploadOptions.action || "", data: e.getUploadImageData(), headers: e.getUploadImageHeaders(), onInnerBeforeUploadEnd: e.onUploadImageInnerBeforeUploadEnd }, model: { value: e.uploadImage.formData.images, callback: function(t) {
|
|
7
7
|
a.$set(e.uploadImage.formData, "images", t);
|
|
8
|
-
}, expression: "uploadImage.formData.images" } }, "kb-pro-vue2-image-upload", e.mergeImageUploadOptions, !1))], 1), o("div", { staticClass: "tips" }, [o("span", { staticStyle: { "font-size": "15px", "font-weight": "bold" } }, [a._v("注意:")]), o("span", [a._v("1. 单次最多可同时选择" + a._s(e.mergeImageUploadOptions.singleLimit) + "张图片")]), o("span", [a._v("2. 仅支持" + a._s((s = (l = e.mergeImageUploadOptions) == null ? void 0 : l.accept) == null ? void 0 : s.map((t) => t.toUpperCase()).join("、")) + "格式")]), o("span", [a._v("3. 单张图片大小不可超过" + a._s((
|
|
8
|
+
}, expression: "uploadImage.formData.images" } }, "kb-pro-vue2-image-upload", e.mergeImageUploadOptions, !1))], 1), o("div", { staticClass: "tips" }, [o("span", { staticStyle: { "font-size": "15px", "font-weight": "bold" } }, [a._v("注意:")]), o("span", [a._v("1. 单次最多可同时选择" + a._s(e.mergeImageUploadOptions.singleLimit) + "张图片")]), o("span", [a._v("2. 仅支持" + a._s((s = (l = e.mergeImageUploadOptions) == null ? void 0 : l.accept) == null ? void 0 : s.map((t) => t.toUpperCase()).join("、")) + "格式")]), o("span", [a._v("3. 单张图片大小不可超过" + a._s((u = (d = e.mergeImageUploadOptions) == null ? void 0 : d.checkOptions) == null ? void 0 : u.maxSize) + "M")]), o("span", [a._v("4. 像素不低于" + a._s((p = (r = e.mergeImageUploadOptions) == null ? void 0 : r.checkOptions) == null ? void 0 : p.minWidth) + "*" + a._s((m = (n = e.mergeImageUploadOptions) == null ? void 0 : n.checkOptions) == null ? void 0 : m.minHeight) + "且像素不高于" + a._s((g = (c = e.mergeImageUploadOptions) == null ? void 0 : c.checkOptions) == null ? void 0 : g.maxWidth) + "*" + a._s((C = (f = e.mergeImageUploadOptions) == null ? void 0 : f.checkOptions) == null ? void 0 : C.maxHeight))])])], 1), o("div", { attrs: { slot: "footer" }, slot: "footer" }, [o("el-button", { on: { click: e.onUploadImageClose } }, [a._v("取消")]), o("el-button", { attrs: { type: "primary" }, on: { click: e.onUploadImageConfirm } }, [a._v("确定")])], 1)], 1), o("el-dialog", { staticClass: "tinymce-editor-dialog tinymce-editor-upload-audio-dialog", attrs: { visible: e.uploadAudio.dialogVisible, title: "插入音频", "append-to-body": !0, "close-on-click-modal": !1, "destroy-on-close": "" }, on: { close: e.onUploadAudioClose } }, [o("el-form", { ref: "uploadAudioFormRef", staticClass: "uploadAudioForm", attrs: { model: e.uploadAudio.formData, "label-width": "auto" } }, [o("el-form-item", { attrs: { label: "名称", prop: "name", rules: { required: !0, message: "必填项" } } }, [o("el-input", { attrs: { maxlength: "14", "show-word-limit": "", placeholder: "请输入" }, model: { value: e.uploadAudio.formData.name, callback: function(t) {
|
|
9
9
|
a.$set(e.uploadAudio.formData, "name", t);
|
|
10
10
|
}, expression: "uploadAudio.formData.name" } })], 1), o("el-form-item", { attrs: { label: "封面", prop: "cover", rules: { required: !0, message: "必填项" } } }, [o("kb-pro-vue2-image-upload", a._b({ attrs: { accept: (v = e.mergeImageUploadOptions) == null ? void 0 : v.accept, action: e.mergeImageUploadOptions.action || "", data: e.getUploadImageData(), headers: e.getUploadImageHeaders(), onInnerBeforeUploadEnd: e.onUploadImageInnerBeforeUploadEnd, limit: 1, multiple: !1 }, model: { value: e.uploadAudio.formData.cover, callback: function(t) {
|
|
11
11
|
a.$set(e.uploadAudio.formData, "cover", t);
|
|
12
|
-
}, expression: "uploadAudio.formData.cover" } }, "kb-pro-vue2-image-upload", e.mergeImageUploadOptions, !1))], 1), o("el-form-item", { attrs: { label: "音频", prop: "file", rules: { required: !0, message: "必填项" } } }, [o("el-upload", { class: ["upload", { "upload-hide": e.uploadAudio.formData.file.length >= 1 }], attrs: { name:
|
|
12
|
+
}, expression: "uploadAudio.formData.cover" } }, "kb-pro-vue2-image-upload", e.mergeImageUploadOptions, !1))], 1), o("el-form-item", { attrs: { label: "音频", prop: "file", rules: { required: !0, message: "必填项" } } }, [o("el-upload", { class: ["upload", { "upload-hide": e.uploadAudio.formData.file.length >= 1 }], attrs: { name: e.mergeAudioUploadOptions.name, "file-list": e.uploadAudio.formData.file, action: ((F = e.mergeAudioUploadOptions) == null ? void 0 : F.action) || "", data: e.getUploadAudioData(), accept: e.mergeAudioUploadOptions.accept, "list-type": "headTextContent", "before-upload": e.onUploadAudioBeforeUpload, headers: e.getUploadAudioHeaders(), "on-remove": e.onUploadAudioRemove, "on-success": e.onUploadAudioSuccess, "on-error": e.onUploadAudioError, limit: 1 } }, [o("el-button", { attrs: { size: "small", type: "primary" } }, [a._v("上传文件"), o("i", { staticClass: "el-icon-upload el-icon--right" })]), o("div", { staticClass: "el-upload__tip", attrs: { slot: "tip" }, slot: "tip" }, [o("div", { staticClass: "tips" }, [o("p", [a._v("注意:")]), o("div", [o("span", [a._v("1. 仅支持" + a._s((_ = (U = e.mergeAudioUploadOptions) == null ? void 0 : U.allowedType) == null ? void 0 : _.map((t) => t.toUpperCase()).join("、")) + "格式")]), o("span", [a._v("2. 单个音频大小不可超过" + a._s((D = e.mergeAudioUploadOptions) == null ? void 0 : D.maxSize) + "M")])])])])], 1)], 1)], 1), o("div", { attrs: { slot: "footer" }, slot: "footer" }, [o("el-button", { on: { click: e.onUploadAudioClose } }, [a._v("取消")]), o("el-button", { attrs: { type: "primary" }, on: { click: e.onUploadAudioConfirm } }, [a._v("确定")])], 1)], 1), o("el-dialog", { staticClass: "tinymce-editor-dialog tinymce-editor-upload-video-dialog", attrs: { visible: e.uploadVideo.dialogVisible, title: "插入视频", "append-to-body": !0, "close-on-click-modal": !1, "destroy-on-close": "" }, on: { close: e.onUploadVideoClose } }, [o("el-form", { ref: "uploadVideoFormRef", staticClass: "uploadVideoForm", attrs: { model: e.uploadVideo.formData, "label-width": "auto" } }, [o("el-form-item", { attrs: { label: "视频", prop: "file", rules: { required: !0, message: "必填项" } } }, [o("el-upload", { class: ["upload", { "upload-hide": e.uploadVideo.formData.file.length >= 1 }], attrs: { name: e.mergeVideoUploadOptions.name, "file-list": e.uploadVideo.formData.file, action: e.mergeVideoUploadOptions.action || "", data: e.getUploadVideoData(), accept: e.mergeVideoUploadOptions.accept, "list-type": "headTextContent", "before-upload": e.onUploadVideoBeforeUpload, headers: e.getUploadVideoHeaders(), "on-remove": e.onUploadVideoRemove, "on-success": e.onUploadVideoSuccess, "on-error": e.onUploadVideoError, limit: 1 } }, [o("el-button", { attrs: { size: "small", type: "primary" } }, [a._v("上传文件"), o("i", { staticClass: "el-icon-upload el-icon--right" })]), o("div", { staticClass: "el-upload__tip", attrs: { slot: "tip" }, slot: "tip" }, [o("div", { staticClass: "tips" }, [o("p", [a._v("注意:")]), o("div", [o("span", [a._v("1. 仅支持" + a._s((b = (E = e.mergeVideoUploadOptions) == null ? void 0 : E.allowedType) == null ? void 0 : b.map((t) => t.toUpperCase()).join("、")) + "格式")]), o("span", [a._v("2. 单个视频大小不可超过" + a._s((y = e.mergeVideoUploadOptions) == null ? void 0 : y.maxSize) + "M")])])])])], 1)], 1)], 1), o("div", { attrs: { slot: "footer" }, slot: "footer" }, [o("el-button", { on: { click: e.onUploadVideoClose } }, [a._v("取消")]), o("el-button", { attrs: { type: "primary" }, on: { click: e.onUploadVideoConfirm } }, [a._v("确定")])], 1)], 1), o("el-dialog", { staticClass: "tinymce-editor-loading-dialog", attrs: { fullscreen: "", "append-to-body": "", visible: e.uploadLoadingConfig.show, "show-close": !1, "close-on-press-escape": !1, "close-on-click-modal": !1, "destroy-on-close": "" }, on: { "update:visible": function(t) {
|
|
13
13
|
return a.$set(e.uploadLoadingConfig, "show", t);
|
|
14
14
|
} } }, [o("div", { staticClass: "tinymce-editor-loading-dialog-content" }, [o("div", { staticClass: "tinymce-editor-spinner" }, [o("div", { staticClass: "tinymce-editor-spinner-dot1" }), o("div", { staticClass: "tinymce-editor-spinner-dot2" }), o("div", { staticClass: "tinymce-editor-spinner-dot3" })]), o("span", [a._v(a._s(e.uploadLoadingConfig.text))])])])], 1);
|
|
15
|
-
}, O = [],
|
|
15
|
+
}, O = [], V = /* @__PURE__ */ I(
|
|
16
16
|
A,
|
|
17
17
|
h,
|
|
18
18
|
O
|
|
19
19
|
);
|
|
20
|
-
const w =
|
|
20
|
+
const w = V.exports;
|
|
21
21
|
export {
|
|
22
22
|
w as default
|
|
23
23
|
};
|
package/es/editor.vue2.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
var Be = Object.defineProperty, Ve = Object.defineProperties;
|
|
2
2
|
var je = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var ue = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var ce = (
|
|
6
|
-
var me = (
|
|
7
|
-
for (var i in
|
|
8
|
-
|
|
4
|
+
var Re = Object.prototype.hasOwnProperty, He = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var ce = (c, s) => (s = Symbol[c]) ? s : Symbol.for("Symbol." + c);
|
|
6
|
+
var me = (c, s, i) => s in c ? Be(c, s, { enumerable: !0, configurable: !0, writable: !0, value: i }) : c[s] = i, D = (c, s) => {
|
|
7
|
+
for (var i in s || (s = {}))
|
|
8
|
+
Re.call(s, i) && me(c, i, s[i]);
|
|
9
9
|
if (ue)
|
|
10
|
-
for (var i of ue(
|
|
11
|
-
|
|
12
|
-
return
|
|
13
|
-
}, B = (
|
|
14
|
-
var
|
|
10
|
+
for (var i of ue(s))
|
|
11
|
+
He.call(s, i) && me(c, i, s[i]);
|
|
12
|
+
return c;
|
|
13
|
+
}, B = (c, s) => Ve(c, je(s));
|
|
14
|
+
var F = (c, s, i) => new Promise((O, T) => {
|
|
15
15
|
var P = (g) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
17
|
+
m(i.next(g));
|
|
18
18
|
} catch (I) {
|
|
19
19
|
T(I);
|
|
20
20
|
}
|
|
21
21
|
}, V = (g) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
23
|
+
m(i.throw(g));
|
|
24
24
|
} catch (I) {
|
|
25
25
|
T(I);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, m = (g) => g.done ? O(g.value) : Promise.resolve(g.value).then(P, V);
|
|
28
|
+
m((i = i.apply(c, s)).next());
|
|
29
29
|
});
|
|
30
|
-
var G = (
|
|
31
|
-
import { defineComponent as
|
|
30
|
+
var G = (c, s, i) => (s = c[ce("asyncIterator")]) ? s.call(c) : (c = c[ce("iterator")](), s = {}, i = (O, T) => (T = c[O]) && (s[O] = (P) => new Promise((V, m, g) => (P = T.call(c, P), g = P.done, Promise.resolve(P.value).then((I) => V({ value: I, done: g }), m)))), i("next"), i("return"), s);
|
|
31
|
+
import { defineComponent as $e, ref as A, computed as X, onMounted as Ee, onUnmounted as qe, watch as de } from "vue";
|
|
32
32
|
import { oneTravelImageCheckAndTransform as Fe, oneTravelImageCompressor as We, blobToFile as Ne, getImagePixel as Le, getFileExtension as Ge } from "@keyblade/one-travel";
|
|
33
|
-
|
|
34
|
-
import { conclude as
|
|
33
|
+
/* empty css */
|
|
34
|
+
import { conclude as W } from "vue-global-config";
|
|
35
35
|
import pe from "tinymce";
|
|
36
36
|
import Xe from "./langs/zh_CN.js";
|
|
37
37
|
import "tinymce/skins/ui/oxide/skin";
|
|
@@ -64,10 +64,10 @@ import "tinymce/plugins/table";
|
|
|
64
64
|
import "tinymce/plugins/visualblocks";
|
|
65
65
|
import "tinymce/plugins/visualchars";
|
|
66
66
|
import "tinymce/plugins/wordcount";
|
|
67
|
-
import { globalProps as
|
|
67
|
+
import { globalProps as N } from "./index.js";
|
|
68
68
|
import { Message as b } from "element-ui";
|
|
69
69
|
import { defaultImageUploadOptions as S, EImageUploadInnerBeforeUploadStep as Je } from "@keyblade/pro-components-vue2";
|
|
70
|
-
const
|
|
70
|
+
const Ra = /* @__PURE__ */ $e({
|
|
71
71
|
__name: "editor",
|
|
72
72
|
props: {
|
|
73
73
|
value: { default: "" },
|
|
@@ -80,8 +80,8 @@ const Ha = /* @__PURE__ */ Ee({
|
|
|
80
80
|
initComplete: null
|
|
81
81
|
},
|
|
82
82
|
emits: ["input"],
|
|
83
|
-
setup(
|
|
84
|
-
const i =
|
|
83
|
+
setup(c, { emit: s }) {
|
|
84
|
+
const i = c;
|
|
85
85
|
pe.addI18n("zh_CN", Xe);
|
|
86
86
|
const O = {
|
|
87
87
|
name: S.name,
|
|
@@ -94,33 +94,35 @@ const Ha = /* @__PURE__ */ Ee({
|
|
|
94
94
|
compressorOptions: S.compressorOptions,
|
|
95
95
|
cropOptions: S.cropOptions
|
|
96
96
|
}, T = {
|
|
97
|
+
name: "file",
|
|
97
98
|
enable: !0,
|
|
98
99
|
maxSize: 300,
|
|
99
100
|
allowedType: ["avi", "wmv", "mp4", "mov", "3gp"],
|
|
100
101
|
accept: ".avi,.wmv,.mp4,.mov,.3gp"
|
|
101
102
|
}, P = {
|
|
103
|
+
name: "file",
|
|
102
104
|
enable: !0,
|
|
103
105
|
maxSize: 200,
|
|
104
106
|
allowedType: ["wav", "mp3", "mp4", "m4a", "wma", "aac"],
|
|
105
107
|
accept: ".wav,.mp3,.mp4,.m4a,.wma,.aac"
|
|
106
|
-
}, V = A(),
|
|
108
|
+
}, V = A(), m = A(), g = A(!1), I = A(!1), H = A({
|
|
107
109
|
show: !1,
|
|
108
110
|
text: "图片上传中,请稍等"
|
|
109
|
-
}), p = X(() =>
|
|
111
|
+
}), p = X(() => W([i.imageUploadOptions, N.imageUploadOptions, O]) || {}), u = X(() => W([i.videoUploadOptions, N.videoUploadOptions, T]) || {}), v = X(() => W([i.audioUploadOptions, N.audioUploadOptions, P]) || {}), $ = A({
|
|
110
112
|
dialogVisible: !1,
|
|
111
113
|
formData: {
|
|
112
114
|
images: []
|
|
113
115
|
}
|
|
114
116
|
}), j = A(), J = A(), K = () => {
|
|
115
|
-
|
|
117
|
+
$.value.dialogVisible = !1, $.value.formData = {
|
|
116
118
|
images: []
|
|
117
119
|
}, j.value = void 0;
|
|
118
120
|
}, fe = () => {
|
|
119
121
|
var o;
|
|
120
122
|
(o = J.value) == null || o.validate((e) => {
|
|
121
|
-
e && (
|
|
122
|
-
var
|
|
123
|
-
(
|
|
123
|
+
e && ($.value.formData.images.forEach((a) => {
|
|
124
|
+
var l;
|
|
125
|
+
(l = m.value) == null || l.insertContent(`<img src=${a == null ? void 0 : a.url} alt="" />`);
|
|
124
126
|
}), K());
|
|
125
127
|
});
|
|
126
128
|
}, w = A({
|
|
@@ -144,8 +146,8 @@ const Ha = /* @__PURE__ */ Ee({
|
|
|
144
146
|
}, ve = () => {
|
|
145
147
|
var o;
|
|
146
148
|
(o = Q.value) == null || o.validate((e) => {
|
|
147
|
-
var a,
|
|
148
|
-
e && ((
|
|
149
|
+
var a, l;
|
|
150
|
+
e && ((l = m.value) == null || l.insertContent(`<audio controls controlslist="nodownload noplaybackrate" data-name="${w.value.formData.name}" data-poster="${w.value.formData.cover[0]}" src="${(a = w.value.formData.file[0]) == null ? void 0 : a.url}"></audio>`), Y());
|
|
149
151
|
});
|
|
150
152
|
}, _ = A({
|
|
151
153
|
dialogVisible: !1,
|
|
@@ -162,15 +164,15 @@ const Ha = /* @__PURE__ */ Ee({
|
|
|
162
164
|
}, ge = () => {
|
|
163
165
|
var o;
|
|
164
166
|
(o = Z.value) == null || o.validate((e) => {
|
|
165
|
-
var a,
|
|
166
|
-
e && ((
|
|
167
|
+
var a, l;
|
|
168
|
+
e && ((l = m.value) == null || l.insertContent(`<video width="auto" height="auto" controls src="${(a = _.value.formData.file[0]) == null ? void 0 : a.url}"></video>`), ee());
|
|
167
169
|
});
|
|
168
170
|
};
|
|
169
171
|
function ae(o) {
|
|
170
|
-
return
|
|
171
|
-
var
|
|
172
|
+
return F(this, null, function* () {
|
|
173
|
+
var r, d, y, f, C, h, U, M, E;
|
|
172
174
|
let e = o;
|
|
173
|
-
if (!((
|
|
175
|
+
if (!((r = p.value) != null && r.handleRequest)) {
|
|
174
176
|
b.error("缺少图片上传配置");
|
|
175
177
|
return;
|
|
176
178
|
}
|
|
@@ -179,7 +181,7 @@ const Ha = /* @__PURE__ */ Ee({
|
|
|
179
181
|
b.error("不允许粘贴");
|
|
180
182
|
return;
|
|
181
183
|
}
|
|
182
|
-
const
|
|
184
|
+
const l = yield Fe(e, a, {
|
|
183
185
|
imageMaxSize: (d = p.value.checkOptions) == null ? void 0 : d.maxSize,
|
|
184
186
|
imageAllowedType: (y = p.value.checkOptions) == null ? void 0 : y.allowedType,
|
|
185
187
|
// imageAllowedMineType: mergeImageUploadOptions.value.allowedMineType,
|
|
@@ -188,87 +190,86 @@ const Ha = /* @__PURE__ */ Ee({
|
|
|
188
190
|
imageMaxWidth: (h = p.value.checkOptions) == null ? void 0 : h.maxWidth,
|
|
189
191
|
imageMaxHeight: (U = p.value.checkOptions) == null ? void 0 : U.maxHeight
|
|
190
192
|
});
|
|
191
|
-
if (!
|
|
192
|
-
b.error((
|
|
193
|
+
if (!l.success) {
|
|
194
|
+
b.error((l == null ? void 0 : l.errorMessage) || "");
|
|
193
195
|
return;
|
|
194
196
|
}
|
|
195
|
-
if (
|
|
196
|
-
e =
|
|
197
|
+
if (l.hasTransform) {
|
|
198
|
+
e = l.file;
|
|
197
199
|
const ie = a == null ? void 0 : a.split(".");
|
|
198
200
|
ie.pop(), a = `${ie.join(",")}.jpg`;
|
|
199
201
|
}
|
|
200
|
-
const
|
|
201
|
-
if (!
|
|
202
|
-
b.error((
|
|
202
|
+
const n = yield We(e);
|
|
203
|
+
if (!n.success) {
|
|
204
|
+
b.error((n == null ? void 0 : n.errorMessage) || "压缩失败");
|
|
203
205
|
return;
|
|
204
206
|
}
|
|
205
|
-
const
|
|
206
|
-
if (!
|
|
207
|
-
b.error((
|
|
207
|
+
const t = yield (E = (M = p.value).handleRequest) == null ? void 0 : E.call(M, Ne(n.file, a), a, { extParameters: i.extParameters });
|
|
208
|
+
if (!t || !t.success) {
|
|
209
|
+
b.error((t == null ? void 0 : t.errorMessage) || "");
|
|
208
210
|
return;
|
|
209
211
|
}
|
|
210
|
-
return
|
|
212
|
+
return t.url;
|
|
211
213
|
});
|
|
212
214
|
}
|
|
213
|
-
const
|
|
214
|
-
var
|
|
215
|
-
const e =
|
|
215
|
+
const L = (o) => F(this, null, function* () {
|
|
216
|
+
var t, r, d, y, f, C, h, U, M, E, le, ne, re;
|
|
217
|
+
const e = m.value, a = o.types;
|
|
216
218
|
if (a.includes("text/html")) {
|
|
217
|
-
const z = o.getData("text/html"),
|
|
218
|
-
se.length > 0 && (
|
|
219
|
+
const z = o.getData("text/html"), R = new DOMParser().parseFromString(z, "text/html"), se = Array.from(R.body.querySelectorAll("img")), Te = Array.from(R.body.querySelectorAll("audio")), ze = Array.from(R.body.querySelectorAll("video"));
|
|
220
|
+
se.length > 0 && (H.value = {
|
|
219
221
|
show: !0,
|
|
220
222
|
text: "图片加载中,请稍等"
|
|
221
223
|
});
|
|
222
224
|
for (const k of [...Te, ...ze])
|
|
223
225
|
k == null || k.remove();
|
|
224
226
|
try {
|
|
225
|
-
for (var ie = G([...se]), Ke,
|
|
226
|
-
const k =
|
|
227
|
+
for (var ie = G([...se]), Ke, Ea, qa; Ke = !(Ea = yield ie.next()).done; Ke = !1) {
|
|
228
|
+
const k = Ea.value;
|
|
227
229
|
if (k.removeAttribute("crossorigin"), k.src.startsWith("http"))
|
|
228
|
-
if ((
|
|
229
|
-
const x = yield (
|
|
230
|
+
if ((t = p.value) != null && t.handleRequestByUrl) {
|
|
231
|
+
const x = yield (r = p.value) == null ? void 0 : r.handleRequestByUrl(k.src, { extParameters: i.extParameters });
|
|
230
232
|
x != null && x.success && (x != null && x.url) ? k.src = x == null ? void 0 : x.url : k.remove();
|
|
231
233
|
} else {
|
|
232
234
|
const x = yield Le(k.src);
|
|
233
|
-
x && (x.width < (((y = (d = p.value) == null ? void 0 : d.checkOptions) == null ? void 0 : y.minWidth) || 0) && x.height < (((C = (f = p.value) == null ? void 0 : f.checkOptions) == null ? void 0 : C.minHeight) || 0) || x.width > (((U = (h = p.value) == null ? void 0 : h.checkOptions) == null ? void 0 : U.maxWidth) || 0) && x.height > (((
|
|
235
|
+
x && (x.width < (((y = (d = p.value) == null ? void 0 : d.checkOptions) == null ? void 0 : y.minWidth) || 0) && x.height < (((C = (f = p.value) == null ? void 0 : f.checkOptions) == null ? void 0 : C.minHeight) || 0) || x.width > (((U = (h = p.value) == null ? void 0 : h.checkOptions) == null ? void 0 : U.maxWidth) || 0) && x.height > (((E = (M = p.value) == null ? void 0 : M.checkOptions) == null ? void 0 : E.maxHeight) || 0)) && k.remove();
|
|
234
236
|
}
|
|
235
237
|
else
|
|
236
238
|
k.remove(), b.error("不支持Word中批量复制图片或视频,请改为单个复制,或者从工具栏中手动插入上传");
|
|
237
239
|
}
|
|
238
|
-
} catch (
|
|
239
|
-
qa = [
|
|
240
|
+
} catch (Ea) {
|
|
241
|
+
qa = [Ea];
|
|
240
242
|
} finally {
|
|
241
243
|
try {
|
|
242
|
-
Ke && (
|
|
244
|
+
Ke && (Ea = ie.return) && (yield Ea.call(ie));
|
|
243
245
|
} finally {
|
|
244
246
|
if (qa)
|
|
245
247
|
throw qa[0];
|
|
246
248
|
}
|
|
247
249
|
}
|
|
248
|
-
|
|
249
|
-
const Oe = new XMLSerializer().serializeToString(
|
|
250
|
+
H.value.show = !1;
|
|
251
|
+
const Oe = new XMLSerializer().serializeToString(R.body);
|
|
250
252
|
e.insertContent(Oe);
|
|
251
|
-
} else
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
for (const z of t) {
|
|
253
|
+
} else a.includes("text/plain") && e.insertContent(o.getData("text/plain"));
|
|
254
|
+
const l = Array.from((o == null ? void 0 : o.files) || []), n = [];
|
|
255
|
+
for (const z of l) {
|
|
255
256
|
if (!z)
|
|
256
257
|
continue;
|
|
257
258
|
const q = Ge(z.name);
|
|
258
|
-
z.type.indexOf("image") > -1 || (re = (ne = (le = p.value) == null ? void 0 : le.checkOptions) == null ? void 0 : ne.allowedType) != null && re.includes(q.toLowerCase()) ?
|
|
259
|
+
z.type.indexOf("image") > -1 || (re = (ne = (le = p.value) == null ? void 0 : le.checkOptions) == null ? void 0 : ne.allowedType) != null && re.includes(q.toLowerCase()) ? n.push(z) : b.error("暂不支持的文件类型");
|
|
259
260
|
}
|
|
260
|
-
if (
|
|
261
|
-
|
|
261
|
+
if (n.length > 0) {
|
|
262
|
+
H.value = {
|
|
262
263
|
show: !0,
|
|
263
264
|
text: "图片上传中,请稍等"
|
|
264
265
|
};
|
|
265
266
|
try {
|
|
266
|
-
for (var Fa = G(
|
|
267
|
+
for (var Fa = G(n), Wa, Na, La; Wa = !(Na = yield Fa.next()).done; Wa = !1) {
|
|
267
268
|
const z = Na.value;
|
|
268
269
|
const q = yield ae(z);
|
|
269
270
|
if (q) {
|
|
270
|
-
const
|
|
271
|
-
e.insertContent(
|
|
271
|
+
const R = `<img src="${q}" alt="" />`;
|
|
272
|
+
e.insertContent(R);
|
|
272
273
|
}
|
|
273
274
|
}
|
|
274
275
|
} catch (Na) {
|
|
@@ -281,22 +282,22 @@ const Ha = /* @__PURE__ */ Ee({
|
|
|
281
282
|
throw La[0];
|
|
282
283
|
}
|
|
283
284
|
}
|
|
284
|
-
|
|
285
|
+
H.value.show = !1;
|
|
285
286
|
}
|
|
286
|
-
|
|
287
|
+
s("input", e.getContent());
|
|
287
288
|
}), oe = (o) => {
|
|
288
289
|
var a;
|
|
289
290
|
o.preventDefault();
|
|
290
291
|
const e = o.clipboardData || ((a = o == null ? void 0 : o.originalEvent) == null ? void 0 : a.clipboardData);
|
|
291
|
-
|
|
292
|
+
L(e);
|
|
292
293
|
}, te = (o) => {
|
|
293
294
|
var a;
|
|
294
295
|
o.preventDefault();
|
|
295
296
|
const e = o.dataTransfer || ((a = o == null ? void 0 : o.originalEvent) == null ? void 0 : a.dataTransfer);
|
|
296
|
-
|
|
297
|
+
L(e);
|
|
297
298
|
};
|
|
298
|
-
|
|
299
|
-
var a,
|
|
299
|
+
Ee(() => {
|
|
300
|
+
var a, l, n;
|
|
300
301
|
const o = {
|
|
301
302
|
// 设置语言
|
|
302
303
|
language: "zh_CN",
|
|
@@ -379,85 +380,85 @@ const Ha = /* @__PURE__ */ Ee({
|
|
|
379
380
|
convert_urls: !1,
|
|
380
381
|
paste_webkit_styles: "all",
|
|
381
382
|
paste_data_images: !1,
|
|
382
|
-
images_file_types: ((
|
|
383
|
+
images_file_types: ((n = (l = (a = p.value) == null ? void 0 : a.checkOptions) == null ? void 0 : l.allowedType) == null ? void 0 : n.join(",")) || "jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp",
|
|
383
384
|
// 粘贴前处理
|
|
384
|
-
paste_preprocess(
|
|
385
|
-
|
|
385
|
+
paste_preprocess(t, r) {
|
|
386
|
+
r == null || r.preventDefault();
|
|
386
387
|
},
|
|
387
|
-
setup(
|
|
388
|
+
setup(t) {
|
|
388
389
|
var d, y;
|
|
389
|
-
const
|
|
390
|
-
|
|
390
|
+
const r = () => {
|
|
391
|
+
$.value.dialogVisible = !0;
|
|
391
392
|
};
|
|
392
|
-
if (
|
|
393
|
+
if (t.ui.registry.addMenuItem("localImage", {
|
|
393
394
|
text: "图片",
|
|
394
395
|
icon: "image",
|
|
395
|
-
onAction: () =>
|
|
396
|
-
}),
|
|
396
|
+
onAction: () => r()
|
|
397
|
+
}), t.ui.registry.addButton("localImage", {
|
|
397
398
|
icon: "image",
|
|
398
399
|
tooltip: "图片",
|
|
399
|
-
onAction: () =>
|
|
400
|
+
onAction: () => r()
|
|
400
401
|
}), (d = v == null ? void 0 : v.value) != null && d.enable) {
|
|
401
402
|
const f = () => {
|
|
402
403
|
w.value.dialogVisible = !0;
|
|
403
404
|
};
|
|
404
|
-
|
|
405
|
+
t.ui.registry.addMenuItem("localAudio", {
|
|
405
406
|
text: "音频",
|
|
406
407
|
icon: "arrow-right",
|
|
407
408
|
onAction: () => f()
|
|
408
|
-
}),
|
|
409
|
+
}), t.ui.registry.addButton("localAudio", {
|
|
409
410
|
icon: "arrow-right",
|
|
410
411
|
tooltip: "音频",
|
|
411
412
|
onAction: () => f()
|
|
412
413
|
});
|
|
413
414
|
}
|
|
414
|
-
if ((y =
|
|
415
|
+
if ((y = u == null ? void 0 : u.value) != null && y.enable) {
|
|
415
416
|
const f = () => {
|
|
416
417
|
_.value.dialogVisible = !0;
|
|
417
418
|
};
|
|
418
|
-
|
|
419
|
+
t.ui.registry.addMenuItem("localVideo", {
|
|
419
420
|
text: "视频",
|
|
420
421
|
icon: "embed",
|
|
421
422
|
onAction: () => f()
|
|
422
|
-
}),
|
|
423
|
+
}), t.ui.registry.addButton("localVideo", {
|
|
423
424
|
icon: "embed",
|
|
424
425
|
tooltip: "视频",
|
|
425
426
|
onAction: () => f()
|
|
426
427
|
});
|
|
427
428
|
}
|
|
428
429
|
}
|
|
429
|
-
}, e =
|
|
430
|
+
}, e = W(
|
|
430
431
|
[
|
|
431
432
|
i.options,
|
|
432
|
-
|
|
433
|
+
N.options,
|
|
433
434
|
o
|
|
434
435
|
],
|
|
435
436
|
{
|
|
436
|
-
mergeFunction: (
|
|
437
|
-
|
|
437
|
+
mergeFunction: (t, r) => (...d) => {
|
|
438
|
+
t(...d), r(...d);
|
|
438
439
|
},
|
|
439
440
|
type: Object
|
|
440
441
|
}
|
|
441
442
|
);
|
|
442
|
-
pe.init(e).then(([
|
|
443
|
-
var
|
|
444
|
-
|
|
443
|
+
pe.init(e).then(([t]) => {
|
|
444
|
+
var r;
|
|
445
|
+
t && (t.customProps = D({}, i), t.on("input", () => {
|
|
445
446
|
if (I.value) {
|
|
446
447
|
I.value = !1;
|
|
447
448
|
return;
|
|
448
449
|
}
|
|
449
|
-
g.value = !0,
|
|
450
|
-
}),
|
|
451
|
-
|
|
452
|
-
}),
|
|
450
|
+
g.value = !0, s("input", t.getContent());
|
|
451
|
+
}), t.on("change", () => {
|
|
452
|
+
s("input", t.getContent());
|
|
453
|
+
}), t.on("paste", (d) => {
|
|
453
454
|
oe(d);
|
|
454
|
-
}),
|
|
455
|
+
}), t.on("drop", (d) => {
|
|
455
456
|
te(d);
|
|
456
|
-
}), (
|
|
457
|
+
}), (r = i.initComplete) == null || r.call(i, { editorIns: t }), m.value = t);
|
|
457
458
|
});
|
|
458
459
|
}), qe(() => {
|
|
459
|
-
var o, e, a,
|
|
460
|
-
(o =
|
|
460
|
+
var o, e, a, l;
|
|
461
|
+
(o = m.value) == null || o.off("input"), (e = m.value) == null || e.off("paste"), (a = m.value) == null || a.off("drop"), (l = m.value) == null || l.destroy();
|
|
461
462
|
});
|
|
462
463
|
const he = () => {
|
|
463
464
|
var e, a;
|
|
@@ -477,19 +478,20 @@ const Ha = /* @__PURE__ */ Ee({
|
|
|
477
478
|
var e, a;
|
|
478
479
|
const o = D({}, w.value.additionalData || {});
|
|
479
480
|
return ((a = (e = v.value) == null ? void 0 : e.headers) == null ? void 0 : a.call(e, B(D({}, o), { extParameters: i.extParameters }))) || {};
|
|
480
|
-
}, De = (o, e, a) => {
|
|
481
|
-
var
|
|
482
|
-
const
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
481
|
+
}, De = (o, e, a) => F(this, null, function* () {
|
|
482
|
+
var t, r;
|
|
483
|
+
const l = (r = (t = v == null ? void 0 : v.value) == null ? void 0 : t.handlerResponse) == null ? void 0 : r.call(t, o);
|
|
484
|
+
let n;
|
|
485
|
+
l instanceof Promise ? yield l : n = l, n != null && n.url ? a[a.length - 1].url = n.url : n != null && n.errorMessage && (b.error(n.errorMessage), a.splice(a.length - 1, 1)), w.value.formData.file = a;
|
|
486
|
+
}), _e = (o, e) => new Promise((a, l) => {
|
|
487
|
+
var t, r, d, y, f, C, h, U;
|
|
488
|
+
const n = o.name.split(".").filter(Boolean).pop() ? o.name.split(".").filter(Boolean).pop() : "";
|
|
489
|
+
if (!((r = (t = v.value) == null ? void 0 : t.allowedType) != null && r.includes(n.toLowerCase()))) {
|
|
490
|
+
b.error(`请上传格式为${(y = (d = v.value) == null ? void 0 : d.allowedType) == null ? void 0 : y.map((M) => M.toUpperCase()).join("、")}的音频`), l();
|
|
489
491
|
return;
|
|
490
492
|
}
|
|
491
493
|
if (o.size > (((f = v.value) == null ? void 0 : f.maxSize) || 0) * 1024 * 1024) {
|
|
492
|
-
b.error(`请上传${((C = v.value) == null ? void 0 : C.maxSize) || 0}M内的音频`),
|
|
494
|
+
b.error(`请上传${((C = v.value) == null ? void 0 : C.maxSize) || 0}M内的音频`), l();
|
|
493
495
|
return;
|
|
494
496
|
}
|
|
495
497
|
w.value.additionalData = { file: o }, (U = (h = v == null ? void 0 : v.value) == null ? void 0 : h.beforeUploadEnd) == null || U.call(h, o), a(!0);
|
|
@@ -500,49 +502,50 @@ const Ha = /* @__PURE__ */ Ee({
|
|
|
500
502
|
}, Ce = () => {
|
|
501
503
|
var e, a;
|
|
502
504
|
const o = D({}, _.value.additionalData || {});
|
|
503
|
-
return ((a = (e =
|
|
505
|
+
return ((a = (e = u.value) == null ? void 0 : e.data) == null ? void 0 : a.call(e, B(D({}, o), { extParameters: i.extParameters }))) || {};
|
|
504
506
|
}, Ue = () => {
|
|
505
507
|
var e, a;
|
|
506
508
|
const o = D({}, _.value.additionalData || {});
|
|
507
|
-
return ((a = (e =
|
|
508
|
-
}, Ie = (o, e, a) => {
|
|
509
|
-
var
|
|
510
|
-
const
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
509
|
+
return ((a = (e = u.value) == null ? void 0 : e.headers) == null ? void 0 : a.call(e, B(D({}, o), { extParameters: i.extParameters }))) || {};
|
|
510
|
+
}, Ie = (o, e, a) => F(this, null, function* () {
|
|
511
|
+
var t, r;
|
|
512
|
+
const l = (r = (t = u == null ? void 0 : u.value) == null ? void 0 : t.handlerResponse) == null ? void 0 : r.call(t, o);
|
|
513
|
+
let n;
|
|
514
|
+
l instanceof Promise ? yield l : n = l, n != null && n.url ? a[a.length - 1].url = n.url : n != null && n.errorMessage && (b.error(n.errorMessage), a.splice(a.length - 1, 1)), _.value.formData.file = a;
|
|
515
|
+
}), Pe = (o, e) => new Promise((a, l) => {
|
|
516
|
+
var t, r, d, y, f, C, h, U;
|
|
517
|
+
const n = o.name.split(".").filter(Boolean).pop() ? o.name.split(".").filter(Boolean).pop() : "";
|
|
518
|
+
if (!((r = (t = u == null ? void 0 : u.value) == null ? void 0 : t.allowedType) != null && r.includes(n.toLowerCase()))) {
|
|
519
|
+
b.error(`请上传格式为${(y = (d = u == null ? void 0 : u.value) == null ? void 0 : d.allowedType) == null ? void 0 : y.map((M) => M.toUpperCase()).join("、")}的视频`), l();
|
|
517
520
|
return;
|
|
518
521
|
}
|
|
519
|
-
if (o.size > (((f =
|
|
520
|
-
b.error(`请上传${((C =
|
|
522
|
+
if (o.size > (((f = u == null ? void 0 : u.value) == null ? void 0 : f.maxSize) || 0) * 1024 * 1024) {
|
|
523
|
+
b.error(`请上传${((C = u == null ? void 0 : u.value) == null ? void 0 : C.maxSize) || 0}M内的视频`), l();
|
|
521
524
|
return;
|
|
522
525
|
}
|
|
523
|
-
_.value.additionalData = { file: o }, (U = (h =
|
|
526
|
+
_.value.additionalData = { file: o }, (U = (h = u == null ? void 0 : u.value) == null ? void 0 : h.beforeUploadEnd) == null || U.call(h, o), a(!0);
|
|
524
527
|
}), Me = (o, e) => {
|
|
525
528
|
_.value.formData.file = e;
|
|
526
529
|
}, Se = (o, e, a) => {
|
|
527
530
|
b.error("上传发生错误,请重试!"), _.value.formData.file = a;
|
|
528
531
|
};
|
|
529
|
-
return de(() => [i.disabled,
|
|
532
|
+
return de(() => [i.disabled, m.value], () => {
|
|
530
533
|
var o, e;
|
|
531
|
-
(e = (o =
|
|
534
|
+
(e = (o = m.value) == null ? void 0 : o.mode) == null || e.set(i.disabled ? "readonly" : "design");
|
|
532
535
|
}, { immediate: !0 }), de(
|
|
533
|
-
() => [i.value,
|
|
536
|
+
() => [i.value, m.value],
|
|
534
537
|
() => {
|
|
535
|
-
var o, e, a,
|
|
538
|
+
var o, e, a, l;
|
|
536
539
|
if (g.value) {
|
|
537
540
|
g.value = !1;
|
|
538
541
|
return;
|
|
539
542
|
}
|
|
540
|
-
I.value = !0, (o =
|
|
543
|
+
I.value = !0, (o = m.value) == null || o.setContent(i.value ? i.value : ""), (a = m.value) == null || a.selection.select((e = m.value) == null ? void 0 : e.getBody(), !0), (l = m.value) == null || l.selection.collapse(!1);
|
|
541
544
|
},
|
|
542
545
|
{ immediate: !0 }
|
|
543
|
-
), { __sfc: !0, defaultImageUploadOptions: O, defaultVideoUploadOptions: T, defaultAudioUploadOptions: P, props: i, emits:
|
|
546
|
+
), { __sfc: !0, defaultImageUploadOptions: O, defaultVideoUploadOptions: T, defaultAudioUploadOptions: P, props: i, emits: s, insRef: V, editorRef: m, preventSettingContent: g, preventUpdatingModelValue: I, uploadLoadingConfig: H, mergeImageUploadOptions: p, mergeVideoUploadOptions: u, mergeAudioUploadOptions: v, uploadImage: $, uploadImageAdditionalData: j, uploadImageFormRef: J, onUploadImageClose: K, onUploadImageConfirm: fe, uploadAudio: w, uploadAudioFormRef: Q, onUploadAudioClose: Y, onUploadAudioConfirm: ve, uploadVideo: _, uploadVideoFormRef: Z, onUploadVideoClose: ee, onUploadVideoConfirm: ge, uploadPasteOrDropFile: ae, handleDataTransfer: L, onValuePaste: oe, onValueDrop: te, getUploadImageData: he, getUploadImageHeaders: xe, onUploadImageInnerBeforeUploadEnd: be, getUploadAudioData: we, getUploadAudioHeaders: ye, onUploadAudioSuccess: De, onUploadAudioBeforeUpload: _e, onUploadAudioRemove: ke, onUploadAudioError: Ae, getUploadVideoData: Ce, getUploadVideoHeaders: Ue, onUploadVideoSuccess: Ie, onUploadVideoBeforeUpload: Pe, onUploadVideoRemove: Me, onUploadVideoError: Se };
|
|
544
547
|
}
|
|
545
548
|
});
|
|
546
549
|
export {
|
|
547
|
-
|
|
550
|
+
Ra as default
|
|
548
551
|
};
|
package/es/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { RawEditorOptions } from 'tinymce';
|
|
2
2
|
import { AudioUploadOptions, ImageUploadOptions, VideoUploadOptions } from './types';
|
|
3
|
-
|
|
4
3
|
interface TinymceEditorGlobalOptions {
|
|
5
4
|
/** 富文本编辑器选项 */
|
|
6
5
|
options?: RawEditorOptions;
|
|
@@ -13,6 +12,10 @@ interface TinymceEditorGlobalOptions {
|
|
|
13
12
|
}
|
|
14
13
|
declare const globalProps: TinymceEditorGlobalOptions;
|
|
15
14
|
declare const TinymceEditor: import('vue/types/v3-component-public-instance').ComponentPublicInstanceConstructor<import('vue/types/v3-component-public-instance').Vue3Instance<{}, Readonly<import('vue').ExtractPropTypes<{
|
|
15
|
+
options: {
|
|
16
|
+
type: import('vue').PropType<Partial<RawEditorOptions>>;
|
|
17
|
+
default: () => {};
|
|
18
|
+
};
|
|
16
19
|
value: {
|
|
17
20
|
type: import('vue').PropType<string>;
|
|
18
21
|
default: string;
|
|
@@ -25,10 +28,6 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
25
28
|
type: import('vue').PropType<Record<string, any>>;
|
|
26
29
|
default: () => {};
|
|
27
30
|
};
|
|
28
|
-
options: {
|
|
29
|
-
type: import('vue').PropType<Partial<RawEditorOptions>>;
|
|
30
|
-
default: () => {};
|
|
31
|
-
};
|
|
32
31
|
imageUploadOptions: {
|
|
33
32
|
type: import('vue').PropType<ImageUploadOptions>;
|
|
34
33
|
};
|
|
@@ -44,6 +43,10 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
44
43
|
}) => void>;
|
|
45
44
|
};
|
|
46
45
|
}>>, Readonly<import('vue').ExtractPropTypes<{
|
|
46
|
+
options: {
|
|
47
|
+
type: import('vue').PropType<Partial<RawEditorOptions>>;
|
|
48
|
+
default: () => {};
|
|
49
|
+
};
|
|
47
50
|
value: {
|
|
48
51
|
type: import('vue').PropType<string>;
|
|
49
52
|
default: string;
|
|
@@ -56,10 +59,6 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
56
59
|
type: import('vue').PropType<Record<string, any>>;
|
|
57
60
|
default: () => {};
|
|
58
61
|
};
|
|
59
|
-
options: {
|
|
60
|
-
type: import('vue').PropType<Partial<RawEditorOptions>>;
|
|
61
|
-
default: () => {};
|
|
62
|
-
};
|
|
63
62
|
imageUploadOptions: {
|
|
64
63
|
type: import('vue').PropType<ImageUploadOptions>;
|
|
65
64
|
};
|
|
@@ -74,14 +73,16 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
74
73
|
editorIns: import('tinymce').Editor;
|
|
75
74
|
}) => void>;
|
|
76
75
|
};
|
|
77
|
-
}>>, {
|
|
78
|
-
|
|
79
|
-
}, {
|
|
76
|
+
}>>, {}, {
|
|
77
|
+
options: Partial<RawEditorOptions>;
|
|
80
78
|
value: string;
|
|
81
79
|
disabled: boolean;
|
|
82
80
|
extParameters: Record<string, any>;
|
|
83
|
-
options: Partial<RawEditorOptions>;
|
|
84
81
|
}, true, import('vue/types/v3-component-options').ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>> & Readonly<Readonly<import('vue').ExtractPropTypes<{
|
|
82
|
+
options: {
|
|
83
|
+
type: import('vue').PropType<Partial<RawEditorOptions>>;
|
|
84
|
+
default: () => {};
|
|
85
|
+
};
|
|
85
86
|
value: {
|
|
86
87
|
type: import('vue').PropType<string>;
|
|
87
88
|
default: string;
|
|
@@ -94,10 +95,6 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
94
95
|
type: import('vue').PropType<Record<string, any>>;
|
|
95
96
|
default: () => {};
|
|
96
97
|
};
|
|
97
|
-
options: {
|
|
98
|
-
type: import('vue').PropType<Partial<RawEditorOptions>>;
|
|
99
|
-
default: () => {};
|
|
100
|
-
};
|
|
101
98
|
imageUploadOptions: {
|
|
102
99
|
type: import('vue').PropType<ImageUploadOptions>;
|
|
103
100
|
};
|
|
@@ -113,6 +110,10 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
113
110
|
}) => void>;
|
|
114
111
|
};
|
|
115
112
|
}>>> & import('vue').ShallowUnwrapRef<{}> & import('vue/types/v3-component-options').ExtractComputedReturns<{}> & import('vue').ComponentCustomProperties & Readonly<import('vue').ExtractPropTypes<{
|
|
113
|
+
options: {
|
|
114
|
+
type: import('vue').PropType<Partial<RawEditorOptions>>;
|
|
115
|
+
default: () => {};
|
|
116
|
+
};
|
|
116
117
|
value: {
|
|
117
118
|
type: import('vue').PropType<string>;
|
|
118
119
|
default: string;
|
|
@@ -125,10 +126,6 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
125
126
|
type: import('vue').PropType<Record<string, any>>;
|
|
126
127
|
default: () => {};
|
|
127
128
|
};
|
|
128
|
-
options: {
|
|
129
|
-
type: import('vue').PropType<Partial<RawEditorOptions>>;
|
|
130
|
-
default: () => {};
|
|
131
|
-
};
|
|
132
129
|
imageUploadOptions: {
|
|
133
130
|
type: import('vue').PropType<ImageUploadOptions>;
|
|
134
131
|
};
|
|
@@ -144,6 +141,10 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
144
141
|
}) => void>;
|
|
145
142
|
};
|
|
146
143
|
}>>> & import('vue/types/v3-component-options').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
144
|
+
options: {
|
|
145
|
+
type: import('vue').PropType<Partial<RawEditorOptions>>;
|
|
146
|
+
default: () => {};
|
|
147
|
+
};
|
|
147
148
|
value: {
|
|
148
149
|
type: import('vue').PropType<string>;
|
|
149
150
|
default: string;
|
|
@@ -156,10 +157,6 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
156
157
|
type: import('vue').PropType<Record<string, any>>;
|
|
157
158
|
default: () => {};
|
|
158
159
|
};
|
|
159
|
-
options: {
|
|
160
|
-
type: import('vue').PropType<Partial<RawEditorOptions>>;
|
|
161
|
-
default: () => {};
|
|
162
|
-
};
|
|
163
160
|
imageUploadOptions: {
|
|
164
161
|
type: import('vue').PropType<ImageUploadOptions>;
|
|
165
162
|
};
|
|
@@ -174,15 +171,17 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
174
171
|
editorIns: import('tinymce').Editor;
|
|
175
172
|
}) => void>;
|
|
176
173
|
};
|
|
177
|
-
}>>, {}, {}, {}, {}, import('vue/types/v3-component-options').ComponentOptionsMixin, import('vue/types/v3-component-options').ComponentOptionsMixin, {
|
|
178
|
-
|
|
179
|
-
}, string, {
|
|
174
|
+
}>>, {}, {}, {}, {}, import('vue/types/v3-component-options').ComponentOptionsMixin, import('vue/types/v3-component-options').ComponentOptionsMixin, {}, string, {
|
|
175
|
+
options: Partial<RawEditorOptions>;
|
|
180
176
|
value: string;
|
|
181
177
|
disabled: boolean;
|
|
182
178
|
extParameters: Record<string, any>;
|
|
183
|
-
options: Partial<RawEditorOptions>;
|
|
184
179
|
}> & {
|
|
185
180
|
props: {
|
|
181
|
+
options: {
|
|
182
|
+
type: import('vue').PropType<Partial<RawEditorOptions>>;
|
|
183
|
+
default: () => {};
|
|
184
|
+
};
|
|
186
185
|
value: {
|
|
187
186
|
type: import('vue').PropType<string>;
|
|
188
187
|
default: string;
|
|
@@ -195,10 +194,6 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
195
194
|
type: import('vue').PropType<Record<string, any>>;
|
|
196
195
|
default: () => {};
|
|
197
196
|
};
|
|
198
|
-
options: {
|
|
199
|
-
type: import('vue').PropType<Partial<RawEditorOptions>>;
|
|
200
|
-
default: () => {};
|
|
201
|
-
};
|
|
202
197
|
imageUploadOptions: {
|
|
203
198
|
type: import('vue').PropType<ImageUploadOptions>;
|
|
204
199
|
};
|
package/es/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './
|
|
1
|
+
import './tinymce-editor-vue2.css';
|
|
2
2
|
import e from "./editor.vue.js";
|
|
3
3
|
import { Button as t, Slider as u, Dialog as i, Upload as n, Tag as r, Form as m, FormItem as c, ButtonGroup as l, InputNumber as d, Loading as g } from "element-ui";
|
|
4
4
|
const b = {}, y = Object.assign(e, {
|
package/es/types.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ImageUploadCheckOptions, ImageUploadCompressorOptions, ImageUploadCropOptions } from '@keyblade/one-travel';
|
|
2
|
-
|
|
3
2
|
/** 图片选项 */
|
|
4
3
|
export interface ImageUploadOptions {
|
|
5
4
|
/** 上传的文件字段名 - 默认: file */
|
|
@@ -59,6 +58,8 @@ export interface ImageUploadOptions {
|
|
|
59
58
|
}
|
|
60
59
|
/** 视频选项 */
|
|
61
60
|
export interface VideoUploadOptions {
|
|
61
|
+
/** 上传的文件字段名 - 默认: file */
|
|
62
|
+
name?: string;
|
|
62
63
|
/** 是否启用 */
|
|
63
64
|
enable?: boolean;
|
|
64
65
|
/** 最大尺寸(M) */
|
|
@@ -85,10 +86,15 @@ export interface VideoUploadOptions {
|
|
|
85
86
|
handlerResponse?: (response: any) => {
|
|
86
87
|
url?: string;
|
|
87
88
|
errorMessage?: string;
|
|
88
|
-
}
|
|
89
|
+
} | Promise<{
|
|
90
|
+
url?: string;
|
|
91
|
+
errorMessage?: string;
|
|
92
|
+
}>;
|
|
89
93
|
}
|
|
90
94
|
/** 音频选项 */
|
|
91
95
|
export interface AudioUploadOptions {
|
|
96
|
+
/** 上传的文件字段名 - 默认: file */
|
|
97
|
+
name?: string;
|
|
92
98
|
/** 是否启用 */
|
|
93
99
|
enable?: boolean;
|
|
94
100
|
/** 最大尺寸(M) */
|
|
@@ -115,5 +121,8 @@ export interface AudioUploadOptions {
|
|
|
115
121
|
handlerResponse?: (response: any) => {
|
|
116
122
|
url?: string;
|
|
117
123
|
errorMessage?: string;
|
|
118
|
-
}
|
|
124
|
+
} | Promise<{
|
|
125
|
+
url?: string;
|
|
126
|
+
errorMessage?: string;
|
|
127
|
+
}>;
|
|
119
128
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@keyblade/tinymce-editor-vue2",
|
|
3
3
|
"description": "KeyBlade Tinymce Editor Vue2",
|
|
4
4
|
"author": "yangshuai <704807396@qq.com>",
|
|
5
|
-
"version": "1.2.
|
|
5
|
+
"version": "1.2.2",
|
|
6
6
|
"private": false,
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "es/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"vue": "^2.7.0",
|
|
30
|
-
"@keyblade/pro-components-vue2": "^1.13.
|
|
30
|
+
"@keyblade/pro-components-vue2": "^1.13.2"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "vite build",
|
package/es/style.less.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
File without changes
|