@keyblade/tinymce-editor-vue2 0.0.12-alpha.43 → 0.0.12-alpha.44
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 +123 -114
- package/package.json +1 -1
package/es/editor.vue2.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { oneTravelImgPondBeforeAddFile as
|
|
3
|
-
import { blobToFile as
|
|
1
|
+
import { defineComponent as xe, ref as h, computed as C, watch as I, onMounted as we, onUnmounted as be } from "vue";
|
|
2
|
+
import { oneTravelImgPondBeforeAddFile as J, oneTravelImageCheckAndTransform as ye, oneTravelImageCompressor as K } from "@keyblade/one-travel";
|
|
3
|
+
import { blobToFile as Q, getFileExtension as X, generateUUID as _e, getImagePixel as Te } from "./util.js";
|
|
4
4
|
import "./style.less.js";
|
|
5
|
-
import
|
|
6
|
-
import { conclude as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
5
|
+
import Ce from "imgpond";
|
|
6
|
+
import { conclude as A } from "vue-global-config";
|
|
7
|
+
import Y from "tinymce";
|
|
8
|
+
import Ae from "./langs/zh_CN.js";
|
|
9
9
|
import "tinymce/skins/ui/oxide/skin";
|
|
10
10
|
import "tinymce/models/dom";
|
|
11
11
|
import "tinymce/themes/silver";
|
|
@@ -34,9 +34,9 @@ import "tinymce/plugins/table";
|
|
|
34
34
|
import "tinymce/plugins/visualblocks";
|
|
35
35
|
import "tinymce/plugins/visualchars";
|
|
36
36
|
import "tinymce/plugins/wordcount";
|
|
37
|
-
import { globalProps as
|
|
37
|
+
import { globalProps as D } from "./index.js";
|
|
38
38
|
import { Message as y } from "element-ui";
|
|
39
|
-
const
|
|
39
|
+
const ma = /* @__PURE__ */ xe({
|
|
40
40
|
__name: "editor",
|
|
41
41
|
props: {
|
|
42
42
|
value: { default: "" },
|
|
@@ -50,10 +50,10 @@ const da = /* @__PURE__ */ he({
|
|
|
50
50
|
initComplete: null
|
|
51
51
|
},
|
|
52
52
|
emits: ["input"],
|
|
53
|
-
setup(
|
|
54
|
-
const m =
|
|
55
|
-
|
|
56
|
-
const
|
|
53
|
+
setup(Z, { emit: H }) {
|
|
54
|
+
const m = Z;
|
|
55
|
+
Y.addI18n("zh_CN", Ae);
|
|
56
|
+
const V = {
|
|
57
57
|
maxCount: 10,
|
|
58
58
|
tipText: "上传",
|
|
59
59
|
maxSize: 30,
|
|
@@ -63,25 +63,25 @@ const da = /* @__PURE__ */ he({
|
|
|
63
63
|
minHeight: 50,
|
|
64
64
|
maxWidth: 6e3,
|
|
65
65
|
maxHeight: 6e3
|
|
66
|
-
},
|
|
66
|
+
}, B = {
|
|
67
67
|
enable: !0,
|
|
68
68
|
maxSize: 300,
|
|
69
69
|
allowedType: ["mp4", "3gp"],
|
|
70
70
|
accept: "video/mp4,video/3gpp"
|
|
71
|
-
},
|
|
71
|
+
}, R = {
|
|
72
72
|
enable: !0,
|
|
73
73
|
maxSize: 200,
|
|
74
74
|
allowedType: ["mp3", "m4a", "wav", "aac"],
|
|
75
75
|
accept: "audio/mp3,audio/wav,audio/aac,audio/x-m4a"
|
|
76
|
-
},
|
|
76
|
+
}, W = h(), b = h(), P = h(!1), M = h(!1), f = h({
|
|
77
77
|
show: !1,
|
|
78
78
|
text: "图片上传中,请稍等"
|
|
79
|
-
}), d =
|
|
80
|
-
var e,
|
|
81
|
-
return ((
|
|
82
|
-
}),
|
|
83
|
-
I(() =>
|
|
84
|
-
|
|
79
|
+
}), d = C(() => A([m.imageUploadOptions, D.imageUploadOptions, V]) || {}), c = C(() => A([m.videoUploadOptions, D.videoUploadOptions, B]) || {}), g = C(() => A([m.audioUploadOptions, D.audioUploadOptions, R]) || {}), z = C(() => A([m.imgPondOptions, D.imgPondOptions]) || {}), ee = C(() => {
|
|
80
|
+
var e, t;
|
|
81
|
+
return ((t = (e = d == null ? void 0 : d.value) == null ? void 0 : e.allowedType) == null ? void 0 : t.map((i) => `.${i}`).join(",")) || "";
|
|
82
|
+
}), S = h();
|
|
83
|
+
I(() => S.value, () => {
|
|
84
|
+
S.value && J(S.value, {
|
|
85
85
|
onStart: () => {
|
|
86
86
|
f.value = {
|
|
87
87
|
show: !0,
|
|
@@ -98,7 +98,7 @@ const da = /* @__PURE__ */ he({
|
|
|
98
98
|
}, { immediate: !0 });
|
|
99
99
|
const U = h();
|
|
100
100
|
I(() => U.value, () => {
|
|
101
|
-
U.value &&
|
|
101
|
+
U.value && J(U.value, {
|
|
102
102
|
onStart: () => {
|
|
103
103
|
f.value = {
|
|
104
104
|
show: !0,
|
|
@@ -113,23 +113,23 @@ const da = /* @__PURE__ */ he({
|
|
|
113
113
|
}
|
|
114
114
|
});
|
|
115
115
|
}, { immediate: !0 });
|
|
116
|
-
const
|
|
116
|
+
const T = h({
|
|
117
117
|
dialogVisible: !1,
|
|
118
118
|
formData: {
|
|
119
119
|
images: []
|
|
120
120
|
}
|
|
121
|
-
}),
|
|
122
|
-
|
|
121
|
+
}), $ = h(), E = () => {
|
|
122
|
+
T.value.dialogVisible = !1, T.value.formData = {
|
|
123
123
|
images: []
|
|
124
124
|
};
|
|
125
|
-
},
|
|
125
|
+
}, ae = () => {
|
|
126
126
|
var e;
|
|
127
|
-
(e =
|
|
128
|
-
|
|
127
|
+
(e = $.value) == null || e.validate((t) => {
|
|
128
|
+
t && (T.value.formData.images.forEach((i) => {
|
|
129
129
|
var o;
|
|
130
|
-
let a =
|
|
131
|
-
|
|
132
|
-
}),
|
|
130
|
+
let a = i;
|
|
131
|
+
z.value.srcAt && (a = (i == null ? void 0 : i[z.value.srcAt]) || ""), (o = b.value) == null || o.insertContent(`<img src=${a} alt="" />`);
|
|
132
|
+
}), E());
|
|
133
133
|
});
|
|
134
134
|
}, v = h({
|
|
135
135
|
dialogVisible: !1,
|
|
@@ -143,17 +143,17 @@ const da = /* @__PURE__ */ he({
|
|
|
143
143
|
},
|
|
144
144
|
// 用于临时保存上传前的参数 { file: File }
|
|
145
145
|
additionalData: {}
|
|
146
|
-
}),
|
|
146
|
+
}), j = h(), q = () => {
|
|
147
147
|
v.value.dialogVisible = !1, v.value.formData = {
|
|
148
148
|
name: "",
|
|
149
149
|
cover: [],
|
|
150
150
|
file: []
|
|
151
151
|
}, v.value.additionalData = {};
|
|
152
|
-
},
|
|
152
|
+
}, oe = () => {
|
|
153
153
|
var e;
|
|
154
|
-
(e =
|
|
155
|
-
var
|
|
156
|
-
|
|
154
|
+
(e = j.value) == null || e.validate((t) => {
|
|
155
|
+
var i, a;
|
|
156
|
+
t && ((a = b.value) == null || a.insertContent(`<audio controls controlslist="nodownload noplaybackrate" 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>`), q());
|
|
157
157
|
});
|
|
158
158
|
}, x = h({
|
|
159
159
|
dialogVisible: !1,
|
|
@@ -163,42 +163,42 @@ const da = /* @__PURE__ */ he({
|
|
|
163
163
|
},
|
|
164
164
|
// 用于临时保存上传前的参数 { file: File }
|
|
165
165
|
additionalData: {}
|
|
166
|
-
}),
|
|
166
|
+
}), N = h(), F = () => {
|
|
167
167
|
x.value.dialogVisible = !1, x.value.formData = {
|
|
168
168
|
file: []
|
|
169
169
|
}, x.value.additionalData = {};
|
|
170
|
-
},
|
|
170
|
+
}, te = () => {
|
|
171
171
|
var e;
|
|
172
|
-
(e =
|
|
173
|
-
var
|
|
174
|
-
|
|
172
|
+
(e = N.value) == null || e.validate((t) => {
|
|
173
|
+
var i, a;
|
|
174
|
+
t && ((a = b.value) == null || a.insertContent(`<video width="auto" height="auto" controls src="${(i = x.value.formData.file[0]) == null ? void 0 : i.url}"></video>`), F());
|
|
175
175
|
});
|
|
176
|
-
},
|
|
176
|
+
}, ie = () => {
|
|
177
177
|
document.querySelectorAll(".swal2-container .swal2-title").forEach((e) => {
|
|
178
178
|
e && (e.innerHTML = `单次最多可选择${d.value.maxCount}张图片`);
|
|
179
179
|
});
|
|
180
|
-
},
|
|
180
|
+
}, ne = (e, t) => new Promise(async (i, a) => {
|
|
181
181
|
var r, l;
|
|
182
|
-
const o = await
|
|
182
|
+
const o = await K(e);
|
|
183
183
|
if (!o.success) {
|
|
184
184
|
a(), setTimeout(() => {
|
|
185
|
-
|
|
185
|
+
t.onError(o.errorMessage);
|
|
186
186
|
});
|
|
187
187
|
return;
|
|
188
188
|
}
|
|
189
|
-
const n = await ((l = (r = d.value).handleRequest) == null ? void 0 : l.call(r,
|
|
189
|
+
const n = await ((l = (r = d.value).handleRequest) == null ? void 0 : l.call(r, Q(o.file, e.name), e.name, { extParameters: m.extParameters }));
|
|
190
190
|
if (!n || !(n != null && n.success)) {
|
|
191
191
|
a(), setTimeout(() => {
|
|
192
|
-
|
|
192
|
+
t.onError(n == null ? void 0 : n.errorMessage);
|
|
193
193
|
});
|
|
194
194
|
return;
|
|
195
195
|
}
|
|
196
|
-
|
|
196
|
+
i(n.url);
|
|
197
197
|
});
|
|
198
|
-
async function
|
|
199
|
-
const a =
|
|
198
|
+
async function L(e, t) {
|
|
199
|
+
const a = t.node.getElementsByTagName("img"), o = [];
|
|
200
200
|
for (let n = a.length - 1; n >= 0; n--) {
|
|
201
|
-
const r = a[n], l = "img-" +
|
|
201
|
+
const r = a[n], l = "img-" + _e();
|
|
202
202
|
r.classList.add(l), o.push(l);
|
|
203
203
|
}
|
|
204
204
|
setTimeout(async () => {
|
|
@@ -212,12 +212,12 @@ const da = /* @__PURE__ */ he({
|
|
|
212
212
|
e.dom.remove(u);
|
|
213
213
|
continue;
|
|
214
214
|
} else if (p.startsWith("http://") || p.startsWith("https://")) {
|
|
215
|
-
const w = await
|
|
215
|
+
const w = await Te(p);
|
|
216
216
|
if (w && (w.width < (d.value.minWidth || 0) && w.height < (d.value.minHeight || 0) || w.width > (d.value.maxWidth || 0) && w.height > (d.value.maxHeight || 0))) {
|
|
217
217
|
e.dom.remove(u);
|
|
218
218
|
continue;
|
|
219
219
|
}
|
|
220
|
-
const k =
|
|
220
|
+
const k = X(p);
|
|
221
221
|
if (!((r = (n = d.value) == null ? void 0 : n.allowedType) != null && r.includes(k.toLowerCase()))) {
|
|
222
222
|
e.dom.remove(u);
|
|
223
223
|
continue;
|
|
@@ -226,13 +226,20 @@ const da = /* @__PURE__ */ he({
|
|
|
226
226
|
}
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
|
-
|
|
230
|
-
|
|
229
|
+
const _ = () => {
|
|
230
|
+
setTimeout(() => {
|
|
231
|
+
var t;
|
|
232
|
+
const e = document.querySelector(".tox-notifications-container");
|
|
233
|
+
(t = e == null ? void 0 : e.remove) == null || t.call(e);
|
|
234
|
+
}, 2e3);
|
|
235
|
+
};
|
|
236
|
+
we(() => {
|
|
237
|
+
var i;
|
|
231
238
|
const e = {
|
|
232
239
|
// 设置语言
|
|
233
240
|
language: "zh_CN",
|
|
234
241
|
// 实例
|
|
235
|
-
target:
|
|
242
|
+
target: W.value,
|
|
236
243
|
// 隐藏品牌
|
|
237
244
|
branding: !1,
|
|
238
245
|
// 隐藏右上角升级按钮
|
|
@@ -310,28 +317,28 @@ const da = /* @__PURE__ */ he({
|
|
|
310
317
|
convert_urls: !1,
|
|
311
318
|
paste_webkit_styles: "all",
|
|
312
319
|
paste_data_images: !0,
|
|
313
|
-
images_file_types: ((
|
|
320
|
+
images_file_types: ((i = d.value.allowedType) == null ? void 0 : i.join(",")) || "jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp",
|
|
314
321
|
// 粘贴前处理
|
|
315
322
|
paste_preprocess(a, o) {
|
|
316
323
|
o.content = o.content.replace(/<video[^>]*(?:\/>|>[\s\S]*?<\/video>)/g, ""), o.content = o.content.replace(/<audio[^>]*(?:\/>|>[\s\S]*?<\/audio>)/g, ""), o.content = o.content.replace(/<nav/g, "<div").replace(/<\/nav>/g, "</div>"), o.content = o.content.replace(/<header/g, "<div").replace(/<\/header>/g, "</div>"), o.content = o.content.replace(/<footer/g, "<div").replace(/<\/footer>/g, "</div>"), o.content = o.content.replace(/<aside/g, "<div").replace(/<\/aside>/g, "</div>"), o.content = o.content.replace(/<section/g, "<div").replace(/<\/section>/g, "</div>"), o.content = o.content.replace(/<main/g, "<div").replace(/<\/main>/g, "</div>"), o.content = o.content.replace(/<article/g, "<div").replace(/<\/article>/g, "</div>"), o.content = o.content.replace(/<details/g, "<div").replace(/<\/details>/g, "</div>");
|
|
317
324
|
},
|
|
318
325
|
// 粘贴后处理(处理异步操作)
|
|
319
326
|
paste_postprocess(a, o) {
|
|
320
|
-
|
|
327
|
+
L(a, o);
|
|
321
328
|
},
|
|
322
329
|
images_upload_handler(a) {
|
|
323
330
|
return new Promise(async (o, n) => {
|
|
324
|
-
var w, k,
|
|
331
|
+
var w, k, O;
|
|
325
332
|
if (!((w = d.value) != null && w.handleRequest))
|
|
326
|
-
return n({ message: "缺少图片上传配置", remove: !0 });
|
|
333
|
+
return _(), n({ message: "缺少图片上传配置", remove: !0 });
|
|
327
334
|
f.value = {
|
|
328
335
|
show: !0,
|
|
329
336
|
text: "图片上传中,请稍等"
|
|
330
337
|
};
|
|
331
338
|
let r = a.blob(), l = r.name ? r.name : a.filename();
|
|
332
339
|
if (!(r != null && r.name) && !(r != null && r.lastModified) && r.type === "image/png")
|
|
333
|
-
return f.value.show = !1, n({ message: "不允许粘贴", remove: !0 });
|
|
334
|
-
const s = await
|
|
340
|
+
return f.value.show = !1, _(), n({ message: "不允许粘贴", remove: !0 });
|
|
341
|
+
const s = await ye(r, l, {
|
|
335
342
|
imageMaxSize: d.value.maxSize,
|
|
336
343
|
imageAllowedType: d.value.allowedType,
|
|
337
344
|
// imageAllowedMineType: mergeImageUploadOptions.value.allowedMineType,
|
|
@@ -341,25 +348,25 @@ const da = /* @__PURE__ */ he({
|
|
|
341
348
|
imageMaxHeight: d.value.maxHeight
|
|
342
349
|
});
|
|
343
350
|
if (!s.success)
|
|
344
|
-
return f.value.show = !1, n({ message: (s == null ? void 0 : s.errorMessage) || "", remove: !0 });
|
|
351
|
+
return f.value.show = !1, _(), n({ message: (s == null ? void 0 : s.errorMessage) || "", remove: !0 });
|
|
345
352
|
if (s.hasTransform) {
|
|
346
353
|
r = s.file;
|
|
347
|
-
const
|
|
348
|
-
|
|
354
|
+
const G = l == null ? void 0 : l.split(".");
|
|
355
|
+
G.pop(), l = `${G.join(",")}.jpg`;
|
|
349
356
|
}
|
|
350
|
-
const u = await
|
|
357
|
+
const u = await K(r);
|
|
351
358
|
if (!u.success)
|
|
352
|
-
return f.value.show = !1, n({ message: u == null ? void 0 : u.errorMessage, remove: !0 });
|
|
353
|
-
const p = await ((
|
|
359
|
+
return f.value.show = !1, _(), n({ message: u == null ? void 0 : u.errorMessage, remove: !0 });
|
|
360
|
+
const p = await ((O = (k = d.value).handleRequest) == null ? void 0 : O.call(k, Q(u.file, l), l, { extParameters: m.extParameters }));
|
|
354
361
|
if (!p || !p.success)
|
|
355
|
-
return f.value.show = !1, n({ message: p.errorMessage, remove: !0 });
|
|
362
|
+
return f.value.show = !1, _(), n({ message: p.errorMessage, remove: !0 });
|
|
356
363
|
f.value.show = !1, o(p.url);
|
|
357
364
|
});
|
|
358
365
|
},
|
|
359
366
|
setup(a) {
|
|
360
367
|
var n, r;
|
|
361
368
|
const o = () => {
|
|
362
|
-
|
|
369
|
+
T.value.dialogVisible = !0, setTimeout(() => {
|
|
363
370
|
var s, u;
|
|
364
371
|
const l = (s = document == null ? void 0 : document.querySelector) == null ? void 0 : s.call(document, ".tinymce-editor-upload-image-dialog .el-upload__text > div");
|
|
365
372
|
l && (l.innerHTML = ((u = d.value) == null ? void 0 : u.tipText) || "上传");
|
|
@@ -406,10 +413,10 @@ const da = /* @__PURE__ */ he({
|
|
|
406
413
|
});
|
|
407
414
|
}
|
|
408
415
|
}
|
|
409
|
-
},
|
|
416
|
+
}, t = A(
|
|
410
417
|
[
|
|
411
418
|
m.options,
|
|
412
|
-
|
|
419
|
+
D.options,
|
|
413
420
|
e
|
|
414
421
|
],
|
|
415
422
|
{
|
|
@@ -419,40 +426,42 @@ const da = /* @__PURE__ */ he({
|
|
|
419
426
|
type: Object
|
|
420
427
|
}
|
|
421
428
|
);
|
|
422
|
-
|
|
429
|
+
Y.init(t).then(([a]) => {
|
|
423
430
|
var o;
|
|
424
431
|
a && (a.customProps = { ...m }, a.on("change input Redo Undo SetContent", () => {
|
|
425
|
-
if (
|
|
426
|
-
|
|
432
|
+
if (M.value) {
|
|
433
|
+
M.value = !1;
|
|
427
434
|
return;
|
|
428
435
|
}
|
|
429
|
-
|
|
436
|
+
P.value = !0, H("input", a.getContent());
|
|
430
437
|
}), a.on("paste", (n) => {
|
|
431
438
|
var l, s;
|
|
432
439
|
const r = ((l = n.clipboardData) == null ? void 0 : l.files) || [];
|
|
433
440
|
for (let u of r) {
|
|
434
|
-
const p =
|
|
441
|
+
const p = X(u.name) || "";
|
|
435
442
|
(s = d.value.allowedType) != null && s.includes(p.toLowerCase()) || n.preventDefault();
|
|
436
443
|
}
|
|
444
|
+
}), a.on("drop", () => {
|
|
445
|
+
_();
|
|
437
446
|
}), (o = m.initComplete) == null || o.call(m, { editorIns: a }), b.value = a);
|
|
438
447
|
});
|
|
439
|
-
}),
|
|
448
|
+
}), be(() => {
|
|
440
449
|
var e;
|
|
441
450
|
(e = b.value) == null || e.destroy();
|
|
442
451
|
});
|
|
443
|
-
const
|
|
444
|
-
var
|
|
452
|
+
const le = () => {
|
|
453
|
+
var t, i;
|
|
445
454
|
const e = { ...v.value.additionalData || {} };
|
|
446
|
-
return ((
|
|
447
|
-
},
|
|
448
|
-
var
|
|
455
|
+
return ((i = (t = g.value) == null ? void 0 : t.data) == null ? void 0 : i.call(t, { ...e, extParameters: m.extParameters })) || {};
|
|
456
|
+
}, re = () => {
|
|
457
|
+
var t, i;
|
|
449
458
|
const e = { ...v.value.additionalData || {} };
|
|
450
|
-
return ((
|
|
451
|
-
},
|
|
459
|
+
return ((i = (t = g.value) == null ? void 0 : t.headers) == null ? void 0 : i.call(t, { ...e, extParameters: m.extParameters })) || {};
|
|
460
|
+
}, se = (e, t, i) => {
|
|
452
461
|
var o, n;
|
|
453
462
|
const a = (n = (o = g == null ? void 0 : g.value) == null ? void 0 : o.handlerResponse) == null ? void 0 : n.call(o, e);
|
|
454
|
-
a != null && a.url ?
|
|
455
|
-
},
|
|
463
|
+
a != null && a.url ? i[i.length - 1].url = a.url : a != null && a.errorMessage && (y.error(a.errorMessage), i.splice(i.length - 1, 1)), v.value.formData.file = i;
|
|
464
|
+
}, ue = (e, t) => new Promise((i, a) => {
|
|
456
465
|
var n, r, l, s, u, p;
|
|
457
466
|
const o = e.name.split(".").filter(Boolean).pop() ? e.name.split(".").filter(Boolean).pop() : "";
|
|
458
467
|
if (!((r = (n = g.value) == null ? void 0 : n.allowedType) != null && r.includes(o.toLowerCase()))) {
|
|
@@ -463,24 +472,24 @@ const da = /* @__PURE__ */ he({
|
|
|
463
472
|
y.error(`请上传${((p = g.value) == null ? void 0 : p.maxSize) || 0}M内的音频`), a();
|
|
464
473
|
return;
|
|
465
474
|
}
|
|
466
|
-
v.value.additionalData = { file: e },
|
|
467
|
-
}),
|
|
468
|
-
v.value.formData.file =
|
|
469
|
-
},
|
|
470
|
-
y.error("上传发生错误,请重试!"), v.value.formData.file =
|
|
471
|
-
}, me = () => {
|
|
472
|
-
var i, t;
|
|
473
|
-
const e = { ...x.value.additionalData || {} };
|
|
474
|
-
return ((t = (i = c.value) == null ? void 0 : i.data) == null ? void 0 : t.call(i, { ...e, extParameters: m.extParameters })) || {};
|
|
475
|
+
v.value.additionalData = { file: e }, i(!0);
|
|
476
|
+
}), de = (e, t) => {
|
|
477
|
+
v.value.formData.file = t;
|
|
478
|
+
}, me = (e, t, i) => {
|
|
479
|
+
y.error("上传发生错误,请重试!"), v.value.formData.file = i;
|
|
475
480
|
}, ce = () => {
|
|
476
|
-
var
|
|
481
|
+
var t, i;
|
|
482
|
+
const e = { ...x.value.additionalData || {} };
|
|
483
|
+
return ((i = (t = c.value) == null ? void 0 : t.data) == null ? void 0 : i.call(t, { ...e, extParameters: m.extParameters })) || {};
|
|
484
|
+
}, pe = () => {
|
|
485
|
+
var t, i;
|
|
477
486
|
const e = { ...x.value.additionalData || {} };
|
|
478
|
-
return ((
|
|
479
|
-
},
|
|
487
|
+
return ((i = (t = c.value) == null ? void 0 : t.headers) == null ? void 0 : i.call(t, { ...e, extParameters: m.extParameters })) || {};
|
|
488
|
+
}, ve = (e, t, i) => {
|
|
480
489
|
var o, n;
|
|
481
490
|
const a = (n = (o = c == null ? void 0 : c.value) == null ? void 0 : o.handlerResponse) == null ? void 0 : n.call(o, e);
|
|
482
|
-
a != null && a.url ?
|
|
483
|
-
},
|
|
491
|
+
a != null && a.url ? i[i.length - 1].url = a.url : a != null && a.errorMessage && (y.error(a.errorMessage), i.splice(i.length - 1, 1)), x.value.formData.file = i;
|
|
492
|
+
}, fe = (e, t) => new Promise((i, a) => {
|
|
484
493
|
var n, r, l, s, u, p;
|
|
485
494
|
const o = e.name.split(".").filter(Boolean).pop() ? e.name.split(".").filter(Boolean).pop() : "";
|
|
486
495
|
if (!((r = (n = c == null ? void 0 : c.value) == null ? void 0 : n.allowedType) != null && r.includes(o.toLowerCase()))) {
|
|
@@ -491,29 +500,29 @@ const da = /* @__PURE__ */ he({
|
|
|
491
500
|
y.error(`请上传${((p = c == null ? void 0 : c.value) == null ? void 0 : p.maxSize) || 0}M内的视频`), a();
|
|
492
501
|
return;
|
|
493
502
|
}
|
|
494
|
-
x.value.additionalData = { file: e },
|
|
495
|
-
}),
|
|
496
|
-
x.value.formData.file =
|
|
497
|
-
},
|
|
498
|
-
y.error("上传发生错误,请重试!"), x.value.formData.file =
|
|
503
|
+
x.value.additionalData = { file: e }, i(!0);
|
|
504
|
+
}), ge = (e, t) => {
|
|
505
|
+
x.value.formData.file = t;
|
|
506
|
+
}, he = (e, t, i) => {
|
|
507
|
+
y.error("上传发生错误,请重试!"), x.value.formData.file = i;
|
|
499
508
|
};
|
|
500
509
|
return I(() => [m.disabled, b.value], () => {
|
|
501
|
-
var e,
|
|
502
|
-
(
|
|
510
|
+
var e, t;
|
|
511
|
+
(t = (e = b.value) == null ? void 0 : e.mode) == null || t.set(m.disabled ? "readonly" : "design");
|
|
503
512
|
}, { immediate: !0 }), I(
|
|
504
513
|
() => [m.value, b.value],
|
|
505
514
|
() => {
|
|
506
515
|
var e;
|
|
507
|
-
if (
|
|
508
|
-
|
|
516
|
+
if (P.value) {
|
|
517
|
+
P.value = !1;
|
|
509
518
|
return;
|
|
510
519
|
}
|
|
511
|
-
|
|
520
|
+
M.value = !0, (e = b.value) == null || e.setContent(m.value ? m.value : "");
|
|
512
521
|
},
|
|
513
522
|
{ immediate: !0 }
|
|
514
|
-
), { __sfc: !0, defaultImageUploadOptions:
|
|
523
|
+
), { __sfc: !0, defaultImageUploadOptions: V, defaultVideoUploadOptions: B, defaultAudioUploadOptions: R, props: m, emits: H, insRef: W, editorRef: b, preventSettingContent: P, preventUpdatingModelValue: M, uploadLoadingConfig: f, mergeImageUploadOptions: d, mergeVideoUploadOptions: c, mergeAudioUploadOptions: g, mergeImgPondOptions: z, imgPondAccept: ee, uploadImageImgPondRef: S, audioImageImgPondRef: U, uploadImage: T, uploadImageFormRef: $, onUploadImageClose: E, onUploadImageConfirm: ae, uploadAudio: v, uploadAudioFormRef: j, onUploadAudioClose: q, onUploadAudioConfirm: oe, uploadVideo: x, uploadVideoFormRef: N, onUploadVideoClose: F, onUploadVideoConfirm: te, onImageUploadUploadExceed: ie, onImageUploadUpload: ne, processPastedImage: L, removeNotification: _, getUploadAudioData: le, getUploadAudioHeaders: re, onUploadAudioSuccess: se, onUploadAudioBeforeUpload: ue, onUploadAudioRemove: de, onUploadAudioError: me, getUploadVideoData: ce, getUploadVideoHeaders: pe, onUploadVideoSuccess: ve, onUploadVideoBeforeUpload: fe, onUploadVideoRemove: ge, onUploadVideoError: he, ImgPond: Ce };
|
|
515
524
|
}
|
|
516
525
|
});
|
|
517
526
|
export {
|
|
518
|
-
|
|
527
|
+
ma as default
|
|
519
528
|
};
|
package/package.json
CHANGED