@keyblade/tinymce-editor-vue2 0.0.12-alpha.44 → 0.0.12-alpha.45

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 +114 -114
  2. package/package.json +1 -1
package/es/editor.vue2.js CHANGED
@@ -1,11 +1,11 @@
1
- import { defineComponent as xe, ref as h, computed as C, watch as I, onMounted as we, onUnmounted as be } from "vue";
1
+ import { defineComponent as xe, ref as x, computed as A, watch as U, onMounted as we, onUnmounted as be } from "vue";
2
2
  import { oneTravelImgPondBeforeAddFile as J, oneTravelImageCheckAndTransform as ye, oneTravelImageCompressor as K } from "@keyblade/one-travel";
3
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 Ce from "imgpond";
6
- import { conclude as A } from "vue-global-config";
5
+ import Ae from "imgpond";
6
+ import { conclude as C } from "vue-global-config";
7
7
  import Y from "tinymce";
8
- import Ae from "./langs/zh_CN.js";
8
+ import Ce 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";
@@ -52,7 +52,7 @@ const ma = /* @__PURE__ */ xe({
52
52
  emits: ["input"],
53
53
  setup(Z, { emit: H }) {
54
54
  const m = Z;
55
- Y.addI18n("zh_CN", Ae);
55
+ Y.addI18n("zh_CN", Ce);
56
56
  const V = {
57
57
  maxCount: 10,
58
58
  tipText: "上传",
@@ -68,70 +68,70 @@ const ma = /* @__PURE__ */ xe({
68
68
  maxSize: 300,
69
69
  allowedType: ["mp4", "3gp"],
70
70
  accept: "video/mp4,video/3gpp"
71
- }, R = {
71
+ }, W = {
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
- }, W = h(), b = h(), P = h(!1), M = h(!1), f = h({
76
+ }, $ = x(), f = x(), P = x(!1), M = x(!1), g = x({
77
77
  show: !1,
78
78
  text: "图片上传中,请稍等"
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(() => {
79
+ }), d = A(() => C([m.imageUploadOptions, D.imageUploadOptions, V]) || {}), c = A(() => C([m.videoUploadOptions, D.videoUploadOptions, B]) || {}), h = A(() => C([m.audioUploadOptions, D.audioUploadOptions, W]) || {}), z = A(() => C([m.imgPondOptions, D.imgPondOptions]) || {}), ee = A(() => {
80
80
  var e, t;
81
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, {
82
+ }), k = x();
83
+ U(() => k.value, () => {
84
+ k.value && J(k.value, {
85
85
  onStart: () => {
86
- f.value = {
86
+ g.value = {
87
87
  show: !0,
88
88
  text: "图片加载中,请稍等"
89
89
  };
90
90
  },
91
91
  onSuccess: () => {
92
- f.value.show = !1;
92
+ g.value.show = !1;
93
93
  },
94
94
  onError: (e) => {
95
- f.value.show = !1, y.error(e);
95
+ g.value.show = !1, y.error(e);
96
96
  }
97
97
  });
98
98
  }, { immediate: !0 });
99
- const U = h();
100
- I(() => U.value, () => {
101
- U.value && J(U.value, {
99
+ const I = x();
100
+ U(() => I.value, () => {
101
+ I.value && J(I.value, {
102
102
  onStart: () => {
103
- f.value = {
103
+ g.value = {
104
104
  show: !0,
105
105
  text: "图片加载中,请稍等"
106
106
  };
107
107
  },
108
108
  onSuccess: () => {
109
- f.value.show = !1;
109
+ g.value.show = !1;
110
110
  },
111
111
  onError: (e) => {
112
- f.value.show = !1, y.error(e);
112
+ g.value.show = !1, y.error(e);
113
113
  }
114
114
  });
115
115
  }, { immediate: !0 });
116
- const T = h({
116
+ const T = x({
117
117
  dialogVisible: !1,
118
118
  formData: {
119
119
  images: []
120
120
  }
121
- }), $ = h(), E = () => {
121
+ }), E = x(), R = () => {
122
122
  T.value.dialogVisible = !1, T.value.formData = {
123
123
  images: []
124
124
  };
125
125
  }, ae = () => {
126
126
  var e;
127
- (e = $.value) == null || e.validate((t) => {
127
+ (e = E.value) == null || e.validate((t) => {
128
128
  t && (T.value.formData.images.forEach((i) => {
129
129
  var o;
130
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());
131
+ z.value.srcAt && (a = (i == null ? void 0 : i[z.value.srcAt]) || ""), (o = f.value) == null || o.insertContent(`<img src=${a} alt="" />`);
132
+ }), R());
133
133
  });
134
- }, v = h({
134
+ }, v = x({
135
135
  dialogVisible: !1,
136
136
  formData: {
137
137
  // 名称
@@ -143,7 +143,7 @@ const ma = /* @__PURE__ */ xe({
143
143
  },
144
144
  // 用于临时保存上传前的参数 { file: File }
145
145
  additionalData: {}
146
- }), j = h(), q = () => {
146
+ }), j = x(), q = () => {
147
147
  v.value.dialogVisible = !1, v.value.formData = {
148
148
  name: "",
149
149
  cover: [],
@@ -153,9 +153,9 @@ const ma = /* @__PURE__ */ xe({
153
153
  var e;
154
154
  (e = j.value) == null || e.validate((t) => {
155
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());
156
+ t && ((a = f.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
- }, x = h({
158
+ }, w = x({
159
159
  dialogVisible: !1,
160
160
  formData: {
161
161
  // 文件
@@ -163,22 +163,22 @@ const ma = /* @__PURE__ */ xe({
163
163
  },
164
164
  // 用于临时保存上传前的参数 { file: File }
165
165
  additionalData: {}
166
- }), N = h(), F = () => {
167
- x.value.dialogVisible = !1, x.value.formData = {
166
+ }), N = x(), F = () => {
167
+ w.value.dialogVisible = !1, w.value.formData = {
168
168
  file: []
169
- }, x.value.additionalData = {};
169
+ }, w.value.additionalData = {};
170
170
  }, te = () => {
171
171
  var e;
172
172
  (e = N.value) == null || e.validate((t) => {
173
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());
174
+ t && ((a = f.value) == null || a.insertContent(`<video width="auto" height="auto" controls src="${(i = w.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
- }, ne = (e, t) => new Promise(async (i, a) => {
181
- var r, l;
180
+ }, le = (e, t) => new Promise(async (i, a) => {
181
+ var r, n;
182
182
  const o = await K(e);
183
183
  if (!o.success) {
184
184
  a(), setTimeout(() => {
@@ -186,25 +186,25 @@ const ma = /* @__PURE__ */ xe({
186
186
  });
187
187
  return;
188
188
  }
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
- if (!n || !(n != null && n.success)) {
189
+ const l = await ((n = (r = d.value).handleRequest) == null ? void 0 : n.call(r, Q(o.file, e.name), e.name, { extParameters: m.extParameters }));
190
+ if (!l || !(l != null && l.success)) {
191
191
  a(), setTimeout(() => {
192
- t.onError(n == null ? void 0 : n.errorMessage);
192
+ t.onError(l == null ? void 0 : l.errorMessage);
193
193
  });
194
194
  return;
195
195
  }
196
- i(n.url);
196
+ i(l.url);
197
197
  });
198
198
  async function L(e, t) {
199
199
  const a = t.node.getElementsByTagName("img"), o = [];
200
- for (let n = a.length - 1; n >= 0; n--) {
201
- const r = a[n], l = "img-" + _e();
202
- r.classList.add(l), o.push(l);
200
+ for (let l = a.length - 1; l >= 0; l--) {
201
+ const r = a[l], n = "img-" + _e();
202
+ r.classList.add(n), o.push(n);
203
203
  }
204
204
  setTimeout(async () => {
205
- var n, r;
206
- for (let l = o.length - 1; l >= 0; l--) {
207
- const s = e.dom.select(`.${o[l]}`);
205
+ var l, r;
206
+ for (let n = o.length - 1; n >= 0; n--) {
207
+ const s = e.dom.select(`.${o[n]}`);
208
208
  if (s.length === 0)
209
209
  continue;
210
210
  const u = s[0], p = u.src;
@@ -212,13 +212,13 @@ const ma = /* @__PURE__ */ xe({
212
212
  e.dom.remove(u);
213
213
  continue;
214
214
  } else if (p.startsWith("http://") || p.startsWith("https://")) {
215
- const w = await Te(p);
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))) {
215
+ const b = await Te(p);
216
+ if (b && (b.width < (d.value.minWidth || 0) && b.height < (d.value.minHeight || 0) || b.width > (d.value.maxWidth || 0) && b.height > (d.value.maxHeight || 0))) {
217
217
  e.dom.remove(u);
218
218
  continue;
219
219
  }
220
- const k = X(p);
221
- if (!((r = (n = d.value) == null ? void 0 : n.allowedType) != null && r.includes(k.toLowerCase()))) {
220
+ const S = X(p);
221
+ if (!((r = (l = d.value) == null ? void 0 : l.allowedType) != null && r.includes(S.toLowerCase()))) {
222
222
  e.dom.remove(u);
223
223
  continue;
224
224
  }
@@ -239,7 +239,7 @@ const ma = /* @__PURE__ */ xe({
239
239
  // 设置语言
240
240
  language: "zh_CN",
241
241
  // 实例
242
- target: W.value,
242
+ target: $.value,
243
243
  // 隐藏品牌
244
244
  branding: !1,
245
245
  // 隐藏右上角升级按钮
@@ -327,18 +327,18 @@ const ma = /* @__PURE__ */ xe({
327
327
  L(a, o);
328
328
  },
329
329
  images_upload_handler(a) {
330
- return new Promise(async (o, n) => {
331
- var w, k, O;
332
- if (!((w = d.value) != null && w.handleRequest))
333
- return _(), n({ message: "缺少图片上传配置", remove: !0 });
334
- f.value = {
330
+ return new Promise(async (o, l) => {
331
+ var b, S, O;
332
+ if (!((b = d.value) != null && b.handleRequest))
333
+ return _(), l({ message: "缺少图片上传配置", remove: !0 });
334
+ g.value = {
335
335
  show: !0,
336
336
  text: "图片上传中,请稍等"
337
337
  };
338
- let r = a.blob(), l = r.name ? r.name : a.filename();
338
+ let r = a.blob(), n = r.name ? r.name : a.filename();
339
339
  if (!(r != null && r.name) && !(r != null && r.lastModified) && r.type === "image/png")
340
- return f.value.show = !1, _(), n({ message: "不允许粘贴", remove: !0 });
341
- const s = await ye(r, l, {
340
+ return g.value.show = !1, _(), l({ message: "不允许粘贴", remove: !0 });
341
+ const s = await ye(r, n, {
342
342
  imageMaxSize: d.value.maxSize,
343
343
  imageAllowedType: d.value.allowedType,
344
344
  // imageAllowedMineType: mergeImageUploadOptions.value.allowedMineType,
@@ -348,28 +348,28 @@ const ma = /* @__PURE__ */ xe({
348
348
  imageMaxHeight: d.value.maxHeight
349
349
  });
350
350
  if (!s.success)
351
- return f.value.show = !1, _(), n({ message: (s == null ? void 0 : s.errorMessage) || "", remove: !0 });
351
+ return g.value.show = !1, _(), l({ message: (s == null ? void 0 : s.errorMessage) || "", remove: !0 });
352
352
  if (s.hasTransform) {
353
353
  r = s.file;
354
- const G = l == null ? void 0 : l.split(".");
355
- G.pop(), l = `${G.join(",")}.jpg`;
354
+ const G = n == null ? void 0 : n.split(".");
355
+ G.pop(), n = `${G.join(",")}.jpg`;
356
356
  }
357
357
  const u = await K(r);
358
358
  if (!u.success)
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 }));
359
+ return g.value.show = !1, _(), l({ message: u == null ? void 0 : u.errorMessage, remove: !0 });
360
+ const p = await ((O = (S = d.value).handleRequest) == null ? void 0 : O.call(S, Q(u.file, n), n, { extParameters: m.extParameters }));
361
361
  if (!p || !p.success)
362
- return f.value.show = !1, _(), n({ message: p.errorMessage, remove: !0 });
363
- f.value.show = !1, o(p.url);
362
+ return g.value.show = !1, _(), l({ message: p.errorMessage, remove: !0 });
363
+ g.value.show = !1, o(p.url);
364
364
  });
365
365
  },
366
366
  setup(a) {
367
- var n, r;
367
+ var l, r;
368
368
  const o = () => {
369
369
  T.value.dialogVisible = !0, setTimeout(() => {
370
370
  var s, u;
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");
372
- l && (l.innerHTML = ((u = d.value) == null ? void 0 : u.tipText) || "上传");
371
+ const n = (s = document == null ? void 0 : document.querySelector) == null ? void 0 : s.call(document, ".tinymce-editor-upload-image-dialog .el-upload__text > div");
372
+ n && (n.innerHTML = ((u = d.value) == null ? void 0 : u.tipText) || "上传");
373
373
  });
374
374
  };
375
375
  if (a.ui.registry.addMenuItem("localImage", {
@@ -380,8 +380,8 @@ const ma = /* @__PURE__ */ xe({
380
380
  icon: "image",
381
381
  tooltip: "图片",
382
382
  onAction: () => o()
383
- }), (n = g == null ? void 0 : g.value) != null && n.enable) {
384
- const l = () => {
383
+ }), (l = h == null ? void 0 : h.value) != null && l.enable) {
384
+ const n = () => {
385
385
  v.value.dialogVisible = !0, setTimeout(() => {
386
386
  var u, p;
387
387
  const s = (u = document == null ? void 0 : document.querySelector) == null ? void 0 : u.call(document, ".tinymce-editor-upload-audio-dialog .el-upload__text > div");
@@ -391,85 +391,85 @@ const ma = /* @__PURE__ */ xe({
391
391
  a.ui.registry.addMenuItem("localAudio", {
392
392
  text: "音频",
393
393
  icon: "arrow-right",
394
- onAction: () => l()
394
+ onAction: () => n()
395
395
  }), a.ui.registry.addButton("localAudio", {
396
396
  icon: "arrow-right",
397
397
  tooltip: "音频",
398
- onAction: () => l()
398
+ onAction: () => n()
399
399
  });
400
400
  }
401
401
  if ((r = c == null ? void 0 : c.value) != null && r.enable) {
402
- const l = () => {
403
- x.value.dialogVisible = !0;
402
+ const n = () => {
403
+ w.value.dialogVisible = !0;
404
404
  };
405
405
  a.ui.registry.addMenuItem("localVideo", {
406
406
  text: "视频",
407
407
  icon: "embed",
408
- onAction: () => l()
408
+ onAction: () => n()
409
409
  }), a.ui.registry.addButton("localVideo", {
410
410
  icon: "embed",
411
411
  tooltip: "视频",
412
- onAction: () => l()
412
+ onAction: () => n()
413
413
  });
414
414
  }
415
415
  }
416
- }, t = A(
416
+ }, t = C(
417
417
  [
418
418
  m.options,
419
419
  D.options,
420
420
  e
421
421
  ],
422
422
  {
423
- mergeFunction: (a, o) => (...n) => {
424
- a(...n), o(...n);
423
+ mergeFunction: (a, o) => (...l) => {
424
+ a(...l), o(...l);
425
425
  },
426
426
  type: Object
427
427
  }
428
428
  );
429
429
  Y.init(t).then(([a]) => {
430
430
  var o;
431
- a && (a.customProps = { ...m }, a.on("change input Redo Undo SetContent", () => {
431
+ a && (a.customProps = { ...m }, a.on("input", () => {
432
432
  if (M.value) {
433
433
  M.value = !1;
434
434
  return;
435
435
  }
436
436
  P.value = !0, H("input", a.getContent());
437
- }), a.on("paste", (n) => {
438
- var l, s;
439
- const r = ((l = n.clipboardData) == null ? void 0 : l.files) || [];
437
+ }), a.on("paste", (l) => {
438
+ var n, s;
439
+ const r = ((n = l.clipboardData) == null ? void 0 : n.files) || [];
440
440
  for (let u of r) {
441
441
  const p = X(u.name) || "";
442
- (s = d.value.allowedType) != null && s.includes(p.toLowerCase()) || n.preventDefault();
442
+ (s = d.value.allowedType) != null && s.includes(p.toLowerCase()) || l.preventDefault();
443
443
  }
444
444
  }), a.on("drop", () => {
445
445
  _();
446
- }), (o = m.initComplete) == null || o.call(m, { editorIns: a }), b.value = a);
446
+ }), (o = m.initComplete) == null || o.call(m, { editorIns: a }), f.value = a);
447
447
  });
448
448
  }), be(() => {
449
- var e;
450
- (e = b.value) == null || e.destroy();
449
+ var e, t, i, a;
450
+ (e = f.value) == null || e.off("input"), (t = f.value) == null || t.off("paste"), (i = f.value) == null || i.off("drop"), (a = f.value) == null || a.destroy();
451
451
  });
452
- const le = () => {
452
+ const ne = () => {
453
453
  var t, i;
454
454
  const e = { ...v.value.additionalData || {} };
455
- return ((i = (t = g.value) == null ? void 0 : t.data) == null ? void 0 : i.call(t, { ...e, extParameters: m.extParameters })) || {};
455
+ return ((i = (t = h.value) == null ? void 0 : t.data) == null ? void 0 : i.call(t, { ...e, extParameters: m.extParameters })) || {};
456
456
  }, re = () => {
457
457
  var t, i;
458
458
  const e = { ...v.value.additionalData || {} };
459
- return ((i = (t = g.value) == null ? void 0 : t.headers) == null ? void 0 : i.call(t, { ...e, extParameters: m.extParameters })) || {};
459
+ return ((i = (t = h.value) == null ? void 0 : t.headers) == null ? void 0 : i.call(t, { ...e, extParameters: m.extParameters })) || {};
460
460
  }, se = (e, t, i) => {
461
- var o, n;
462
- const a = (n = (o = g == null ? void 0 : g.value) == null ? void 0 : o.handlerResponse) == null ? void 0 : n.call(o, e);
461
+ var o, l;
462
+ const a = (l = (o = h == null ? void 0 : h.value) == null ? void 0 : o.handlerResponse) == null ? void 0 : l.call(o, e);
463
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
464
  }, ue = (e, t) => new Promise((i, a) => {
465
- var n, r, l, s, u, p;
465
+ var l, r, n, s, u, p;
466
466
  const o = e.name.split(".").filter(Boolean).pop() ? e.name.split(".").filter(Boolean).pop() : "";
467
- if (!((r = (n = g.value) == null ? void 0 : n.allowedType) != null && r.includes(o.toLowerCase()))) {
468
- y.error(`请上传格式为${(s = (l = g.value) == null ? void 0 : l.allowedType) == null ? void 0 : s.map((w) => w.toUpperCase()).join("、")}的音频`), a();
467
+ if (!((r = (l = h.value) == null ? void 0 : l.allowedType) != null && r.includes(o.toLowerCase()))) {
468
+ y.error(`请上传格式为${(s = (n = h.value) == null ? void 0 : n.allowedType) == null ? void 0 : s.map((b) => b.toUpperCase()).join("、")}的音频`), a();
469
469
  return;
470
470
  }
471
- if (e.size > (((u = g.value) == null ? void 0 : u.maxSize) || 0) * 1024 * 1024) {
472
- y.error(`请上传${((p = g.value) == null ? void 0 : p.maxSize) || 0}M内的音频`), a();
471
+ if (e.size > (((u = h.value) == null ? void 0 : u.maxSize) || 0) * 1024 * 1024) {
472
+ y.error(`请上传${((p = h.value) == null ? void 0 : p.maxSize) || 0}M内的音频`), a();
473
473
  return;
474
474
  }
475
475
  v.value.additionalData = { file: e }, i(!0);
@@ -479,48 +479,48 @@ const ma = /* @__PURE__ */ xe({
479
479
  y.error("上传发生错误,请重试!"), v.value.formData.file = i;
480
480
  }, ce = () => {
481
481
  var t, i;
482
- const e = { ...x.value.additionalData || {} };
482
+ const e = { ...w.value.additionalData || {} };
483
483
  return ((i = (t = c.value) == null ? void 0 : t.data) == null ? void 0 : i.call(t, { ...e, extParameters: m.extParameters })) || {};
484
484
  }, pe = () => {
485
485
  var t, i;
486
- const e = { ...x.value.additionalData || {} };
486
+ const e = { ...w.value.additionalData || {} };
487
487
  return ((i = (t = c.value) == null ? void 0 : t.headers) == null ? void 0 : i.call(t, { ...e, extParameters: m.extParameters })) || {};
488
488
  }, ve = (e, t, i) => {
489
- var o, n;
490
- const a = (n = (o = c == null ? void 0 : c.value) == null ? void 0 : o.handlerResponse) == null ? void 0 : n.call(o, e);
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;
489
+ var o, l;
490
+ const a = (l = (o = c == null ? void 0 : c.value) == null ? void 0 : o.handlerResponse) == null ? void 0 : l.call(o, e);
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)), w.value.formData.file = i;
492
492
  }, fe = (e, t) => new Promise((i, a) => {
493
- var n, r, l, s, u, p;
493
+ var l, r, n, s, u, p;
494
494
  const o = e.name.split(".").filter(Boolean).pop() ? e.name.split(".").filter(Boolean).pop() : "";
495
- if (!((r = (n = c == null ? void 0 : c.value) == null ? void 0 : n.allowedType) != null && r.includes(o.toLowerCase()))) {
496
- y.error(`请上传格式为${(s = (l = c == null ? void 0 : c.value) == null ? void 0 : l.allowedType) == null ? void 0 : s.map((w) => w.toUpperCase()).join("、")}的视频`), a();
495
+ if (!((r = (l = c == null ? void 0 : c.value) == null ? void 0 : l.allowedType) != null && r.includes(o.toLowerCase()))) {
496
+ y.error(`请上传格式为${(s = (n = c == null ? void 0 : c.value) == null ? void 0 : n.allowedType) == null ? void 0 : s.map((b) => b.toUpperCase()).join("、")}的视频`), a();
497
497
  return;
498
498
  }
499
499
  if (e.size > (((u = c == null ? void 0 : c.value) == null ? void 0 : u.maxSize) || 0) * 1024 * 1024) {
500
500
  y.error(`请上传${((p = c == null ? void 0 : c.value) == null ? void 0 : p.maxSize) || 0}M内的视频`), a();
501
501
  return;
502
502
  }
503
- x.value.additionalData = { file: e }, i(!0);
503
+ w.value.additionalData = { file: e }, i(!0);
504
504
  }), ge = (e, t) => {
505
- x.value.formData.file = t;
505
+ w.value.formData.file = t;
506
506
  }, he = (e, t, i) => {
507
- y.error("上传发生错误,请重试!"), x.value.formData.file = i;
507
+ y.error("上传发生错误,请重试!"), w.value.formData.file = i;
508
508
  };
509
- return I(() => [m.disabled, b.value], () => {
509
+ return U(() => [m.disabled, f.value], () => {
510
510
  var e, t;
511
- (t = (e = b.value) == null ? void 0 : e.mode) == null || t.set(m.disabled ? "readonly" : "design");
512
- }, { immediate: !0 }), I(
513
- () => [m.value, b.value],
511
+ (t = (e = f.value) == null ? void 0 : e.mode) == null || t.set(m.disabled ? "readonly" : "design");
512
+ }, { immediate: !0 }), U(
513
+ () => [m.value, f.value],
514
514
  () => {
515
515
  var e;
516
516
  if (P.value) {
517
517
  P.value = !1;
518
518
  return;
519
519
  }
520
- M.value = !0, (e = b.value) == null || e.setContent(m.value ? m.value : "");
520
+ M.value = !0, (e = f.value) == null || e.setContent(m.value ? m.value : "");
521
521
  },
522
522
  { immediate: !0 }
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 };
523
+ ), { __sfc: !0, defaultImageUploadOptions: V, defaultVideoUploadOptions: B, defaultAudioUploadOptions: W, props: m, emits: H, insRef: $, editorRef: f, preventSettingContent: P, preventUpdatingModelValue: M, uploadLoadingConfig: g, mergeImageUploadOptions: d, mergeVideoUploadOptions: c, mergeAudioUploadOptions: h, mergeImgPondOptions: z, imgPondAccept: ee, uploadImageImgPondRef: k, audioImageImgPondRef: I, uploadImage: T, uploadImageFormRef: E, onUploadImageClose: R, onUploadImageConfirm: ae, uploadAudio: v, uploadAudioFormRef: j, onUploadAudioClose: q, onUploadAudioConfirm: oe, uploadVideo: w, uploadVideoFormRef: N, onUploadVideoClose: F, onUploadVideoConfirm: te, onImageUploadUploadExceed: ie, onImageUploadUpload: le, processPastedImage: L, removeNotification: _, getUploadAudioData: ne, getUploadAudioHeaders: re, onUploadAudioSuccess: se, onUploadAudioBeforeUpload: ue, onUploadAudioRemove: de, onUploadAudioError: me, getUploadVideoData: ce, getUploadVideoHeaders: pe, onUploadVideoSuccess: ve, onUploadVideoBeforeUpload: fe, onUploadVideoRemove: ge, onUploadVideoError: he, ImgPond: Ae };
524
524
  }
525
525
  });
526
526
  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": "0.0.12-alpha.44",
5
+ "version": "0.0.12-alpha.45",
6
6
  "private": false,
7
7
  "type": "module",
8
8
  "main": "es/index.js",