@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.
Files changed (2) hide show
  1. package/es/editor.vue2.js +122 -110
  2. 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, 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]);
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(s))
11
- He.call(s, l) && me(c, l, s[l]);
10
+ for (var l of ue(r))
11
+ He.call(r, l) && me(c, l, r[l]);
12
12
  return c;
13
- }, B = (c, s) => Ve(c, je(s));
14
- var W = (c, s, l) => new Promise((z, S) => {
15
- var I = (g) => {
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(g));
18
- } catch (U) {
19
- S(U);
17
+ m(l.next(f));
18
+ } catch (w) {
19
+ S(w);
20
20
  }
21
- }, V = (g) => {
21
+ }, V = (f) => {
22
22
  try {
23
- m(l.throw(g));
24
- } catch (U) {
25
- S(U);
23
+ m(l.throw(f));
24
+ } catch (w) {
25
+ S(w);
26
26
  }
27
- }, m = (g) => g.done ? z(g.value) : Promise.resolve(g.value).then(I, V);
28
- m((l = l.apply(c, s)).next());
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, 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);
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: s }) {
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(), g = A(!1), U = A(!1), H = 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]) || {}), v = X(() => E([l.audioUploadOptions, N.audioUploadOptions, I]) || {}), $ = A({
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
- }, w = A({
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
- w.value.dialogVisible = !1, w.value.formData = {
141
+ y.value.dialogVisible = !1, y.value.formData = {
142
142
  name: "",
143
143
  cover: [],
144
144
  file: []
145
- }, w.value.additionalData = {}, j.value = void 0;
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="${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());
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
- }, _ = A({
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
- _.value.dialogVisible = !1, _.value.formData = {
161
+ k.value.dialogVisible = !1, k.value.formData = {
162
162
  file: []
163
- }, _.value.additionalData = {};
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 = _.value.formData.file[0]) == null ? void 0 : a.url}"></video>`), ee());
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 r, d, y, f, h, C, P, q, F;
173
+ var s, d, D, v, h, U, P, q, F;
174
174
  let e = o;
175
- if (!((r = p.value) != null && r.handleRequest)) {
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: (y = p.value.checkOptions) == null ? void 0 : y.allowedType,
186
+ imageAllowedType: (D = p.value.checkOptions) == null ? void 0 : D.allowedType,
187
187
  // imageAllowedMineType: mergeImageUploadOptions.value.allowedMineType,
188
- imageMinWidth: (f = p.value.checkOptions) == null ? void 0 : f.minWidth,
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: (C = p.value.checkOptions) == null ? void 0 : C.maxWidth,
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, r, d, y, f, h, C, P, q, F, le, ne, re;
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 k of [...Te, ...ze])
225
- k == null || k.remove();
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 k = qa.value;
229
- if (k.removeAttribute("crossorigin"), k.src.startsWith("http"))
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 (r = p.value) == null ? void 0 : r.handleRequestByUrl(k.src, { extParameters: l.extParameters });
232
- x != null && x.success && (x != null && x.url) ? k.src = x == null ? void 0 : x.url : k.remove();
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(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 > (((F = (q = p.value) == null ? void 0 : q.checkOptions) == null ? void 0 : F.maxHeight) || 0)) && k.remove();
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
- k.remove(), b.error("不支持Word中批量复制图片或视频,请改为单个复制,或者从工具栏中手动插入上传");
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
- s("input", e.getContent());
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, r) {
386
- r == null || r.preventDefault();
385
+ paste_preprocess(t, s) {
386
+ s == null || s.preventDefault();
387
387
  },
388
388
  setup(t) {
389
- var d, y;
390
- const r = () => {
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: () => r()
396
+ onAction: () => s()
397
397
  }), t.ui.registry.addButton("localImage", {
398
398
  icon: "image",
399
399
  tooltip: "图片",
400
- onAction: () => r()
401
- }), (d = v == null ? void 0 : v.value) != null && d.enable) {
402
- const f = () => {
403
- w.value.dialogVisible = !0;
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: () => f()
408
+ onAction: () => v()
409
409
  }), t.ui.registry.addButton("localAudio", {
410
410
  icon: "arrow-right",
411
411
  tooltip: "音频",
412
- onAction: () => f()
412
+ onAction: () => v()
413
413
  });
414
414
  }
415
- if ((y = u == null ? void 0 : u.value) != null && y.enable) {
416
- const f = () => {
417
- _.value.dialogVisible = !0;
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: () => f()
422
+ onAction: () => v()
423
423
  }), t.ui.registry.addButton("localVideo", {
424
424
  icon: "embed",
425
425
  tooltip: "视频",
426
- onAction: () => f()
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, r) => (...d) => {
437
- t(...d), r(...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 r;
443
- t && (t.customProps = D({}, l), t.on("input", () => {
444
- if (U.value) {
445
- U.value = !1;
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
- g.value = !0, s("input", t.getContent());
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
- s("input", t.getContent());
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
- }), (r = l.initComplete) == null || r.call(l, { editorIns: t }), m.value = t);
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 = 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 }))) || {};
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 = 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 }))) || {};
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 = D({}, w.value.additionalData || {});
474
- return ((a = (e = v.value) == null ? void 0 : e.data) == null ? void 0 : a.call(e, B(D({}, o), { extParameters: l.extParameters }))) || {};
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 = D({}, w.value.additionalData || {});
478
- return ((a = (e = v.value) == null ? void 0 : e.headers) == null ? void 0 : a.call(e, B(D({}, o), { extParameters: l.extParameters }))) || {};
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, r;
481
- const n = (r = (t = v == null ? void 0 : v.value) == null ? void 0 : t.handlerResponse) == null ? void 0 : r.call(t, o);
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)), w.value.formData.file = a;
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, r, d, y, f, h, C;
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 = v.value) == null ? void 0 : i.allowedType) != null && t.includes(n.toLowerCase()))) {
488
- b.error(`请上传格式为${(d = (r = v.value) == null ? void 0 : r.allowedType) == null ? void 0 : d.map((P) => P.toUpperCase()).join("、")}的音频`), a();
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 > (((y = v.value) == null ? void 0 : y.maxSize) || 0) * 1024 * 1024) {
492
- b.error(`请上传${((f = v.value) == null ? void 0 : f.maxSize) || 0}M内的音频`), a();
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
- w.value.additionalData = { file: o }, (C = (h = v == null ? void 0 : v.value) == null ? void 0 : h.beforeUploadEnd) == null || C.call(h, o), e(!0);
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
- w.value.formData.file = e;
498
- }, Ae = (o, e, a) => {
499
- b.error("上传发生错误,请重试!"), w.value.formData.file = a;
500
- }, Ce = () => {
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 = D({}, _.value.additionalData || {});
503
- return ((a = (e = u.value) == null ? void 0 : e.data) == null ? void 0 : a.call(e, B(D({}, o), { extParameters: l.extParameters }))) || {};
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 = D({}, _.value.additionalData || {});
507
- return ((a = (e = u.value) == null ? void 0 : e.headers) == null ? void 0 : a.call(e, B(D({}, o), { extParameters: l.extParameters }))) || {};
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, r;
521
+ var t, s;
510
522
  debugger;
511
- const n = (r = (t = u == null ? void 0 : u.value) == null ? void 0 : t.handlerResponse) == null ? void 0 : r.call(t, o);
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)), _.value.formData.file = a;
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, r, d, y, f, h, C;
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 = (r = u == null ? void 0 : u.value) == null ? void 0 : r.allowedType) == null ? void 0 : d.map((P) => P.toUpperCase()).join("、")}的视频`), a();
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 > (((y = u == null ? void 0 : u.value) == null ? void 0 : y.maxSize) || 0) * 1024 * 1024) {
522
- b.error(`请上传${((f = u == null ? void 0 : u.value) == null ? void 0 : f.maxSize) || 0}M内的视频`), a();
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
- _.value.additionalData = { file: o }, (C = (h = u == null ? void 0 : u.value) == null ? void 0 : h.beforeUploadEnd) == null || C.call(h, o), e(!0);
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
- _.value.formData.file = e;
539
+ k.value.formData.file = e;
528
540
  }, Se = (o, e, a) => {
529
- b.error("上传发生错误,请重试!"), _.value.formData.file = a;
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 (g.value) {
539
- g.value = !1;
550
+ if (f.value) {
551
+ f.value = !1;
540
552
  return;
541
553
  }
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);
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: 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 };
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.6",
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.4"
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.5"
30
+ "@keyblade/pro-components-vue2": "^1.14.7"
31
31
  },
32
32
  "scripts": {
33
33
  "build": "vite build",