@keyblade/tinymce-editor-vue2 0.0.12-alpha.30 → 0.0.12-alpha.32

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.vue.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import n from "./editor.vue2.js";
2
2
  import m from "./_virtual/_plugin-vue2_normalizer.js";
3
3
  var c = function() {
4
- var l, i, s, u, d, r, p;
4
+ var l, i, s, d, u, r, p;
5
5
  var a = this, e = a._self._c, o = a._self._setupProxy;
6
6
  return e("div", { staticClass: "tinymce-editor" }, [e("textarea", { ref: "insRef" }), e("el-dialog", { staticClass: "tinymce-editor-dialog tinymce-editor-upload-image-dialog", attrs: { visible: o.uploadImage.dialogVisible, title: "插入图片", "append-to-body": !0, "close-on-click-modal": !1, "destroy-on-close": "" }, on: { close: o.onUploadImageClose } }, [e("el-form", { ref: "uploadImageFormRef", staticClass: "uploadImageForm", attrs: { model: o.uploadImage.formData } }, [e("el-form-item", { attrs: { prop: "images", rules: { required: !0, message: "必填项" } } }, [e(o.ImgPond, a._b({ ref: "uploadImageImgPondRef", attrs: { valueType: "array", accept: o.imgPondAccept, size: o.mergeImageUploadOptions.maxSize, count: o.mergeImageUploadOptions.maxCount, upload: o.onImageUploadUpload }, model: { value: o.uploadImage.formData.images, callback: function(t) {
7
7
  a.$set(o.uploadImage.formData, "images", t);
@@ -9,7 +9,7 @@ var c = function() {
9
9
  a.$set(o.uploadAudio.formData, "name", t);
10
10
  }, expression: "uploadAudio.formData.name" } })], 1), e("el-form-item", { attrs: { label: "封面", prop: "cover", rules: { required: !0, message: "必填项" } } }, [e(o.ImgPond, a._b({ ref: "audioImageImgPondRef", attrs: { valueType: "array", accept: o.imgPondAccept, size: o.mergeImageUploadOptions.maxSize, count: 1, upload: o.onImageUploadUpload }, model: { value: o.uploadAudio.formData.cover, callback: function(t) {
11
11
  a.$set(o.uploadAudio.formData, "cover", t);
12
- }, expression: "uploadAudio.formData.cover" } }, "ImgPond", o.mergeImgPondOptions, !1))], 1), e("el-form-item", { attrs: { label: "音频", prop: "file", rules: { required: !0, message: "必填项" } } }, [e("el-upload", { class: ["upload", { "upload-hide": o.uploadAudio.formData.file.length >= 1 }], attrs: { name: "file", "file-list": o.uploadAudio.formData.file, action: ((s = o.mergeAudioUploadOptions) == null ? void 0 : s.action) || "", data: o.getUploadAudioData(), accept: "audio/*", "list-type": "headTextContent", "before-upload": o.onUploadAudioBeforeUpload, headers: o.getUploadAudioHeaders(), "on-remove": o.onUploadAudioRemove, "on-success": o.onUploadAudioSuccess, "on-error": o.onUploadAudioError, limit: 1 } }, [e("el-button", { attrs: { size: "small", type: "primary" } }, [a._v("上传文件"), e("i", { staticClass: "el-icon-upload el-icon--right" })]), e("div", { staticClass: "el-upload__tip", attrs: { slot: "tip" }, slot: "tip" }, [a._v("支持音频格式:" + a._s((d = (u = o.mergeAudioUploadOptions) == null ? void 0 : u.allowedType) == null ? void 0 : d.map((t) => t.toUpperCase()).join("、")))])], 1)], 1)], 1), e("div", { attrs: { slot: "footer" }, slot: "footer" }, [e("el-button", { on: { click: o.onUploadAudioClose } }, [a._v("取消")]), e("el-button", { attrs: { type: "primary" }, on: { click: o.onUploadAudioConfirm } }, [a._v("确定")])], 1)], 1), e("el-dialog", { staticClass: "tinymce-editor-dialog tinymce-editor-upload-video-dialog", attrs: { visible: o.uploadVideo.dialogVisible, title: "插入视频", "append-to-body": !0, "close-on-click-modal": !1, "destroy-on-close": "" }, on: { close: o.onUploadVideoClose } }, [e("el-form", { ref: "uploadVideoFormRef", staticClass: "uploadVideoForm", attrs: { model: o.uploadVideo.formData, "label-width": "auto" } }, [e("el-form-item", { attrs: { label: "视频", prop: "file", rules: { required: !0, message: "必填项" } } }, [e("el-upload", { class: ["upload", { "upload-hide": o.uploadVideo.formData.file.length >= 1 }], attrs: { name: "file", "file-list": o.uploadVideo.formData.file, action: o.mergeVideoUploadOptions.action || "", data: o.getUploadVideoData(), accept: "video/*", "list-type": "headTextContent", "before-upload": o.onUploadVideoBeforeUpload, headers: o.getUploadVideoHeaders(), "on-remove": o.onUploadVideoRemove, "on-success": o.onUploadVideoSuccess, "on-error": o.onUploadVideoError, limit: 1 } }, [e("el-button", { attrs: { size: "small", type: "primary" } }, [a._v("上传文件"), e("i", { staticClass: "el-icon-upload el-icon--right" })]), e("div", { staticClass: "el-upload__tip", attrs: { slot: "tip" }, slot: "tip" }, [a._v("支持视频格式:" + a._s((p = (r = o.mergeVideoUploadOptions) == null ? void 0 : r.allowedType) == null ? void 0 : p.map((t) => t.toUpperCase()).join("、")))])], 1)], 1)], 1), e("div", { attrs: { slot: "footer" }, slot: "footer" }, [e("el-button", { on: { click: o.onUploadVideoClose } }, [a._v("取消")]), e("el-button", { attrs: { type: "primary" }, on: { click: o.onUploadVideoConfirm } }, [a._v("确定")])], 1)], 1), e("el-dialog", { staticClass: "tinymce-editor-loading-dialog", attrs: { fullscreen: "", visible: o.uploadLoadingConfig.show, "show-close": !1, "close-on-press-escape": !1, "close-on-click-modal": !1, "destroy-on-close": "" }, on: { "update:visible": function(t) {
12
+ }, expression: "uploadAudio.formData.cover" } }, "ImgPond", o.mergeImgPondOptions, !1))], 1), e("el-form-item", { attrs: { label: "音频", prop: "file", rules: { required: !0, message: "必填项" } } }, [e("el-upload", { class: ["upload", { "upload-hide": o.uploadAudio.formData.file.length >= 1 }], attrs: { name: "file", "file-list": o.uploadAudio.formData.file, action: ((s = o.mergeAudioUploadOptions) == null ? void 0 : s.action) || "", data: o.getUploadAudioData(), accept: "audio/*", "list-type": "headTextContent", "before-upload": o.onUploadAudioBeforeUpload, headers: o.getUploadAudioHeaders(), "on-remove": o.onUploadAudioRemove, "on-success": o.onUploadAudioSuccess, "on-error": o.onUploadAudioError, limit: 1 } }, [e("el-button", { attrs: { size: "small", type: "primary" } }, [a._v("上传文件"), e("i", { staticClass: "el-icon-upload el-icon--right" })]), e("div", { staticClass: "el-upload__tip", attrs: { slot: "tip" }, slot: "tip" }, [a._v("支持音频格式:" + a._s((u = (d = o.mergeAudioUploadOptions) == null ? void 0 : d.allowedType) == null ? void 0 : u.map((t) => t.toUpperCase()).join("、")))])], 1)], 1)], 1), e("div", { attrs: { slot: "footer" }, slot: "footer" }, [e("el-button", { on: { click: o.onUploadAudioClose } }, [a._v("取消")]), e("el-button", { attrs: { type: "primary" }, on: { click: o.onUploadAudioConfirm } }, [a._v("确定")])], 1)], 1), e("el-dialog", { staticClass: "tinymce-editor-dialog tinymce-editor-upload-video-dialog", attrs: { visible: o.uploadVideo.dialogVisible, title: "插入视频", "append-to-body": !0, "close-on-click-modal": !1, "destroy-on-close": "" }, on: { close: o.onUploadVideoClose } }, [e("el-form", { ref: "uploadVideoFormRef", staticClass: "uploadVideoForm", attrs: { model: o.uploadVideo.formData, "label-width": "auto" } }, [e("el-form-item", { attrs: { label: "视频", prop: "file", rules: { required: !0, message: "必填项" } } }, [e("el-upload", { class: ["upload", { "upload-hide": o.uploadVideo.formData.file.length >= 1 }], attrs: { name: "file", "file-list": o.uploadVideo.formData.file, action: o.mergeVideoUploadOptions.action || "", data: o.getUploadVideoData(), accept: "video/*", "list-type": "headTextContent", "before-upload": o.onUploadVideoBeforeUpload, headers: o.getUploadVideoHeaders(), "on-remove": o.onUploadVideoRemove, "on-success": o.onUploadVideoSuccess, "on-error": o.onUploadVideoError, limit: 1 } }, [e("el-button", { attrs: { size: "small", type: "primary" } }, [a._v("上传文件"), e("i", { staticClass: "el-icon-upload el-icon--right" })]), e("div", { staticClass: "el-upload__tip", attrs: { slot: "tip" }, slot: "tip" }, [a._v("支持视频格式:" + a._s((p = (r = o.mergeVideoUploadOptions) == null ? void 0 : r.allowedType) == null ? void 0 : p.map((t) => t.toUpperCase()).join("、")))])], 1)], 1)], 1), e("div", { attrs: { slot: "footer" }, slot: "footer" }, [e("el-button", { on: { click: o.onUploadVideoClose } }, [a._v("取消")]), e("el-button", { attrs: { type: "primary" }, on: { click: o.onUploadVideoConfirm } }, [a._v("确定")])], 1)], 1), e("el-dialog", { staticClass: "tinymce-editor-loading-dialog", attrs: { fullscreen: "", "append-to-body": "", visible: o.uploadLoadingConfig.show, "show-close": !1, "close-on-press-escape": !1, "close-on-click-modal": !1, "destroy-on-close": "" }, on: { "update:visible": function(t) {
13
13
  return a.$set(o.uploadLoadingConfig, "show", t);
14
14
  } } }, [e("div", { staticClass: "tinymce-editor-loading-dialog-content" }, [e("div", { staticClass: "tinymce-editor-spinner" }, [e("div", { staticClass: "tinymce-editor-spinner-dot1" }), e("div", { staticClass: "tinymce-editor-spinner-dot2" }), e("div", { staticClass: "tinymce-editor-spinner-dot3" })]), e("span", [a._v(a._s(o.uploadLoadingConfig.text))])])])], 1);
