@fileverse-dev/dsheet 3.0.1-yjs-1 → 3.0.1-yjs-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.
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import { C as s, a as t, b as o, S as l, d as r, i as n, e as d, T as c, f as i, g as S, h, j as m, k as p, l as C, n as u, o as E, p as g, q as F, s as x, t as R, u as f, v as A, w as L, x as w, z as I, A as T, B as v, D, E as M } from "./index-C7kCuqoG.js";
2
- import { ce as V, cf as X, cg as b, cl as z, bd as P, e as U, f as _, l as y, a as B, cW as O, cX as Y, aY as j, cY as G, cZ as H, d1 as J, d2 as Z, d4 as q, D as K, di as N, dJ as W, aR as Q } from "./executeStringFunction-B2qjYgmE.js";
1
+ import { C as s, a as t, b as o, S as l, d as r, i as n, e as d, T as c, f as i, g as S, h, j as m, k as p, l as C, n as u, o as E, p as g, q as F, s as x, t as R, u as f, v as A, w as L, x as w, z as I, A as T, B as v, D, E as M } from "./index-BBy6z-oo.js";
2
+ import { ce as V, cf as X, cg as b, cl as z, bd as P, e as U, f as _, l as y, a as B, cW as O, cX as Y, aY as j, cY as G, cZ as H, d1 as J, d2 as Z, d4 as q, D as K, di as N, dJ as W, aR as Q } from "./executeStringFunction-COcGVlOE.js";
3
3
  import { FLVURL as ee } from "@fileverse-dev/formulajs";
4
4
  import { E as se, S as te } from "./constants-Cdz6oSCq.js";
