@keyblade/tinymce-editor-vue2 1.2.6 → 1.2.8
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 +122 -110
- package/package.json +3 -3
package/es/editor.vue2.js
CHANGED
|
@@ -2,32 +2,32 @@ var Be = Object.defineProperty, Ve = Object.defineProperties;
|
|
|
2
2
|
var je = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var ue = Object.getOwnPropertySymbols;
|
|
4
4
|
var Re = Object.prototype.hasOwnProperty, He = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var ce = (c,
|
|
6
|
-
var me = (c,
|
|
7
|
-
for (var l in
|
|
8
|
-
Re.call(
|
|
5
|
+
var ce = (c, r) => (r = Symbol[c]) ? r : /* @__PURE__ */ Symbol.for("Symbol." + c);
|
|
6
|
+
var me = (c, r, l) => r in c ? Be(c, r, { enumerable: !0, configurable: !0, writable: !0, value: l }) : c[r] = l, _ = (c, r) => {
|
|
7
|
+
for (var l in r || (r = {}))
|
|
8
|
+
Re.call(r, l) && me(c, l, r[l]);
|
|
9
9
|
if (ue)
|
|
10
|
-
for (var l of ue(
|
|
11
|
-
He.call(
|
|
10
|
+
for (var l of ue(r))
|
|
11
|
+
He.call(r, l) && me(c, l, r[l]);
|
|
12
12
|
return c;
|
|
13
|
-
}, B = (c,
|
|
14
|
-
var W = (c,
|
|
15
|
-
var I = (
|
|
13
|
+
}, B = (c, r) => Ve(c, je(r));
|
|
14
|
+
var W = (c, r, l) => new Promise((z, S) => {
|
|
15
|
+
var I = (f) => {
|
|
16
16
|
try {
|
|
17
|
-
m(l.next(
|
|
18
|
-
} catch (
|
|
19
|
-
S(
|
|
17
|
+
m(l.next(f));
|
|
18
|
+
} catch (w) {
|
|
19
|
+
S(w);
|
|
20
20
|
}
|
|
21
|
-
}, V = (
|
|
21
|
+
}, V = (f) => {
|
|
22
22
|
try {
|
|
23
|
-
m(l.throw(
|
|
24
|
-
} catch (
|
|
25
|
-
S(
|
|
23
|
+
m(l.throw(f));
|
|
24
|
+
} catch (w) {
|
|
25
|
+
S(w);
|
|
26
26
|
}
|
|
27
|
-
}, m = (
|
|
28
|
-
m((l = l.apply(c,
|
|
27
|
+
}, m = (f) => f.done ? z(f.value) : Promise.resolve(f.value).then(I, V);
|
|
28
|
+
m((l = l.apply(c, r)).next());
|
|
29
29
|
});
|
|
30
|
-
var G = (c,
|
|
30
|
+
var G = (c, r, l) => (r = c[ce("asyncIterator")]) ? r.call(c) : (c = c[ce("iterator")](), r = {}, l = (z, S) => (S = c[z]) && (r[z] = (I) => new Promise((V, m, f) => (I = S.call(c, I), f = I.done, Promise.resolve(I.value).then((w) => V({ value: w, done: f }), m)))), l("next"), l("return"), r);
|
|
31
31
|
import { defineComponent as $e, ref as A, computed as X, onMounted as qe, onUnmounted as Fe, watch as de } from "vue";
|
|
32
32
|
import { oneTravelImageCheckAndTransform as We, oneTravelImageCompressor as Ee, blobToFile as Ne, getImagePixel as Le, getFileExtension as Ge } from "@keyblade/one-travel";
|
|
33
33
|
/* empty css */
|
|
@@ -80,7 +80,7 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
80
80
|
initComplete: null
|
|
81
81
|
},
|
|
82
82
|
emits: ["input"],
|
|
83
|
-
setup(c, { emit:
|
|
83
|
+
setup(c, { emit: r }) {
|
|
84
84
|
const l = c;
|
|
85
85
|
pe.addI18n("zh_CN", Xe);
|
|
86
86
|
const z = {
|
|
@@ -105,10 +105,10 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
105
105
|
maxSize: 200,
|
|
106
106
|
allowedType: ["wav", "mp3", "mp4", "m4a", "wma", "aac"],
|
|
107
107
|
accept: ".wav,.mp3,.mp4,.m4a,.wma,.aac"
|
|
108
|
-
}, V = A(), m = A(),
|
|
108
|
+
}, V = A(), m = A(), f = A(!1), w = A(!1), H = A({
|
|
109
109
|
show: !1,
|
|
110
110
|
text: "图片上传中,请稍等"
|
|
111
|
-
}), p = X(() => E([l.imageUploadOptions, N.imageUploadOptions, z]) || {}), u = X(() => E([l.videoUploadOptions, N.videoUploadOptions, S]) || {}),
|
|
111
|
+
}), p = X(() => E([l.imageUploadOptions, N.imageUploadOptions, z]) || {}), u = X(() => E([l.videoUploadOptions, N.videoUploadOptions, S]) || {}), g = X(() => E([l.audioUploadOptions, N.audioUploadOptions, I]) || {}), $ = A({
|
|
112
112
|
dialogVisible: !1,
|
|
113
113
|
formData: {
|
|
114
114
|
images: []
|
|
@@ -125,7 +125,7 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
125
125
|
(n = m.value) == null || n.insertContent(`<img src=${a == null ? void 0 : a.url} alt="" />`);
|
|
126
126
|
}), K());
|
|
127
127
|
});
|
|
128
|
-
},
|
|
128
|
+
}, y = A({
|
|
129
129
|
dialogVisible: !1,
|
|
130
130
|
formData: {
|
|
131
131
|
// 名称
|
|
@@ -138,18 +138,18 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
138
138
|
// 用于临时保存上传前的参数 { file: File }
|
|
139
139
|
additionalData: {}
|
|
140
140
|
}), Q = A(), Y = () => {
|
|
141
|
-
|
|
141
|
+
y.value.dialogVisible = !1, y.value.formData = {
|
|
142
142
|
name: "",
|
|
143
143
|
cover: [],
|
|
144
144
|
file: []
|
|
145
|
-
},
|
|
145
|
+
}, y.value.additionalData = {}, j.value = void 0;
|
|
146
146
|
}, ve = () => {
|
|
147
147
|
var o;
|
|
148
148
|
(o = Q.value) == null || o.validate((e) => {
|
|
149
149
|
var a, n, i;
|
|
150
|
-
e && ((i = m.value) == null || i.insertContent(`<audio controls controlslist="nodownload noplaybackrate" data-name="${
|
|
150
|
+
e && ((i = m.value) == null || i.insertContent(`<audio controls controlslist="nodownload noplaybackrate" data-name="${y.value.formData.name}" data-poster="${(a = y.value.formData.cover[0]) == null ? void 0 : a.url}" src="${(n = y.value.formData.file[0]) == null ? void 0 : n.url}"></audio>`), Y());
|
|
151
151
|
});
|
|
152
|
-
},
|
|
152
|
+
}, k = A({
|
|
153
153
|
dialogVisible: !1,
|
|
154
154
|
formData: {
|
|
155
155
|
// 文件
|
|
@@ -158,21 +158,21 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
158
158
|
// 用于临时保存上传前的参数 { file: File }
|
|
159
159
|
additionalData: {}
|
|
160
160
|
}), Z = A(), ee = () => {
|
|
161
|
-
|
|
161
|
+
k.value.dialogVisible = !1, k.value.formData = {
|
|
162
162
|
file: []
|
|
163
|
-
},
|
|
163
|
+
}, k.value.additionalData = {};
|
|
164
164
|
}, ge = () => {
|
|
165
165
|
var o;
|
|
166
166
|
(o = Z.value) == null || o.validate((e) => {
|
|
167
167
|
var a, n;
|
|
168
|
-
e && ((n = m.value) == null || n.insertContent(`<video width="auto" height="auto" controls src="${(a =
|
|
168
|
+
e && ((n = m.value) == null || n.insertContent(`<video width="auto" height="auto" controls src="${(a = k.value.formData.file[0]) == null ? void 0 : a.url}"></video>`), ee());
|
|
169
169
|
});
|
|
170
170
|
};
|
|
171
171
|
function ae(o) {
|
|
172
172
|
return W(this, null, function* () {
|
|
173
|
-
var
|
|
173
|
+
var s, d, D, v, h, U, P, q, F;
|
|
174
174
|
let e = o;
|
|
175
|
-
if (!((
|
|
175
|
+
if (!((s = p.value) != null && s.handleRequest)) {
|
|
176
176
|
b.error("缺少图片上传配置");
|
|
177
177
|
return;
|
|
178
178
|
}
|
|
@@ -183,11 +183,11 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
183
183
|
}
|
|
184
184
|
const n = yield We(e, a, {
|
|
185
185
|
imageMaxSize: (d = p.value.checkOptions) == null ? void 0 : d.maxSize,
|
|
186
|
-
imageAllowedType: (
|
|
186
|
+
imageAllowedType: (D = p.value.checkOptions) == null ? void 0 : D.allowedType,
|
|
187
187
|
// imageAllowedMineType: mergeImageUploadOptions.value.allowedMineType,
|
|
188
|
-
imageMinWidth: (
|
|
188
|
+
imageMinWidth: (v = p.value.checkOptions) == null ? void 0 : v.minWidth,
|
|
189
189
|
imageMinHeight: (h = p.value.checkOptions) == null ? void 0 : h.minHeight,
|
|
190
|
-
imageMaxWidth: (
|
|
190
|
+
imageMaxWidth: (U = p.value.checkOptions) == null ? void 0 : U.maxWidth,
|
|
191
191
|
imageMaxHeight: (P = p.value.checkOptions) == null ? void 0 : P.maxHeight
|
|
192
192
|
});
|
|
193
193
|
if (!n.success) {
|
|
@@ -213,7 +213,7 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
213
213
|
});
|
|
214
214
|
}
|
|
215
215
|
const L = (o) => W(null, null, function* () {
|
|
216
|
-
var t,
|
|
216
|
+
var t, s, d, D, v, h, U, P, q, F, le, ne, re;
|
|
217
217
|
const e = m.value, a = o.types;
|
|
218
218
|
if (a.includes("text/html")) {
|
|
219
219
|
const T = o.getData("text/html"), R = new DOMParser().parseFromString(T, "text/html"), se = Array.from(R.body.querySelectorAll("img")), Te = Array.from(R.body.querySelectorAll("audio")), ze = Array.from(R.body.querySelectorAll("video"));
|
|
@@ -221,21 +221,21 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
221
221
|
show: !0,
|
|
222
222
|
text: "图片加载中,请稍等"
|
|
223
223
|
});
|
|
224
|
-
for (const
|
|
225
|
-
|
|
224
|
+
for (const C of [...Te, ...ze])
|
|
225
|
+
C == null || C.remove();
|
|
226
226
|
try {
|
|
227
227
|
for (var ie = G([...se]), Ke, qa, Fa; Ke = !(qa = yield ie.next()).done; Ke = !1) {
|
|
228
|
-
const
|
|
229
|
-
if (
|
|
228
|
+
const C = qa.value;
|
|
229
|
+
if (C.removeAttribute("crossorigin"), C.src.startsWith("http"))
|
|
230
230
|
if ((t = p.value) != null && t.handleRequestByUrl) {
|
|
231
|
-
const x = yield (
|
|
232
|
-
x != null && x.success && (x != null && x.url) ?
|
|
231
|
+
const x = yield (s = p.value) == null ? void 0 : s.handleRequestByUrl(C.src, { extParameters: l.extParameters });
|
|
232
|
+
x != null && x.success && (x != null && x.url) ? C.src = x == null ? void 0 : x.url : C.remove();
|
|
233
233
|
} else {
|
|
234
|
-
const x = yield Le(
|
|
235
|
-
x && (x.width < (((
|
|
234
|
+
const x = yield Le(C.src);
|
|
235
|
+
x && (x.width < (((D = (d = p.value) == null ? void 0 : d.checkOptions) == null ? void 0 : D.minWidth) || 0) && x.height < (((h = (v = p.value) == null ? void 0 : v.checkOptions) == null ? void 0 : h.minHeight) || 0) || x.width > (((P = (U = p.value) == null ? void 0 : U.checkOptions) == null ? void 0 : P.maxWidth) || 0) && x.height > (((F = (q = p.value) == null ? void 0 : q.checkOptions) == null ? void 0 : F.maxHeight) || 0)) && C.remove();
|
|
236
236
|
}
|
|
237
237
|
else
|
|
238
|
-
|
|
238
|
+
C.remove(), b.error("不支持Word中批量复制图片或视频,请改为单个复制,或者从工具栏中手动插入上传");
|
|
239
239
|
}
|
|
240
240
|
} catch (qa) {
|
|
241
241
|
Fa = [qa];
|
|
@@ -284,7 +284,7 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
284
284
|
}
|
|
285
285
|
H.value.show = !1;
|
|
286
286
|
}
|
|
287
|
-
|
|
287
|
+
r("input", e.getContent());
|
|
288
288
|
}), oe = (o) => {
|
|
289
289
|
var a;
|
|
290
290
|
o.preventDefault();
|
|
@@ -382,48 +382,48 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
382
382
|
paste_data_images: !1,
|
|
383
383
|
images_file_types: ((i = (n = (a = p.value) == null ? void 0 : a.checkOptions) == null ? void 0 : n.allowedType) == null ? void 0 : i.join(",")) || "jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp",
|
|
384
384
|
// 粘贴前处理
|
|
385
|
-
paste_preprocess(t,
|
|
386
|
-
|
|
385
|
+
paste_preprocess(t, s) {
|
|
386
|
+
s == null || s.preventDefault();
|
|
387
387
|
},
|
|
388
388
|
setup(t) {
|
|
389
|
-
var d,
|
|
390
|
-
const
|
|
389
|
+
var d, D;
|
|
390
|
+
const s = () => {
|
|
391
391
|
$.value.dialogVisible = !0;
|
|
392
392
|
};
|
|
393
393
|
if (t.ui.registry.addMenuItem("localImage", {
|
|
394
394
|
text: "图片",
|
|
395
395
|
icon: "image",
|
|
396
|
-
onAction: () =>
|
|
396
|
+
onAction: () => s()
|
|
397
397
|
}), t.ui.registry.addButton("localImage", {
|
|
398
398
|
icon: "image",
|
|
399
399
|
tooltip: "图片",
|
|
400
|
-
onAction: () =>
|
|
401
|
-
}), (d =
|
|
402
|
-
const
|
|
403
|
-
|
|
400
|
+
onAction: () => s()
|
|
401
|
+
}), (d = g == null ? void 0 : g.value) != null && d.enable) {
|
|
402
|
+
const v = () => {
|
|
403
|
+
y.value.dialogVisible = !0;
|
|
404
404
|
};
|
|
405
405
|
t.ui.registry.addMenuItem("localAudio", {
|
|
406
406
|
text: "音频",
|
|
407
407
|
icon: "arrow-right",
|
|
408
|
-
onAction: () =>
|
|
408
|
+
onAction: () => v()
|
|
409
409
|
}), t.ui.registry.addButton("localAudio", {
|
|
410
410
|
icon: "arrow-right",
|
|
411
411
|
tooltip: "音频",
|
|
412
|
-
onAction: () =>
|
|
412
|
+
onAction: () => v()
|
|
413
413
|
});
|
|
414
414
|
}
|
|
415
|
-
if ((
|
|
416
|
-
const
|
|
417
|
-
|
|
415
|
+
if ((D = u == null ? void 0 : u.value) != null && D.enable) {
|
|
416
|
+
const v = () => {
|
|
417
|
+
k.value.dialogVisible = !0;
|
|
418
418
|
};
|
|
419
419
|
t.ui.registry.addMenuItem("localVideo", {
|
|
420
420
|
text: "视频",
|
|
421
421
|
icon: "embed",
|
|
422
|
-
onAction: () =>
|
|
422
|
+
onAction: () => v()
|
|
423
423
|
}), t.ui.registry.addButton("localVideo", {
|
|
424
424
|
icon: "embed",
|
|
425
425
|
tooltip: "视频",
|
|
426
|
-
onAction: () =>
|
|
426
|
+
onAction: () => v()
|
|
427
427
|
});
|
|
428
428
|
}
|
|
429
429
|
}
|
|
@@ -433,26 +433,38 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
433
433
|
o
|
|
434
434
|
], {
|
|
435
435
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
436
|
-
mergeFunction: (t,
|
|
437
|
-
t(...d),
|
|
436
|
+
mergeFunction: (t, s) => (...d) => {
|
|
437
|
+
t(...d), s(...d);
|
|
438
438
|
},
|
|
439
439
|
type: Object
|
|
440
440
|
});
|
|
441
441
|
pe.init(e).then(([t]) => {
|
|
442
|
-
var
|
|
443
|
-
t && (t.customProps =
|
|
444
|
-
if (
|
|
445
|
-
|
|
442
|
+
var s;
|
|
443
|
+
t && (t.customProps = _({}, l), t.on("input", () => {
|
|
444
|
+
if (w.value) {
|
|
445
|
+
w.value = !1;
|
|
446
446
|
return;
|
|
447
447
|
}
|
|
448
|
-
|
|
448
|
+
f.value = !0, r("input", t.getContent());
|
|
449
|
+
}), t.on("undo", function() {
|
|
450
|
+
if (w.value) {
|
|
451
|
+
w.value = !1;
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
f.value = !0, r("input", t.getContent());
|
|
455
|
+
}), t.on("redo", function() {
|
|
456
|
+
if (w.value) {
|
|
457
|
+
w.value = !1;
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
f.value = !0, r("input", t.getContent());
|
|
449
461
|
}), t.on("change", () => {
|
|
450
|
-
|
|
462
|
+
r("input", t.getContent());
|
|
451
463
|
}), t.on("paste", (d) => {
|
|
452
464
|
oe(d);
|
|
453
465
|
}), t.on("drop", (d) => {
|
|
454
466
|
te(d);
|
|
455
|
-
}), (
|
|
467
|
+
}), (s = l.initComplete) == null || s.call(l, { editorIns: t }), m.value = t);
|
|
456
468
|
});
|
|
457
469
|
}), Fe(() => {
|
|
458
470
|
var o, e, a, n;
|
|
@@ -460,73 +472,73 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
460
472
|
});
|
|
461
473
|
const he = () => {
|
|
462
474
|
var e, a;
|
|
463
|
-
const o =
|
|
464
|
-
return ((a = (e = p.value) == null ? void 0 : e.data) == null ? void 0 : a.call(e, B(
|
|
475
|
+
const o = _({}, j.value || {});
|
|
476
|
+
return ((a = (e = p.value) == null ? void 0 : e.data) == null ? void 0 : a.call(e, B(_({}, o), { extParameters: l.extParameters }))) || {};
|
|
465
477
|
}, xe = () => {
|
|
466
478
|
var e, a;
|
|
467
|
-
const o =
|
|
468
|
-
return ((a = (e = p.value) == null ? void 0 : e.headers) == null ? void 0 : a.call(e, B(
|
|
479
|
+
const o = _({}, j.value || {});
|
|
480
|
+
return ((a = (e = p.value) == null ? void 0 : e.headers) == null ? void 0 : a.call(e, B(_({}, o), { extParameters: l.extParameters }))) || {};
|
|
469
481
|
}, be = (o, e, a) => {
|
|
470
482
|
a === Je.all && (j.value = { file: o });
|
|
471
483
|
}, we = () => {
|
|
472
484
|
var e, a;
|
|
473
|
-
const o =
|
|
474
|
-
return ((a = (e =
|
|
485
|
+
const o = _({}, y.value.additionalData || {});
|
|
486
|
+
return ((a = (e = g.value) == null ? void 0 : e.data) == null ? void 0 : a.call(e, B(_({}, o), { extParameters: l.extParameters }))) || {};
|
|
475
487
|
}, ye = () => {
|
|
476
488
|
var e, a;
|
|
477
|
-
const o =
|
|
478
|
-
return ((a = (e =
|
|
489
|
+
const o = _({}, y.value.additionalData || {});
|
|
490
|
+
return ((a = (e = g.value) == null ? void 0 : e.headers) == null ? void 0 : a.call(e, B(_({}, o), { extParameters: l.extParameters }))) || {};
|
|
479
491
|
}, De = (o, e, a) => W(null, null, function* () {
|
|
480
|
-
var t,
|
|
481
|
-
const n = (
|
|
492
|
+
var t, s;
|
|
493
|
+
const n = (s = (t = g == null ? void 0 : g.value) == null ? void 0 : t.handlerResponse) == null ? void 0 : s.call(t, o);
|
|
482
494
|
let i;
|
|
483
|
-
n instanceof Promise ? i = yield n : i = n, i != null && i.url ? a[a.length - 1].url = i.url : i != null && i.errorMessage && (b.error(i.errorMessage), a.splice(a.length - 1, 1)),
|
|
495
|
+
n instanceof Promise ? i = yield n : i = n, i != null && i.url ? a[a.length - 1].url = i.url : i != null && i.errorMessage && (b.error(i.errorMessage), a.splice(a.length - 1, 1)), y.value.formData.file = a;
|
|
484
496
|
}), _e = (o) => new Promise((e, a) => {
|
|
485
|
-
var i, t,
|
|
497
|
+
var i, t, s, d, D, v, h, U;
|
|
486
498
|
const n = o.name.split(".").filter(Boolean).pop() ? o.name.split(".").filter(Boolean).pop() : "";
|
|
487
|
-
if (!((t = (i =
|
|
488
|
-
b.error(`请上传格式为${(d = (
|
|
499
|
+
if (!((t = (i = g.value) == null ? void 0 : i.allowedType) != null && t.includes(n.toLowerCase()))) {
|
|
500
|
+
b.error(`请上传格式为${(d = (s = g.value) == null ? void 0 : s.allowedType) == null ? void 0 : d.map((P) => P.toUpperCase()).join("、")}的音频`), a();
|
|
489
501
|
return;
|
|
490
502
|
}
|
|
491
|
-
if (o.size > (((
|
|
492
|
-
b.error(`请上传${((
|
|
503
|
+
if (o.size > (((D = g.value) == null ? void 0 : D.maxSize) || 0) * 1024 * 1024) {
|
|
504
|
+
b.error(`请上传${((v = g.value) == null ? void 0 : v.maxSize) || 0}M内的音频`), a();
|
|
493
505
|
return;
|
|
494
506
|
}
|
|
495
|
-
|
|
507
|
+
y.value.additionalData = { file: o }, (U = (h = g == null ? void 0 : g.value) == null ? void 0 : h.beforeUploadEnd) == null || U.call(h, o), e(!0);
|
|
496
508
|
}), ke = (o, e) => {
|
|
497
|
-
|
|
498
|
-
},
|
|
499
|
-
b.error("上传发生错误,请重试!"),
|
|
500
|
-
},
|
|
509
|
+
y.value.formData.file = e;
|
|
510
|
+
}, Ce = (o, e, a) => {
|
|
511
|
+
b.error("上传发生错误,请重试!"), y.value.formData.file = a;
|
|
512
|
+
}, Ae = () => {
|
|
501
513
|
var e, a;
|
|
502
|
-
const o =
|
|
503
|
-
return ((a = (e = u.value) == null ? void 0 : e.data) == null ? void 0 : a.call(e, B(
|
|
514
|
+
const o = _({}, k.value.additionalData || {});
|
|
515
|
+
return ((a = (e = u.value) == null ? void 0 : e.data) == null ? void 0 : a.call(e, B(_({}, o), { extParameters: l.extParameters }))) || {};
|
|
504
516
|
}, Ue = () => {
|
|
505
517
|
var e, a;
|
|
506
|
-
const o =
|
|
507
|
-
return ((a = (e = u.value) == null ? void 0 : e.headers) == null ? void 0 : a.call(e, B(
|
|
518
|
+
const o = _({}, k.value.additionalData || {});
|
|
519
|
+
return ((a = (e = u.value) == null ? void 0 : e.headers) == null ? void 0 : a.call(e, B(_({}, o), { extParameters: l.extParameters }))) || {};
|
|
508
520
|
}, Ie = (o, e, a) => W(null, null, function* () {
|
|
509
|
-
var t,
|
|
521
|
+
var t, s;
|
|
510
522
|
debugger;
|
|
511
|
-
const n = (
|
|
523
|
+
const n = (s = (t = u == null ? void 0 : u.value) == null ? void 0 : t.handlerResponse) == null ? void 0 : s.call(t, o);
|
|
512
524
|
let i;
|
|
513
|
-
n instanceof Promise ? i = yield n : i = n, i != null && i.url ? a[a.length - 1].url = i.url : i != null && i.errorMessage && (b.error(i.errorMessage), a.splice(a.length - 1, 1)),
|
|
525
|
+
n instanceof Promise ? i = yield n : i = n, i != null && i.url ? a[a.length - 1].url = i.url : i != null && i.errorMessage && (b.error(i.errorMessage), a.splice(a.length - 1, 1)), k.value.formData.file = a;
|
|
514
526
|
}), Pe = (o) => new Promise((e, a) => {
|
|
515
|
-
var i, t,
|
|
527
|
+
var i, t, s, d, D, v, h, U;
|
|
516
528
|
const n = o.name.split(".").filter(Boolean).pop() ? o.name.split(".").filter(Boolean).pop() : "";
|
|
517
529
|
if (!((t = (i = u == null ? void 0 : u.value) == null ? void 0 : i.allowedType) != null && t.includes(n.toLowerCase()))) {
|
|
518
|
-
b.error(`请上传格式为${(d = (
|
|
530
|
+
b.error(`请上传格式为${(d = (s = u == null ? void 0 : u.value) == null ? void 0 : s.allowedType) == null ? void 0 : d.map((P) => P.toUpperCase()).join("、")}的视频`), a();
|
|
519
531
|
return;
|
|
520
532
|
}
|
|
521
|
-
if (o.size > (((
|
|
522
|
-
b.error(`请上传${((
|
|
533
|
+
if (o.size > (((D = u == null ? void 0 : u.value) == null ? void 0 : D.maxSize) || 0) * 1024 * 1024) {
|
|
534
|
+
b.error(`请上传${((v = u == null ? void 0 : u.value) == null ? void 0 : v.maxSize) || 0}M内的视频`), a();
|
|
523
535
|
return;
|
|
524
536
|
}
|
|
525
|
-
|
|
537
|
+
k.value.additionalData = { file: o }, (U = (h = u == null ? void 0 : u.value) == null ? void 0 : h.beforeUploadEnd) == null || U.call(h, o), e(!0);
|
|
526
538
|
}), Me = (o, e) => {
|
|
527
|
-
|
|
539
|
+
k.value.formData.file = e;
|
|
528
540
|
}, Se = (o, e, a) => {
|
|
529
|
-
b.error("上传发生错误,请重试!"),
|
|
541
|
+
b.error("上传发生错误,请重试!"), k.value.formData.file = a;
|
|
530
542
|
};
|
|
531
543
|
return de(() => [l.disabled, m.value], () => {
|
|
532
544
|
var o, e;
|
|
@@ -535,14 +547,14 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
535
547
|
() => [l.value, m.value],
|
|
536
548
|
() => {
|
|
537
549
|
var o, e, a, n;
|
|
538
|
-
if (
|
|
539
|
-
|
|
550
|
+
if (f.value) {
|
|
551
|
+
f.value = !1;
|
|
540
552
|
return;
|
|
541
553
|
}
|
|
542
|
-
|
|
554
|
+
w.value = !0, (o = m.value) == null || o.setContent(l.value ? l.value : ""), (a = m.value) == null || a.selection.select((e = m.value) == null ? void 0 : e.getBody(), !0), (n = m.value) == null || n.selection.collapse(!1);
|
|
543
555
|
},
|
|
544
556
|
{ immediate: !0 }
|
|
545
|
-
), { __sfc: !0, defaultImageUploadOptions: z, defaultVideoUploadOptions: S, defaultAudioUploadOptions: I, props: l, emits:
|
|
557
|
+
), { __sfc: !0, defaultImageUploadOptions: z, defaultVideoUploadOptions: S, defaultAudioUploadOptions: I, props: l, emits: r, insRef: V, editorRef: m, preventSettingContent: f, preventUpdatingModelValue: w, uploadLoadingConfig: H, mergeImageUploadOptions: p, mergeVideoUploadOptions: u, mergeAudioUploadOptions: g, uploadImage: $, uploadImageAdditionalData: j, uploadImageFormRef: J, onUploadImageClose: K, onUploadImageConfirm: fe, uploadAudio: y, uploadAudioFormRef: Q, onUploadAudioClose: Y, onUploadAudioConfirm: ve, uploadVideo: k, 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: Ce, getUploadVideoData: Ae, getUploadVideoHeaders: Ue, onUploadVideoSuccess: Ie, onUploadVideoBeforeUpload: Pe, onUploadVideoRemove: Me, onUploadVideoError: Se };
|
|
546
558
|
}
|
|
547
559
|
});
|
|
548
560
|
export {
|
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.8",
|
|
6
6
|
"private": false,
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "es/index.js",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"vue-global-config": "^0.2.6",
|
|
24
24
|
"tinymce": "^7.1.0",
|
|
25
25
|
"element-ui": "^2.15.14",
|
|
26
|
-
"@keyblade/one-travel": "^3.0.
|
|
26
|
+
"@keyblade/one-travel": "^3.0.5"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"vue": "^2.7.0",
|
|
30
|
-
"@keyblade/pro-components-vue2": "^1.14.
|
|
30
|
+
"@keyblade/pro-components-vue2": "^1.14.7"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "vite build",
|