@fileverse-dev/dsheet 3.0.2-patch.7 → 3.0.2-patch.8
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/{constants-Q8nzbvQO.js → constants-Cdz6oSCq.js} +3 -5
- package/dist/constants.js +1 -1
- package/dist/editor/components/editor-workbook-sync.d.ts +1 -1
- package/dist/editor/constants/shared-constants.d.ts +0 -2
- package/dist/editor/hooks/use-celldata-compaction.d.ts +23 -0
- package/dist/editor/hooks/use-xlsx-import-impl.d.ts +2 -1
- package/dist/editor/hooks/use-xlsx-import.d.ts +2 -1
- package/dist/editor/utils/compact-committed-celldata.d.ts +28 -0
- package/dist/editor/utils/config-ydoc-update.d.ts +20 -0
- package/dist/editor/utils/update-ydoc.d.ts +13 -3
- package/dist/executeStringFunction-DVN2p-9G.js +32625 -0
- package/dist/formula.js +1 -1
- package/dist/{index-BqJw4oqU.js → index-BghvCwFN.js} +21769 -24707
- package/dist/index.es.js +39 -39
- package/dist/sheet-engine/core/api/cell.d.ts +0 -20
- package/dist/sheet-engine/core/api/common.d.ts +2 -1
- package/dist/sheet-engine/core/api/index.d.ts +1 -0
- package/dist/sheet-engine/core/api/sheet-flowdata-lifecycle.d.ts +17 -0
- package/dist/sheet-engine/core/api/sheet.d.ts +5 -0
- package/dist/sheet-engine/core/modules/formula-worker-bridge.d.ts +1 -0
- package/dist/sheet-engine/core/modules/sheet-metadata-hooks.d.ts +4 -0
- package/dist/sheet-engine/core/modules/sheet.d.ts +17 -1
- package/dist/sheet-engine/core/paste/paste-border-utils.d.ts +23 -0
- package/dist/sheet-engine/core/settings.d.ts +1 -1
- package/dist/sheet-engine/core/types.d.ts +3 -0
- package/dist/sheet-engine/core/utils/active-draft-context.d.ts +4 -0
- package/dist/sheet-engine/core/utils/border-config-utils.d.ts +16 -0
- package/dist/sheet-engine/core/utils/cell-persist-utils.d.ts +10 -0
- package/dist/sheet-engine/core/utils/merge-hydrate.d.ts +15 -0
- package/dist/sheet-engine/core/utils/mirror-cell-format-ranges.d.ts +17 -0
- package/dist/sheet-engine/core/utils/range-format.d.ts +76 -0
- package/dist/sheet-engine/core/utils/ydoc-celldata-changes.d.ts +46 -0
- package/dist/sheet-engine/react/components/Workbook/api.d.ts +8 -1
- package/dist/sheet-engine/react/components/Workbook/index.d.ts +5 -1
- package/dist/use-xlsx-import-impl-Bwcgej92.js +1553 -0
- package/dist/{xlsx-export-impl-BVnggmUo.js → xlsx-export-impl-CbVuo6Dk.js} +1106 -1106
- package/package.json +1 -1
- package/dist/executeStringFunction-C5hEkx9z.js +0 -27694
- package/dist/use-xlsx-import-impl-OjMoKLbj.js +0 -1537
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { E as
|
|
2
|
-
const E =
|
|
1
|
+
import { E as a, S as n } from "./crypto-constants-CqpCRs86.js";
|
|
2
|
+
const E = a, d = n, f = [
|
|
3
3
|
{
|
|
4
4
|
id: "0",
|
|
5
5
|
name: "Sheet1",
|
|
6
6
|
celldata: [],
|
|
7
7
|
config: {},
|
|
8
|
-
order: 0
|
|
9
|
-
row: 500,
|
|
10
|
-
column: 26
|
|
8
|
+
order: 0
|
|
11
9
|
}
|
|
12
10
|
], m = [
|
|
13
11
|
"undo",
|
package/dist/constants.js
CHANGED
|
@@ -19,5 +19,5 @@ export declare const createAfterOrderChangesHandler: ({ sheetEditorRef, ydocRef,
|
|
|
19
19
|
export declare const createAfterColorChangesHandler: ({ sheetEditorRef, ydocRef, dsheetId, handleOnChangePortalUpdate, }: SyncContext) => () => void;
|
|
20
20
|
export declare const createAfterHideChangesHandler: ({ sheetEditorRef, ydocRef, dsheetId, handleOnChangePortalUpdate, }: SyncContext) => () => void;
|
|
21
21
|
export declare const createAfterColRowChangesHandler: ({ sheetEditorRef, ydocRef, dsheetId, handleOnChangePortalUpdate, }: SyncContext) => () => void;
|
|
22
|
-
export declare const updateAllCell: ({ sheetEditorRef, ydocRef, dsheetId, handleOnChangePortalUpdate, }: SyncContext, subSheetId: string) => void;
|
|
22
|
+
export declare const updateAllCell: ({ sheetEditorRef, ydocRef, dsheetId, handleOnChangePortalUpdate, }: SyncContext, subSheetId: string, caller?: string) => void;
|
|
23
23
|
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MutableRefObject, RefObject } from 'react';
|
|
2
|
+
import { WorkbookInstance, Sheet } from '../../sheet-engine/react';
|
|
3
|
+
|
|
4
|
+
import type * as Y from 'yjs';
|
|
5
|
+
type UseCelldataCompactionArgs = {
|
|
6
|
+
dsheetId: string;
|
|
7
|
+
ydocRef: RefObject<Y.Doc | null>;
|
|
8
|
+
sheetEditorRef: RefObject<WorkbookInstance | null>;
|
|
9
|
+
currentDataRef: MutableRefObject<Sheet[]>;
|
|
10
|
+
handleOnChangePortalUpdate: () => void;
|
|
11
|
+
syncStatus: 'initializing' | 'syncing' | 'synced' | 'error';
|
|
12
|
+
isDataLoaded: boolean;
|
|
13
|
+
isReadOnly: boolean;
|
|
14
|
+
remoteUpdateRef: MutableRefObject<boolean>;
|
|
15
|
+
collabSyncing: boolean;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* One-shot background compaction: remove committed celldata entries that copy/paste
|
|
19
|
+
* would never write (`shouldPersistCelldataCell` === false). Runs once per dsheetId
|
|
20
|
+
* after the editor is synced and idle so it does not compete with load or edits.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useCelldataCompaction({ dsheetId, ydocRef, sheetEditorRef, currentDataRef, handleOnChangePortalUpdate, syncStatus, isDataLoaded, isReadOnly, remoteUpdateRef, collabSyncing, }: UseCelldataCompactionArgs): void;
|
|
23
|
+
export {};
|
|
@@ -11,6 +11,7 @@ export type XlsxImportRuntimeDeps = {
|
|
|
11
11
|
updateDocumentTitle?: (title: string) => void;
|
|
12
12
|
filterToastShown: boolean;
|
|
13
13
|
setFilterToastShown: React.Dispatch<React.SetStateAction<boolean>>;
|
|
14
|
+
handleContentPortal?: () => void;
|
|
14
15
|
};
|
|
15
16
|
export type XlsxImportOptions = {
|
|
16
17
|
headless?: boolean;
|
|
@@ -19,4 +20,4 @@ export type XlsxImportOptions = {
|
|
|
19
20
|
generateSheetId?: () => string;
|
|
20
21
|
};
|
|
21
22
|
/** Full XLSX import pipeline; loaded only when user imports a file. */
|
|
22
|
-
export declare function runXlsxFileUpload({ sheetEditorRef, ydocRef, setForceSheetRender, dsheetId, currentDataRef, updateDocumentTitle, filterToastShown, setFilterToastShown, }: XlsxImportRuntimeDeps, event: React.ChangeEvent<HTMLInputElement> | undefined, fileArg: File, importType?: 'new-dsheet' | 'merge-current-dsheet' | 'new-current-dsheet', options?: XlsxImportOptions): Promise<void>;
|
|
23
|
+
export declare function runXlsxFileUpload({ sheetEditorRef, ydocRef, setForceSheetRender, dsheetId, currentDataRef, updateDocumentTitle, filterToastShown, setFilterToastShown, handleContentPortal, }: XlsxImportRuntimeDeps, event: React.ChangeEvent<HTMLInputElement> | undefined, fileArg: File, importType?: 'new-dsheet' | 'merge-current-dsheet' | 'new-current-dsheet', options?: XlsxImportOptions): Promise<void>;
|
|
@@ -7,13 +7,14 @@ type ImportType = 'new-dsheet' | 'merge-current-dsheet' | 'new-current-dsheet';
|
|
|
7
7
|
* XLSX import: keeps ~100k+ LOC (SSF, hyperlink helpers, exceljs/luckyexcel orchestration)
|
|
8
8
|
* in a separate chunk until the user actually imports a file.
|
|
9
9
|
*/
|
|
10
|
-
export declare const useXLSXImport: ({ sheetEditorRef, ydocRef, setForceSheetRender, dsheetId, currentDataRef, updateDocumentTitle, }: {
|
|
10
|
+
export declare const useXLSXImport: ({ sheetEditorRef, ydocRef, setForceSheetRender, dsheetId, currentDataRef, updateDocumentTitle, handleContentPortal, }: {
|
|
11
11
|
sheetEditorRef: RefObject<WorkbookInstance | null>;
|
|
12
12
|
ydocRef: RefObject<Y.Doc | null>;
|
|
13
13
|
setForceSheetRender: Dispatch<SetStateAction<number>>;
|
|
14
14
|
dsheetId: string;
|
|
15
15
|
currentDataRef: MutableRefObject<object | null>;
|
|
16
16
|
updateDocumentTitle?: (title: string) => void;
|
|
17
|
+
handleContentPortal?: () => void;
|
|
17
18
|
}) => {
|
|
18
19
|
handleXLSXUpload: (event: ChangeEvent<HTMLInputElement> | undefined, fileArg: File, importType?: ImportType) => Promise<void>;
|
|
19
20
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { CellMatrix, CellWithRowAndCol, Sheet } from '../../sheet-engine/core/types';
|
|
2
|
+
import { SheetChangePath } from './update-ydoc';
|
|
3
|
+
import * as Y from 'yjs';
|
|
4
|
+
export declare const CELLDATA_COMPACT_STORAGE_KEY_PREFIX = "dsheet-celldata-compact-v1:";
|
|
5
|
+
export type CelldataCompactionResult = {
|
|
6
|
+
removedFromYdoc: number;
|
|
7
|
+
clearedInMemory: number;
|
|
8
|
+
changes: SheetChangePath[];
|
|
9
|
+
};
|
|
10
|
+
export declare function celldataCompactStorageKey(dsheetId: string): string;
|
|
11
|
+
export declare function hasCelldataCompactionCompleted(dsheetId: string): boolean;
|
|
12
|
+
export declare function markCelldataCompactionCompleted(dsheetId: string): void;
|
|
13
|
+
/** Collect Yjs celldata keys that should not be persisted (format-only / empty ghosts). */
|
|
14
|
+
export declare function collectStaleCelldataKeys(celldataMap: Y.Map<unknown> | Record<string, unknown> | null | undefined): string[];
|
|
15
|
+
export declare function buildCelldataDeleteChanges(sheetId: string, keys: string[]): SheetChangePath[];
|
|
16
|
+
/** Null out dense-grid cells that should not be persisted. */
|
|
17
|
+
export declare function compactSheetDataMatrix(data: CellMatrix | null | undefined): number;
|
|
18
|
+
/** Drop sparse celldata entries that should not be persisted. */
|
|
19
|
+
export declare function compactSheetCelldataArray(celldata: CellWithRowAndCol[] | null | undefined): {
|
|
20
|
+
next: CellWithRowAndCol[];
|
|
21
|
+
removed: number;
|
|
22
|
+
};
|
|
23
|
+
export declare function compactInMemorySheets(sheets: Sheet[] | null | undefined): number;
|
|
24
|
+
/**
|
|
25
|
+
* Scan Y.Doc for committed celldata ghosts. Does not mutate — caller applies
|
|
26
|
+
* `changes` via `updateYdocSheetData`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function planYdocCelldataCompaction(ydoc: Y.Doc, dsheetId: string): CelldataCompactionResult;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { WorkbookInstance } from '../../sheet-engine/react';
|
|
2
|
+
import { SheetChangePath } from './update-ydoc';
|
|
3
|
+
|
|
4
|
+
import * as Y from 'yjs';
|
|
5
|
+
/** Diff top-level config sub-keys and emit granular Yjs updates. */
|
|
6
|
+
export declare function buildConfigSubKeyChanges({ sheetId, oldConfig, newConfig, }: {
|
|
7
|
+
sheetId: string;
|
|
8
|
+
oldConfig: Record<string, any>;
|
|
9
|
+
newConfig: Record<string, any>;
|
|
10
|
+
}): SheetChangePath[];
|
|
11
|
+
/**
|
|
12
|
+
* Sync active sheet config sub-keys to Yjs (borderInfo, merge, rowlen, …).
|
|
13
|
+
* Replaces whole-config writes so only changed sub-keys are broadcast.
|
|
14
|
+
*/
|
|
15
|
+
export declare const configYdocUpdate: ({ sheetEditorRef, ydocRef, dsheetId, handleContentPortal, }: {
|
|
16
|
+
sheetEditorRef: React.RefObject<WorkbookInstance | null>;
|
|
17
|
+
ydocRef: React.RefObject<Y.Doc | null>;
|
|
18
|
+
dsheetId: string;
|
|
19
|
+
handleContentPortal?: any;
|
|
20
|
+
}) => void;
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import { Sheet } from '../../sheet-engine/react';
|
|
2
|
-
import
|
|
2
|
+
import { CellFormatRange } from '../../sheet-engine/core/utils/range-format';
|
|
3
|
+
import * as Y from "yjs";
|
|
3
4
|
export type SheetChangePath = {
|
|
4
5
|
sheetId: string;
|
|
5
6
|
path: string[];
|
|
6
7
|
key?: string;
|
|
7
8
|
value: any;
|
|
8
|
-
type?:
|
|
9
|
+
type?: "update" | "delete";
|
|
10
|
+
/**
|
|
11
|
+
* Compaction deletes planned earlier may race with edits across idle chunks.
|
|
12
|
+
* When set, skip the delete if the live celldata entry is now persistable.
|
|
13
|
+
* Do not set on intentional clears — those must always remove the key.
|
|
14
|
+
*/
|
|
15
|
+
skipIfPersistable?: boolean;
|
|
9
16
|
};
|
|
10
|
-
export declare const updateYdocSheetData: (ydoc: Y.Doc | null, dsheetId: string, changes: SheetChangePath[], handleContentPortal: any
|
|
17
|
+
export declare const updateYdocSheetData: (ydoc: Y.Doc | null, dsheetId: string, changes: SheetChangePath[], handleContentPortal: any, onCellFormatRangesCommitted?: (commits: Array<{
|
|
18
|
+
sheetId: string;
|
|
19
|
+
ranges: CellFormatRange[];
|
|
20
|
+
}>) => void) => void;
|
|
11
21
|
export declare function ySheetArrayToPlain(sheetArray: Y.Array<Y.Map>): Sheet[];
|