5
5
  export {
@@ -1,8 +1,10 @@
1
1
  import { Context } from '../context';
2
2
 
3
+ /** Drop cached dense-sheet set (e.g. after structural workbook changes). */
4
+ export declare function invalidateSheetsRequiredDenseCache(): void;
3
5
  /**
4
6
  * Sheets that must keep dense `data` while `activeSheetId` is active:
5
- * the active tab plus any tab referenced by its formulas (deps graph + text scan).
7
+ * the active tab, tabs its formulas read, and tabs with formulas that read it.
6
8
  */
7
9
  export declare function getSheetsRequiredDense(ctx: Context, activeSheetId: string): Set<string>;
8
10
  /** Sheets the formula worker needs dense — active refs plus any tab with formulas. */
@@ -23,7 +23,7 @@ export type Hooks = {
23
23
  cellDataChange?: () => void;
24
24
  hyperlinkChange?: () => void;
25
25
  updateCellYdoc?: (changes: SheetChangePath[]) => void;
26
- updateAllCell?: (sheetId: string) => void;
26
+ updateAllCell?: (sheetId: string, caller?: string) => void;
27
27
  beforeUpdateCell?: (r: number, c: number, value: any) => boolean;
28
28
  /** Clears RTC remote-apply lock so local edits can run data-block formulas. */
29
29
  onLocalCellEdit?: () => void;
@@ -0,0 +1,40 @@
1
+ import { Context } from '../context';
2
+ import { Cell, CellWithRowAndCol } from '../types';
3
+
4
+ export type CelldataYdocChange = {
5
+ sheetId: string;
6
+ path: string[];
7
+ key?: string;
8
+ value: any;
9
+ type?: 'update' | 'delete';
10
+ };
11
+ /** Cheap equality before deep compare — hot path for structural diffs. */
12
+ export declare function cellsEqualForYdocPersist(before: unknown, after: unknown): boolean;
13
+ /**
14
+ * Snapshot persisted cells in a range.
15
+ * Prefer sparse `celldata` when provided — O(populated cells), not O(range area).
16
+ */
17
+ export declare function snapshotPersistedCelldataInRange(data: unknown[][] | null | undefined, r1: number, r2: number, c1: number, c2: number, celldata?: CellWithRowAndCol[] | null): Map<string, Cell | string | number | boolean>;
18
+ export declare function appendCelldataDiffChange(changes: CelldataYdocChange[], sheetId: string, r: number, c: number, cell: unknown, beforePersisted?: Map<string, Cell | string | number | boolean>): void;
19
+ export declare function buildCelldataChangesForRange(sheetId: string, data: unknown[][], r1: number, r2: number, c1: number, c2: number, beforePersisted?: Map<string, Cell | string | number | boolean>): CelldataYdocChange[];
20
+ export declare function emitCelldataRangeDiffToYdoc(ctx: Context, sheetId: string, data: unknown[][], r1: number, r2: number, c1: number, c2: number, beforePersisted?: Map<string, Cell | string | number | boolean>): void;
21
+ export type MergeBounds = {
22
+ minR: number;
23
+ minC: number;
24
+ maxR: number;
25
+ maxC: number;
26
+ };
27
+ /** Disturbed range for insert row/col — snapshot only rows/cols that may shift. */
28
+ export declare function getInsertRowColSnapshotBounds(type: 'row' | 'column', index: number, direction: 'lefttop' | 'rightbottom', rowCount: number, colCount: number, mergeBounds: MergeBounds | null): {
29
+ r1: number;
30
+ r2: number;
31
+ c1: number;
32
+ c2: number;
33
+ };
34
+ /** Disturbed range for delete row/col — from deletion point to sheet edge. */
35
+ export declare function getDeleteRowColSnapshotBounds(type: 'row' | 'column', start: number, rowCount: number, colCount: number, mergeBounds: MergeBounds | null): {
36
+ r1: number;
37
+ r2: number;
38
+ c1: number;
39
+ c2: number;
40
+ };
@@ -1,6 +1,6 @@
1
- import { g as Qe } from "./executeStringFunction-B2qjYgmE.js";
1
+ import { g as Qe } from "./executeStringFunction-COcGVlOE.js";
2
2
  import * as Ke from "yjs";
3
- import { m as et, y as tt, r as rt } from "./index-C7kCuqoG.js";
3
+ import { m as et, y as tt, r as rt } from "./index-BBy6z-oo.js";
4
4
  import { n as nt } from "./xlsx-hyperlink-inline-DzewAypN.js";
5
5
  import { toast as Ye } from "@fileverse/ui";
6
6
  var Xe = { exports: {} };
@@ -2,8 +2,8 @@ import { utils as ht, write as Nt } from "xlsx-js-style";
2
2
  import { Workbook as Pt } from "exceljs";
3
3
  import { toast as Ut } from "@fileverse/ui";
4
4
  import { addFortuneImagesToWorksheet as Lt } from "./xlsx-image-utils-Cvg0qxRA.js";
5
- import { g as jt, c as xt, b as Wt } from "./executeStringFunction-B2qjYgmE.js";
6
- import { c as Ct } from "./index-C7kCuqoG.js";
5
+ import { g as jt, c as xt, b as Wt } from "./executeStringFunction-COcGVlOE.js";
6
+ import { c as Ct } from "./index-BBy6z-oo.js";
7
7
  import { c as zt, g as Mt } from "./xlsx-hyperlink-inline-DzewAypN.js";
8
8
  const Zt = {
9
9
  1: "thin",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/dsheet",
3
3
  "private": false,
4
4
  "description": "DSheet",
5
- "version": "3.0.1-yjs-1",
5
+ "version": "3.0.1-yjs-2",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {
@@ -1,26 +0,0 @@
1
- export type PackagePublishTraceEvent = {
2
- kind: 'package-onChange';
3
- dsheetId: string;
4
- traceId: number;
5
- step: string;
6
- ms: number;
7
- heapMB: number | null;
8
- meta?: Record<string, unknown>;
9
- outcome?: 'complete' | 'skipped';
10
- };
11
- declare global {
12
- interface Window {
13
- __publishTraceEnabled?: () => boolean;
14
- __publishTraceSink?: (event: PackagePublishTraceEvent) => void;
15
- }
16
- }
17
- export declare class PackagePublishTrace {
18
- private readonly dsheetId;
19
- private last;
20
- private traceId;
21
- private finished;
22
- constructor(dsheetId: string);
23
- mark(step: string, meta?: Record<string, unknown>): void;
24
- finish(meta?: Record<string, unknown>): void;
25
- skip(reason: string, meta?: Record<string, unknown>): void;
26
- }