@fileverse-dev/ddoc 3.0.14-patch-1 → 3.0.15
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/dist/{ccip-LusRwzWg.mjs → ccip-BnuraDz4.mjs} +1 -1
- package/dist/{index-CnwMYpbP.mjs → index-ztCSp_Xi.mjs} +26546 -25880
- package/dist/index.es.js +1 -1
- package/dist/package/extensions/mardown-paste-handler/index.d.ts +1 -1
- package/dist/package/utils/image-compression.d.ts +21 -0
- package/package.json +2 -1
package/dist/index.es.js
CHANGED
|
@@ -27,4 +27,4 @@ export default MarkdownPasteHandler;
|
|
|
27
27
|
export declare function searchForSecureImageNodeAndEmbedImageContent(originalDoc: PMNode, ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
|
|
28
28
|
url: string;
|
|
29
29
|
file: File;
|
|
30
|
-
}>, fetchV1ImageFn?: (url: string) => Promise<ArrayBuffer | undefined
|
|
30
|
+
}>, fetchV1ImageFn?: (url: string) => Promise<ArrayBuffer | undefined>, shouldCompress?: boolean): Promise<PMNode>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const IMAGE_COMPRESSION_SETTINGS: {
|
|
2
|
+
HIGH: {
|
|
3
|
+
quality: number;
|
|
4
|
+
convertSize: number;
|
|
5
|
+
};
|
|
6
|
+
MEDIUM: {
|
|
7
|
+
quality: number;
|
|
8
|
+
convertSize: number;
|
|
9
|
+
};
|
|
10
|
+
LOW: {
|
|
11
|
+
quality: number;
|
|
12
|
+
convertSize: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare function compressImage(img: Blob, compressionSettings: keyof typeof IMAGE_COMPRESSION_SETTINGS, asBase64?: true): Promise<string>;
|
|
16
|
+
export declare function compressImage(img: Blob, compressionSettings: keyof typeof IMAGE_COMPRESSION_SETTINGS, asBase64: false): Promise<Blob>;
|
|
17
|
+
export declare const convertBase64ImageToBlob: (base64: string, contentType: string) => Blob;
|
|
18
|
+
export declare const getCompressedBase64Image: (base64: string, compressionSettings: keyof typeof IMAGE_COMPRESSION_SETTINGS) => Promise<{
|
|
19
|
+
compressedBase64: string;
|
|
20
|
+
mimeType: string;
|
|
21
|
+
}>;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@fileverse-dev/ddoc",
|
|
3
3
|
"private": false,
|
|
4
4
|
"description": "DDoc",
|
|
5
|
-
"version": "3.0.
|
|
5
|
+
"version": "3.0.15",
|
|
6
6
|
"main": "dist/index.es.js",
|
|
7
7
|
"module": "dist/index.es.js",
|
|
8
8
|
"exports": {
|
|
@@ -83,6 +83,7 @@
|
|
|
83
83
|
"@xstate/react": "^3.2.2",
|
|
84
84
|
"base64-js": "^1.5.1",
|
|
85
85
|
"classnames": "^2.5.1",
|
|
86
|
+
"compressorjs": "^1.2.1",
|
|
86
87
|
"copy-to-clipboard": "^3.3.3",
|
|
87
88
|
"date-fns": "^4.1.0",
|
|
88
89
|
"dompurify": "^3.1.6",
|