@keyblade/tinymce-editor-vue2 1.2.5 → 1.2.6
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 +95 -95
- package/package.json +2 -2
package/es/editor.vue2.js
CHANGED
|
@@ -2,36 +2,36 @@ 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, s) => (s = Symbol[c]) ? s : Symbol.for("Symbol." + c);
|
|
6
|
-
var me = (c, s,
|
|
7
|
-
for (var
|
|
8
|
-
Re.call(s,
|
|
5
|
+
var ce = (c, s) => (s = Symbol[c]) ? s : /* @__PURE__ */ Symbol.for("Symbol." + c);
|
|
6
|
+
var me = (c, s, l) => s in c ? Be(c, s, { enumerable: !0, configurable: !0, writable: !0, value: l }) : c[s] = l, D = (c, s) => {
|
|
7
|
+
for (var l in s || (s = {}))
|
|
8
|
+
Re.call(s, l) && me(c, l, s[l]);
|
|
9
9
|
if (ue)
|
|
10
|
-
for (var
|
|
11
|
-
He.call(s,
|
|
10
|
+
for (var l of ue(s))
|
|
11
|
+
He.call(s, l) && me(c, l, s[l]);
|
|
12
12
|
return c;
|
|
13
|
-
},
|
|
14
|
-
var
|
|
13
|
+
}, B = (c, s) => Ve(c, je(s));
|
|
14
|
+
var W = (c, s, l) => new Promise((z, S) => {
|
|
15
15
|
var I = (g) => {
|
|
16
16
|
try {
|
|
17
|
-
m(
|
|
17
|
+
m(l.next(g));
|
|
18
18
|
} catch (U) {
|
|
19
19
|
S(U);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, V = (g) => {
|
|
22
22
|
try {
|
|
23
|
-
m(
|
|
23
|
+
m(l.throw(g));
|
|
24
24
|
} catch (U) {
|
|
25
25
|
S(U);
|
|
26
26
|
}
|
|
27
|
-
}, m = (g) => g.done ? z(g.value) : Promise.resolve(g.value).then(I,
|
|
28
|
-
m((
|
|
27
|
+
}, m = (g) => g.done ? z(g.value) : Promise.resolve(g.value).then(I, V);
|
|
28
|
+
m((l = l.apply(c, s)).next());
|
|
29
29
|
});
|
|
30
|
-
var G = (c, s,
|
|
31
|
-
import { defineComponent as $e, ref as A, computed as X, onMounted as
|
|
32
|
-
import { oneTravelImageCheckAndTransform as
|
|
30
|
+
var G = (c, s, l) => (s = c[ce("asyncIterator")]) ? s.call(c) : (c = c[ce("iterator")](), s = {}, l = (z, S) => (S = c[z]) && (s[z] = (I) => new Promise((V, m, g) => (I = S.call(c, I), g = I.done, Promise.resolve(I.value).then((U) => V({ value: U, done: g }), m)))), l("next"), l("return"), s);
|
|
31
|
+
import { defineComponent as $e, ref as A, computed as X, onMounted as qe, onUnmounted as Fe, watch as de } from "vue";
|
|
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 */
|
|
34
|
-
import { conclude as
|
|
34
|
+
import { conclude as E } 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";
|
|
@@ -81,7 +81,7 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
81
81
|
},
|
|
82
82
|
emits: ["input"],
|
|
83
83
|
setup(c, { emit: s }) {
|
|
84
|
-
const
|
|
84
|
+
const l = c;
|
|
85
85
|
pe.addI18n("zh_CN", Xe);
|
|
86
86
|
const z = {
|
|
87
87
|
name: M.name,
|
|
@@ -105,22 +105,22 @@ 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
|
-
},
|
|
108
|
+
}, V = A(), m = A(), g = A(!1), U = A(!1), H = A({
|
|
109
109
|
show: !1,
|
|
110
110
|
text: "图片上传中,请稍等"
|
|
111
|
-
}), p = X(() =>
|
|
111
|
+
}), p = X(() => E([l.imageUploadOptions, N.imageUploadOptions, z]) || {}), u = X(() => E([l.videoUploadOptions, N.videoUploadOptions, S]) || {}), v = X(() => E([l.audioUploadOptions, N.audioUploadOptions, I]) || {}), $ = A({
|
|
112
112
|
dialogVisible: !1,
|
|
113
113
|
formData: {
|
|
114
114
|
images: []
|
|
115
115
|
}
|
|
116
|
-
}),
|
|
117
|
-
|
|
116
|
+
}), j = A(), J = A(), K = () => {
|
|
117
|
+
$.value.dialogVisible = !1, $.value.formData = {
|
|
118
118
|
images: []
|
|
119
|
-
},
|
|
119
|
+
}, j.value = void 0;
|
|
120
120
|
}, fe = () => {
|
|
121
121
|
var o;
|
|
122
122
|
(o = J.value) == null || o.validate((e) => {
|
|
123
|
-
e && (
|
|
123
|
+
e && ($.value.formData.images.forEach((a) => {
|
|
124
124
|
var n;
|
|
125
125
|
(n = m.value) == null || n.insertContent(`<img src=${a == null ? void 0 : a.url} alt="" />`);
|
|
126
126
|
}), K());
|
|
@@ -142,12 +142,12 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
142
142
|
name: "",
|
|
143
143
|
cover: [],
|
|
144
144
|
file: []
|
|
145
|
-
}, w.value.additionalData = {},
|
|
145
|
+
}, w.value.additionalData = {}, j.value = void 0;
|
|
146
146
|
}, ve = () => {
|
|
147
147
|
var o;
|
|
148
148
|
(o = Q.value) == null || o.validate((e) => {
|
|
149
|
-
var a, n;
|
|
150
|
-
e && ((
|
|
149
|
+
var a, n, i;
|
|
150
|
+
e && ((i = m.value) == null || i.insertContent(`<audio controls controlslist="nodownload noplaybackrate" data-name="${w.value.formData.name}" data-poster="${(a = w.value.formData.cover[0]) == null ? void 0 : a.url}" src="${(n = w.value.formData.file[0]) == null ? void 0 : n.url}"></audio>`), Y());
|
|
151
151
|
});
|
|
152
152
|
}, _ = A({
|
|
153
153
|
dialogVisible: !1,
|
|
@@ -169,8 +169,8 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
169
169
|
});
|
|
170
170
|
};
|
|
171
171
|
function ae(o) {
|
|
172
|
-
return
|
|
173
|
-
var r, d, y, f, h, C, P,
|
|
172
|
+
return W(this, null, function* () {
|
|
173
|
+
var r, d, y, f, h, C, P, q, F;
|
|
174
174
|
let e = o;
|
|
175
175
|
if (!((r = p.value) != null && r.handleRequest)) {
|
|
176
176
|
b.error("缺少图片上传配置");
|
|
@@ -181,7 +181,7 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
181
181
|
b.error("不允许粘贴");
|
|
182
182
|
return;
|
|
183
183
|
}
|
|
184
|
-
const n = yield
|
|
184
|
+
const n = yield We(e, a, {
|
|
185
185
|
imageMaxSize: (d = p.value.checkOptions) == null ? void 0 : d.maxSize,
|
|
186
186
|
imageAllowedType: (y = p.value.checkOptions) == null ? void 0 : y.allowedType,
|
|
187
187
|
// imageAllowedMineType: mergeImageUploadOptions.value.allowedMineType,
|
|
@@ -199,12 +199,12 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
199
199
|
const ie = a == null ? void 0 : a.split(".");
|
|
200
200
|
ie.pop(), a = `${ie.join(",")}.jpg`;
|
|
201
201
|
}
|
|
202
|
-
const
|
|
203
|
-
if (!
|
|
204
|
-
b.error((
|
|
202
|
+
const i = yield Ee(e);
|
|
203
|
+
if (!i.success) {
|
|
204
|
+
b.error((i == null ? void 0 : i.errorMessage) || "压缩失败");
|
|
205
205
|
return;
|
|
206
206
|
}
|
|
207
|
-
const t = yield (
|
|
207
|
+
const t = yield (F = (q = p.value).handleRequest) == null ? void 0 : F.call(q, Ne(i.file, a), a, { extParameters: l.extParameters });
|
|
208
208
|
if (!t || !t.success) {
|
|
209
209
|
b.error((t == null ? void 0 : t.errorMessage) || "");
|
|
210
210
|
return;
|
|
@@ -212,77 +212,77 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
212
212
|
return t.url;
|
|
213
213
|
});
|
|
214
214
|
}
|
|
215
|
-
const L = (o) =>
|
|
216
|
-
var t, r, d, y, f, h, C, P,
|
|
215
|
+
const L = (o) => W(null, null, function* () {
|
|
216
|
+
var t, r, d, y, f, h, C, P, q, F, le, ne, re;
|
|
217
217
|
const e = m.value, a = o.types;
|
|
218
218
|
if (a.includes("text/html")) {
|
|
219
|
-
const T = o.getData("text/html"),
|
|
220
|
-
se.length > 0 && (
|
|
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"));
|
|
220
|
+
se.length > 0 && (H.value = {
|
|
221
221
|
show: !0,
|
|
222
222
|
text: "图片加载中,请稍等"
|
|
223
223
|
});
|
|
224
224
|
for (const k of [...Te, ...ze])
|
|
225
225
|
k == null || k.remove();
|
|
226
226
|
try {
|
|
227
|
-
for (var ie = G([...se]), Ke,
|
|
228
|
-
const k =
|
|
227
|
+
for (var ie = G([...se]), Ke, qa, Fa; Ke = !(qa = yield ie.next()).done; Ke = !1) {
|
|
228
|
+
const k = qa.value;
|
|
229
229
|
if (k.removeAttribute("crossorigin"), k.src.startsWith("http"))
|
|
230
230
|
if ((t = p.value) != null && t.handleRequestByUrl) {
|
|
231
|
-
const x = yield (r = p.value) == null ? void 0 : r.handleRequestByUrl(k.src, { extParameters:
|
|
231
|
+
const x = yield (r = p.value) == null ? void 0 : r.handleRequestByUrl(k.src, { extParameters: l.extParameters });
|
|
232
232
|
x != null && x.success && (x != null && x.url) ? k.src = x == null ? void 0 : x.url : k.remove();
|
|
233
233
|
} else {
|
|
234
234
|
const x = yield Le(k.src);
|
|
235
|
-
x && (x.width < (((y = (d = p.value) == null ? void 0 : d.checkOptions) == null ? void 0 : y.minWidth) || 0) && x.height < (((h = (f = p.value) == null ? void 0 : f.checkOptions) == null ? void 0 : h.minHeight) || 0) || x.width > (((P = (C = p.value) == null ? void 0 : C.checkOptions) == null ? void 0 : P.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 < (((h = (f = p.value) == null ? void 0 : f.checkOptions) == null ? void 0 : h.minHeight) || 0) || x.width > (((P = (C = p.value) == null ? void 0 : C.checkOptions) == null ? void 0 : P.maxWidth) || 0) && x.height > (((F = (q = p.value) == null ? void 0 : q.checkOptions) == null ? void 0 : F.maxHeight) || 0)) && k.remove();
|
|
236
236
|
}
|
|
237
237
|
else
|
|
238
238
|
k.remove(), b.error("不支持Word中批量复制图片或视频,请改为单个复制,或者从工具栏中手动插入上传");
|
|
239
239
|
}
|
|
240
|
-
} catch (
|
|
241
|
-
|
|
240
|
+
} catch (qa) {
|
|
241
|
+
Fa = [qa];
|
|
242
242
|
} finally {
|
|
243
243
|
try {
|
|
244
|
-
Ke && (
|
|
244
|
+
Ke && (qa = ie.return) && (yield qa.call(ie));
|
|
245
245
|
} finally {
|
|
246
|
-
if (
|
|
247
|
-
throw
|
|
246
|
+
if (Fa)
|
|
247
|
+
throw Fa[0];
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
|
-
|
|
251
|
-
const Oe = new XMLSerializer().serializeToString(
|
|
250
|
+
H.value.show = !1;
|
|
251
|
+
const Oe = new XMLSerializer().serializeToString(R.body);
|
|
252
252
|
e.insertContent(Oe);
|
|
253
253
|
} else a.includes("text/plain") && e.insertContent(o.getData("text/plain"));
|
|
254
|
-
const n = Array.from((o == null ? void 0 : o.files) || []),
|
|
254
|
+
const n = Array.from((o == null ? void 0 : o.files) || []), i = [];
|
|
255
255
|
for (const T of n) {
|
|
256
256
|
if (!T)
|
|
257
257
|
continue;
|
|
258
|
-
const
|
|
259
|
-
T.type.indexOf("image") > -1 || (re = (ne = (le = p.value) == null ? void 0 : le.checkOptions) == null ? void 0 : ne.allowedType) != null && re.includes(
|
|
258
|
+
const O = Ge(T.name);
|
|
259
|
+
T.type.indexOf("image") > -1 || (re = (ne = (le = p.value) == null ? void 0 : le.checkOptions) == null ? void 0 : ne.allowedType) != null && re.includes((O == null ? void 0 : O.toLowerCase()) || "") ? i.push(T) : b.error("暂不支持的文件类型");
|
|
260
260
|
}
|
|
261
|
-
if (
|
|
262
|
-
|
|
261
|
+
if (i.length > 0) {
|
|
262
|
+
H.value = {
|
|
263
263
|
show: !0,
|
|
264
264
|
text: "图片上传中,请稍等"
|
|
265
265
|
};
|
|
266
266
|
try {
|
|
267
|
-
for (var
|
|
267
|
+
for (var Wa = G(i), Ea, Na, La; Ea = !(Na = yield Wa.next()).done; Ea = !1) {
|
|
268
268
|
const T = Na.value;
|
|
269
|
-
const
|
|
270
|
-
if (
|
|
271
|
-
const
|
|
272
|
-
e.insertContent(
|
|
269
|
+
const O = yield ae(T);
|
|
270
|
+
if (O) {
|
|
271
|
+
const R = `<img src="${O}" alt="" />`;
|
|
272
|
+
e.insertContent(R);
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
} catch (Na) {
|
|
276
276
|
La = [Na];
|
|
277
277
|
} finally {
|
|
278
278
|
try {
|
|
279
|
-
|
|
279
|
+
Ea && (Na = Wa.return) && (yield Na.call(Wa));
|
|
280
280
|
} finally {
|
|
281
281
|
if (La)
|
|
282
282
|
throw La[0];
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
|
-
|
|
285
|
+
H.value.show = !1;
|
|
286
286
|
}
|
|
287
287
|
s("input", e.getContent());
|
|
288
288
|
}), oe = (o) => {
|
|
@@ -296,13 +296,13 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
296
296
|
const e = o.dataTransfer || ((a = o == null ? void 0 : o.originalEvent) == null ? void 0 : a.dataTransfer);
|
|
297
297
|
L(e);
|
|
298
298
|
};
|
|
299
|
-
|
|
300
|
-
var a, n,
|
|
299
|
+
qe(() => {
|
|
300
|
+
var a, n, i;
|
|
301
301
|
const o = {
|
|
302
302
|
// 设置语言
|
|
303
303
|
language: "zh_CN",
|
|
304
304
|
// 实例
|
|
305
|
-
target:
|
|
305
|
+
target: V.value,
|
|
306
306
|
// 隐藏品牌
|
|
307
307
|
branding: !1,
|
|
308
308
|
// 隐藏右上角升级按钮
|
|
@@ -380,7 +380,7 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
380
380
|
convert_urls: !1,
|
|
381
381
|
paste_webkit_styles: "all",
|
|
382
382
|
paste_data_images: !1,
|
|
383
|
-
images_file_types: ((
|
|
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
385
|
paste_preprocess(t, r) {
|
|
386
386
|
r == null || r.preventDefault();
|
|
@@ -388,7 +388,7 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
388
388
|
setup(t) {
|
|
389
389
|
var d, y;
|
|
390
390
|
const r = () => {
|
|
391
|
-
|
|
391
|
+
$.value.dialogVisible = !0;
|
|
392
392
|
};
|
|
393
393
|
if (t.ui.registry.addMenuItem("localImage", {
|
|
394
394
|
text: "图片",
|
|
@@ -427,8 +427,8 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
427
427
|
});
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
|
-
}, e =
|
|
431
|
-
|
|
430
|
+
}, e = E([
|
|
431
|
+
l.options,
|
|
432
432
|
N.options,
|
|
433
433
|
o
|
|
434
434
|
], {
|
|
@@ -440,7 +440,7 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
440
440
|
});
|
|
441
441
|
pe.init(e).then(([t]) => {
|
|
442
442
|
var r;
|
|
443
|
-
t && (t.customProps = D({},
|
|
443
|
+
t && (t.customProps = D({}, l), t.on("input", () => {
|
|
444
444
|
if (U.value) {
|
|
445
445
|
U.value = !1;
|
|
446
446
|
return;
|
|
@@ -452,39 +452,39 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
452
452
|
oe(d);
|
|
453
453
|
}), t.on("drop", (d) => {
|
|
454
454
|
te(d);
|
|
455
|
-
}), (r =
|
|
455
|
+
}), (r = l.initComplete) == null || r.call(l, { editorIns: t }), m.value = t);
|
|
456
456
|
});
|
|
457
|
-
}),
|
|
457
|
+
}), Fe(() => {
|
|
458
458
|
var o, e, a, n;
|
|
459
459
|
(o = m.value) == null || o.off("input"), (e = m.value) == null || e.off("paste"), (a = m.value) == null || a.off("drop"), (n = m.value) == null || n.destroy();
|
|
460
460
|
});
|
|
461
461
|
const he = () => {
|
|
462
462
|
var e, a;
|
|
463
|
-
const o = D({},
|
|
464
|
-
return ((a = (e = p.value) == null ? void 0 : e.data) == null ? void 0 : a.call(e,
|
|
463
|
+
const o = D({}, j.value || {});
|
|
464
|
+
return ((a = (e = p.value) == null ? void 0 : e.data) == null ? void 0 : a.call(e, B(D({}, o), { extParameters: l.extParameters }))) || {};
|
|
465
465
|
}, xe = () => {
|
|
466
466
|
var e, a;
|
|
467
|
-
const o = D({},
|
|
468
|
-
return ((a = (e = p.value) == null ? void 0 : e.headers) == null ? void 0 : a.call(e,
|
|
467
|
+
const o = D({}, j.value || {});
|
|
468
|
+
return ((a = (e = p.value) == null ? void 0 : e.headers) == null ? void 0 : a.call(e, B(D({}, o), { extParameters: l.extParameters }))) || {};
|
|
469
469
|
}, be = (o, e, a) => {
|
|
470
|
-
a === Je.all && (
|
|
470
|
+
a === Je.all && (j.value = { file: o });
|
|
471
471
|
}, we = () => {
|
|
472
472
|
var e, a;
|
|
473
473
|
const o = D({}, w.value.additionalData || {});
|
|
474
|
-
return ((a = (e = v.value) == null ? void 0 : e.data) == null ? void 0 : a.call(e,
|
|
474
|
+
return ((a = (e = v.value) == null ? void 0 : e.data) == null ? void 0 : a.call(e, B(D({}, o), { extParameters: l.extParameters }))) || {};
|
|
475
475
|
}, ye = () => {
|
|
476
476
|
var e, a;
|
|
477
477
|
const o = D({}, w.value.additionalData || {});
|
|
478
|
-
return ((a = (e = v.value) == null ? void 0 : e.headers) == null ? void 0 : a.call(e,
|
|
479
|
-
}, De = (o, e, a) =>
|
|
478
|
+
return ((a = (e = v.value) == null ? void 0 : e.headers) == null ? void 0 : a.call(e, B(D({}, o), { extParameters: l.extParameters }))) || {};
|
|
479
|
+
}, De = (o, e, a) => W(null, null, function* () {
|
|
480
480
|
var t, r;
|
|
481
481
|
const n = (r = (t = v == null ? void 0 : v.value) == null ? void 0 : t.handlerResponse) == null ? void 0 : r.call(t, o);
|
|
482
|
-
let
|
|
483
|
-
n instanceof Promise ?
|
|
482
|
+
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)), w.value.formData.file = a;
|
|
484
484
|
}), _e = (o) => new Promise((e, a) => {
|
|
485
|
-
var
|
|
485
|
+
var i, t, r, d, y, f, h, C;
|
|
486
486
|
const n = o.name.split(".").filter(Boolean).pop() ? o.name.split(".").filter(Boolean).pop() : "";
|
|
487
|
-
if (!((t = (
|
|
487
|
+
if (!((t = (i = v.value) == null ? void 0 : i.allowedType) != null && t.includes(n.toLowerCase()))) {
|
|
488
488
|
b.error(`请上传格式为${(d = (r = v.value) == null ? void 0 : r.allowedType) == null ? void 0 : d.map((P) => P.toUpperCase()).join("、")}的音频`), a();
|
|
489
489
|
return;
|
|
490
490
|
}
|
|
@@ -500,21 +500,21 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
500
500
|
}, Ce = () => {
|
|
501
501
|
var e, a;
|
|
502
502
|
const o = D({}, _.value.additionalData || {});
|
|
503
|
-
return ((a = (e = u.value) == null ? void 0 : e.data) == null ? void 0 : a.call(e,
|
|
503
|
+
return ((a = (e = u.value) == null ? void 0 : e.data) == null ? void 0 : a.call(e, B(D({}, o), { extParameters: l.extParameters }))) || {};
|
|
504
504
|
}, Ue = () => {
|
|
505
505
|
var e, a;
|
|
506
506
|
const o = D({}, _.value.additionalData || {});
|
|
507
|
-
return ((a = (e = u.value) == null ? void 0 : e.headers) == null ? void 0 : a.call(e,
|
|
508
|
-
}, Ie = (o, e, a) =>
|
|
507
|
+
return ((a = (e = u.value) == null ? void 0 : e.headers) == null ? void 0 : a.call(e, B(D({}, o), { extParameters: l.extParameters }))) || {};
|
|
508
|
+
}, Ie = (o, e, a) => W(null, null, function* () {
|
|
509
509
|
var t, r;
|
|
510
510
|
debugger;
|
|
511
511
|
const n = (r = (t = u == null ? void 0 : u.value) == null ? void 0 : t.handlerResponse) == null ? void 0 : r.call(t, o);
|
|
512
|
-
let
|
|
513
|
-
n instanceof Promise ?
|
|
512
|
+
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)), _.value.formData.file = a;
|
|
514
514
|
}), Pe = (o) => new Promise((e, a) => {
|
|
515
|
-
var
|
|
515
|
+
var i, t, r, d, y, f, h, C;
|
|
516
516
|
const n = o.name.split(".").filter(Boolean).pop() ? o.name.split(".").filter(Boolean).pop() : "";
|
|
517
|
-
if (!((t = (
|
|
517
|
+
if (!((t = (i = u == null ? void 0 : u.value) == null ? void 0 : i.allowedType) != null && t.includes(n.toLowerCase()))) {
|
|
518
518
|
b.error(`请上传格式为${(d = (r = u == null ? void 0 : u.value) == null ? void 0 : r.allowedType) == null ? void 0 : d.map((P) => P.toUpperCase()).join("、")}的视频`), a();
|
|
519
519
|
return;
|
|
520
520
|
}
|
|
@@ -528,21 +528,21 @@ const Ra = /* @__PURE__ */ $e({
|
|
|
528
528
|
}, Se = (o, e, a) => {
|
|
529
529
|
b.error("上传发生错误,请重试!"), _.value.formData.file = a;
|
|
530
530
|
};
|
|
531
|
-
return de(() => [
|
|
531
|
+
return de(() => [l.disabled, m.value], () => {
|
|
532
532
|
var o, e;
|
|
533
|
-
(e = (o = m.value) == null ? void 0 : o.mode) == null || e.set(
|
|
533
|
+
(e = (o = m.value) == null ? void 0 : o.mode) == null || e.set(l.disabled ? "readonly" : "design");
|
|
534
534
|
}, { immediate: !0 }), de(
|
|
535
|
-
() => [
|
|
535
|
+
() => [l.value, m.value],
|
|
536
536
|
() => {
|
|
537
537
|
var o, e, a, n;
|
|
538
538
|
if (g.value) {
|
|
539
539
|
g.value = !1;
|
|
540
540
|
return;
|
|
541
541
|
}
|
|
542
|
-
U.value = !0, (o = m.value) == null || o.setContent(
|
|
542
|
+
U.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
543
|
},
|
|
544
544
|
{ immediate: !0 }
|
|
545
|
-
), { __sfc: !0, defaultImageUploadOptions: z, defaultVideoUploadOptions: S, defaultAudioUploadOptions: I, props:
|
|
545
|
+
), { __sfc: !0, defaultImageUploadOptions: z, defaultVideoUploadOptions: S, defaultAudioUploadOptions: I, props: l, emits: s, insRef: V, editorRef: m, preventSettingContent: g, preventUpdatingModelValue: U, 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 };
|
|
546
546
|
}
|
|
547
547
|
});
|
|
548
548
|
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.6",
|
|
6
6
|
"private": false,
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "es/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
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.4"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"vue": "^2.7.0",
|