15
15
  }, g = [], f = /* @__PURE__ */ m(
package/es/editor.vue2.js CHANGED
@@ -1,9 +1,9 @@
1
- import { defineComponent as ge, ref as g, computed as C, watch as U, onMounted as he, onUnmounted as xe } from "vue";
1
+ import { defineComponent as ge, ref as h, computed as T, watch as I, onMounted as he, onUnmounted as xe } from "vue";
2
2
  import { oneTravelImgPondBeforeAddFile as G, oneTravelImageCheckAndTransform as be, oneTravelImageCompressor as J } from "@keyblade/one-travel";
3
3
  import { blobToFile as K, getFileExtension as Q, getImagePixel as we } from "./util.js";
4
4
  import "./style.less.js";
5
5
  import ye from "imgpond";
6
- import { conclude as T } from "vue-global-config";
6
+ import { conclude as A } from "vue-global-config";
7
7
  import X from "tinymce";
8
8
  import _e from "./langs/zh_CN.js";
9
9
  import "tinymce/skins/ui/oxide/skin";
@@ -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";
38
- import { Message as w, Loading as Ce } from "element-ui";
39
- const ua = /* @__PURE__ */ ge({
37
+ import { globalProps as C } from "./index.js";
38
+ import { Message as w } from "element-ui";
39
+ const sa = /* @__PURE__ */ ge({
40
40
  __name: "editor",
41
41
  props: {
42
42
  value: { default: "" },
@@ -50,8 +50,8 @@ const ua = /* @__PURE__ */ ge({
50
50
  initComplete: null
51
51
  },
52
52
  emits: ["input"],
53
- setup(Y, { emit: I }) {
54
- const c = Y;
53
+ setup(Y, { emit: k }) {
54
+ const m = Y;
55
55
  X.addI18n("zh_CN", _e);
56
56
  const z = {
57
57
  maxCount: 10,
@@ -71,65 +71,65 @@ const ua = /* @__PURE__ */ ge({
71
71
  enable: !0,
72
72
  maxSize: 200,
73
73
  allowedType: ["mp3", "m4a", "wav", "aac"]
74
- }, H = g(), x = g(), P = g(!1), D = g(!1), b = g({
74
+ }, H = h(), b = h(), P = h(!1), D = h(!1), f = h({
75
75
  show: !1,
76
76
  text: "图片上传中,请稍等"
77
- }), d = C(() => T([c.imageUploadOptions, A.imageUploadOptions, z]) || {}), m = C(() => T([c.videoUploadOptions, A.videoUploadOptions, V]) || {}), f = C(() => T([c.audioUploadOptions, A.audioUploadOptions, B]) || {}), k = C(() => T([c.imgPondOptions, A.imgPondOptions]) || {}), Z = C(() => {
78
- var e, i;
79
- return ((i = (e = d == null ? void 0 : d.value) == null ? void 0 : e.allowedType) == null ? void 0 : i.map((o) => `.${o}`).join(",")) || "";
80
- }), M = g();
81
- U(() => M.value, () => {
77
+ }), d = T(() => A([m.imageUploadOptions, C.imageUploadOptions, z]) || {}), c = T(() => A([m.videoUploadOptions, C.videoUploadOptions, V]) || {}), g = T(() => A([m.audioUploadOptions, C.audioUploadOptions, B]) || {}), U = T(() => A([m.imgPondOptions, C.imgPondOptions]) || {}), Z = T(() => {
78
+ var a, i;
79
+ return ((i = (a = d == null ? void 0 : d.value) == null ? void 0 : a.allowedType) == null ? void 0 : i.map((o) => `.${o}`).join(",")) || "";
80
+ }), M = h();
81
+ I(() => M.value, () => {
82
82
  M.value && G(M.value, {
83
83
  onStart: () => {
84
- b.value = {
84
+ f.value = {
85
85
  show: !0,
86
86
  text: "图片加载中,请稍等"
87
87
  };
88
88
  },
89
89
  onSuccess: () => {
90
- b.value.show = !1;
90
+ f.value.show = !1;
91
91
  },
92
- onError: (e) => {
93
- b.value.show = !1, w.error(e);
92
+ onError: (a) => {
93
+ f.value.show = !1, w.error(a);
94
94
  }
95
95
  });
96
96
  }, { immediate: !0 });
97
- const S = g();
98
- U(() => S.value, () => {
99
- if (S.value) {
100
- let e;
101
- G(S.value, {
102
- onStart: () => {
103
- e = Ce.service({ text: "图片加载中,请稍等", fullscreen: !0, customClass: "tinymce-loading", background: "rgba(0, 0, 0, 0.8)" });
104
- },
105
- onSuccess: () => {
106
- e == null || e.close();
107
- },
108
- onError: (i) => {
109
- e == null || e.close(), w.error(i);
110
- }
111
- });
112
- }
97
+ const S = h();
98
+ I(() => S.value, () => {
99
+ S.value && G(S.value, {
100
+ onStart: () => {
101
+ f.value = {
102
+ show: !0,
103
+ text: "图片加载中,请稍等"
104
+ };
105
+ },
106
+ onSuccess: () => {
107
+ f.value.show = !1;
108
+ },
109
+ onError: (a) => {
110
+ f.value.show = !1, w.error(a);
111
+ }
112
+ });
113
113
  }, { immediate: !0 });
114
- const _ = g({
114
+ const _ = h({
115
115
  dialogVisible: !1,
116
116
  formData: {
117
117
  images: []
118
118
  }
119
- }), R = g(), W = () => {
119
+ }), R = h(), W = () => {
120
120
  _.value.dialogVisible = !1, _.value.formData = {
121
121
  images: []
122
122
  };
123
123
  }, ee = () => {
124
- var e;
125
- (e = R.value) == null || e.validate((i) => {
124
+ var a;
125
+ (a = R.value) == null || a.validate((i) => {
126
126
  i && (_.value.formData.images.forEach((o) => {
127
127
  var t;
128
- let a = o;
129
- k.value.srcAt && (a = (o == null ? void 0 : o[k.value.srcAt]) || ""), (t = x.value) == null || t.insertContent(`<img src=${a} alt="" />`);
128
+ let e = o;
129
+ U.value.srcAt && (e = (o == null ? void 0 : o[U.value.srcAt]) || ""), (t = b.value) == null || t.insertContent(`<img src=${e} alt="" />`);
130
130
  }), W());
131
131
  });
132
- }, v = g({
132
+ }, v = h({
133
133
  dialogVisible: !1,
134
134
  formData: {
135
135
  // 名称
@@ -141,19 +141,19 @@ const ua = /* @__PURE__ */ ge({
141
141
  },
142
142
  // 用于临时保存上传前的参数 { file: File }
143
143
  additionalData: {}
144
- }), j = g(), $ = () => {
144
+ }), j = h(), $ = () => {
145
145
  v.value.dialogVisible = !1, v.value.formData = {
146
146
  name: "",
147
147
  cover: [],
148
148
  file: []
149
149
  }, v.value.additionalData = {};
150
150
  }, ae = () => {
151
- var e;
152
- (e = j.value) == null || e.validate((i) => {
153
- var o, a;
154
- i && ((a = x.value) == null || a.insertContent(`<audio controls data-name="${v.value.formData.name}" data-poster="${v.value.formData.cover[0]}" src="${(o = v.value.formData.file[0]) == null ? void 0 : o.url}"></audio>`), $());
151
+ var a;
152
+ (a = j.value) == null || a.validate((i) => {
153
+ var o, e;
154
+ i && ((e = b.value) == null || e.insertContent(`<audio controls data-name="${v.value.formData.name}" data-poster="${v.value.formData.cover[0]}" src="${(o = v.value.formData.file[0]) == null ? void 0 : o.url}"></audio>`), $());
155
155
  });
156
- }, h = g({
156
+ }, x = h({
157
157
  dialogVisible: !1,
158
158
  formData: {
159
159
  // 文件
@@ -161,37 +161,37 @@ const ua = /* @__PURE__ */ ge({
161
161
  },
162
162
  // 用于临时保存上传前的参数 { file: File }
163
163
  additionalData: {}
164
- }), E = g(), q = () => {
165
- h.value.dialogVisible = !1, h.value.formData = {
164
+ }), E = h(), q = () => {
165
+ x.value.dialogVisible = !1, x.value.formData = {
166
166
  file: []
167
- }, h.value.additionalData = {};
167
+ }, x.value.additionalData = {};
168
168
  }, te = () => {
169
- var e;
170
- (e = E.value) == null || e.validate((i) => {
171
- var o, a;
172
- i && ((a = x.value) == null || a.insertContent(`<video controls controlslist="nodownload" src="${(o = h.value.formData.file[0]) == null ? void 0 : o.url}"></video>`), q());
169
+ var a;
170
+ (a = E.value) == null || a.validate((i) => {
171
+ var o, e;
172
+ i && ((e = b.value) == null || e.insertContent(`<video controls controlslist="nodownload" src="${(o = x.value.formData.file[0]) == null ? void 0 : o.url}"></video>`), q());
173
173
  });
174
- }, oe = (e, i) => new Promise(async (o, a) => {
174
+ }, oe = (a, i) => new Promise(async (o, e) => {
175
175
  var r, l;
176
- const t = await J(e);
176
+ const t = await J(a);
177
177
  if (!t.success) {
178
- a(), setTimeout(() => {
178
+ e(), setTimeout(() => {
179
179
  i.onError(t.errorMessage);
180
180
  });
181
181
  return;
182
182
  }
183
- const n = await ((l = (r = d.value).handleRequest) == null ? void 0 : l.call(r, K(t.file, e.name), e.name, { extParameters: c.extParameters }));
183
+ const n = await ((l = (r = d.value).handleRequest) == null ? void 0 : l.call(r, K(t.file, a.name), a.name, { extParameters: m.extParameters }));
184
184
  if (!n || !(n != null && n.success)) {
185
- a(), setTimeout(() => {
185
+ e(), setTimeout(() => {
186
186
  i.onError(n == null ? void 0 : n.errorMessage);
187
187
  });
188
188
  return;
189
189
  }
190
190
  o(n.url);
191
191
  });
192
- async function F(e) {
193
- var o, a, t, n, r;
194
- const i = e.getElementsByTagName("img");
192
+ async function F(a) {
193
+ var o, e, t, n, r;
194
+ const i = a.getElementsByTagName("img");
195
195
  for (let l of i) {
196
196
  const s = l.src;
197
197
  if (s.startsWith("data:image"))
@@ -199,7 +199,7 @@ const ua = /* @__PURE__ */ ge({
199
199
  else if (s.startsWith("http://") || s.startsWith("https://")) {
200
200
  const u = await we(s);
201
201
  if (u && (u.width < (d.value.minWidth || 0) && u.height < (d.value.minHeight || 0) || u.width > (d.value.maxWidth || 0) && u.height > (d.value.maxHeight || 0))) {
202
- (a = l == null ? void 0 : l.remove) == null || a.call(l);
202
+ (e = l == null ? void 0 : l.remove) == null || e.call(l);
203
203
  return;
204
204
  }
205
205
  const p = Q(s);
@@ -212,7 +212,7 @@ const ua = /* @__PURE__ */ ge({
212
212
  }
213
213
  he(() => {
214
214
  var o;
215
- const e = {
215
+ const a = {
216
216
  // 设置语言
217
217
  language: "zh_CN",
218
218
  // 实例
@@ -293,25 +293,25 @@ const ua = /* @__PURE__ */ ge({
293
293
  paste_data_images: !0,
294
294
  images_file_types: ((o = d.value.allowedType) == null ? void 0 : o.join(",")) || "jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp",
295
295
  // 粘贴前处理
296
- paste_preprocess(a, t) {
296
+ paste_preprocess(e, t) {
297
297
  t.content = t.content.replace(/<video[^>]*(?:\/>|>[\s\S]*?<\/video>)/g, ""), t.content = t.content.replace(/<audio[^>]*(?:\/>|>[\s\S]*?<\/audio>)/g, ""), t.content = t.content.replace(/<nav/g, "<div").replace(/<\/nav>/g, "</div>"), t.content = t.content.replace(/<header/g, "<div").replace(/<\/header>/g, "</div>"), t.content = t.content.replace(/<footer/g, "<div").replace(/<\/footer>/g, "</div>"), t.content = t.content.replace(/<aside/g, "<div").replace(/<\/aside>/g, "</div>"), t.content = t.content.replace(/<section/g, "<div").replace(/<\/section>/g, "</div>"), t.content = t.content.replace(/<main/g, "<div").replace(/<\/main>/g, "</div>"), t.content = t.content.replace(/<article/g, "<div").replace(/<\/article>/g, "</div>"), t.content = t.content.replace(/<details/g, "<div").replace(/<\/details>/g, "</div>");
298
298
  },
299
299
  // 粘贴后处理(处理异步操作)
300
- paste_postprocess(a, t) {
300
+ paste_postprocess(e, t) {
301
301
  F(t.node);
302
302
  },
303
- images_upload_handler(a) {
303
+ images_upload_handler(e) {
304
304
  return new Promise(async (t, n) => {
305
305
  var y, N, O;
306
306
  if (!((y = d.value) != null && y.handleRequest))
307
307
  return n({ message: "缺少图片上传配置", remove: !0 });
308
- b.value = {
308
+ f.value = {
309
309
  show: !0,
310
310
  text: "图片上传中,请稍等"
311
311
  };
312
- let r = a.blob(), l = r.name ? r.name : a.filename();
312
+ let r = e.blob(), l = r.name ? r.name : e.filename();
313
313
  if (!(r != null && r.name) && !(r != null && r.lastModified) && r.type === "image/png")
314
- return b.value.show = !1, n({ message: "不允许粘贴", remove: !0 });
314
+ return f.value.show = !1, n({ message: "不允许粘贴", remove: !0 });
315
315
  const s = await be(r, l, {
316
316
  imageMaxSize: d.value.maxSize,
317
317
  imageAllowedType: d.value.allowedType,
@@ -322,7 +322,7 @@ const ua = /* @__PURE__ */ ge({
322
322
  imageMaxHeight: d.value.maxHeight
323
323
  });
324
324
  if (!s.success)
325
- return b.value.show = !1, n({ message: (s == null ? void 0 : s.errorMessage) || "", remove: !0 });
325
+ return f.value.show = !1, n({ message: (s == null ? void 0 : s.errorMessage) || "", remove: !0 });
326
326
  if (s.hasTransform) {
327
327
  r = s.file;
328
328
  const L = l == null ? void 0 : l.split(".");
@@ -330,14 +330,14 @@ const ua = /* @__PURE__ */ ge({
330
330
  }
331
331
  const u = await J(r);
332
332
  if (!u.success)
333
- return b.value.show = !1, n({ message: u == null ? void 0 : u.errorMessage, remove: !0 });
334
- const p = await ((O = (N = d.value).handleRequest) == null ? void 0 : O.call(N, K(u.file, l), l, { extParameters: c.extParameters }));
333
+ return f.value.show = !1, n({ message: u == null ? void 0 : u.errorMessage, remove: !0 });
334
+ const p = await ((O = (N = d.value).handleRequest) == null ? void 0 : O.call(N, K(u.file, l), l, { extParameters: m.extParameters }));
335
335
  if (!p || !p.success)
336
- return b.value.show = !1, n({ message: p.errorMessage, remove: !0 });
337
- b.value.show = !1, t(p.url);
336
+ return f.value.show = !1, n({ message: p.errorMessage, remove: !0 });
337
+ f.value.show = !1, t(p.url);
338
338
  });
339
339
  },
340
- setup(a) {
340
+ setup(e) {
341
341
  var n, r;
342
342
  const t = () => {
343
343
  _.value.dialogVisible = !0, setTimeout(() => {
@@ -346,15 +346,15 @@ const ua = /* @__PURE__ */ ge({
346
346
  l && (l.innerHTML = ((u = d.value) == null ? void 0 : u.tipText) || "上传");
347
347
  });
348
348
  };
349
- if (a.ui.registry.addMenuItem("localImage", {
349
+ if (e.ui.registry.addMenuItem("localImage", {
350
350
  text: "图片",
351
351
  icon: "image",
352
352
  onAction: () => t()
353
- }), a.ui.registry.addButton("localImage", {
353
+ }), e.ui.registry.addButton("localImage", {
354
354
  icon: "image",
355
355
  tooltip: "图片",
356
356
  onAction: () => t()
357
- }), (n = f == null ? void 0 : f.value) != null && n.enable) {
357
+ }), (n = g == null ? void 0 : g.value) != null && n.enable) {
358
358
  const l = () => {
359
359
  v.value.dialogVisible = !0, setTimeout(() => {
360
360
  var u, p;
@@ -362,139 +362,139 @@ const ua = /* @__PURE__ */ ge({
362
362
  s && (s.innerHTML = ((p = d.value) == null ? void 0 : p.tipText) || "上传");
363
363
  });
364
364
  };
365
- a.ui.registry.addMenuItem("localAudio", {
365
+ e.ui.registry.addMenuItem("localAudio", {
366
366
  text: "音频",
367
367
  icon: "arrow-right",
368
368
  onAction: () => l()
369
- }), a.ui.registry.addButton("localAudio", {
369
+ }), e.ui.registry.addButton("localAudio", {
370
370
  icon: "arrow-right",
371
371
  tooltip: "音频",
372
372
  onAction: () => l()
373
373
  });
374
374
  }
375
- if ((r = m == null ? void 0 : m.value) != null && r.enable) {
375
+ if ((r = c == null ? void 0 : c.value) != null && r.enable) {
376
376
  const l = () => {
377
- h.value.dialogVisible = !0;
377
+ x.value.dialogVisible = !0;
378
378
  };
379
- a.ui.registry.addMenuItem("localVideo", {
379
+ e.ui.registry.addMenuItem("localVideo", {
380
380
  text: "视频",
381
381
  icon: "embed",
382
382
  onAction: () => l()
383
- }), a.ui.registry.addButton("localVideo", {
383
+ }), e.ui.registry.addButton("localVideo", {
384
384
  icon: "embed",
385
385
  tooltip: "视频",
386
386
  onAction: () => l()
387
387
  });
388
388
  }
389
389
  }
390
- }, i = T(
390
+ }, i = A(
391
391
  [
392
- c.options,
393
- A.options,
394
- e
392
+ m.options,
393
+ C.options,
394
+ a
395
395
  ],
396
396
  {
397
- mergeFunction: (a, t) => (...n) => {
398
- a(...n), t(...n);
397
+ mergeFunction: (e, t) => (...n) => {
398
+ e(...n), t(...n);
399
399
  },
400
400
  type: Object
401
401
  }
402
402
  );
403
- X.init(i).then(([a]) => {
403
+ X.init(i).then(([e]) => {
404
404
  var t;
405
- a && (a.customProps = { ...c }, a.on("change input Redo Undo SetContent", () => {
405
+ e && (e.customProps = { ...m }, e.on("change input Redo Undo SetContent", () => {
406
406
  if (D.value) {
407
407
  D.value = !1;
408
408
  return;
409
409
  }
410
- P.value = !0, I("input", a.getContent());
411
- }), a.on("paste", (n) => {
410
+ P.value = !0, k("input", e.getContent());
411
+ }), e.on("paste", (n) => {
412
412
  var l, s;
413
413
  const r = ((l = n.clipboardData) == null ? void 0 : l.files) || [];
414
414
  for (let u of r) {
415
415
  const p = Q(u.name) || "";
416
416
  (s = d.value.allowedType) != null && s.includes(p.toLowerCase()) || n.preventDefault();
417
417
  }
418
- }), (t = c.initComplete) == null || t.call(c, { editorIns: a }), x.value = a);
418
+ }), (t = m.initComplete) == null || t.call(m, { editorIns: e }), b.value = e);
419
419
  });
420
420
  }), xe(() => {
421
- var e;
422
- (e = x.value) == null || e.destroy();
421
+ var a;
422
+ (a = b.value) == null || a.destroy();
423
423
  });
424
424
  const ie = () => {
425
425
  var i, o;
426
- const e = { ...v.value.additionalData || {} };
427
- return ((o = (i = f.value) == null ? void 0 : i.data) == null ? void 0 : o.call(i, { file: e, extParameters: c.extParameters })) || {};
426
+ const a = { ...v.value.additionalData || {} };
427
+ return ((o = (i = g.value) == null ? void 0 : i.data) == null ? void 0 : o.call(i, { file: a, extParameters: m.extParameters })) || {};
428
428
  }, le = () => {
429
429
  var i, o;
430
- const e = { ...v.value.additionalData || {} };
431
- return ((o = (i = f.value) == null ? void 0 : i.headers) == null ? void 0 : o.call(i, { file: e, extParameters: c.extParameters })) || {};
432
- }, ne = (e, i, o) => {
430
+ const a = { ...v.value.additionalData || {} };
431
+ return ((o = (i = g.value) == null ? void 0 : i.headers) == null ? void 0 : o.call(i, { file: a, extParameters: m.extParameters })) || {};
432
+ }, ne = (a, i, o) => {
433
433
  var t, n;
434
- const a = (n = (t = f == null ? void 0 : f.value) == null ? void 0 : t.handlerResponse) == null ? void 0 : n.call(t, e);
435
- a != null && a.url ? o[o.length - 1].url = a.url : a != null && a.errorMessage && (w.error(a.errorMessage), o.splice(o.length - 1, 1)), v.value.formData.file = o;
436
- }, re = (e, i) => new Promise((o, a) => {
434
+ const e = (n = (t = g == null ? void 0 : g.value) == null ? void 0 : t.handlerResponse) == null ? void 0 : n.call(t, a);
435
+ e != null && e.url ? o[o.length - 1].url = e.url : e != null && e.errorMessage && (w.error(e.errorMessage), o.splice(o.length - 1, 1)), v.value.formData.file = o;
436
+ }, re = (a, i) => new Promise((o, e) => {
437
437
  var n, r, l, s, u, p;
438
- const t = e.name.split(".").filter(Boolean).pop() ? e.name.split(".").filter(Boolean).pop() : "";
439
- if (!((r = (n = f.value) == null ? void 0 : n.allowedType) != null && r.includes(t.toLowerCase()))) {
440
- w.error(`请上传格式为${(s = (l = f.value) == null ? void 0 : l.allowedType) == null ? void 0 : s.map((y) => y.toUpperCase()).join("、")}的音频`), a();
438
+ const t = a.name.split(".").filter(Boolean).pop() ? a.name.split(".").filter(Boolean).pop() : "";
439
+ if (!((r = (n = g.value) == null ? void 0 : n.allowedType) != null && r.includes(t.toLowerCase()))) {
440
+ w.error(`请上传格式为${(s = (l = g.value) == null ? void 0 : l.allowedType) == null ? void 0 : s.map((y) => y.toUpperCase()).join("、")}的音频`), e();
441
441
  return;
442
442
  }
443
- if (e.size > (((u = f.value) == null ? void 0 : u.maxSize) || 0) * 1024 * 1024) {
444
- w.error(`请上传${((p = f.value) == null ? void 0 : p.maxSize) || 0}M内的音频`), a();
443
+ if (a.size > (((u = g.value) == null ? void 0 : u.maxSize) || 0) * 1024 * 1024) {
444
+ w.error(`请上传${((p = g.value) == null ? void 0 : p.maxSize) || 0}M内的音频`), e();
445
445
  return;
446
446
  }
447
- v.value.additionalData = { file: e }, o(!0);
448
- }), se = (e, i) => {
447
+ v.value.additionalData = { file: a }, o(!0);
448
+ }), se = (a, i) => {
449
449
  v.value.formData.file = i;
450
- }, ue = (e, i, o) => {
450
+ }, ue = (a, i, o) => {
451
451
  w.error("上传发生错误,请重试!"), v.value.formData.file = o;
452
452
  }, de = () => {
453
453
  var i, o;
454
- const e = { ...h.value.additionalData || {} };
455
- return ((o = (i = m.value) == null ? void 0 : i.data) == null ? void 0 : o.call(i, { file: e, extParameters: c.extParameters })) || {};
456
- }, ce = () => {
454
+ const a = { ...x.value.additionalData || {} };
455
+ return ((o = (i = c.value) == null ? void 0 : i.data) == null ? void 0 : o.call(i, { file: a, extParameters: m.extParameters })) || {};
456
+ }, me = () => {
457
457
  var i, o;
458
- const e = { ...h.value.additionalData || {} };
459
- return ((o = (i = m.value) == null ? void 0 : i.headers) == null ? void 0 : o.call(i, { file: e, extParameters: c.extParameters })) || {};
460
- }, me = (e, i, o) => {
458
+ const a = { ...x.value.additionalData || {} };
459
+ return ((o = (i = c.value) == null ? void 0 : i.headers) == null ? void 0 : o.call(i, { file: a, extParameters: m.extParameters })) || {};
460
+ }, ce = (a, i, o) => {
461
461
  var t, n;
462
- const a = (n = (t = m == null ? void 0 : m.value) == null ? void 0 : t.handlerResponse) == null ? void 0 : n.call(t, e);
463
- a != null && a.url ? o[o.length - 1].url = a.url : a != null && a.errorMessage && (w.error(a.errorMessage), o.splice(o.length - 1, 1)), h.value.formData.file = o;
464
- }, pe = (e, i) => new Promise((o, a) => {
462
+ const e = (n = (t = c == null ? void 0 : c.value) == null ? void 0 : t.handlerResponse) == null ? void 0 : n.call(t, a);
463
+ e != null && e.url ? o[o.length - 1].url = e.url : e != null && e.errorMessage && (w.error(e.errorMessage), o.splice(o.length - 1, 1)), x.value.formData.file = o;
464
+ }, pe = (a, i) => new Promise((o, e) => {
465
465
  var n, r, l, s, u, p;
466
- const t = e.name.split(".").filter(Boolean).pop() ? e.name.split(".").filter(Boolean).pop() : "";
467
- if (!((r = (n = m == null ? void 0 : m.value) == null ? void 0 : n.allowedType) != null && r.includes(t.toLowerCase()))) {
468
- w.error(`请上传格式为${(s = (l = m == null ? void 0 : m.value) == null ? void 0 : l.allowedType) == null ? void 0 : s.map((y) => y.toUpperCase()).join("、")}的视频`), a();
466
+ const t = a.name.split(".").filter(Boolean).pop() ? a.name.split(".").filter(Boolean).pop() : "";
467
+ if (!((r = (n = c == null ? void 0 : c.value) == null ? void 0 : n.allowedType) != null && r.includes(t.toLowerCase()))) {
468
+ w.error(`请上传格式为${(s = (l = c == null ? void 0 : c.value) == null ? void 0 : l.allowedType) == null ? void 0 : s.map((y) => y.toUpperCase()).join("、")}的视频`), e();
469
469
  return;
470
470
  }
471
- if (e.size > (((u = m == null ? void 0 : m.value) == null ? void 0 : u.maxSize) || 0) * 1024 * 1024) {
472
- w.error(`请上传${((p = m == null ? void 0 : m.value) == null ? void 0 : p.maxSize) || 0}M内的视频`), a();
471
+ if (a.size > (((u = c == null ? void 0 : c.value) == null ? void 0 : u.maxSize) || 0) * 1024 * 1024) {
472
+ w.error(`请上传${((p = c == null ? void 0 : c.value) == null ? void 0 : p.maxSize) || 0}M内的视频`), e();
473
473
  return;
474
474
  }
475
- h.value.additionalData = { file: e }, o(!0);
476
- }), ve = (e, i) => {
477
- h.value.formData.file = i;
478
- }, fe = (e, i, o) => {
479
- w.error("上传发生错误,请重试!"), h.value.formData.file = o;
475
+ x.value.additionalData = { file: a }, o(!0);
476
+ }), ve = (a, i) => {
477
+ x.value.formData.file = i;
478
+ }, fe = (a, i, o) => {
479
+ w.error("上传发生错误,请重试!"), x.value.formData.file = o;
480
480
  };
481
- return U(() => [c.disabled, x.value], () => {
482
- var e, i;
483
- (i = (e = x.value) == null ? void 0 : e.mode) == null || i.set(c.disabled ? "readonly" : "design");
484
- }, { immediate: !0 }), U(
485
- () => [c.value, x.value],
481
+ return I(() => [m.disabled, b.value], () => {
482
+ var a, i;
483
+ (i = (a = b.value) == null ? void 0 : a.mode) == null || i.set(m.disabled ? "readonly" : "design");
484
+ }, { immediate: !0 }), I(
485
+ () => [m.value, b.value],
486
486
  () => {
487
- var e;
487
+ var a;
488
488
  if (P.value) {
489
489
  P.value = !1;
490
490
  return;
491
491
  }
492
- D.value = !0, (e = x.value) == null || e.setContent(c.value ? c.value : "");
492
+ D.value = !0, (a = b.value) == null || a.setContent(m.value ? m.value : "");
493
493
  },
494
494
  { immediate: !0 }
495
- ), { __sfc: !0, defaultImageUploadOptions: z, defaultVideoUploadOptions: V, defaultAudioUploadOptions: B, props: c, emits: I, insRef: H, editorRef: x, preventSettingContent: P, preventUpdatingModelValue: D, uploadLoadingConfig: b, mergeImageUploadOptions: d, mergeVideoUploadOptions: m, mergeAudioUploadOptions: f, mergeImgPondOptions: k, imgPondAccept: Z, uploadImageImgPondRef: M, audioImageImgPondRef: S, uploadImage: _, uploadImageFormRef: R, onUploadImageClose: W, onUploadImageConfirm: ee, uploadAudio: v, uploadAudioFormRef: j, onUploadAudioClose: $, onUploadAudioConfirm: ae, uploadVideo: h, uploadVideoFormRef: E, onUploadVideoClose: q, onUploadVideoConfirm: te, onImageUploadUpload: oe, processPastedImage: F, getUploadAudioData: ie, getUploadAudioHeaders: le, onUploadAudioSuccess: ne, onUploadAudioBeforeUpload: re, onUploadAudioRemove: se, onUploadAudioError: ue, getUploadVideoData: de, getUploadVideoHeaders: ce, onUploadVideoSuccess: me, onUploadVideoBeforeUpload: pe, onUploadVideoRemove: ve, onUploadVideoError: fe, ImgPond: ye };
495
+ ), { __sfc: !0, defaultImageUploadOptions: z, defaultVideoUploadOptions: V, defaultAudioUploadOptions: B, props: m, emits: k, insRef: H, editorRef: b, preventSettingContent: P, preventUpdatingModelValue: D, uploadLoadingConfig: f, mergeImageUploadOptions: d, mergeVideoUploadOptions: c, mergeAudioUploadOptions: g, mergeImgPondOptions: U, imgPondAccept: Z, uploadImageImgPondRef: M, audioImageImgPondRef: S, uploadImage: _, uploadImageFormRef: R, onUploadImageClose: W, onUploadImageConfirm: ee, uploadAudio: v, uploadAudioFormRef: j, onUploadAudioClose: $, onUploadAudioConfirm: ae, uploadVideo: x, uploadVideoFormRef: E, onUploadVideoClose: q, onUploadVideoConfirm: te, onImageUploadUpload: oe, processPastedImage: F, getUploadAudioData: ie, getUploadAudioHeaders: le, onUploadAudioSuccess: ne, onUploadAudioBeforeUpload: re, onUploadAudioRemove: se, onUploadAudioError: ue, getUploadVideoData: de, getUploadVideoHeaders: me, onUploadVideoSuccess: ce, onUploadVideoBeforeUpload: pe, onUploadVideoRemove: ve, onUploadVideoError: fe, ImgPond: ye };
496
496
  }
497
497
  });
498
498
  export {
499
- ua as default
499
+ sa as default
500
500
  };
package/es/style.css CHANGED
@@ -1 +1 @@
1
- .tox-tinymce-aux{z-index:10000!important}.tox-statusbar__branding{display:none!important}.tinymce-editor-dialog .el-dialog{min-width:600px}.tinymce-editor-upload-image-dialog .uploadImageForm{display:flex;align-content:center}.tinymce-editor-upload-image-dialog .uploadImageForm .tips{margin-left:20px;display:flex;flex-direction:column}.tinymce-editor-upload-image-dialog .uploadImageForm .tips>span{margin-bottom:16px}.tinymce-editor-dialog .upload-hide .el-upload,.tinymce-editor-dialog .upload-hide .el-upload__tip{display:none}.el-loading-mask.is-fullscreen.tinymce-loading{z-index:3000!important}.tinymce-editor-loading-dialog{z-index:4000!important}.tinymce-editor-loading-dialog .el-dialog{margin-top:calc(50vh - 107px);width:388px;min-width:auto!important;height:214px;background-image:linear-gradient(-72deg,#d8faff,#fff);box-shadow:0 2px 20px #00000012;border-radius:16px}.tinymce-editor-loading-dialog .el-dialog .el-dialog__header{display:none}.tinymce-editor-loading-dialog .el-dialog .el-dialog__body{height:100%}.tinymce-editor-loading-dialog .el-dialog .el-dialog__body .tinymce-editor-loading-dialog-content{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}.tinymce-editor-loading-dialog .el-dialog .el-dialog__body .tinymce-editor-loading-dialog-content span{margin-top:15px;font-size:16px;color:#1d2129;line-height:24px;font-weight:500}.tinymce-editor-spinner{width:60px;height:60px;position:relative;text-align:center;-webkit-animation:sk-rotate 2s infinite linear;animation:sk-rotate 2s infinite linear}.tinymce-editor-spinner-dot1,.tinymce-editor-spinner-dot2,.tinymce-editor-spinner-dot3{width:24px;height:24px;display:inline-block;position:absolute;top:0;background-color:#333;border-radius:100%;-webkit-animation:sk-bounce 2s infinite ease-in-out;animation:sk-bounce 2s infinite ease-in-out}.tinymce-editor-spinner-dot1{left:calc(50% - 12px);background-color:#5dff8e}.tinymce-editor-spinner-dot2{top:auto;bottom:0;right:0;-webkit-animation-delay:-1s;animation-delay:-1s;background-color:#21f4c7}.tinymce-editor-spinner-dot3{top:auto;bottom:0;left:0;-webkit-animation-delay:-1s;animation-delay:-1s;background-color:#98ff56}@-webkit-keyframes sk-rotate{to{-webkit-transform:rotate(360deg)}}@keyframes sk-rotate{to{transform:rotate(360deg);-webkit-transform:rotate(360deg)}}@-webkit-keyframes sk-bounce{0%,to{-webkit-transform:scale(0)}50%{-webkit-transform:scale(1)}}@keyframes sk-bounce{0%,to{transform:scale(0);-webkit-transform:scale(0)}50%{transform:scale(1);-webkit-transform:scale(1)}}
1
+ .tox-tinymce-aux{z-index:10000!important}.tox-statusbar__branding{display:none!important}.tinymce-editor-dialog .el-dialog{min-width:600px}.tinymce-editor-upload-image-dialog .uploadImageForm{display:flex;align-content:center}.tinymce-editor-upload-image-dialog .uploadImageForm .tips{margin-left:20px;display:flex;flex-direction:column}.tinymce-editor-upload-image-dialog .uploadImageForm .tips>span{margin-bottom:16px}.tinymce-editor-dialog .upload-hide .el-upload,.tinymce-editor-dialog .upload-hide .el-upload__tip{display:none}.tinymce-editor-loading-dialog{z-index:4000!important}.tinymce-editor-loading-dialog .el-dialog{margin-top:calc(50vh - 107px);width:388px;min-width:auto!important;height:214px;background-image:linear-gradient(-72deg,#d8faff,#fff);box-shadow:0 2px 20px #00000012;border-radius:16px}.tinymce-editor-loading-dialog .el-dialog .el-dialog__header{display:none!important}.tinymce-editor-loading-dialog .el-dialog .el-dialog__body{height:100%}.tinymce-editor-loading-dialog .el-dialog .el-dialog__body .tinymce-editor-loading-dialog-content{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}.tinymce-editor-loading-dialog .el-dialog .el-dialog__body .tinymce-editor-loading-dialog-content span{margin-top:15px;font-size:16px;color:#1d2129;line-height:24px;font-weight:500}.tinymce-editor-spinner{width:60px;height:60px;position:relative;text-align:center;-webkit-animation:sk-rotate 2s infinite linear;animation:sk-rotate 2s infinite linear}.tinymce-editor-spinner-dot1,.tinymce-editor-spinner-dot2,.tinymce-editor-spinner-dot3{width:24px;height:24px;display:inline-block;position:absolute;top:0;background-color:#333;border-radius:100%;-webkit-animation:sk-bounce 2s infinite ease-in-out;animation:sk-bounce 2s infinite ease-in-out}.tinymce-editor-spinner-dot1{left:calc(50% - 12px);background-color:#5dff8e}.tinymce-editor-spinner-dot2{top:auto;bottom:0;right:0;-webkit-animation-delay:-1s;animation-delay:-1s;background-color:#21f4c7}.tinymce-editor-spinner-dot3{top:auto;bottom:0;left:0;-webkit-animation-delay:-1s;animation-delay:-1s;background-color:#98ff56}@-webkit-keyframes sk-rotate{to{-webkit-transform:rotate(360deg)}}@keyframes sk-rotate{to{transform:rotate(360deg);-webkit-transform:rotate(360deg)}}@-webkit-keyframes sk-bounce{0%,to{-webkit-transform:scale(0)}50%{-webkit-transform:scale(1)}}@keyframes sk-bounce{0%,to{transform:scale(0);-webkit-transform:scale(0)}50%{transform:scale(1);-webkit-transform:scale(1)}}
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.30",
5
+ "version": "0.0.12-alpha.32",
6
6
  "private": false,
7
7
  "type": "module",
8
8
  "main": "es/index.js",