@ai-matrx/office 0.5.3 → 0.7.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.0
4
+
5
+ New `./collab/sheets-transform` entry: the co-editing transformer for workbook edits (COLLAB-DESIGN unit C5a). Pure functions, no runtime wiring: nothing calls it until the Sheets flip (C6).
6
+
7
+ - `transformGroup(x, y, side)` rewrites command group `x` to apply after `y`. The later-committed op takes `"left"`: it wins overwrites and sits first on position ties. It returns `{ op, lost, dropped }` or a `Barrier`. `sheetTransformer` is the same thing as an `OpTransformer` for the C2 session.
8
+ - Covered: cell values and styles (`set-range-values`; style keys and border sides merge per key), row and column insert, remove and move, merge and unmerge (including the merge fixups structural commands emit), row height, auto-height and column width, worksheet name.
9
+ - `SHEET_MUTATIONS` classifies all 116 mutation ids Univer 1.0.4 can emit into a workbook: 14 covered (with params allowlists), 26 never travel, 76 barriers (sort, row/column counts, sheet order, cut-paste, sheet-level settings and visibility are X; formulas wait for C5b, ranged resources for C5c). A census test fails on any unclassified or stale id. Regenerate the census with `node scripts/census-sheet-mutations.mjs` after a Univer bump.
10
+ - Two capture rules for C6, enforced as barriers when broken. `completeCellContent(entry, postCell)` must complete every content write from the sender's post-state. `exactMergeRemovals(group, mergesBefore)` must replace unmerge selections with the exact merges they remove.
11
+ - `lost` names parts of the other op this one overrode, for the other author's notice. `dropped` names parts of this op that cannot apply, for its own author's notice.
12
+ - Evidence: a pairwise TP1 fuzz over 13 command families (91 pairs), on shapes captured from real Univer 1.0.4 commands and judged by the canonical state hash. 4,000 seeds per pair, both commit orders: 728,000 checks, 0 divergences, 0 throws. Moves of partly overlapping blocks return a barrier: 1,540 of 8,000 row-move pairs and 1,478 of 8,000 column-move pairs. Reproduce with `SHEET_FUZZ_SEEDS=4000 pnpm vitest run src/collab/sheets/transform/sheet-transform-fuzz.test.ts`; the default test run uses 150 seeds.
13
+
14
+ New dependency `@univerjs/sheets` 1.0.4 (for its range helper). `@univerjs/engine-formula` and `@univerjs/engine-render` are dev-only, for the headless test seats.
15
+
16
+ ### Consumer action
17
+
18
+ None. The entry is inert until C6 wires it.
19
+
20
+ ## 0.6.1
21
+
22
+ Fix: the collab room relayed two things it must not. (1) Mutations Univer marks `onlyLocal` (formula-engine recalculation results, which every seat computes itself) were logged and sent, so every recalculation became network traffic. (2) The sender's view-only params (`layoutState`, `textRanges`, `prevTextRanges`) travelled with a document edit and the receiver restored the sender's layout and caret. Both now stay home, for Docs and Workbooks (one session). `DocumentModel` passes Univer's execution options to its collab listeners. New exports from the collab session: `stripSenderView`, `SENDER_VIEW_PARAMS`.
23
+
24
+ ## 0.6.0
25
+
26
+ Fix: two-seat co-editing corrupted the saved document on reload. Live, both screens showed the same clean text; after a reload the stored version showed it twice or interleaved, and the next reload scrambled it further. Cause: the Docs model never trimmed the room's shared mutation log, so a reloading seat booted from the newest saved snapshot (which already held every edit) and then replayed the whole log on top of it; it then saved that. Workbooks trimmed the log by POSITION after the save, which could drop an entry that arrived while the save was in flight, and a seat that read a snapshot older than the trim lost edits.
27
+
28
+ - Every room entry has an id (`eid`). A saved snapshot names the entries it holds (`stampCovered`; read back with `takeCovered`, both also on `./univer`, no Yjs), and a session given `base` never replays them.
29
+ - `WorkbookCollabSession.coveredNow()` (read with the body you save) and `checkpoint(snapshotId, covered)` (the elected saver, after the save lands) replace `compactLog(upTo)`: entries leave the log by id, never by position, and the room records its newest checkpoint.
30
+ - Join-time sync: a seat that booted from a snapshot older than the room's newest checkpoint reloads the newest one (`base.reload`) before applying the log.
31
+ - `DocumentModel` stamps and checkpoints its saves; `DocumentCollabFactory` receives the `base` as a 4th argument and `DocumentCollabHandle` gains `coveredNow` and `checkpoint`.
32
+
33
+ Known, not fixed here: two seats typing within the same relay window (a few seconds) still diverge — mutations carry offsets computed on the sender's body and are applied without transformation.
34
+
35
+ ### Consumer action
36
+
37
+ Document editor: pass the factory's `base` to `new WorkbookCollabSession({ base })` and return `coveredNow` / `checkpoint` from the handle; elect with `electHost({ tabTieBreak: true })` so one tab saves. Workbook editor: read `coveredNow()` right before `workbook.save()`, save `stampCovered(snapshot, covered)`, then `checkpoint(rowId, covered)` when host (replaces `logLength` + `compactLog`); load every snapshot through `takeCovered` and pass `base` (`snapshotId`, `covered`, `reload`).
38
+
3
39
  ## 0.5.3
4
40
 
5
41
  New `./docs/host` entry: the Docs host ports alone (`configureDocsHost`, `getDocsHost`, `DocsHostPorts`, `DocsSupabase`). It imports nothing heavy, so a start-up module can register the host without pulling the document engine (Univer, lodash-es, rxjs, mammoth) into first load. `./docs` still re-exports the same functions; both share one `globalThis` slot.