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