@keyblade/tinymce-editor-vue2 0.0.12-alpha.21 → 0.0.12-alpha.22
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 +127 -118
- package/package.json +1 -1
package/es/editor.vue2.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { oneTravelImgPondBeforeAddFile as J, oneTravelImageCheckAndTransform as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { conclude as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { defineComponent as ge, ref as h, computed as _, watch as S, onMounted as he, onUnmounted as xe } from "vue";
|
|
2
|
+
import { oneTravelImgPondBeforeAddFile as J, oneTravelImageCheckAndTransform as be, oneTravelImageCompressor as K } from "@keyblade/one-travel";
|
|
3
|
+
import { getFileExtension as Q, getImagePixel as ye } from "./util.js";
|
|
4
|
+
import we from "imgpond";
|
|
5
|
+
import { conclude as C } from "vue-global-config";
|
|
6
|
+
import X from "tinymce";
|
|
7
|
+
import _e from "./langs/zh_CN.js";
|
|
8
8
|
import "tinymce/skins/ui/oxide/skin";
|
|
9
9
|
import "tinymce/models/dom";
|
|
10
10
|
import "tinymce/themes/silver";
|
|
@@ -33,9 +33,9 @@ import "tinymce/plugins/table";
|
|
|
33
33
|
import "tinymce/plugins/visualblocks";
|
|
34
34
|
import "tinymce/plugins/visualchars";
|
|
35
35
|
import "tinymce/plugins/wordcount";
|
|
36
|
-
import { globalProps as
|
|
36
|
+
import { globalProps as A } from "./index.js";
|
|
37
37
|
import { Loading as k, Message as b } from "element-ui";
|
|
38
|
-
const ra = /* @__PURE__ */
|
|
38
|
+
const ra = /* @__PURE__ */ ge({
|
|
39
39
|
__name: "editor",
|
|
40
40
|
props: {
|
|
41
41
|
value: { default: "" },
|
|
@@ -49,9 +49,9 @@ const ra = /* @__PURE__ */ fe({
|
|
|
49
49
|
initComplete: null
|
|
50
50
|
},
|
|
51
51
|
emits: ["input"],
|
|
52
|
-
setup(
|
|
53
|
-
const
|
|
54
|
-
|
|
52
|
+
setup(Y, { emit: z }) {
|
|
53
|
+
const m = Y;
|
|
54
|
+
X.addI18n("zh_CN", _e);
|
|
55
55
|
const V = {
|
|
56
56
|
maxCount: 10,
|
|
57
57
|
tipText: "上传",
|
|
@@ -70,7 +70,7 @@ const ra = /* @__PURE__ */ fe({
|
|
|
70
70
|
enable: !0,
|
|
71
71
|
maxSize: 200,
|
|
72
72
|
allowedType: ["mp3", "m4a", "wav", "aac"]
|
|
73
|
-
}, R = h(), x = h(), P = h(!1), T = h(!1), c =
|
|
73
|
+
}, R = h(), x = h(), P = h(!1), T = h(!1), c = _(() => C([m.imageUploadOptions, A.imageUploadOptions, V]) || {}), d = _(() => C([m.videoUploadOptions, A.videoUploadOptions, B]) || {}), f = _(() => C([m.audioUploadOptions, A.audioUploadOptions, H]) || {}), U = _(() => C([m.imgPondOptions, A.imgPondOptions]) || {}), Z = _(() => {
|
|
74
74
|
var e, o;
|
|
75
75
|
return ((o = (e = c == null ? void 0 : c.value) == null ? void 0 : e.allowedType) == null ? void 0 : o.map((i) => `.${i}`).join(",")) || "";
|
|
76
76
|
}), D = h();
|
|
@@ -107,25 +107,25 @@ const ra = /* @__PURE__ */ fe({
|
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
109
|
}, { immediate: !0 });
|
|
110
|
-
const
|
|
110
|
+
const w = h({
|
|
111
111
|
dialogVisible: !1,
|
|
112
112
|
formData: {
|
|
113
113
|
images: []
|
|
114
114
|
}
|
|
115
115
|
}), W = h(), j = () => {
|
|
116
|
-
|
|
116
|
+
w.value.dialogVisible = !1, w.value.formData = {
|
|
117
117
|
images: []
|
|
118
118
|
};
|
|
119
|
-
},
|
|
119
|
+
}, ee = () => {
|
|
120
120
|
var e;
|
|
121
121
|
(e = W.value) == null || e.validate((o) => {
|
|
122
|
-
o && (
|
|
122
|
+
o && (w.value.formData.images.forEach((i) => {
|
|
123
123
|
var t;
|
|
124
124
|
let a = i;
|
|
125
125
|
U.value.srcAt && (a = (i == null ? void 0 : i[U.value.srcAt]) || ""), (t = x.value) == null || t.insertContent(`<img src=${a} alt="" />`);
|
|
126
126
|
}), j());
|
|
127
127
|
});
|
|
128
|
-
},
|
|
128
|
+
}, v = h({
|
|
129
129
|
dialogVisible: !1,
|
|
130
130
|
formData: {
|
|
131
131
|
// 名称
|
|
@@ -137,17 +137,17 @@ const ra = /* @__PURE__ */ fe({
|
|
|
137
137
|
},
|
|
138
138
|
// 用于临时保存上传前的参数 { file: File }
|
|
139
139
|
additionalData: {}
|
|
140
|
-
}), $ = h(),
|
|
141
|
-
|
|
140
|
+
}), $ = h(), E = () => {
|
|
141
|
+
v.value.dialogVisible = !1, v.value.formData = {
|
|
142
142
|
name: "",
|
|
143
143
|
cover: [],
|
|
144
144
|
file: []
|
|
145
|
-
},
|
|
146
|
-
},
|
|
145
|
+
}, v.value.additionalData = {};
|
|
146
|
+
}, ae = () => {
|
|
147
147
|
var e;
|
|
148
148
|
(e = $.value) == null || e.validate((o) => {
|
|
149
149
|
var i, a;
|
|
150
|
-
o && ((a = x.value) == null || a.insertContent(`<audio controls data-name="${
|
|
150
|
+
o && ((a = x.value) == null || a.insertContent(`<audio controls data-name="${v.value.formData.name}" data-poster="${v.value.formData.cover[0]}" src="${(i = v.value.formData.file[0]) == null ? void 0 : i.url}"></audio>`), E());
|
|
151
151
|
});
|
|
152
152
|
}, g = h({
|
|
153
153
|
dialogVisible: !1,
|
|
@@ -157,18 +157,18 @@ const ra = /* @__PURE__ */ fe({
|
|
|
157
157
|
},
|
|
158
158
|
// 用于临时保存上传前的参数 { file: File }
|
|
159
159
|
additionalData: {}
|
|
160
|
-
}),
|
|
160
|
+
}), I = h(), q = () => {
|
|
161
161
|
g.value.dialogVisible = !1, g.value.formData = {
|
|
162
162
|
file: []
|
|
163
163
|
}, g.value.additionalData = {};
|
|
164
|
-
},
|
|
164
|
+
}, te = () => {
|
|
165
165
|
var e;
|
|
166
|
-
(e =
|
|
166
|
+
(e = I.value) == null || e.validate((o) => {
|
|
167
167
|
var i, a;
|
|
168
168
|
o && ((a = x.value) == null || a.insertContent(`<video controls controlslist="nodownload" src="${(i = g.value.formData.file[0]) == null ? void 0 : i.url}"></video>`), q());
|
|
169
169
|
});
|
|
170
|
-
},
|
|
171
|
-
var
|
|
170
|
+
}, oe = (e, o) => new Promise(async (i, a) => {
|
|
171
|
+
var r, l;
|
|
172
172
|
const t = await K(e);
|
|
173
173
|
if (!t.success) {
|
|
174
174
|
a(), setTimeout(() => {
|
|
@@ -176,7 +176,7 @@ const ra = /* @__PURE__ */ fe({
|
|
|
176
176
|
});
|
|
177
177
|
return;
|
|
178
178
|
}
|
|
179
|
-
const n = await ((
|
|
179
|
+
const n = await ((l = (r = c.value).handleRequest) == null ? void 0 : l.call(r, t.file, e.name, { extParameters: m.extParameters }));
|
|
180
180
|
if (!n || !(n != null && n.success)) {
|
|
181
181
|
a(), setTimeout(() => {
|
|
182
182
|
o.onError(n == null ? void 0 : n.errorMessage);
|
|
@@ -186,25 +186,27 @@ const ra = /* @__PURE__ */ fe({
|
|
|
186
186
|
i(n.url);
|
|
187
187
|
});
|
|
188
188
|
async function F(e) {
|
|
189
|
-
var i, a, t, n;
|
|
189
|
+
var i, a, t, n, r;
|
|
190
190
|
const o = e.getElementsByTagName("img");
|
|
191
191
|
for (let l of o) {
|
|
192
|
-
const
|
|
193
|
-
if (
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
192
|
+
const s = l.src;
|
|
193
|
+
if (s.startsWith("data:image"))
|
|
194
|
+
(i = l == null ? void 0 : l.remove) == null || i.call(l);
|
|
195
|
+
else if (s.startsWith("http://") || s.startsWith("https://")) {
|
|
196
|
+
const u = await ye(s);
|
|
197
|
+
if (u && (u.width < (c.value.minWidth || 0) && u.height < (c.value.minHeight || 0) || u.width > (c.value.maxWidth || 0) && u.height > (c.value.maxHeight || 0))) {
|
|
198
|
+
(a = l == null ? void 0 : l.remove) == null || a.call(l);
|
|
197
199
|
return;
|
|
198
200
|
}
|
|
199
|
-
const
|
|
200
|
-
if (!((
|
|
201
|
-
(
|
|
201
|
+
const p = Q(s);
|
|
202
|
+
if (!((n = (t = c.value) == null ? void 0 : t.allowedType) != null && n.includes(p.toLowerCase()))) {
|
|
203
|
+
(r = l == null ? void 0 : l.remove) == null || r.call(l);
|
|
202
204
|
return;
|
|
203
205
|
}
|
|
204
206
|
}
|
|
205
207
|
}
|
|
206
208
|
}
|
|
207
|
-
|
|
209
|
+
he(() => {
|
|
208
210
|
var i;
|
|
209
211
|
const e = {
|
|
210
212
|
// 设置语言
|
|
@@ -296,14 +298,14 @@ const ra = /* @__PURE__ */ fe({
|
|
|
296
298
|
},
|
|
297
299
|
images_upload_handler(a) {
|
|
298
300
|
return new Promise(async (t, n) => {
|
|
299
|
-
var N, O,
|
|
301
|
+
var N, O, L;
|
|
300
302
|
if (!((N = c.value) != null && N.handleRequest))
|
|
301
303
|
return n({ message: "缺少图片上传配置", remove: !0 });
|
|
302
|
-
const
|
|
303
|
-
let
|
|
304
|
-
if (!(
|
|
305
|
-
return
|
|
306
|
-
const
|
|
304
|
+
const r = k.service({ text: "上传中" });
|
|
305
|
+
let l = a.blob(), s = l.name ? l.name : a.filename();
|
|
306
|
+
if (!(l != null && l.name) && !(l != null && l.lastModified) && l.type === "image/png")
|
|
307
|
+
return r == null || r.close(), n({ message: "不允许粘贴", remove: !0 });
|
|
308
|
+
const u = await be(l, s, {
|
|
307
309
|
imageMaxSize: c.value.maxSize,
|
|
308
310
|
imageAllowedType: c.value.allowedType,
|
|
309
311
|
// imageAllowedMineType: mergeImageUploadOptions.value.allowedMineType,
|
|
@@ -312,29 +314,29 @@ const ra = /* @__PURE__ */ fe({
|
|
|
312
314
|
imageMaxWidth: c.value.maxWidth,
|
|
313
315
|
imageMaxHeight: c.value.maxHeight
|
|
314
316
|
});
|
|
315
|
-
if (!
|
|
316
|
-
return
|
|
317
|
-
if (
|
|
318
|
-
|
|
319
|
-
const
|
|
320
|
-
|
|
317
|
+
if (!u.success)
|
|
318
|
+
return r == null || r.close(), n({ message: (u == null ? void 0 : u.errorMessage) || "", remove: !0 });
|
|
319
|
+
if (u.hasTransform) {
|
|
320
|
+
l = u.file;
|
|
321
|
+
const G = s == null ? void 0 : s.split(".");
|
|
322
|
+
G.pop(), s = `${G.join(",")}.jpeg`;
|
|
321
323
|
}
|
|
322
|
-
const
|
|
323
|
-
if (!
|
|
324
|
-
return
|
|
325
|
-
const y = await ((
|
|
324
|
+
const p = await K(l);
|
|
325
|
+
if (!p.success)
|
|
326
|
+
return r == null || r.close(), n({ message: p == null ? void 0 : p.errorMessage, remove: !0 });
|
|
327
|
+
const y = await ((L = (O = c.value).handleRequest) == null ? void 0 : L.call(O, p.file, s, { extParameters: m.extParameters }));
|
|
326
328
|
if (!y || !y.success)
|
|
327
|
-
return
|
|
328
|
-
|
|
329
|
+
return r == null || r.close(), n({ message: y.errorMessage, remove: !0 });
|
|
330
|
+
r == null || r.close(), t(y.url);
|
|
329
331
|
});
|
|
330
332
|
},
|
|
331
333
|
setup(a) {
|
|
332
|
-
var n,
|
|
334
|
+
var n, r;
|
|
333
335
|
const t = () => {
|
|
334
|
-
|
|
335
|
-
var s,
|
|
336
|
-
const
|
|
337
|
-
|
|
336
|
+
w.value.dialogVisible = !0, setTimeout(() => {
|
|
337
|
+
var s, u;
|
|
338
|
+
const l = (s = document == null ? void 0 : document.querySelector) == null ? void 0 : s.call(document, ".tinymce-editor-upload-image-dialog .el-upload__text > div");
|
|
339
|
+
l && (l.innerHTML = ((u = c.value) == null ? void 0 : u.tipText) || "上传");
|
|
338
340
|
});
|
|
339
341
|
};
|
|
340
342
|
if (a.ui.registry.addMenuItem("localImage", {
|
|
@@ -346,42 +348,42 @@ const ra = /* @__PURE__ */ fe({
|
|
|
346
348
|
tooltip: "图片",
|
|
347
349
|
onAction: () => t()
|
|
348
350
|
}), (n = f == null ? void 0 : f.value) != null && n.enable) {
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
-
var
|
|
352
|
-
const s = (
|
|
353
|
-
s && (s.innerHTML = ((
|
|
351
|
+
const l = () => {
|
|
352
|
+
v.value.dialogVisible = !0, setTimeout(() => {
|
|
353
|
+
var u, p;
|
|
354
|
+
const s = (u = document == null ? void 0 : document.querySelector) == null ? void 0 : u.call(document, ".tinymce-editor-upload-audio-dialog .el-upload__text > div");
|
|
355
|
+
s && (s.innerHTML = ((p = c.value) == null ? void 0 : p.tipText) || "上传");
|
|
354
356
|
});
|
|
355
357
|
};
|
|
356
358
|
a.ui.registry.addMenuItem("localAudio", {
|
|
357
359
|
text: "音频",
|
|
358
360
|
icon: "arrow-right",
|
|
359
|
-
onAction: () =>
|
|
361
|
+
onAction: () => l()
|
|
360
362
|
}), a.ui.registry.addButton("localAudio", {
|
|
361
363
|
icon: "arrow-right",
|
|
362
364
|
tooltip: "音频",
|
|
363
|
-
onAction: () =>
|
|
365
|
+
onAction: () => l()
|
|
364
366
|
});
|
|
365
367
|
}
|
|
366
|
-
if ((
|
|
367
|
-
const
|
|
368
|
+
if ((r = d == null ? void 0 : d.value) != null && r.enable) {
|
|
369
|
+
const l = () => {
|
|
368
370
|
g.value.dialogVisible = !0;
|
|
369
371
|
};
|
|
370
372
|
a.ui.registry.addMenuItem("localVideo", {
|
|
371
373
|
text: "视频",
|
|
372
374
|
icon: "embed",
|
|
373
|
-
onAction: () =>
|
|
375
|
+
onAction: () => l()
|
|
374
376
|
}), a.ui.registry.addButton("localVideo", {
|
|
375
377
|
icon: "embed",
|
|
376
378
|
tooltip: "视频",
|
|
377
|
-
onAction: () =>
|
|
379
|
+
onAction: () => l()
|
|
378
380
|
});
|
|
379
381
|
}
|
|
380
382
|
}
|
|
381
|
-
}, o =
|
|
383
|
+
}, o = C(
|
|
382
384
|
[
|
|
383
|
-
|
|
384
|
-
|
|
385
|
+
m.options,
|
|
386
|
+
A.options,
|
|
385
387
|
e
|
|
386
388
|
],
|
|
387
389
|
{
|
|
@@ -391,92 +393,99 @@ const ra = /* @__PURE__ */ fe({
|
|
|
391
393
|
type: Object
|
|
392
394
|
}
|
|
393
395
|
);
|
|
394
|
-
|
|
396
|
+
X.init(o).then(([a]) => {
|
|
395
397
|
var t;
|
|
396
|
-
a && (a.customProps = { ...
|
|
398
|
+
a && (a.customProps = { ...m }, a.on("change input Redo Undo SetContent", () => {
|
|
397
399
|
if (T.value) {
|
|
398
400
|
T.value = !1;
|
|
399
401
|
return;
|
|
400
402
|
}
|
|
401
403
|
P.value = !0, z("input", a.getContent());
|
|
402
|
-
}),
|
|
404
|
+
}), a.on("paste", (n) => {
|
|
405
|
+
var l, s;
|
|
406
|
+
const r = ((l = n.clipboardData) == null ? void 0 : l.files) || [];
|
|
407
|
+
for (let u of r) {
|
|
408
|
+
const p = Q(u.name) || "";
|
|
409
|
+
(s = c.value.allowedType) != null && s.includes(p.toLowerCase()) || n.preventDefault();
|
|
410
|
+
}
|
|
411
|
+
}), (t = m.initComplete) == null || t.call(m, { editorIns: a }), x.value = a);
|
|
403
412
|
});
|
|
404
|
-
}),
|
|
413
|
+
}), xe(() => {
|
|
405
414
|
var e;
|
|
406
415
|
(e = x.value) == null || e.destroy();
|
|
407
416
|
});
|
|
408
|
-
const
|
|
417
|
+
const ie = () => {
|
|
409
418
|
var o, i;
|
|
410
|
-
const e = { ...
|
|
411
|
-
return ((i = (o = f.value) == null ? void 0 : o.data) == null ? void 0 : i.call(o, { file: e, extParameters:
|
|
412
|
-
},
|
|
419
|
+
const e = { ...v.value.additionalData || {} };
|
|
420
|
+
return ((i = (o = f.value) == null ? void 0 : o.data) == null ? void 0 : i.call(o, { file: e, extParameters: m.extParameters })) || {};
|
|
421
|
+
}, le = () => {
|
|
413
422
|
var o, i;
|
|
414
|
-
const e = { ...
|
|
415
|
-
return ((i = (o = f.value) == null ? void 0 : o.headers) == null ? void 0 : i.call(o, { file: e, extParameters:
|
|
416
|
-
},
|
|
423
|
+
const e = { ...v.value.additionalData || {} };
|
|
424
|
+
return ((i = (o = f.value) == null ? void 0 : o.headers) == null ? void 0 : i.call(o, { file: e, extParameters: m.extParameters })) || {};
|
|
425
|
+
}, ne = (e, o, i) => {
|
|
417
426
|
var t, n;
|
|
418
427
|
const a = (n = (t = f == null ? void 0 : f.value) == null ? void 0 : t.handlerResponse) == null ? void 0 : n.call(t, e);
|
|
419
|
-
a != null && a.url ? i[i.length - 1].url = a.url : a != null && a.errorMessage && (b.error(a.errorMessage), i.splice(i.length - 1, 1)),
|
|
420
|
-
},
|
|
421
|
-
var n,
|
|
428
|
+
a != null && a.url ? i[i.length - 1].url = a.url : a != null && a.errorMessage && (b.error(a.errorMessage), i.splice(i.length - 1, 1)), v.value.formData.file = i;
|
|
429
|
+
}, re = (e, o) => new Promise((i, a) => {
|
|
430
|
+
var n, r, l, s, u, p;
|
|
422
431
|
const t = e.name.split(".").filter(Boolean).pop() ? e.name.split(".").filter(Boolean).pop() : "";
|
|
423
|
-
if (!((
|
|
424
|
-
b.error(`请上传格式为${(s = (
|
|
432
|
+
if (!((r = (n = f.value) == null ? void 0 : n.allowedType) != null && r.includes(t.toLowerCase()))) {
|
|
433
|
+
b.error(`请上传格式为${(s = (l = f.value) == null ? void 0 : l.allowedType) == null ? void 0 : s.map((y) => y.toUpperCase()).join("、")}的音频`), a();
|
|
425
434
|
return;
|
|
426
435
|
}
|
|
427
|
-
if (e.size > (((
|
|
428
|
-
b.error(`请上传${((
|
|
436
|
+
if (e.size > (((u = f.value) == null ? void 0 : u.maxSize) || 0) * 1024 * 1024) {
|
|
437
|
+
b.error(`请上传${((p = f.value) == null ? void 0 : p.maxSize) || 0}M内的音频`), a();
|
|
429
438
|
return;
|
|
430
439
|
}
|
|
431
|
-
|
|
432
|
-
}),
|
|
433
|
-
|
|
434
|
-
},
|
|
435
|
-
b.error("上传发生错误,请重试!"),
|
|
436
|
-
},
|
|
440
|
+
v.value.additionalData = { file: e }, i(!0);
|
|
441
|
+
}), se = (e, o) => {
|
|
442
|
+
v.value.formData.file = o;
|
|
443
|
+
}, ue = (e, o, i) => {
|
|
444
|
+
b.error("上传发生错误,请重试!"), v.value.formData.file = i;
|
|
445
|
+
}, ce = () => {
|
|
437
446
|
var o, i;
|
|
438
447
|
const e = { ...g.value.additionalData || {} };
|
|
439
|
-
return ((i = (o =
|
|
440
|
-
},
|
|
448
|
+
return ((i = (o = d.value) == null ? void 0 : o.data) == null ? void 0 : i.call(o, { file: e, extParameters: m.extParameters })) || {};
|
|
449
|
+
}, me = () => {
|
|
441
450
|
var o, i;
|
|
442
451
|
const e = { ...g.value.additionalData || {} };
|
|
443
|
-
return ((i = (o =
|
|
444
|
-
},
|
|
452
|
+
return ((i = (o = d.value) == null ? void 0 : o.headers) == null ? void 0 : i.call(o, { file: e, extParameters: m.extParameters })) || {};
|
|
453
|
+
}, de = (e, o, i) => {
|
|
445
454
|
var t, n;
|
|
446
|
-
const a = (n = (t =
|
|
455
|
+
const a = (n = (t = d == null ? void 0 : d.value) == null ? void 0 : t.handlerResponse) == null ? void 0 : n.call(t, e);
|
|
447
456
|
a != null && a.url ? i[i.length - 1].url = a.url : a != null && a.errorMessage && (b.error(a.errorMessage), i.splice(i.length - 1, 1)), g.value.formData.file = i;
|
|
448
|
-
},
|
|
449
|
-
var n,
|
|
457
|
+
}, pe = (e, o) => new Promise((i, a) => {
|
|
458
|
+
var n, r, l, s, u, p;
|
|
450
459
|
const t = e.name.split(".").filter(Boolean).pop() ? e.name.split(".").filter(Boolean).pop() : "";
|
|
451
|
-
if (!((
|
|
452
|
-
b.error(`请上传格式为${(s = (
|
|
460
|
+
if (!((r = (n = d == null ? void 0 : d.value) == null ? void 0 : n.allowedType) != null && r.includes(t.toLowerCase()))) {
|
|
461
|
+
b.error(`请上传格式为${(s = (l = d == null ? void 0 : d.value) == null ? void 0 : l.allowedType) == null ? void 0 : s.map((y) => y.toUpperCase()).join("、")}的视频`), a();
|
|
453
462
|
return;
|
|
454
463
|
}
|
|
455
|
-
if (e.size > (((
|
|
456
|
-
b.error(`请上传${((
|
|
464
|
+
if (e.size > (((u = d == null ? void 0 : d.value) == null ? void 0 : u.maxSize) || 0) * 1024 * 1024) {
|
|
465
|
+
b.error(`请上传${((p = d == null ? void 0 : d.value) == null ? void 0 : p.maxSize) || 0}M内的视频`), a();
|
|
457
466
|
return;
|
|
458
467
|
}
|
|
459
468
|
g.value.additionalData = { file: e }, i(!0);
|
|
460
|
-
}),
|
|
469
|
+
}), ve = (e, o) => {
|
|
461
470
|
g.value.formData.file = o;
|
|
462
|
-
},
|
|
471
|
+
}, fe = (e, o, i) => {
|
|
463
472
|
b.error("上传发生错误,请重试!"), g.value.formData.file = i;
|
|
464
473
|
};
|
|
465
|
-
return S(() => [
|
|
474
|
+
return S(() => [m.disabled, x.value], () => {
|
|
466
475
|
var e, o;
|
|
467
|
-
(o = (e = x.value) == null ? void 0 : e.mode) == null || o.set(
|
|
476
|
+
(o = (e = x.value) == null ? void 0 : e.mode) == null || o.set(m.disabled ? "readonly" : "design");
|
|
468
477
|
}, { immediate: !0 }), S(
|
|
469
|
-
() => [
|
|
478
|
+
() => [m.value, x.value],
|
|
470
479
|
() => {
|
|
471
480
|
var e;
|
|
472
481
|
if (P.value) {
|
|
473
482
|
P.value = !1;
|
|
474
483
|
return;
|
|
475
484
|
}
|
|
476
|
-
T.value = !0, (e = x.value) == null || e.setContent(
|
|
485
|
+
T.value = !0, (e = x.value) == null || e.setContent(m.value ? m.value : "");
|
|
477
486
|
},
|
|
478
487
|
{ immediate: !0 }
|
|
479
|
-
), { __sfc: !0, defaultImageUploadOptions: V, defaultVideoUploadOptions: B, defaultAudioUploadOptions: H, props:
|
|
488
|
+
), { __sfc: !0, defaultImageUploadOptions: V, defaultVideoUploadOptions: B, defaultAudioUploadOptions: H, props: m, emits: z, insRef: R, editorRef: x, preventSettingContent: P, preventUpdatingModelValue: T, mergeImageUploadOptions: c, mergeVideoUploadOptions: d, mergeAudioUploadOptions: f, mergeImgPondOptions: U, imgPondAccept: Z, uploadImageImgPondRef: D, audioImageImgPondRef: M, uploadImage: w, uploadImageFormRef: W, onUploadImageClose: j, onUploadImageConfirm: ee, uploadAudio: v, uploadAudioFormRef: $, onUploadAudioClose: E, onUploadAudioConfirm: ae, uploadVideo: g, uploadVideoFormRef: I, onUploadVideoClose: q, onUploadVideoConfirm: te, onImageUploadUpload: oe, processPastedImage: F, getUploadAudioData: ie, getUploadAudioHeaders: le, onUploadAudioSuccess: ne, onUploadAudioBeforeUpload: re, onUploadAudioRemove: se, onUploadAudioError: ue, getUploadVideoData: ce, getUploadVideoHeaders: me, onUploadVideoSuccess: de, onUploadVideoBeforeUpload: pe, onUploadVideoRemove: ve, onUploadVideoError: fe, ImgPond: we };
|
|
480
489
|
}
|
|
481
490
|
});
|
|
482
491
|
export {
|
package/package.json
CHANGED