@keyblade/tinymce-editor-vue2 0.0.12-alpha.48 → 0.0.12-alpha.49
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/editor.vue2.js +104 -102
- package/package.json +1 -1
package/es/editor.vue2.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as De, ref as y, computed as
|
|
2
|
-
import { oneTravelImgPondBeforeAddFile as K, oneTravelImageCompressor as Q, oneTravelImageCheckAndTransform as
|
|
1
|
+
import { defineComponent as De, ref as y, computed as C, watch as z, onMounted as Ae, onUnmounted as Ce } from "vue";
|
|
2
|
+
import { oneTravelImgPondBeforeAddFile as K, oneTravelImageCompressor as Q, oneTravelImageCheckAndTransform as Te } from "@keyblade/one-travel";
|
|
3
3
|
import { blobToFile as Y, generateUUID as Pe, getImagePixel as Z, getFileExtension as ee } from "./util.js";
|
|
4
4
|
import "./style.less.js";
|
|
5
5
|
import Me from "imgpond";
|
|
6
|
-
import { conclude as
|
|
6
|
+
import { conclude as T } from "vue-global-config";
|
|
7
7
|
import ae from "tinymce";
|
|
8
8
|
import Se from "./langs/zh_CN.js";
|
|
9
9
|
import "tinymce/skins/ui/oxide/skin";
|
|
@@ -50,7 +50,7 @@ const va = /* @__PURE__ */ De({
|
|
|
50
50
|
initComplete: null
|
|
51
51
|
},
|
|
52
52
|
emits: ["input"],
|
|
53
|
-
setup(te, { emit:
|
|
53
|
+
setup(te, { emit: M }) {
|
|
54
54
|
const m = te;
|
|
55
55
|
ae.addI18n("zh_CN", Se);
|
|
56
56
|
const B = {
|
|
@@ -72,15 +72,15 @@ const va = /* @__PURE__ */ De({
|
|
|
72
72
|
maxSize: 200,
|
|
73
73
|
allowedType: ["mp3", "m4a", "wav", "aac"],
|
|
74
74
|
accept: "audio/mp3,audio/wav,audio/aac,audio/x-m4a"
|
|
75
|
-
}, E = y(), h = y(),
|
|
75
|
+
}, E = y(), h = y(), S = y(!1), U = y(!1), v = y({
|
|
76
76
|
show: !1,
|
|
77
77
|
text: "图片上传中,请稍等"
|
|
78
|
-
}), r =
|
|
78
|
+
}), r = C(() => T([m.imageUploadOptions, P.imageUploadOptions, B]) || {}), c = C(() => T([m.videoUploadOptions, P.videoUploadOptions, j]) || {}), w = C(() => T([m.audioUploadOptions, P.audioUploadOptions, q]) || {}), H = C(() => T([m.imgPondOptions, P.imgPondOptions]) || {}), oe = C(() => {
|
|
79
79
|
var e, a;
|
|
80
|
-
return ((a = (e = r == null ? void 0 : r.value) == null ? void 0 : e.allowedType) == null ? void 0 : a.map((
|
|
81
|
-
}),
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
return ((a = (e = r == null ? void 0 : r.value) == null ? void 0 : e.allowedType) == null ? void 0 : a.map((o) => `.${o}`).join(",")) || "";
|
|
81
|
+
}), I = y();
|
|
82
|
+
z(() => I.value, () => {
|
|
83
|
+
I.value && K(I.value, {
|
|
84
84
|
onStart: () => {
|
|
85
85
|
v.value = {
|
|
86
86
|
show: !0,
|
|
@@ -95,9 +95,9 @@ const va = /* @__PURE__ */ De({
|
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
97
|
}, { immediate: !0 });
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
const k = y();
|
|
99
|
+
z(() => k.value, () => {
|
|
100
|
+
k.value && K(k.value, {
|
|
101
101
|
onStart: () => {
|
|
102
102
|
v.value = {
|
|
103
103
|
show: !0,
|
|
@@ -124,10 +124,10 @@ const va = /* @__PURE__ */ De({
|
|
|
124
124
|
}, ie = () => {
|
|
125
125
|
var e;
|
|
126
126
|
(e = $.value) == null || e.validate((a) => {
|
|
127
|
-
a && (A.value.formData.images.forEach((
|
|
127
|
+
a && (A.value.formData.images.forEach((o) => {
|
|
128
128
|
var l;
|
|
129
|
-
let
|
|
130
|
-
H.value.srcAt && (
|
|
129
|
+
let t = o;
|
|
130
|
+
H.value.srcAt && (t = (o == null ? void 0 : o[H.value.srcAt]) || ""), (l = h.value) == null || l.insertContent(`<img src=${t} alt="" />`);
|
|
131
131
|
}), R());
|
|
132
132
|
});
|
|
133
133
|
}, x = y({
|
|
@@ -151,8 +151,8 @@ const va = /* @__PURE__ */ De({
|
|
|
151
151
|
}, le = () => {
|
|
152
152
|
var e;
|
|
153
153
|
(e = F.value) == null || e.validate((a) => {
|
|
154
|
-
var
|
|
155
|
-
a && ((
|
|
154
|
+
var o, t;
|
|
155
|
+
a && ((t = h.value) == null || t.insertContent(`<audio controls controlslist="nodownload noplaybackrate" data-name="${x.value.formData.name}" data-poster="${x.value.formData.cover[0]}" src="${(o = x.value.formData.file[0]) == null ? void 0 : o.url}"></audio>`), N());
|
|
156
156
|
});
|
|
157
157
|
}, _ = y({
|
|
158
158
|
dialogVisible: !1,
|
|
@@ -169,35 +169,35 @@ const va = /* @__PURE__ */ De({
|
|
|
169
169
|
}, ne = () => {
|
|
170
170
|
var e;
|
|
171
171
|
(e = O.value) == null || e.validate((a) => {
|
|
172
|
-
var
|
|
173
|
-
a && ((
|
|
172
|
+
var o, t;
|
|
173
|
+
a && ((t = h.value) == null || t.insertContent(`<video width="auto" height="auto" controls src="${(o = _.value.formData.file[0]) == null ? void 0 : o.url}"></video>`), L());
|
|
174
174
|
});
|
|
175
175
|
}, re = () => {
|
|
176
176
|
document.querySelectorAll(".swal2-container .swal2-title").forEach((e) => {
|
|
177
177
|
e && (e.innerHTML = `单次最多可选择${r.value.maxCount}张图片`);
|
|
178
178
|
});
|
|
179
|
-
}, se = (e, a) => new Promise(async (
|
|
179
|
+
}, se = (e, a) => new Promise(async (o, t) => {
|
|
180
180
|
var d, n;
|
|
181
181
|
const l = await Q(e);
|
|
182
182
|
if (!l.success) {
|
|
183
|
-
|
|
183
|
+
t(), setTimeout(() => {
|
|
184
184
|
a.onError(l.errorMessage);
|
|
185
185
|
});
|
|
186
186
|
return;
|
|
187
187
|
}
|
|
188
188
|
const i = await ((n = (d = r.value).handleRequest) == null ? void 0 : n.call(d, Y(l.file, e.name), e.name, { extParameters: m.extParameters }));
|
|
189
189
|
if (!i || !(i != null && i.success)) {
|
|
190
|
-
|
|
190
|
+
t(), setTimeout(() => {
|
|
191
191
|
a.onError(i == null ? void 0 : i.errorMessage);
|
|
192
192
|
});
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
195
|
-
|
|
195
|
+
o(i.url);
|
|
196
196
|
});
|
|
197
197
|
async function ue(e, a) {
|
|
198
|
-
const
|
|
199
|
-
for (let i =
|
|
200
|
-
const d =
|
|
198
|
+
const t = a.node.getElementsByTagName("img"), l = [];
|
|
199
|
+
for (let i = t.length - 1; i >= 0; i--) {
|
|
200
|
+
const d = t[i], n = "img-" + Pe();
|
|
201
201
|
d.classList.add(n), l.push(n);
|
|
202
202
|
}
|
|
203
203
|
setTimeout(async () => {
|
|
@@ -236,12 +236,12 @@ const va = /* @__PURE__ */ De({
|
|
|
236
236
|
show: !0,
|
|
237
237
|
text: "图片上传中,请稍等"
|
|
238
238
|
};
|
|
239
|
-
let
|
|
239
|
+
let o = a.name ? a.name : "";
|
|
240
240
|
if (!(a != null && a.name) && !(a != null && a.lastModified) && a.type === "image/png") {
|
|
241
241
|
v.value.show = !1, f.error("不允许粘贴");
|
|
242
242
|
return;
|
|
243
243
|
}
|
|
244
|
-
const
|
|
244
|
+
const t = await Te(a, o, {
|
|
245
245
|
imageMaxSize: r.value.maxSize,
|
|
246
246
|
imageAllowedType: r.value.allowedType,
|
|
247
247
|
// imageAllowedMineType: mergeImageUploadOptions.value.allowedMineType,
|
|
@@ -250,21 +250,21 @@ const va = /* @__PURE__ */ De({
|
|
|
250
250
|
imageMaxWidth: r.value.maxWidth,
|
|
251
251
|
imageMaxHeight: r.value.maxHeight
|
|
252
252
|
});
|
|
253
|
-
if (!
|
|
254
|
-
v.value.show = !1, f.error((
|
|
253
|
+
if (!t.success) {
|
|
254
|
+
v.value.show = !1, f.error((t == null ? void 0 : t.errorMessage) || "");
|
|
255
255
|
return;
|
|
256
256
|
}
|
|
257
|
-
if (
|
|
258
|
-
a =
|
|
259
|
-
const s =
|
|
260
|
-
s.pop(),
|
|
257
|
+
if (t.hasTransform) {
|
|
258
|
+
a = t.file;
|
|
259
|
+
const s = o == null ? void 0 : o.split(".");
|
|
260
|
+
s.pop(), o = `${s.join(",")}.jpg`;
|
|
261
261
|
}
|
|
262
262
|
const l = await Q(a);
|
|
263
263
|
if (!l.success) {
|
|
264
264
|
v.value.show = !1, f.error((l == null ? void 0 : l.errorMessage) || "压缩失败");
|
|
265
265
|
return;
|
|
266
266
|
}
|
|
267
|
-
const i = await ((u = (n = r.value).handleRequest) == null ? void 0 : u.call(n, Y(l.file,
|
|
267
|
+
const i = await ((u = (n = r.value).handleRequest) == null ? void 0 : u.call(n, Y(l.file, o), o, { extParameters: m.extParameters }));
|
|
268
268
|
if (!i || !i.success) {
|
|
269
269
|
v.value.show = !1, f.error((i == null ? void 0 : i.errorMessage) || "");
|
|
270
270
|
return;
|
|
@@ -273,8 +273,8 @@ const va = /* @__PURE__ */ De({
|
|
|
273
273
|
}
|
|
274
274
|
const V = async (e) => {
|
|
275
275
|
var l, i, d;
|
|
276
|
-
const a = h.value,
|
|
277
|
-
if (
|
|
276
|
+
const a = h.value, o = e.types;
|
|
277
|
+
if (o.includes("text/html")) {
|
|
278
278
|
const n = e.getData("text/html"), s = new DOMParser().parseFromString(n, "text/html"), p = Array.from(s.body.querySelectorAll("img")), b = Array.from(s.body.querySelectorAll("audio")), W = Array.from(s.body.querySelectorAll("video"));
|
|
279
279
|
p.length > 0 && (v.value = {
|
|
280
280
|
show: !0,
|
|
@@ -297,9 +297,9 @@ const va = /* @__PURE__ */ De({
|
|
|
297
297
|
const _e = new XMLSerializer().serializeToString(s.body);
|
|
298
298
|
a.insertContent(_e);
|
|
299
299
|
} else
|
|
300
|
-
|
|
301
|
-
const
|
|
302
|
-
for await (const n of
|
|
300
|
+
o.includes("text/plain") && a.insertContent(e.getData("text/plain"));
|
|
301
|
+
const t = Array.from(e.items);
|
|
302
|
+
for await (const n of t) {
|
|
303
303
|
const u = n.getAsFile();
|
|
304
304
|
if (!u)
|
|
305
305
|
continue;
|
|
@@ -312,20 +312,20 @@ const va = /* @__PURE__ */ De({
|
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
|
-
|
|
315
|
+
M("input", a.getContent());
|
|
316
316
|
}, X = (e) => {
|
|
317
|
-
var
|
|
317
|
+
var o;
|
|
318
318
|
e.preventDefault();
|
|
319
|
-
const a = e.clipboardData || ((
|
|
319
|
+
const a = e.clipboardData || ((o = e == null ? void 0 : e.originalEvent) == null ? void 0 : o.clipboardData);
|
|
320
320
|
V(a);
|
|
321
321
|
}, J = (e) => {
|
|
322
|
-
var
|
|
322
|
+
var o;
|
|
323
323
|
e.preventDefault();
|
|
324
|
-
const a = e.dataTransfer || ((
|
|
324
|
+
const a = e.dataTransfer || ((o = e == null ? void 0 : e.originalEvent) == null ? void 0 : o.dataTransfer);
|
|
325
325
|
V(a);
|
|
326
326
|
};
|
|
327
327
|
Ae(() => {
|
|
328
|
-
var
|
|
328
|
+
var o;
|
|
329
329
|
const e = {
|
|
330
330
|
// 设置语言
|
|
331
331
|
language: "zh_CN",
|
|
@@ -408,9 +408,9 @@ const va = /* @__PURE__ */ De({
|
|
|
408
408
|
convert_urls: !1,
|
|
409
409
|
paste_webkit_styles: "all",
|
|
410
410
|
paste_data_images: !1,
|
|
411
|
-
images_file_types: ((
|
|
411
|
+
images_file_types: ((o = r.value.allowedType) == null ? void 0 : o.join(",")) || "jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp",
|
|
412
412
|
// 粘贴前处理
|
|
413
|
-
paste_preprocess(
|
|
413
|
+
paste_preprocess(t, l) {
|
|
414
414
|
l == null || l.preventDefault();
|
|
415
415
|
},
|
|
416
416
|
// // 粘贴后处理(处理异步操作)
|
|
@@ -488,7 +488,7 @@ const va = /* @__PURE__ */ De({
|
|
|
488
488
|
// resolve(uploadRes.url!)
|
|
489
489
|
// })
|
|
490
490
|
// },
|
|
491
|
-
setup(
|
|
491
|
+
setup(t) {
|
|
492
492
|
var i, d;
|
|
493
493
|
const l = () => {
|
|
494
494
|
A.value.dialogVisible = !0, setTimeout(() => {
|
|
@@ -497,11 +497,11 @@ const va = /* @__PURE__ */ De({
|
|
|
497
497
|
n && (n.innerHTML = ((s = r.value) == null ? void 0 : s.tipText) || "上传");
|
|
498
498
|
});
|
|
499
499
|
};
|
|
500
|
-
if (
|
|
500
|
+
if (t.ui.registry.addMenuItem("localImage", {
|
|
501
501
|
text: "图片",
|
|
502
502
|
icon: "image",
|
|
503
503
|
onAction: () => l()
|
|
504
|
-
}),
|
|
504
|
+
}), t.ui.registry.addButton("localImage", {
|
|
505
505
|
icon: "image",
|
|
506
506
|
tooltip: "图片",
|
|
507
507
|
onAction: () => l()
|
|
@@ -513,11 +513,11 @@ const va = /* @__PURE__ */ De({
|
|
|
513
513
|
u && (u.innerHTML = ((p = r.value) == null ? void 0 : p.tipText) || "上传");
|
|
514
514
|
});
|
|
515
515
|
};
|
|
516
|
-
|
|
516
|
+
t.ui.registry.addMenuItem("localAudio", {
|
|
517
517
|
text: "音频",
|
|
518
518
|
icon: "arrow-right",
|
|
519
519
|
onAction: () => n()
|
|
520
|
-
}),
|
|
520
|
+
}), t.ui.registry.addButton("localAudio", {
|
|
521
521
|
icon: "arrow-right",
|
|
522
522
|
tooltip: "音频",
|
|
523
523
|
onAction: () => n()
|
|
@@ -527,120 +527,122 @@ const va = /* @__PURE__ */ De({
|
|
|
527
527
|
const n = () => {
|
|
528
528
|
_.value.dialogVisible = !0;
|
|
529
529
|
};
|
|
530
|
-
|
|
530
|
+
t.ui.registry.addMenuItem("localVideo", {
|
|
531
531
|
text: "视频",
|
|
532
532
|
icon: "embed",
|
|
533
533
|
onAction: () => n()
|
|
534
|
-
}),
|
|
534
|
+
}), t.ui.registry.addButton("localVideo", {
|
|
535
535
|
icon: "embed",
|
|
536
536
|
tooltip: "视频",
|
|
537
537
|
onAction: () => n()
|
|
538
538
|
});
|
|
539
539
|
}
|
|
540
540
|
}
|
|
541
|
-
}, a =
|
|
541
|
+
}, a = T(
|
|
542
542
|
[
|
|
543
543
|
m.options,
|
|
544
544
|
P.options,
|
|
545
545
|
e
|
|
546
546
|
],
|
|
547
547
|
{
|
|
548
|
-
mergeFunction: (
|
|
549
|
-
|
|
548
|
+
mergeFunction: (t, l) => (...i) => {
|
|
549
|
+
t(...i), l(...i);
|
|
550
550
|
},
|
|
551
551
|
type: Object
|
|
552
552
|
}
|
|
553
553
|
);
|
|
554
|
-
ae.init(a).then(([
|
|
554
|
+
ae.init(a).then(([t]) => {
|
|
555
555
|
var l;
|
|
556
|
-
|
|
557
|
-
if (
|
|
558
|
-
|
|
556
|
+
t && (t.customProps = { ...m }, t.on("input", () => {
|
|
557
|
+
if (U.value) {
|
|
558
|
+
U.value = !1;
|
|
559
559
|
return;
|
|
560
560
|
}
|
|
561
|
-
|
|
562
|
-
}),
|
|
561
|
+
S.value = !0, M("input", t.getContent());
|
|
562
|
+
}), t.on("change", () => {
|
|
563
|
+
M("input", t.getContent());
|
|
564
|
+
}), t.on("paste", (i) => {
|
|
563
565
|
X(i);
|
|
564
|
-
}),
|
|
566
|
+
}), t.on("drop", (i) => {
|
|
565
567
|
J(i);
|
|
566
|
-
}), (l = m.initComplete) == null || l.call(m, { editorIns:
|
|
568
|
+
}), (l = m.initComplete) == null || l.call(m, { editorIns: t }), h.value = t);
|
|
567
569
|
});
|
|
568
|
-
}),
|
|
569
|
-
var e, a,
|
|
570
|
-
(e = h.value) == null || e.off("input"), (a = h.value) == null || a.off("paste"), (
|
|
570
|
+
}), Ce(() => {
|
|
571
|
+
var e, a, o, t;
|
|
572
|
+
(e = h.value) == null || e.off("input"), (a = h.value) == null || a.off("paste"), (o = h.value) == null || o.off("drop"), (t = h.value) == null || t.destroy();
|
|
571
573
|
});
|
|
572
574
|
const me = () => {
|
|
573
|
-
var a,
|
|
575
|
+
var a, o;
|
|
574
576
|
const e = { ...x.value.additionalData || {} };
|
|
575
|
-
return ((
|
|
577
|
+
return ((o = (a = w.value) == null ? void 0 : a.data) == null ? void 0 : o.call(a, { ...e, extParameters: m.extParameters })) || {};
|
|
576
578
|
}, de = () => {
|
|
577
|
-
var a,
|
|
579
|
+
var a, o;
|
|
578
580
|
const e = { ...x.value.additionalData || {} };
|
|
579
|
-
return ((
|
|
580
|
-
}, ce = (e, a,
|
|
581
|
+
return ((o = (a = w.value) == null ? void 0 : a.headers) == null ? void 0 : o.call(a, { ...e, extParameters: m.extParameters })) || {};
|
|
582
|
+
}, ce = (e, a, o) => {
|
|
581
583
|
var l, i;
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
}, pe = (e, a) => new Promise((
|
|
584
|
+
const t = (i = (l = w == null ? void 0 : w.value) == null ? void 0 : l.handlerResponse) == null ? void 0 : i.call(l, e);
|
|
585
|
+
t != null && t.url ? o[o.length - 1].url = t.url : t != null && t.errorMessage && (f.error(t.errorMessage), o.splice(o.length - 1, 1)), x.value.formData.file = o;
|
|
586
|
+
}, pe = (e, a) => new Promise((o, t) => {
|
|
585
587
|
var i, d, n, u, s, p;
|
|
586
588
|
const l = e.name.split(".").filter(Boolean).pop() ? e.name.split(".").filter(Boolean).pop() : "";
|
|
587
589
|
if (!((d = (i = w.value) == null ? void 0 : i.allowedType) != null && d.includes(l.toLowerCase()))) {
|
|
588
|
-
f.error(`请上传格式为${(u = (n = w.value) == null ? void 0 : n.allowedType) == null ? void 0 : u.map((b) => b.toUpperCase()).join("、")}的音频`),
|
|
590
|
+
f.error(`请上传格式为${(u = (n = w.value) == null ? void 0 : n.allowedType) == null ? void 0 : u.map((b) => b.toUpperCase()).join("、")}的音频`), t();
|
|
589
591
|
return;
|
|
590
592
|
}
|
|
591
593
|
if (e.size > (((s = w.value) == null ? void 0 : s.maxSize) || 0) * 1024 * 1024) {
|
|
592
|
-
f.error(`请上传${((p = w.value) == null ? void 0 : p.maxSize) || 0}M内的音频`),
|
|
594
|
+
f.error(`请上传${((p = w.value) == null ? void 0 : p.maxSize) || 0}M内的音频`), t();
|
|
593
595
|
return;
|
|
594
596
|
}
|
|
595
|
-
x.value.additionalData = { file: e },
|
|
597
|
+
x.value.additionalData = { file: e }, o(!0);
|
|
596
598
|
}), fe = (e, a) => {
|
|
597
599
|
x.value.formData.file = a;
|
|
598
|
-
}, ve = (e, a,
|
|
599
|
-
f.error("上传发生错误,请重试!"), x.value.formData.file =
|
|
600
|
+
}, ve = (e, a, o) => {
|
|
601
|
+
f.error("上传发生错误,请重试!"), x.value.formData.file = o;
|
|
600
602
|
}, ge = () => {
|
|
601
|
-
var a,
|
|
603
|
+
var a, o;
|
|
602
604
|
const e = { ..._.value.additionalData || {} };
|
|
603
|
-
return ((
|
|
605
|
+
return ((o = (a = c.value) == null ? void 0 : a.data) == null ? void 0 : o.call(a, { ...e, extParameters: m.extParameters })) || {};
|
|
604
606
|
}, he = () => {
|
|
605
|
-
var a,
|
|
607
|
+
var a, o;
|
|
606
608
|
const e = { ..._.value.additionalData || {} };
|
|
607
|
-
return ((
|
|
608
|
-
}, xe = (e, a,
|
|
609
|
+
return ((o = (a = c.value) == null ? void 0 : a.headers) == null ? void 0 : o.call(a, { ...e, extParameters: m.extParameters })) || {};
|
|
610
|
+
}, xe = (e, a, o) => {
|
|
609
611
|
var l, i;
|
|
610
|
-
const
|
|
611
|
-
|
|
612
|
-
}, we = (e, a) => new Promise((
|
|
612
|
+
const t = (i = (l = c == null ? void 0 : c.value) == null ? void 0 : l.handlerResponse) == null ? void 0 : i.call(l, e);
|
|
613
|
+
t != null && t.url ? o[o.length - 1].url = t.url : t != null && t.errorMessage && (f.error(t.errorMessage), o.splice(o.length - 1, 1)), _.value.formData.file = o;
|
|
614
|
+
}, we = (e, a) => new Promise((o, t) => {
|
|
613
615
|
var i, d, n, u, s, p;
|
|
614
616
|
const l = e.name.split(".").filter(Boolean).pop() ? e.name.split(".").filter(Boolean).pop() : "";
|
|
615
617
|
if (!((d = (i = c == null ? void 0 : c.value) == null ? void 0 : i.allowedType) != null && d.includes(l.toLowerCase()))) {
|
|
616
|
-
f.error(`请上传格式为${(u = (n = c == null ? void 0 : c.value) == null ? void 0 : n.allowedType) == null ? void 0 : u.map((b) => b.toUpperCase()).join("、")}的视频`),
|
|
618
|
+
f.error(`请上传格式为${(u = (n = c == null ? void 0 : c.value) == null ? void 0 : n.allowedType) == null ? void 0 : u.map((b) => b.toUpperCase()).join("、")}的视频`), t();
|
|
617
619
|
return;
|
|
618
620
|
}
|
|
619
621
|
if (e.size > (((s = c == null ? void 0 : c.value) == null ? void 0 : s.maxSize) || 0) * 1024 * 1024) {
|
|
620
|
-
f.error(`请上传${((p = c == null ? void 0 : c.value) == null ? void 0 : p.maxSize) || 0}M内的视频`),
|
|
622
|
+
f.error(`请上传${((p = c == null ? void 0 : c.value) == null ? void 0 : p.maxSize) || 0}M内的视频`), t();
|
|
621
623
|
return;
|
|
622
624
|
}
|
|
623
|
-
_.value.additionalData = { file: e },
|
|
625
|
+
_.value.additionalData = { file: e }, o(!0);
|
|
624
626
|
}), be = (e, a) => {
|
|
625
627
|
_.value.formData.file = a;
|
|
626
|
-
}, ye = (e, a,
|
|
627
|
-
f.error("上传发生错误,请重试!"), _.value.formData.file =
|
|
628
|
+
}, ye = (e, a, o) => {
|
|
629
|
+
f.error("上传发生错误,请重试!"), _.value.formData.file = o;
|
|
628
630
|
};
|
|
629
|
-
return
|
|
631
|
+
return z(() => [m.disabled, h.value], () => {
|
|
630
632
|
var e, a;
|
|
631
633
|
(a = (e = h.value) == null ? void 0 : e.mode) == null || a.set(m.disabled ? "readonly" : "design");
|
|
632
|
-
}, { immediate: !0 }),
|
|
634
|
+
}, { immediate: !0 }), z(
|
|
633
635
|
() => [m.value, h.value],
|
|
634
636
|
() => {
|
|
635
637
|
var e;
|
|
636
|
-
if (
|
|
637
|
-
|
|
638
|
+
if (S.value) {
|
|
639
|
+
S.value = !1;
|
|
638
640
|
return;
|
|
639
641
|
}
|
|
640
|
-
|
|
642
|
+
U.value = !0, (e = h.value) == null || e.setContent(m.value ? m.value : "");
|
|
641
643
|
},
|
|
642
644
|
{ immediate: !0 }
|
|
643
|
-
), { __sfc: !0, defaultImageUploadOptions: B, defaultVideoUploadOptions: j, defaultAudioUploadOptions: q, props: m, emits:
|
|
645
|
+
), { __sfc: !0, defaultImageUploadOptions: B, defaultVideoUploadOptions: j, defaultAudioUploadOptions: q, props: m, emits: M, insRef: E, editorRef: h, preventSettingContent: S, preventUpdatingModelValue: U, uploadLoadingConfig: v, mergeImageUploadOptions: r, mergeVideoUploadOptions: c, mergeAudioUploadOptions: w, mergeImgPondOptions: H, imgPondAccept: oe, uploadImageImgPondRef: I, audioImageImgPondRef: k, uploadImage: A, uploadImageFormRef: $, onUploadImageClose: R, onUploadImageConfirm: ie, uploadAudio: x, uploadAudioFormRef: F, onUploadAudioClose: N, onUploadAudioConfirm: le, uploadVideo: _, uploadVideoFormRef: O, onUploadVideoClose: L, onUploadVideoConfirm: ne, onImageUploadUploadExceed: re, onImageUploadUpload: se, processPastedImage: ue, uploadPasteOrDropFile: G, handleDataTransfer: V, onValuePaste: X, onValueDrop: J, getUploadAudioData: me, getUploadAudioHeaders: de, onUploadAudioSuccess: ce, onUploadAudioBeforeUpload: pe, onUploadAudioRemove: fe, onUploadAudioError: ve, getUploadVideoData: ge, getUploadVideoHeaders: he, onUploadVideoSuccess: xe, onUploadVideoBeforeUpload: we, onUploadVideoRemove: be, onUploadVideoError: ye, ImgPond: Me };
|
|
644
646
|
}
|
|
645
647
|
});
|
|
646
648
|
export {
|
package/package.json
CHANGED