@rowsncolumns/rnc-engine 1.2.17 → 1.2.19
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.
|
@@ -178,6 +178,31 @@ export interface EngineSpreadsheet extends EngineRenderState, EngineSpreadsheetH
|
|
|
178
178
|
* decided NOT to apply the preview: the user rejected the suggestion, or the request failed. A
|
|
179
179
|
* preview the host does apply needs no call; the applying write retires it. */
|
|
180
180
|
clearStreamPreview: () => void;
|
|
181
|
+
/** HOLD cells at what the grid drew before the latest commit, so a host can reveal a batch of
|
|
182
|
+
* changes later (agent replay). Display-only: the document and engine hold the new values
|
|
183
|
+
* throughout, and only the painted accessors (`getCellData`, `getFormattedValue`,
|
|
184
|
+
* `getEffectiveValue`, `getEffectiveExtendedValue`, `getEffectiveFormat`, …) show the held copy.
|
|
185
|
+
* `getUserEnteredValue` / `getUserEnteredExtendedValue` (the editor and formula bar) ignore it.
|
|
186
|
+
* Precedence: held, then stream preview, then committed.
|
|
187
|
+
*
|
|
188
|
+
* The copy is the render state captured when the latest commit BEGAN, so call this right after
|
|
189
|
+
* `engine.applyRemoteUpdate` (synchronously is safest: a later local command or commit moves that
|
|
190
|
+
* point). A cell already held keeps its first copy. Skipped and not counted: a cell with an active
|
|
191
|
+
* stream preview (the chat preview wins), a cell outside the loaded window (windowed mode: it was
|
|
192
|
+
* never drawn), and every cell on a sheet the latest commit changed structurally. A loaded cell
|
|
193
|
+
* that was empty is held blank. Returns how many of `cells` are held after the call.
|
|
194
|
+
*
|
|
195
|
+
* Released by `releaseCells`, by any local command covering the cell (one without ranges, and
|
|
196
|
+
* undo / redo / load / import, release everything), and by a commit that moves the sheet's
|
|
197
|
+
* coordinates: `fullResyncSheets` or a changed merge set. A REMOTE row/column insert or delete is
|
|
198
|
+
* not detectable here (it arrives as a whole-document reprojection); the host calls
|
|
199
|
+
* `releaseCells(sheetId)` for it. */
|
|
200
|
+
holdCells: (sheetId: number, cells: ReadonlyArray<CellInterface>) => number;
|
|
201
|
+
/** Release held cells: no arguments releases everything, a `sheetId` alone releases that sheet,
|
|
202
|
+
* and `ranges` narrows it to the cells inside them. */
|
|
203
|
+
releaseCells: (sheetId?: number, ranges?: GridRange[]) => void;
|
|
204
|
+
/** Whether a cell is held (see `holdCells`). Reads the live hold set, not the rendered one. */
|
|
205
|
+
isCellHeld: (sheetId: number, rowIndex: number, columnIndex: number) => boolean;
|
|
181
206
|
undo: () => void;
|
|
182
207
|
redo: () => void;
|
|
183
208
|
/** Run `action` with every command it issues collected and applied afterwards as ONE `batch` —
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-engine-core.d.ts","sourceRoot":"","sources":["../../src/use-engine-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,aAAa,EACb,QAAQ,EACR,SAAS,EACT,cAAc,EACd,aAAa,EACb,eAAe,EACf,UAAU,EACX,MAAM,4BAA4B,CAAC;AAYpC,OAAO,EACL,KAAK,aAAa,EAIlB,KAAK,qBAAqB,EAI1B,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,cAAc,EAGnB,KAAK,yBAAyB,EAG9B,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,KAAK,EACV,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,SAAS,EAMf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAuBL,KAAK,mBAAmB,EAKzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EAIxB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAEL,KAAK,yBAAyB,EAE/B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,KAAK,iBAAiB,EAQvB,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KA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AAC,qBAAqB,CAAC,CAAC;IAC/C,WAAW,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC;IAC/B,MAAM,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC;IAGrB,kBAAkB,EAAE,qBAAqB,EAAE,CAAC;IAC5C,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,yGAAyG;IACzG,iBAAiB,EAAE,EAAE,CAAC,mBAAmB,CAAC,CAAC;IAC3C,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,+EAA+E;IAC/E,iBAAiB,EAAE,EAAE,CAAC,mBAAmB,CAAC,CAAC;IAC3C,+EAA+E;IAC/E,6BAA6B,EAAE,EAAE,CAAC,+BAA+B,CAAC,CAAC;CACpE;AAMD;;kFAEkF;AAClF,wBAAgB,aAAa,CAC3B,OAAO,EAAE,2BAA2B,GACnC,iBAAiB,CAu6GnB"}
|
|
@@ -39,7 +39,10 @@ const WINDOW_REFRESH_MARGIN_COLS = 2;
|
|
|
39
39
|
* the viewport, but every accessor answering that read (`getUserEnteredValue`, `getTextFormatRuns`,
|
|
40
40
|
* `getCellFormat`, …) resolves through the windowed `getCellData` — so an evicted active cell blanked
|
|
41
41
|
* the formula bar on scroll. A 1×1 range piggybacking on a read that's already crossing into wasm is
|
|
42
|
-
* free; skipped when the cell is inside the window or a frozen band.
|
|
42
|
+
* free; skipped when the cell is inside the window or a frozen band.
|
|
43
|
+
*
|
|
44
|
+
* Returns the ranges read beside their snapshots: they are what the render state holds, which
|
|
45
|
+
* `holdCells` needs to tell a blank cell from one that was never loaded. */
|
|
43
46
|
function readWindowWithFrozenBands(engine, w, frozenRowCount, frozenColumnCount, pinnedCell) {
|
|
44
47
|
const ranges = [w, ...frozenBandRanges(w, frozenRowCount, frozenColumnCount)];
|
|
45
48
|
if (pinnedCell) {
|
|
@@ -58,7 +61,10 @@ function readWindowWithFrozenBands(engine, w, frozenRowCount, frozenColumnCount,
|
|
|
58
61
|
});
|
|
59
62
|
}
|
|
60
63
|
}
|
|
61
|
-
return
|
|
64
|
+
return {
|
|
65
|
+
ranges,
|
|
66
|
+
snapshots: ranges.map((r) => engine.readWindow(r.sheetId, r.startRow, r.startCol, r.endRow, r.endCol)),
|
|
67
|
+
};
|
|
62
68
|
}
|
|
63
69
|
/** Display text for a cell whose custom-function eval is in flight — the same transient
|
|
64
70
|
* placeholder the JS engine's `SheetCell` shows (`LOADING_VALUE`). */
|
|
@@ -132,6 +138,81 @@ function previewFormulaCellData(engine, sheetId, rowIndex, columnIndex, text) {
|
|
|
132
138
|
return { ue: { fv: formula }, ev: { sv }, fv: sv };
|
|
133
139
|
return previewCellData(text);
|
|
134
140
|
}
|
|
141
|
+
/** Whether a cell's coordinates fall inside `range` — one rule for holds and their release. */
|
|
142
|
+
function gridRangeContains(range, rowIndex, columnIndex) {
|
|
143
|
+
return (rowIndex >= range.startRowIndex &&
|
|
144
|
+
rowIndex <= range.endRowIndex &&
|
|
145
|
+
columnIndex >= range.startColumnIndex &&
|
|
146
|
+
columnIndex <= range.endColumnIndex);
|
|
147
|
+
}
|
|
148
|
+
/** `cells` (keyed by {@link cellKey}) without the entries a LOCAL `command` covers: the retirement rule
|
|
149
|
+
* both display-only shadows share, the stream preview and held cells. A `batch` retires what each
|
|
150
|
+
* member covers, `change-theme` covers no cell, and a command without a sheet and `range`/`ranges`
|
|
151
|
+
* to scope it (a structural edit, a write at `coords`, …) retires everything. Returns `cells` itself
|
|
152
|
+
* when nothing is covered, so a caller can skip republishing. */
|
|
153
|
+
function withoutCoveredCells(cells, command) {
|
|
154
|
+
if (command.command === "batch") {
|
|
155
|
+
let next = cells;
|
|
156
|
+
for (const member of command.commands)
|
|
157
|
+
next = withoutCoveredCells(next, member);
|
|
158
|
+
return next;
|
|
159
|
+
}
|
|
160
|
+
const cmd = command;
|
|
161
|
+
if (!cells.size || cmd.command === "change-theme")
|
|
162
|
+
return cells;
|
|
163
|
+
const ranges = cmd.ranges ?? (cmd.range ? [cmd.range] : null);
|
|
164
|
+
if (!ranges?.length || cmd.sheetId == null)
|
|
165
|
+
return new Map();
|
|
166
|
+
let next = null;
|
|
167
|
+
for (const key of cells.keys()) {
|
|
168
|
+
const parsed = parseCellKey(key);
|
|
169
|
+
if (!parsed || parsed.sheetId !== cmd.sheetId)
|
|
170
|
+
continue;
|
|
171
|
+
if (ranges.some((r) => gridRangeContains(r, parsed.rowIndex, parsed.columnIndex))) {
|
|
172
|
+
next ??= new Map(cells);
|
|
173
|
+
next.delete(key);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return next ?? cells;
|
|
177
|
+
}
|
|
178
|
+
/** The effective format the grid drew for `key` in `state`: the cell's own style over its derived
|
|
179
|
+
* format, as `getEffectiveFormat` layers them. */
|
|
180
|
+
function drawnFormat(state, key) {
|
|
181
|
+
const own = state.cellStyles.get(key);
|
|
182
|
+
const derived = state.derivedFormats.get(key);
|
|
183
|
+
if (!derived)
|
|
184
|
+
return own;
|
|
185
|
+
if (!own)
|
|
186
|
+
return derived;
|
|
187
|
+
return { ...derived, ...own };
|
|
188
|
+
}
|
|
189
|
+
const mergeKey = (m) => `${m.startRowIndex}:${m.endRowIndex}:${m.startColumnIndex}:${m.endColumnIndex}`;
|
|
190
|
+
/** The sheets whose coordinates `commit` may have moved, so their held cells are no longer where they
|
|
191
|
+
* were drawn: every sheet in `fullResyncSheets` (a local row/column insert or delete, or the undo of
|
|
192
|
+
* one) and every sheet whose merge set changed against what was drawn (`drawn`). The merge check
|
|
193
|
+
* compares rather than trusting the channel, because a remote sync re-sends a sheet's WHOLE merge list
|
|
194
|
+
* on every commit; for the same reason a remote UNMERGE is not seen (the list just omits it).
|
|
195
|
+
*
|
|
196
|
+
* A remote row/column shift is not seen either: the engine answers it with a whole-document
|
|
197
|
+
* reprojection that carries neither signal, so the host releases that sheet itself. */
|
|
198
|
+
function structurallyChangedSheets(commit, drawn) {
|
|
199
|
+
const changed = new Set(commit.fullResyncSheets ?? []);
|
|
200
|
+
const drawnMerges = new Map();
|
|
201
|
+
for (const m of commit.merges ?? []) {
|
|
202
|
+
if (changed.has(m.sheetId))
|
|
203
|
+
continue;
|
|
204
|
+
let keys = drawnMerges.get(m.sheetId);
|
|
205
|
+
if (!keys) {
|
|
206
|
+
const sheet = drawn.find((s) => s.sheetId === m.sheetId);
|
|
207
|
+
keys = new Set((sheet?.merges ?? []).map(mergeKey));
|
|
208
|
+
drawnMerges.set(m.sheetId, keys);
|
|
209
|
+
}
|
|
210
|
+
const present = keys.has(mergeKey(m));
|
|
211
|
+
if (m.removed ? present : !present)
|
|
212
|
+
changed.add(m.sheetId);
|
|
213
|
+
}
|
|
214
|
+
return changed;
|
|
215
|
+
}
|
|
135
216
|
/** Seed for the parsed facets before the first commit (stable reference). */
|
|
136
217
|
const EMPTY_FACETS = {
|
|
137
218
|
conditionalFormats: [],
|
|
@@ -308,6 +389,56 @@ export function useEngineCore(options) {
|
|
|
308
389
|
// tiny top-left placeholder would leave everything past the first few columns unfetched until a
|
|
309
390
|
// manual scroll. Null until the first viewport report.
|
|
310
391
|
const lastViewportRef = useRef(null);
|
|
392
|
+
// Held cells (see `holdCells`). `loadedRangesRef` is the windowed reads the render state was built
|
|
393
|
+
// from (`null` when not windowed: every cell is resident), recorded at each read. `drawnRef` is
|
|
394
|
+
// what the last render drew, reassigned every render (a reference to the immutable state, no
|
|
395
|
+
// copy). The engine subscriber moves it into `commitBaseRef` when a commit BEGINS, so a hold
|
|
396
|
+
// copies the pre-commit cells even after the commit has rendered.
|
|
397
|
+
const loadedRangesRef = useRef(options.windowed ? [] : null);
|
|
398
|
+
const drawnRef = useRef({
|
|
399
|
+
state,
|
|
400
|
+
ranges: loadedRangesRef.current,
|
|
401
|
+
});
|
|
402
|
+
if (drawnRef.current.state !== state ||
|
|
403
|
+
drawnRef.current.ranges !== loadedRangesRef.current)
|
|
404
|
+
drawnRef.current = { state, ranges: loadedRangesRef.current };
|
|
405
|
+
const commitBaseRef = useRef(null);
|
|
406
|
+
// The held cells themselves: `null` whenever nothing is held, so the painted accessors are the
|
|
407
|
+
// plain ones (see `getCellData`). Immutable: each hold or release publishes a new map, and that
|
|
408
|
+
// identity change is what re-creates the accessors and clears the grid's cell cache.
|
|
409
|
+
const [heldCells, setHeldCells] = useState(null);
|
|
410
|
+
const heldCellsRef = useRef(null);
|
|
411
|
+
const publishHeldCells = useCallback((next) => {
|
|
412
|
+
const value = next?.size ? next : null;
|
|
413
|
+
if (value === heldCellsRef.current)
|
|
414
|
+
return;
|
|
415
|
+
heldCellsRef.current = value;
|
|
416
|
+
setHeldCells(value);
|
|
417
|
+
}, []);
|
|
418
|
+
const structuralSheetsOf = useCallback((base) => {
|
|
419
|
+
if (!base.commit)
|
|
420
|
+
return new Set();
|
|
421
|
+
base.structural ??= structurallyChangedSheets(base.commit, base.state.sheets);
|
|
422
|
+
return base.structural;
|
|
423
|
+
}, []);
|
|
424
|
+
// Release the holds on every sheet whose coordinates the commit that began from `base` moved.
|
|
425
|
+
const releaseHeldOnStructuralCommit = useCallback((base) => {
|
|
426
|
+
const held = heldCellsRef.current;
|
|
427
|
+
if (!held)
|
|
428
|
+
return;
|
|
429
|
+
const sheets = structuralSheetsOf(base);
|
|
430
|
+
if (!sheets.size)
|
|
431
|
+
return;
|
|
432
|
+
let next = null;
|
|
433
|
+
for (const [key, cell] of held) {
|
|
434
|
+
if (!sheets.has(cell.sheetId))
|
|
435
|
+
continue;
|
|
436
|
+
next ??= new Map(held);
|
|
437
|
+
next.delete(key);
|
|
438
|
+
}
|
|
439
|
+
if (next)
|
|
440
|
+
publishHeldCells(next);
|
|
441
|
+
}, [publishHeldCells, structuralSheetsOf]);
|
|
311
442
|
// Live refs for the windowed frozen-band reads (read inside stable callbacks + the mount effect).
|
|
312
443
|
// The host getter is authoritative (a collab host answers from its doc plane); the hook's own folded
|
|
313
444
|
// per-sheet counts are the fallback. Latest-ref pattern: reassigned every render.
|
|
@@ -337,7 +468,9 @@ export function useEngineCore(options) {
|
|
|
337
468
|
const readWindowedSnapshots = useCallback((engine, w) => {
|
|
338
469
|
const host = getWindowFrozenCountsRef.current?.(w.sheetId);
|
|
339
470
|
const sheet = stateSheetsRef.current.find((s) => s.sheetId === w.sheetId);
|
|
340
|
-
|
|
471
|
+
const { ranges, snapshots } = readWindowWithFrozenBands(engine, w, host?.frozenRowCount ?? sheet?.frozenRowCount ?? 0, host?.frozenColumnCount ?? sheet?.frozenColumnCount ?? 0, activeCellBySheetIdRef.current[w.sheetId] ?? DEFAULT_ACTIVE_CELL);
|
|
472
|
+
loadedRangesRef.current = ranges;
|
|
473
|
+
return snapshots;
|
|
341
474
|
}, []);
|
|
342
475
|
// Engine data extents `[sheetId, rowCount, colCount][]` → the grid's scroll extent in windowed mode
|
|
343
476
|
// (so it scrolls the full sheet while JS holds only the window). Empty until the engine reports them.
|
|
@@ -513,6 +646,16 @@ export function useEngineCore(options) {
|
|
|
513
646
|
setState((prev) => foldWindows(prev, snaps));
|
|
514
647
|
};
|
|
515
648
|
unsubscribe = engine.onChanges((commit) => {
|
|
649
|
+
// Before anything folds: what the grid drew when this commit began is what a `holdCells`
|
|
650
|
+
// right after it copies. Then release holds whose sheet this commit moved.
|
|
651
|
+
const drawn = drawnRef.current;
|
|
652
|
+
const base = {
|
|
653
|
+
state: drawn.state,
|
|
654
|
+
ranges: drawn.ranges,
|
|
655
|
+
commit,
|
|
656
|
+
};
|
|
657
|
+
commitBaseRef.current = base;
|
|
658
|
+
releaseHeldOnStructuralCommit(base);
|
|
516
659
|
// Reconcile the tab list with the engine's authoritative sheet set/order/titles after every
|
|
517
660
|
// commit — so create / rename / delete / reorder / hide / color update the tabs (and a new
|
|
518
661
|
// sheet renders). The engine owns lifecycle (it generates `create-sheet` ids), so this can't
|
|
@@ -675,6 +818,7 @@ export function useEngineCore(options) {
|
|
|
675
818
|
};
|
|
676
819
|
const w = windowRef.current;
|
|
677
820
|
const snap = engine.readWindow(w.sheetId, w.startRow, w.startCol, w.endRow, w.endCol);
|
|
821
|
+
loadedRangesRef.current = [w];
|
|
678
822
|
setState((prev) => foldWindow(prev, snap));
|
|
679
823
|
}
|
|
680
824
|
refreshExtents();
|
|
@@ -714,39 +858,11 @@ export function useEngineCore(options) {
|
|
|
714
858
|
const preview = streamPreviewRef.current;
|
|
715
859
|
if (!preview?.size)
|
|
716
860
|
return;
|
|
717
|
-
|
|
718
|
-
if (
|
|
719
|
-
for (const member of command.commands)
|
|
720
|
-
retireStreamPreviewForCommand(member);
|
|
721
|
-
return;
|
|
722
|
-
}
|
|
723
|
-
const cmd = command;
|
|
724
|
-
if (cmd.command === "change-theme")
|
|
725
|
-
return;
|
|
726
|
-
const ranges = cmd.ranges ?? (cmd.range ? [cmd.range] : null);
|
|
727
|
-
if (!ranges?.length || cmd.sheetId == null) {
|
|
728
|
-
streamPreviewRef.current = null;
|
|
729
|
-
setStreamPreview(null);
|
|
861
|
+
const next = withoutCoveredCells(preview, command);
|
|
862
|
+
if (next === preview)
|
|
730
863
|
return;
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
for (const key of Array.from(preview.keys())) {
|
|
734
|
-
const parsed = parseCellKey(key);
|
|
735
|
-
if (!parsed || parsed.sheetId !== cmd.sheetId)
|
|
736
|
-
continue;
|
|
737
|
-
const covered = ranges.some((r) => parsed.rowIndex >= r.startRowIndex &&
|
|
738
|
-
parsed.rowIndex <= r.endRowIndex &&
|
|
739
|
-
parsed.columnIndex >= r.startColumnIndex &&
|
|
740
|
-
parsed.columnIndex <= r.endColumnIndex);
|
|
741
|
-
if (covered) {
|
|
742
|
-
preview.delete(key);
|
|
743
|
-
removed = true;
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
if (!removed)
|
|
747
|
-
return;
|
|
748
|
-
streamPreviewRef.current = preview.size ? preview : null;
|
|
749
|
-
setStreamPreview(preview.size ? new Map(preview) : null);
|
|
864
|
+
streamPreviewRef.current = next.size ? next : null;
|
|
865
|
+
setStreamPreview(next.size ? new Map(next) : null);
|
|
750
866
|
}, []);
|
|
751
867
|
// The committed `fv` a preview is standing on. Read through a ref so the streaming callback
|
|
752
868
|
// (created once) always sees fresh values.
|
|
@@ -754,6 +870,89 @@ export function useEngineCore(options) {
|
|
|
754
870
|
sheetDataRef.current = state.sheetData;
|
|
755
871
|
const committedFvAt = useCallback((sheetId, rowIndex, columnIndex) => sheetDataRef.current?.[sheetId]?.[rowIndex]?.values?.[columnIndex]?.fv ??
|
|
756
872
|
undefined, []);
|
|
873
|
+
// Held cells (see `holdCells` on `EngineSpreadsheet`): a display-only copy of what the grid drew,
|
|
874
|
+
// taken from the render state captured when the latest commit began (`commitBaseRef`).
|
|
875
|
+
const holdCells = useCallback((sheetId, cells) => {
|
|
876
|
+
if (!cells.length)
|
|
877
|
+
return 0;
|
|
878
|
+
const base = commitBaseRef.current ?? drawnRef.current;
|
|
879
|
+
if (structuralSheetsOf(base).has(sheetId))
|
|
880
|
+
return 0;
|
|
881
|
+
const { state: drawn, ranges } = base;
|
|
882
|
+
const preview = streamPreviewRef.current;
|
|
883
|
+
const prev = heldCellsRef.current;
|
|
884
|
+
let next = null;
|
|
885
|
+
const counted = new Set();
|
|
886
|
+
for (const { rowIndex, columnIndex } of cells) {
|
|
887
|
+
const key = cellKey(sheetId, rowIndex, columnIndex);
|
|
888
|
+
if (counted.has(key))
|
|
889
|
+
continue;
|
|
890
|
+
// Already held: it is drawn from its held copy, so keep that one.
|
|
891
|
+
if (prev?.has(key)) {
|
|
892
|
+
counted.add(key);
|
|
893
|
+
continue;
|
|
894
|
+
}
|
|
895
|
+
// Windowed: a cell outside the reads the render state came from was never drawn.
|
|
896
|
+
if (ranges &&
|
|
897
|
+
!ranges.some((r) => r.sheetId === sheetId &&
|
|
898
|
+
rowIndex >= r.startRow &&
|
|
899
|
+
rowIndex <= r.endRow &&
|
|
900
|
+
columnIndex >= r.startCol &&
|
|
901
|
+
columnIndex <= r.endCol))
|
|
902
|
+
continue;
|
|
903
|
+
const data = drawn.sheetData?.[sheetId]?.[rowIndex]?.values?.[columnIndex] ??
|
|
904
|
+
undefined;
|
|
905
|
+
// An active stream preview (the same "until the real value lands" rule `getCellData` uses)
|
|
906
|
+
// wins: the chat preview hands straight over to the committed value.
|
|
907
|
+
const previewEntry = preview?.get(key);
|
|
908
|
+
if (previewEntry && data?.fv === previewEntry.basis)
|
|
909
|
+
continue;
|
|
910
|
+
next ??= new Map(prev ?? undefined);
|
|
911
|
+
next.set(key, {
|
|
912
|
+
sheetId,
|
|
913
|
+
rowIndex,
|
|
914
|
+
columnIndex,
|
|
915
|
+
data,
|
|
916
|
+
format: drawnFormat(drawn, key),
|
|
917
|
+
});
|
|
918
|
+
counted.add(key);
|
|
919
|
+
}
|
|
920
|
+
if (next)
|
|
921
|
+
publishHeldCells(next);
|
|
922
|
+
return counted.size;
|
|
923
|
+
}, [publishHeldCells, structuralSheetsOf]);
|
|
924
|
+
const releaseCells = useCallback((sheetId, ranges) => {
|
|
925
|
+
const held = heldCellsRef.current;
|
|
926
|
+
if (!held)
|
|
927
|
+
return;
|
|
928
|
+
if (sheetId == null) {
|
|
929
|
+
publishHeldCells(null);
|
|
930
|
+
return;
|
|
931
|
+
}
|
|
932
|
+
let next = null;
|
|
933
|
+
for (const [key, cell] of held) {
|
|
934
|
+
if (cell.sheetId !== sheetId)
|
|
935
|
+
continue;
|
|
936
|
+
if (ranges &&
|
|
937
|
+
!ranges.some((r) => gridRangeContains(r, cell.rowIndex, cell.columnIndex)))
|
|
938
|
+
continue;
|
|
939
|
+
next ??= new Map(held);
|
|
940
|
+
next.delete(key);
|
|
941
|
+
}
|
|
942
|
+
if (next)
|
|
943
|
+
publishHeldCells(next);
|
|
944
|
+
}, [publishHeldCells]);
|
|
945
|
+
const isCellHeld = useCallback((sheetId, rowIndex, columnIndex) => heldCellsRef.current?.has(cellKey(sheetId, rowIndex, columnIndex)) ??
|
|
946
|
+
false, []);
|
|
947
|
+
// A local command shows the user what they did: it releases the held cells it covers.
|
|
948
|
+
const releaseHeldForCommand = useCallback((command) => {
|
|
949
|
+
const held = heldCellsRef.current;
|
|
950
|
+
if (!held)
|
|
951
|
+
return;
|
|
952
|
+
const next = withoutCoveredCells(held, command);
|
|
953
|
+
if (next !== held)
|
|
954
|
+
publishHeldCells(next);
|
|
955
|
+
}, [publishHeldCells]);
|
|
757
956
|
// Commands issued while a `batchHistory` action runs, applied together when it returns.
|
|
758
957
|
const batchCommandsRef = useRef(null);
|
|
759
958
|
const onCommand = useCallback((command) => {
|
|
@@ -766,8 +965,9 @@ export function useEngineCore(options) {
|
|
|
766
965
|
}
|
|
767
966
|
// The host's apply (or any other local write) is the authority — retire the preview for the cells
|
|
768
967
|
// it covers in this same render, so the committed value replaces the previewed one with no blank
|
|
769
|
-
// frame in between.
|
|
968
|
+
// frame in between. Held cells it covers are released for the same reason.
|
|
770
969
|
retireStreamPreviewForCommand(command);
|
|
970
|
+
releaseHeldForCommand(command);
|
|
771
971
|
// Remember the last SINGLE formatting action so `onRepeatFormatting` can replay it onto a new
|
|
772
972
|
// target (a 2-D paint-format array is not a repeatable single action, so it's excluded).
|
|
773
973
|
if ((command.command === "change-formatting" &&
|
|
@@ -834,6 +1034,7 @@ export function useEngineCore(options) {
|
|
|
834
1034
|
return commit;
|
|
835
1035
|
}, [
|
|
836
1036
|
retireStreamPreviewForCommand,
|
|
1037
|
+
releaseHeldForCommand,
|
|
837
1038
|
showError,
|
|
838
1039
|
focusEmbedOrChart,
|
|
839
1040
|
setTableAutoExpansion,
|
|
@@ -947,6 +1148,8 @@ export function useEngineCore(options) {
|
|
|
947
1148
|
const engine = engineRef.current;
|
|
948
1149
|
if (!engine)
|
|
949
1150
|
return;
|
|
1151
|
+
// An undo rewrites cells no command range names: show them all.
|
|
1152
|
+
releaseCells();
|
|
950
1153
|
const prevDepth = engine.undoDepth();
|
|
951
1154
|
const commit = engine.undo();
|
|
952
1155
|
if (engine.undoDepth() < prevDepth) {
|
|
@@ -958,11 +1161,12 @@ export function useEngineCore(options) {
|
|
|
958
1161
|
}
|
|
959
1162
|
lastUndoDepth.current = engine.undoDepth();
|
|
960
1163
|
restoreChartSelection(commit);
|
|
961
|
-
}, [applyView, restoreChartSelection]);
|
|
1164
|
+
}, [applyView, restoreChartSelection, releaseCells]);
|
|
962
1165
|
const redo = useCallback(() => {
|
|
963
1166
|
const engine = engineRef.current;
|
|
964
1167
|
if (!engine)
|
|
965
1168
|
return;
|
|
1169
|
+
releaseCells();
|
|
966
1170
|
const prevRedoDepth = engine.redoDepth();
|
|
967
1171
|
const commit = engine.redo();
|
|
968
1172
|
if (engine.redoDepth() < prevRedoDepth) {
|
|
@@ -974,10 +1178,11 @@ export function useEngineCore(options) {
|
|
|
974
1178
|
}
|
|
975
1179
|
lastUndoDepth.current = engine.undoDepth();
|
|
976
1180
|
restoreChartSelection(commit);
|
|
977
|
-
}, [applyView, restoreChartSelection]);
|
|
1181
|
+
}, [applyView, restoreChartSelection, releaseCells]);
|
|
978
1182
|
const load = useCallback((document) => {
|
|
1183
|
+
releaseCells();
|
|
979
1184
|
engineRef.current?.load(document);
|
|
980
|
-
}, []);
|
|
1185
|
+
}, [releaseCells]);
|
|
981
1186
|
/**
|
|
982
1187
|
* Import an `.xlsx` workbook through the native Rust engine, REPLACING the current document (sheets,
|
|
983
1188
|
* cell data, facets, history) — not merging into it. Render state is cleared first so nothing from
|
|
@@ -996,6 +1201,12 @@ export function useEngineCore(options) {
|
|
|
996
1201
|
const commit = engine.importXlsx(bytes);
|
|
997
1202
|
if (!commit)
|
|
998
1203
|
return false;
|
|
1204
|
+
// A replaced document holds nothing from the old one.
|
|
1205
|
+
if (heldCellsRef.current) {
|
|
1206
|
+
heldCellsRef.current = null;
|
|
1207
|
+
setHeldCells(null);
|
|
1208
|
+
}
|
|
1209
|
+
commitBaseRef.current = null;
|
|
999
1210
|
const engineSheets = engine.sheets?.() ?? [];
|
|
1000
1211
|
const seedSheets = engineSheets.map((es) => ({
|
|
1001
1212
|
sheetId: es.sheetId,
|
|
@@ -1034,6 +1245,7 @@ export function useEngineCore(options) {
|
|
|
1034
1245
|
next = foldCommitStructuralOnly(next, commit);
|
|
1035
1246
|
if (windowRef.current) {
|
|
1036
1247
|
const w = windowRef.current;
|
|
1248
|
+
loadedRangesRef.current = [w];
|
|
1037
1249
|
next = foldWindow(next, engine.readWindow(w.sheetId, w.startRow, w.startCol, w.endRow, w.endCol));
|
|
1038
1250
|
}
|
|
1039
1251
|
}
|
|
@@ -1142,7 +1354,9 @@ export function useEngineCore(options) {
|
|
|
1142
1354
|
setSelectionsBySheetId(next);
|
|
1143
1355
|
}, []);
|
|
1144
1356
|
const { sheetData, cellStyles, derivedFormats, notes } = state;
|
|
1145
|
-
|
|
1357
|
+
// The cell beneath any hold: the stream preview, else the committed cell. What the editor and the
|
|
1358
|
+
// formula bar read (`getUserEnteredValue` / `getUserEnteredExtendedValue`).
|
|
1359
|
+
const getUnheldCellData = useCallback((sheetId, rowIndex, columnIndex) => {
|
|
1146
1360
|
const committed = sheetData?.[sheetId]?.[rowIndex]?.values?.[columnIndex] ?? undefined;
|
|
1147
1361
|
// A previewing stream shadows the committed cell — until the real value lands, which is any
|
|
1148
1362
|
// change to what was committed when the preview was painted (`basis`). That covers a local
|
|
@@ -1152,12 +1366,23 @@ export function useEngineCore(options) {
|
|
|
1152
1366
|
return preview.data;
|
|
1153
1367
|
return committed;
|
|
1154
1368
|
}, [sheetData, streamPreview]);
|
|
1369
|
+
// The painted cell: a held cell first (see `holdCells`). With nothing held this IS
|
|
1370
|
+
// `getUnheldCellData`, so the common case pays nothing; a hold or release swaps the identity, which
|
|
1371
|
+
// is what clears the grid's cell cache.
|
|
1372
|
+
const getCellData = useMemo(() => heldCells
|
|
1373
|
+
? (sheetId, rowIndex, columnIndex) => {
|
|
1374
|
+
const held = heldCells.get(cellKey(sheetId, rowIndex, columnIndex));
|
|
1375
|
+
return held
|
|
1376
|
+
? held.data
|
|
1377
|
+
: getUnheldCellData(sheetId, rowIndex, columnIndex);
|
|
1378
|
+
}
|
|
1379
|
+
: getUnheldCellData, [heldCells, getUnheldCellData]);
|
|
1155
1380
|
// Stable-identity cache for the user⊕derived merge: a 2-level `WeakMap<userFmt, WeakMap<derivedFmt,
|
|
1156
1381
|
// merged>>`, so the SAME merged object is returned across renders unless an input actually changes.
|
|
1157
1382
|
// Mirrors `use-sheet-properties`'s `getEffectiveFormat`, keeping the grid from re-rendering on
|
|
1158
1383
|
// identity churn. GC-friendly: keyed on the format objects themselves (no manual eviction).
|
|
1159
1384
|
const mergedFormatCache = useRef(new WeakMap());
|
|
1160
|
-
const
|
|
1385
|
+
const getUnheldEffectiveFormat = useCallback((sheetId, rowIndex, columnIndex) => {
|
|
1161
1386
|
const key = cellKey(sheetId, rowIndex, columnIndex);
|
|
1162
1387
|
// The cell's OWN consolidated style. Conditional formatting is NOT layered here — CanvasGrid
|
|
1163
1388
|
// computes it from the rules (`useConditionalFormatting`); CF overlays don't ride on the format.
|
|
@@ -1189,6 +1414,15 @@ export function useEngineCore(options) {
|
|
|
1189
1414
|
}
|
|
1190
1415
|
return merged;
|
|
1191
1416
|
}, [cellStyles, derivedFormats, streamPreview, sheetData]);
|
|
1417
|
+
// A held cell's drawn format first, under the same zero-cost rule as `getCellData`.
|
|
1418
|
+
const getEffectiveFormat = useMemo(() => heldCells
|
|
1419
|
+
? (sheetId, rowIndex, columnIndex) => {
|
|
1420
|
+
const held = heldCells.get(cellKey(sheetId, rowIndex, columnIndex));
|
|
1421
|
+
return held
|
|
1422
|
+
? held.format
|
|
1423
|
+
: getUnheldEffectiveFormat(sheetId, rowIndex, columnIndex);
|
|
1424
|
+
}
|
|
1425
|
+
: getUnheldEffectiveFormat, [heldCells, getUnheldEffectiveFormat]);
|
|
1192
1426
|
const getNote = useCallback((sheetId, rowIndex, columnIndex) => notes.get(cellKey(sheetId, rowIndex, columnIndex)), [notes]);
|
|
1193
1427
|
const getFormattedValue = useCallback((sheetId, rowIndex, columnIndex) => {
|
|
1194
1428
|
const cell = getCellData(sheetId, rowIndex, columnIndex);
|
|
@@ -1264,7 +1498,8 @@ export function useEngineCore(options) {
|
|
|
1264
1498
|
return ev;
|
|
1265
1499
|
}, [getCellData]);
|
|
1266
1500
|
const getUserEnteredValue = useCallback((sheetId, rowIndex, columnIndex) => {
|
|
1267
|
-
|
|
1501
|
+
// Ignores holds: the editor and formula bar open on the real value.
|
|
1502
|
+
const ue = getUnheldCellData(sheetId, rowIndex, columnIndex)?.ue;
|
|
1268
1503
|
if (!ue)
|
|
1269
1504
|
return undefined;
|
|
1270
1505
|
if (ue.fv != null)
|
|
@@ -1274,13 +1509,13 @@ export function useEngineCore(options) {
|
|
|
1274
1509
|
if (ue.bv != null)
|
|
1275
1510
|
return ue.bv ? "TRUE" : "FALSE";
|
|
1276
1511
|
return ue.sv ?? undefined;
|
|
1277
|
-
}, [
|
|
1512
|
+
}, [getUnheldCellData]);
|
|
1278
1513
|
const getHyperlink = useCallback((sheetId, rowIndex, columnIndex) => getCellData(sheetId, rowIndex, columnIndex)?.hyperlink, [getCellData]);
|
|
1279
1514
|
// ── Additional cell accessors (mirror useSheetProperties / useSpreadsheetState, typed via SS) ──
|
|
1280
1515
|
// Rich-text runs ride on the cell (`textFormatRuns`, emitted by the engine from the imported
|
|
1281
1516
|
// rich shared string). Surface them so the grid renders mixed in-cell formatting.
|
|
1282
1517
|
const getTextFormatRuns = useCallback((sheetId, rowIndex, columnIndex) => getCellData(sheetId, rowIndex, columnIndex)?.textFormatRuns, [getCellData]);
|
|
1283
|
-
const getUserEnteredExtendedValue = useCallback((sheetId, rowIndex, columnIndex) =>
|
|
1518
|
+
const getUserEnteredExtendedValue = useCallback((sheetId, rowIndex, columnIndex) => getUnheldCellData(sheetId, rowIndex, columnIndex)?.ue, [getUnheldCellData]);
|
|
1284
1519
|
const getUserEnteredFormat = useCallback((sheetId, rowIndex, columnIndex) => cellStyles.get(cellKey(sheetId, rowIndex, columnIndex)), [cellStyles]);
|
|
1285
1520
|
const getErrorValue = useCallback((sheetId, rowIndex, columnIndex) => {
|
|
1286
1521
|
const cell = getCellData(sheetId, rowIndex, columnIndex);
|
|
@@ -2671,6 +2906,9 @@ export function useEngineCore(options) {
|
|
|
2671
2906
|
onRequestAddRows,
|
|
2672
2907
|
onChangeBatchStream,
|
|
2673
2908
|
clearStreamPreview,
|
|
2909
|
+
holdCells,
|
|
2910
|
+
releaseCells,
|
|
2911
|
+
isCellHeld,
|
|
2674
2912
|
onDeleteDataValidationRules,
|
|
2675
2913
|
onCopy,
|
|
2676
2914
|
onPaste,
|
|
@@ -2779,6 +3017,9 @@ export function useEngineCore(options) {
|
|
|
2779
3017
|
onUpdateSheet,
|
|
2780
3018
|
onChangeBatchStream,
|
|
2781
3019
|
clearStreamPreview,
|
|
3020
|
+
holdCells,
|
|
3021
|
+
releaseCells,
|
|
3022
|
+
isCellHeld,
|
|
2782
3023
|
onRequestAddRows,
|
|
2783
3024
|
onDeleteDataValidationRules,
|
|
2784
3025
|
onClearHistory,
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rowsncolumns/rnc-engine",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.19",
|
|
4
4
|
"author": "Vinay M",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"description": "Typed JS/TS interop for the Rust→WASM spreadsheet calc engine (rnc-wasm). Ergonomic JSON-in/out wrapper over the wasm-bindgen surface: applyCommand(Command)→CommitResult, readWindow→WindowSnapshot, and Map<\"sheet!A1\",CellFormat> style folding. Pluggable backend — single-user `SpreadsheetEngine` (default) or collaborative `CollabSpreadsheetEngine` (Yjs sync) — plus the Option-B `useSpreadsheetEngine` React hook.",
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@rowsncolumns/common-types": ">=5.3.3",
|
|
53
53
|
"@rowsncolumns/dag": ">=7.2.31",
|
|
54
|
-
"@rowsncolumns/grid": ">=13.2.
|
|
55
|
-
"@rowsncolumns/spreadsheet": ">=10.5.
|
|
56
|
-
"@rowsncolumns/spreadsheet-state": ">=29.1.
|
|
57
|
-
"@rowsncolumns/toolkit": ">=24.5.
|
|
54
|
+
"@rowsncolumns/grid": ">=13.2.36",
|
|
55
|
+
"@rowsncolumns/spreadsheet": ">=10.5.3",
|
|
56
|
+
"@rowsncolumns/spreadsheet-state": ">=29.1.11",
|
|
57
|
+
"@rowsncolumns/toolkit": ">=24.5.15",
|
|
58
58
|
"@rowsncolumns/utils": ">=9.5.4",
|
|
59
59
|
"fflate": "^0.8.2"
|
|
60
60
|
}
|