@fileverse-dev/dsheet 1.2.85-ydoc-2 → 1.2.85-ydoc-9
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/index.es.js +37931 -37185
- package/dist/package/constants/shared-constants.d.ts +58 -3
- package/dist/package/contexts/editor-context.d.ts +1 -0
- package/dist/package/utils/calc-chain-ydoc-update.d.ts +17 -0
- package/dist/package/utils/condition-format-ydoc-update.d.ts +17 -0
- package/dist/package/utils/data-block-list-ydoc-update.d.ts +18 -0
- package/dist/package/utils/data-verification-ydoc-update.d.ts +17 -0
- package/dist/package/utils/diff-sheet.d.ts +13 -1
- package/dist/package/utils/hyperlink-ydoc-update.d.ts +17 -0
- package/dist/package/utils/live-query-list-ydoc-update.d.ts +17 -0
- package/dist/package/utils/update-ydoc.d.ts +1 -2
- package/package.json +2 -2
|
@@ -4,11 +4,66 @@ export declare const ERROR_MESSAGES_FLAG: ErrorMessagesFlagType;
|
|
|
4
4
|
export declare const SERVICES_API_KEY: ServicesApiKeyType;
|
|
5
5
|
export declare const DEFAULT_SHEET_DATA: {
|
|
6
6
|
name: string;
|
|
7
|
-
celldata: never[];
|
|
8
7
|
config: {};
|
|
8
|
+
index: string;
|
|
9
|
+
status: string;
|
|
9
10
|
order: number;
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
zoomRatio: number;
|
|
12
|
+
showGridLines: string;
|
|
13
|
+
defaultColWidth: number;
|
|
14
|
+
defaultRowHeight: number;
|
|
15
|
+
celldata: ({
|
|
16
|
+
r: number;
|
|
17
|
+
c: number;
|
|
18
|
+
v: {
|
|
19
|
+
ct: {
|
|
20
|
+
fa: string;
|
|
21
|
+
t: string;
|
|
22
|
+
};
|
|
23
|
+
fc: string;
|
|
24
|
+
ff: string;
|
|
25
|
+
tb: number;
|
|
26
|
+
v: string;
|
|
27
|
+
qp: number;
|
|
28
|
+
f?: undefined;
|
|
29
|
+
};
|
|
30
|
+
} | {
|
|
31
|
+
r: number;
|
|
32
|
+
c: number;
|
|
33
|
+
v: {
|
|
34
|
+
ct: {
|
|
35
|
+
fa: string;
|
|
36
|
+
t?: undefined;
|
|
37
|
+
};
|
|
38
|
+
fc: string;
|
|
39
|
+
ff: string;
|
|
40
|
+
tb: number;
|
|
41
|
+
v: string;
|
|
42
|
+
qp?: undefined;
|
|
43
|
+
f?: undefined;
|
|
44
|
+
};
|
|
45
|
+
} | {
|
|
46
|
+
r: number;
|
|
47
|
+
c: number;
|
|
48
|
+
v: {
|
|
49
|
+
f: string;
|
|
50
|
+
ct: {
|
|
51
|
+
fa: string;
|
|
52
|
+
t?: undefined;
|
|
53
|
+
};
|
|
54
|
+
fc: string;
|
|
55
|
+
ff: string;
|
|
56
|
+
tb: number;
|
|
57
|
+
v: string;
|
|
58
|
+
qp?: undefined;
|
|
59
|
+
};
|
|
60
|
+
})[];
|
|
61
|
+
calcChain: {
|
|
62
|
+
r: number;
|
|
63
|
+
c: number;
|
|
64
|
+
id: string;
|
|
65
|
+
}[];
|
|
66
|
+
id: string;
|
|
12
67
|
}[];
|
|
13
68
|
export declare const TOOL_BAR_ITEMS: string[];
|
|
14
69
|
export declare const CELL_CONTEXT_MENU_ITEMS: string[];
|
|
@@ -5,6 +5,7 @@ import { DataBlockApiKeyHandlerType, SheetUpdateData } from '../types';
|
|
|
5
5
|
|
|
6
6
|
import * as Y from 'yjs';
|
|
7
7
|
export interface EditorContextType {
|
|
8
|
+
handleOnChangePortalUpdate: (data: Sheet[]) => void;
|
|
8
9
|
setSelectedTemplate?: React.Dispatch<React.SetStateAction<string>>;
|
|
9
10
|
setShowSmartContractModal?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
10
11
|
getDocumentTitle?: () => string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { WorkbookInstance } from '@fileverse-dev/fortune-react';
|
|
2
|
+
|
|
3
|
+
import * as Y from 'yjs';
|
|
4
|
+
/**
|
|
5
|
+
* Verifies the integrity of sheet data in a YDoc against a given sheet editor instance.
|
|
6
|
+
* This function is used to verify that the sheet data in a YDoc matches the data in a sheet editor instance.
|
|
7
|
+
* @param {Object} options
|
|
8
|
+
* @param {React.RefObject<WorkbookInstance | null>} options.sheetEditorRef - Reference to the sheet editor instance
|
|
9
|
+
* @param {React.RefObject<Y.Doc | null>} options.ydocRef - Reference to the YDoc instance
|
|
10
|
+
* @returns {void}
|
|
11
|
+
*/
|
|
12
|
+
export declare const calcChainYdocUpdate: ({ sheetEditorRef, ydocRef, dsheetId, handleContentPortal }: {
|
|
13
|
+
sheetEditorRef: React.RefObject<WorkbookInstance | null>;
|
|
14
|
+
ydocRef: React.RefObject<Y.Doc | null>;
|
|
15
|
+
dsheetId: string;
|
|
16
|
+
handleContentPortal?: any;
|
|
17
|
+
}) => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { WorkbookInstance } from '@fileverse-dev/fortune-react';
|
|
2
|
+
|
|
3
|
+
import * as Y from 'yjs';
|
|
4
|
+
/**
|
|
5
|
+
* Verifies the integrity of sheet data in a YDoc against a given sheet editor instance.
|
|
6
|
+
* This function is used to verify that the sheet data in a YDoc matches the data in a sheet editor instance.
|
|
7
|
+
* @param {Object} options
|
|
8
|
+
* @param {React.RefObject<WorkbookInstance | null>} options.sheetEditorRef - Reference to the sheet editor instance
|
|
9
|
+
* @param {React.RefObject<Y.Doc | null>} options.ydocRef - Reference to the YDoc instance
|
|
10
|
+
* @returns {void}
|
|
11
|
+
*/
|
|
12
|
+
export declare const conditionFormatYdocUpdate: ({ sheetEditorRef, ydocRef, dsheetId, handleContentPortal }: {
|
|
13
|
+
sheetEditorRef: React.RefObject<WorkbookInstance | null>;
|
|
14
|
+
ydocRef: React.RefObject<Y.Doc | null>;
|
|
15
|
+
dsheetId: string;
|
|
16
|
+
handleContentPortal?: any;
|
|
17
|
+
}) => void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { WorkbookInstance } from '@fileverse-dev/fortune-react';
|
|
2
|
+
|
|
3
|
+
import * as Y from 'yjs';
|
|
4
|
+
/**
|
|
5
|
+
* Verifies the integrity of sheet data in a YDoc against a given sheet editor instance.
|
|
6
|
+
* This function is used to verify that the sheet data in a YDoc matches the data in a sheet editor instance.
|
|
7
|
+
* @param {Object} options
|
|
8
|
+
* @param {React.RefObject<WorkbookInstance | null>} options.sheetEditorRef - Reference to the sheet editor instance
|
|
9
|
+
* @param {React.RefObject<Y.Doc | null>} options.ydocRef - Reference to the YDoc instance
|
|
10
|
+
* @returns {void}
|
|
11
|
+
*/
|
|
12
|
+
export declare const dataBlockListYdocUpdate: ({ sheetEditorRef, ydocRef, dsheetId, handleContentPortal, dataBlockCalcFunction }: {
|
|
13
|
+
sheetEditorRef: React.RefObject<WorkbookInstance | null>;
|
|
14
|
+
ydocRef: React.RefObject<Y.Doc | null>;
|
|
15
|
+
dsheetId: string;
|
|
16
|
+
handleContentPortal?: any;
|
|
17
|
+
dataBlockCalcFunction?: any;
|
|
18
|
+
}) => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { WorkbookInstance } from '@fileverse-dev/fortune-react';
|
|
2
|
+
|
|
3
|
+
import * as Y from 'yjs';
|
|
4
|
+
/**
|
|
5
|
+
* Verifies the integrity of sheet data in a YDoc against a given sheet editor instance.
|
|
6
|
+
* This function is used to verify that the sheet data in a YDoc matches the data in a sheet editor instance.
|
|
7
|
+
* @param {Object} options
|
|
8
|
+
* @param {React.RefObject<WorkbookInstance | null>} options.sheetEditorRef - Reference to the sheet editor instance
|
|
9
|
+
* @param {React.RefObject<Y.Doc | null>} options.ydocRef - Reference to the YDoc instance
|
|
10
|
+
* @returns {void}
|
|
11
|
+
*/
|
|
12
|
+
export declare const dataVerificationYdocUpdate: ({ sheetEditorRef, ydocRef, dsheetId, handleContentPortal }: {
|
|
13
|
+
sheetEditorRef: React.RefObject<WorkbookInstance | null>;
|
|
14
|
+
ydocRef: React.RefObject<Y.Doc | null>;
|
|
15
|
+
dsheetId: string;
|
|
16
|
+
handleContentPortal?: any;
|
|
17
|
+
}) => void;
|
|
@@ -22,5 +22,17 @@ type DiffResult<T> = {
|
|
|
22
22
|
removed: T[];
|
|
23
23
|
updated: UpdatedItem<T>[];
|
|
24
24
|
};
|
|
25
|
-
export declare function diffObjectArrays<T extends Record<string, any>>(oldArr: readonly T[], newArr: readonly T[], getKey
|
|
25
|
+
export declare function diffObjectArrays<T extends Record<string, any>>(oldArr: readonly T[], newArr: readonly T[], getKey?: (item: T) => string): DiffResult<T>;
|
|
26
|
+
type UpdatedEntry<T> = {
|
|
27
|
+
key: string;
|
|
28
|
+
before: T;
|
|
29
|
+
after: T;
|
|
30
|
+
changes: Partial<Record<keyof T, DiffChange<any>>>;
|
|
31
|
+
};
|
|
32
|
+
type ObjectDiffResult<T> = {
|
|
33
|
+
added: Record<string, T>;
|
|
34
|
+
removed: Record<string, T>;
|
|
35
|
+
updated: UpdatedEntry<T>[];
|
|
36
|
+
};
|
|
37
|
+
export declare function diffObjectMap<T extends Record<string, any>>(oldObj: Record<string, T>, newObj: Record<string, T>): ObjectDiffResult<T>;
|
|
26
38
|
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { WorkbookInstance } from '@fileverse-dev/fortune-react';
|
|
2
|
+
|
|
3
|
+
import * as Y from 'yjs';
|
|
4
|
+
/**
|
|
5
|
+
* Verifies the integrity of sheet data in a YDoc against a given sheet editor instance.
|
|
6
|
+
* This function is used to verify that the sheet data in a YDoc matches the data in a sheet editor instance.
|
|
7
|
+
* @param {Object} options
|
|
8
|
+
* @param {React.RefObject<WorkbookInstance | null>} options.sheetEditorRef - Reference to the sheet editor instance
|
|
9
|
+
* @param {React.RefObject<Y.Doc | null>} options.ydocRef - Reference to the YDoc instance
|
|
10
|
+
* @returns {void}
|
|
11
|
+
*/
|
|
12
|
+
export declare const hyperlinkYdocUpdate: ({ sheetEditorRef, ydocRef, dsheetId, handleContentPortal }: {
|
|
13
|
+
sheetEditorRef: React.RefObject<WorkbookInstance | null>;
|
|
14
|
+
ydocRef: React.RefObject<Y.Doc | null>;
|
|
15
|
+
dsheetId: string;
|
|
16
|
+
handleContentPortal?: any;
|
|
17
|
+
}) => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { WorkbookInstance } from '@fileverse-dev/fortune-react';
|
|
2
|
+
|
|
3
|
+
import * as Y from 'yjs';
|
|
4
|
+
/**
|
|
5
|
+
* Verifies the integrity of sheet data in a YDoc against a given sheet editor instance.
|
|
6
|
+
* This function is used to verify that the sheet data in a YDoc matches the data in a sheet editor instance.
|
|
7
|
+
* @param {Object} options
|
|
8
|
+
* @param {React.RefObject<WorkbookInstance | null>} options.sheetEditorRef - Reference to the sheet editor instance
|
|
9
|
+
* @param {React.RefObject<Y.Doc | null>} options.ydocRef - Reference to the YDoc instance
|
|
10
|
+
* @returns {void}
|
|
11
|
+
*/
|
|
12
|
+
export declare const liveQueryListYdocUpdate: ({ sheetEditorRef, ydocRef, dsheetId, handleContentPortal }: {
|
|
13
|
+
sheetEditorRef: React.RefObject<WorkbookInstance | null>;
|
|
14
|
+
ydocRef: React.RefObject<Y.Doc | null>;
|
|
15
|
+
dsheetId: string;
|
|
16
|
+
handleContentPortal?: any;
|
|
17
|
+
}) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Sheet, WorkbookInstance } from '@fileverse-dev/fortune-react';
|
|
2
2
|
import * as Y from 'yjs';
|
|
3
|
-
type SheetChangePath = {
|
|
3
|
+
export type SheetChangePath = {
|
|
4
4
|
sheetId: string;
|
|
5
5
|
path: string[];
|
|
6
6
|
key?: string;
|
|
@@ -9,4 +9,3 @@ type SheetChangePath = {
|
|
|
9
9
|
};
|
|
10
10
|
export declare const updateYdocSheetData: (ydoc: Y.Doc | null, dsheetId: string, sheetEditor: WorkbookInstance | null, changes: SheetChangePath[], handleContentPortal: any) => void;
|
|
11
11
|
export declare function ySheetArrayToPlain(sheetArray: Y.Array<Y.Map>): Sheet[];
|
|
12
|
-
export {};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@fileverse-dev/dsheet",
|
|
3
3
|
"private": false,
|
|
4
4
|
"description": "DSheet",
|
|
5
|
-
"version": "1.2.85-ydoc-
|
|
5
|
+
"version": "1.2.85-ydoc-9",
|
|
6
6
|
"main": "dist/index.es.js",
|
|
7
7
|
"module": "dist/index.es.js",
|
|
8
8
|
"exports": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@fileverse-dev/dsheets-templates": "^0.0.29",
|
|
37
37
|
"@fileverse-dev/formulajs": "4.4.46",
|
|
38
|
-
"@fileverse-dev/fortune-react": "1.2.90-ydoc-
|
|
38
|
+
"@fileverse-dev/fortune-react": "1.2.90-ydoc-14",
|
|
39
39
|
"@fileverse/ui": "^4.1.7-patch-40",
|
|
40
40
|
"classnames": "^2.5.1",
|
|
41
41
|
"exceljs": "^4.4.0",
|