@fileverse-dev/ddoc 3.0.11 → 3.0.13-patch-1
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-BSmAwD79.mjs → ccip-BzFktff7.mjs} +1 -1
- package/dist/{index-jQSXpa4H.mjs → index-D7gGsJ0p.mjs} +26529 -25863
- package/dist/index.es.js +1 -1
- package/dist/package/extensions/mardown-paste-handler/index.d.ts +1 -1
- package/dist/package/sync-local/types/index.d.ts +3 -3
- 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>;
|
|
@@ -48,7 +48,7 @@ export interface SyncMachineContext {
|
|
|
48
48
|
updated: number[];
|
|
49
49
|
removed: number[];
|
|
50
50
|
}) => void) | null;
|
|
51
|
-
onError: ((e:
|
|
51
|
+
onError: ((e: Error) => void) | null;
|
|
52
52
|
roomKey: string;
|
|
53
53
|
wsUrl: string;
|
|
54
54
|
uncommittedUpdatesIdList: string[];
|
|
@@ -121,9 +121,9 @@ export type Update = Uint8Array;
|
|
|
121
121
|
export interface ISocketInitConfig {
|
|
122
122
|
onConnect: ConnectHandler;
|
|
123
123
|
onDisconnect: DisconnectHandler;
|
|
124
|
-
onError: (err:
|
|
124
|
+
onError: (err: Error) => void;
|
|
125
125
|
onWsEvent: EventHandler;
|
|
126
|
-
onHandShakeError: (err:
|
|
126
|
+
onHandShakeError: (err: Error) => void;
|
|
127
127
|
roomId: string;
|
|
128
128
|
}
|
|
129
129
|
export declare enum SocketStatusEnum {
|
|
@@ -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.13-patch-1",
|
|
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",
|