@keyblade/tinymce-editor-vue2 0.0.12-alpha.12 → 0.0.12-alpha.14
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/README.md +4 -1
- package/es/editor.vue.d.ts +1 -1
- package/es/editor.vue2.js +12 -10
- package/es/index.d.ts +26 -26
- package/es/util.d.ts +1 -0
- package/es/util.js +69 -56
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -110,6 +110,7 @@ import { oneTravelImageCheck, oneTravelImageCompressor } from '@keyblade/tinymce
|
|
|
110
110
|
```typescript
|
|
111
111
|
export async function oneTravelImageCheck(data: File | Blob, options?: {
|
|
112
112
|
imageMaxSize?: number;
|
|
113
|
+
imageAllowedType?: string[];
|
|
113
114
|
imageAllowedMineType?: string[]
|
|
114
115
|
imageMinWidth?: number;
|
|
115
116
|
imageMinHeight?: number;
|
|
@@ -126,7 +127,9 @@ export async function oneTravelImageCheck(data: File | Blob, options?: {
|
|
|
126
127
|
format?: boolean;
|
|
127
128
|
pixel?: boolean;
|
|
128
129
|
message?: string
|
|
129
|
-
}
|
|
130
|
+
},
|
|
131
|
+
/** 错误消息 */
|
|
132
|
+
errorMessage?: string;
|
|
130
133
|
}> {}
|
|
131
134
|
|
|
132
135
|
export async function oneTravelImageCompressor(data: File | Blob): Promise<{
|
package/es/editor.vue.d.ts
CHANGED
|
@@ -237,6 +237,7 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
237
237
|
options: () => {};
|
|
238
238
|
}>>>, {
|
|
239
239
|
imageMaxSize: number;
|
|
240
|
+
imageAllowedType: string[];
|
|
240
241
|
imageAllowedMineType: string[];
|
|
241
242
|
imageMinWidth: number;
|
|
242
243
|
imageMinHeight: number;
|
|
@@ -246,7 +247,6 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
246
247
|
modelValue: string;
|
|
247
248
|
imageUploadMaxCount: number;
|
|
248
249
|
imageUploadTip: string;
|
|
249
|
-
imageAllowedType: string[];
|
|
250
250
|
audioEnable: boolean;
|
|
251
251
|
audioMaxSize: number;
|
|
252
252
|
audioAllowedType: string[];
|
package/es/editor.vue2.js
CHANGED
|
@@ -32,7 +32,7 @@ import "tinymce/plugins/table";
|
|
|
32
32
|
import "tinymce/plugins/visualblocks";
|
|
33
33
|
import "tinymce/plugins/visualchars";
|
|
34
34
|
import "tinymce/plugins/wordcount";
|
|
35
|
-
import { globalProps as
|
|
35
|
+
import { globalProps as y } from "./index.js";
|
|
36
36
|
import { Loading as xe, Message as h } from "element-ui";
|
|
37
37
|
const ia = /* @__PURE__ */ ce({
|
|
38
38
|
__name: "editor",
|
|
@@ -140,6 +140,7 @@ const ia = /* @__PURE__ */ ce({
|
|
|
140
140
|
var p, c;
|
|
141
141
|
const t = await N(i, {
|
|
142
142
|
imageMaxSize: a.imageMaxSize,
|
|
143
|
+
imageAllowedType: a.imageAllowedType,
|
|
143
144
|
imageAllowedMineType: a.imageAllowedMineType,
|
|
144
145
|
imageMinWidth: a.imageMinWidth,
|
|
145
146
|
imageMinHeight: a.imageMinHeight,
|
|
@@ -190,16 +191,16 @@ const ia = /* @__PURE__ */ ce({
|
|
|
190
191
|
}
|
|
191
192
|
}
|
|
192
193
|
}
|
|
193
|
-
const
|
|
194
|
-
() => x([a.paste_preprocess,
|
|
194
|
+
const b = M(() => x([a.videoUploadOptions, y.videoUploadOptions]) || {}), _ = M(() => x([a.audioUploadOptions, y.audioUploadOptions]) || {}), $ = M(() => x([a.imgPondOptions, y.imgPondOptions]) || {}), C = M(
|
|
195
|
+
() => x([a.paste_preprocess, y.paste_preprocess], {
|
|
195
196
|
type: Function
|
|
196
197
|
})
|
|
197
198
|
), D = M(
|
|
198
|
-
() => x([a.paste_postprocess,
|
|
199
|
+
() => x([a.paste_postprocess, y.paste_postprocess], {
|
|
199
200
|
type: Function
|
|
200
201
|
})
|
|
201
202
|
), f = M(
|
|
202
|
-
() => x([a.imageUploadHandle,
|
|
203
|
+
() => x([a.imageUploadHandle, y.imageUploadHandle], {
|
|
203
204
|
type: Function
|
|
204
205
|
})
|
|
205
206
|
);
|
|
@@ -301,6 +302,7 @@ const ia = /* @__PURE__ */ ce({
|
|
|
301
302
|
let u = o.blob();
|
|
302
303
|
const v = o.filename(), p = await N(u, {
|
|
303
304
|
imageMaxSize: a.imageMaxSize,
|
|
305
|
+
imageAllowedType: a.imageAllowedType,
|
|
304
306
|
imageAllowedMineType: a.imageAllowedMineType,
|
|
305
307
|
imageMinWidth: a.imageMinWidth,
|
|
306
308
|
imageMinHeight: a.imageMinHeight,
|
|
@@ -386,7 +388,7 @@ const ia = /* @__PURE__ */ ce({
|
|
|
386
388
|
}, l = x(
|
|
387
389
|
[
|
|
388
390
|
a.options,
|
|
389
|
-
|
|
391
|
+
y.tinymceOptions,
|
|
390
392
|
i
|
|
391
393
|
],
|
|
392
394
|
{
|
|
@@ -434,13 +436,13 @@ const ia = /* @__PURE__ */ ce({
|
|
|
434
436
|
h.error("上传发生错误,请重试!"), r.value.formData.file = o;
|
|
435
437
|
}, re = () => {
|
|
436
438
|
var i, l;
|
|
437
|
-
return ((l = (i =
|
|
439
|
+
return ((l = (i = b.value) == null ? void 0 : i.data) == null ? void 0 : l.call(i, { ...s.value.additionalData || {}, extParameters: a.extParameters })) || {};
|
|
438
440
|
}, se = () => {
|
|
439
441
|
var i, l;
|
|
440
|
-
return ((l = (i =
|
|
442
|
+
return ((l = (i = b.value) == null ? void 0 : i.headers) == null ? void 0 : l.call(i, { ...s.value.additionalData || {}, extParameters: a.extParameters })) || {};
|
|
441
443
|
}, de = (i, l, o) => {
|
|
442
444
|
var t, n;
|
|
443
|
-
const e = (n = (t =
|
|
445
|
+
const e = (n = (t = b == null ? void 0 : b.value) == null ? void 0 : t.handlerResponse) == null ? void 0 : n.call(t, i);
|
|
444
446
|
e != null && e.url ? o[o.length - 1].url = e.url : e != null && e.errorMessage && (h.error(e.errorMessage), o.splice(o.length - 1, 1)), s.value.formData.file = o;
|
|
445
447
|
}, ue = (i, l) => new Promise((o, e) => {
|
|
446
448
|
const t = i.name.split(".").filter(Boolean).pop() ? i.name.split(".").filter(Boolean).pop() : "";
|
|
@@ -475,7 +477,7 @@ const ia = /* @__PURE__ */ ce({
|
|
|
475
477
|
V.value = !0, (i = d.value) == null || i.setContent(a.value ? a.value : a.modelValue ? a.modelValue : "");
|
|
476
478
|
},
|
|
477
479
|
{ immediate: !0 }
|
|
478
|
-
), { __sfc: !0, insRef: k, editorRef: d, preventSettingContent: U, preventUpdatingModelValue: V, uploadImage: g, uploadImageFormRef: z, onUploadImageClose: L, onUploadImageConfirm: J, uploadAudio: r, uploadAudioFormRef: H, onUploadAudioConfirm: K, onUploadAudioClose: Q, uploadVideo: s, uploadVideoFormRef: W, onUploadVideoConfirm: X, onUploadVideoClose: Y, onImageUploadUpload: Z, props: a, emits: S, imgPondAccept: ee, processPastedImage: B, mergeVideoUploadOptions:
|
|
480
|
+
), { __sfc: !0, insRef: k, editorRef: d, preventSettingContent: U, preventUpdatingModelValue: V, uploadImage: g, uploadImageFormRef: z, onUploadImageClose: L, onUploadImageConfirm: J, uploadAudio: r, uploadAudioFormRef: H, onUploadAudioConfirm: K, onUploadAudioClose: Q, uploadVideo: s, uploadVideoFormRef: W, onUploadVideoConfirm: X, onUploadVideoClose: Y, onImageUploadUpload: Z, props: a, emits: S, imgPondAccept: ee, processPastedImage: B, mergeVideoUploadOptions: b, mergeAudioUploadOptions: _, mergeImgPondOptions: $, paste_preprocess: C, paste_postprocess: D, imageUploadHandle: f, getUploadAudioData: ae, getUploadAudioHeaders: ie, onUploadAudioSuccess: oe, onUploadAudioBeforeUpload: te, onUploadAudioRemove: le, onUploadAudioError: ne, getUploadVideoData: re, getUploadVideoHeaders: se, onUploadVideoSuccess: de, onUploadVideoBeforeUpload: ue, onUploadVideoRemove: me, onUploadVideoError: pe, ImgPond: he };
|
|
479
481
|
}
|
|
480
482
|
});
|
|
481
483
|
export {
|
package/es/index.d.ts
CHANGED
|
@@ -61,6 +61,10 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
61
61
|
type: import('vue').PropType<number>;
|
|
62
62
|
default: number;
|
|
63
63
|
};
|
|
64
|
+
imageAllowedType: {
|
|
65
|
+
type: import('vue').PropType<string[]>;
|
|
66
|
+
default: () => string[];
|
|
67
|
+
};
|
|
64
68
|
imageAllowedMineType: {
|
|
65
69
|
type: import('vue').PropType<string[]>;
|
|
66
70
|
default: () => string[];
|
|
@@ -103,10 +107,6 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
103
107
|
type: import('vue').PropType<string>;
|
|
104
108
|
default: string;
|
|
105
109
|
};
|
|
106
|
-
imageAllowedType: {
|
|
107
|
-
type: import('vue').PropType<string[]>;
|
|
108
|
-
default: () => string[];
|
|
109
|
-
};
|
|
110
110
|
audioEnable: {
|
|
111
111
|
type: import('vue').PropType<boolean>;
|
|
112
112
|
default: boolean;
|
|
@@ -203,6 +203,10 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
203
203
|
type: import('vue').PropType<number>;
|
|
204
204
|
default: number;
|
|
205
205
|
};
|
|
206
|
+
imageAllowedType: {
|
|
207
|
+
type: import('vue').PropType<string[]>;
|
|
208
|
+
default: () => string[];
|
|
209
|
+
};
|
|
206
210
|
imageAllowedMineType: {
|
|
207
211
|
type: import('vue').PropType<string[]>;
|
|
208
212
|
default: () => string[];
|
|
@@ -245,10 +249,6 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
245
249
|
type: import('vue').PropType<string>;
|
|
246
250
|
default: string;
|
|
247
251
|
};
|
|
248
|
-
imageAllowedType: {
|
|
249
|
-
type: import('vue').PropType<string[]>;
|
|
250
|
-
default: () => string[];
|
|
251
|
-
};
|
|
252
252
|
audioEnable: {
|
|
253
253
|
type: import('vue').PropType<boolean>;
|
|
254
254
|
default: boolean;
|
|
@@ -345,6 +345,7 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
345
345
|
"update:modelValue": (value: string) => void;
|
|
346
346
|
}, {
|
|
347
347
|
imageMaxSize: number;
|
|
348
|
+
imageAllowedType: string[];
|
|
348
349
|
imageAllowedMineType: string[];
|
|
349
350
|
imageMinWidth: number;
|
|
350
351
|
imageMinHeight: number;
|
|
@@ -354,7 +355,6 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
354
355
|
modelValue: string;
|
|
355
356
|
imageUploadMaxCount: number;
|
|
356
357
|
imageUploadTip: string;
|
|
357
|
-
imageAllowedType: string[];
|
|
358
358
|
audioEnable: boolean;
|
|
359
359
|
audioMaxSize: number;
|
|
360
360
|
audioAllowedType: string[];
|
|
@@ -367,6 +367,10 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
367
367
|
type: import('vue').PropType<number>;
|
|
368
368
|
default: number;
|
|
369
369
|
};
|
|
370
|
+
imageAllowedType: {
|
|
371
|
+
type: import('vue').PropType<string[]>;
|
|
372
|
+
default: () => string[];
|
|
373
|
+
};
|
|
370
374
|
imageAllowedMineType: {
|
|
371
375
|
type: import('vue').PropType<string[]>;
|
|
372
376
|
default: () => string[];
|
|
@@ -409,10 +413,6 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
409
413
|
type: import('vue').PropType<string>;
|
|
410
414
|
default: string;
|
|
411
415
|
};
|
|
412
|
-
imageAllowedType: {
|
|
413
|
-
type: import('vue').PropType<string[]>;
|
|
414
|
-
default: () => string[];
|
|
415
|
-
};
|
|
416
416
|
audioEnable: {
|
|
417
417
|
type: import('vue').PropType<boolean>;
|
|
418
418
|
default: boolean;
|
|
@@ -509,6 +509,10 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
509
509
|
type: import('vue').PropType<number>;
|
|
510
510
|
default: number;
|
|
511
511
|
};
|
|
512
|
+
imageAllowedType: {
|
|
513
|
+
type: import('vue').PropType<string[]>;
|
|
514
|
+
default: () => string[];
|
|
515
|
+
};
|
|
512
516
|
imageAllowedMineType: {
|
|
513
517
|
type: import('vue').PropType<string[]>;
|
|
514
518
|
default: () => string[];
|
|
@@ -551,10 +555,6 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
551
555
|
type: import('vue').PropType<string>;
|
|
552
556
|
default: string;
|
|
553
557
|
};
|
|
554
|
-
imageAllowedType: {
|
|
555
|
-
type: import('vue').PropType<string[]>;
|
|
556
|
-
default: () => string[];
|
|
557
|
-
};
|
|
558
558
|
audioEnable: {
|
|
559
559
|
type: import('vue').PropType<boolean>;
|
|
560
560
|
default: boolean;
|
|
@@ -651,6 +651,10 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
651
651
|
type: import('vue').PropType<number>;
|
|
652
652
|
default: number;
|
|
653
653
|
};
|
|
654
|
+
imageAllowedType: {
|
|
655
|
+
type: import('vue').PropType<string[]>;
|
|
656
|
+
default: () => string[];
|
|
657
|
+
};
|
|
654
658
|
imageAllowedMineType: {
|
|
655
659
|
type: import('vue').PropType<string[]>;
|
|
656
660
|
default: () => string[];
|
|
@@ -693,10 +697,6 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
693
697
|
type: import('vue').PropType<string>;
|
|
694
698
|
default: string;
|
|
695
699
|
};
|
|
696
|
-
imageAllowedType: {
|
|
697
|
-
type: import('vue').PropType<string[]>;
|
|
698
|
-
default: () => string[];
|
|
699
|
-
};
|
|
700
700
|
audioEnable: {
|
|
701
701
|
type: import('vue').PropType<boolean>;
|
|
702
702
|
default: boolean;
|
|
@@ -793,6 +793,7 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
793
793
|
"update:modelValue": (value: string) => void;
|
|
794
794
|
}, string, {
|
|
795
795
|
imageMaxSize: number;
|
|
796
|
+
imageAllowedType: string[];
|
|
796
797
|
imageAllowedMineType: string[];
|
|
797
798
|
imageMinWidth: number;
|
|
798
799
|
imageMinHeight: number;
|
|
@@ -802,7 +803,6 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
802
803
|
modelValue: string;
|
|
803
804
|
imageUploadMaxCount: number;
|
|
804
805
|
imageUploadTip: string;
|
|
805
|
-
imageAllowedType: string[];
|
|
806
806
|
audioEnable: boolean;
|
|
807
807
|
audioMaxSize: number;
|
|
808
808
|
audioAllowedType: string[];
|
|
@@ -816,6 +816,10 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
816
816
|
type: import('vue').PropType<number>;
|
|
817
817
|
default: number;
|
|
818
818
|
};
|
|
819
|
+
imageAllowedType: {
|
|
820
|
+
type: import('vue').PropType<string[]>;
|
|
821
|
+
default: () => string[];
|
|
822
|
+
};
|
|
819
823
|
imageAllowedMineType: {
|
|
820
824
|
type: import('vue').PropType<string[]>;
|
|
821
825
|
default: () => string[];
|
|
@@ -858,10 +862,6 @@ declare const TinymceEditor: import('vue/types/v3-component-public-instance').Co
|
|
|
858
862
|
type: import('vue').PropType<string>;
|
|
859
863
|
default: string;
|
|
860
864
|
};
|
|
861
|
-
imageAllowedType: {
|
|
862
|
-
type: import('vue').PropType<string[]>;
|
|
863
|
-
default: () => string[];
|
|
864
|
-
};
|
|
865
865
|
audioEnable: {
|
|
866
866
|
type: import('vue').PropType<boolean>;
|
|
867
867
|
default: boolean;
|
package/es/util.d.ts
CHANGED
package/es/util.js
CHANGED
|
@@ -1,77 +1,90 @@
|
|
|
1
|
-
import h from "
|
|
2
|
-
|
|
1
|
+
import { compressAccurately as h } from "image-conversion";
|
|
2
|
+
import w from "compressorjs";
|
|
3
|
+
async function x(r, s) {
|
|
3
4
|
const {
|
|
4
|
-
imageMaxSize:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
imageMaxSize: t = 30,
|
|
6
|
+
imageAllowedType: i = ["jpg", "jpeg", "png", "bmp", "heif", "gif", "webp"],
|
|
7
|
+
imageAllowedMineType: e = ["image/jpg", "image/jpeg", "image/png", "image/bmp", "image/heif", "image/heic", "image/gif", "image/webp"],
|
|
8
|
+
imageMinWidth: a = 60,
|
|
9
|
+
imageMinHeight: c = 60,
|
|
8
10
|
imageMaxWidth: o = 6e3,
|
|
9
|
-
imageMaxHeight:
|
|
10
|
-
} =
|
|
11
|
-
if (n.size >
|
|
12
|
-
return { success: !1, error: { size: !0 }, errorMessage: `请上传大小不超过${
|
|
13
|
-
if (!
|
|
14
|
-
return { success: !1, error: { format: !0 }, errorMessage: `请上传格式为${
|
|
15
|
-
const
|
|
16
|
-
return
|
|
11
|
+
imageMaxHeight: g = 6e3
|
|
12
|
+
} = s || {}, n = r, p = await l(n);
|
|
13
|
+
if (n.size > t * 1024 * 1024)
|
|
14
|
+
return { success: !1, error: { size: !0 }, errorMessage: `请上传大小不超过${t}M的图片` };
|
|
15
|
+
if (!e.includes(n.type))
|
|
16
|
+
return { success: !1, error: { format: !0 }, errorMessage: `请上传格式为${i.map((f) => f.toUpperCase()).join("、")}的图片` };
|
|
17
|
+
const m = await u(p);
|
|
18
|
+
return m.width < a && m.height < c || m.width > o && m.height > g ? { success: !1, error: { pixel: !0 }, errorMessage: `请上传像素不低于${a}*${c}且像素不高于${o}*${g}的图片` } : { success: !0, file: n };
|
|
17
19
|
}
|
|
18
|
-
async function
|
|
19
|
-
var
|
|
20
|
-
let
|
|
21
|
-
const
|
|
20
|
+
async function z(r) {
|
|
21
|
+
var g;
|
|
22
|
+
let s = r;
|
|
23
|
+
const t = await l(s);
|
|
22
24
|
let i = !1;
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
+
const e = {};
|
|
26
|
+
let a = "image-conversion", c = s.type;
|
|
27
|
+
["image/heif", "image/heic", "image/webp"].includes(s.type) && (a = "compressor", e.convertTypes = [s.type], e.convertSize = 0, e.quality = 1, c = "image/jpeg", i = !0);
|
|
25
28
|
const o = 5 * 1024 * 1024;
|
|
26
|
-
if (
|
|
27
|
-
|
|
29
|
+
if (s.size > o)
|
|
30
|
+
if (i) {
|
|
31
|
+
const n = await u(t);
|
|
32
|
+
a = "compressor", e.convertTypes = [s.type], e.convertSize = o, e.maxWidth = n.width * (o / s.size), e.quality = 0.92;
|
|
33
|
+
} else
|
|
34
|
+
a = "image-conversion", e.type = c, e.size = 5 * 1024;
|
|
35
|
+
if (Object.keys(e).length > 0) {
|
|
36
|
+
const n = await d(y(t), e, a);
|
|
28
37
|
if (n.success)
|
|
29
|
-
|
|
38
|
+
s = n.file;
|
|
30
39
|
else
|
|
31
|
-
return { file:
|
|
40
|
+
return { file: s, success: !1, hasConversion: i, errorMessage: (g = n.error) == null ? void 0 : g.message };
|
|
32
41
|
}
|
|
33
|
-
return { file:
|
|
42
|
+
return { file: s, hasConversion: i, success: !0 };
|
|
34
43
|
}
|
|
35
|
-
function
|
|
36
|
-
return new Promise((
|
|
37
|
-
new
|
|
38
|
-
...
|
|
39
|
-
success: async (
|
|
40
|
-
|
|
44
|
+
function d(r, s = {}, t) {
|
|
45
|
+
return new Promise((i) => {
|
|
46
|
+
t === "compressor" ? new w(r, {
|
|
47
|
+
...s,
|
|
48
|
+
success: async (e) => {
|
|
49
|
+
i({ success: !0, file: e });
|
|
41
50
|
},
|
|
42
|
-
error(
|
|
43
|
-
|
|
51
|
+
error(e) {
|
|
52
|
+
i({ success: !1, error: e });
|
|
44
53
|
}
|
|
54
|
+
}) : h(r, s).then((e) => {
|
|
55
|
+
i({ success: !0, file: e });
|
|
56
|
+
}).catch((e) => {
|
|
57
|
+
i({ success: !1, error: (e == null ? void 0 : e.message) || "" });
|
|
45
58
|
});
|
|
46
59
|
});
|
|
47
60
|
}
|
|
48
|
-
function
|
|
49
|
-
return new Promise((
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
},
|
|
61
|
+
function u(r) {
|
|
62
|
+
return new Promise((s) => {
|
|
63
|
+
const t = new Image();
|
|
64
|
+
t.onload = function() {
|
|
65
|
+
s({ width: t.width, height: t.height, image: t });
|
|
66
|
+
}, t.src = r;
|
|
54
67
|
});
|
|
55
68
|
}
|
|
56
|
-
function
|
|
57
|
-
const
|
|
58
|
-
let
|
|
59
|
-
const
|
|
60
|
-
for (;
|
|
61
|
-
|
|
62
|
-
return new Blob([
|
|
69
|
+
function y(r) {
|
|
70
|
+
const s = r.split(","), t = s[0].match(/:(.*?);/)[1], i = atob(s[1]);
|
|
71
|
+
let e = i.length;
|
|
72
|
+
const a = new Uint8Array(e);
|
|
73
|
+
for (; e--; )
|
|
74
|
+
a[e] = i.charCodeAt(e);
|
|
75
|
+
return new Blob([a], { type: t });
|
|
63
76
|
}
|
|
64
|
-
function
|
|
65
|
-
return new Promise((
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
e
|
|
70
|
-
},
|
|
77
|
+
function l(r) {
|
|
78
|
+
return new Promise((s, t) => {
|
|
79
|
+
const i = new FileReader();
|
|
80
|
+
i.onloadend = () => {
|
|
81
|
+
const e = i.result;
|
|
82
|
+
s(e);
|
|
83
|
+
}, i.onerror = t, i.readAsDataURL(r);
|
|
71
84
|
});
|
|
72
85
|
}
|
|
73
86
|
export {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
87
|
+
u as getImagePixel,
|
|
88
|
+
x as oneTravelImageCheck,
|
|
89
|
+
z as oneTravelImageCompressor
|
|
77
90
|
};
|
package/package.json
CHANGED