@fileverse-dev/dsheet 2.0.36-rtc-3 → 2.0.36-rtc-5

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,4 +1,4 @@
1
- import { S as s, a as l, i as o, T as t, b as r, d as n, e as d, h as S, f as h, g as i, j as c, k as m, l as C, n as p, o as E, p as x, q as F, r as g, s as R, t as f, u as L, v as b, w as u, x as T, z as A } from "./index-5LUHnjpo.js";
1
+ import { S as s, a as l, i as o, T as t, b as r, d as n, e as d, h as S, f as h, g as i, j as c, k as m, l as C, n as p, o as E, p as x, q as F, r as g, s as R, t as f, u as L, v as b, w as u, x as T, z as A } from "./index-B0uH_dM4.js";
2
2
  import { bL as w, bM as k, bN as V, bR as z, bb as M, e as X, f as _, h as j, a as v, cc as y, aq as P, cj as U } from "./executeStringFunction-F9mb-SpN.js";
3
3
  import { FLVURL as D } from "@fileverse-dev/formulajs";
4
4
  import { E as H, S as N } from "./constants-yStXQJiK.js";
@@ -6,6 +6,27 @@ export declare function getCellValue(ctx: Context, row: number, column: number,
6
6
  type?: keyof Cell;
7
7
  }): any;
8
8
  export declare function setCellValue(ctx: Context, row: number, column: number, value: any, cellInput: HTMLDivElement | null, options?: CommonOptions, callAfterUpdate?: boolean): void;
9
+ /**
10
+ * Apply a cell value coming from a remote RTC peer, verbatim.
11
+ *
12
+ * This differs from `setCellValue` in two important ways and must be used for
13
+ * every Yjs-driven remote apply:
14
+ *
15
+ * 1. It NEVER runs the formula engine and NEVER fires the local-edit hooks
16
+ * (`onLocalCellEdit` / `afterUpdateCell`). The peer already computed the
17
+ * value, so we use the synced `v`/`m`/`f` as-is. This avoids both
18
+ * recomputation divergence and an update loop back into Yjs.
19
+ *
20
+ * 2. It PRESERVES the formula calc list. The regular `setCellValue` object
21
+ * branch calls `delFunctionGroup`, which removes the cell from `calcChain`
22
+ * and strips its dependency edges. Because `execFunctionGroup` walks
23
+ * `calcChain` to decide what to recompute, dropping a formula cell there
24
+ * permanently breaks its reactivity on that client (even after RTC stops).
25
+ * Here we instead keep formula cells registered via
26
+ * `insertUpdateFunctionGroup`, so they stay reactive to future local edits
27
+ * on both owner and peer.
28
+ */
29
+ export declare function applyRemoteCellValue(ctx: Context, row: number, column: number, value: any, options?: CommonOptions): void;
9
30
  export declare function clearCell(ctx: Context, row: number, column: number, options?: CommonOptions): void;
10
31
  export declare function setCellFormat(ctx: Context, row: number, column: number, attr: keyof Cell, value: any, options?: CommonOptions): void;
11
32
  export declare function autoFillCell(ctx: Context, copyRange: SingleRange, applyRange: SingleRange, direction: 'up' | 'down' | 'left' | 'right'): void;
@@ -19,6 +19,17 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
19
19
  setCellValue: (row: number, column: number, value: any, options?: api.CommonOptions & {
20
20
  type?: keyof Cell;
21
21
  }, callAfterUpdate?: boolean) => void;
22
+ /**
23
+ * Apply a cell value coming from a remote RTC peer, verbatim.
24
+ *
25
+ * Use this (instead of `setCellValue`) for every Yjs-driven remote apply:
26
+ * it writes the synced value/formula as-is without running the formula
27
+ * engine and without firing local-edit hooks, while keeping formula cells
28
+ * registered in `calcChain` so they remain reactive to future local edits.
29
+ */
30
+ applyRemoteCellValue: (row: number, column: number, value: any, options?: api.CommonOptions & {
31
+ type?: keyof Cell;
32
+ }) => void;
22
33
  setCellError: (row: number, column: number, errorMessage: {
23
34
  title: string;
24
35
  message: string;
@@ -23,6 +23,9 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
23
23
  setCellValue: (row: number, column: number, value: any, options?: api.CommonOptions & {
24
24
  type?: keyof import('../../../core').Cell;
25
25
  }, callAfterUpdate?: boolean) => void;
26
+ applyRemoteCellValue: (row: number, column: number, value: any, options?: api.CommonOptions & {
27
+ type?: keyof import('../../../core').Cell;
28
+ }) => void;
26
29
  setCellError: (row: number, column: number, errorMessage: {
27
30
  title: string;
28
31
  message: string;