@keyblade/tinymce-editor-vue2 0.0.5-alpha.1 → 0.0.5-alpha.3

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 +14 -8
  2. package/package.json +2 -2
package/es/editor.vue2.js CHANGED
@@ -32,7 +32,7 @@ import "tinymce/plugins/visualblocks";
32
32
  import "tinymce/plugins/visualchars";
33
33
  import "tinymce/plugins/wordcount";
34
34
  import { globalProps as d } from "./index.js";
35
- const ke = /* @__PURE__ */ F({
35
+ const Se = /* @__PURE__ */ F({
36
36
  __name: "editor",
37
37
  props: {
38
38
  value: { default: "" },
@@ -66,8 +66,8 @@ const ke = /* @__PURE__ */ F({
66
66
  (o = a == null ? void 0 : a.remove) == null || o.call(a);
67
67
  return;
68
68
  }
69
- const w = t.split("."), S = w[w.length - 1].toLowerCase();
70
- if (!i.imageAllowedType.includes(S)) {
69
+ const w = t.split("."), k = w[w.length - 1].toLowerCase();
70
+ if (!i.imageAllowedType.includes(k)) {
71
71
  (e = a == null ? void 0 : a.remove) == null || e.call(a);
72
72
  return;
73
73
  }
@@ -186,6 +186,12 @@ const ke = /* @__PURE__ */ F({
186
186
  convert_urls: !1,
187
187
  paste_webkit_styles: "all",
188
188
  paste_data_images: !0,
189
+ menu: {
190
+ insert: {
191
+ title: "菜单",
192
+ items: "link"
193
+ }
194
+ },
189
195
  // 粘贴前处理
190
196
  paste_preprocess(o, e) {
191
197
  var a;
@@ -202,7 +208,7 @@ const ke = /* @__PURE__ */ F({
202
208
  var x, V, B;
203
209
  const t = (V = (x = d.message) == null ? void 0 : x.loading) == null ? void 0 : V.call(x);
204
210
  let r = o.blob();
205
- const w = o.base64(), S = o.filename(), P = r.name.split("."), $ = P[P.length - 1].toLowerCase();
211
+ const w = o.base64(), k = o.filename(), P = r.name.split("."), $ = P[P.length - 1].toLowerCase();
206
212
  if (r.size > i.imageMaxSize * 1024 * 1024)
207
213
  return t == null || t.close(), a({ message: `请上传大小不超过${i.imageMaxSize}M的图片`, remove: !0 });
208
214
  if (!i.imageAllowedMineType.includes(r.type))
@@ -212,8 +218,8 @@ const ke = /* @__PURE__ */ F({
212
218
  return t == null || t.close(), a({ message: `请上传像素不低于${i.imageMinWidth}*${i.imageMinHeight}且像素不高于${i.imageMaxWidth}*${i.imageMaxHeight}的图片`, remove: !0 });
213
219
  const l = {};
214
220
  ["image/heif", "image/heic", "image/webp"].includes($) && (l.convertTypes = [r.type], l.convertSize = 0);
215
- const k = 5 * 1024 * 1024;
216
- if (r.size > k && (l.convertTypes = [r.type], l.convertSize = k, l.maxWidth = p.width * (k / r.size)), Object.keys(l).length > 0) {
221
+ const S = 5 * 1024 * 1024;
222
+ if (r.size > S && (l.convertTypes = [r.type], l.convertSize = S, l.maxWidth = p.width * (S / r.size)), Object.keys(l).length > 0) {
217
223
  const u = await T(H(U), l);
218
224
  if (u.success)
219
225
  r = u.file;
@@ -222,7 +228,7 @@ const ke = /* @__PURE__ */ F({
222
228
  }
223
229
  if (!c.value)
224
230
  return t == null || t.close(), a({ message: "缺少图片上传配置", remove: !0 });
225
- const z = await ((B = c.value) == null ? void 0 : B.call(c, r, S));
231
+ const z = await ((B = c.value) == null ? void 0 : B.call(c, r, k));
226
232
  if (!z.success)
227
233
  return t == null || t.close(), a({ message: z.errorMessage, remove: !0 });
228
234
  t == null || t.close(), e(z.url);
@@ -272,5 +278,5 @@ const ke = /* @__PURE__ */ F({
272
278
  }
273
279
  });
274
280
  export {
275
- ke as default
281
+ Se as default
276
282
  };
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.5-alpha.01",
5
+ "version": "0.0.5-alpha.03",
6
6
  "private": false,
7
7
  "type": "module",
8
8
  "main": "es/index.js",
@@ -21,7 +21,7 @@
21
21
  ],
22
22
  "dependencies": {
23
23
  "compressorjs": "^1.2.1",
24
- "vue-global-config": "^0.6.1",
24
+ "vue-global-config": "^0.2.6",
25
25
  "tinymce": "^7.1.0"
26
26
  },
27
27
  "devDependencies": {},