@fileverse-dev/dsheet 1.2.85-animation → 1.2.85-ydoc-2
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.
|
@@ -2,10 +2,6 @@ import { Sheet, WorkbookInstance } from '@fileverse-dev/fortune-react';
|
|
|
2
2
|
import { DataBlockApiKeyHandlerType } from '../types';
|
|
3
3
|
|
|
4
4
|
import * as Y from 'yjs';
|
|
5
|
-
/**
|
|
6
|
-
* Hook for managing sheet data
|
|
7
|
-
* Handles initialization, updates, and persistence of sheet data
|
|
8
|
-
*/
|
|
9
5
|
export declare const useEditorData: (ydocRef: React.MutableRefObject<Y.Doc | null>, dsheetId: string, sheetEditorRef: React.MutableRefObject<WorkbookInstance | null>, setForceSheetRender?: React.Dispatch<React.SetStateAction<number>>, portalContent?: string, isReadOnly?: boolean, onChange?: (data: Sheet[]) => void, syncStatus?: "initializing" | "syncing" | "synced" | "error", commentData?: object, dataBlockCalcFunction?: {
|
|
10
6
|
[key: string]: {
|
|
11
7
|
[key: string]: any;
|
|
@@ -7,3 +7,20 @@ import { Sheet } from '@fileverse-dev/fortune-react';
|
|
|
7
7
|
* @returns {boolean} - true if any cell data or images changed, false if identical
|
|
8
8
|
*/
|
|
9
9
|
export declare function isSpreadsheetChanged(oldSheets: Sheet[], newSheets: Sheet[]): boolean;
|
|
10
|
+
type DiffChange<T> = {
|
|
11
|
+
from: T;
|
|
12
|
+
to: T;
|
|
13
|
+
};
|
|
14
|
+
type UpdatedItem<T> = {
|
|
15
|
+
key: string;
|
|
16
|
+
before: T;
|
|
17
|
+
after: T;
|
|
18
|
+
changes: Partial<Record<keyof T, DiffChange<any>>>;
|
|
19
|
+
};
|
|
20
|
+
type DiffResult<T> = {
|
|
21
|
+
added: T[];
|
|
22
|
+
removed: T[];
|
|
23
|
+
updated: UpdatedItem<T>[];
|
|
24
|
+
};
|
|
25
|
+
export declare function diffObjectArrays<T extends Record<string, any>>(oldArr: readonly T[], newArr: readonly T[], getKey: (item: T) => string): DiffResult<T>;
|
|
26
|
+
export {};
|
|
@@ -4,5 +4,5 @@ export declare const updateSheetData: (ydoc: Y.Doc | null, dsheetId: string, dat
|
|
|
4
4
|
[key: string]: {
|
|
5
5
|
[key: string]: any;
|
|
6
6
|
};
|
|
7
|
-
}, isReadOnly?: boolean) => void;
|
|
7
|
+
}, isReadOnly?: boolean, handleContentPortal?: any) => void;
|
|
8
8
|
export declare const formatSheetData: (data: Sheet[], preSheetArray: Sheet[], sheetEditor: WorkbookInstance) => Sheet[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Sheet, WorkbookInstance } from '@fileverse-dev/fortune-react';
|
|
2
|
+
import * as Y from 'yjs';
|
|
3
|
+
type SheetChangePath = {
|
|
4
|
+
sheetId: string;
|
|
5
|
+
path: string[];
|
|
6
|
+
key?: string;
|
|
7
|
+
value: any;
|
|
8
|
+
type?: 'update' | 'delete';
|
|
9
|
+
};
|
|
10
|
+
export declare const updateYdocSheetData: (ydoc: Y.Doc | null, dsheetId: string, sheetEditor: WorkbookInstance | null, changes: SheetChangePath[], handleContentPortal: any) => void;
|
|
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-
|
|
5
|
+
"version": "1.2.85-ydoc-2",
|
|
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",
|
|
38
|
+
"@fileverse-dev/fortune-react": "1.2.90-ydoc-2",
|
|
39
39
|
"@fileverse/ui": "^4.1.7-patch-40",
|
|
40
40
|
"classnames": "^2.5.1",
|
|
41
41
|
"exceljs": "^4.4.0",
|