@fileverse-dev/dsheet 3.0.1-yjs-2 → 3.0.1-yjs-3

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.
@@ -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 {};
@@ -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;
@@ -31987,10 +31987,10 @@ export {
31987
31987
  mp as dT,
31988
31988
  hp as dU,
31989
31989
  zs as dV,
31990
- ep as dW,
31991
- Af as dX,
31992
- gp as dY,
31993
- pp as dZ,
31990
+ Af as dW,
31991
+ gp as dX,
31992
+ pp as dY,
31993
+ ep as dZ,
31994
31994
  Uh as d_,
31995
31995
  xg as da,
31996
31996
  cf as db,
package/dist/formula.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { FLVURL as r } from "@fileverse-dev/formulajs";
2
- import { e as t, f } from "./executeStringFunction-COcGVlOE.js";
2
+ import { e as t, f } from "./executeStringFunction-e269Z0vZ.js";
3
3
  export {
4
4
  r as FLVURL,
5
5
  t as executeStringFunction,